Building an embedded Samba4

Martin Zielinski mz at seh.de
Mon Feb 6 07:47:11 GMT 2006


Tomasz Chmielewski wrote:
> Jeremy Allison schrieb:
> 
>> On Thu, Feb 02, 2006 at 08:50:50PM +0100, Tomasz Chmielewski wrote:
>>
>>> - how to build it yourself - Samba doesn't cross-compile very well, 
>>> in fact, its ./configure script refuses to run at some point when it 
>>> detects we're gonna cross-compile
>>
>> If you want to send in fixes for that I'd be happy to review them.
> 
> Well, I described it here:
> 
> https://bugzilla.samba.org/show_bug.cgi?id=3424
> 
> 
> More info:
> 
> When ./configure script detects that:
> 
> if test "$cross_compiling" = yes; then
> 
> it quits with:
> 
>   { echo "$as_me:$LINENO: WARNING: cannot run when cross-compiling" >&5
> 
> My ugly hack was to change '"$cross_compiling" = yes' to 
> '"$cross_compiling" = blah' (in several places in ./configure).
> 
> However, I'm unable to produce a patch or resolve it in a better way.
> 
> 
Hi!
These errors are common when cross compiling.

For the arm target, i use a kinda pre-configure script with parts like 
this (samba-3) :

# -- configure.arm:

# Make the configure script happy
export samba_cv_HAVE_MEMORY_KEYTAB=set
export samba_cv_USE_SETEUID=set
export samba_cv_HAVE_WRFILE_KEYTAB=set
export ac_cv_path_KRB5_CONFIG=${KERBEROS}/tools/krb5-config

./configure ${CALL}

# -- end

This lets the configure script use the pre-defined values instead of 
testing them and running into the error condition.

Some config.h and Makefile settings need to be fixed afterwards:

# -- configure.arm:

CFG="include/config.h"
if test  -f $CFG ; then

	echo "Fixing ${CFG}..."
	echo "/* ---------------------- ARM --------------------- */" >> $CFG
	echo "#define HAVE_GETTIMEOFDAY_TZ 1"    >> $CFG
	echo "#define USE_SETEUID 1"             >> $CFG
	echo "#define HAVE_IFACE_IFCONF 1"       >> $CFG
fi

if test -f Makefile ; then
	echo "Fixing the WINBIND_NSS_OBJ list in Makefile..."
     cat Makefile | sed 's/WINBIND_NSS_OBJ = /WINBIND_NSS_OBJ = 
nsswitch\/winbind_nss_linux.o /' > Makefile.1
	cat Makefile.1 | sed 's/KRB5LIBS=/KRB5LIBS=-lcom_err /' > Makefile.2
	rm -f Makefile.1
	rm -f Makefile
	mv Makefile.2 Makefile
fi

# -- end

Never found out, what goes wrong with the auto-detection.
But - as said before - it's not unusual to pre-set configure variables 
when cross-compiling.

Bye,

Martin

-- 
Martin Zielinski             mz at seh.de
Software Development
SEH Computertechnik GmbH     www.seh.de


More information about the samba-technical mailing list