]> granicus.if.org Git - php/commitdiff
Support also --with-gd (without path). Please test this!
authorfoobar <sniper@php.net>
Tue, 23 Oct 2001 09:19:11 +0000 (09:19 +0000)
committerfoobar <sniper@php.net>
Tue, 23 Oct 2001 09:19:11 +0000 (09:19 +0000)
ext/gd/config.m4

index ac5d1db672998bcc888dbacbd611bea5157ccef5..ee3bc62272df163e23148c27cf67028db4536a80 100644 (file)
@@ -224,31 +224,29 @@ dnl Various checks for GD features
   PHP_GD_FREETYPE1
   PHP_GD_T1LIB
 
-  case $PHP_GD in
-    yes)
-      PHP_ADD_LIBRARY(gd,, GD_SHARED_LIBADD)
-      PHP_GD_CHECK_VERSION
-      AC_DEFINE(HAVE_LIBGD,1,[ ])
-       ;;
-    *)
-dnl A whole whack of possible places where these might be
-      for i in include/gd1.3 include/gd include gd1.3 gd ""; do
-        test -f $PHP_GD/$i/gd.h && GD_INCLUDE=$PHP_GD/$i
-      done
-
-      for i in lib/gd1.3 lib/gd lib gd1.3 gd ""; do
-        test -f $PHP_GD/$i/libgd.$SHLIB_SUFFIX_NAME -o -f $PHP_GD/$i/libgd.a && GD_LIB=$PHP_GD/$i
-      done
-
-      if test -n "$GD_INCLUDE" -a -n "$GD_LIB" ; then
-        PHP_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB, GD_SHARED_LIBADD)
-        AC_DEFINE(HAVE_LIBGD,1,[ ])
-        PHP_GD_CHECK_VERSION
-      else
-        AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $withval])
-      fi 
-    ;;
-  esac
+  if test "$PHP_GD" = "yes"; then
+    GD_SEARCH_PATHS="/usr/local /usr"
+  else
+    GD_SEARCH_PATHS=$PHP_GD
+  fi
+
+  for j in $GD_SEARCH_PATHS; do
+    for i in include/gd1.3 include/gd include gd1.3 gd ""; do
+      test -f $j/$i/gd.h && GD_INCLUDE=$j/$i
+    done
+
+    for i in lib/gd1.3 lib/gd lib gd1.3 gd ""; do
+      test -f $j/$i/libgd.$SHLIB_SUFFIX_NAME -o -f $j/$i/libgd.a && GD_LIB=$j/$i
+    done
+  done
+
+  if test -n "$GD_INCLUDE" -a -n "$GD_LIB" ; then
+    PHP_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB, GD_SHARED_LIBADD)
+    AC_DEFINE(HAVE_LIBGD,1,[ ])
+    PHP_GD_CHECK_VERSION
+  else
+    AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $withval])
+  fi 
 
 dnl NetBSD package structure
   if test -f /usr/pkg/include/gd/gd.h -a -z "$GD_INCLUDE" ; then