2000-03-30 22:59:23 +08:00
|
|
|
AC_DEFUN(PHP_GD_JPEG,[
|
|
|
|
AC_MSG_CHECKING([for libjpeg (needed by gd-1.8+)])
|
|
|
|
AC_ARG_WITH(jpeg-dir,
|
2000-10-15 06:48:38 +08:00
|
|
|
[ --with-jpeg-dir[=DIR] GD: jpeg dir for gd-1.8+],[
|
2000-03-30 22:59:23 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
2000-05-23 18:21:40 +08:00
|
|
|
if test "$withval" = "yes"; then
|
2000-03-30 22:59:23 +08:00
|
|
|
withval="/usr/local"
|
|
|
|
fi
|
|
|
|
old_LIBS=$LIBS
|
|
|
|
LIBS="$LIBS -L$withval/lib"
|
2000-11-12 03:27:46 +08:00
|
|
|
AC_CHECK_LIB(jpeg,jpeg_read_header, [LIBS="$LIBS -ljpeg"],[AC_MSG_RESULT(no)],)
|
2000-03-30 22:59:23 +08:00
|
|
|
LIBS=$old_LIBS
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(jpeg, $withval/lib)
|
|
|
|
LIBS="$LIBS -L$withval/lib -ljpeg"
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_WARN(If configure fails try --with-jpeg-dir=<DIR>)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2000-06-07 03:06:46 +08:00
|
|
|
AC_DEFUN(PHP_GD_XPM,[
|
|
|
|
AC_MSG_CHECKING([for libXpm (needed by gd-1.8+)])
|
|
|
|
AC_ARG_WITH(xpm-dir,
|
2000-10-15 06:48:38 +08:00
|
|
|
[ --with-xpm-dir[=DIR] GD: xpm dir for gd-1.8+],[
|
2000-06-07 03:06:46 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
if test "$withval" = "yes"; then
|
|
|
|
withval="/usr/X11R6"
|
|
|
|
fi
|
|
|
|
old_LIBS=$LIBS
|
2000-11-12 03:27:46 +08:00
|
|
|
LIBS="$LIBS -L$withval/lib -lX11"
|
2000-06-07 03:06:46 +08:00
|
|
|
AC_CHECK_LIB(Xpm,XpmFreeXpmImage, [LIBS="$LIBS -L$withval/lib -lXpm"],[AC_MSG_RESULT(no)],)
|
|
|
|
LIBS=$old_LIBS
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(Xpm, $withval/lib)
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(X11, $withval/lib)
|
2000-11-12 03:27:46 +08:00
|
|
|
LIBS="$LIBS -L$withval/lib -lXpm -L$withval/lib -lX11"
|
2000-06-07 03:06:46 +08:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_WARN(If configure fails try --with-xpm-dir=<DIR>)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2000-11-08 09:53:51 +08: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, gdImageColorClosestHWB, [AC_DEFINE(HAVE_COLORCLOSESTHWB,1,[ ]) ])
|
2000-11-12 03:27:46 +08:00
|
|
|
AC_CHECK_LIB(z, compress, LIBS="-lz $LIBS",,)
|
2000-11-08 09:53:51 +08:00
|
|
|
AC_CHECK_LIB(png,png_info_init, LIBS="-lpng $LIBS",,)
|
|
|
|
AC_CHECK_LIB(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE,1,[ ])])
|
|
|
|
AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])])
|
|
|
|
AC_CHECK_LIB(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF, 1, [ ])])
|
|
|
|
AC_CHECK_LIB(gd, gdImageWBMP, [AC_DEFINE(HAVE_GD_WBMP, 1, [ ])])
|
2000-11-09 10:29:15 +08:00
|
|
|
AC_CHECK_LIB(gd, gdImageCreateFromJpeg, [AC_DEFINE(HAVE_GD_JPG, 1, [ ])])
|
|
|
|
AC_CHECK_LIB(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])])
|
2000-11-08 09:53:51 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
2000-10-16 21:50:30 +08:00
|
|
|
AC_MSG_CHECKING(whether to enable truetype string function in gd)
|
|
|
|
AC_ARG_ENABLE(gd-native-ttf,
|
|
|
|
[ --enable-gd-imgstrttf Enable TrueType string function in gd],[
|
|
|
|
if test "$enableval" = "yes" ; then
|
|
|
|
AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
])
|
2000-06-07 03:06:46 +08:00
|
|
|
|
2000-11-09 10:29:15 +08:00
|
|
|
|
1999-09-29 23:13:25 +08:00
|
|
|
shared=no
|
1999-04-17 08:37:12 +08:00
|
|
|
AC_ARG_WITH(gd,
|
2000-10-15 06:48:38 +08:00
|
|
|
[
|
1999-09-07 00:50:11 +08:00
|
|
|
--with-gd[=DIR] Include GD support (DIR is GD's install dir).
|
|
|
|
Set DIR to "shared" to build as a dl, or
|
|
|
|
"shared,DIR" to build as a dl and still specify DIR.],
|
1999-04-17 08:37:12 +08:00
|
|
|
[
|
1999-09-29 23:13:25 +08:00
|
|
|
PHP_WITH_SHARED
|
2000-11-08 08:18:49 +08:00
|
|
|
old_withval=$withval
|
2000-10-15 06:48:38 +08:00
|
|
|
PHP_GD_JPEG
|
|
|
|
PHP_GD_XPM
|
2000-10-21 20:03:52 +08:00
|
|
|
withval=$old_withval
|
1999-09-07 00:50:11 +08:00
|
|
|
|
2000-11-09 10:59:17 +08:00
|
|
|
AC_MSG_CHECKING(whether to include GD support)
|
|
|
|
|
1999-04-17 08:37:12 +08:00
|
|
|
case "$withval" in
|
|
|
|
no)
|
2000-11-08 09:53:51 +08:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
1999-04-17 08:37:12 +08:00
|
|
|
yes)
|
1999-12-30 12:52:19 +08:00
|
|
|
AC_DEFINE(HAVE_LIBGD,1,[ ])
|
1999-09-07 00:50:11 +08:00
|
|
|
if test "$shared" = "yes"; then
|
|
|
|
AC_MSG_RESULT(yes (shared))
|
|
|
|
GD_LIBS="-lgd"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes (static))
|
|
|
|
AC_ADD_LIBRARY(gd)
|
|
|
|
fi
|
2000-11-08 09:53:51 +08:00
|
|
|
|
|
|
|
old_LDFLAGS=$LDFLAGS
|
|
|
|
old_LIBS=$LIBS
|
|
|
|
|
|
|
|
dnl Check the capabilities of GD lib...
|
|
|
|
PHP_GD_CHECK_VERSION
|
1999-11-11 03:22:35 +08:00
|
|
|
|
2000-11-08 09:53:51 +08:00
|
|
|
LIBS=$old_LIBS
|
|
|
|
LDFLAGS=$old_LDFLAGS
|
|
|
|
if test "$ac_cv_lib_gd_gdImageCreateFromPng" = "yes"; then
|
|
|
|
AC_ADD_LIBRARY(png)
|
|
|
|
AC_ADD_LIBRARY(z)
|
|
|
|
fi
|
|
|
|
|
|
|
|
ac_cv_lib_gd_gdImageLine=yes
|
|
|
|
;;
|
2000-03-13 13:58:50 +08:00
|
|
|
|
1999-04-17 08:37:12 +08:00
|
|
|
*)
|
|
|
|
dnl A whole whack of possible places where this might be
|
1999-07-25 22:46:33 +08:00
|
|
|
test -f $withval/include/gd1.3/gd.h && GD_INCLUDE="$withval/include/gd1.3"
|
|
|
|
test -f $withval/include/gd/gd.h && GD_INCLUDE="$withval/include/gd"
|
|
|
|
test -f $withval/include/gd.h && GD_INCLUDE="$withval/include"
|
|
|
|
test -f $withval/gd1.3/gd.h && GD_INCLUDE="$withval/gd1.3"
|
|
|
|
test -f $withval/gd/gd.h && GD_INCLUDE="$withval/gd"
|
|
|
|
test -f $withval/gd.h && GD_INCLUDE="$withval"
|
|
|
|
|
|
|
|
test -f $withval/lib/libgd.so && GD_LIB="$withval/lib"
|
|
|
|
test -f $withval/lib/gd/libgd.so && GD_LIB="$withval/lib/gd"
|
|
|
|
test -f $withval/lib/gd1.3/libgd.so && GD_LIB="$withval/lib/gd1.3"
|
|
|
|
test -f $withval/libgd.so && GD_LIB="$withval"
|
|
|
|
test -f $withval/gd/libgd.so && GD_LIB="$withval/gd"
|
|
|
|
test -f $withval/gd1.3/libgd.so && GD_LIB="$withval/gd1.3"
|
1999-04-17 08:37:12 +08:00
|
|
|
|
|
|
|
test -f $withval/lib/libgd.a && GD_LIB="$withval/lib"
|
|
|
|
test -f $withval/lib/gd/libgd.a && GD_LIB="$withval/lib/gd"
|
|
|
|
test -f $withval/lib/gd1.3/libgd.a && GD_LIB="$withval/lib/gd1.3"
|
|
|
|
test -f $withval/libgd.a && GD_LIB="$withval"
|
|
|
|
test -f $withval/gd/libgd.a && GD_LIB="$withval/gd"
|
|
|
|
test -f $withval/gd1.3/libgd.a && GD_LIB="$withval/gd1.3"
|
2000-11-12 03:27:46 +08:00
|
|
|
|
1999-04-17 08:37:12 +08:00
|
|
|
if test -n "$GD_INCLUDE" && test -n "$GD_LIB" ; then
|
1999-12-30 12:52:19 +08:00
|
|
|
AC_DEFINE(HAVE_LIBGD,1,[ ])
|
1999-09-29 23:13:25 +08:00
|
|
|
if test "$shared" = "yes"; then
|
1999-09-07 00:50:11 +08:00
|
|
|
AC_MSG_RESULT(yes (shared))
|
|
|
|
GD_LIBS="-lgd"
|
|
|
|
GD_LFLAGS="-L$GD_LIB"
|
1999-09-29 23:13:25 +08:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes (static))
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB)
|
1999-09-07 00:50:11 +08:00
|
|
|
fi
|
1999-10-17 22:57:49 +08:00
|
|
|
old_LDFLAGS=$LDFLAGS
|
|
|
|
LDFLAGS="$LDFLAGS -L$GD_LIB"
|
|
|
|
old_LIBS=$LIBS
|
2000-11-08 09:53:51 +08:00
|
|
|
|
|
|
|
dnl Check the capabilities of GD lib...
|
|
|
|
PHP_GD_CHECK_VERSION
|
1999-10-17 22:57:49 +08:00
|
|
|
|
|
|
|
LIBS=$old_LIBS
|
|
|
|
LDFLAGS=$old_LDFLAGS
|
|
|
|
if test "$ac_cv_lib_gd_gdImageCreateFromPng" = "yes"; then
|
|
|
|
AC_ADD_LIBRARY(z)
|
2000-03-30 22:59:23 +08:00
|
|
|
AC_ADD_LIBRARY(png)
|
1999-10-17 22:57:49 +08:00
|
|
|
fi
|
2000-03-19 07:23:39 +08:00
|
|
|
|
1999-09-29 23:13:25 +08:00
|
|
|
ac_cv_lib_gd_gdImageLine=yes
|
1999-04-17 08:37:12 +08:00
|
|
|
else
|
1999-07-25 22:46:33 +08:00
|
|
|
AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $withval])
|
2000-11-08 09:53:51 +08:00
|
|
|
fi
|
|
|
|
;;
|
1999-04-17 08:37:12 +08:00
|
|
|
esac
|
2000-10-15 06:48:38 +08:00
|
|
|
],[])
|
|
|
|
|
2000-11-08 09:53:51 +08:00
|
|
|
|
2000-04-20 22:59:59 +08:00
|
|
|
if test "$with_gd" != "no" && test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
|
1999-07-23 23:56:47 +08:00
|
|
|
CHECK_TTF="yes"
|
|
|
|
AC_ARG_WITH(ttf,
|
2000-10-15 07:04:26 +08:00
|
|
|
[ --with-ttf[=DIR] GD: Include FreeType 1.x support],[
|
1999-07-23 23:56:47 +08:00
|
|
|
if test $withval = "no" ; then
|
|
|
|
CHECK_TTF=""
|
|
|
|
else
|
|
|
|
CHECK_TTF="$withval"
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
2000-10-15 07:04:26 +08:00
|
|
|
AC_MSG_CHECKING(whether to include FreeType 1.x support)
|
1999-07-23 23:56:47 +08:00
|
|
|
if test -n "$CHECK_TTF" ; then
|
|
|
|
for i in /usr /usr/local "$CHECK_TTF" ; do
|
|
|
|
if test -f "$i/include/freetype.h" ; then
|
|
|
|
TTF_DIR="$i"
|
2000-03-12 23:52:14 +08:00
|
|
|
unset TTF_INC_DIR
|
|
|
|
fi
|
|
|
|
if test -f "$i/include/freetype/freetype.h"; then
|
|
|
|
TTF_DIR="$i"
|
|
|
|
TTF_INC_DIR="$i/include/freetype"
|
1999-07-23 23:56:47 +08:00
|
|
|
fi
|
|
|
|
done
|
2000-10-15 07:04:26 +08:00
|
|
|
if test -n "$TTF_DIR" ; then
|
|
|
|
AC_DEFINE(HAVE_LIBTTF,1,[ ])
|
1999-09-29 23:13:25 +08:00
|
|
|
if test "$shared" = "yes"; then
|
2000-10-15 07:04:26 +08:00
|
|
|
GD_LIBS="$GD_LIBS -lttf"
|
|
|
|
GD_LFLAGS="$GD_LFLAGS -L$TTF_DIR/lib"
|
|
|
|
else
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib)
|
|
|
|
fi
|
|
|
|
if test -z "$TTF_INC_DIR"; then
|
|
|
|
TTF_INC_DIR="$TTF_DIR/include"
|
1999-09-07 00:50:11 +08:00
|
|
|
fi
|
2000-10-15 07:04:26 +08:00
|
|
|
AC_ADD_INCLUDE($TTF_INC_DIR)
|
1999-07-23 23:56:47 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
2000-10-15 07:04:26 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1999-07-23 23:56:47 +08:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2000-10-15 06:48:38 +08:00
|
|
|
AC_MSG_CHECKING(for T1lib support)
|
|
|
|
AC_ARG_WITH(t1lib,
|
|
|
|
[ --with-t1lib[=DIR] GD: Include T1lib support.],
|
|
|
|
[
|
|
|
|
if test "$withval" != "no"; then
|
|
|
|
if test "$withval" = "yes"; then
|
|
|
|
for i in /usr/local /usr; do
|
|
|
|
if test -f "$i/include/t1lib.h"; then
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(t1, "$i/lib")
|
|
|
|
AC_ADD_INCLUDE("$i/include")
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
else
|
|
|
|
if test -f "$withval/include/t1lib.h"; then
|
|
|
|
AC_ADD_LIBRARY_WITH_PATH(t1, "$withval/lib")
|
|
|
|
AC_ADD_INCLUDE("$withval/include")
|
2000-02-25 14:43:51 +08:00
|
|
|
fi
|
|
|
|
fi
|
2000-10-15 06:48:38 +08:00
|
|
|
AC_CHECK_LIB(t1, T1_GetExtend, [AC_DEFINE(HAVE_LIBT1,1,[ ])])
|
|
|
|
if test "$ac_cv_lib_t1_T1_GetExtend" = "yes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2000-02-25 14:43:51 +08:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2000-10-15 06:48:38 +08:00
|
|
|
],[
|
2000-02-25 14:43:51 +08:00
|
|
|
AC_MSG_RESULT(no)
|
2000-10-15 06:48:38 +08:00
|
|
|
])
|
2000-02-25 14:43:51 +08:00
|
|
|
|
2000-05-28 05:30:30 +08:00
|
|
|
dnl NetBSD package structure
|
1999-04-17 08:37:12 +08:00
|
|
|
if test -f /usr/pkg/include/gd/gd.h -a -z "$GD_INCLUDE" ; then
|
1999-07-25 22:46:33 +08:00
|
|
|
GD_INCLUDE="/usr/pkg/include/gd"
|
1999-04-17 08:37:12 +08:00
|
|
|
fi
|
2000-05-28 05:30:30 +08:00
|
|
|
|
|
|
|
dnl SuSE 6.x package structure
|
2000-05-28 05:09:00 +08:00
|
|
|
if test -f /usr/include/gd/gd.h -a -z "$GD_INCLUDE" ; then
|
|
|
|
GD_INCLUDE="/usr/include/gd"
|
|
|
|
fi
|
1999-07-23 23:56:47 +08:00
|
|
|
|
1999-10-17 22:57:49 +08:00
|
|
|
AC_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE)
|
|
|
|
AC_ADD_INCLUDE($GD_INCLUDE)
|
1999-09-07 00:50:11 +08:00
|
|
|
PHP_EXTENSION(gd, $shared)
|
|
|
|
if test "$shared" != "yes"; then
|
1999-10-04 23:18:26 +08:00
|
|
|
GD_STATIC="libphpext_gd.la"
|
1999-09-07 00:50:11 +08:00
|
|
|
else
|
|
|
|
GD_SHARED="gd.la"
|
|
|
|
fi
|
1999-04-17 08:37:12 +08:00
|
|
|
fi
|
1999-09-07 00:50:11 +08:00
|
|
|
|
1999-12-30 10:59:53 +08:00
|
|
|
PHP_SUBST(GD_LFLAGS)
|
|
|
|
PHP_SUBST(GD_LIBS)
|