#! /bin/sh # $Id$ # This "reautoconf" script found at the root of the TeX Live source tree # runs aclocal and autoconf (from PATH) in all relevant directories. # # Copyright 2008 Karl Berry. # Copyright 2005 Olaf Weber. # 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 # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this library; if not, see . 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 } : ${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." sleep 5 # Give users a chance to cancel and set TL_AUTOCONF and/or TL_ACLOCAL do_it () { $do_say "$0: running \"$@\"" $do_cmd "$@" } # 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). base=configure.in dir=. rdir=texk/m4 do_one # Autoconf in all other directories 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."