Configuring PHP 5.2.3 with GD support for Mac OS X
PHP 5.2.3 does not seem to want to configure with GD support on Mac OS X for some reason. When configuring, you may notice this error:
Expand|Select|Wrap|Line Numbers
- configure: error: GD build test failed. Please check the config.log for details.
Expand|Select|Wrap|Line Numbers
- configure:42434: gcc -o conftest -g -O2 -no-cpp-precomp -L/usr/local/lib -L/usr/local/lib conftest.c -L -lfreetype -lpng -lz -ljpeg -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm 1>&5
- /usr/bin/ld: -L: directory name missing
- collect2: ld returned 1 exit status
The easy solution is to remove that errant '-L', since it doesn't do anything (except crash the configure script, that is). But where is it?
Looking on line 42434 of the configure script doesn't look too helpful....
Expand|Select|Wrap|Line Numbers
- if { (eval echo configure:42434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
- then
Expand|Select|Wrap|Line Numbers
- ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
But where is $LIBS defined?
Moving backwards from line 42434, we encounter this definition on line 42415:
Expand|Select|Wrap|Line Numbers
- LIBS=" -L$GD_LIB $GD_SHARED_LIBADD $LIBS"
Simply remove that part of the string:
Expand|Select|Wrap|Line Numbers
- LIBS=" $GD_SHARED_LIBADD $LIBS"