]> granicus.if.org Git - php/commitdiff
MFB: Fix bug #20995
authorfoobar <sniper@php.net>
Sat, 14 Dec 2002 09:33:37 +0000 (09:33 +0000)
committerfoobar <sniper@php.net>
Sat, 14 Dec 2002 09:33:37 +0000 (09:33 +0000)
ext/gd/config.m4

index ba8ca5d0ad3242e02a38ec0154b92fa92bf40a23..fcbedc73e7b8ebdd7fcae465e73f6e86f0c21b79 100644 (file)
@@ -242,22 +242,6 @@ AC_DEFUN(PHP_GD_CHECK_VERSION,[
   PHP_CHECK_LIBRARY(gd, gdImageGifCtx,          [AC_DEFINE(HAVE_GD_GIF_CTX,          1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
 ])
 
-dnl
-dnl Check for gd 2.0.4 greater availability
-dnl
-
-AC_TRY_COMPILE(
-[
-#include <gd.h>
-#include <stdlib.h>
-], [
-gdIOCtx *ctx;
-ctx = malloc(sizeof(gdIOCtx));
-ctx->gd_free = 1;
-], [
-  AC_DEFINE(HAVE_LIBGD204, 1, [ ])
-])
-
 dnl
 dnl Main GD configure
 dnl 
@@ -363,6 +347,24 @@ dnl Library path
   fi 
 
   PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE)
+
+  dnl
+  dnl Check for gd 2.0.4 greater availability
+  dnl
+  old_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS=-I$GD_INCLUDE
+  AC_TRY_COMPILE([
+#include <gd.h>
+#include <stdlib.h>
+  ], [
+gdIOCtx *ctx;
+ctx = malloc(sizeof(gdIOCtx));
+ctx->gd_free = 1;
+  ], [
+    AC_DEFINE(HAVE_LIBGD204, 1, [ ])
+  ])
+  CPPFLAGS=$old_CPPFLAGS
+
  fi
 fi