PHP 4.0 Bug #8296 Updated: (with fix) empty library reference after ./configure

From: Date: Sun, 17 Dec 2000 17:59:34 +0000
Subject: PHP 4.0 Bug #8296 Updated: (with fix) empty library reference after ./configure
Groups: php.dev 
Request: Send a blank email to php-dev+get-41678@lists.php.net to get a copy of this message
ID: 8296 Updated by: sniper Reported By: chrismcc+phpbug@pricegrabber.com Old-Status: Open Status: Closed Bug Type: Compile Failure Assigned To: Comments: This is fixed already. Please try latest snapshot from http://snaps.php.net/ or wait for PHP 4.0.4 to be released. --Jani Previous Comments: --------------------------------------------------------------------------- [2000-12-16 12:37:33] chrismcc+phpbug@pricegrabber.com Using the php rpm from RH7 and recomliling on RH6.x produces the following configure error checking whether to include GNU gettext support... yes checking for bindtextdomain in -lintl... no checking for bindtextdomain in -lc... no configure: error: Unable to find required gettext library Where gettext IS there. ./configure ... --with-db2 and --with-db3 ... is used, but db2 and db3 are not installed on the system earlier in configure output ... checking for db_create in -ldb... no checking for db_create in -ldb-3... no ... They are not found, But -l gets added the $LIBS After much testing this is a fix. --- aclocal.m4.pricegrabber Fri Dec 15 15:48:32 2000 +++ aclocal.m4 Fri Dec 15 15:47:56 2000 @@ -557,7 +557,7 @@ dnl AC_DEFUN(AC_ADD_LIBRARY,[ case "$1" in - c|c_r|pthread*) ;; + c|c_r|pthread*|'') ;; *) ifelse($3,,[ PHP_X_ADD_LIBRARY($1,$2,LIBS) What happens is the case statment will fall through if the tests are false. IT falls through with an empty $THIS_LIBS variable --from configure case "$THIS_LIBS" in c|c_r|pthread*) ;; *) LIBS="-l$THIS_LIBS $LIBS" ;; esac ---end from if LIBS=-lfoo -lbar when $THIS_LIBS is empty you end up with LIBS="-l -lfoo -lbar" the next compile test tries to use these libraries i.e. configure:16753: checking for bindtextdomain in -lc configure:16772: gcc -o conftest -O2 -march=i686 -fPIC -L/usr/lib conftest.c -lc -lttf -ljpeg -lgd -l -ldb -lgdbm -lresolv -lm -ldl -lcrypt -lnsl -lttf -lpng -ljpeg -lz -lresolv -L/usr/lib -ljpeg 1>&5 /usr/bin/ld: cannot open -l-ldb: No such file or directory -lgd -l -ldb -lgdbm ends up -lgd -l-ldb -lgdbm The solution is for the case statement to handle a NULL or empty case case ... c|c_r|pthread*|'') ;; This IMHO, is a nasty bug and took me several hours to find. p.s. I like getting my name in READMEs and CHANGELOGS :) --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=8296

« previous php.dev (#41678) next »