1998-09-03 08:37:37 +08:00
|
|
|
#! @SHELL@
|
1994-04-30 09:42:39 +08:00
|
|
|
# autoreconf - remake all Autoconf configure scripts in a directory tree
|
2000-01-10 18:11:57 +08:00
|
|
|
# Copyright (C) 1994, 1999 Free Software Foundation, Inc.
|
1994-04-30 09:42:39 +08:00
|
|
|
|
|
|
|
# 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, 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 program; if not, write to the Free Software
|
1996-06-13 01:55:25 +08:00
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
# 02111-1307, USA.
|
1994-04-30 09:42:39 +08:00
|
|
|
|
2000-02-08 19:39:46 +08:00
|
|
|
me=`echo "$0" | sed -e 's,.*/,,'`
|
|
|
|
|
1994-05-05 01:34:32 +08:00
|
|
|
usage="\
|
1999-01-08 11:38:59 +08:00
|
|
|
Usage: autoreconf [OPTION] ... [TEMPLATE-FILE]
|
|
|
|
|
2000-02-15 17:15:22 +08:00
|
|
|
Run \`autoconf' (and \`autoheader', \`aclocal' and \`automake', where
|
|
|
|
appropriate) repeatedly to remake the Autoconf \`configure' scripts
|
|
|
|
and configuration header templates in the directory tree rooted at the
|
1999-01-08 11:38:59 +08:00
|
|
|
current directory. By default, it only remakes those files that are
|
|
|
|
older than their predecessors. If you install a new version of
|
|
|
|
Autoconf, running \`autoreconf' remakes all of the files by giving it
|
|
|
|
the \`--force' option.
|
|
|
|
|
|
|
|
-m, --macrodir=DIR directory storing macro files
|
|
|
|
-l, --localdir=DIR directory storing \`aclocal.m4' and \`acconfig.h'
|
|
|
|
-f, --force consider every files are obsolete
|
|
|
|
-v, --verbose verbosely report processing
|
|
|
|
-h, --help print this help, then exit
|
|
|
|
--version print version number, then exit
|
|
|
|
|
|
|
|
The following options are passed to \`automake':
|
|
|
|
--cygnus assume program is part of Cygnus-style tree
|
|
|
|
--foreign set strictness to foreign
|
|
|
|
--gnits set strictness to gnits
|
|
|
|
--gnu set strictness to gnu
|
|
|
|
-i, --include-deps include generated dependencies in Makefile.in
|
|
|
|
|
|
|
|
Report bugs to <bug-autoconf@gnu.org>."
|
1994-09-16 02:34:35 +08:00
|
|
|
|
2000-01-10 18:11:57 +08:00
|
|
|
version="\
|
|
|
|
autoreconf (GNU @PACKAGE@) @VERSION@
|
|
|
|
Written by David J. MacKenzie.
|
|
|
|
|
|
|
|
Copyright (C) 1994, 1999 Free Software Foundation, Inc.
|
|
|
|
This is free software; see the source for copying conditions. There is NO
|
|
|
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
|
|
|
|
2000-02-08 19:39:46 +08:00
|
|
|
help="\
|
|
|
|
Try \`$me --help' for more information."
|
|
|
|
|
1994-09-16 02:34:35 +08:00
|
|
|
localdir=
|
1999-04-10 14:18:49 +08:00
|
|
|
verbose=:
|
1994-11-04 22:44:38 +08:00
|
|
|
force=no
|
1998-10-29 08:53:33 +08:00
|
|
|
automake_mode=--gnu
|
|
|
|
automake_deps=
|
1994-05-05 01:34:32 +08:00
|
|
|
|
|
|
|
test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@
|
|
|
|
|
|
|
|
while test $# -gt 0; do
|
1999-04-10 14:18:49 +08:00
|
|
|
case "$1" in
|
2000-02-08 19:39:46 +08:00
|
|
|
--help | --h* | -h )
|
1994-05-05 01:34:32 +08:00
|
|
|
echo "$usage"; exit 0 ;;
|
2000-02-15 17:15:22 +08:00
|
|
|
--version | --vers*)
|
|
|
|
echo "$version"; exit 0 ;;
|
|
|
|
|
1994-11-04 22:44:38 +08:00
|
|
|
--localdir=* | --l*=* )
|
2000-01-29 17:46:28 +08:00
|
|
|
localdir=`echo "$1" | sed -e 's/^[^=]*=//'`
|
1994-11-04 22:44:38 +08:00
|
|
|
shift ;;
|
2000-02-08 19:39:46 +08:00
|
|
|
--localdir | --l* | -l )
|
1994-11-04 22:44:38 +08:00
|
|
|
shift
|
2000-02-08 21:45:24 +08:00
|
|
|
test $# -eq 0 && { echo "$help" >&2; exit 1; }
|
1994-11-04 22:44:38 +08:00
|
|
|
localdir="${1}"
|
|
|
|
shift ;;
|
2000-02-15 17:15:22 +08:00
|
|
|
|
1994-05-05 01:34:32 +08:00
|
|
|
--macrodir=* | --m*=* )
|
2000-01-29 17:46:28 +08:00
|
|
|
AC_MACRODIR=`echo "$1" | sed -e 's/^[^=]*=//'`
|
1994-05-05 01:34:32 +08:00
|
|
|
shift ;;
|
2000-02-08 19:39:46 +08:00
|
|
|
--macrodir | --m* | -m )
|
1994-05-05 01:34:32 +08:00
|
|
|
shift
|
2000-02-08 21:45:24 +08:00
|
|
|
test $# -eq 0 && { echo "help" >&2; exit 1; }
|
1994-05-05 01:34:32 +08:00
|
|
|
AC_MACRODIR="$1"
|
|
|
|
shift ;;
|
2000-02-15 17:15:22 +08:00
|
|
|
|
1999-09-07 21:21:40 +08:00
|
|
|
-v | --verbose | --verb*)
|
1999-04-10 14:18:49 +08:00
|
|
|
verbose=echo; shift ;;
|
1994-11-04 22:44:38 +08:00
|
|
|
-f | --force)
|
|
|
|
force=yes; shift ;;
|
1998-10-29 08:53:33 +08:00
|
|
|
--cygnus | --foreign | --gnits | --gnu)
|
|
|
|
automake_mode=$1; shift ;;
|
|
|
|
--include-deps | -i)
|
|
|
|
automake_deps=$1; shift ;;
|
2000-02-15 17:15:22 +08:00
|
|
|
|
1994-05-05 01:34:32 +08:00
|
|
|
--) # Stop option processing.
|
|
|
|
shift; break ;;
|
2000-02-08 19:39:46 +08:00
|
|
|
-*)
|
2000-02-08 21:45:24 +08:00
|
|
|
exec >&2
|
2000-02-08 19:39:46 +08:00
|
|
|
echo "$me: invalid option $1"
|
|
|
|
echo "$help"
|
|
|
|
exit 1 ;;
|
1994-05-05 01:34:32 +08:00
|
|
|
*) break ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
1994-09-16 05:16:59 +08:00
|
|
|
if test $# -ne 0; then
|
2000-02-08 21:45:24 +08:00
|
|
|
exec >&2
|
2000-02-15 17:15:22 +08:00
|
|
|
echo "$me: invalid number of arguments"
|
2000-02-08 19:39:46 +08:00
|
|
|
echo "$help"
|
2000-02-15 17:15:22 +08:00
|
|
|
exit 1
|
1994-09-16 05:16:59 +08:00
|
|
|
fi
|
|
|
|
|
1996-11-21 05:27:29 +08:00
|
|
|
# The paths to the autoconf and autoheader scripts, at the top of the tree.
|
2000-02-15 17:15:22 +08:00
|
|
|
top_autoconf=`echo "$0" |sed s%autoreconf%autoconf%`
|
|
|
|
top_autoheader=`echo "$0" |sed s%autoreconf%autoheader%`
|
1994-04-30 09:42:39 +08:00
|
|
|
|
1996-11-21 05:27:29 +08:00
|
|
|
# Make a list of directories to process.
|
1994-04-30 09:42:39 +08:00
|
|
|
# The xargs grep filters out Cygnus configure.in files.
|
1994-09-16 02:34:35 +08:00
|
|
|
find . -name configure.in -print |
|
1994-04-30 09:42:39 +08:00
|
|
|
xargs grep -l AC_OUTPUT |
|
1994-09-16 02:34:35 +08:00
|
|
|
sed 's%/configure\.in$%%; s%^./%%' |
|
|
|
|
while read dir; do
|
1994-04-30 09:42:39 +08:00
|
|
|
(
|
1994-09-16 02:34:35 +08:00
|
|
|
cd $dir || continue
|
|
|
|
|
|
|
|
case "$dir" in
|
|
|
|
.) dots= ;;
|
|
|
|
*) # A "../" for each directory in /$dir.
|
|
|
|
dots=`echo /$dir|sed 's%/[^/]*%../%g'` ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$0" in
|
|
|
|
/*) autoconf=$top_autoconf; autoheader=$top_autoheader ;;
|
|
|
|
*/*) autoconf=$dots$top_autoconf; autoheader=$dots$top_autoheader ;;
|
|
|
|
*) autoconf=$top_autoconf; autoheader=$top_autoheader ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$AC_MACRODIR" in
|
|
|
|
/*) macrodir_opt="--macrodir=$AC_MACRODIR" ;;
|
|
|
|
*) macrodir_opt="--macrodir=$dots$AC_MACRODIR" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$localdir" in
|
1994-11-04 22:44:38 +08:00
|
|
|
"") localdir_opt=
|
1999-04-10 14:18:49 +08:00
|
|
|
aclocal_m4=aclocal.m4 ;;
|
1994-11-04 22:44:38 +08:00
|
|
|
/*) localdir_opt="--localdir=$localdir"
|
1999-04-10 14:18:49 +08:00
|
|
|
aclocal_m4=$localdir/aclocal.m4 ;;
|
1994-11-04 22:44:38 +08:00
|
|
|
*) localdir_opt="--localdir=$dots$localdir"
|
1999-04-10 14:18:49 +08:00
|
|
|
aclocal_m4=$dots$localdir/aclocal.m4 ;;
|
1994-09-16 02:34:35 +08:00
|
|
|
esac
|
|
|
|
|
1999-04-10 14:18:49 +08:00
|
|
|
# Regenerate aclocal.m4 if necessary.
|
1998-10-29 08:53:33 +08:00
|
|
|
run_aclocal=no
|
1999-04-10 14:18:49 +08:00
|
|
|
aclocal_dir=`echo $aclocal_m4 | sed 's,/*[^/]*$,,;s,^$,.,'`
|
|
|
|
if test -f "$aclocal_m4" &&
|
|
|
|
grep 'generated automatically by aclocal' $aclocal_m4 > /dev/null
|
1998-10-29 08:53:33 +08:00
|
|
|
then
|
|
|
|
run_aclocal=yes
|
|
|
|
else
|
1999-04-10 14:18:49 +08:00
|
|
|
if test -f "$aclocal_dir/acinclude.m4"
|
1998-10-29 08:53:33 +08:00
|
|
|
then
|
|
|
|
run_aclocal=yes
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test $run_aclocal = yes
|
|
|
|
then
|
1999-04-10 14:18:49 +08:00
|
|
|
# If there are flags for aclocal, use them. Makefile.am and Makefile
|
|
|
|
# may not exists.
|
|
|
|
aclocal_flags=`sed -ne '\
|
|
|
|
/^ACLOCAL_[A-Z_]*FLAGS/{
|
|
|
|
s/.*=//
|
|
|
|
p
|
|
|
|
q
|
|
|
|
}' Makefile.in 2>/dev/null`
|
1998-10-29 08:53:33 +08:00
|
|
|
if test $force = no &&
|
1999-04-10 14:18:49 +08:00
|
|
|
ls -lt configure.in $aclocal_m4 $aclocal_dir/acinclude.m4 2>/dev/null|
|
|
|
|
sed 1q |
|
|
|
|
grep 'aclocal\.m4$' > /dev/null
|
1998-10-29 08:53:33 +08:00
|
|
|
then
|
|
|
|
:
|
|
|
|
else
|
1999-08-25 21:44:46 +08:00
|
|
|
if test x"$aclocal_dir" != x.
|
|
|
|
then
|
|
|
|
aclocal_flags="$aclocal_flags -I $aclocal_dir"
|
|
|
|
fi
|
1999-04-10 14:18:49 +08:00
|
|
|
$verbose "running aclocal $aclocal_flags in $dir, creating $aclocal_m4"
|
1999-08-25 21:44:46 +08:00
|
|
|
aclocal $aclocal_flags --output=$aclocal_m4
|
1998-10-29 08:53:33 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Re-run automake if required. Assumes that there is a Makefile.am
|
|
|
|
# in the topmost directory.
|
|
|
|
if test -f Makefile.am
|
|
|
|
then
|
|
|
|
amforce=
|
|
|
|
test $force = no && amforce=--no-force
|
1999-04-10 14:18:49 +08:00
|
|
|
$verbose running automake $amforce in $dir
|
1998-10-29 08:53:33 +08:00
|
|
|
automake $amforce $automake_mode $automake_deps
|
|
|
|
fi
|
|
|
|
|
1999-04-10 14:18:49 +08:00
|
|
|
test ! -f $aclocal_m4 && aclocal_m4=
|
1994-11-04 22:44:38 +08:00
|
|
|
|
|
|
|
if test $force = no && test -f configure &&
|
1999-04-10 14:18:49 +08:00
|
|
|
ls -lt configure configure.in $aclocal_m4 | sed 1q |
|
1994-11-04 22:44:38 +08:00
|
|
|
grep 'configure$' > /dev/null
|
|
|
|
then
|
|
|
|
:
|
|
|
|
else
|
1999-04-10 14:18:49 +08:00
|
|
|
$verbose "running autoconf in $dir"
|
1994-11-04 22:44:38 +08:00
|
|
|
$autoconf $macrodir_opt $localdir_opt
|
|
|
|
fi
|
1994-09-16 02:34:35 +08:00
|
|
|
|
1999-09-24 12:45:36 +08:00
|
|
|
if grep '^[ ]*A[CM]_CONFIG_HEADER' configure.in >/dev/null; then
|
1998-10-29 08:53:33 +08:00
|
|
|
templates=`sed -n '/A[CM]_CONFIG_HEADER/ {
|
|
|
|
s%[^#]*A[CM]_CONFIG_HEADER[ ]*(\([^)]*\).*%\1%
|
|
|
|
p
|
|
|
|
q
|
|
|
|
}' configure.in`
|
|
|
|
tcount=`set -- $templates; echo $#`
|
|
|
|
template=`set -- $templates; echo $1 | sed '
|
|
|
|
s/.*://
|
|
|
|
t colon
|
|
|
|
s/$/.in/
|
|
|
|
: colon
|
|
|
|
s/:.*//
|
|
|
|
'`
|
1999-01-05 11:18:40 +08:00
|
|
|
stamp=`echo $template | sed 's,/*[^/]*$,,;s,^$,.,'`/stamp-h`test "$tcount" -gt 1 && echo "$tcount"`.in
|
1998-10-29 08:53:33 +08:00
|
|
|
if test ! -f "$template" || grep autoheader "$template" >/dev/null; then
|
1994-11-04 22:44:38 +08:00
|
|
|
if test $force = no && test -f $template &&
|
1999-04-10 14:18:49 +08:00
|
|
|
ls -lt $template configure.in $aclocal_m4 $stamp 2>/dev/null \
|
1999-01-05 11:18:40 +08:00
|
|
|
`echo $localdir_opt | sed -e 's/--localdir=//' \
|
|
|
|
-e '/./ s%$%/%'`acconfig.h |
|
1998-10-29 08:53:33 +08:00
|
|
|
sed 1q | egrep "$template$|$stamp$" > /dev/null
|
1994-11-04 22:44:38 +08:00
|
|
|
then
|
|
|
|
:
|
|
|
|
else
|
1999-04-10 14:18:49 +08:00
|
|
|
$verbose "running autoheader in $dir"
|
|
|
|
$autoheader $macrodir_opt $localdir_opt &&
|
|
|
|
$verbose "touching $stamp" &&
|
1998-10-29 08:53:33 +08:00
|
|
|
touch $stamp
|
1994-11-04 22:44:38 +08:00
|
|
|
fi
|
1994-09-16 02:34:35 +08:00
|
|
|
fi
|
1994-04-30 09:42:39 +08:00
|
|
|
fi
|
|
|
|
)
|
|
|
|
done
|
1999-04-10 14:18:49 +08:00
|
|
|
|
|
|
|
# Local Variables:
|
2000-02-15 17:15:22 +08:00
|
|
|
# mode: shell-script
|
|
|
|
# sh-indentation: 2
|
1999-04-10 14:18:49 +08:00
|
|
|
# End:
|