On Fri, Dec 06, 2002 at 07:29:52AM -0800, Dan Kegel wrote: > I needed to cross-compile Samba for ppc linux from x86 linux. > Fortunately, samba-2.2.7 is very nearly cross-compile-friendly. > The main problem when cross-compiling autoconf'd projects is AC_TRY_RUN > in configure.in, which just doesn't work. Sure enough, to get > Samba to build in a cross-compilation environment, all I had > to do was get rid of one use of AC_TRY_RUN in configure.in, > run autoconf2.50 (to generate a configure script that sets > SIZEOF_INT without using AC_TRY_RUN), and run configure like this:
> CC=/opt/cegl-1.4/hardhat/devkit/ppc/405/bin/powerpc-linux-gcc > CFLAGS="-mcpu=403" ../samba-2.2.7/source/configure > --build=pentium-unknown-linux --host=ppc-unknown-linux > Here's a patch that removes the one use of AC_TRY_RUN in configure.in > that was causing trouble. (And oddly, this makes the definition of > HAVE_GETTIMEOFDAY_TZ better match how this macro is used in the sources, > I think.) Please apply if you agree it's benign. Thanks! Are you certain that the runtime check isn't needed on some platforms? There may be some platforms that appear to have a working gettimeofday() until you actually try to *use* it; maybe the AC_TRY_RUN was frivolous, but maybe it was added to deal with a real problem. In the latter case, AC_TRY_RUN should be called with a sane default for cross-compiling. -- Steve Langasek postmodern programmer
msg04813/pgp00000.pgp
Description: PGP signature