Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ext/gd/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ dnl
dnl Checks for the configure options
dnl

MACHINE_INCLUDES=$($CC -dumpmachine)

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
Expand All @@ -50,6 +52,12 @@ AC_DEFUN([PHP_GD_ZLIB],[
elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then
PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
elif test -f "$PHP_ZLIB_DIR/include/$MACHINE_INCLUDES/zlib/zlib.h"; then
PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/$MACHINE_INCLUDES/zlib"
elif test -f "$PHP_ZLIB_DIR/include/$MACHINE_INCLUDES/zlib.h"; then
PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/$MACHINE_INCLUDES"
else
AC_MSG_ERROR([Can't find zlib headers under "$PHP_ZLIB_DIR"])
fi
Expand All @@ -61,6 +69,12 @@ AC_DEFUN([PHP_GD_ZLIB],[
elif test -f "$i/include/zlib.h"; then
PHP_ZLIB_DIR="$i"
PHP_ZLIB_INCDIR="$i/include"
elif test -f "$i/include/$MACHINE_INCLUDES/zlib/zlib.h"; then
PHP_ZLIB_DIR="$i"
PHP_ZLIB_INCDIR="$i/include/$MACHINE_INCLUDES/zlib"
elif test -f "$i/include/$MACHINE_INCLUDES/zlib.h"; then
PHP_ZLIB_DIR="$i"
PHP_ZLIB_INCDIR="$i/include/$MACHINE_INCLUDES"
fi
done
fi
Expand All @@ -71,6 +85,7 @@ AC_DEFUN([PHP_GD_WEBP],[

for i in $PHP_WEBP_DIR /usr/local /usr; do
test -f $i/include/webp/decode.h && GD_WEBP_DIR=$i && break
test -f $i/include/$MACHINE_INCLUDES/webp/decode.h && GD_WEBP_DIR=$i && break
done

if test -z "$GD_WEBP_DIR"; then
Expand All @@ -79,6 +94,7 @@ AC_DEFUN([PHP_GD_WEBP],[

for i in $PHP_WEBP_DIR /usr/local /usr; do
test -f $i/include/webp/encode.h && GD_WEBP_DIR=$i && break
test -f $i/include/$MACHINE_INCLUDES/webp/encode.h && GD_WEBP_DIR=$i && break
done

if test -z "$GD_WEBP_DIR"; then
Expand All @@ -105,6 +121,7 @@ AC_DEFUN([PHP_GD_JPEG],[

for i in $PHP_JPEG_DIR /usr/local /usr; do
test -f $i/include/jpeglib.h && GD_JPEG_DIR=$i && break
test -f $i/include/$MACHINE_INCLUDES/jpeglib.h && GD_JPEG_DIR=$i && break
done

if test -z "$GD_JPEG_DIR"; then
Expand All @@ -130,6 +147,7 @@ AC_DEFUN([PHP_GD_PNG],[

for i in $PHP_PNG_DIR /usr/local /usr; do
test -f $i/include/png.h && GD_PNG_DIR=$i && break
test -f $i/include/$MACHINE_INCLUDES/png.h && GD_PNG_DIR=$i && break
done

if test -z "$GD_PNG_DIR"; then
Expand Down Expand Up @@ -162,6 +180,8 @@ AC_DEFUN([PHP_GD_XPM],[
for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
test -f $i/include/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i && break
test -f $i/include/X11/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i/X11 && break
test -f $i/include/$MACHINE_INCLUDES/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i && break
test -f $i/include/$MACHINE_INCLUDES/X11/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i/X11 && break
done

if test -z "$GD_XPM_DIR"; then
Expand Down