[uClibc] Cross-compiling PHP

Mitch Davis mitch.davis at opennw.com
Mon Dec 6 04:11:13 UTC 2004


Hello,

I have been experimenting with running PHP 4.3.9 in a
uClibc environment.  To build it, I've been chrooting
into the uClibc image root, and compiling it there.
Compiling PHP natively in this environment means I have
to also build binutils_target, gcc_target, flex, bison
and make.

Has anyone succeeded in *cross-compiling* PHP to run
under uClibc?

I've tried tricking configure on the host with a
config.cache generated on the target.  Cached items
are correctly picked up, but the PHP configure script
still wants to run some test binaries (which of course,
fail on the host).  

Any ideas?

Thanks,

Mitch.

homer [/tmp/php-4.3.9-b1] PATH=/home/mjd/uClibc/build_i386/staging_dir/i386-
linux-uclibc/bin:$PATH CFLAGS=-Os ../php-4.3.9/configure
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -Os ) works... yes
checking whether the C compiler (gcc -Os ) is a cross-compiler... yes
checking whether we are using GNU C... (cached) yes
...
checking for sys/param.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for alloca.h... (cached) yes
checking for arpa/inet.h... (cached) yes
...
checking for sys/ipc.h... (cached) yes
checking for dlfcn.h... (cached) yes
checking for fopencookie... (cached) yes
configure: error: can not run test program while cross compiling
homer [/tmp/php-4.3.9-b1]



More information about the uClibc mailing list