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=0.5 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,15d78a51b0d35cec X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!news.glorb.com!wn13feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: architecture-independent GNAT project files? Reply-To: no to spamers (No@email.given.org) References: <75l5ceF18samiU1@mid.individual.net> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Mon, 27 Apr 2009 12:06:50 GMT NNTP-Posting-Host: 12.65.72.242 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1240834010 12.65.72.242 (Mon, 27 Apr 2009 12:06:50 GMT) NNTP-Posting-Date: Mon, 27 Apr 2009 12:06:50 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:5553 Date: 2009-04-27T12:06:50+00:00 List-Id: You could use: -gnateD on your command line or GPS options list -gnateD? Define or redefine preprocessing symbol, e.g. -gnateDsym=val Where use could set a variable to the architecture path you wish to use such as for a 32-bit arch gnat make -gnateDArchLib="/usr/lib/' then for the 64 bit arch use gnat make -gnateDArchLib="/usr/lib64/' -- -- ArchLib is define in commnd line options. if not present an error -- will be generated. -- Libs_Path : String := ArchLib ; ... open ( File => LibFlile, Name => Libs_Path & FileName, Mode => In_File ) ; In <75l5ceF18samiU1@mid.individual.net>, =?ISO-8859-1?Q?Bj=F6rn?= Persson writes: >When I write GNAT project files for shared libraries I find that I have to >hardcode the paths to some architecture-specific directories. 32-bit >libraries are in /usr/lib/ while 64-bit libraries are in /usr/lib64/, and I >would like to have a single project file that works for both cases. > >The way to find out the architecture of a Unix-like system appears to be to >invoke uname, but GNAT project files don't seem to have a shell-out >feature. As far as I can see in the manual the only ways they can get input >is by environment variables and command line parameters. I don't suppose >Gnatmake provides some variable to project files that shows what the >architecture is? > >I could define an environment variable in the systemwide profile, but that's >not really a good solution. That variable would contain the host >architecture but it's the target architecture I really need to test for. I >also don't like polluting the environment. > >Does anyone have a better idea? > >-- >Bj�rn Persson >PGP key A88682FD