summaryrefslogtreecommitdiff
path: root/Build/source/m4/kpse-freetype2-flags.m4
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-04-22 18:17:33 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-04-22 18:17:33 +0000
commit633c2bc993d2ad14ecf137836f22eef08805a3b5 (patch)
tree784c479c7046d0dbf7cbfb9446c7762b5e1bb494 /Build/source/m4/kpse-freetype2-flags.m4
parent62b00fcce4ced507597a1c9b18116b781f0d1a9e (diff)
build fix for freetype2 and macosx (preliminary)
git-svn-id: svn://tug.org/texlive/trunk@12798 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4/kpse-freetype2-flags.m4')
-rw-r--r--Build/source/m4/kpse-freetype2-flags.m445
1 files changed, 32 insertions, 13 deletions
diff --git a/Build/source/m4/kpse-freetype2-flags.m4 b/Build/source/m4/kpse-freetype2-flags.m4
index 68feb0de66c..387aeaa3262 100644
--- a/Build/source/m4/kpse-freetype2-flags.m4
+++ b/Build/source/m4/kpse-freetype2-flags.m4
@@ -9,28 +9,47 @@
# KPSE_FREETYPE2_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
# -----------------------------------------------------
-# Provide the configure options '--with-system-freetype2' (if in the TL tree),
-# '--with-freetype2-includes', and '--with-freetype2-libdir'.
+# Provide the configure options '--with-system-freetype2' (if in the TL tree).
#
# Set the make variables FREETYPE2_INCLUDES and FREETYPE2_LIBS to the CPPFLAGS and
# LIBS required for the `-lfreetype' library in libs/freetype2/ of the TL tree.
+dnl AC_DEFUN([KPSE_FREETYPE2_FLAGS],
+dnl [AC_REQUIRE([_KPSE_CHECK_FT2_CONFIG])[]dnl
+dnl _KPSE_LIB_FLAGS([freetype2], [freetype],
+dnl [$1],
+dnl [-IBLD/libs/freetype2/freetype2 -IBLD/libs/freetype2],
+dnl [BLD/libs/freetype2/libfreetype.a], [],
+dnl [], [${top_builddir}/../../libs/freetype2/ft2build.h])[]dnl
+dnl ]) # KPSE_FREETYPE2_FLAGS
AC_DEFUN([KPSE_FREETYPE2_FLAGS],
-[AC_REQUIRE([KPSE_ZLIB_FLAGS])[]dnl
+[AC_REQUIRE([_KPSE_CHECK_FT2_CONFIG])[]dnl
_KPSE_LIB_FLAGS([freetype2], [freetype],
- [$1],
- [-IBLD/libs/freetype2/freetype2 -IBLD/libs/freetype2],
- [BLD/libs/freetype2/libfreetype.a], [],
- [], [${top_builddir}/../../libs/freetype2/ft2build.h])[]dnl
+ [$1],
+ [cat BLD/libs/freetype2/ft-],
+ [BLD/libs/freetype2/libfreetype.a], [],
+ [], [${top_builddir}/../../libs/freetype2/ft2build.h])[]dnl
+if test "x$with_system_freetype2" = xno; then
+ FREETYPE2_LIBS='`'"$FREETYPE2_INCLUDES"'libs`'
+ FREETYPE2_INCLUDES='`'"$FREETYPE2_INCLUDES"'includes`'
+fi
]) # KPSE_FREETYPE2_FLAGS
# KPSE_FREETYPE2_SYSTEM_FLAGS
# ---------------------------
AC_DEFUN([KPSE_FREETYPE2_SYSTEM_FLAGS],
-[if test "x$with_freetype2_includes" != x && test "x$with_freetype2_includes" != xyes; then
- FREETYPE2_INCLUDES="-I$with_freetype2_includes/freetype2 -I$with_freetype2_includes"
-fi
-FREETYPE2_LIBS="-lfreetype"
-if test "x$with_freetype2_libdir" != x && test "x$with_freetype2_libdir" != xyes; then
- FREETYPE2_LIBS="-L$with_freetype2_libdir $FREETYPE2_LIBS"
+[AC_REQUIRE([_KPSE_CHECK_FT2_CONFIG])[]dnl
+if test -n `$FT2_CONFIG --ftversion 2>/dev/null`; then
+ FREETYPE2_INCLUDES=`$FT2_CONFIG --cflags`
+ FREETYPE2_LIBS=`$FT2_CONFIG --libs`
+else
+ AC_MSG_ERROR([Can not use installed freetype2 headers and library])
fi
]) # KPSE_FREETYPE2_SYSTEM_FLAGS
+
+# _KPSE_CHECK_FT2_CONFIG
+# ----------------------
+# Check for freetype-config
+AC_DEFUN([_KPSE_CHECK_FT2_CONFIG],
+[AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
+AC_CHECK_TOOL([FT2_CONFIG], [freetype-config], [:])[]dnl
+]) # _KPSE_CHECK_FT2_CONFIG