diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-05-25 08:58:23 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-05-25 08:58:23 +0000 |
commit | b50e8d78f4b4b86177863a60bc85f5cd393ba04b (patch) | |
tree | 0819fc02385b631cb47eaa46cc3613613e64ceef /Build/source/m4 | |
parent | 622523bd36859ef50591a5e4696bf803ca30a87d (diff) |
better handling of fontconfig, using pkg-config
git-svn-id: svn://tug.org/texlive/trunk@13457 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4')
-rw-r--r-- | Build/source/m4/cho-libs.m4 | 30 | ||||
-rw-r--r-- | Build/source/m4/kpse-fontconfig-flags.m4 | 23 |
2 files changed, 27 insertions, 26 deletions
diff --git a/Build/source/m4/cho-libs.m4 b/Build/source/m4/cho-libs.m4 index a6de533f8d1..f6addf6862d 100644 --- a/Build/source/m4/cho-libs.m4 +++ b/Build/source/m4/cho-libs.m4 @@ -70,26 +70,16 @@ AC_DEFUN([CHO_CHECK_LIBPAPER], # ----------------------- # Check for libfontconfig AC_DEFUN([CHO_CHECK_LIBFONTCONFIG], -[_cppflags=$CPPFLAGS _ldflags=$LDFLAGS - have_libfontconfig=no - AC_ARG_WITH([fontconfig], - [AS_HELP_STRING([--with-fontconfig=DIR],[use fontconfig include/library files from DIR])], - [if test -d "$withval"; then - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" - FONTCONFIGLDFLAGS="-L$withval/lib" - fi]) - AC_MSG_CHECKING([for fontconfig header files]) - AC_TRY_COMPILE( - [#include <fontconfig/fontconfig.h>], - [FcObjectSet *os;], - [AC_MSG_RESULT(yes) - AC_SEARCH_LIBS([FcInit], [fontconfig], - [AC_DEFINE([HAVE_LIBFONTCONFIG], 1, [Define if you have libfontconfig]) - have_libfontconfig=yes])], - [CPPFLAGS=$_cppflags - LDDFLAGS=$_ldflags - AC_MSG_RESULT(no)]) +[AC_CACHE_CHECK([for fontconfig header files and library], + [cho_cv_have_fontconfig], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <fontconfig/fontconfig.h>]], + [[FcObjectSet *os;]])], + [cho_cv_have_fontconfig=yes], + [cho_cv_have_fontconfig=no])]) +AS_IF([test "x$cho_cv_have_fontconfig" = xyes], + [AC_CHECK_FUNCS([FcInit], + [AC_DEFINE([HAVE_LIBFONTCONFIG], 1, + [Define if you have libfontconfig and its headers.])])]) ])# CHO_CHECK_LIBFONTCONFIG # CHO_CHECK_LIBFREETYPE(PACKAGE-NAME) diff --git a/Build/source/m4/kpse-fontconfig-flags.m4 b/Build/source/m4/kpse-fontconfig-flags.m4 index 4e869006ee3..681f1349692 100644 --- a/Build/source/m4/kpse-fontconfig-flags.m4 +++ b/Build/source/m4/kpse-fontconfig-flags.m4 @@ -17,16 +17,27 @@ # to the CPPFLAGS and LIBS required for the installed '-lfontconfig' # library and define HAVE_LIBFONTCONFIG. AC_DEFUN([KPSE_FONTCONFIG_FLAGS], -[AC_ARG_WITH([fontconfig], - AS_HELP_STRING([--with-fontconfig=DIR], - [use fontconfig include/library files from DIR]))[]dnl +[AC_REQUIRE([_KPSE_CHECK_PKG_CONFIG])[]dnl +AC_ARG_WITH([fontconfig-includes], + AS_HELP_STRING([--with-fontconfig-includes=DIR], + [fontconfig headers installed in DIR]))[]dnl +AC_ARG_WITH([fontconfig-libdir], + AS_HELP_STRING([--with-fontconfig-libdir=DIR], + [fontconfig library installed in DIR]))[]dnl AC_CACHE_CHECK([for installed fontconfig headers and library], [kpse_cv_have_fontconfig], [kpse_save_CPPFLAGS=$CPPFLAGS kpse_save_LIBS=$LIBS -if test "x$with_fontconfig" != x && test -d "$with_fontconfig"; then - kpse_cv_fontconfig_includes="-I$with_fontconfig/include" - kpse_cv_fontconfig_libs="-L$with_fontconfig/lib -lfontconfig" +if test "x$with_fontconfig_includes:$with_fontconfig_libdir" != x:; then + if test "x$with_fontconfig_includes" != x; then + kpse_cv_fontconfig_includes="-I$with_fontconfig_includes" + fi + if test "x$with_fontconfig_libdir" != x; then + kpse_cv_fontconfig_libdir="-L$with_fontconfig_libdir -lfontconfig" + fi +elif $PKG_CONFIG fontconfig; then + kpse_cv_fontconfig_includes=`$PKG_CONFIG fontconfig --cflags` + kpse_cv_fontconfig_libs=`$PKG_CONFIG fontconfig --libs` else kpse_cv_fontconfig_includes= kpse_cv_fontconfig_libs='-lfontconfig' |