]> granicus.if.org Git - php/commitdiff
# Improve the GD lib detection when GD is on the ld_path and it is
authorRasmus Lerdorf <rasmus@php.net>
Wed, 10 Nov 1999 19:22:35 +0000 (19:22 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Wed, 10 Nov 1999 19:22:35 +0000 (19:22 +0000)
# configure using just --with-gd

ext/gd/config.m4

index d2148f93b690dee26d4fec746ce09f80b95ebae7..8d6d819ecbc49321382fb8c3b0d5c82127b5e940 100644 (file)
@@ -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