diff options
Diffstat (limited to 'fontconfig/configure.in')
-rw-r--r-- | fontconfig/configure.in | 249 |
1 files changed, 114 insertions, 135 deletions
diff --git a/fontconfig/configure.in b/fontconfig/configure.in index e0aba1992..ea44c1422 100644 --- a/fontconfig/configure.in +++ b/fontconfig/configure.in @@ -63,6 +63,7 @@ AC_PROG_LN_S AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AC_PROG_MAKE_SET +PKG_PROG_PKG_CONFIG AC_MSG_CHECKING([for RM macro]) _predefined_rm=`make -p -f /dev/null 2>/dev/null|grep '^RM ='|sed -e 's/^RM = //'` @@ -106,7 +107,11 @@ AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes) dnl ========================================================================== -AC_ARG_WITH(arch, [ --with-arch=ARCH Force architecture to ARCH], arch="$withval", arch=auto) +AC_ARG_WITH(arch, + [AC_HELP_STRING([--with-arch=ARCH], + [Force architecture to ARCH])], + , + arch="$withval", arch=auto) if test "x$arch" != xauto; then AC_DEFINE_UNQUOTED([FC_ARCHITECTURE], "$arch", [Architecture prefix to use for cache file names]) @@ -166,20 +171,7 @@ AC_DEFINE_UNQUOTED(USE_ICONV,$use_iconv,[Use iconv.]) # # Checks for FreeType # - -AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes) - -if test "$freetype_config" = "yes"; then - AC_PATH_PROG(ft_config,freetype-config,no) - if test "$ft_config" = "no"; then - AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/]) - fi -else - ft_config="$freetype_config" -fi - -FREETYPE_CFLAGS="`$ft_config --cflags`" -FREETYPE_LIBS="`$ft_config --libs`" +PKG_CHECK_MODULES(FREETYPE, freetype2) AC_SUBST(FREETYPE_LIBS) AC_SUBST(FREETYPE_CFLAGS) @@ -202,123 +194,48 @@ LIBS="$fontconfig_save_libs" # # Check expat configuration # - -AC_ARG_WITH(expat, [ --with-expat=DIR Use Expat in DIR], expat=$withval, expat=yes) -AC_ARG_WITH(expat-includes, [ --with-expat-includes=DIR Use Expat includes in DIR], expat_includes=$withval, expat_includes=yes) -AC_ARG_WITH(expat-lib, [ --with-expat-lib=DIR Use Expat library in DIR], expat_lib=$withval, expat_lib=yes) - if test "$enable_libxml2" != "yes"; then - case "$expat" in - no) - ;; - *) - case "$expat_includes" in - yes) - case "$expat" in - yes) - ;; - *) - EXPAT_CFLAGS="-I$expat/include" - ;; - esac - ;; - no) - EXPAT_CFLAGS="" - ;; - *) - EXPAT_CFLAGS="-I$expat_includes" - ;; - esac - case "$expat_lib" in - yes) - case "$expat" in - yes) - EXPAT_LIBS="-lexpat" - ;; - *) - EXPAT_LIBS="-L$expat/lib -lexpat" - ;; - esac - ;; - no) - ;; - *) - EXPAT_LIBS="-L$expat_lib -lexpat" - ;; - esac - - expatsaved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS" - expatsaved_LIBS="$LIBS" - LIBS="$LIBS $EXPAT_LIBS" - - AC_CHECK_HEADER(expat.h) - case "$ac_cv_header_expat_h" in - no) - AC_CHECK_HEADER(xmlparse.h) - case "$ac_cv_header_xmlparse_h" in - no) - have_expat_header=no; - ;; - yes) - HAVE_XMLPARSE_H=1 - AC_SUBST(HAVE_XMLPARSE_H) - AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H, + # specify EXPAT_CFLAGS and/or EXPAT_LIBS if you like the old behavior + # with --with-expat-includes and --with-expat-lib. + PKG_CHECK_MODULES(EXPAT, expat) + expatsaved_CPPFLAGS="$CPPFLAGS" + expatsaved_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS" + LIBS="$LIBS $EXPAT_LIBS" + + AC_CHECK_HEADER(expat.h) + if test "$ac_cv_header_expat_h" = "no"; then + AC_CHECK_HEADER(xmlparse.h) + if test "$ac_cv_header_xmlparse_h" = "yes"; then + HAVE_XMLPARSE_H=1 + AC_SUBST(HAVE_XMLPARSE_H) + AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H, [Use xmlparse.h instead of expat.h]) - have_expat_header=yes - ;; - esac - ;; - yes) - have_expat_header=yes - ;; - esac - case "$have_expat_header" in - no) - expat=no - ;; - yes) - AC_CHECK_FUNCS(XML_SetDoctypeDeclHandler) - case "$ac_cv_func_XML_SetDoctypeDeclHandler" in - yes) - HAVE_EXPAT=1 - AC_SUBST(HAVE_EXPAT) - AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT, - [Found a useable expat library]) - ;; - *) - expat=no - ;; - esac - ;; - esac - CPPFLAGS="$expatsaved_CPPFLAGS" - LIBS="$expatsaved_LIBS" - ;; - esac - + else + AC_MSG_ERROR([ +*** expat is required. or try to use --enable-libxml2]) + fi + fi + AC_CHECK_FUNCS(XML_SetDoctypeDeclHandler) + if test "$ac_cv_func_XML_SetDoctypeDeclHandler" = "no"; then + AC_MSG_ERROR([ +*** expat is required. or try to use --enable-libxml2]) + fi + CPPFLAGS="$expatsaved_CPPFLAGS" + LIBS="$expatsaved_LIBS" + AC_SUBST(EXPAT_CFLAGS) AC_SUBST(EXPAT_LIBS) - - case "$expat" in - no) - EXPAT_CFLAGS="" - EXPAT_LIBS="" - - AC_MSG_WARN([Cannot find usable expat library. Trying to use libxml2 as fallback.]) - ;; - esac fi # # Check libxml2 configuration # +AC_ARG_ENABLE(libxml2, + [AC_HELP_STRING([--enable-libxml2], + [Use libxml2 instead of Expat])]) -AC_ARG_ENABLE(libxml2, [ --enable-libxml2 Use libxml2 instead of Expat]) - -PKG_PROG_PKG_CONFIG - -if test "$enable_libxml2" = "yes" -o "$expat" = "no"; then +if test "$enable_libxml2" = "yes"; then PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6]) AC_DEFINE_UNQUOTED(ENABLE_LIBXML2,1,[Use libxml2 instead of Expat]) @@ -330,7 +247,10 @@ fi # Set default font directory # -AC_ARG_WITH(default-fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], default_fonts="$withval", default_fonts=yes) +AC_ARG_WITH(default-fonts, + [AC_HELP_STRING([--with-default-fonts=DIR], + [Use fonts from DIR when config is busted])], + default_fonts="$withval", default_fonts=yes) case "$default_fonts" in yes) @@ -358,7 +278,10 @@ AC_SUBST(FC_DEFAULT_FONTS) # with outline fonts; those with bitmaps can be added as desired in # local.conf or ~/.fonts.conf # -AC_ARG_WITH(add-fonts, [ --with-add-fonts=DIR1,DIR2,...Find additional fonts in DIR1,DIR2,... ], add_fonts="$withval", add_fonts=yes) +AC_ARG_WITH(add-fonts, + [AC_HELP_STRING([--with-add-fonts=DIR1,DIR2,...], + [Find additional fonts in DIR1,DIR2,... ])], + add_fonts="$withval", add_fonts=yes) case "$add_fonts" in yes) @@ -409,7 +332,10 @@ AC_SUBST(FC_FONTPATH) # # Set default cache directory path # -AC_ARG_WITH(cache-dir, [ --with-cache-dir=DIR Use DIR to store cache files (default LOCALSTATEDIR/cache/fontconfig)], fc_cachedir="$withval", fc_cachedir=yes) +AC_ARG_WITH(cache-dir, + [AC_HELP_STRING([--with-cache-dir=DIR], + [Use DIR to store cache files [default=LOCALSTATEDIR/cache/fontconfig]])], + fc_cachedir="$withval", fc_cachedir=yes) case $fc_cachedir in no|yes) @@ -430,23 +356,72 @@ FC_FONTDATE=`LC_ALL=C date` AC_SUBST(FC_FONTDATE) -AC_ARG_WITH(confdir, [ --with-confdir=DIR Use DIR to store configuration files (default SYSCONFDIR/fonts)], confdir="$withval", confdir=yes) - # -# Set CONFDIR and FONTCONFIG_PATH +# Set configuration paths # -case "$confdir" in +AC_ARG_WITH(templatedir, + [AC_HELP_STRING([--with-templatedir=DIR], + [Use DIR to store the configuration template files [default=DATADIR/fontconfig/conf.avail]])], + [templatedir="$withval"], + [templatedir=yes]) +AC_ARG_WITH(baseconfigdir, + [AC_HELP_STRING([--with-baseconfigdir=DIR], + [Use DIR to store the base configuration files [default=SYSCONFDIR/fonts]])], + [baseconfigdir="$withval"], + [baseconfigdir=yes]) +AC_ARG_WITH(configdir, + [AC_HELP_STRING([--with-configdir=DIR], + [Use DIR to store active configuration files [default=BASECONFIGDIR/conf.d]])], + [configdir="$withval"], + [configdir=yes]) +AC_ARG_WITH(xmldir, + [AC_HELP_STRING([--with-xmldir=DIR], + [Use DIR to store XML schema files [default=DATADIR/xml/fontconfig]])], + [xmldir="$withval"], + [xmldir=yes]) + +case "$templatedir" in no|yes) - confdir='${sysconfdir}'/fonts + templatedir='${datadir}'/fontconfig/conf.avail ;; *) ;; esac -AC_SUBST(confdir) -CONFDIR=${confdir} -AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR",[Font configuration directory]) -AC_SUBST(CONFDIR) +case "$baseconfigdir" in +no|yes) + baseconfigdir='${sysconfdir}'/fonts + ;; +*) + ;; +esac +case "$configdir" in +no|yes) + configdir='${baseconfigdir}'/conf.d + ;; +*) + ;; +esac +case "$xmldir" in +no|yes) + xmldir='${datadir}'/xml/fontconfig + ;; +*) + ;; +esac + +TEMPLATEDIR=${templatedir} +BASECONFIGDIR=${baseconfigdir} +CONFIGDIR=${configdir} +XMLDIR=${xmldir} +AC_SUBST(templatedir) +AC_SUBST(TEMPLATEDIR) +AC_SUBST(baseconfigdir) +AC_SUBST(BASECONFIGDIR) +AC_SUBST(configdir) +AC_SUBST(CONFIGDIR) +AC_SUBST(xmldir) +AC_SUBST(XMLDIR) # # Let people not build/install docs if they don't have docbook @@ -468,7 +443,11 @@ if test x$HASDOCBOOK = xno; then fi fi -AC_ARG_ENABLE(docs, [ --disable-docs Don't build and install documentation],,enable_docs=$default_docs) +AC_ARG_ENABLE(docs, + [AC_HELP_STRING([--disable-docs], + [Don't build and install documentation])], + , + enable_docs=$default_docs) AM_CONDITIONAL(ENABLE_DOCS, test "x$enable_docs" = xyes) |