#36110 [NEW]: ./configure fails when checking for gd, gdImageCreate
| From: | ifette at gmail dot com | Date: | Fri, 20 Jan 2006 20:17:28 +0000 |
| Subject: | #36110 [NEW]: ./configure fails when checking for gd, gdImageCreate | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-92311@lists.php.net to get a copy of this message | ||
From: ifette at gmail dot com
Operating system: Linux 2.6.14-gentoo-r2 #2 SMP PR
PHP version: 6CVS-2006-01-20 (CVS)
PHP Bug Type: Compile Failure
Bug description: ./configure fails when checking for gd, gdImageCreate
Description:
------------
When trying to run ./configure, configure fails when checking for the
presence of libgd.
checking for gdImageCreate in -lgd... no
configure: error: GD build test failed. Please check the config.log for
details. (I only get this error when using --with-gd=/usr. If I use the
built-in gd, it compiles).
The problem appears to be the code that the configure script is using: It
tries to execute:
gcc -o conftest -g -O2 -Wl,-rpath, -L conftest.c -lgd -lcurl -lbz2 -lz
-lresolv -lm -ldl -lnsl -lm -licui18n -licuuc -licudata -lm -licuio
-lxml2 -lz -lm -lssl -lcrypto -ldl -lcurl -lidn -lssl -lcrypto -ldl -lz
-lxml2 -lz -lm -lgd 1>&5
The -L there is causing a huge problem. The failure is
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../crt1.o: In function
`_start':
init.c:(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
If the -L is removed (or a path is added after -L), then everything
compiles fine.
Reproduce code:
---------------
./configure --prefix=/nonportage/php --with-openssl --with-zlib
--with-bz2
--with-gd=/usr --with-mcrypt
--with-mysqli=/nonportage/mysql/bin/mysql_config
--with-apxs2=/usr/sbin/apxs2 --enable-mbstring --with-curl
--with-mysql=/nonportage/mysql
Expected result:
----------------
I expect it to complete configure :-)
Actual result:
--------------
configure:34794: checking for gdImageCreate in -lgd
configure:34813: gcc -o conftest -g -O2 -Wl,-rpath, -L conftest.c -lgd
-lcurl -lbz2 -lz -lresolv -lm -ldl -lnsl -lm -licui18n -licuuc -licudata
-lm -licuio -lxml2 -lz -lm -lssl -lcrypto -ldl -lcurl -lidn -lssl -lcrypto
-ldl -lz -lxml2 -lz -lm -lgd 1>&5
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../crt1.o: In function
`_start':
init.c:(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
configure: failed program was:
#line 34802 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gdImageCreate();
int main() {
gdImageCreate()
; return 0; }
--
Edit bug report at http://bugs.php.net/?id=36110&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36110&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36110&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36110&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36110&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36110&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36110&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36110&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36110&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36110&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36110&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36110&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36110&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36110&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36110&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36110&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36110&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36110&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36110&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36110&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36110&r=mysqlcfg