Re: Debian Sarge: problem with libgnat.so
- From: Ludovic Brenta <ludovic@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 23 Dec 2005 13:43:39 +0100
Martin Klaiber <martinkl@xxxxxxxxxxxxxxxxxx> writes:
> Ludovic Brenta <ludovic@xxxxxxxxxxxxxxxxxx> wrote:
>
>> Your Makefile is correct, except that it calls the C compiler to link
>> your program. If you call gnatgcc instead, you should be fine. By
>> default, gnatgcc looks in /usr/lib/gcc-lib/i486-linux/2.8.1/adalib,
>> but gcc (the C compiler) only looks in /usr/lib.
>
> Hm, gnatgcc gives the same error:
Oops, sorry. I think I meant gnatmake, but even that wouldn't solve
your problem.
> I want to keep it portable with other Linux-distros (if possible) as
> the code is public. Would it be better to use gnatgcc oder gcc then?
I suggest that you hide libgnat from C programmers. To do this, you
link your shared library with libgnat; unfortunately, as things stand
now, you must use the full path for that, like so:
# -*- Makefile -*- snippet
adalib:=/usr/lib/gcc-lib/`gnatgcc -dumpmachine`/`gnatgcc -dumpversion`/adalib
libopensteuer.so.$(major).$(minor): $(OBJECT_FILES)
gnatgcc -shared -o $@ $(OBJECT_FILES) \
-L$(adalib) -lgnat -Wl,--soname,libopensteuer.so.$(major)
install:
cp -p libopensteuer.so.$(major).$(minor) /usr/local/lib
cd /usr/local/lib; \
ln -s libopensteuer.so.$(major).$(minor) libopensteuer.so; \
ln -s libopensteuer.so.$(major).$(minor) libopensteuer.so.$(major)
CFLAGS := -Wall
test_c.o: test_c.c:
gcc -c $< -o $@ $CFLAGS
test_c: test_c.o install
gcc -o $@ $< -lopensteuer
# End of Makefile snippet
If libopensteuer is properly linked with libgnat, then it doesn't
matter what you use to do the final linking: gcc, gnatcc, gnatlink, or
even plain ld.
As to portability, the only standard layout for Ada files is the GNU
Ada Environment Specification[1]. It might be worthwhile to see if we
can improve this standard. Also, the only GNU/Linux distribution I
know of that conforms to this standard is Debian.
[1] http://cert.uni-stuttgart.de/projects/ada/gnae.php
HTH
--
Ludovic Brenta.
.
- Follow-Ups:
- Re: Debian Sarge: problem with libgnat.so
- From: Martin Klaiber
- Re: Debian Sarge: problem with libgnat.so
- From: Georg Bauhaus
- Re: Debian Sarge: problem with libgnat.so
- References:
- Debian Sarge: problem with libgnat.so
- From: Martin Klaiber
- Re: Debian Sarge: problem with libgnat.so
- From: Ludovic Brenta
- Re: Debian Sarge: problem with libgnat.so
- From: Martin Klaiber
- Debian Sarge: problem with libgnat.so
- Prev by Date: Re: simulate mouse click - windows
- Next by Date: Re: simulate mouse click - windows
- Previous by thread: Re: Debian Sarge: problem with libgnat.so
- Next by thread: Re: Debian Sarge: problem with libgnat.so
- Index(es):
Relevant Pages
|