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!news4.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 18:23:35 -0600 From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Debian Sarge: problem with libgnat.so References: <87lkycpuwu.fsf@ludovic-brenta.org> <87acesouf8.fsf@ludovic-brenta.org> <96eu73-n92.ln1@martinkl.dialup.fu-berlin.de> Date: Sat, 24 Dec 2005 01:23:06 +0100 Message-ID: <87u0czny1h.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:FbtJFm7qBDSTTIvInpnoFgdsACA= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 83.134.238.193 X-Trace: sv3-PUiyok4y/AwLuvxR/+seshwVTBET4OZN7ehnMr1//Yx7fQ4VCybTOUV15pyU1ZVQhazwbk1hySYY8cF!mA80ud2PTlmI7vy4kuLxRmc8zuaTdIe9sktor9dmCVQSYxUTFdgC2P7qtz0OY9GFiLNBCb3qzmA= 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:6997 Date: 2005-12-24T01:23:06+01:00 List-Id: Martin Klaiber writes: [...] > GNAT_LIB = /usr/lib/gcc-lib/i486-linux/2.8.1/adalib/libgnat.so [...] > .PHONY: shared > shared: default > gnatgcc -shared -L$(GNAT_LIB) -lgnat -Wl,-soname,$(SHARED_API) -o $(SHARED_VERSION) *.o > > But this only moves the problem one step forward :-/ > > gnatmake libopensteuer -c -fPIC -m -O3 -largs > gnatmake: objects up to date. > gnatgcc -shared -L/usr/lib/gcc-lib/i486-linux/2.8.1/adalib/libgnat.so -lgnat -Wl,-soname,libopensteuer.so.0 -o libopensteuer.so.0.2004.3 *.o > ld: cannot find -lgnat > > Is my system broken? Do you have an idea, why gnatgcc doesn't find > libgnat? Because your -L does not specify a directory name but a file name instead. No, your system isn't broken :) > On the other hand, I don't want to use gnatgcc really, because there > are systems out without gnatgcc (SuSE IIRC). So, I think, I will > use the other option: ask the user if I should create > /usr/lib/libgnat.so if it is missing. If you hide libgnat from C programmers, you can use gnatgcc, adagcc (FreeBSD) or gcc or ld or whatever, and they don't have to know or care. They'll use just "gcc" and get libgnat pulled in by your library. If you make your library into a package, it will have to Build-Depend on gnat, and Depend on libgnat-3.15p-1. [...] About GNAE: > Indeed. But the paper doesn't mention a situation as we might have > in my case: somebody installs the libraries needed for this program > (for instance by a package-manager which only does the default > installation, i.e. no extra creation of links). > > But this person does not install the Ada-compiler, as he only wants > to build a C-program using my library. So he would only have $(CC), > and as you said, C-compilers would look in /usr/lib vor libgnat.so, > not in /usr/lib/gcc-lib/... > > Doesn't this mean that we always should have /usr/lib/libgnat.so? > > Or, to ask the other way round: is there a special reason why we > don't have this link in /usr/lib? The GNAE specifies that libgnat.so must be in the GNAT-specific directory under /usr/lib/gcc-lib/.../adalib. In Debian, most libraries intended for use from C programs come in two packages. Assuming a library L with soname libL.so.0, you'd have: package libL0: /usr/lib/libL.so.0.1.2 /usr/lib/libL.so.0 -> libL.so.0.1.2 package libL-dev: /usr/lib/libL.so -> libL.so.0.1.2 In C programs, if you specify "-lL" on your linker's command line, you need the libL-dev package. Your users only need the libL0 package. Now, libgnat is not intended for use from C programs, and there is no libgnat-dev package; instead the package gnat provides the .so link as well as the compiler and assorted tools. So therefore, as things stand now, anyone who wants to specify "-lgnat" must install gnat, and also specify -L/usr/lib/gcc-lib/.../adalib. In the next gnat, I will provide /usr/lib/libgnat.so for the specific purpose of making it easier to link shared libraries with libgnat. But don't hold your breath for that next release; in any case it will not be in Sarge but only in Etch. -- Ludovic Brenta.