[Samba] Cross-compile Samba 3.5.6 with STLinux 2.3 (SH4 CPU)

Alex ambroxa at yahoo.it
Wed Oct 27 04:26:12 MDT 2010


I need to generate a minimal Samba working in a SH4 cpu in a STLinux 2.3 environment. The goal is to have very very simple Samba server running in a STLinux environment. STLinux Kernel has included the CIFS support.

Really I'm a newbie in Samba cross-compilation. And obviously I've problems :-(
Any help will be appreciated. Thanks :-)


1) First of all I've set some env vars:
export PREFIX="sh4-linux"
export CC="${PREFIX}-gcc"
export CXX="${PREFIX}-g++"
export LD="${PREFIX}-ld"
export NM="${PREFIX}-nm -B"
export AR="${PREFIX}-ar"
export RANLIB="${PREFIX}-ranlib"
export LN_S="ln -s"
export CFLAGS="-g -O2"
export PKG_CONFIG_PATH=/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib/pkgconfig
export LD_LIBRARY_PATH=/opt/STM/STLinux-2.3/devkit/sh4/lib
export LDFLAGS="-L/opt/STM/STLinux-2.3/devkit/sh4/lib -L/opt/STM/STLinux-2.3/devkit/sh4/lib/gcc/sh4-linux/4.2.4"
export CPPFLAGS="-I/opt/STM/STLinux-2.3/devkit/sh4/include -I/opt/STM/STLinux-2.3/devkit/sh4/lib/gcc/sh4-linux/4.2.4/include -I/opt/STM/STLinux-2.3/devkit/sh4/lib/gcc/sh4-linux/4.2.4/incl
ude/spp"

2) I've run configure
./configure --host=sh4-linux --target=sh4-linux --without-automount --without-sendfile-support --with-included-popt --with-included-iniparser --disable-cups --without-sys-quotas --without-ads --enable-static=yes --enable-shared=no --prefix=/root/SAMBA/tmp

3) configure stop with error:
checking that the C compiler understands -errwarn... cross
checking that the C compiler understands -qhalt... cross
checking that the C compiler understands negative enum values... configure: error: in `/root/SAMBA/samba-3.5.6/source3':
configure: error: cannot run test program while cross compiling
See `config.log' for more details.

4) config.log show this:
configure:13070: checking that the C compiler understands negative enum values
configure:13077: error: in `/root/SAMBA/samba-3.5.6/source3':
configure:13080: error: cannot run test program while cross compiling

I've read that I need to setup the "config.site" file. I've read documentation but I've not understand how to set it.



      


More information about the samba mailing list