|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41455 ext/dba/config.m4 pollutes global $LIBS and $LDFLAGS
Submitted: 2007-05-21 11:17 UTC Modified: 2007-05-21 11:39 UTC
From: mmarek at suse dot cz Assigned:
Status: Closed Package: *Compile Issues
PHP Version: 5.2.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
16 - 14 = ?
Subscribe to this entry?

 [2007-05-21 11:17 UTC] mmarek at suse dot cz
--enable-dba=shared --with-db4=... causes the main php binary be linked against libdb-4.x. It's because the test in ext/dba/config.m4 fails to reset $LIBS and $LDFLAGS. I'll attach a patch.

Reproduce code:
compile with the above options

Expected result:
the cli binary / apache module not linked against libdb-4.x

Actual result:
ldd -u -r /usr/bin/php5
 Unused direct dependencies:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-21 11:20 UTC] mmarek at suse dot cz
Where can I attach a file? :)

Hopefully the lines won't wrap:

breaking out of the for loop right after the link test leaves $LIBS and
$LDFLAGS with their temporary values
--- ext/dba/config.m4.orig
+++ ext/dba/config.m4
@@ -172,6 +172,7 @@ dnl parameters(version, library list, fu
   for LIB in $2; do
     if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then
+      unset PHP_DBA_DB_CHECK_found_it
 #include "$THIS_INCLUDE"
@@ -185,10 +186,14 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
-            break
+            PHP_DBA_DB_CHECK_found_it=1
+      if test -n "$PHP_DBA_DB_CHECK_found_it"; then
+        unset PHP_DBA_DB_CHECK_found_it
+        break
+      fi
   if test -z "$THIS_LIBS"; then
 [2007-05-21 11:39 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Committed your patch with slight modification.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 19 03:03:37 2021 UTC