rasmus                                   Thu, 12 May 2011 08:19:37 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=310964

Log:
Check headers first and let the CHECK_LIBRARY macro
handle checking for the library. This makes it
correctly handle non-standard system paths as long
as gcc knows about them. Should fix the build on
Ubuntu natty.

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/gd/config.m4
    U   php/php-src/trunk/ext/gd/config.m4

Modified: php/php-src/branches/PHP_5_3/ext/gd/config.m4
===================================================================
--- php/php-src/branches/PHP_5_3/ext/gd/config.m4       2011-05-12 06:51:46 UTC 
(rev 310963)
+++ php/php-src/branches/PHP_5_3/ext/gd/config.m4       2011-05-12 08:19:37 UTC 
(rev 310964)
@@ -72,11 +72,11 @@
   if test "$PHP_JPEG_DIR" != "no"; then

     for i in $PHP_JPEG_DIR /usr/local /usr; do
-      test -f $i/$PHP_LIBDIR/libjpeg.$SHLIB_SUFFIX_NAME || test -f 
$i/$PHP_LIBDIR/libjpeg.a && GD_JPEG_DIR=$i && break
+      test -f $i/include/jpeglib.h && GD_JPEG_DIR=$i && break
     done

     if test -z "$GD_JPEG_DIR"; then
-      AC_MSG_ERROR([libjpeg.(a|so) not found.])
+      AC_MSG_ERROR([jpeglib.h not found.])
     fi

     PHP_CHECK_LIBRARY(jpeg,jpeg_read_header,
@@ -97,21 +97,17 @@
   if test "$PHP_PNG_DIR" != "no"; then

     for i in $PHP_PNG_DIR /usr/local /usr; do
-      test -f $i/$PHP_LIBDIR/libpng.$SHLIB_SUFFIX_NAME || test -f 
$i/$PHP_LIBDIR/libpng.a && GD_PNG_DIR=$i && break
+      test -f $i/include/png.h && GD_PNG_DIR=$i && break
     done

     if test -z "$GD_PNG_DIR"; then
-      AC_MSG_ERROR([libpng.(a|so) not found.])
+      AC_MSG_ERROR([png.h not found.])
     fi

     if test "$PHP_ZLIB_DIR" = "no"; then
       AC_MSG_ERROR([PNG support requires ZLIB. Use --with-zlib-dir=<DIR>])
     fi

-    if test ! -f $GD_PNG_DIR/include/png.h; then
-      AC_MSG_ERROR([png.h not found.])
-    fi
-
     PHP_CHECK_LIBRARY(png,png_write_image,
     [
       PHP_ADD_INCLUDE($GD_PNG_DIR/include)

Modified: php/php-src/trunk/ext/gd/config.m4
===================================================================
--- php/php-src/trunk/ext/gd/config.m4  2011-05-12 06:51:46 UTC (rev 310963)
+++ php/php-src/trunk/ext/gd/config.m4  2011-05-12 08:19:37 UTC (rev 310964)
@@ -77,11 +77,11 @@
   if test "$PHP_VPX_DIR" != "no"; then

     for i in $PHP_VPX_DIR /usr/local /usr; do
-      test -f $i/$PHP_VPX_DIR/libvpx.$SHLIB_SUFFIX_NAME || test -f 
$i/$PHP_LIBDIR/libvpx.a && GD_VPX_DIR=$i && break
+      test -f $i/include/vpx_codec.h || test -f $i/include/vpx/vpx_codec.h && 
GD_VPX_DIR=$i && break
     done

     if test -z "$GD_VPX_DIR"; then
-      AC_MSG_ERROR([libvpx.(a|so) not found.])
+      AC_MSG_ERROR([vpx_codec.h not found.])
     fi

     PHP_CHECK_LIBRARY(vpx,vpx_codec_destroy,
@@ -103,11 +103,11 @@
   if test "$PHP_JPEG_DIR" != "no"; then

     for i in $PHP_JPEG_DIR /usr/local /usr; do
-      test -f $i/$PHP_LIBDIR/libjpeg.$SHLIB_SUFFIX_NAME || test -f 
$i/$PHP_LIBDIR/libjpeg.a && GD_JPEG_DIR=$i && break
+      test -f $i/include/jpeglib.h && GD_JPEG_DIR=$i && break
     done

     if test -z "$GD_JPEG_DIR"; then
-      AC_MSG_ERROR([libjpeg.(a|so) not found.])
+      AC_MSG_ERROR([jpeglib.h not found.])
     fi

     PHP_CHECK_LIBRARY(jpeg,jpeg_read_header,
@@ -128,21 +128,17 @@
   if test "$PHP_PNG_DIR" != "no"; then

     for i in $PHP_PNG_DIR /usr/local /usr; do
-      test -f $i/$PHP_LIBDIR/libpng.$SHLIB_SUFFIX_NAME || test -f 
$i/$PHP_LIBDIR/libpng.a && GD_PNG_DIR=$i && break
+      test -f $i/include/png.h && GD_PNG_DIR=$i && break
     done

     if test -z "$GD_PNG_DIR"; then
-      AC_MSG_ERROR([libpng.(a|so) not found.])
+      AC_MSG_ERROR([png.h not found.])
     fi

     if test "$PHP_ZLIB_DIR" = "no"; then
       AC_MSG_ERROR([PNG support requires ZLIB. Use --with-zlib-dir=<DIR>])
     fi

-    if test ! -f $GD_PNG_DIR/include/png.h; then
-      AC_MSG_ERROR([png.h not found.])
-    fi
-
     PHP_CHECK_LIBRARY(png,png_write_image,
     [
       PHP_ADD_INCLUDE($GD_PNG_DIR/include)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to