php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mmarek at suse dot cz
New email:
PHP Version: OS:

 

 [2007-05-21 11:17 UTC] mmarek at suse dot cz
Description:
------------
--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:
         /usr/lib64/libdb-4.4.so
         /lib64/libnsl.so.1
         /lib64/libz.so.1

Patches

Pull Requests

History

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
 AC_DEFUN([PHP_DBA_DB_CHECK],[
   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
       PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$LIB,[
         AC_TRY_LINK([
 #include "$THIS_INCLUDE"
@@ -185,10 +186,14 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
 #endif
           ],[
             THIS_LIBS=$LIB
-            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
     fi
   done
   if test -z "$THIS_LIBS"; then
 [2007-05-21 11:39 UTC] tony2001@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Committed your patch with slight modification.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC