From 439959587de13ada54151587673e869870ae48e0 Mon Sep 17 00:00:00 2001 From: Martin Schröder Date: Wed, 30 Jan 2008 13:46:16 +0000 Subject: First step in converting to autoconf 2.61++ from peb git-svn-id: svn://tug.org/texlive/trunk@6448 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/Makefile.in | 2 +- Build/source/texk/m4/ChangeLog | 10 +++ Build/source/texk/m4/kpse_asm.m4 | 42 +++++++++++++ Build/source/texk/m4/kpse_cross.m4 | 51 ++++++++++++++++ Build/source/texk/m4/kpse_inc.m4 | 121 +++++++++++++++++++++++++++++++++++++ Build/source/texk/m4/kpse_maint.m4 | 35 +++++++++++ Build/source/texk/m4/kpse_mtim.m4 | 25 ++++++++ Build/source/texk/m4/kpse_unset.m4 | 34 +++++++++++ Build/source/texk/make/README | 17 ++++++ Build/source/texk/make/clean.mk | 2 +- 10 files changed, 337 insertions(+), 2 deletions(-) create mode 100644 Build/source/texk/m4/ChangeLog create mode 100644 Build/source/texk/m4/kpse_asm.m4 create mode 100644 Build/source/texk/m4/kpse_cross.m4 create mode 100644 Build/source/texk/m4/kpse_inc.m4 create mode 100644 Build/source/texk/m4/kpse_maint.m4 create mode 100644 Build/source/texk/m4/kpse_mtim.m4 create mode 100644 Build/source/texk/m4/kpse_unset.m4 (limited to 'Build') diff --git a/Build/source/Makefile.in b/Build/source/Makefile.in index 8a230a1f5c8..eb7ca589aed 100644 --- a/Build/source/Makefile.in +++ b/Build/source/Makefile.in @@ -138,7 +138,7 @@ distclean: clean (if test -f $$dir/Makefile; then cd $$dir && $(MAKE) $@; else true; fi) || exit 1; \ done rm -f Makefile *.status *.cache *.log dialogconfig.h TAGS - rm -f libs/config.log libs/config.status libs/config.cache libs/kpse_empty + rm -f libs/config.log libs/config.status libs/config.cache rm -f utils/texinfo/info/funs.h utils/texinfo/info/doc.c utils/texinfo/info/key.c tags TAGS: diff --git a/Build/source/texk/m4/ChangeLog b/Build/source/texk/m4/ChangeLog new file mode 100644 index 00000000000..c2f9c8c4c75 --- /dev/null +++ b/Build/source/texk/m4/ChangeLog @@ -0,0 +1,10 @@ +2008-01-29 Peter Breitenlohner + + Support for autoconf-2.59+: + * kpse_cross.m4, kpse_maint.m4, kpse_asm.m4, kpse_mtim.m4 + (all new): Copied from ../etc/autoconf/acsite.m4 with some + trivial changes. + * kpse_unset.m4 (new): Copied from ../etc/autoconf/acspecific.m4 + with some trivial changes. + * kpse_inc.m4 (new): kpse_include mechanism for autoconf-2.59. + diff --git a/Build/source/texk/m4/kpse_asm.m4 b/Build/source/texk/m4/kpse_asm.m4 new file mode 100644 index 00000000000..833003f00a1 --- /dev/null +++ b/Build/source/texk/m4/kpse_asm.m4 @@ -0,0 +1,42 @@ +# Private macro for the kpathsea library. +# by Peter Breitenlohner , April 15, 1996. +# Copyright (C) 1996 - 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# pb_AC_ASM_UNDERSCORE +# -------------------- +# Check if gcc asm for i386 needs external symbols with an underscore. +AC_DEFUN([pb_AC_ASM_UNDERSCORE], [ +AC_CACHE_CHECK([whether gcc asm needs underscore], + [pb_cv_asm_underscore], + [ +# Older versions of GCC asm for i386 need an underscore prepended to +# external symbols. Figure out if this is so. +AC_LINK_IFELSE([ +extern char val ; +extern void sub () ; +#if defined (__i386__) && defined (__GNUC__) +asm(" .align 4\n" +".globl sub\n" +"sub:\n" +" movb \$[]1,val\n" +" ret\n"); +#else +void sub () { val = 1; } +#endif /* assembler */ +char val ; +int main() { sub (); return 0; } +], [pb_cv_asm_underscore=no], [pb_cv_asm_underscore=yes])]) +if test "x$pb_cv_asm_underscore" = xyes; then + AC_DEFINE([ASM_NEEDS_UNDERSCORE], 1, + [web2c: Define if gcc asm needs _ on external symbols.]) +fi +] +) + diff --git a/Build/source/texk/m4/kpse_cross.m4 b/Build/source/texk/m4/kpse_cross.m4 new file mode 100644 index 00000000000..e08730de73e --- /dev/null +++ b/Build/source/texk/m4/kpse_cross.m4 @@ -0,0 +1,51 @@ +# Private macros for the kpathsea library. +# by Karl Berry +# Copyright (C) 199? - 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# KPSE_CROSS_PATH_PROG(RESULT, CROSS_PROG, NORMAL_PROG) +# ----------------------------------------------------- +# Find a program when cross-compiling, or use a default when not. +# RESULT = variable which records the outcome +# CROSS_PROG = program to look for when cross-compiling +# NORMAL_PROG = program to use when not cross-compiling +# Example: KPSE_CROSS_PATH_PROG([TANGLE], [tangle], [./tangle]) sets +# 'TANGLE' to the program 'tangle' found in PATH when cross-compiling, +# and to './tangle' if not. +AC_DEFUN([KPSE_CROSS_PATH_PROG], + [if test "$cross_compiling" = yes; then +AC_PATH_PROG([$1], [$2]) +if test -z "${$1}"; then + AC_MSG_ERROR([$2 was not found but is required when cross-compiling. + Install $2 or set \$$1 to the full pathname.]) +fi +else + $1=$3 +fi]) + +# KPSE_CROSS_BUILD_VAR(STEM, PROG) +# -------------------------------- +# Set BUILD$1 to $2 when cross-compiling, to $($1) if not. +# Example: KPSE_CROSS_BUILD_VAR([CC], [cc]) sets 'BUILDCC' to 'cc' +# if cross-compiling, and to '$(CC)' if not. +AC_DEFUN([KPSE_CROSS_BUILD_VAR], + [if test "$cross_compiling" = yes; then + if test -z "${BUILD$1}"; then + BUILD$1='$2' + fi + AC_MSG_RESULT([setting \$BUILD$1 to ${BUILD$1}]) +else + if test -n "${BUILD$1}"; then + AC_MSG_WARN([\$BUILD$1 set but not cross-compiling.]) + fi + BUILD$1='$($1)' +fi +AC_SUBST(BUILD$1) +]) + diff --git a/Build/source/texk/m4/kpse_inc.m4 b/Build/source/texk/m4/kpse_inc.m4 new file mode 100644 index 00000000000..dfa9a1b85bd --- /dev/null +++ b/Build/source/texk/m4/kpse_inc.m4 @@ -0,0 +1,121 @@ +# Private macros for the kpathsea library. +# by Peter Breitenlohner +# based on earlier work +# by Karl Berry +# Copyright (C) 1995 - 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# KPSE_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS]) +# --------------------------------------------------- +# Specify output files that are configured with AC_SUBST. +# In a first step, each input file is converted into an auxiliary file +# with all `kpse_include' directives resolved. +# In a second step each auxiliary file is passed to AC_CONFIG_FILES +# with the (optional) COMMANDS to be run after config.status creates +# the output file. +# +# Each FILE is specified as OUTPUT[:[INPUT][:[AUX]]], i.e., the syntax is +# similar to that for AC_CONFIG_FILES but the meaning is quite different, +# there is one unique INPUT for each OUTPUT. If omitted, INPUT defaults +# to OUTPUT.in and AUX to OUTPUT.aux. +AC_DEFUN([KPSE_CONFIG_FILES], +[AC_FOREACH([AC_File], [$1], + [_KPSE_CONFIG_FILE([$2], m4_bpatsubst(AC_File, [:], [,]))])dnl +_AC_CONFIG_COMMANDS_INIT([$3])dnl +]) + +# _KPSE_CONFIG_FILE([COMMANDS], OUTPUT, [INPUT], [AUX]) +# ----------------------------------- +# See above. +m4_define([_KPSE_CONFIG_FILE], +[AC_CONFIG_FILES(m4_ifval([$4], [$4], [$2].aux):m4_ifval([$3], [$3], [$2].in), + [# Discard the file just generated and first resolve kpse_include's + _KPSE_INCLUDE(m4_ifval([$4], [$4], [$2].aux), m4_ifval([$3], [$3], [$2].in))])dnl +AC_CONFIG_FILES([$2]:m4_ifval([$4], [$4], [$2].aux), [$1])dnl +]) + +# _KPSE_INCLUDE(DEST, SOURCE) +# --------------------------- +# Create DEST from SOURCE with all occurrences of +# kpse_include INCLUDE_FILE +# replaced by the contents of INCLUDE_FILE if that file exists. +# Note: this doesn't work recursively, one level of inclusion only! +m4_define([_KPSE_INCLUDE], +[kpse_input=`case $2 in + [[\\/$]]*) # Absolute + test -f "$2" || AC_MSG_ERROR([cannot find input file: $2]) + echo "$2";; + *) # Relative + if test -f "$2"; then + # Build tree + echo "$2" + elif test -f "$srcdir/$2"; then + # Source tree + echo "$srcdir/$2" + else + # /dev/null tree + AC_MSG_ERROR([cannot find input file: $2]) + fi;; + esac` || AS_EXIT([1]) +# Replace lines of the form "kpse_include foo" with the contents of foo: +# first, from the kpse_include lines construct a list of file names. +# From that list, we construct a second list of those files that exist. +# Then we construct a list of sed commands for including those files, +# and a sed command that removes the kpse_include lines. We don't attempt +# to read non-existent files because some (buggy) versions of sed choke +# on this. Have to use sed because old (Ultrix, SunOs) awk does not support +# getline or system. (Anyway, configure scripts aren't supposed to use awk.) +# Can't use only one -e and commands {dr foo} because foo has to be last. +# Be careful, because the filename may contain /. +# Be careful with whitespace; we need to use echo. +kpse_file_substs=`sed -n '/^kpse_include/s%[[ ]]*\(.*\)%\1%p' "$kpse_input"` +if test x"$kpse_file_substs" = x; then + AC_MSG_WARN([No need to use \`[KPSE_CONFIG_FILES]' for input \`$2' + without any \`kpse_include' directives]) +fi +# Create the sed command line ... +dnl # Input lines containing "@configure_input@" are output twice, +dnl # first unmodified and then with our modifications. +dnl kpse_substs="sed -e '/@configure_input@/p' \ +dnl -e 's,@configure_input@,$1. Generated from `echo $2 | +dnl sed 's,.*/,,'` by configure.,'" +dnl +dnl I hope this is portable +# Input lines containing "@configure_input@" are output twice, +# first with our modifications and then unmodified. +kpse_substs="sed -e '/@configure_input@/ { h; \ + s,@configure_input@,$1. Generated from `echo $2 | + sed 's,.*/,,'` by configure.,; G }'" +for kpse_inc in $kpse_file_substs; do + kpse_read=`case $kpse_inc in + [[\\/$]]*) # Absolute + if test -f "$kpse_inc"; then + echo "$kpse_inc" + fi;; + *) # Relative + if test -f "$kpse_inc"; then + # Build tree + echo "$kpse_inc" + elif test -f "$srcdir/$kpse_inc"; then + # Source tree + echo "$srcdir/$kpse_inc" + fi;; + esac` + if test -n "$kpse_read"; then + kpse_mung=`echo $kpse_inc | sed 's,/,%,g'` + kpse_substs="$kpse_substs -e '/^kpse_include $kpse_mung$/r $kpse_read'" + fi +done +# ... and fix the whitespace and escaped slashes. +kpse_substs=`echo "$kpse_substs" | sed -e 's,%,\\\/,g' \ + -e 's/kpse_include /kpse_include[[ ]]*/g'` +dnl The parens around the eval prevent an "illegal io" in Ultrix sh. +(eval $kpse_substs -e '/^kpse_include/d' "$kpse_input") > $1 +]) + diff --git a/Build/source/texk/m4/kpse_maint.m4 b/Build/source/texk/m4/kpse_maint.m4 new file mode 100644 index 00000000000..bf0ca3f5f17 --- /dev/null +++ b/Build/source/texk/m4/kpse_maint.m4 @@ -0,0 +1,35 @@ +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# Adapted for kpathsea + +# AM_MAINTAINER_MODE +# ------------------ +# Check whether to enable maintainer-specific portions of Makefiles. +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + if test "x$USE_MAINTAINER_MODE" = xyes; then + MAINT= + else + MAINT='#M#' + fi + AC_SUBST(MAINT)dnl +] +) + diff --git a/Build/source/texk/m4/kpse_mtim.m4 b/Build/source/texk/m4/kpse_mtim.m4 new file mode 100644 index 00000000000..90958a566e4 --- /dev/null +++ b/Build/source/texk/m4/kpse_mtim.m4 @@ -0,0 +1,25 @@ +# Private macro for the kpathsea library. +# by Karl Berry +# Copyright (C) 199? - 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# KPSE_STRUCT_ST_MTIM +# ------------------- +# Test for member st_mtim in struct stat +# Should use AC_CHECK_MEMBER or AC_CHECK_MEMBERS +AC_DEFUN([KPSE_STRUCT_ST_MTIM], +[AC_CACHE_CHECK([for st_mtim in struct stat], ac_cv_struct_st_mtim, +[AC_TRY_COMPILE([#include +#include ], [struct stat s; s.st_mtim;], +ac_cv_struct_st_mtim=yes, ac_cv_struct_st_mtim=no)]) +if test $ac_cv_struct_st_mtim = yes; then + AC_DEFINE(HAVE_ST_MTIM) +fi +]) + diff --git a/Build/source/texk/m4/kpse_unset.m4 b/Build/source/texk/m4/kpse_unset.m4 new file mode 100644 index 00000000000..a93d8ef0da8 --- /dev/null +++ b/Build/source/texk/m4/kpse_unset.m4 @@ -0,0 +1,34 @@ +# Private macros for the kpathsea library. +# by Karl Berry +# Copyright (C) 199? - 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AC_UNSET_CC +# ----------- +# Unset CC to run configure with cross compiler. +AC_DEFUN([AC_UNSET_CC], [ +ZZ= +if test "$cross_compiling" = yes && + (test "x$CC" = "xdos-gcc" || test "x$CC" = "xi386-mingw32-gcc" || test "x$CC" = "xgnuwin32gcc") ; then +ZZ=$CC +unset CC +cross_compiling=no +fi +]) + +# AC_RESET_CC +# ----------- +# Restore CC that has been unset by AC_UNSET_CC +AC_DEFUN([AC_RESET_CC], [ +if test "x$ZZ" = "xdos-gcc" || test "x$ZZ" = "xi386-mingw32-gcc" || test "x$ZZ" = "xgnuwin32gcc" ; then +CC=$ZZ +cross_compiling=yes +fi +]) + diff --git a/Build/source/texk/make/README b/Build/source/texk/make/README index 779cd460e6a..9481d74b7d5 100644 --- a/Build/source/texk/make/README +++ b/Build/source/texk/make/README @@ -4,3 +4,20 @@ configure substitutes them for ac_include lines in Makefile.in. (This is an enhancement to standard Autoconf; see aclocal.m4.) kb@mail.tug.org + +------------------------ + +With the long overdue transition from autoconf-2.13 to autoconf-2.59+ +this is handled as follows: + +Every 'ac_include' in Makefile.in are replaced by 'kpse_include' and the +command 'AC_CONFIG_FILES([Makefile])' in configure.in (or configure.ac) +is replaced by 'KPSE_CONFIG_FILES([Makefile])'. + +The macro KPSE_CONFIG_FILES (defined in kpse_inc.m4) uses standard +autoconf mechanisms to achieve the desired substitutions. + +Peter Breitenlohner + + + diff --git a/Build/source/texk/make/clean.mk b/Build/source/texk/make/clean.mk index fc55c1ab109..7b963fa074a 100644 --- a/Build/source/texk/make/clean.mk +++ b/Build/source/texk/make/clean.mk @@ -7,7 +7,7 @@ clean:: mostlyclean rm -f $(library).a squeeze *.bad *.dvi *.lj distclean:: extraclean clean - rm -f Makefile Makefile.aux kpse_empty + rm -f Makefile Makefile.aux rm -f config.status config.log config.cache c-auto.h libtool rm -rf conftest* rm -f stamp-auto stamp-tangle stamp-ctangle -- cgit v1.2.3