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,15d78a51b0d35cec X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!x1g2000prh.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: architecture-independent GNAT project files? Date: Mon, 27 Apr 2009 14:55:36 -0700 (PDT) Organization: http://groups.google.com Message-ID: <7b4268c9-3af5-49ec-ac6a-b5d901d5248c@x1g2000prh.googlegroups.com> References: <75l5ceF18samiU1@mid.individual.net> <75mlktF1979j6U1@mid.individual.net> NNTP-Posting-Host: 94.108.203.209 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1240869336 4327 127.0.0.1 (27 Apr 2009 21:55:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 27 Apr 2009 21:55:36 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x1g2000prh.googlegroups.com; posting-host=94.108.203.209; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.7) Gecko/2009030810 Iceweasel/3.0.7 (Debian-3.0.7-1),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5575 Date: 2009-04-27T14:55:36-07:00 List-Id: Bj=F6rn Persson wrote on comp.lang.ada: > >> 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 wh= at > >> the architecture is? > > > I don't know if it has, but if any, how that is supposed to work for cr= oss > > platform developing? > > The cross-compiler would know its target platform and would assign that > value to the hypothetical variable. The project file would then select th= e > right library directories for that platform. Yes. "gcc -v | grep ^Target:" yields the correct information. I normally use a minimal Makefile to set up such variables from the environment and then invoke gnatmake, passing it the variables. > Such a feature, if done right, could make it possible to write project fi= les > that would work for anything from ARM to Itanium, but I wasn't planning t= o > do that. I'm satisfied if I can support a multilib environment so that i3= 86 > libraries will be selected if someone uses the -m32 parameter on an x86_6= 4 > platform. For true cross-compilation I guess the cross-compiler will > normally have a completely separate set of libraries, including a separat= e > project file directory. It is my understanding that "gcc -m32" invokes the linker in such a way (i.e. "ld -melf_i386", "ld -mi386linux" or some such) that it automatically selects /usr/lib64 instead of /usr/lib. Is that not the case? If I'm right, your problem disappars as far as binary libraries go but still exists for target-dependent source files. -- Ludovic Brenta.