Re: Including C source in GNAT project for building library



Simon Wright <simon.j.wright@xxxxxxx> writes:

As well as Ada source, this library needs two C-sourced units to act
as wrappers for macros in the Tcl/Tk header files.

I can do this by hand (obviously only for a static library) by doing
this after gnatmake has done its part:

gcc -c -g -O2 -I/usr/include tclmacro.c
gcc -c -g -O2 -I/usr/include tkmacro.c
ar -r lib/libtash.a tclmacro.o tkmacro.o
ranlib lib/libtash.a

but can't help feeling there should be a way to tell gnatmake to do
this!

OK, this seems to work:

gprmake -P build_tash_library.gpr
gnatmake -P build_tash_library.gpr

because gnatmake includes all the objects it finds in the object
directory in the resulting library.

Is this The Way?
.