# Cross Build PHP 5.2.5

- Thread: https://externals.io/message/34987
- Original archive: https://news-web.php.net/php.internals/34987
- Started by Pete Klemm on 2008-01-28T22:36:26+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #34987 — Pete Klemm — 2008-01-28T22:36:26+00:00

URL: https://externals.io/message/34987#34987

I am trying to cross compile PHP 5.2.5. I have tried many combinations 
of parameters
to configure, but find that the build keeps wanting to use native tools 
or link with native
libraries. Has anyone been successful in cross compiling for ARM. I 
intend to use PHP
on an embedded web server and would like to tune the PHP build to just 
bring in the
options I need.

I call configure with the following arguments:

CC="arm-unknown-linux-gnu-gcc" \
CXX="arm-unknown-linux-gnu-g++" \
PREFIX="opt/crosstool/gcc-4.0.2-glibc-2.3.6/arm-unknown-linux-gnu/arm-unknown-linux-gnu" 
\
RANLIB="arm-unknown-linux-gnu-ranlib" \
LIBS="-L/opt/crosstool/gcc-4.0.2-glibc-2.3.6/arm-unknown-linux-gnu/arm-unknown-linux-gnu/lib" 
\
CFLAGS="-I/opt/crosstool/gcc-4.0.2-glibc-2.3.6/arm-unknown-linux-gnu/arm-unknown-linux-gnu/include 
-I/opt/crosstool/gcc-4.0.2-glibc-2.3.6/arm-unknown-linux-gnu/include" \
./configure \
--host=arm-unknown-linux-gnu \
--prefix=/opt/crosstool/gcc-4.0.2-glibc-2.3.6/arm-unknown-linux-gnu/arm-unknown-linux-gnu 
\
--oldincludedir=/opt/crosstool/gcc-4.0.2-glibc-2.3.6/arm-unknown-linux-gnu/arm-unknown-linux-gnu/include 
\
--with-libdir=/opt/crosstool/gcc-4.0.2-glibc-2.3.6/arm-unknown-linux-gnu/arm-unknown-linux-gnu/lib 
\
--with-includedir=/opt/crosstool/gcc-4.0.2-glibc-2.3.6/arm-unknown-linux-gnu/arm-unknown-linux-gnu/include 
\
--disable-ipv6 \
--without-openssl \
--without-curl \
--with-gettext \
--without-kerberos \
--without-ldap \
--disable-mbstring \
--without-mcrypt \
--without-mhash \
--without-mysql \
--enable-sockets \
--without-pdo-sqlite \
--without-sqlite \
--without-xml \
--with-pear=shared,/opt/crosstool/gcc-4.0.2-glibc-2.3.6/arm-unknown-linux-gnu/arm-unknown-linux-gnu 
\
--enable-libgcc \
--enable-posix


Thanks for your help,
Pete
