split rts headers into public and private
C code calling into the rts, eg to initialise it, uses header files like
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
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
pkg-config supports both shared and static libs (ie allows specifying the extra private deps of a static lib, eg
-lm -ldl etc).