php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8296 (with fix) empty library reference after ./configure
Submitted: 2000-12-16 12:37 UTC Modified: 2000-12-17 12:59 UTC
From: chrismcc+phpbug at pricegrabber dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.0.3pl1 OS: Linux ( Redhat 6.x)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chrismcc+phpbug at pricegrabber dot com
New email:
PHP Version: OS:

 

 [2000-12-16 12:37 UTC] chrismcc+phpbug at pricegrabber dot 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

:)





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-17 12:59 UTC] sniper@php.net
This is fixed already. Please try latest snapshot from http://snaps.php.net/
or wait for PHP 4.0.4 to be released.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 17:01:33 2024 UTC