solution to AIX "file *.lo contains an incorrect file suffix" error
| From: | Brandon Craig Rhodes | Date: | Wed, 22 Jan 2003 21:15:30 +0000 |
| Subject: | solution to AIX "file *.lo contains an incorrect file suffix" error | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-9800@lists.php.net to get a copy of this message | ||
Our PHP 4.3.0 build failed to compile sapi/cli/php on our AIX machine,
with over one hundred error messages like:
cc: 1501-218 file ext/ctype/ctype.lo contains an incorrect file suffix
The causes of this are rather subtle:
1. GNU libtool will usually not create static objects under AIX.
2. But the PHP developers want libtool to create static objects.
3. So the PHP developers provide their own ./libtool in the source
tree which will create them, which they run with "/bin/sh libtool".
4. Unfortunately, while "/bin/sh <file>" usually looks for <file> in
the current directory before searching through $PATH, on AIX it
looks through $PATH first; thus the PHP Makefile winds up running
/usr/local/bin/libtool (or wherever you have it installed) instead.
Thus the solution is to modify the PHP Makefile so that the line
LIBTOOL = $(SHELL) libtool --silent
instead reads
LIBTOOL = $(SHELL) ./libtool --silent
Technical notes: When you compile and install libtool, it runs a
script called libtool.m4 which, around line 2363 in the libtool-1.4.3
source, disables AIX static linking with the explanation that:
"On AIX, shared libraries and static libraries use the same
namespace, and are all built from PIC."
It disables static linking by setting enable_static=no when it writes
your libtool script; the ./libtool script in the PHP build directory
works precisely because this variable is set to "yes" instead.
--
Brandon Craig Rhodes brandon@rhodesmill.org http://rhodesmill.org/brandon