]> granicus.if.org Git - php/commitdiff
use AC_ADD_ macros
authorStig Bakken <ssb@php.net>
Sun, 25 Jul 1999 14:46:33 +0000 (14:46 +0000)
committerStig Bakken <ssb@php.net>
Sun, 25 Jul 1999 14:46:33 +0000 (14:46 +0000)
ext/gd/config.m4

index 452c151fd30c7dacd8965879a7220a10faa3be2a..77813eb1d4df149aeeb3cd9e42f5714a6cc552ac 100644 (file)
@@ -7,7 +7,7 @@ AC_ARG_WITH(gd,
     no)
       AC_MSG_RESULT(no) ;;
     yes)
-      GD_LIBS="-lgd"
+      AC_ADD_LIBRARY(-lgd)
       AC_DEFINE(HAVE_LIBGD)
       AC_MSG_RESULT(yes)
       AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ])
@@ -15,12 +15,19 @@ AC_ARG_WITH(gd,
       ;;
     *)
 dnl A whole whack of possible places where this might be
-      test -f $withval/include/gd1.3/gd.h && GD_INCLUDE="-I$withval/include/gd1.3"
-      test -f $withval/include/gd/gd.h && GD_INCLUDE="-I$withval/include/gd"
-      test -f $withval/include/gd.h && GD_INCLUDE="-I$withval/include"
-      test -f $withval/gd1.3/gd.h && GD_INCLUDE="-I$withval/gd1.3"
-      test -f $withval/gd/gd.h && GD_INCLUDE="-I$withval/gd"
-      test -f $withval/gd.h && GD_INCLUDE="-I$withval"
+      test -f $withval/include/gd1.3/gd.h && GD_INCLUDE="$withval/include/gd1.3"
+      test -f $withval/include/gd/gd.h && GD_INCLUDE="$withval/include/gd"
+      test -f $withval/include/gd.h && GD_INCLUDE="$withval/include"
+      test -f $withval/gd1.3/gd.h && GD_INCLUDE="$withval/gd1.3"
+      test -f $withval/gd/gd.h && GD_INCLUDE="$withval/gd"
+      test -f $withval/gd.h && GD_INCLUDE="$withval"
+
+      test -f $withval/lib/libgd.so && GD_LIB="$withval/lib"
+      test -f $withval/lib/gd/libgd.so && GD_LIB="$withval/lib/gd"
+      test -f $withval/lib/gd1.3/libgd.so && GD_LIB="$withval/lib/gd1.3"
+      test -f $withval/libgd.so && GD_LIB="$withval"
+      test -f $withval/gd/libgd.so && GD_LIB="$withval/gd"
+      test -f $withval/gd1.3/libgd.so && GD_LIB="$withval/gd1.3"
 
       test -f $withval/lib/libgd.a && GD_LIB="$withval/lib"
       test -f $withval/lib/gd/libgd.a && GD_LIB="$withval/lib/gd"
@@ -30,13 +37,13 @@ dnl A whole whack of possible places where this might be
       test -f $withval/gd1.3/libgd.a && GD_LIB="$withval/gd1.3"
 
       if test -n "$GD_INCLUDE" && test -n "$GD_LIB" ; then
-        GD_LIBS="-L$GD_LIB -lgd"
+        AC_ADD_LIBRARY_WITH_PATH(-lgd, $GD_LIB)
         AC_DEFINE(HAVE_LIBGD)
         AC_MSG_RESULT(yes)
         AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13) ])
        ac_cv_lib_gd_gdImageLine=yes
       else
-        AC_MSG_ERROR(Unable to find libgd.a anywhere under $withval)
+        AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $withval])
       fi ;;
   esac
 ],[
@@ -84,7 +91,7 @@ if test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
   fi
   
   if test -f /usr/pkg/include/gd/gd.h -a -z "$GD_INCLUDE" ; then
-    GD_INCLUDE="-I/usr/pkg/include/gd"
+    GD_INCLUDE="/usr/pkg/include/gd"
   fi
 
   AC_MSG_CHECKING(whether to enable 4bit antialias hack with FreeType2)
@@ -101,6 +108,5 @@ if test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
   ])
   
   PHP_EXTENSION(gd)
-  EXTRA_LIBS="$EXTRA_LIBS $GD_LIBS"
-  INCLUDES="$INCLUDES $GD_INCLUDE"
+  AC_ADD_INCLUDE($GD_INCLUDE)
 fi