ID: 25896
Comment by: valdes at uchicago dot edu
Reported By: kscott at toadmail dot com
Status: No Feedback
Bug Type: DBM/DBA related
Operating System: Solaris 8
PHP Version: 4.3.4RC1
New Comment:
This form says not to submit "this is how I solved it"
comments to bugs that aren't open, but since I didn't
originally submit this bug, I don't know how else to
follow up on it. So here goes.
I had this same problem, also on Solaris, when trying
to configure php 4.3.9 with db2 or db3. My db
libraries and includes are in /usr/local/lib & /usr/
local/include, resp, and configure properly finds them.
However, when "configure" compiles conftest's that use
libdb*.*, the library option (-ldb*) is placed before
conftest.c on the command line, and hence the
compilation fails with a link error. Eg, for db3, the
config.log file shows:
configure:23508: cc -o conftest -O
-D_POSIX_PTHREAD_SEMANTICS -L/usr/local/lib -ldb3
-R/usr/ucblib -L/usr/ucblib conftest.c -lresolv -lm
-ldl -lnsl -lsocket 1>&5
which fails with:
Undefined first referenced
symbol in file
db_create conftest.o
ld: fatal: Symbol referencing errors. No output written
to conftest
The problem is that the "-ldb3" in the compilation
command should come after the source file conftest.c.
One way to fix this in the configure script is by
changing the lines around, eg, 23490 from
old_LDFLAGS=$LDFLAGS
LDFLAGS="-L$THIS_PREFIX/lib -l$LIB $LDFLAGS"
to
old_LDFLAGS=$LDFLAGS
LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
LIBS="-l$LIB $LIBS"
The proper fix would be to change the lines in ext/dba/
config.m4 that generate the relevant lines in
configure, but I don't speak autoconf at the moment, so
I can't produce a proper patch. The bug is present for
both db2 and db3 (and I'm guessing db4 too--I don't
have db4 installed, so I didn't test it), so multiple
changes are required.
Previous Comments:
------------------------------------------------------------------------
[2003-10-28 04:47:46] [EMAIL PROTECTED]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
------------------------------------------------------------------------
[2003-10-17 09:49:34] [EMAIL PROTECTED]
Check the config.log for more information about why it fails.
------------------------------------------------------------------------
[2003-10-17 09:41:49] kscott at toadmail dot com
Description:
------------
Also found this to be true in 4.3.3, but since 4.3.0 had already been
installed on the system, I believe it worked ok. The problem is that
configure complains the major version doesn't match the header. In
fact, the header was fine, the library was recompiled a couple times
and reinstalled just to be sure. To work around this, I forced
THIS_LIBS to equal $LIBS, and the configuration continued, and it
appears PHP is working okay. I really couldn't figure out why it
fails.
The version of DB3 I'm using is 3.2.9. I haven't tried another version
yet. OS is Solaris 8. PHP versions attempted, 4.3.4RC1 and 4.3.3.
Both failed in same way.
Reproduce code:
---------------
Source near line 22980 in "configure."
Expected result:
----------------
It should detect and configure for DB3.
Actual result:
--------------
checking for db3 major version... error: Header contains different
version
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25896&edit=1