I am trying to build a static library using gprbuild. The library does not have a main (which is written in C and linked in later stage) and must be self contained as far as I understand the gpr term for this is "stand-alone" which means, it will not be required to link with anything including the runtime during it's run-time.
My gpr looks like this
project Ada_Foo_Lib is
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Library_Dir use "lib";
for Library_Name use "ada_foo_lib";
for Library_Kind use "static";
package Binder is
for Default_Switches("Ada") use ("-n");
for Required_Switches ("Ada") use ("-n");
end Binder;
end Ada_Foo_Lib;
When I run gprbuild, I see in the log that does not include a call to the binder:
gnatmake -Pada_foo_lib.gpr --create-missing-dirs
gcc-4.9 -c -I- -gnatA /home/temp/src/ada_foo_pack.adb
building static library for project ada_foo_lib
ar cr /home/temp/lib/libada_foo_lib.a /home/temp/obj/ada_foo_pack.o
ranlib /home/temp/lib/libada_foo_lib.a
My problem is that resulting libada_foo_lib.a
does not have adainit
and adafinal
exported. I tried to link it and also verified with an objdump
.
I tried all kinds of combinations of switches but nothing made the binder to be called, unless I changed to Library_Kind
to dynamic
and use Library_Standalone
: