Debian Codegraph @

reautoconf

raw symbols SCIP
1 #! /bin/sh -x
2 # $Id: reautoconf 77715 2026-02-10 01:40:57Z karl $
3 # This "reautoconf" script at the root of the TeX Live source tree
4 # runs autoreconf (from PATH) in all relevant TL directories.
5 #
6 # Copyright 2008-2025 Karl Berry.
7 # Copyright 2004-2009 Peter Breitenlohner.
8 # Copyright 2005 Olaf Weber.
9 #
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.
14 #
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.
19 #
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/>.
22
23 unset CDPATH
24
25 usage="Usage: $0 [OPTION]... [DIR]...
26 Run \`autoreconf --no-recursive' in the directories DIR...
27 (default all) of the TeX Live source tree.
28
29 By default, also pass -Wno-obsolete, because Autoconf 2.70
30 and later deprecated many widely used macros. See Build/m4/README for
31 a lengthy discussion of this. To see the obsolete warnings (perhaps
32 because you want to spend time fixing them), use --warn-obsolete.
33
34 Options:
35 -f, --force pass --force to autoreconf
36 -h, --help display this help and exit successfully
37 -n, --dry-run don't run any commands; just print them
38 -q, --quiet don't echo commands
39 -v, --verbose verbosely report processing (default)
40 --warn-obsolete do not pass -Wno-obsolete
41
42 All programs are found along PATH.
43
44 This script should be invoked only from the top level of the TeX Live
45 source tree.
46
47 Report bugs (and any other discussion) to:
48 [email protected] (https://lists.tug.org/tlbuild)
49
50 Version: $Id: reautoconf 77715 2026-02-10 01:40:57Z karl $
51 "
52
53 do_cmd=eval
54 do_say=echo
55 force=
56 verbose=-v
57 warn_obsolete=-Wno-obsolete
58
59 list=
60
61 for option
62 do
63 case $option in
64 -f | --force) force=--force ;;
65 -h | --help | --version) echo "$usage"; exit 0 ;;
66 -n | --dry-run) do_cmd=: ;;
67 -q | --quiet) do_say=:; verbose= ;;
68 -v | --verbose) do_say=echo; verbose=-v ;;
69 --warn-obsolete) warn_obsolete= ;;
70 -*) echo "$0: *** unrecognized option \`$option'" >&2
71 echo "Try --help if you need it." >&2; exit 1 ;;
72 *) list="$list $option" ;;
73 esac
74 done
75
76 test x"$do_cmd" = x: && do_say=echo # -n implies -v
77
78 if test ! -f ./m4/kpse-setup.m4; then
79 echo "$0: *** can't find ./m4/kpse-setup.m4 (from `pwd`)" >&2
80 exit 1
81 fi
82
83 echo "$0: using `autoconf --version | sed 1q`"
84 echo "$0: using `autoheader --version | sed 1q`"
85 echo "$0: using `autom4te --version | sed 1q`"
86 echo "$0: using `automake --version | sed 1q`"
87 echo "$0: using `aclocal --version | sed 1q`"
88 echo "$0: using `libtool --version | sed 1q`"
89 echo "$0: if you want to use different versions, set PATH."
90
91 # Give users a chance to quit here.
92 $do_cmd sleep 4
93 $do_say "$0: starting at `date`."
94
95 do_it () {
96 test x"$do_say" = x: || printf "\f "
97 $do_say "$0: running \"$@\""
98 $do_cmd "$@"
99 if test $? -ne 0; then
100 echo "$0: goodbye, exit status of $*: $?" >&2
101 echo "$0: directory: `/bin/pwd`" >&2
102 exit 1
103 fi
104 }
105
106 # use the presence of an ac/ subdir to determine if it's a package
107 # directory in which we should run autoreconf. Would be better to
108 # extract from kpse-pkgs.m4, if we ever get an autoconf-only package.
109 if test "x$list" = x; then
110 list=". auxdir/auxsub libs utils texk \
111 `find libs utils texk -type d -name ac | sed 's,/ac\$,,'`"
112 fi
113
114 # Run autoreconf in all directories.
115 for dir in $list; do
116
117 if test ! -d "$dir"; then
118 echo "$0: $dir not a directory, skipping." >&2
119 continue
120 fi
121 if test ! -f "$dir/configure.ac"; then
122 echo "$0: $dir/configure.ac: no such file, skipping." >&2
123 continue
124 fi
125 if test -f "$dir/ac/withenable.ac"; then
126 extra_dirs=`grep 'dnl extra_dirs = ' $dir/ac/withenable.ac |
127 sed 's,^.*= ,,'`
128 else
129 extra_dirs=
130 fi
131 do_it autoreconf $verbose --no-recursive \
132 $warn_obsolete $force $dir $extra_dirs
133 done
134
135 echo "$0: done at `date`."