移植 Samba 3.2.0 到arm linux

    先用autogen.sh生成configure, 由于该脚本中对于交叉编译部分支持有问题, 需要做一些修改, 基本上就是把类似于这样的代码
  1.     if test "$cross_compiling" = yes; then
  2.   { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
  3. See /`config.log' for more details." >&5
  4. echo "$as_me: error: cannot run test program while cross compiling
  5. See /`config.log' for more details." >&2;}
  6. { (exit 1); exit 1; }; }


改为

  1.     if test "$cross_compiling" = yes; then
  2.   { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
  3. See /`config.log' for more details." >&5
  4. echo "$as_me: error: cannot run test program while cross compiling
  5. See /`config.log' for more details." >&2;}
  6.     }
  7. #modified: { (exit 1); exit 1; }; }

然后configure,

生成了Makefile和include/config.h等文件, 由于configure的时候用到了HOST系统下的一些头文件, 所以生成config.h中有些地方需要手动修改.我改动过的地方如下:

  1.  797 /* Whether the system has IPv6 support */
  2.  798 //robin: #define HAVE_IPV6 1
  3.  799

  4. 2648 /* Whether seteuid() is available */
  5. 2649 /* #undef USE_SETEUID */
  6. 2650 // rboin:
  7. 2651  #define USE_SETEUID 1

 我使用的如下脚本:

build.sh:

  1. export CFLAGS='-O3 -w -isystem /usr/local/arm-linux/include'
  2. export CPPFLAGS='-O3 -w -isystem /usr/local/arm-linux/include'
  3. export PATH=/usr/local/arm-linux/bin:$PATH
  4. export LD_LIBRARY_PATH=/usr/local/arm-linux/bin/arm-linux-gcc
  5. export CC=/usr/local/arm-linux/bin/arm-linux-gcc
  6. export CPP=/usr/local/arm-linux/bin/arm-linux-cpp

  7. MQARMDIR=/board/bin
  8. MQUSERDIR=/board/config

  9. ./configure  --build=x86-linux --host=arm-linux --target=arm-linux /
  10.         --includedir=/usr/local/arm-linux/include /
  11.         --oldincludedir=/usr/local/arm-linux/include /
  12.         --disable-largefile    /
  13.         --enable-swat=no /
  14.         --enable-cup=no /
  15.         --enable-iprint=no /
  16.         --enable-pie=no /
  17.         --enable-fam=no /
  18.         --enable-static=yes /
  19.         --enable-shared-libs=no /
  20.         --enable-dnssd=no /
  21.         --with-ldap=no /
  22.         --with-ads=no /
  23.         --with-cifsmount=no /
  24.         --with-utmp=no /
  25.         --with-libtalloc=no /
  26.         --with-libtdb=no /
  27.         --with-libnetapi=no /
  28.         --with-libaddns=no /
  29.         --with-libsmbclient=no /
  30.         --with-libsmbsharemodes=no /
  31.         --with-acl-support=no /
  32.         --with-sendfile-support=no /
  33.         --with-winbind=no /
  34.         --with-static-modules=nmbd,smbd,smbclient,smbpasswd /
  35.         --bindir=$MQARMDIR/bin /
  36.         --sbindir=$MQARMDIR/bin /
  37.         --localstatedir=$MQUSERDIR/samba/var /
  38.         --libdir=$MQARMDIR/lib /
  39.         --with-privatedir=$MQUSERDIR/samba/private /
  40.         --with-rootsbindir=$MQARMDIR/bin /
  41.         --with-lockdir=$MQUSERDIR/samba/var/locks /
  42.         --with-configdir=$MQUSERDIR/samba /
  43.         --with-logfilebase=$MQUSERDIR/samba/var /
  44.         --with-piddir=$MQUSERDIR/samba/var

  45. cp config.h include/config.h
  46. make clean
  47. time make

Good luck!

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值