@ -36,6 +36,8 @@ AC_SUBST(EXEEXT)
PKG_PROG_PKG_CONFIG([0.24])
LT_INIT(win32-dll)
# checks for native programs to generate building tool
@ -287,96 +289,216 @@ AC_SUBST([XX_CFLAGS])
AC_SUBST([XX_ANSIFLAGS])
# All library tests below try `pkg-config' first. If that fails, a function
# from the library is tested in the traditional autoconf way (zlib, bzip2),
# or a config script is called (libpng).
#
# The `xxx_reqpriv' variables are for the `Requires.private' field in
# `freetype2.pc'. The `xxx_libpriv' variables are for the `Libs.private'
# field in `freetype2.pc' if pkg-config doesn't find a proper .pc file.
#
# The `xxx_libstaticconf' variables are for the `freetype-config' script.
#
# Note that a call to PKG_CHECK_MODULES(XXX, ...) sets and creates the
# output variables `XXX_CFLAGS' and `XXX_LIBS'. In case one or both are set
# for a library by the user, no entry for this library is added to
# `Requires.private'. Instead, it gets added to `Libs.private'
# check for system zlib
# don't quote AS_HELP_STRING!
AC_ARG_WITH([zlib],
AS_HELP_STRING([--without-zlib],
[use internal zlib instead of system-wide]))
if test x$with_zlib != xno && test -z "$LIBZ"; then
AC_CHECK_LIB([z],
[gzsetparams],
[AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])])
fi
if test x$with_zlib != xno && test -n "$LIBZ"; then
SYSTEM_ZLIB=yes
fi
[AS_HELP_STRING([--with-zlib=@<:@yes|no|auto@:>@],
[use system zlib instead of internal library @<:@default=auto@:>@])],
[], [with_zlib=auto])
have_zlib=no
if test x"$with_zlib" = xyes -o x"$with_zlib" = xauto; then
zlib_pkg="zlib"
have_zlib_pkg=no
# All library tests below use `pkg-config'. The `XXX_PKG' variables are for
# the `Requires.private' field in `freetype2.pc'; we use the `HAVE_PKG' flag
# to insert commas between the entries.
HAVE_PKG=no
if test x"$ZLIB_CFLAGS" = x -a x"$ZLIB_LIBS" = x; then
PKG_CHECK_EXISTS([$zlib_pkg], [have_zlib_pkg=yes])
fi
PKG_CHECK_MODULES([ZLIB], [$zlib_pkg],
[have_zlib="yes (pkg-config)"], [:])
if test $have_zlib_pkg = yes; then
# we have zlib.pc
zlib_reqpriv="$zlib_pkg"
zlib_libpriv=
zlib_libstaticconf=`$PKG_CONFIG --static --libs "$zlib_pkg"`
else
zlib_reqpriv=
if test "$have_zlib" != no; then
# ZLIB_CFLAGS and ZLIB_LIBS are set by the user
zlib_libpriv="$ZLIB_LIBS"
zlib_libstaticconf="$ZLIB_LIBS"
have_zlib="yes (ZLIB_CFLAGS and ZLIB_LIBS)"
else
# fall back to standard autoconf test
AC_CHECK_LIB([z],
[gzsetparams],
[AC_CHECK_HEADER([zlib.h],
[have_zlib="yes (autoconf test)"
zlib_libpriv="-lz"
zlib_libstaticconf="$zlib_libpriv"
ZLIB_LIBS="$zlib_libpriv"])])
fi
fi
fi
if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
AC_MSG_ERROR([external zlib support requested but library not found])
fi
# check for system libbz2
HAVE_LIBBZIP2=no
# don't quote AS_HELP_STRING!
AC_ARG_WITH([bzip2],
AS_HELP_STRING([--without-bzip2],
[do not support bzip2 compressed fonts]))
if test x$with_bzip2 != xno; then
BZIP2_PKG="bzip2"
# as a side effect, this call sets and creates output variables
# BZIP2_CFLAGS and BZIP2_LIBS
PKG_CHECK_MODULES([BZIP2], [$BZIP2_PKG])
LIBBZIP2=`$PKG_CONFIG --libs-only-l "$BZIP2_PKG"`
HAVE_LIBBZIP2=yes
AC_MSG_RESULT([$BZIP2_LIBS])
if test $HAVE_PKG = no; then
HAVE_PKG=yes
[AS_HELP_STRING([--with-bzip2=@<:@yes|no|auto@:>@],
[support bzip2 compressed fonts @<:@default=auto@:>@])],
[], [with_bzip2=auto])
have_bzip2=no
if test x"$with_bzip2" = xyes -o x"$with_bzip2" = xauto; then
bzip2_pkg="bzip2"
have_bzip2_pkg=no
if test x"$BZIP2_CFLAGS" = x -a x"$BZIP2_LIBS" = x; then
PKG_CHECK_EXISTS([$bzip2_pkg], [have_bzip2_pkg=yes])
fi
PKG_CHECK_MODULES([BZIP2], [$bzip2_pkg],
[have_bzip2="yes (pkg-config)"], [:])
if test $have_bzip2_pkg = yes; then
# we have bzip2.pc
bzip2_reqpriv="$bzip2_pkg"
bzip2_libpriv=
bzip2_libstaticconf=`$PKG_CONFIG --static --libs "$bzip2_pkg"`
else
BZIP2_PKG=", $BZIP2_PKG"
bzip2_reqpriv=
if test "$have_bzip2" != no; then
# BZIP2_CFLAGS and BZIP2_LIBS are set by the user
bzip2_libpriv="$BZIP2_LIBS"
bzip2_libstaticconf="$BZIP2_LIBS"
have_bzip2="yes (BZIP2_CFLAGS and BZIP2_LIBS)"
else
# fall back to standard autoconf test
AC_CHECK_LIB([bz2],
[BZ2_bzDecompress],
[AC_CHECK_HEADER([bzlib.h],
[have_bzip2="yes (autoconf test)"
bzip2_libpriv="-lbz2"
bzip2_libstaticconf="$bzip2_libpriv"
BZIP2_LIBS="$bzip2_libpriv"])])
fi
fi
fi
if test x"$with_bzip2" = xyes -a "$have_bzip2" = no; then
AC_MSG_ERROR([bzip2 support requested but library not found])
fi
# check for system libpng
HAVE_LIBPNG=no
# don't quote AS_HELP_STRING!
AC_ARG_WITH([png],
AS_HELP_STRING([--without-png],
[do not support png compressed OpenType embedded bitmaps]))
if test x$with_png != xno; then
LIBPNG_PKG="libpng"
# as a side effect, this call sets and creates output variables
# LIBPNG_CFLAGS and LIBPNG_LIBS
PKG_CHECK_MODULES([LIBPNG], [$LIBPNG_PKG])
LIBPNG=`$PKG_CONFIG --libs-only-l "$LIBPNG_PKG"`
HAVE_LIBPNG=yes
AC_MSG_RESULT([$LIBPNG_LIBS])
if test $HAVE_PKG = no; then
HAVE_PKG=yes
[AS_HELP_STRING([--with-png=@<:@yes|no|auto@:>@],
[support png compressed OpenType embedded bitmaps @<:@default=auto@:>@])],
[], [with_png=auto])
have_libpng=no
if test x"$with_png" = xyes -o x"$with_png" = xauto; then
libpng_pkg="libpng"
have_libpng_pkg=no
if test x"$LIBPNG_CFLAGS" = x -a x"$LIBPNG_LIBS" = x; then
PKG_CHECK_EXISTS([$libpng_pkg], [have_libpng_pkg=yes])
fi
PKG_CHECK_MODULES([LIBPNG], [$libpng_pkg],
[have_libpng="yes (pkg-config)"], [:])
if test $have_libpng_pkg = yes; then
# we have libpng.pc
libpng_reqpriv="$libpng_pkg"
libpng_libpriv=
libpng_libstaticconf=`$PKG_CONFIG --static --libs "$libpng_pkg"`
else
LIBPNG_PKG=", $LIBPNG_PKG"
libpng_reqpriv=
if test "$have_libpng" != no; then
# LIBPNG_CFLAGS and LIBPNG_LIBS are set by the user
libpng_libpriv="$LIBPNG_LIBS"
libpng_libstaticconf="$LIBPNG_LIBS"
have_libpng="yes (LIBPNG_CFLAGS and LIBPNG_LIBS)"
else
# fall back to config script.
AC_MSG_CHECKING([for libpng-config])
if which libpng-config > /dev/null; then
LIBPNG_CFLAGS=`libpng-config --cflags`
LIBPNG_LIBS=`libpng-config --ldflags`
libpng_libpriv=`libpng-config --static --ldflags`
libpng_libstaticconf="$libpng_libpriv"
have_libpng="yes (libpng-config)"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
fi
fi
if test x"$with_png" = xyes -a "$have_libpng" = no; then
AC_MSG_ERROR([libpng support requested but library not found])
fi
# check for system libharfbuzz
HAVE_HARFBUZZ=no
# don't quote AS_HELP_STRING!
AC_ARG_WITH([harfbuzz],
AS_HELP_STRING([--without-harfbuzz],
[do not use improved auto-hinting of OpenType fonts]))
if test x$with_harfbuzz != xno; then
HARFBUZZ_PKG="harfbuzz >= 0.9.19"
# as a side effect, this call sets and creates output variables
# HARFBUZZ_CFLAGS and HARFBUZZ_LIBS
PKG_CHECK_MODULES([HARFBUZZ], [$HARFBUZZ_PKG])
LIBHARFBUZZ=`$PKG_CONFIG --libs-only-l "$HARFBUZZ_PKG"`
HAVE_LIBHARFBUZZ=yes
AC_MSG_RESULT([$HARFBUZZ_LIBS])
if test $HAVE_PKG = no; then
HAVE_PKG=yes
[AS_HELP_STRING([--with-harfbuzz=@<:@yes|no|auto@:>@],
[improve auto-hinting of OpenType fonts @<:@default=auto@:>@])],
[], [with_harfbuzz=auto])
have_harfbuzz=no
if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
harfbuzz_pkg="harfbuzz >= 0.9.19"
have_harfbuzz_pkg=no
if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
PKG_CHECK_EXISTS([$harfbuzz_pkg], [have_harfbuzz_pkg=yes])
fi
PKG_CHECK_MODULES([HARFBUZZ], [$harfbuzz_pkg],
[have_harfbuzz="yes (pkg-config)"], [:])
if test $have_harfbuzz_pkg = yes; then
# we have harfbuzz.pc
harfbuzz_reqpriv="$harfbuzz_pkg"
harfbuzz_libpriv=
harfbuzz_libstaticconf=`$PKG_CONFIG --static --libs "$harfbuzz_pkg"`
else
HARFBUZZ_PKG=", $HARFBUZZ_PKG"
harfbuzz_reqpriv=
if test "$have_harfbuzz" != no; then
# HARFBUZZ_CFLAGS and HARFBUZZ_LIBS are set by the user
harfbuzz_libpriv="$HARFBUZZ_LIBS"
harfbuzz_libstaticconf="$HARFBUZZ_LIBS"
have_harfbuzz="yes (HARFBUZZ_CFLAGS and HARFBUZZ_LIBS)"
else
# since HarfBuzz is quite a new library we don't fall back to a
# different test; additionally, it has too many dependencies
:
fi
fi
fi
if test x"$with_harfbuzz" = xyes -a "$have_harfbuzz" = no; then
AC_MSG_ERROR([harfbuzz support requested but library not found])
fi
# Some options handling SDKs/archs in CFLAGS should be copied
# to LDFLAGS. Apple TechNote 2137 recommends to include these
@ -426,15 +548,14 @@ set ${save_config_args}
ftmac_c="" # src/base/ftmac.c should not be included in makefiles by default
# don't quote AS_HELP_STRING!
AC_ARG_WITH([old-mac-fonts],
AS_HELP_STRING([--with-old-mac-fonts],
[allow Mac resource-based fonts to be used]))
if test x$with_old_mac_fonts = xyes; then
orig_LDFLAGS="${LDFLAGS}"
AC_MSG_CHECKING([CoreServices & ApplicationServices of Mac OS X])
FT2_EXTRA_LIBS ="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
LDFLAGS="$LDFLAGS $FT2_EXTRA_LIBS "
ft2_extra_libs ="-Wl,-framework,CoreServices -Wl,-framework,ApplicationServices"
LDFLAGS="$LDFLAGS $ft2_extra_libs "
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
@ -520,7 +641,7 @@ if test x$with_old_mac_fonts = xyes; then
CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX=0"
])],
[AC_MSG_RESULT([not found])
FT2_EXTRA_LIBS =""
ft2_extra_libs =""
LDFLAGS="${orig_LDFLAGS}"
CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"])
else
@ -740,7 +861,6 @@ fi
# Whether to use AppleTypeService since Mac OS X.
# don't quote AS_HELP_STRING!
AC_ARG_WITH([ats],
AS_HELP_STRING([--with-ats],
[use AppleTypeService, if available (default=yes)]))
@ -791,41 +911,91 @@ case "$CFLAGS" in
esac
AC_SUBST([ftmac_c])
AC_SUBST([LIBZ])
AC_SUBST([LIBBZIP2])
AC_SUBST([LIBPNG])
AC_SUBST([LIBHARFBUZZ])
AC_SUBST([FT2_EXTRA_LIBS])
AC_SUBST([SYSTEM_ZLIB])
# entries in Requires.private are separated by commas;
REQUIRES_PRIVATE="$zlib_reqpriv, \
$bzip2_reqpriv, \
$libpng_reqpriv, \
$harfbuzz_reqpriv"
# beautify
REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
| sed -e 's/^ *//' \
-e 's/ *$//' \
-e 's/, */,/g' \
-e 's/,,*/,/g' \
-e 's/^,*//' \
-e 's/,*$//' \
-e 's/,/, /g'`
LIBS_PRIVATE="$zlib_libpriv \
$bzip2_libpriv \
$libpng_libpriv \
$harfbuzz_libpriv \
$ft2_extra_libs"
# beautify
LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
| sed -e 's/^ *//' \
-e 's/ *$//' \
-e 's/ */ /g'`
LIBS_CONFIG="-lfreetype \
$ZLIB_LIBS \
$BZIP2_LIBS \
$LIBPNG_LIBS \
$HARFBUZZ_LIBS \
$ft2_extra_libs"
# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
# on if necessary; also beautify
LIBS_CONFIG=`echo "$LIBS_CONFIG" \
| sed -e 's|-L */usr/lib64/* | |g' \
-e 's|-L */usr/lib/* | |g' \
-e 's/^ *//' \
-e 's/ *$//' \
-e 's/ */ /g'`
LIBSSTATIC_CONFIG="-lfreetype \
$zlib_libstaticconf \
$bzip2_libstaticconf \
$libpng_libstaticconf \
$harfbuzz_libstaticconf \
$ft2_extra_libs"
# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later
# on if necessary; also beautify
LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
| sed -e 's|-L */usr/lib64/* | |g' \
-e 's|-L */usr/lib/* | |g' \
-e 's/^ *//' \
-e 's/ *$//' \
-e 's/ */ /g'`
AC_SUBST([BZIP2_PKG])
AC_SUBST([LIBPNG_PKG])
AC_SUBST([HARFBUZZ_PKG])
LT_INIT(win32-dll)
AC_SUBST([ftmac_c])
AC_SUBST([REQUIRES_PRIVATE])
AC_SUBST([LIBS_PRIVATE])
AC_SUBST([LIBS_CONFIG])
AC_SUBST([LIBSSTATIC_CONFIG])
AC_SUBST([hardcode_libdir_flag_spec])
AC_SUBST([wl])
AC_SUBST([build_libtool_libs])
# changing LDFLAGS value should only be done after
# lt_cv_prog_compiler_static_works test
if test x$SYSTEM_ZLIB = xyes; then
CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
LDFLAGS="$LDFLAGS $LIBZ"
if test "$have_zlib" != no ; then
CFLAGS="$CFLAGS $ZLIB_CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
LDFLAGS="$LDFLAGS $ZLIB_LIBS "
fi
if test x$HAVE_LIBBZIP2 = xyes; then
CFLAGS="$CFLAGS $LIBBZIP2_CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2"
LDFLAGS="$LDFLAGS $LIBBZIP2_LIBS"
if test "$have_bzip2" != no ; then
CFLAGS="$CFLAGS $BZIP2_CFLAGS -DFT_CONFIG_OPTION_USE_BZIP2"
LDFLAGS="$LDFLAGS $BZIP2_LIBS"
fi
if test x$HAVE_LIBPNG = xyes; then
if test x"$have_libpng" != no ; then
CFLAGS="$CFLAGS $LIBPNG_CFLAGS -DFT_CONFIG_OPTION_USE_PNG"
LDFLAGS="$LDFLAGS $LIBPNG_LIBS"
fi
if test x$HAVE_LIBHARFBUZZ = xyes; then
if test x"$have_harfbuzz" != no ; then
CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS -DFT_CONFIG_OPTION_USE_HARFBUZZ"
LDFLAGS="$LDFLAGS $HARFBUZZ_LIBS"
fi
@ -855,4 +1025,13 @@ AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
AC_OUTPUT
AC_MSG_NOTICE([
Library configuration:
external zlib: $have_zlib
bzip2: $have_bzip2
libpng: $have_libpng
harfbuzz: $have_harfbuzz
])
# end of configure.raw