[Samba] Cross Compile Samba4

Sebastian Ulmer SebastianUlmer at gmx.de
Sun Sep 2 06:42:42 MDT 2012


Hi,

I try to port samba4beta8 to Optware which includes cross compiling it 
for various platforms. I already created makefiles for optware for samba 
versions 3.4 and 3.6.  Creating a working makefile for samba4 I try to 
use the new build environment but it puzzles me. I don't get over part 
where the python version is being checked.  From my findings it looks 
like the linker dislikes the argument "-Bsymbolic-functions". I tried to 
find the part of the buildscript where this option is set, but didn't 
find it. Unfortunately I cannot switch to a newer compiler, which 
supports this argument. I tried to use option --nopyc, but that did not 
help. Further I did notice that the scripts does not find the correct 
python version of the target platform and uses host python and I don't 
how to change that. I would appreciate any help. A example makefile on 
how to cross compile samba36 can be found here:
http://trac.nslu2-linux.org/optware/browser/trunk/make/samba36.mk

Here are the last words from compilation:

Checking for program 
python                                                       : 
/usr/bin/python
Checking for program 
perl                                                         : /usr/bin/perl
Checking for program 
xsltproc                                                     : not found
Checking for program 
python                                                       : 
/usr/bin/python
Checking for Python version >= 
2.4.2                                              : ok 2.6.5
Checking for library 
python2.6                                                    : not found
Checking for library 
python2.6                                                    : not found
Checking for library 
python26                                                     : not found
Checking for program 
python2.6-config                                             : 
/usr/bin/python2.6-config
Checking for custom 
code                                                          : Could 
not find the python development headers
/home/ulmer/optware/builddir/ddwrt/builds/samba4/wscript:92: error: the 
configuration failed (see 
'/home/ulmer/optware/builddir/ddwrt/builds/samba4/bin/config.log')


the config.log files states:

[1/2] Compiling ^[[32mtest.c^[[0m
['/home/ulmer/optware/builddir/ddwrt/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc', 
'-MD', '-fno-strict-aliasing', '-O2', '-pipe', 
'-I/home/ulmer/optware/builddir/ddwrt/staging/opt/include', 
'-I/home/ulmer/optware/builddir/ddwrt/staging/opt/include/etc', 
'-I/home/ulmer/optware/builddir/ddwrt/staging/opt/include/python2.6', 
'-I/usr/local/include', '-I/usr/include/python2.6', '-D_SAMBA_BUILD_=4', 
'-DHAVE_CONFIG_H=1', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', 
'../test.c', '-c', '-o', 'default/test_1.o']
[2/2] Linking ^[[33mdefault/testprog^[[0m
/home/ulmer/optware/builddir/ddwrt/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/lib/gcc/mipsel-linux-uclibc/4.1.1/../../../../mipsel-linux-uclibc/bin/ld: 
unrecognized option '-Bsymbolic-functions'
/home/ulmer/optware/builddir/ddwrt/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/lib/gcc/mipsel-linux-uclibc/4.1.1/../../../../mipsel-linux-uclibc/bin/ld: 
use the --help option for usage information
collect2: ld returned 1 exit status
['/home/ulmer/optware/builddir/ddwrt/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc', 
'default/test_1.o', '-o', 
'/home/ulmer/optware/builddir/ddwrt/builds/samba4/bin/.conf_check_0/testbuild/default/testprog', 
'-L/home/ulmer/optware/builddir/ddwrt/staging/opt/lib', 
'-Wl,-rpath,/opt/lib', 
'-Wl,-rpath-link,/home/ulmer/optware/builddir/ddwrt/staging/opt/lib', 
'-Wl,-Bsymbolic-functions', '-L/usr/local/lib', '-Wl,-Bdynamic', '-lm', 
'-lpthread', '-ldl', '-lutil']
command returned 'Build failed:  -> task failed (err #1): \n\t{task: 
cc_link test_1.o -> testprog}'Could not find the python development headers

Configure for samba4 is invoked by

                ./configure \
                 --cross-compile\
                 --cross-answers=cross_compile_vars.txt\
                 --target=$(GNU_TARGET_NAME) \
                 --prefix=$(SAMBA4_INST_DIR) \
                 --exec-prefix=$(SAMBA4_INST_DIR) \
                 --bindir=$(SAMBA4_BIN_DIR) \
                 --sbindir=$(SAMBA4_SBIN_DIR) \
                 --libexecdir=$(SAMBA4_LIBEXEC_DIR) \
                 --datadir=$(SAMBA4_DATA_DIR) \
                 --sysconfdir=$(SAMBA4_SYSCONF_DIR) \
                 --sharedstatedir=$(SAMBA4_SHAREDSTATE_DIR) \
                 --localstatedir=$(SAMBA4_LOCALSTATE_DIR) \
                 --libdir=$(SAMBA4_LIB_DIR) \
                 --includedir=$(SAMBA4_INCLUDE_DIR) \
                 --oldincludedir=$(SAMBA4_INCLUDE_DIR) \
                 --infodir=$(SAMBA4_INFO_DIR) \
                 --mandir=$(SAMBA4_MAN_DIR) \
                 --with-privatedir=$(SAMBA4_SYSCONF_DIR) \
                 --with-lockdir=$(SAMBA4_LOCALSTATE_DIR) \
                 --with-piddir=$(SAMBA4_LOCALSTATE_DIR) \
                 --with-configdir=$(SAMBA4_SYSCONF_DIR) \
                 --with-logfilebase=$(SAMBA4_LOCALSTATE_DIR) \
                 --nopyc\
                 --without-quotas \
                 --without-sys-quotas\
                 $(SAMBA4_CONFIG_ARGS) \


Regards,

Sebastian



More information about the samba mailing list