From 644ca8810095c28eca47cb8b7d3a8d6855131148 Mon Sep 17 00:00:00 2001 From: foobar Date: Fri, 20 Jan 2006 21:58:17 +0000 Subject: [PATCH] =?utf8?q?-=20Fixed=20bug=20#=C3=8236110=20(missing=20sani?= =?utf8?q?ty=20checks=20for=20external=20build)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ext/gd/config.m4 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index ba5f2edf9a..6ef2e2810f 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -208,19 +208,23 @@ AC_DEFUN([PHP_GD_JISX0208], AC_DEFUN([PHP_GD_CHECK_VERSION], [ AC_MSG_CHECKING([for GD library version]) - GD_VERSION=`$GDLIB_CONFIG --version` - AC_DEFINE_UNQUOTED(PHP_GD_VERSION_STRING, "$GD_VERSION", [GD library version]) + GD_VERSION=`$GDLIB_CONFIG --version 2> /dev/null` + + if test -z "$GD_VERSION"; then + AC_MSG_ERROR([invalid gdlib-config passed to --with-gd!]) + fi ac_IFS=[$]IFS IFS="." set $GD_VERSION IFS=$ac_IFS - GD_VERNUM=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` + GD_VERNUM=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3 2> /dev/null` if test "$GD_VERNUM" -lt "2000033"; then AC_MSG_ERROR([GD version 2.0.33 or greater required.]) else + AC_DEFINE_UNQUOTED(PHP_GD_VERSION_STRING, "$GD_VERSION", [GD library version]) AC_MSG_RESULT([$GD_VERSION]) fi ]) @@ -263,7 +267,7 @@ dnl These are always defined with bundled library elif test "$PHP_GD" != "no"; then - if test -x "$PHP_GD"; then + if test -f "$PHP_GD" && test -x "$PHP_GD"; then GDLIB_CONFIG=$PHP_GD PHP_GD_CHECK_VERSION else -- 2.50.1