beta-0.89.2
[luatex.git] / source / reautoconf
blob9af782a0ef328a6aebdb86f849e07539beb27cd5
1 #! /bin/sh
2 # $Id: reautoconf 15977 2009-11-10 10:34:20Z peter $
3 # This "reautoconf" script found at the root of the TeX Live source tree
4 # runs aclocal and autoconf (from PATH) in all relevant directories.
6 # Copyright 2008 Karl Berry.
7 # Copyright 2005 Olaf Weber.
8 # Copyright 2004 - 2009 Peter Breitenlohner.
10 # This program is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 unset CDPATH
25 usage="Usage: $0 [OPTION]... [DIR]...
26 Run \`autoreconf --no-recursive' in the directories DIR...
27 (default all) of the TeX Live source tree.
29 Options:
30 -h, --help display this help and exit successfully
31 -n, --dry-run don't run any commands; just print them
32 -q, --quiet don't echo commands
33 -v, --verbose verbosely report processing (default)
35 Environment variables:
36 TL_AUTOCONF: program to use instead of autoconf from PATH
37 TL_AUTOHEADER: program to use instead of autoheader from PATH
38 TL_AUTOMAKE: program to use instead of automake from PATH
39 TL_ACLOCAL: program to use instead of aclocal from PATH"
41 do_cmd=eval
42 do_say=echo
43 verbose=-v
45 list=
47 for option
49 case $option in
50 -h | --help) echo "$usage"; exit 0
52 -n | --dry-run) do_cmd=:
54 -q | --quiet) do_say=:; verbose=
56 -v | --verbose) do_say=echo; verbose=-v
58 -*) echo "$0: *** unrecognized option \`$option'"
59 echo "$usage"; exit 1
61 *) list="$list $option"
63 esac
64 done
66 [ "$do_cmd" = : ] && do_say=echo # -n implies -v
68 [ -f ./m4/kpse-setup.m4 ] || {
69 echo "$0: *** can't find ./m4/kpse-setup.m4 (from `pwd`)" >&2
70 exit 1
73 : ${TL_AUTOCONF=autoconf}
74 echo "$0: using \"$TL_AUTOCONF\" = `$TL_AUTOCONF --version | sed 1q`"
75 : ${TL_AUTOHEADER=autoheader}
76 echo "$0: using \"$TL_AUTOHEADER\" = `$TL_AUTOHEADER --version | sed 1q`"
77 : ${TL_AUTOMAKE=automake}
78 echo "$0: using \"$TL_AUTOMAKE\" = `$TL_AUTOMAKE --version | sed 1q`"
79 : ${TL_ACLOCAL=aclocal}
80 echo "$0: using \"$TL_ACLOCAL\" = `$TL_ACLOCAL --version | sed 1q`"
81 echo "$0: if you want to use different versions, set TL_AUTOCONF,"
82 echo "$0: TL_AUTOHEADER, TL_AUTOMAKE, and/or TL_ACLOCAL."
84 # Give users a chance to quit here
85 # and set TL_AUTOCONF, TL_AUTOHEADER, TL_AUTOMAKE, and/or TL_ACLOCAL
86 $do_cmd sleep 5
88 AUTOCONF=$TL_AUTOCONF
89 AUTOHEADER=$TL_AUTOHEADER
90 AUTOMAKE=$TL_AUTOMAKE
91 ACLOCAL=$TL_ACLOCAL
92 export AUTOCONF AUTOHEADER AUTOMAKE ACLOCAL
94 do_it () {
95 $do_say "$0: running \"$@\""
96 $do_cmd "$@"
99 if test "x$list" = x; then
100 list=". auxdir/auxsub libs utils texk `find libs utils texk -type d -name ac |
101 sed 's,/ac\$,,'`"
104 # Autoreconf in all directories
105 for dir in $list; do
106 # Remove trailing slash from shell filename completion
107 dir=`echo $dir | sed 's,/\$,,'`
108 if test ! -d "$dir"; then
109 echo "$0: $dir not a directory, skipping." >&2
110 continue
112 if test ! -f "$dir/configure.ac"; then
113 echo "$0: $dir/configure.ac: no such file, skipping." >&2
114 continue
116 if test -f "$dir/ac/withenable.ac"; then
117 extra_dirs=`grep 'dnl extra_dirs = ' $dir/ac/withenable.ac |
118 sed 's,^.*= ,,'`
119 else
120 extra_dirs=
122 do_it autoreconf $verbose --no-recursive $dir $extra_dirs
123 done
125 echo "$0: done."