When downloading open-source software from the internet (in this case: PHP 5.5.5), they often come with an Automake "script" (if I can call it a script) for building from source.
Now I'm trying to cross-compile for a different architecture, but I keep getting a different error whenever I specify a different ./configure --switch. Typically, this error is a short non-descriptive message that means absolutely nothing to anyone except the developer.
checking "whether flock struct is linux ordered"... configure: error: in `/usr/src/hd/lib/php-5.5.5': configure: error: cannot run test program while cross compiling
Followed by:
See `config.log' for more details
So I type:
cat ./config.log
But really, the only thing out of the ordinary that it's showing me is this:
configure: exit 1
--
So what gives? How can I tell what the problem is?
FYI, my configure options look somewhat like this:
./configure --prefix="`pwd`/install/" \
--build="i386-pc-linux-gnu" \
--host="mips-linux-gnu" \
--target="mips-linux-gnu" \
--with-libxml-dir="/usr/src/hd/lib/libxml2-2.7.8/install/" \
--enable-soap \
CC="mips-linux-gnu-gcc" \
CFLAGS="-O2 -EL -march=74kf" \
CPP="mips-linux-gnu-cpp" \
CPPFLAGS="-I$CROSS_ROOTFS/include" \
CXX="mips-linux-gnu-g++" \
CXXFLAGS="-O2 -EL -march=74kf" \
CXXCPP="mips-linux-gnu-cpp" \
AR="mips-linux-gnu-ar" \
RANLIB="mips-linux-gnu-ranlib" \
AS="mips-linux-gnu-as" \
NM="mips-linux-gnu-nm" \
LD="mips-linux-gnu-ld" \
LDFLAGS="-L$CROSS_ROOTFS/lib" \
ADDR2LINE="mips-linux-gnu-addr2line"
As you may not know, I'm using the CodeSourcery toolchain to cross-compile for mips. I am aware that I don't need to specify all of the variables (such as RANLIB), but I don't see how it could hurt.
UPDATE
The problem seems to lie in one (or more) of the bundled extensions, as listed here: http://php.net/manual/en/extensions.membership.php
Configuring with --disable-all works. But obviously, I do need at least some of those bundled extensions in order to do some real work.
Still, how can I tell which one?
UPDATE
I narrowed the problem down to an extension called OPcache that was enabled by default (see: https://www.php.net/manual/en/opcache.installation.php). It successfully compiled after disabling that, along with some other extensions that wouldn't work on my target system anyway.
Still, this was not obvious to me at all. What I did was work my way backwards from the output log, disabling listed extensions one by one until the stupid thing would finally work.
Surely there has to exist a better way to pinpoint problems like these? Otherwise what the hell is the entire point of this automake nonsense?