summaryrefslogtreecommitdiff
path: root/Build/source/m4
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/m4')
-rw-r--r--Build/source/m4/kpse-freetype2-flags.m445
-rw-r--r--Build/source/m4/kpse-setup.m418
2 files changed, 43 insertions, 20 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
diff --git a/Build/source/m4/kpse-setup.m4 b/Build/source/m4/kpse-setup.m4
index 48097c1f9ea..b6cfa8ebcb9 100644
--- a/Build/source/m4/kpse-setup.m4
+++ b/Build/source/m4/kpse-setup.m4
@@ -41,7 +41,7 @@ KPSE_FOR_PKGS([libs], [m4_sinclude(kpse_TL[libs/]Kpse_Pkg[/ac/withenable.ac])])
# Provide the configure option --enable-PROG if the option `without' is
# specified, or -disable-PROG otherwise.
# Define the list of libraries required from the TL tree (if any).
-# Options:
+# Options:
# without - do not build by default
AC_DEFUN([KPSE_WITH_PROG],
[m4_pushdef([Kpse_with], m4_if(m4_index([ $3 ], [ without ]), [-1], [yes], [no]))[]dnl
@@ -67,11 +67,13 @@ AC_FOREACH([Kpse_Lib], [$2], [ need_[]AS_TR_SH(Kpse_Lib)=yes
# KPSE_WITH_LIB(LIB, REQUIRED-LIBS, OPTIONS, [COMMENT-SYS],
[COMMENT-INC], [COMMENT-LIB])
# ---------------------------------------------------------
-# Unless the option `tree' is specified, provide the configure options
-# --with-system-LIB, --with-LIB-includes, and --with-LIB-libdir.
+# Unless the option `tree' is specified, provide the configure option.
+# --with-system-LIB; in addition provide --with-LIB-includes, and
+# --with-LIB-libdir unless the option `nodirs' is specified.
# Define the list of libraries required from the TL tree (if any).
-# Options:
+# Options:
# tree - only use library from the TL tree
+# nodirs - prevent --with-LIB-*=DIR configure options
# The last three arguments are optional additions to the help texts.
#
# At the top-level we build a (reversed) list of potential system libraries.
@@ -80,12 +82,14 @@ AC_DEFUN([KPSE_WITH_LIB],
[AC_ARG_WITH([system-$1],
[AS_HELP_STRING([--with-system-$1],
[use installed $1 headers and library]m4_ifval([$4], [ ($4)]))])[]dnl
-AC_ARG_WITH([$1-includes],
- [AS_HELP_STRING([--with-$1-includes=DIR],
- [$1 headers installed in DIR]m4_ifval([$5], [ ($5)]))])[]dnl
+m4_if(m4_index([ $3 ], [ nodirs ]), [-1],
+[AC_ARG_WITH([$1-includes],
+ [AS_HELP_STRING([--with-$1-includes=DIR],
+ [$1 headers installed in DIR]m4_ifval([$5], [ ($5)]))])[]dnl
AC_ARG_WITH([$1-libdir],
[AS_HELP_STRING([--with-$1-libdir=DIR],
[$1 library installed in DIR]m4_ifval([$6], [ ($6)]))])[]dnl
+])[]dnl m4_if
if test "x$with_system_[]AS_TR_SH($1)" = x; then
if test -f $srcdir/kpse_TL[]m4_if([$1], [kpathsea], [texk], [libs])/$1/configure; then
AC_MSG_NOTICE([Assuming `$1' headers and library from TL tree])