summaryrefslogtreecommitdiff
path: root/Build/source/m4/kpse-fontconfig-flags.m4
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-05-25 08:58:23 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-05-25 08:58:23 +0000
commitb50e8d78f4b4b86177863a60bc85f5cd393ba04b (patch)
tree0819fc02385b631cb47eaa46cc3613613e64ceef /Build/source/m4/kpse-fontconfig-flags.m4
parent622523bd36859ef50591a5e4696bf803ca30a87d (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/kpse-fontconfig-flags.m4')
-rw-r--r--Build/source/m4/kpse-fontconfig-flags.m423
1 files changed, 17 insertions, 6 deletions
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'