autoconf
[Top][All Lists]
Advanced

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

Re: running tests when cross-compiling


From: Ralf Wildenhues
Subject: Re: running tests when cross-compiling
Date: Thu, 12 Feb 2009 18:29:22 +0100
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

Hello Vadim,

* Vadim Zeitlin wrote on Wed, Feb 11, 2009 at 06:11:43PM CET:
>  Configure is smart enough to not try to run the tests when cross-compiling
> which is usually, of course, the right thing to do. However in some
> situations you can actually run the program even when cross-compiling: the
> example which matters to me is when you cross-compile from Cygwin to
> mingw32 but I could imagine that this could happen in some other situations
> too, e.g. when you have an emulator for the target host on the build system
> (this could happen when developing for embedded systems I suppose).

Try specifying --host but not --build.

I think this is an undocumented (and I think also deprecated) detail of
the current configure machinery: that an empty $build_alias only sets
$cross_compiling to 'maybe', and that then, the first link test
(AC_PROG_CC typically) tries to run the executable in that case, in
order to finally decide whether to set it to 'yes'.

(If/when this detail is removed, it should be replaced with some other
documented method; IMHO it shouldn't be removed though, but I don't
remember the discussions around this ATM.)

Another thing you can do, which is at least implicitly documented in the
manual, is to use code in configure.ac which temporarily munges
$cross_compiling.  But of course that won't help with unchanged
third-party packages.

* Erik de Castro Lopo wrote on Wed, Feb 11, 2009 at 10:03:15PM CET:
> Vadim Zeitlin wrote:
> 
> >  Configure is smart enough to not try to run the tests when cross-compiling
> 
> It does? I thought these tests just failed.

The AC_*RUN* macros have optional arguments describing what to do in the
cross compilation case.

Hope that helps.

Cheers,
Ralf




reply via email to

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