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,e36020a4e7d24836 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.mixmin.net!news.unit0.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: How to leave .ali files in original library? Date: Wed, 09 Mar 2011 22:10:06 +0100 Organization: A noiseless patient Spider Message-ID: <87zkp4uhjl.fsf@ludovic-brenta.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="iccJ6ppNEEaRQyJwKSAo4w"; logging-data="25461"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ok9+Z1P/9zsk587VClllH" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:fe36yO8oWuUffy5iElreEtsX9gY= sha1:j5UxxmGU2Fdn8cSnkLpl7F/giQ4= Xref: g2news1.google.com comp.lang.ada:18012 Date: 2011-03-09T22:10:06+01:00 List-Id: localhost@example.org writes: > Hi again with another question on building an app using gcc-ada. I'm > building against ncurses thanks to Ludovic and Nasser I *think* I created a > static executable or maybe not ;) Is there a way to tell for sure? I ran ldd > and it doesn't show the curses lib so I think it's included ok but I did get > 3 lines of output: > > linux-vdso.so.1 => (0x00007fff3b1fb000) > libc.so.6 => /lib64/libc.so.6 (0x00007f27f34e3000) > /lib64/ld-linux-x86-64.so.2 (0x00007f27f3853000) > > so maybe it's not static after all. What should I do? No, it's pretty much as static as you can get. This means your executable depends only on the C library and the dynamic loader; they are guaranteed to exist on your target computer even if it has no compiler or other run-time library installed. So, you can declare victory on this front :) BTW, ldd was the correct thing to do, too :) > My question after that is how I can stop all the .ali files from being > regenerated in my working directory. They're all in > ncurses/lib/ada/adalib already do they really have to be > rebuilt/copied into my working directory? I seem to remember a way of > avoiding this but I can't find it now. The .o files are also being > built. I realize this has to happen but can't it be done in the adalib > directory instead of every directory I build an Ada ncurses program? > In other words why should the object files be created over and over > again. So essentially you want an installation of ncurses that you can reuse in several programs without recompiling the library. I don't know how ncurses is meant to be compiled (makefiles, project files?) but the canonical way to achieve what you want is by means of a library project file, as described in the GNAT User's Guide. Essentially: library project Ncurses is for Library_Name use "ncurses_ada"; for Library_Dir use "/usr/lib"; for Library_Kind use "static"; for Source_Dirs use ("/usr/share/ada/adainclude/ncurses"); for Library_ALI_Dir use "/usr/lib/ada/adalib/ncurses"; for Externally_Built use "true"; end Ncurses; And place libncurses_ada.a in /usr/lib, the source files in the Source_Dirs and the ALI files, read-only, in the Library_ALI_Dir. Do *not* place any object files in any directory referenced by the project file. You can, of course, adjust the directories to suit your needs. The ones shown above are appropriate for proper packages (.deb or .rpm). For full details on how to package libraries for the masses, here is another useful link: http://people.debian.org/~lbrenta/debian-ada-policy.html -- Ludovic Brenta.