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

RE: porting app with gnu configure



Some packages using autoconf allow you to specify default values for cross-compilation in a architecture specific file. Check the documentation of the package to see if this is supported.

Otherwise you can specify the default values by editing the config.cache file in advance. E.g. to look like this:

ac_cv_alignmentof_voidp=${ac_cv_alignmentof_voidp='1'}
ac_cv_c_bigendian=${ac_cv_c_bigendian='no'}
ac_cv_c_char_unsigned=${ac_cv_c_char_unsigned='no'}
ac_cv_sizeof___int64=${ac_cv_sizeof___int64='0'}
ac_cv_sizeof_int=${ac_cv_sizeof_int='4'}
ac_cv_sizeof_long=${ac_cv_sizeof_long='4'}
ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long='8'}
ac_cv_sizeof_short=${ac_cv_sizeof_short='2'}
ac_cv_sizeof_voidp=${ac_cv_sizeof_voidp='4'}

Then run configure. E.g. like this:

env \
  CC="gcc-cris -mlinux -isystem $EROOT/include"  \
  CPP="gcc-cris -mlinux -E -isystem $EROOT/include" \
  CXX="g++-cris -mlinux -xc++ -isystem $EROOT/include" \
  LDFLAGS="-L$EROOT/lib" \
  OBJCOPY="objcopy-cris" \
  LD="ld-cris -mcrislinux" \
  AR="ar-cris" \
  RANLIB="ranlib-cris" \
  NM="nm-cris" \
  STRIP="strip-cris" \
  \
  ../src/configure \
    --host=cris-axis-linux \
    --without-x \
    --prefix=/usr

Above builds with glibc for Linux 2.4.x.
Note that you should set "--host" if your package is going to run on Etrax.
"--target" should be used when you are building something like a compiler that runs on the build machine to generate code for etrax.

/MiP

> -----Original Message-----
> From: johana@xxxxxxx.com">mailto:johana@xxxxxxx.com]
> Sent: Sunday, October 07, 2001 10:41
> To: dev-etrax; Vladimir Bormotov
> Subject: Re: porting app with gnu configure
> 
> 
> That looks similar to the way I have done it when building 
> appliations using
> configure (e.g openssh) and I don't know of any better way.
> Unfortunatly I have had the same problems as you, autoconf 
> isn't exactly
> optimal when it comes to cross compiling (I guess it depend 
> on who wrote
> the configure.in as well)
> For some tests there might be options or defines to control 
> the behavior
> so the test is skipped, but for some tests you simply have to 
> add your own
> configure options or skip the test.
> 
> Good luck!
> /Johan
> 
> ----- Original Message -----
> From: Vladimir Bormotov <bor@xxxxxxx.ua>
> To: dev-etrax <dev-etrax@xxxxxxx.com>
> Sent: Saturday, October 06, 2001 9:09 PM
> Subject: porting app with gnu configure
> 
> 
> >
> > Hi!
> >
> >  I try
> >
> >  $ export CC=cris-gcc
> >  $ export AR=cris-ar
> >  $ export RANLIB=cris-ranlib
> >  $ ./configure --target=cris-axis-linux-gnu
> >
> >  but..
> >
> > ....
> >  checking size of long... 4
> > checking whether byte ordering is bigendian... configure: 
> error: can not
> run test program while cross compiling
> >
> >
> >  read "GNU Autobook" and patch configure.in (or write own 
> configure.in) is
> >  my "main direction", but may be simliest way exist?
> >
> > --
> > Bor.
> >
>