[Samba] Samba Cross-Compilation Problem

Michael Wood esiotrot at gmail.com
Tue Feb 22 02:29:42 MST 2011


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.

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

e.g. the article says: "Naturally, most programs are not cross
compilation tools. For those programs, it does not make sense to speak
of a target. It only makes sense to speak of a target for tools like
`gcc' or the `binutils' which actually produce running code. For
example, it does not make sense to speak of the target of a tool like
`bison' or `make'."  and you can add Samba to "bison" and "make".

--build is where you are building the software.
--host is where the software will be hosted (i.e. where you are going
to run it after compiling it.)
--target is to do with the output that the software you are building
will create.  Obviously not relevant for something like Samba.

--build is normally guessed correctly.
--host defaults to the same as --build, but Hitesh wants arm-linux.
--target (as mentioned several times above ;) does not make sense here.

It's not rocket surgery ;)

Michael Wood <esiotrot at gmail.com>

More information about the samba-technical mailing list