Ludovic Brenta wrote:
/usr/lib/gcc/x86_64-linux-gnu/4.1.2/adalib/libgnarl.a
and I really don't think you need libpython2.4.a or anything else.
The reason why you need static Ada libraries and nothing else is
because all Ada libraries are linked dynamically against
libgnat-4.1.so; if you replace it with a static version then you also
need to replace the dependent libraries with static versions.
We explicitly add "-lpython2.4" at the end of the linker section.
libgps.a depends on python so we have to link against it. So in order
to link the application with "-static".
Gnatlink itself is what appears to be adding '-lgnarl-4.1' to
(ultimately) the ld command line, and there's no libgnarl-4.1.a, so in
static mode there's nothing for it to pick up. Hence it throws an
error: "/usr/bin/ld: cannot find -lgnarl-4.1".
There doesn't seem to be any documented way to get it to not add that to
the ld command line.
Unless I specify "-static" in the linker switches, it will link against
the dynamic libraries even if I add the full paths to the static
libraries to the linker switches. Try doing an ldd on the resulting
executable and you'll see it referring to libgnat-4.1.so.1.
"-static" seems to require, at a minimum, that there be static libraries
for all libraries that are referenced explicitly (hence it can't find
-lpython2.4 unless I add -L/usr/lib/python2.4/config, and it can't find
-lgnarl-4.1 at all). This is true even if I add "-Bdynamic" to the
switches list just before the "-lpython2.4".
For what it's worth, here's one iteration of the linker package
definition that I've tried to use:
package Linker is
for Default_Switches ("Ada") use
("-g",
"-static",
"/usr/lib/libgnatprj.a",
"/usr/lib/libgnatvsn.a",
"/usr/lib/libtemplates_parser.a",
"/usr/lib/libgtkada2.a",
"/usr/lib/gcc/x86_64-linux-gnu/4.1.2/adalib/libgnarl.a",
"/usr/lib/gcc/x86_64-linux-gnu/4.1.2/adalib/libgnat.a",
GtkAda2.Linker_Switches,
Gnatprj.Linker_Switches,
Gnatvsn.Linker_Switches,
Templates_Parser.Linker_Switches,
-- Some C libraries which we build from debian/rules:
"obj/libgps.a", "obj/libdb.a",
-- The python shared library from python-dev comes
-- last, because libgps.a needs it.
"-L/usr/lib/python2.4/config",
"-lpython2.4");
end Linker;
--
Kevin Brown [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]