]> granicus.if.org Git - php/commitdiff
- Add better zlib detection
authorPierre Joye <pajoye@php.net>
Tue, 26 Dec 2006 10:42:25 +0000 (10:42 +0000)
committerPierre Joye <pajoye@php.net>
Tue, 26 Dec 2006 10:42:25 +0000 (10:42 +0000)
ext/gd/config.m4

index 6ef2e2810fd6dc11a33d45afb0933fdc7b787b68..343374fb5fd54681b33ce4f9151b75ad7059af47 100644 (file)
@@ -44,6 +44,30 @@ dnl
 dnl Checks for the configure options 
 dnl 
 
+AC_DEFUN([PHP_GD_ZLIB],[
+       if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
+               if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
+                       PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
+                       PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib"
+               elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then
+                       PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
+                       PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
+               else
+                       AC_MSG_ERROR([Can't find zlib headers under "$PHP_ZLIB_DIR"])
+               fi
+       else
+               for i in /usr/local /usr; do
+                       if test -f "$i/include/zlib/zlib.h"; then
+                               PHP_ZLIB_DIR="$i"
+                               PHP_ZLIB_INCDIR="$i/include/zlib"
+                       elif test -f "$i/include/zlib.h"; then
+                               PHP_ZLIB_DIR="$i"
+                               PHP_ZLIB_INCDIR="$i/include"
+                       fi
+               done
+       fi
+])
+
 AC_DEFUN([PHP_GD_JPEG],
 [
   if test "$PHP_JPEG_DIR" != "no"; then
@@ -248,7 +272,7 @@ dnl check for fabsf and floorf which are available since C99
 
 dnl Depending which libraries were included to PHP configure,
 dnl enable the support in bundled GD library
-
+  PHP_GD_ZLIB
   PHP_GD_TTSTR
   PHP_GD_JISX0208
   PHP_GD_JPEG