From: Rasmus Lerdorf Date: Wed, 10 Nov 1999 19:22:35 +0000 (+0000) Subject: # Improve the GD lib detection when GD is on the ld_path and it is X-Git-Tag: php-4.0b3_RC5~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a4e1a9b0f854c990c2e39541a7778de68a2e485;p=php # Improve the GD lib detection when GD is on the ld_path and it is # configure using just --with-gd --- diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index d2148f93b6..8d6d819ecb 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -20,8 +20,21 @@ AC_ARG_WITH(gd, AC_MSG_RESULT(yes (static)) AC_ADD_LIBRARY(gd) fi - AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ]) - ac_cv_lib_gd_gdImageLine=yes + old_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -L$GD_LIB" + old_LIBS=$LIBS + AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ]) + LIBS="$LIBS -lpng -lz" + AC_CHECK_LIB(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE,1)]) + AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1)]) + + LIBS=$old_LIBS + LDFLAGS=$old_LDFLAGS + if test "$ac_cv_lib_gd_gdImageCreateFromPng" = "yes"; then + AC_ADD_LIBRARY(png) + AC_ADD_LIBRARY(z) + fi + ac_cv_lib_gd_gdImageLine=yes ;; *) dnl A whole whack of possible places where this might be @@ -45,7 +58,6 @@ dnl A whole whack of possible places where this might be test -f $withval/libgd.a && GD_LIB="$withval" test -f $withval/gd/libgd.a && GD_LIB="$withval/gd" test -f $withval/gd1.3/libgd.a && GD_LIB="$withval/gd1.3" - if test -n "$GD_INCLUDE" && test -n "$GD_LIB" ; then AC_DEFINE(HAVE_LIBGD) if test "$shared" = "yes"; then