Ok, lets get that implemented now.

Here is "kind of" what I want to do.

AC_INIT(foo.cpp)
AC_PREREQ(2.14)
                 
cross_host=$host
host=NONE
                    
AC_CANONICAL_HOST

AC_LANG_CPLUSPLUS

if test "$cross_host" != "NONE" && test "$cross_host" != "$host"; then
  AC_CHECK_PROGS(CXX, ${cross_host}-c++ ${cross_host}-g++, , ${PATH})
fi

AC_PROG_CXX


That "kind of" works.


mo(~/project/jikes/src/Xcygwin_mini)% ../mini/configure --host=i586-cygwin32
checking host system type... i686-pc-linux-gnu
checking for i586-cygwin32-c++... i586-cygwin32-c++
checking for c++... (cached) i586-cygwin32-c++
checking whether the C++ compiler (i586-cygwin32-c++   ) works...


There are a couple of problems with this approach. It compares the
result of running config.guess to what the user passed in with --host
, but I am not sure we actually want the configure script to
continue to think it is running on a i686-pc-linux-gnu host when
it is actually using a cross compiler.

This is actually a more general problem. For instance, when I run
./configure on a Window box running cygwin but I use a cross like
mingwin, the host still returns cygwin values. If the autoconf
script uses host values to make compile time decisions, then
they will be wrong because we are using a cross compiler.

Here is a quick example from the online autoconf macro archive.

http://peti.cys.de/autoconf-archive/Miscellaneous/acx_check_pathname_style.html

This test will break if you use a cross compiler with cygwin.
So who is at fault here? Should autoconf know about the host
it is running under and the cross "host" info?

Mo Dejong
Red Hat Inc.

On 21 Apr 2000, Alexandre Oliva wrote:

> On Apr 21, 2000, Mo DeJong <[EMAIL PROTECTED]> wrote:
> 
> > Ok, I can buy that --host argument, but then why does using
> > --host also not work?
> 
> Because that was never implemented?
> 
> -- 
> Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
> Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
> Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
> oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me
> 
> 

Reply via email to