~ubuntu-branches/ubuntu/trusty/texlive-bin/trusty

1.1.6 by Norbert Preining
Import upstream version 2009
1
#! /bin/sh
1.1.7 by Norbert Preining
Import upstream version 2011.20120307
2
# $Id: reautoconf 15977 2009-11-10 10:34:20Z peter $
1.1.6 by Norbert Preining
Import upstream version 2009
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.
5
#
6
# Copyright 2008 Karl Berry.
7
# Copyright 2005 Olaf Weber.
8
# Copyright 2004 - 2009 Peter Breitenlohner.
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
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)
34
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"
40
41
do_cmd=eval
42
do_say=echo
43
verbose=-v
44
45
list=
46
47
for option
48
do
49
  case $option in
50
    -h | --help) echo "$usage"; exit 0
51
      ;;
52
    -n | --dry-run) do_cmd=:
53
      ;;
54
    -q | --quiet) do_say=:; verbose=
55
      ;;
56
    -v | --verbose) do_say=echo; verbose=-v
57
      ;;
58
    -*) echo "$0: *** unrecognized option \`$option'"
59
      echo "$usage"; exit 1
60
      ;;
61
    *) list="$list $option"
62
      ;;
63
  esac
64
done
65
66
[ "$do_cmd" = : ] && do_say=echo	# -n implies -v
67
68
[ -f ./m4/kpse-setup.m4 ] || {
69
	echo "$0: *** can't find ./m4/kpse-setup.m4 (from `pwd`)" >&2
70
	exit 1
71
}
72
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."
83
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
87
88
AUTOCONF=$TL_AUTOCONF
89
AUTOHEADER=$TL_AUTOHEADER
90
AUTOMAKE=$TL_AUTOMAKE
91
ACLOCAL=$TL_ACLOCAL
92
export AUTOCONF AUTOHEADER AUTOMAKE ACLOCAL
93
94
do_it () {
95
  $do_say "$0: running \"$@\""
96
  $do_cmd "$@"
97
}
98
99
if test "x$list" = x; then
1.1.7 by Norbert Preining
Import upstream version 2011.20120307
100
  list=". auxdir/auxsub libs utils texk `find libs utils texk -type d -name ac |
1.1.6 by Norbert Preining
Import upstream version 2009
101
    sed 's,/ac\$,,'`"
102
fi
103
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
111
  fi
112
  if test ! -f "$dir/configure.ac"; then
113
    echo "$0: $dir/configure.ac: no such file, skipping." >&2
114
    continue
115
  fi
1.1.7 by Norbert Preining
Import upstream version 2011.20120307
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=
121
  fi
122
  do_it autoreconf $verbose --no-recursive $dir $extra_dirs
1.1.6 by Norbert Preining
Import upstream version 2009
123
done
124
125
echo "$0: done."