Samba/Compiling Samba from Source

Cross compile Samba
If you want to compile Samba e.g. for an embedded system you need to cross compile Samba on your host PC.

After you have downloaded the Samba sources from Samba.org, unpack these sources and enter the samba- /source/ directory. Then you need to set the CC environment:


 * 1) export LD_LIBRARY_PATH&#61;//lib
 * 2) export LDFLAGS&#61;-L//lib
 * 3) export CPPFLAGS&#61;-I//include
 * 4) export CC&#61;/bin/

as an example see the following for a mips compiler:


 * 1) export LD_LIBRARY_PATH&#61;~/home/me/my_prj/linux/mips_compiler/lib
 * 2) export LDFLAGS&#61;-L/~/home/me/my_prj/linux/mips_compiler/lib
 * 3) export CPPFLAGS&#61;-I/~/home/me/my_prj/linux/mips_compiler/include
 * 4) export CC&#61;~/home/me/my_prj/linux/mips_compiler/bin/mips-linux-uclib-gcc

Note: CPPFLAGS are not flags for a C++ compiler! CPPFLAGS means C-PreProcessor, thus CPPFLAGS are the options for the C-preprocessor.

Now entering the samba- /source/ directory and run 'configure':


 * 1) ./configure --host&#61;i686 --target&#61;mips-linux-uclibc

After the configure script has ended, run make in samba- /source/


 * 1) make