[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cross compile: distinct object files, how?

From: Ralf Wildenhues
Subject: Re: cross compile: distinct object files, how?
Date: Wed, 15 Apr 2009 23:36:30 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Christian,

* Christian Rössel wrote on Wed, Apr 15, 2009 at 01:37:59PM CEST:
> Ralf Wildenhues wrote:
> > 
> > BTW, how do you ensure configure tests are correct for both compilers
> > without running two configure scripts, or running one of them twice?
> Hm, good question. We are in the process of modifying an existing
> autotools framework to meet new requirements. In the existing setup
> there were some custom m4 scripts that were executed in the
> cross-compile case (we need cross compilation only on special machines
> like IBM Blue Gene/P). But replacing them by the standard checks seems
> to be a good thing.

BTW, you might be interested to hear that improved support for BG/P in
Libtool is a topic right now in this thread on the Libtool list:

> The approach of calling configure twice with different options places an
> unnecessary burden and source of errors to the user.

Well, you can sort-of automate this by letting your one configure script
invoke the other one.  But it cannot be done strictly with
AC_CONFIG_SUBDIRS: that would also pass a path to a shared config.cache
file (if -C is passed to configure), which is wrong in this case, and of
course you have to override any arguments of CC=... etc. on the
configure command line (which is listed in "$ac_configure_args", escaped
to be suitable for eval).

> From the user's perspective, one call with --host, --build and
> CC_FOR_BUILD in the cross-compile situation should be sufficient.


> A scenario to accomplish this could be:
> configure needs to invoke two nested configures (via AC_CONFIG_SUBDIRS),
> one for the host-system and one for the build-system. The build-system
> configure must then set CC=$(CC_FOR_BUILD) and host=build (or call
> AC_CANONICAL_BUILD and AC_CANONICAL_HOST). Then the usual checks follow.

> When there is no need for cross-compilation, the top-level configure
> does not invoke the nested configures which can be done with
> conditionals.
> Is this a possible scenario?

Sounds viable, yes.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]