apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miroslav Kes <m...@ra.rockwell.com>
Subject How to cross compile apr & apr-util ?
Date Fri, 13 Feb 2009 15:51:55 GMT
Hi,

I have problem to correctly setup cross compile for APR and APR-util for 
Linux ARM (big endian) target. After some experiments to bypass tests that 
need to execute code on the targt platform I suceeded to cross compile 
APR. Lets say the APR is built using these commands

./configure --prefix=/usr \
            --host=armv5teb-softfloat-linux-gnueabi \
            ac_cv_file__dev_zero="yes" \
            ac_cv_func_setpgrp_void="yes" \
            apr_cv_process_shared_works="yes" \
            apr_cv_mutex_robust_shared="no" \
            apr_cv_tcp_nodelay_with_cork="yes" \
            ac_cv_sizeof_struct_iovec="8" \
            apr_cv_mutex_recursive="yes" \
            CPPFLAGS=-I/tmp/usr/include \
            LDFLAGS=-L/tmp/usr/lib

make all
make DESTDIR=/tmp install

i.e. the cross compiled APR is installed in /tmp/usr/bin , 
/tmp/usr/build-1, /tmp/usr/include ... 

Now if I want to build apr-utils the configure script fails to find the 
correct build-1 directory:

./configure --prefix=/usr \
            --host=armv5teb-softfloat-linux-gnueabi \
            --with-apr=/tmp/usr \
            CPPFLAGS=-I/tmp/usr/include \
            LDFLAGS=-L/tmp/usr/lib

configure: WARNING: If you wanted to set the --build type, don't use 
--host.
    If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... armv5teb-softfloat-linux-gnueabi
checking target system type... armv5teb-softfloat-linux-gnueabi
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.3.4
checking for chosen layout... apr-util
checking for armv5teb-softfloat-linux-gnueabi-gcc... 
armv5teb-softfloat-linux-gnueabi-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether armv5teb-softfloat-linux-gnueabi-gcc accepts -g... yes
checking for armv5teb-softfloat-linux-gnueabi-gcc option to accept ISO 
C89... none needed
Applying apr-util hints file rules for armv5teb-softfloat-linux-gnueabi
checking for APR... yes
./configure: line 3761: cd: /usr/build-1: No such file or directory

The reason is that the ./configure script finds the 
/tmp/usr/bin/apr-1-config but querying the apr-1-config for the APR 
configuration it points to /usr which is correct from the target 
filesystem point of view but incorrect from the build process point of 
view.

How should setup the cross compile environment to get aroud this problem?

Thanks

Mira Kes

Mime
View raw message