[Samba] R: Cross-compile Samba 3.5.6 with STLinux 2.3 (SH4 CPU)
Alex
ambroxa at yahoo.it
Thu Oct 28 00:58:10 MDT 2010
I answer myself. I hope this can be useful.
1) create with a text editor the file config.site and write into it:
------------------config.site-----------
samba_cv_CC_NEGATIVE_ENUM_VALUES=yes
----------------------------------------
(I've tested the C code and sh4-linux-gcc supports negative enum)
2) set some env vars:
export CONFIG_SITE=/path/to/your/config.site
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="-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-lin
ux/4.2.4/include/spp"
export LIBS="-L/opt/STM/STLinux-2.3/devkit/sh4/target/lib -L/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib"
3) run configure:
./configure --host=sh4-linux --target=sh4-linux \
--disable-fam --disable-avahi --disable-swat --disable-cups --disable-iprint --disable-pie \
--enable-static=no --enable-shared=yes \
--without-ldap --without-ads --with-cifsumount --without-pam \
--without-automount --without-sendfile-support --with-included-popt \
--without-sys-quotas --without-utmp --without-cluster-support --without-acl-support \
--without-winbind --with-included-popt --with-included-iniparser \
--prefix=/usr/local/samba
4) (remember to install gettext package in your i686 distro)
make
make install
5) strip binaries:
sh4-linux-strip /usr/local/samba/bin/*
sh4-linux-strip /usr/local/samba/sbin/*
That's all
Now you can copy /usr/local/samba/* in your SH4 device.
Many binaries are not useful: I suggest you to remove them.
Remove also man pages
Remember to set a user with smbpasswd and create /usr/local/samba/lib/smb.conf
This is a simple smb.conf :
----------------smb.conf---------------
[global]
workgroup = WORKGROUP
netbios name = SH4
security = share
deadtime = 60
load printers = no
log level = 0
max smbd processes = 6
[movie]
path = /media/hdd/movie
read only = no
guest ok = yes
browseable = yes
[root_dir]
path = /
browseable = yes
read only = no
guest ok = no
More information about the samba
mailing list