2013-04-06 15:12:32 -07:00
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
# Configure template for gd library
|
|
|
|
|
2013-04-08 01:46:27 -07:00
|
|
|
AC_PREREQ(2.54)
|
2013-04-06 15:12:32 -07:00
|
|
|
|
2013-05-13 07:18:40 -07:00
|
|
|
# Some m4 magic to have correct version number everywhere
|
|
|
|
m4_define([gd_MAJOR],[2])dnl
|
|
|
|
m4_define([gd_MINOR],[1])dnl
|
|
|
|
m4_define([gd_REVISION],[0])dnl
|
|
|
|
m4_define([gd_EXTRA],[alpha1])dnl
|
|
|
|
|
|
|
|
m4_ifdef([gd_EXTRA],
|
|
|
|
[m4_define([gd_PKG_VERSION],[gd_MAJOR.gd_MINOR.gd_REVISION-gd_EXTRA])],
|
|
|
|
[m4_define([gd_PKG_VERSION],[gd_MAJOR.gd_MINOR.gd_REVISION])]
|
|
|
|
)dnl
|
|
|
|
|
|
|
|
AC_INIT([GD], gd_PKG_VERSION, [https://bitbucket.org/libgd/gd-libgd/issues], [libgd], [http://lib.gd])
|
2013-04-06 15:12:32 -07:00
|
|
|
AC_CONFIG_SRCDIR([src/gd.c])
|
|
|
|
AC_CONFIG_AUX_DIR(config)
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2013-04-16 11:42:47 -07:00
|
|
|
AC_CANONICAL_HOST
|
2013-04-06 15:12:32 -07:00
|
|
|
|
2013-05-13 07:18:40 -07:00
|
|
|
# This is not used anywhere
|
|
|
|
GDLIB_MAJOR=gd_MAJOR
|
|
|
|
GDLIB_MINOR=gd_MINOR
|
|
|
|
GDLIB_REVISION=gd_REVISION
|
|
|
|
GDLIB_EXTRA=gd_EXTRA
|
2013-04-08 00:37:55 -07:00
|
|
|
AC_SUBST(GDLIB_MAJOR)
|
|
|
|
AC_SUBST(GDLIB_MINOR)
|
|
|
|
AC_SUBST(GDLIB_REVISION)
|
2013-05-13 07:18:40 -07:00
|
|
|
AC_SUBST(GDLIB_EXTRA)
|
2013-04-08 00:27:45 -07:00
|
|
|
|
|
|
|
# Dynamic library version information
|
|
|
|
# See http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
|
2013-04-08 00:46:59 -07:00
|
|
|
GDLIB_CURRENT=3
|
|
|
|
GDLIB_REVISION=0
|
2013-04-12 05:53:48 -07:00
|
|
|
GDLIB_AGE=0
|
2013-04-08 00:37:55 -07:00
|
|
|
AC_SUBST(GDLIB_CURRENT)
|
|
|
|
AC_SUBST(GDLIB_REVISION)
|
|
|
|
AC_SUBST(GDLIB_AGE)
|
2013-04-08 00:27:45 -07:00
|
|
|
|
2013-04-06 15:12:32 -07:00
|
|
|
#Expanded by tests later in this file. TBB 2.0.26
|
|
|
|
#2.0.28: GIF is standard now. Doesn't depend on anything else,
|
|
|
|
#so we always build it.
|
|
|
|
FEATURES="GD_GIF GD_GIFANIM GD_OPENPOLYGON"
|
|
|
|
AC_SUBST(FEATURES)
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
|
2013-04-08 00:12:06 -07:00
|
|
|
AC_CONFIG_HEADERS([src/config.h:src/config.hin])
|
2013-04-06 15:12:32 -07:00
|
|
|
|
2013-04-16 11:53:15 -07:00
|
|
|
dnl newer automake wants this, but we still want to work with older
|
|
|
|
m4_ifndef([AM_PROG_AR],[m4_define([AM_PROG_AR],[:])])
|
|
|
|
AM_PROG_AR
|
|
|
|
|
2013-04-06 15:12:32 -07:00
|
|
|
AC_PROG_CC
|
2013-04-22 02:09:08 -07:00
|
|
|
AM_PROG_CC_C_O
|
2013-04-06 15:12:32 -07:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2013-05-10 12:07:58 -07:00
|
|
|
LT_INIT([win32-dll])
|
2013-04-16 12:22:52 -07:00
|
|
|
PKG_PROG_PKG_CONFIG
|
2013-04-06 15:12:32 -07:00
|
|
|
|
|
|
|
dnl may be required for freetype and Xpm
|
|
|
|
AC_PATH_X
|
|
|
|
|
|
|
|
if test -n "$x_includes" && test "x$x_includes" != xNONE ; then
|
2013-04-12 05:53:48 -07:00
|
|
|
CFLAGS="$CFLAGS -I$x_includes"
|
2013-04-06 15:12:32 -07:00
|
|
|
fi
|
|
|
|
if test -n "$x_libraries" && test "x$x_libraries" != xNONE ; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$x_libraries"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_CHECK_HEADERS([errno.h limits.h stddef.h stdlib.h string.h unistd.h])
|
|
|
|
|
2013-04-16 14:47:09 -07:00
|
|
|
dnl if we're configuring on a system w/out gettext, don't fall over
|
|
|
|
m4_ifndef([AM_ICONV],[m4_define([AM_ICONV],[:])])
|
2013-04-06 15:12:32 -07:00
|
|
|
AM_ICONV
|
|
|
|
# if test -n "$LIBICONV" ; then
|
|
|
|
# LIBS="$LIBS $LIBICONV"
|
|
|
|
# fi
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(iconv.h,
|
|
|
|
[AC_MSG_CHECKING(whether iconv.h defines iconv_t)
|
|
|
|
AC_EGREP_HEADER([typedef.*iconv_t],iconv.h,
|
|
|
|
[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_ICONV_T_DEF, 1,
|
|
|
|
[Define if <iconv.h> defines iconv_t.])],
|
|
|
|
AC_MSG_RESULT(no))])
|
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
#AC_C_CONST
|
|
|
|
#AC_TYPE_SIZE_T
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
#AC_FUNC_ERROR_AT_LINE
|
|
|
|
#AC_FUNC_MALLOC
|
|
|
|
#AC_FUNC_REALLOC
|
|
|
|
#AC_FUNC_VPRINTF
|
|
|
|
#AC_CHECK_FUNCS([floor memset sqrt strchr strdup strtol])
|
|
|
|
|
|
|
|
dnl do we need to specify -lm explicitly?
|
|
|
|
AC_CHECK_FUNC(sin,,[AC_CHECK_LIB(m,sin)])
|
|
|
|
|
|
|
|
dnl zlib is required
|
2013-04-16 13:57:45 -07:00
|
|
|
AC_ARG_WITH(zlib,
|
|
|
|
[ --with-zlib=DIR where to find the zlib library])
|
|
|
|
if test "$with_zlib" != no; then
|
|
|
|
AC_CHECK_LIB(z,deflate,
|
|
|
|
[LIBS="-lz $LIBS"
|
|
|
|
AC_DEFINE(HAVE_LIBZ, 1, [Define if you have zlib.])
|
|
|
|
with_zlib=yes],
|
|
|
|
[AC_MSG_WARN([zlib is required - see http://www.gzip.org/zlib/])
|
|
|
|
with_zlib=no])
|
|
|
|
fi
|
2013-04-16 15:07:09 -07:00
|
|
|
AM_CONDITIONAL([HAVE_LIBZ], test "$with_zlib" = yes)
|
2013-04-06 15:12:32 -07:00
|
|
|
|
|
|
|
dnl libpng is required
|
|
|
|
AC_ARG_WITH(png,dnl
|
2013-04-16 12:22:52 -07:00
|
|
|
[ --with-png=DIR where to find the png library])
|
|
|
|
|
|
|
|
case $with_png in
|
|
|
|
no) ;;
|
|
|
|
yes|"")
|
|
|
|
PKG_CHECK_MODULES([LIBPNG], libpng, [
|
|
|
|
with_png=yes
|
|
|
|
],[
|
|
|
|
if test "$with_png" = yes; then
|
2013-04-22 06:19:26 -07:00
|
|
|
AC_MSG_ERROR([png support requested, but not found - see http://www.libpng.org/pub/png/])
|
2013-04-06 15:12:32 -07:00
|
|
|
fi
|
2013-04-16 12:22:52 -07:00
|
|
|
with_png=no
|
|
|
|
])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
LIBPNG_CONFIG=$with_png/bin/libpng-config
|
|
|
|
if test -e "$LIBPNG_CONFIG"; then
|
|
|
|
LIBPNG_CFLAGS=`$LIBPNG_CONFIG --cflags`
|
|
|
|
LIBPNG_LIBS=`$LIBPNG_CONFIG --libs`
|
|
|
|
with_png=yes
|
2013-04-06 15:12:32 -07:00
|
|
|
else
|
2013-04-22 06:19:26 -07:00
|
|
|
AC_MSG_ERROR([png support requested, but not found at requested location: $LIBPNG_CONFIG])
|
2013-04-06 15:12:32 -07:00
|
|
|
fi
|
2013-04-16 12:22:52 -07:00
|
|
|
;;
|
|
|
|
esac
|
2013-04-22 06:19:26 -07:00
|
|
|
if test "$with_png" != no; then
|
2013-04-16 12:22:52 -07:00
|
|
|
CPPFLAGS="$CPPFLAGS $LIBPNG_CFLAGS"
|
|
|
|
LIBS="$LIBS $LIBPNG_LIBS"
|
|
|
|
FEATURES="GD_PNG $FEATURES"
|
|
|
|
AC_DEFINE(HAVE_LIBPNG, 1, [Define if you have the png library.])
|
2013-04-06 15:12:32 -07:00
|
|
|
fi
|
2013-04-16 15:07:09 -07:00
|
|
|
AM_CONDITIONAL([HAVE_LIBPNG], test "$with_png" = yes)
|
2013-04-06 15:12:32 -07:00
|
|
|
|
|
|
|
dnl FreeType configure tests snarfed from libwmf ..
|
|
|
|
AC_ARG_WITH(freetype,dnl
|
2013-04-16 12:22:52 -07:00
|
|
|
[ --with-freetype=DIR where to find the freetype 2.x library]])
|
|
|
|
|
|
|
|
case $with_freetype in
|
|
|
|
no) ;;
|
|
|
|
yes|"")
|
|
|
|
dnl All freetype2 versions are numerically much larger than the actual
|
|
|
|
dnl version number you see in the tarball. This is because the number
|
|
|
|
dnl corresponds to the shared library version rather than the release.
|
|
|
|
dnl 9.8.3 is the version that freetype2-2.1.10 used.
|
|
|
|
PKG_CHECK_MODULES([LIBFREETYPE], [freetype2 >= 9.8.3], [
|
|
|
|
with_freetype=yes
|
|
|
|
],[
|
|
|
|
if test "$with_freetype" = yes; then
|
|
|
|
AC_MSG_ERROR([freetype support requested, but not found])
|
2013-04-06 15:12:32 -07:00
|
|
|
fi
|
2013-04-16 12:22:52 -07:00
|
|
|
with_freetype=no
|
|
|
|
])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
FREETYPE_CONFIG=$with_freetype/bin/freetype-config
|
|
|
|
if test -e "$FREETYPE_CONFIG"; then
|
|
|
|
LIBFREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
|
|
|
|
LIBFREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
|
|
|
|
with_freetype=yes
|
2013-04-06 15:12:32 -07:00
|
|
|
else
|
2013-04-16 12:22:52 -07:00
|
|
|
AC_MSG_ERROR([freetype support requested, but not found: $FREETYPE_CONFIG])
|
2013-04-06 15:12:32 -07:00
|
|
|
fi
|
2013-04-16 12:22:52 -07:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test "$with_freetype" = yes; then
|
|
|
|
CPPFLAGS="$CPPFLAGS $LIBFREETYPE_CFLAGS"
|
|
|
|
LIBS="$LIBS $LIBFREETYPE_LIBS"
|
|
|
|
FEATURES="GD_FREETYPE $FEATURES"
|
|
|
|
AC_DEFINE(HAVE_LIBFREETYPE, 1, [Define if you have the freetype library.])
|
|
|
|
AC_DEFINE(HAVE_FT2BUILD_H, 1, [Define if you have the ft2build.h header.])
|
2013-04-06 15:12:32 -07:00
|
|
|
fi
|
2013-04-21 23:52:12 -07:00
|
|
|
AM_CONDITIONAL([HAVE_LIBFREETYPE], test "$with_freetype" = yes)
|
2013-04-06 15:12:32 -07:00
|
|
|
|
|
|
|
dnl check for libfontconfig by default
|
|
|
|
AC_ARG_WITH(fontconfig,dnl
|
|
|
|
[ --with-fontconfig=DIR where to find the fontconfig library],
|
|
|
|
[if test -d "$withval"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval/lib"
|
2013-04-12 05:53:48 -07:00
|
|
|
CFLAGS="$CFLAGS -I$withval/include"
|
2013-04-06 15:12:32 -07:00
|
|
|
fi],
|
|
|
|
withval=yes)
|
|
|
|
|
|
|
|
if test "$withval" != no; then
|
|
|
|
AC_CHECK_LIB(fontconfig,FcInit,
|
|
|
|
[LIBS="-lfontconfig $LIBS"
|
|
|
|
FEATURES="GD_FONTCONFIG $FEATURES"
|
|
|
|
AC_DEFINE(HAVE_LIBFONTCONFIG, 1, [ Define if you have the fontconfig library. ])])
|
|
|
|
else
|
|
|
|
ac_cv_lib_fontconfig_FcInit=no
|
|
|
|
fi
|
2013-04-22 02:09:08 -07:00
|
|
|
AM_CONDITIONAL([HAVE_LIBFONTCONFIG], test "$ac_cv_lib_fontconfig_FcInit" = yes)
|
2013-04-06 15:12:32 -07:00
|
|
|
|
|
|
|
dnl check for libjpeg by default
|
|
|
|
AC_ARG_WITH(jpeg,dnl
|
|
|
|
[ --with-jpeg=DIR where to find the jpeg library],
|
|
|
|
[if test -d "$withval"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval/lib"
|
2013-04-12 05:53:48 -07:00
|
|
|
CFLAGS="$CFLAGS -I$withval/include"
|
2013-04-06 15:12:32 -07:00
|
|
|
fi],
|
|
|
|
withval=yes)
|
|
|
|
|
|
|
|
if test "$withval" != no; then
|
|
|
|
AC_CHECK_LIB(jpeg,jpeg_set_defaults,
|
|
|
|
[LIBS="-ljpeg $LIBS"
|
|
|
|
FEATURES="GD_JPEG $FEATURES"
|
|
|
|
AC_DEFINE(HAVE_LIBJPEG, 1, [ Define if you have the jpeg library. ])])
|
|
|
|
else
|
|
|
|
ac_cv_lib_jpeg_jpeg_set_defaults=no
|
|
|
|
fi
|
2013-04-22 02:09:08 -07:00
|
|
|
AM_CONDITIONAL([HAVE_LIBJPEG], test "$ac_cv_lib_jpeg_jpeg_set_defaults" = yes)
|
2013-04-06 15:12:32 -07:00
|
|
|
|
|
|
|
dnl check for libXpm by default
|
|
|
|
AC_ARG_WITH(xpm,dnl
|
|
|
|
[ --with-xpm=DIR where to find the xpm library],
|
|
|
|
[if test -d "$withval"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval/lib"
|
2013-04-12 05:53:48 -07:00
|
|
|
CFLAGS="$CFLAGS -I$withval/include"
|
2013-04-06 15:12:32 -07:00
|
|
|
fi],
|
|
|
|
withval=yes)
|
|
|
|
|
|
|
|
if test "$withval" != no; then
|
|
|
|
AC_CHECK_LIB(Xpm,XpmReadFileToXpmImage,
|
2013-04-14 00:16:19 -07:00
|
|
|
[LIBS="-lXpm $LIBS"
|
2013-04-06 15:12:32 -07:00
|
|
|
FEATURES="GD_XPM $FEATURES"
|
2013-04-14 00:16:19 -07:00
|
|
|
AC_DEFINE(HAVE_LIBXPM, 1, [ Define if you have the Xpm library. ])])
|
2013-04-06 15:12:32 -07:00
|
|
|
else
|
|
|
|
ac_cv_lib_Xpm_XpmReadFileToXpmImage=no
|
|
|
|
fi
|
2013-04-22 02:09:08 -07:00
|
|
|
AM_CONDITIONAL([HAVE_LIBXPM], test "$ac_cv_lib_Xpm_XpmReadFileToXpmImage" = yes)
|
2013-04-07 09:42:07 -07:00
|
|
|
|
|
|
|
dnl check for libvpx by default
|
|
|
|
AC_ARG_WITH(vpx,dnl
|
|
|
|
[ --with-vpx=DIR where to find the vpx library],
|
|
|
|
[if test -d "$withval"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval/lib"
|
2013-04-12 05:53:48 -07:00
|
|
|
CFLAGS="$CFLAGS -I$withval/include"
|
2013-04-07 09:42:07 -07:00
|
|
|
fi],
|
|
|
|
withval=yes)
|
|
|
|
|
|
|
|
if test "$withval" != no; then
|
|
|
|
AC_CHECK_LIB(vpx,vpx_codec_destroy,
|
|
|
|
[LIBS="-lvpx $LIBS"
|
|
|
|
FEATURES="GD_VPX $FEATURES"
|
|
|
|
AC_DEFINE(HAVE_LIBVPX, 1, [ Define if you have the vpx library. ])])
|
|
|
|
else
|
|
|
|
ac_cv_lib_vpx_vpx_codec_destroy=no
|
|
|
|
fi
|
2013-04-22 02:09:08 -07:00
|
|
|
AM_CONDITIONAL([HAVE_LIBVPX], test "$ac_cv_lib_vpx_vpx_codec_destroy" = yes)
|
2013-04-07 11:55:40 -07:00
|
|
|
|
2013-04-14 02:00:57 -07:00
|
|
|
dnl check for libtiff by default
|
2013-04-07 11:55:40 -07:00
|
|
|
AC_ARG_WITH(tiff,dnl
|
2013-04-14 02:00:57 -07:00
|
|
|
[ --with-tiff=DIR where to find the TIFF library],
|
2013-04-07 11:55:40 -07:00
|
|
|
[if test -d "$withval"; then
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval/lib"
|
2013-04-12 05:53:48 -07:00
|
|
|
CFLAGS="$CFLAGS -I$withval/include"
|
2013-04-07 11:55:40 -07:00
|
|
|
fi],
|
|
|
|
withval=yes)
|
|
|
|
|
|
|
|
if test "$withval" != no; then
|
|
|
|
AC_CHECK_LIB(tiff,TIFFClientOpen,
|
|
|
|
[LIBS="-ltiff $LIBS"
|
2013-04-14 02:00:57 -07:00
|
|
|
FEATURES="GD_TIFF $FEATURES"
|
|
|
|
AC_DEFINE(HAVE_LIBTIFF, 1, [ Define if you have the TIFF library. ])])
|
2013-04-07 11:55:40 -07:00
|
|
|
else
|
|
|
|
ac_cv_lib_tiff_TIFFClientOpen=no
|
|
|
|
fi
|
2013-04-22 02:09:08 -07:00
|
|
|
AM_CONDITIONAL([HAVE_LIBTIFF], test "$ac_cv_lib_tiff_TIFFClientOpen" = yes)
|
2013-04-07 11:55:40 -07:00
|
|
|
|
2013-04-12 05:53:48 -07:00
|
|
|
gl_VISIBILITY()
|
|
|
|
CFLAGS="$CFLAGS $CFLAG_VISIBILITY"
|
2013-04-07 11:55:40 -07:00
|
|
|
|
2013-04-08 00:12:06 -07:00
|
|
|
AX_PTHREAD()
|
2013-04-06 15:12:32 -07:00
|
|
|
|
2013-04-22 20:36:16 -07:00
|
|
|
MINGW_AC_WIN32_NATIVE_HOST()
|
|
|
|
|
2013-05-02 00:06:49 -07:00
|
|
|
if test "$mingw_cv_win32_host" = yes; then
|
2013-04-22 20:36:16 -07:00
|
|
|
AC_DEFINE([BGDWIN32], [], [Define is you are building for Win32 API])
|
|
|
|
fi
|
|
|
|
|
2013-04-06 15:12:32 -07:00
|
|
|
dnl report configuration
|
|
|
|
AC_MSG_RESULT([
|
|
|
|
** Configuration summary for $PACKAGE $VERSION:
|
|
|
|
|
2013-04-16 13:57:45 -07:00
|
|
|
Support for Zlib: $with_zlib
|
2013-04-16 12:22:52 -07:00
|
|
|
Support for PNG library: $with_png
|
2013-04-06 15:12:32 -07:00
|
|
|
Support for JPEG library: $ac_cv_lib_jpeg_jpeg_set_defaults
|
2013-04-07 09:42:07 -07:00
|
|
|
Support for VPX library: $ac_cv_lib_vpx_vpx_codec_destroy
|
2013-04-08 00:16:26 -07:00
|
|
|
Support for TIFF library: $ac_cv_lib_tiff_TIFFClientOpen
|
2013-04-16 12:22:52 -07:00
|
|
|
Support for Freetype 2.x library: $with_freetype
|
2013-04-06 15:12:32 -07:00
|
|
|
Support for Fontconfig library: $ac_cv_lib_fontconfig_FcInit
|
|
|
|
Support for Xpm library: $ac_cv_lib_Xpm_XpmReadFileToXpmImage
|
2013-04-12 01:35:08 -07:00
|
|
|
Support for pthreads: $ax_pthread_ok
|
2013-04-06 15:12:32 -07:00
|
|
|
])
|
|
|
|
|
2013-04-08 00:12:06 -07:00
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
src/Makefile
|
2013-04-22 02:09:08 -07:00
|
|
|
tests/Makefile
|
2013-04-22 02:24:35 -07:00
|
|
|
tests/test_config.h
|
2013-04-08 00:12:06 -07:00
|
|
|
config/Makefile
|
2013-04-14 00:42:14 -07:00
|
|
|
config/gdlib-config
|
|
|
|
config/gdlib.pc])
|
2013-04-06 15:12:32 -07:00
|
|
|
|
|
|
|
AC_OUTPUT
|