Opened 8 years ago

Last modified 21 months ago

#3251 new task

split rts headers into public and private

Reported by: duncan Owned by:
Priority: lowest Milestone:
Component: Runtime System Version: 6.10.2
Keywords: Cc: simonmar
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

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).

Change History (14)

comment:1 Changed 8 years ago by igloo

difficulty: Unknown
Milestone: 6.12 branch

comment:2 Changed 7 years ago by igloo

Milestone: 6.12 branch6.12.3

comment:3 Changed 7 years ago by igloo

Milestone: 6.12.36.14.1
Priority: normallow

comment:4 Changed 7 years ago by igloo

Milestone: 7.0.17.0.2

comment:5 Changed 7 years ago by igloo

Milestone: 7.0.27.2.1

comment:6 Changed 6 years ago by igloo

Milestone: 7.2.17.4.1

comment:7 Changed 6 years ago by igloo

Milestone: 7.4.17.6.1
Priority: lowlowest

comment:8 Changed 5 years ago by igloo

Milestone: 7.6.17.6.2

comment:9 Changed 3 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:10 Changed 3 years ago by thomie

Cc: simonmar added
Type: feature requesttask
Type of failure: None/Unknown

comment:11 Changed 3 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:12 Changed 3 years ago by thoughtpolice

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:13 Changed 2 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:14 Changed 21 months ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.