autoconf
[Top][All Lists]
Advanced

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

Re: Detect Cross Compiler


From: Ralf Wildenhues
Subject: Re: Detect Cross Compiler
Date: Sun, 13 Feb 2011 09:09:01 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

Hello Justin,

* Too, Justin A. wrote on Thu, Feb 10, 2011 at 06:56:08PM CET:
> As a whole, my project is not being cross-compiled, but there is a
> test that uses a user-specified compiler on some test code and then
> runs the generated executable. The problem is that the user may
> specify to cross-compile this test code, in which case the executable
> should NOT be run. Therefore, I would like to set an
> AM_CONDITIONAL(IS_USING_CROSS_COMPILER), for example.
> 
> Say the user specifies the test compiler on the configure line using
> 
> —with-test-compiler=<compiler>.
> 
> What I would like to do is have configure detect that this compiler,
> $with_test_compiler, is a cross-compiler for the host system and then
> I can set my AM_CONDITIONAL to use in my Makefile.am's. I'm aware of
> AC_RUN_IFELSE and AC_LANG_PROGRAM, but I don't see a way to feed these
> macros a different compiler. AC_LANG and AC_LANG_PUSH don't seem to be
> useful in this scenario either.

Right.  That's another part of what I meant in the other mail when I
wrote "Autoconf ... is only suited for one compiler per language".
Again, the correct way around this is to use one configure script per
C compiler.  Then, with overriding CC as appropriate, the corresponding
tests provided by Autoconf should work as expected.

Hope that helps.

Cheers,
Ralf



reply via email to

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