今天在君正T20上編譯samba 2.2.7a 遇到了一些問題,特此記錄一下
1.自己寫一個build.sh腳本,方便后續的再次編譯
#!/bin/sh
#
export CFLAGS="-O2 -muclibc"?
export CPPFLAGS="-O2 -muclibc"?
export CXXFLAGS="-O2 -muclibc"?
export LDFLAGS="-O2 -muclibc"
#export CFLAGS='-O3 -w -isystem /home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/mips-linux-gnu/libc/usr/include'
#export CPPFLAGS='-O3 -w -isystem /home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/mips-linux-gnu/libc/usr/include'
export PATH=/home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/bin:$PATH
export COMPILE_TOOL=/home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/bin/mips-linux-gnu-
export CC=${COMPILE_TOOL}gcc
export AS=${COMPILE_TOOL}as
export AR=${COMPILE_TOOL}ar
export LD=${COMPILE_TOOL}ld
export RANLIB=${COMPILE_TOOL}ranlib
export STRIP=${COMPILE_TOOL}strip
export CPP=${COMPILE_TOOL}cpp
export LD_LIBRARY_PATH=/home/xuxuequan/Ingenicwork/Ingenic-SDK/rootfs/lib
#
MQARMDIR=/usr/samba
MQUSERDIR=/usr/samba/config
#
./configure --build=i686-build_pc-linux-gnu --host=mips-linux-gnu --target=mips-linux-gnu \
?--prefix=/home/xuxuequan/Ingenicwork/lib/libsource/samba-2.2.7a/install \
?--includedir=/home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/mips-linux-gnu/libc/uclibc/usr/include \
?--oldincludedir=/home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/mips-linux-gnu/libc/uclibc/usr/include \
?--disable-largefile \
?--enable-swat=no \
?--enable-smbtorture4=no \
?--enable-cups=no \
?--enable-iprint=no \
?--enable-pie=no \
?--enable-relro=no \
?--with-PACKAGE=no \
?--enable-external-libtalloc=no \
?--enable-external-libtevent=no \
?--enable-external-libtdb=no \
?--enable-fam=no \
?--enable-avahi=no \
?--with-libtalloc=no \
?--with-libtevent=no \
?--with-libtdb=no \
?--with-libnetapi=no \
?--with-libsmbsharemodes=no \
?--with-dmapi=no \
?--with-ldap=no \
?--with-ads=no \
?--with-dnsupdate=no \
?--with-pam=no \
?--with-pam_smbpass=no \
?--with-sys-quotas=no \
?--with-utmp=no \
?--with-cluster-support=no \
?--with-acl-support=no \
?--with-sendfile-support=no \
?--with-wbclient=no \
?--with-winbind=no \
?--with-included-popt=no \
?--with-included-iniparser=no \
?--bindir=$MQARMDIR/bin \
?--sbindir=$MQARMDIR/sbin \
?--localstatedir=$MQUSERDIR/var \
?--libdir=$MQARMDIR/lib \
?--with-privatedir=$MQUSERDIR/private \
?--with-rootsbindir=$MQARMDIR/bin \
?--with-lockdir=$MQUSERDIR/var/locks \
?--with-configdir=$MQUSERDIR \
?--with-logfilebase=$MQUSERDIR/var \
?--with-piddir=$MQUSERDIR/var
2.執行這個build.sh生成Makefile文件
3.修改/home/xuxuequan/Ingenicwork/lib/libsource/samba-2.2.7a/source/include/config.h
注釋掉三個宏定義,增加下面紅色的定義
/* The number of bytes in a int. ?*/
//#define SIZEOF_INT cross
/* The number of bytes in a long. ?*/
//#define SIZEOF_LONG cross
/* The number of bytes in a short. ?*/
//#define SIZEOF_SHORT cross
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_SHORT 2
#define HAVE_GETTIMEOFDAY_TZ 1
#define USE_SETEUID 1
#define HAVE_IFACE_IFCONF 1
4.后續執行make即可在bin下面生成smbclient