Skip to content

split rts headers into public and private

C code calling into the rts, eg to initialise it, uses header files like HsFFI.h or RtsAPI.h. However these header files that describe the public API of the rts are installed in $libdir/ghc-x.y/include where as the standard location for public header files should be $prefix/include/ghc-x.y.

The private header files that are only used by .hc files when compiling -fvia-C should remain where they are. So this would involve identifying which headers are public and which are private.

Once we have a set of public header files it might be nice to provide a pkg-config .pc file to make it easy for C programs to locate the header files and libraries. Eg it should be possible to compile and link a C program that uses the RTS public API with just:

gcc -o main main.c `pkg-config --cflags --libs ghc-rts-6.12.1`

and this would supply the flags like

-I/usr/include/ghc-6.12.1 -lHSrts -L/usr/lib/ghc-6.12.1

Note that pkg-config supports both shared and static libs (ie allows specifying the extra private deps of a static lib, eg -lm -ldl etc).

Trac metadata
Trac field Value
Version 6.10.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information