summaryrefslogtreecommitdiff
path: root/Build/source/m4
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-09-09 10:07:08 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-09-09 10:07:08 +0000
commite981cdbd1662ed82436259f1046987c5b7204f1a (patch)
tree031a0f1bd753e2495237b10de7d1ff6fe5a1a909 /Build/source/m4
parent3ad3db6624b55ad14658410f68ab6cb878904c7c (diff)
Various updates of build system: Use AC_CONFIG_MACRO_DIRS instead of ACLOCAL_AMFLAGS,
Factor recursion into subdirs into .am fragment and m4 macros, Avoid unnecessary use of Libtool, Use z_const git-svn-id: svn://tug.org/texlive/trunk@31606 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/m4')
-rw-r--r--Build/source/m4/ChangeLog10
-rw-r--r--Build/source/m4/kpse-freetype2-flags.m46
-rw-r--r--Build/source/m4/kpse-pkgs.m42
-rw-r--r--Build/source/m4/kpse-setup.m468
4 files changed, 72 insertions, 14 deletions
diff --git a/Build/source/m4/ChangeLog b/Build/source/m4/ChangeLog
index cf95c4adc0e..47040f51af1 100644
--- a/Build/source/m4/ChangeLog
+++ b/Build/source/m4/ChangeLog
@@ -1,3 +1,13 @@
+2013-09-05 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * kpse-setup.m4 (KPSE_RECURSE_LIBS, KPSE_RECURSE_PROGS):
+ New macros to recurse into all library and program modules.
+ Ignore missing modules (at both autoconf and configure time).
+
+2013-09-01 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * kpse-freetype2-flags.m4: No reason to require Libtool.
+
2013-08-18 Peter Breitenlohner <peb@mppmu.mpg.de>
* kpse-zlib-flags.m4 (KPSE_ZLIB_FLAGS): Test if <<zlib.h> defines
diff --git a/Build/source/m4/kpse-freetype2-flags.m4 b/Build/source/m4/kpse-freetype2-flags.m4
index ce4da7a6ade..4e11f6ee525 100644
--- a/Build/source/m4/kpse-freetype2-flags.m4
+++ b/Build/source/m4/kpse-freetype2-flags.m4
@@ -1,5 +1,5 @@
# Public macros for the TeX Live (TL) tree.
-# Copyright (C) 2009-2012 Peter Breitenlohner <tex-live@tug.org>
+# Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org>
#
# This file is free software; the copyright holder
# gives unlimited permission to copy and/or distribute it,
@@ -13,9 +13,9 @@
# LIBS required for the `-lfreetype' library in libs/freetype2/ of the TL tree.
AC_DEFUN([KPSE_FREETYPE2_FLAGS], [dnl
AC_REQUIRE([KPSE_ZLIB_FLAGS])[]dnl
-_KPSE_LIB_FLAGS([freetype2], [freetype], [lt],
+_KPSE_LIB_FLAGS([freetype2], [freetype], [],
[-IBLD/libs/freetype2/freetype2 -IBLD/libs/freetype2],
- [BLD/libs/freetype2/libfreetype.la], [],
+ [BLD/libs/freetype2/libfreetype.a], [],
[], [${top_builddir}/../../libs/freetype2/ft2build.h])[]dnl
]) # KPSE_FREETYPE2_FLAGS
diff --git a/Build/source/m4/kpse-pkgs.m4 b/Build/source/m4/kpse-pkgs.m4
index da0b427d43c..e2a3307ab53 100644
--- a/Build/source/m4/kpse-pkgs.m4
+++ b/Build/source/m4/kpse-pkgs.m4
@@ -143,6 +143,6 @@ AC_DEFUN([KPSE_FOR_PKGS],
AC_FOREACH([Kpse_Pkg], kpse_$1_pkgs,
[m4_pushdef([Kpse_pkg], AS_TR_SH(Kpse_Pkg))[]dnl
m4_pushdef([Kpse_PKG], AS_TR_CPP(Kpse_Pkg))[]dnl
-$2
+$2[]dnl
m4_popdef([Kpse_pkg])m4_popdef([Kpse_PKG])[]dnl
])]) # KPSE_FOR_PKGS
diff --git a/Build/source/m4/kpse-setup.m4 b/Build/source/m4/kpse-setup.m4
index 1309b69b92a..73913d38159 100644
--- a/Build/source/m4/kpse-setup.m4
+++ b/Build/source/m4/kpse-setup.m4
@@ -14,8 +14,8 @@
# configure option --disable-PKG or --enable-PKG for programs
# additional program specific configure options (if any)
# library dependencies for programs and libraries
-AC_DEFUN([KPSE_SETUP],
-[AC_REQUIRE([_KPSE_MSG_WARN_PREPARE])[]dnl
+AC_DEFUN([KPSE_SETUP], [dnl
+AC_REQUIRE([_KPSE_MSG_WARN_PREPARE])[]dnl
m4_define([kpse_TL], [$1])[]dnl
m4_define([kpse_indent_26], [28])[]dnl
AC_ARG_ENABLE([all-pkgs],
@@ -95,8 +95,9 @@ KPSE_FOR_PKGS([texlibs], [m4_sinclude(kpse_TL[texk/]Kpse_Pkg[/ac/withenable.ac])
# disable - do not build by default
# native - impossible to cross compile
# x - requires X11
-AC_DEFUN([KPSE_ENABLE_PROG],
-[m4_pushdef([Kpse_enable], m4_if(m4_index([ $3 ], [ disable ]), [-1], [yes], [no]))[]dnl
+AC_DEFUN([KPSE_ENABLE_PROG], [dnl
+m4_define([have_]AS_TR_SH($1))[]dnl
+m4_pushdef([Kpse_enable], m4_if(m4_index([ $3 ], [ disable ]), [-1], [yes], [no]))[]dnl
AC_ARG_ENABLE([$1],
AS_HELP_STRING([[--]m4_if(Kpse_enable, [yes], [dis], [en])[able-$1]],
m4_if(Kpse_enable, [yes],
@@ -155,8 +156,9 @@ m4_define([kpse_sys_texk_pkgs], [])[]dnl initialize the list.
# _KPSE_WITH_LIB(DIR, LIB, REQUIRED-LIBS, OPTIONS)
# ------------------------------------------------
# Internal subroutine for KPSE_WITH_LIB and KPSE_WITH_TEXLIB.
-m4_define([_KPSE_WITH_LIB],
-[m4_if(m4_index([ $4 ], [ tree ]), [-1],
+m4_define([_KPSE_WITH_LIB], [dnl
+m4_define([have_]AS_TR_SH($2))[]dnl
+m4_if(m4_index([ $4 ], [ tree ]), [-1],
[KPSE_]AS_TR_CPP([$2])[_OPTIONS([with-system])[]dnl
if test "x$with_system_[]AS_TR_SH($2)" = x; then
if test -f $srcdir/kpse_TL[]$1/$2/configure; then
@@ -205,8 +207,8 @@ AC_FOREACH([Kpse_Lib], [$3], [ need_[]AS_TR_SH(Kpse_Lib)=yes
# When the user requests to use an installed version of a required library,
# check that the flags derived from --with-LIB-includes and --with-LIB-libdir
# or determined otherwise provide the required functionality.
-AC_DEFUN([KPSE_TRY_LIB],
-[if test "x$need_[]AS_TR_SH($1):$with_system_[]AS_TR_SH($1)" = xyes:yes; then
+AC_DEFUN([KPSE_TRY_LIB], [dnl
+if test "x$need_[]AS_TR_SH($1):$with_system_[]AS_TR_SH($1)" = xyes:yes; then
AC_MSG_CHECKING([requested system `$1' library])
CPPFLAGS="$AS_TR_CPP($1)_INCLUDES $CPPFLAGS"
LIBS="$AS_TR_CPP($1)_LIBS $LIBS"
@@ -220,10 +222,56 @@ fi
# KPSE_TRY_LIBXX(LIB, PROLOGUE, BODY)
# -----------------------------------
# As above, but for C++.
-AC_DEFUN([KPSE_TRY_LIBXX],
-[AC_REQUIRE([AC_PROG_CXX])[]dnl
+AC_DEFUN([KPSE_TRY_LIBXX], [dnl
+AC_REQUIRE([AC_PROG_CXX])[]dnl
AC_LANG_PUSH([C++])[]dnl
KPSE_TRY_LIB($@)[]dnl
AC_LANG_POP([C++])[]dnl
]) # KPSE_TRY_LIBXX
+# KPSE_RECURSE_LIBS(LIST, TEXT, [PREFIX])
+# ---------------------------------------
+# Determine which of the libraries in kpse_LIST_pkgs to build.
+AC_DEFUN([KPSE_RECURSE_LIBS], [dnl
+m4_pushdef([Kpse_add], [$][1="$3Kpse_Pkg $$][1"])[]dnl prepend
+_KPSE_RECURSE([$1], [$2 libraries],
+ [test "x$with_system_[]Kpse_pkg" != xyes && test "x$need_[]Kpse_pkg" = xyes],
+ [$3])[]dnl
+m4_popdef([Kpse_add])[]dnl
+]) # KPSE_RECURSE_LIBS
+
+# KPSE_RECURSE_PROGS(LIST, TEXT)
+# ------------------------------
+# Determine which of the programs in kpse_LIST_pkgs to build.
+AC_DEFUN([KPSE_RECURSE_PROGS], [dnl
+m4_pushdef([Kpse_add], [$][1="$$][1 Kpse_Pkg"])[]dnl append
+_KPSE_RECURSE([$1], [$2 programs],
+ [test "x$enable_[]Kpse_pkg" = xyes])[]dnl
+m4_popdef([Kpse_add])[]dnl
+]) # KPSE_RECURSE_PROGS
+
+# _KPSE_RECURSE(LIST, TEXT, COND, [PREFIX])
+# -----------------------------------------
+# Internal subroutine. Determine which of the libraies or programs in
+# kpse_LIST_pkgs to build, and set output variables MAKE_SUBDIRS and
+# CONF_SUBDIRS. Cause 'make dist', 'configure -hr', and 'autoreconf'
+# to recurse into all existing ones.
+m4_define([_KPSE_RECURSE], [dnl
+AC_MSG_CHECKING([for $2 to build])
+MAKE_SUBDIRS=
+CONF_SUBDIRS=
+KPSE_FOR_PKGS([$1], [dnl
+m4_ifdef([have_]Kpse_pkg, [dnl
+if test -x $srcdir/$4Kpse_Pkg/configure; then
+ $3 && Kpse_add([MAKE_SUBDIRS])
+ Kpse_add([CONF_SUBDIRS])
+ if false; then
+ AC_CONFIG_SUBDIRS($4Kpse_Pkg)
+ fi
+fi
+])[]dnl m4_ifdef
+])
+AC_SUBST([MAKE_SUBDIRS])[]dnl
+AC_SUBST([CONF_SUBDIRS])[]dnl
+AC_MSG_RESULT([$MAKE_SUBDIRS])[]dnl
+]) # _KPSE_RECURSE