libgd/configure.ac

318 lines
9.0 KiB
Plaintext
Raw Normal View History

# Process this file with autoconf to produce a configure script.
# Configure template for gd library
#
AC_PREREQ(2.54)
#HEY! Change BOTH the version number and the GDLIB_REVISION setting!
2013-04-11 15:59:36 -07:00
AC_INIT([GD], [2.1.0], [https://bitbucket.org/libgd/gd-libgd/issues])
AC_CONFIG_SRCDIR([src/gd.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
GDLIB_MAJOR=2
GDLIB_MINOR=1
GDLIB_REVISION=0
2013-04-08 00:37:55 -07:00
AC_SUBST(GDLIB_MAJOR)
AC_SUBST(GDLIB_MINOR)
AC_SUBST(GDLIB_REVISION)
# Dynamic library version information
# See http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
GDLIB_CURRENT=3
GDLIB_REVISION=0
GDLIB_AGE=0
2013-04-08 00:37:55 -07:00
AC_SUBST(GDLIB_CURRENT)
AC_SUBST(GDLIB_REVISION)
AC_SUBST(GDLIB_AGE)
#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])
AC_MSG_CHECKING([if we are building a Cygwin target])
case "$target" in
*-*-cygwin*) XTRA_LDFLAGS="-no-undefined"
os_cygwin=yes
;;
*) XTRA_LDFLAGS=
os_cygwin=no
;;
esac
AC_MSG_RESULT([$os_cygwin])
AC_SUBST([XTRA_LDFLAGS])
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
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_LN_S
AC_PROG_MAKE_SET
2013-04-08 00:12:06 -07:00
LT_INIT
PKG_PROG_PKG_CONFIG
dnl may be required for freetype and Xpm
AC_PATH_X
if test -n "$x_includes" && test "x$x_includes" != xNONE ; then
CFLAGS="$CFLAGS -I$x_includes"
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])
dnl if we're configuring on a system w/out gettext, don't fall over
m4_ifndef([AM_ICONV],[m4_define([AM_ICONV],[:])])
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
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
AM_CONDITIONAL([HAVE_LIBZ], test "$with_zlib" = yes)
dnl libpng is required
AC_ARG_WITH(png,dnl
[ --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
AC_MSG_ERROR([png support requested, but not found - see http://www.libpng.org/pub/png/])
fi
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
else
AC_MSG_ERROR([png support requested, but not found at requested location: $LIBPNG_CONFIG])
fi
;;
esac
if test "$with_png" != no; then
CPPFLAGS="$CPPFLAGS $LIBPNG_CFLAGS"
LIBS="$LIBS $LIBPNG_LIBS"
FEATURES="GD_PNG $FEATURES"
AC_DEFINE(HAVE_LIBPNG, 1, [Define if you have the png library.])
fi
AM_CONDITIONAL([HAVE_LIBPNG], test "$with_png" = yes)
dnl FreeType configure tests snarfed from libwmf ..
AC_ARG_WITH(freetype,dnl
[ --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])
fi
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
else
AC_MSG_ERROR([freetype support requested, but not found: $FREETYPE_CONFIG])
fi
;;
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.])
fi
2013-04-21 23:52:12 -07:00
AM_CONDITIONAL([HAVE_LIBFREETYPE], test "$with_freetype" = yes)
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"
CFLAGS="$CFLAGS -I$withval/include"
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
AM_CONDITIONAL([HAVE_LIBFONTCONFIG], test "$ac_cv_lib_fontconfig_FcInit" = yes)
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"
CFLAGS="$CFLAGS -I$withval/include"
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
AM_CONDITIONAL([HAVE_LIBJPEG], test "$ac_cv_lib_jpeg_jpeg_set_defaults" = yes)
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"
CFLAGS="$CFLAGS -I$withval/include"
fi],
withval=yes)
if test "$withval" != no; then
AC_CHECK_LIB(Xpm,XpmReadFileToXpmImage,
[LIBS="-lXpm $LIBS"
FEATURES="GD_XPM $FEATURES"
AC_DEFINE(HAVE_LIBXPM, 1, [ Define if you have the Xpm library. ])])
else
ac_cv_lib_Xpm_XpmReadFileToXpmImage=no
fi
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"
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
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"
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
AM_CONDITIONAL([HAVE_LIBTIFF], test "$ac_cv_lib_tiff_TIFFClientOpen" = yes)
2013-04-07 11:55:40 -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()
dnl report configuration
AC_MSG_RESULT([
** Configuration summary for $PACKAGE $VERSION:
Support for Zlib: $with_zlib
Support for PNG library: $with_png
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
Support for TIFF library: $ac_cv_lib_tiff_TIFFClientOpen
Support for Freetype 2.x library: $with_freetype
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-08 00:12:06 -07:00
AC_CONFIG_FILES([Makefile
src/Makefile
tests/Makefile
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])
AC_OUTPUT