php-src/ext/gd/config.m4

250 lines
8.0 KiB
Plaintext
Raw Normal View History

2001-05-10 00:55:48 +00:00
dnl
dnl $Id$
dnl
AC_DEFUN(PHP_GD_JPEG,[
2001-05-10 00:55:48 +00:00
PHP_ARG_WITH(jpeg-dir, for the location of libjpeg,
[ --with-jpeg-dir=DIR GD: Set the path to libjpeg install prefix.])
if test "$PHP_JPEG_DIR" != "no"; then
for i in /usr /usr/local $PHP_JPEG_DIR; do
test -f "$i/lib/libjpeg.s?" -o -f "$i/lib/libjpeg.a" && GD_JPEG_DIR=$i
done
2001-05-10 23:55:56 +00:00
AC_CHECK_LIB(jpeg,jpeg_read_header,
[
PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/lib, GD_SHARED_LIBADD)
2001-05-10 00:55:48 +00:00
],[
AC_MSG_ERROR(Problem with libjpeg.(a|so). Please check config.log for more information.)
2001-05-10 00:55:48 +00:00
],[
-L$GD_JPEG_DIR/lib
2001-05-10 00:55:48 +00:00
])
else
AC_MSG_RESULT(If configure fails try --with-jpeg-dir=<DIR>)
2001-05-10 00:55:48 +00:00
fi
])
2001-04-13 12:00:12 +00:00
AC_DEFUN(PHP_GD_PNG,[
2001-05-10 00:55:48 +00:00
PHP_ARG_WITH(png-dir, for the location of libpng,
[ --with-png-dir=DIR GD: Set the path to libpng install prefix.])
if test "$PHP_PNG_DIR" != "no"; then
for i in /usr /usr/local $PHP_PNG_DIR; do
test -f "$i/lib/libpng.s?" -o -f "$i/lib/libpng.a" && GD_PNG_DIR=$i
done
2001-05-10 23:55:56 +00:00
if test "$PHP_ZLIB_DIR" = "no"; then
AC_MSG_ERROR(PNG support requires ZLIB. Use --with-zlib-dir=<DIR>)
fi
AC_CHECK_LIB(png,png_info_init,
[
2001-05-10 00:55:48 +00:00
PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, GD_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/lib, GD_SHARED_LIBADD)
2001-05-10 00:55:48 +00:00
],[
AC_MSG_ERROR(Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information.)
2001-05-10 00:55:48 +00:00
],[
-L$PHP_ZLIB_DIR/lib -lz -L$GD_PNG_DIR/lib
2001-05-10 00:55:48 +00:00
])
else
AC_MSG_RESULT(If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>)
2001-05-10 00:55:48 +00:00
fi
2001-04-13 12:00:12 +00:00
])
AC_DEFUN(PHP_GD_XPM,[
2001-05-10 00:55:48 +00:00
PHP_ARG_WITH(xpm-dir, for the location of libXpm,
[ --with-xpm-dir=DIR GD: Set the path to libXpm install prefix.])
if test "$PHP_XPM_DIR" != "no"; then
for i in /usr /usr/local /usr/X11R6 $PHP_XPM_DIR; do
test -f "$i/lib/libXpm.s?" -o -f "$i/lib/libXpm.a" && GD_XPM_DIR=$i
done
2001-05-10 23:55:56 +00:00
AC_CHECK_LIB(Xpm,XpmFreeXpmImage,
[
PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_DIR/lib, GD_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_DIR/lib, GD_SHARED_LIBADD)
2001-05-10 00:55:48 +00:00
],[
AC_MSG_ERROR(Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information.)
2001-05-10 00:55:48 +00:00
],[
-L$GD_XPM_DIR/lib -lX11
2001-05-10 00:55:48 +00:00
])
else
AC_MSG_RESULT(If configure fails try --with-xpm-dir=<DIR>)
fi
])
2001-05-10 00:55:48 +00:00
AC_DEFUN(PHP_GD_FREETYPE1,[
PHP_ARG_WITH(ttf,whether to include include FreeType 1.x support,
[ --with-ttf[=DIR] GD: Include FreeType 1.x support])
if test "$PHP_TTF" != "no"; then
if test "$PHP_FREETYPE_DIR" = "no" -o "$PHP_FREETYPE_DIR" = ""; then
if test -n "$PHP_TTF" ; then
for i in /usr /usr/local $PHP_TTF; do
2001-05-10 00:55:48 +00:00
if test -f "$i/include/freetype.h" ; then
2001-05-12 11:09:05 +00:00
TTF_DIR=$i
2001-05-10 00:55:48 +00:00
unset TTF_INC_DIR
fi
if test -f "$i/include/freetype/freetype.h"; then
2001-05-12 11:09:05 +00:00
TTF_DIR=$i
TTF_INC_DIR=$i/include/freetype
2001-05-10 00:55:48 +00:00
fi
done
fi
if test -n "$TTF_DIR" ; then
AC_DEFINE(HAVE_LIBTTF,1,[ ])
PHP_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib, GD_SHARED_LIBADD)
fi
if test -z "$TTF_INC_DIR"; then
2001-05-12 11:09:05 +00:00
TTF_INC_DIR=$TTF_DIR/include
2001-05-10 00:55:48 +00:00
fi
PHP_ADD_INCLUDE($TTF_INC_DIR)
else
AC_MSG_RESULT(no - FreeType 2.x is to be used instead)
fi
fi
2001-04-13 12:00:12 +00:00
])
2001-05-10 00:55:48 +00:00
AC_DEFUN(PHP_GD_FREETYPE2,[
PHP_ARG_WITH(freetype-dir, for freetype(2),
[ --with-freetype-dir=DIR GD: Set the path to freetype2 install prefix.])
if test "$PHP_FREETYPE_DIR" != "no"; then
for i in /usr /usr/local $PHP_FREETYPE_DIR; do
2001-05-10 00:55:48 +00:00
if test -f "$i/include/freetype2/freetype/freetype.h"; then
2001-05-12 11:09:05 +00:00
FREETYPE2_DIR=$i
FREETYPE2_INC_DIR=$i/include/freetype2/freetype
2001-05-10 00:55:48 +00:00
fi
done
if test -n "$FREETYPE2_DIR" ; then
PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/lib, GD_SHARED_LIBADD)
PHP_ADD_INCLUDE($FREETYPE2_INC_DIR)
AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
AC_DEFINE(HAVE_LIBFREETYPE,1,[ ])
else
AC_MSG_ERROR(freetype2 not found!)
fi
else
AC_MSG_RESULT(If configure fails try --with-freetype-dir=<DIR>)
fi
2000-11-08 01:53:51 +00:00
])
2001-05-10 00:55:48 +00:00
AC_DEFUN(PHP_GD_T1LIB,[
PHP_ARG_WITH(t1lib, whether to include T1lib support,
[ --with-t1lib[=DIR] GD: Include T1lib support.])
2000-11-08 01:53:51 +00:00
2001-05-10 00:55:48 +00:00
if test "$PHP_T1LIB" != "no"; then
for i in /usr /usr/local $PHP_T1LIB; do
test -f "$i/include/t1lib.h" && T1_DIR=$i
2001-05-10 00:55:48 +00:00
done
2001-06-04 01:36:14 +00:00
if test -n "$T1_DIR"; then
2001-07-03 21:09:16 +00:00
AC_CHECK_LIB(t1, T1_LoadFont,
[
2001-05-10 00:55:48 +00:00
AC_DEFINE(HAVE_LIBT1,1,[ ])
PHP_ADD_INCLUDE("$T1_DIR/include")
PHP_ADD_LIBRARY_WITH_PATH(t1, "$T1_DIR/lib", GD_SHARED_LIBADD)
],[
AC_MSG_ERROR(Problem with libt1.(a|so). Please check config.log for more information.)
],[
-L$T1_DIR/lib
2001-05-10 00:55:48 +00:00
])
else
AC_MSG_ERROR(Your t1lib distribution is not installed correctly. Please reinstall it.)
2001-05-10 00:55:48 +00:00
fi
fi
])
AC_DEFUN(PHP_GD_TTSTR,[
2001-06-24 15:56:05 +00:00
PHP_ARG_ENABLE(gd-native-ttf, whether to enable truetype string function in gd,
2001-05-10 00:55:48 +00:00
[ --enable-gd-native-ttf GD: Enable TrueType string function in gd])
2001-06-24 15:56:05 +00:00
if test "$PHP_GD_NATIVE_TTF" = "yes"; then
AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
fi
])
2001-05-10 00:55:48 +00:00
AC_DEFUN(PHP_GD_CHECK_VERSION,[
AC_CHECK_LIB(gd, gdImageString16, [AC_DEFINE(HAVE_LIBGD13, 1, [ ])])
AC_CHECK_LIB(gd, gdImagePaletteCopy, [AC_DEFINE(HAVE_LIBGD15, 1, [ ])])
AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])])
2001-08-24 20:05:58 +00:00
AC_CHECK_LIB(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])])
AC_CHECK_LIB(gd, gdImageGif, [AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ])])
2001-05-10 00:55:48 +00:00
AC_CHECK_LIB(gd, gdImageWBMP, [AC_DEFINE(HAVE_GD_WBMP, 1, [ ])])
AC_CHECK_LIB(gd, gdImageCreateFromJpeg, [AC_DEFINE(HAVE_GD_JPG, 1, [ ])])
AC_CHECK_LIB(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])])
AC_CHECK_LIB(gd, gdImageCreateFromGd2, [AC_DEFINE(HAVE_GD_GD2, 1, [ ])])
2001-05-10 00:55:48 +00:00
AC_CHECK_LIB(gd, gdImageCreateTrueColor, [AC_DEFINE(HAVE_LIBGD20, 1, [ ])])
AC_CHECK_LIB(gd, gdImageSetTile, [AC_DEFINE(HAVE_GD_IMAGESETTILE, 1, [ ])])
AC_CHECK_LIB(gd, gdImageSetBrush, [AC_DEFINE(HAVE_GD_IMAGESETBRUSH, 1, [ ])])
AC_CHECK_LIB(gd, gdImageStringFTEx, [AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ])])
AC_CHECK_LIB(gd, gdImageColorClosestHWB, [AC_DEFINE(HAVE_COLORCLOSESTHWB, 1, [ ])])
AC_CHECK_LIB(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])])
2001-05-21 19:28:22 +00:00
AC_CHECK_LIB(gd, gdImageGifCtx, [AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])])
2001-05-10 00:55:48 +00:00
])
2000-11-09 02:29:15 +00:00
2001-05-10 00:55:48 +00:00
PHP_ARG_WITH(gd, whether to include GD support,
2000-12-06 17:34:58 +00:00
[ --with-gd[=DIR] Include GD support (DIR is GD's install dir).
1999-09-06 16:50:11 +00:00
Set DIR to "shared" to build as a dl, or
2001-05-10 00:55:48 +00:00
"shared,DIR" to build as a dl and still specify DIR.])
if test "$PHP_GD" != "no"; then
PHP_EXTENSION(gd, $ext_shared)
PHP_SUBST(GD_SHARED_LIBADD)
dnl Various checks for GD features
PHP_GD_TTSTR
2000-10-14 22:48:38 +00:00
PHP_GD_JPEG
2001-04-13 12:00:12 +00:00
PHP_GD_PNG
2000-10-14 22:48:38 +00:00
PHP_GD_XPM
2001-05-10 00:55:48 +00:00
PHP_GD_FREETYPE2
PHP_GD_FREETYPE1
PHP_GD_T1LIB
2001-05-12 11:09:05 +00:00
case $PHP_GD in
yes)
2001-05-10 00:55:48 +00:00
PHP_ADD_LIBRARY(gd,, GD_SHARED_LIBADD)
2000-11-08 01:53:51 +00:00
PHP_GD_CHECK_VERSION
2001-05-10 00:55:48 +00:00
AC_DEFINE(HAVE_LIBGD,1,[ ])
;;
*)
2001-05-10 00:55:48 +00:00
dnl A whole whack of possible places where these might be
for i in include/gd1.3 include/gd include gd1.3 gd ""; do
2001-05-12 11:09:05 +00:00
test -f $PHP_GD/$i/gd.h && GD_INCLUDE=$PHP_GD/$i
2001-05-10 00:55:48 +00:00
done
2001-05-10 00:55:48 +00:00
for i in lib/gd1.3 lib/gd lib gd1.3 gd ""; do
test -f $PHP_GD/$i/libgd.s? -o -f $PHP_GD/$i/libgd.a && GD_LIB=$PHP_GD/$i
2001-05-10 00:55:48 +00:00
done
2000-11-11 19:27:46 +00:00
if test -n "$GD_INCLUDE" && test -n "$GD_LIB" ; then
2001-05-10 00:55:48 +00:00
PHP_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB, GD_SHARED_LIBADD)
AC_DEFINE(HAVE_LIBGD,1,[ ])
2000-11-08 01:53:51 +00:00
PHP_GD_CHECK_VERSION
else
1999-07-25 14:46:33 +00:00
AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $withval])
2000-11-08 01:53:51 +00:00
fi
;;
esac
dnl NetBSD package structure
if test -f /usr/pkg/include/gd/gd.h -a -z "$GD_INCLUDE" ; then
2001-05-12 11:09:05 +00:00
GD_INCLUDE=/usr/pkg/include/gd
fi
dnl SuSE 6.x package structure
if test -f /usr/include/gd/gd.h -a -z "$GD_INCLUDE" ; then
2001-05-12 11:09:05 +00:00
GD_INCLUDE=/usr/include/gd
fi
1999-07-23 15:56:47 +00:00
PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE)
PHP_ADD_INCLUDE($GD_INCLUDE)
1999-09-06 16:50:11 +00:00
2001-05-10 00:55:48 +00:00
fi