comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: How to leave .ali files in original library?
Date: Wed, 09 Mar 2011 22:10:06 +0100
Date: 2011-03-09T22:10:06+01:00	[thread overview]
Message-ID: <87zkp4uhjl.fsf@ludovic-brenta.org> (raw)
In-Reply-To: slrninfg27.kmk.localhost@example.org

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.



  parent reply	other threads:[~2011-03-09 21:10 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-09 18:00 How to leave .ali files in original library? localhost
2011-03-09 18:53 ` Jeffrey Carter
2011-03-09 18:56   ` localhost
2011-03-09 19:17   ` localhost
2011-03-10 17:10   ` Robert Matthews
2011-03-10 17:42     ` localhost
2011-03-09 21:10 ` Ludovic Brenta [this message]
2011-03-10  6:10   ` localhost
2011-03-10  6:36     ` Simon Wright
2011-03-10  6:46       ` localhost
2011-03-10  9:23         ` Ludovic Brenta
2011-03-10  9:36           ` localhost
2011-03-10 18:42             ` Per Sandberg
2011-03-10 21:06               ` Simon Wright
2011-03-11  9:12               ` Emacs vs GPS vs Eclipse, Ada vs Lisp vs Lua vs Java Stephen Leake
2011-03-11 11:59                 ` Peter C. Chapin
2011-03-11 14:59                 ` Dmitry A. Kazakov
2011-03-12 12:53                   ` Stephen Leake
2011-03-12 15:23                     ` Dmitry A. Kazakov
2011-03-13 15:17                       ` Stephen Leake
2011-03-13 16:20                         ` Dmitry A. Kazakov
2011-03-14 12:07                           ` Stephen Leake
2011-03-14 13:54                             ` Dmitry A. Kazakov
2011-03-11  8:41             ` How to leave .ali files in original library? Stephen Leake
2011-03-11  8:59               ` localhost
2011-03-12 12:36                 ` Stephen Leake
2011-03-10 21:23           ` Randy Brukardt
2011-03-11  6:05             ` AdaMagica
2011-03-11  6:44               ` Per Sandberg
2011-03-11  9:26                 ` Cyrille
2011-03-11 10:09                   ` Cyrille
2011-03-11  9:02             ` localhost
2011-03-11  9:16               ` Ludovic Brenta
2011-03-11 15:07                 ` Dmitry A. Kazakov
2011-03-12 12:37                 ` Stephen Leake
2011-03-11  9:19             ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox