summaryrefslogtreecommitdiff
path: root/Build/source/reautoconf
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2008-02-22 13:26:51 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2008-02-22 13:26:51 +0000
commit967085db16cf192c5b331dd0c1329a05c8ad99eb (patch)
treecd4b1ca034d0d5eb78f3953f39b21cb5bcce7de4 /Build/source/reautoconf
parent0f707b371f1c3df29547d4c42dfceb4b7f29c953 (diff)
new version of reautoconf script
git-svn-id: svn://tug.org/texlive/trunk@6731 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/reautoconf')
-rwxr-xr-xBuild/source/reautoconf152
1 files changed, 95 insertions, 57 deletions
diff --git a/Build/source/reautoconf b/Build/source/reautoconf
index 6ef35f4c6b1..85c80c0cf0e 100755
--- a/Build/source/reautoconf
+++ b/Build/source/reautoconf
@@ -1,18 +1,12 @@
#! /bin/sh
-echo "autoconf stuff in transition, do not use! --peb/martin/karl 1feb08"
-exit 1
-/bin/false
-
# $Id$
# This "reautoconf" script found at the root of the TeX Live source tree
-# runs a hacked autoconf 2.13 in various directories and the
-# current autoconf (from PATH) in the rest.
-# Adapted from Peter Breitenlohner's original version.
+# runs aclocal and autoconf (from PATH) in all relevant directories.
#
# Copyright 2008 Karl Berry.
# Copyright 2005 Olaf Weber.
-# Copyright 2004 Peter Breitenlohner.
+# Copyright 2004 - 2008 Peter Breitenlohner.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -29,68 +23,112 @@ exit 1
unset CDPATH
+usage="Usage: $0 [OPTION]...
+ Run \`aclocal' (if applicable) and \`autoconf' for a
+ selection of packages in the TeX Live source tree.
+
+Options:
+ -h, --help display this help and exit successfully
+ -f, --force include some optional packages
+ -n, --dry-run don't run any commands; just print them
+ -q, --quiet don't echo commands
+ -v, --verbose verbosely report processing (default)
+
+Selection:
+ packages using KPSE macros are included
+ packages using automake are excluded
+ packages using GNU autoconf 2.60 or later:
+ with \`--force' included, otherwise excluded
+ packages using old autoconf versions are excluded
+
+Environment variables:
+ TL_AUTOCONF: program to use instead of autoconf from PATH
+ TL_ACLOCAL: program to use instead of aclocal from PATH"
+
+force=no
+do_cmd=
+do_say=echo
+
+for option
+do
+ case $option in
+ -h | --help) echo "$usage"; exit 0
+ ;;
+ -f | --force) force=yes
+ ;;
+ -n | --dry-run) do_cmd=:
+ ;;
+ -q | --quiet) do_say=:
+ ;;
+ -v | --verbose) do_say=echo
+ ;;
+ *) echo "$0: *** unrecognized option \`$option'"
+ echo "$usage"; exit 1
+ ;;
+ esac
+done
+
+[ "$do_cmd" = : ] && do_say=echo # -n implies -v
+
[ -f ./texk/make/common.mk ] || {
echo "$0: *** can't find ./texk/make/common.mk (from `pwd`)" >&2
exit 1
}
-# Remember the topdir.
-topdir=`pwd`
+: ${TL_AUTOCONF=autoconf}
+echo "$0: using \"$TL_AUTOCONF\" = `$TL_AUTOCONF --version | sed 1q`"
+echo "$0: if you want to use a different autoconf, set TL_AUTOCONF."
+: ${TL_ACLOCAL=aclocal}
+echo "$0: using \"$TL_ACLOCAL\" = `$TL_ACLOCAL --version | sed 1q`"
+echo "$0: if you want to use a different aclocal, set TL_ACLOCAL."
-# "acold" runs our hacked autoconf-2.13 with special includes.
-acold () { # $dir=current
- echo "$0: running our autoconf2.13 in \`$dir'"
- $topdir/texk/autoconf2.13 -m "$topdir/texk/etc/autoconf"
-}
+sleep 5 # Give users a chance to cancel and set TL_AUTOCONF and/or TL_ACLOCAL
-# acnew runs autoconf from PATH.
-acnew () { # $dir=current, $dir/$rdir->./texk/m4 with the KPSE macros.
- echo "$0: running $TL_AUTOCONF in \`$dir'"
- $TL_AUTOCONF --force || return
+do_it () {
+ $do_say "$0: running \"$@\""
+ $do_cmd "$@"
}
-: ${TL_AUTOCONF=autoconf}
-echo "$0: new $TL_AUTOCONF = `$TL_AUTOCONF --version | sed 1q`"
-echo "$0: if you want to use a different autoconf, set TL_AUTOCONF."
+# process one directory
+do_one () { # $base=configure.{in,ac}, $dir=current, $dir/$rdir->./texk/m4 with the KPSE macros
+ if grep 'AM_INIT_AUTOMAKE' $base >/dev/null 2>&1; then
+ $do_say "$0: $dir/$base ... uses automake, skipped."
+ elif grep 'm4_include(\['$rdir'/kpse_.*\.m4])' aclocal.m4 >/dev/null 2>&1; then
+ $do_say "$0: $dir/$base ... uses KPSE macros"
+ do_it $TL_ACLOCAL -I $rdir
+ do_it $TL_AUTOCONF
+ elif grep '# Generated by GNU Autoconf 2.6' configure >/dev/null 2>&1; then
+ if test "$force" = yes; then
+ $do_say "$0: $dir/$base ... uses modern autoconf, forced"
+ do_it $TL_AUTOCONF
+ else
+ $do_say "$0: $dir/$base ... uses modern autoconf, skipped"
+ fi
+ else
+ $do_say "$0: $dir/$base ... uses older autoconf, skipped."
+ fi
+}
# Autoconf in . (the top level).
-dir=. rdir=texk/m4
-acold
+base=configure.in dir=. rdir=texk/m4
+do_one
# Autoconf in all other directories
-for dir in `find utils libs texk -name configure.in | sed 's,/configure.in$,,'`; do
- case $dir in
- */texi*) # texinfo and texi2html are automade
- ;;
- */ncurses) # ncurses has its own special configure
- ;;
- */icu*) # ICU needs new autoconf
- (cd $dir; acnew)
- ;;
- */libgnuw32)# only for windows
- ;;
- utils/*) # Skip everything in utils for now.
- ;;
- */curl) # Is automade.
- ;;
- texk) rdir=m4
- (cd $dir; acold)
- ;;
- texk/*) rdir=`echo $dir | sed -e 's,^texk/,,' -e 's,[^/]*,..,g'`/m4
- case $dir in
- */devnag|*/dvipdfmx|*/xdvipdfmx)
- (cd $dir; acnew);;
- *) (cd $dir; acold);;
- esac
- ;;
- *) rdir=`echo $dir | sed 's,[^/]*,..,g'`/texk/m4
- case $dir in
- */t1utils|*/lcdf-typetools|*/curl|*/expat)
- (cd $dir; acnew) ;;
- *) (cd $dir; acold) ;;
- esac
- ;;
-esac
+for base in configure.{in,ac}; do
+ for dir in `find utils libs texk -name $base | sed "s,/$base\$,,"`; do
+ case $dir in
+ texk)
+ rdir=m4
+ ;;
+ texk/*)
+ rdir=`echo $dir | sed -e 's,^texk/,,' -e 's,[^/]*,..,g'`/m4
+ ;;
+ *)
+ rdir=`echo $dir | sed 's,[^/]*,..,g'`/texk/m4
+ ;;
+ esac
+ (cd $dir; do_one)
+ done
done
echo "$0: done."