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: a07f3367d7,a19f7b11143e52d2 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn?= Persson Newsgroups: comp.lang.ada Subject: Re: One united Ada policy for all Linux distributions? Followup-To: comp.lang.ada Date: Wed, 19 May 2010 15:24:07 +0200 Message-ID: <85i73nF41eU2@mid.individual.net> References: <8b775424-6d49-4fc1-8f9d-f1837d75371e@e21g2000vbl.googlegroups.com> <15rwx3bkqj8p9$.18lm12fadj9m7$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8Bit X-Trace: individual.net IQ6CdUTEzkwCXk/NkufeCQXhHPCCZ+O6ydKj1gbkET6kYspRF3 Cancel-Lock: sha1:vfa56eso7nTSNv/zoC5/D3jctKQ= User-Agent: KNode/4.4.2 Xref: g2news2.google.com comp.lang.ada:11764 Date: 2010-05-19T15:24:07+02:00 List-Id: Dmitry A. Kazakov wrote: > Ideally gpr files should be installed where GPS, > gprbuild, gnatmake could look after them. GNAT GPL's GPS does it in > /lib/gnat. I think the policy should mandate a directory under > /usr/lib or /usr/include for all gpr files rather than project-dependent > directories. The question of where to store .gpr files is actually rather complicated. The .gpr file for a library needs to point to architecture-specific library files, which makes the .gpr file itself architecture-specific if the location is hard-coded. For example, a multilib system may have a 32-bit /usr/lib/lib.so with .ali files in /usr/lib//, and a 64- bit /usr/lib64/lib.so with .ali files in /usr/lib64//. It would then need two different .gpr files, one pointing to /usr/lib/ and the other to /usr/lib64/. One might then try putting the .gpr files somewhere in /usr/lib* too, for example /usr/lib/gnat/.gpr and /usr/lib64/gnat/.gpr. That doesn't work however, because although Gnat can be configured to look for .gpr files in multiple directories, it will look in the same set of directories regardless of whether it's compiling for 32-bit or 64-bit mode, and use the first .gpr file with a matching name that it finds. If it finds the 64-bit .gpr first, then compiling 32-bit binaries fails, and vice versa. To solve this problem in Fedora I parameterize the .gpr files. There is a file named common.gpr which defines the variable Lib as either "lib" or "lib64" depending on an environment variable named HARDWARE_PLATFORM. HARDWARE_PLATFORM is defined by a snippet of shell script in /etc/profile.d/, and can be changed with the command "setarch". All the other .gpr files import common.gpr and use the variable Lib like this: for Library_Dir use "/usr/" & Common.Lib; for Library_ALI_Dir use "/usr/" & Common.Lib & "/"; That makes the .gpr files architecture-independent. According to the Filesystem Hierarchy Standard they should then be somewhere under /usr/share. I keep them in /usr/lib/gnat however, because that's where Gnat looks for them (but not in /usr/lib64/gnat, only in /usr/lib/gnat). This is controlled by an RPM macro named _GNAT_project_dir, so if I were to move the .gpr files I would only need to change the macro and rebuild the packages. -- Bj�rn Persson PGP key A88682FD