[PATCH] allow cross-compiling samba-2.2.7

Steve Langasek vorlon at netexpress.net
Fri Dec 6 15:59:21 GMT 2002

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20021206/1824bd18/attachment.bin

More information about the samba-technical mailing list