Cross-compiling is broken. Help me fix it.

Tom Tromey tromey@cygnus.com
Sat Apr 1 00:00:00 GMT 2000


>> The first thing I did was to set some environment variables so that the
>> correct compilers would be used.  In particular I did the following:
>> 
>> setenv AR     i386-lynx-lynxos-ar
>> setenv AS     i386-lynx-lynxos-as
>> setenv CC     i386-lynx-lynxos-gcc
>> setenv CXX    i386-lynx-lynxos-g++
>> setenv LD     i386-lynx-lynxos-ld
>> setenv NM     i386-lynx-lynxos-nm
>> setenv RANLIB i386-lynx-lynxos-ranlib

Benjamin> seems wrong. You might want to take a look at libjava or
Benjamin> zlib for the java runtime. (look for aclocal.m4 macros to
Benjamin> get started)

Actually, we (meaning libjava or zlib) probably rely on the top-level
Makefile to set these macros correctly before invoking our configure
script.  This is the "standard" thing to do, even though it is ugly
(you'd expect a bunch of AC_CHECK_TOOL invocations instead).  (I say
"probably" because even though I wrote this code I basically never
look at it.)

>> checking whether byte ordering is bigendian... configure: error:
>> can not run test program while cross compiling

>> Ok, so I go in and hack that part of the configure script to simply
>> assume little endian instead of quitting with that error message.
>> Configuration now finishes.  But during the make, I run into the
>> following problem:

Benjamin> No. There has to be a better way. This is curently being
Benjamin> warned about by autoconf anyway, so should change.

AC_C_BIGENDIAN currently (autoconf 2.13) doesn't let you provide a
default or anything like that.  Instead the assumption is that if you
don't already know, and you can't tell at configure time (i.e., cross
build case), then you have to revert to checking at runtime.

Tom


More information about the Libstdc++ mailing list