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,de92eb048dc3c019 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!news.glorb.com!sumatra.thomas-huehn.de!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Library file locations (was: Debian Policy for Ada, Second Edition) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <_BcTf.48930$d5.205180@newsb.telia.net> Date: Sun, 19 Mar 2006 13:00:42 GMT NNTP-Posting-Host: 83.250.106.90 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1142773242 83.250.106.90 (Sun, 19 Mar 2006 14:00:42 CET) NNTP-Posting-Date: Sun, 19 Mar 2006 14:00:42 CET Organization: Telia Internet Xref: g2news1.google.com comp.lang.ada:3448 Date: 2006-03-19T13:00:42+00:00 List-Id: Tapio Kelloniemi wrote: > Bj�rn Persson >>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/ 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/, /usr[/local]/lib and /usr[/local]/lib/. (Substitute /opt/GNAT/ 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