From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,540ef566e4c55af7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Fri, 23 Dec 2005 06:44:08 -0600 From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Debian Sarge: problem with libgnat.so References: <87lkycpuwu.fsf@ludovic-brenta.org> Date: Fri, 23 Dec 2005 13:43:39 +0100 Message-ID: <87acesouf8.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:yQNw7EVey0IFP+X15OBigB5TJOg= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 83.134.238.193 X-Trace: sv3-yvMTJFwqf0mAUHygwKbZX96WBREHwQg1sUfz+0HKBWf6KDHBPem8NDudHveB/Fwvs48qtm04MRvlHb3!9z9/LKeN9aLQcrgG3kyeQs7HZWTiyDOCi//Hr3kVMvAQWPSSgQAOcZAt+sp1XrVBlJ5wmmyIq+Y= X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:6984 Date: 2005-12-23T13:43:39+01:00 List-Id: Martin Klaiber writes: > Ludovic Brenta 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.