[asterisk-dev] Trickiness building svn-trunk as cross-compile

Brian Capouch brianc at palaver.net
Mon Jan 22 14:39:22 MST 2007


Kevin P. Fleming wrote:
> Brian Capouch wrote:
> 
>>all: calls _all: which calls cleantest, which sees the recently-built
>>code in menuselect and removes it, then goes in there and starts
>>building it to run on the target platform.  BANG!!
> 
> 
> We've covered this before. The existing Makefiles work perfectly when
> cross-compiling is setup, and menuselect/mxml are built to run on the
> build host, not the target.
> 
> As I asked you before, can you show us _exactly_ how you are setting up
> your cross-compile? We can't really do anything to help you when we have
> to guess what commands and environment you have setup...

I didn't send them along because the "nextgen" (kamikaze) build system 
for openWRT uses a set of customized wrapper scripts that hide all the 
details.  Unwinding them is a chore I haven't yet tried to tackle.

e.g. here is the salient config for the early part of the process:

define Build/Configure
         (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
                 CFLAGS="$(TARGET_CFLAGS)" \
                 LDFLAGS="-L$(STAGING_DIR)/lib -I$(STAGING_DIR)/include" \
                 ./configure \
                         --host=$(GNU_TARGET_NAME) \
                         --build=$(GNU_HOST_NAME) \
                         --without-pwlib \
                         --with-postgres=/usr/src/postgres-mipsel \
                         --with-ssl=/usr/src/trunk/staging_dir_mipsel \
                         --with-z  \
                 );
                 (cd $(PKG_BUILD_DIR)/menuselect; \
                 ./configure \
                         --host=$(GNU_HOST_NAME) \
                         --build=$(GNU_HOST_NAME); \
                 make ; \
                 cd ..; \
                 make menuselect; \
         );
endef

Once it completes the Configure phase, by default it then does the 
"Compile" phase, which is to start at the rootlevel directory and do a 
"make all"

If there is a way to tell the TOPLEVEL configure script to use the 
compiling host as the target inside menuselect, then I could dispense 
with that second stanza and all would be well.

That must be what I'm not understanding.  I don't know how to tell it 
things at the toplevel configure to change configure options in inner 
directories.

If I don't include that customized configuration option to menuselect, 
then here's what I get:

make[3]: Entering directory `/usr/src/trunk/build_mipsel/asterisk-svn-trunk'
make[4]: Entering directory 
`/usr/src/trunk/build_mipsel/asterisk-svn-trunk/menuselect'
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[4]: *** [autoconfig.h] Error 1
make[4]: Leaving directory 
`/usr/src/trunk/build_mipsel/asterisk-svn-trunk/menuselect'
make[3]: *** [menuselect/menuselect] Error 2
make[3]: Leaving directory `/usr/src/trunk/build_mipsel/asterisk-svn-trunk'
make[2]: *** [/usr/src/trunk/build_mipsel/asterisk-svn-trunk/.built] Error 2
make[2]: Leaving directory `/usr/src/trunk/package/asterisk'
make[1]: *** [asterisk-install] Error 2
make[1]: Leaving directory `/usr/src/trunk/package'
make: *** [package/asterisk-install] Error 2


Thanks.

B.


More information about the asterisk-dev mailing list