comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <spam-away@nowhere.nil>
Subject: Re: Library file locations (was: Debian Policy for Ada, Second Edition)
Date: Sun, 19 Mar 2006 13:00:42 GMT
Date: 2006-03-19T13:00:42+00:00	[thread overview]
Message-ID: <_BcTf.48930$d5.205180@newsb.telia.net> (raw)
In-Reply-To: <E18Tf.983$5g6.74@reader1.news.jippii.net>

Tapio Kelloniemi wrote:
> Bj�rn Persson <spam-away@nowhere.nil>
>>Tapio Kelloniemi wrote:
>>>GNAT people seemingly haven't read FHS. This is what it says about the
>>>include directory:
>>>"This  is  where all of the system's general-use include files for the C
>>>programming language should be placed."
>>
>>It doesn't forbid putting non-C files there. FHS doesn't mention Ada, so
>>the most logical thing to do is to treat .ads files like .h files.
> 
> Generic bodies also go there and at least Debian requires that all .adb files
> must be installed to this directory.

To the extent that Gnat needs a library's .adb files when compiling a 
program, they too have the same function as the .h files. If you install 
bodies even though they aren't needed, I don't know of a standard 
location for them, but it seems logical to put them together with the 
specifications, especially if you already have generic bodies there.

> Also putting Ada files to 
> include/<project> may result in having both .h and .ad? files in the same 
> directory, which may not be very comfortable.

If it's one library that's written in part in C and in part in Ada, why 
would it be uncomfortable to have them in the same directory? If you're 
thinking of two different libraries, they need to have different names 
and different subdirectories under include.

>>>Non-C languages generally use lib, like Python and Ruby.
>>
>>Python doesn't have a system with separate specifications and
>>pre-compiled libraries. A Python module is contained in a single file,
>>so the Python developers had to choose between include and lib.
> 
> Python has precompiled modules, with .pyc extension and they are kept in the 
> same directories as the original source code.

Yes, but they have the same function as the .py files, only they're a 
bit faster to load. To import a module you need *either* a .py file *or* 
a .pyc file *or* a .pyo file. At least that's what the Python manual says:
http://www.python.org/doc/2.2.3/tut/node8.html#SECTION008120000000000000000
Whichever kind you have you need them at run time, so they function much 
like .so files. Therefore it makes sense to have them in /usr/lib.

To use a pre-compiled library from Ada you need *both* a set of source 
files (.ads and maybe .adb) *and* a binary file (.a or .so). Only then 
is it reasonable to keep sources and binaries separate.

It *would* have made a lot of sense to keep C headers closer to the 
binaries, in /usr/lib or maybe /usr/lib/include, but it's too late to 
change that. For Ada to integrate well in the Unix environment I think 
it's best to keep library files in the same places as corresponding C 
library files.

> GNAT should look for project files in /usr/local as well, but I'm
> afraid this will not be done. Perhaps the project file directory should be 
> changed to share/gnat.

Is there a good reason not to have project files somewhere under include 
or lib? I think they should be in one of /usr[/local]/include, 
/usr[/local]/include/<project>, /usr[/local]/lib and 
/usr[/local]/lib/<project>. (Substitute /opt/GNAT/<ver> for /usr when 
Gnat is a third-party package.)

-- 
Bj�rn Persson                              PGP key A88682FD
                    omb jor ers @sv ge.
                    r o.b n.p son eri nu



  reply	other threads:[~2006-03-19 13:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-18  1:15 Debian Policy for Ada, Second Edition Ludovic Brenta
2006-03-18 13:36 ` Pascal Obry
2006-03-18 14:39   ` Ludovic Brenta
2006-03-18 16:32     ` Pascal Obry
2006-03-18 17:13       ` Ludovic Brenta
2006-03-18 19:10         ` Pascal Obry
2006-03-18 19:49           ` Georg Bauhaus
2006-03-18 21:16       ` Tapio Kelloniemi
2006-03-19  2:04         ` Library file locations (was: Debian Policy for Ada, Second Edition) Björn Persson
2006-03-19  7:48           ` Tapio Kelloniemi
2006-03-19 13:00             ` Björn Persson [this message]
2006-03-19 15:31             ` Pascal Obry
2006-03-19 16:48               ` Björn Persson
2006-03-19 20:21               ` Tapio Kelloniemi
2006-03-19 22:24                 ` Ludovic Brenta
2006-03-20  9:07                   ` Tapio Kelloniemi
2006-03-20 11:51                     ` Ludovic Brenta
2006-03-21 20:11                       ` Tapio Kelloniemi
2006-03-21 22:30                         ` Library file locations Ludovic Brenta
2006-03-22 11:57                         ` Library file locations (was: Debian Policy for Ada, Second Edition) Georg Bauhaus
2006-03-20  6:52                 ` Pascal Obry
2006-03-20  9:10                   ` Tapio Kelloniemi
replies disabled

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