[Samba] Samba Cross-Compilation Problem

Richard Sharpe realrichardsharpe at gmail.com
Tue Feb 22 08:29:15 MST 2011

On Tue, Feb 22, 2011 at 4:29 AM, Michael Wood <esiotrot at gmail.com> wrote:
> Hi
> On 21 February 2011 18:49, Richard Sharpe <realrichardsharpe at gmail.com> wrote:
>> On Mon, Feb 21, 2011 at 6:35 AM, Michael Wood <esiotrot at gmail.com> wrote:
>>> On 21 February 2011 08:25, Hitesh Bajaj <hitesh_bajaj24 at yahoo.com> wrote:
>>>> Hi
>>>> Tool Chain: I am using montavista (mv_pro_5.0)tool chain.Samba Version: I Used - samba-3.5.6.Error: error: ADS_STRUCT has no member named ldapThen I Switched To Version samba-3.4.10Then I got the Same Error.
>>>> EnvironMent I Set Accroding Are:
>>>> 1) export CONFIG_SITE=/home/hitesh/Sources/config.site2) export PREFIX="arm_v5t_le"3) export CC="${PREFIX}-gcc"4) export LD="${PREFIX}-ld"5) export NM="${PREFIX}-nm -B"6) export AR="${PREFIX}-ar"7) export RANLIB="${PREFIX}-ranlib"8) export LN_S="ln -s"
>>>> 9) export PKG_CONFIG_PATH=/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/target/usr/lib/pkgconfig
>>>> 10)export LD_LIBRARY_PATH=/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/lib/11)export LDFLAGS=-L/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/lib/12)export CPPFLAGS=-I/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/include/13) export LIBS="-L/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/target/lib -L/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/target/usr/lib"
>>>> Then I Configured Samba As:
>>>> ./configure --host=i686 --target=arm-linux --prefix=/home/hitesh/samba/samba-05
>>> I believe this is wrong and should rather be something like:
>>> ./configure --host=arm-linux --prefix=/home/hitesh/samba/samba-05
>>> --target only makes sense for a something like a compiler.  i.e. it
>>> should probably not appear in Samba's "./configure --help" output.
>>> --host is where you want to run whatever it is you're building.
>>> --build is where you're building it, so you could put something like
>>> i686-linux there if you like, but it should not be necessary.
>>> So, try with just --host=arm-linux.
>>> You might need more than the above to solve your problem, though.
>> Hmmm, this web site:
>> http://www.airs.com/ian/configure/configure_5.html seems to suggest
>> that he has --host and --target approximately correct, although
>> configure should be able to figure out --host by itself.
> No, I am afraid you have misinterpreted the article.
> It was (mostly) about compiling a cross-*compiler* and not something
> like Samba.  A cross compiler would normally be built on e.g.
> x86-linux, be designed to run on x86-linux and target arm-linux.  So
> --build would be x86-linux, --host would also be x86-linux and
> --target would be arm-linux.

Sigh. Yes I was mistaken. I failed so see the term "cross-compilation
tools..." and I had forgotten that --host was what I used when cross
compiling Samba and netatalk and Avahi and ... on Fedora 9 x86_64 or
whatever for Marvell ARM Linux.

> For something like Samba, --target does not make sense, because Samba
> is not a compiler/assembler/linker etc.


> It's not rocket surgery ;)

Well, yes and no. For example:

You suggested ./configure --host=arm-linux --prefix=/home/hitesh/samba/samba-05

However, --prefix has to be correct as well, as it is the location
that the built programs are going to reside on the 'target' and he
should probably use something --prefix=/usr/local or --prefix=/opt or
whatever path he wants on the final target, and then when moving
things to the staging directory, use 'make install
DIR=/path/to/staging/dir' (I have forgotten the actual magic
incantation so that is only approximately correct). This is because he
is most likely then going to have to package up everything for
inclusion in EEPROM/Flash. Even if he is going to put it on a disk on
the target, he will not want '/home/hitesh/samba/samba-05' embedded in
everything because that will likely not exist on the target.

So, it's not rocket science, but it does require careful thinking
about what is to happen, and it took a while to get it correct, so I
built scripts to encapsulate the steps for the approximately 10
packages I was cross compiling ...

Richard Sharpe

More information about the samba-technical mailing list