comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: architecture-independent GNAT project files?
Date: Mon, 27 Apr 2009 14:55:36 -0700 (PDT)
Date: 2009-04-27T14:55:36-07:00	[thread overview]
Message-ID: <7b4268c9-3af5-49ec-ac6a-b5d901d5248c@x1g2000prh.googlegroups.com> (raw)
In-Reply-To: 75mlktF1979j6U1@mid.individual.net

Björn 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 what
> >> the architecture is?
>
> > I don't know if it has, but if any, how that is supposed to work for cross
> > 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 the
> 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 files
> that would work for anything from ARM to Itanium, but I wasn't planning to
> do that. I'm satisfied if I can support a multilib environment so that i386
> libraries will be selected if someone uses the -m32 parameter on an x86_64
> platform. For true cross-compilation I guess the cross-compiler will
> normally have a completely separate set of libraries, including a separate
> 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.



  reply	other threads:[~2009-04-27 21:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-27  7:32 architecture-independent GNAT project files? Björn Persson
2009-04-27  8:02 ` Dmitry A. Kazakov
2009-04-27 21:16   ` Björn Persson
2009-04-27 21:55     ` Ludovic Brenta [this message]
2009-04-28 21:41       ` Björn Persson
2009-04-28  7:24     ` Dmitry A. Kazakov
2009-04-28 20:56       ` sjw
2009-04-30 12:17       ` Björn Persson
2009-04-30 12:31         ` Ludovic Brenta
2009-04-27 12:06 ` anon
2009-04-27 19:10   ` sjw
replies disabled

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