* More explanations in the manual.
* Fix a spurious failure in the testsuite.
* Clarify some warning messages.
+* autoreconf by default only rebuilds configure and config.h.in files
+ that are older than any of their particular input files; there is a
+ --force option to use after installing a new version of Autoconf.
\f
Thanks to everybody who's submitted changes and additions to Autoconf!
I've incorporated many of them, and am still considering others for
@node Invoking autoreconf, , Invoking autoconf, Making configure Scripts
@section Using @code{autoreconf} to Update @code{configure} Scripts
-If you have a lot of Autoconf-generated @code{configure} scripts and you
-get a new version of Autoconf, the @code{autoreconf} program can be
-handy. It runs @code{autoconf} (and @code{autoheader}, where
-appropriate) repeatedly to remake all of the Autoconf @code{configure}
-scripts in the directory tree rooted at the current directory. If you
-give the @samp{--macrodir=@var{dir}} or @samp{--localdir=@var{dir}}
-options, it passes them down (with relative paths adjusted properly).
-
-@xref{Automatic Remaking}, for information about automatic remaking of
-@code{configure} scripts when their source files change.
+If you have a lot of Autoconf-generated @code{configure} scripts, the
+@code{autoreconf} program can save you some work. It runs
+@code{autoconf} (and @code{autoheader}, where appropriate) repeatedly to
+remake the Autoconf @code{configure} scripts and configuration header
+templates in the directory tree rooted at the current directory. By
+default, it only remakes those files that are older than their
+@file{configure.in} or (if present) @file{aclocal.m4}. Since
+@code{autoheader} does not change the timestamp of its output file if
+the file wouldn't be changing, this is not necessarily the minimum
+amount of work. If you install a new version of Autoconf, you can make
+@code{autoreconf} remake @emph{all} of the files by giving it the
+@samp{--force} option.
+
+If you give @code{autoreconf} the @samp{--macrodir=@var{dir}} or
+@samp{--localdir=@var{dir}} options, it passes them down to
+@code{autoconf} and @code{autoheader} (with relative paths adjusted
+properly).
+
+@xref{Automatic Remaking}, for @file{Makefile} rules to automatically
+remake @code{configure} scripts when their source files change. That
+method handles the timestamps of configuration header templates
+properly, but does not pass @samp{--macrodir=@var{dir}} or
+@samp{--localdir=@var{dir}}.
@noindent
@code{autoreconf} accepts the following options:
@itemx -h
Print a summary of the command line options and exit.
+@item --force
+@itemx -f
+Remake even @file{configure} scripts and configuration headers that are
+newer than their input files (@file{configure.in} and, if present,
+@file{aclocal.m4}).
+
@item --localdir=@var{dir}
@itemx -l @var{dir}
Look for the package files @file{aclocal.m4} and @file{acconfig.h} (but
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
usage="\
-Usage: autoreconf [-h] [--help] [-m dir] [--macrodir=dir]
- [-l dir] [--localdir=dir] [--verbose] [--version]"
+Usage: autoreconf [-f] [-h] [--help] [-m dir] [--macrodir=dir]
+ [-l dir] [--localdir=dir] [--force] [--verbose] [--version]"
localdir=
verbose=no
show_version=no
+force=no
test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@
case "$1" in
-h | --help | --h*)
echo "$usage"; exit 0 ;;
- --localdir=* | --l*=* )
- localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -l | --localdir | --l*)
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- localdir="${1}"
- shift ;;
+ --localdir=* | --l*=* )
+ localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
+ shift ;;
+ -l | --localdir | --l*)
+ shift
+ test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
+ localdir="${1}"
+ shift ;;
--macrodir=* | --m*=* )
AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`"
shift ;;
shift ;;
--verbose | --verb*)
verbose=yes; shift ;;
+ -f | --force)
+ force=yes; shift ;;
--version | --vers*)
show_version=yes; shift ;;
--) # Stop option processing.
esac
case "$localdir" in
- "") localdir_opt= ;;
- /*) localdir_opt="--localdir=$localdir" ;;
- *) localdir_opt="--localdir=$dots$localdir" ;;
+ "") localdir_opt=
+ aclocal=aclocal.m4 ;;
+ /*) localdir_opt="--localdir=$localdir"
+ aclocal=$localdir/aclocal.m4 ;;
+ *) localdir_opt="--localdir=$dots$localdir"
+ aclocal=$dots$localdir/aclocal.m4 ;;
esac
- test $verbose = yes && echo running autoconf in $dir
- $autoconf $macrodir_opt $localdir_opt
+ test ! -f $aclocal && aclocal=
+
+ if test $force = no && test -f configure &&
+ ls -lt configure configure.in $aclocal | sed 1q |
+ grep 'configure$' > /dev/null
+ then
+ :
+ else
+ test $verbose = yes && echo running autoconf in $dir
+ $autoconf $macrodir_opt $localdir_opt
+ fi
if grep AC_CONFIG_HEADER configure.in >/dev/null; then
template=`sed -n '/AC_CONFIG_HEADER/{
q
}' configure.in`
if test ! -f $template || grep autoheader $template >/dev/null; then
- test $verbose = yes && echo running autoheader in $dir
- $autoheader $macrodir_opt $localdir_opt
+ if test $force = no && test -f $template &&
+ ls -lt $template configure.in $aclocal | sed 1q |
+ grep "$template$" > /dev/null
+ then
+ :
+ else
+ test $verbose = yes && echo running autoheader in $dir
+ $autoheader $macrodir_opt $localdir_opt
+ fi
fi
fi
)
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
usage="\
-Usage: autoreconf [-h] [--help] [-m dir] [--macrodir=dir]
- [-l dir] [--localdir=dir] [--verbose] [--version]"
+Usage: autoreconf [-f] [-h] [--help] [-m dir] [--macrodir=dir]
+ [-l dir] [--localdir=dir] [--force] [--verbose] [--version]"
localdir=
verbose=no
show_version=no
+force=no
test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@
case "$1" in
-h | --help | --h*)
echo "$usage"; exit 0 ;;
- --localdir=* | --l*=* )
- localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -l | --localdir | --l*)
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- localdir="${1}"
- shift ;;
+ --localdir=* | --l*=* )
+ localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
+ shift ;;
+ -l | --localdir | --l*)
+ shift
+ test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
+ localdir="${1}"
+ shift ;;
--macrodir=* | --m*=* )
AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`"
shift ;;
shift ;;
--verbose | --verb*)
verbose=yes; shift ;;
+ -f | --force)
+ force=yes; shift ;;
--version | --vers*)
show_version=yes; shift ;;
--) # Stop option processing.
esac
case "$localdir" in
- "") localdir_opt= ;;
- /*) localdir_opt="--localdir=$localdir" ;;
- *) localdir_opt="--localdir=$dots$localdir" ;;
+ "") localdir_opt=
+ aclocal=aclocal.m4 ;;
+ /*) localdir_opt="--localdir=$localdir"
+ aclocal=$localdir/aclocal.m4 ;;
+ *) localdir_opt="--localdir=$dots$localdir"
+ aclocal=$dots$localdir/aclocal.m4 ;;
esac
- test $verbose = yes && echo running autoconf in $dir
- $autoconf $macrodir_opt $localdir_opt
+ test ! -f $aclocal && aclocal=
+
+ if test $force = no && test -f configure &&
+ ls -lt configure configure.in $aclocal | sed 1q |
+ grep 'configure$' > /dev/null
+ then
+ :
+ else
+ test $verbose = yes && echo running autoconf in $dir
+ $autoconf $macrodir_opt $localdir_opt
+ fi
if grep AC_CONFIG_HEADER configure.in >/dev/null; then
template=`sed -n '/AC_CONFIG_HEADER/{
q
}' configure.in`
if test ! -f $template || grep autoheader $template >/dev/null; then
- test $verbose = yes && echo running autoheader in $dir
- $autoheader $macrodir_opt $localdir_opt
+ if test $force = no && test -f $template &&
+ ls -lt $template configure.in $aclocal | sed 1q |
+ grep "$template$" > /dev/null
+ then
+ :
+ else
+ test $verbose = yes && echo running autoheader in $dir
+ $autoheader $macrodir_opt $localdir_opt
+ fi
fi
fi
)
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
usage="\
-Usage: autoreconf [-h] [--help] [-m dir] [--macrodir=dir]
- [-l dir] [--localdir=dir] [--verbose] [--version]"
+Usage: autoreconf [-f] [-h] [--help] [-m dir] [--macrodir=dir]
+ [-l dir] [--localdir=dir] [--force] [--verbose] [--version]"
localdir=
verbose=no
show_version=no
+force=no
test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@
case "$1" in
-h | --help | --h*)
echo "$usage"; exit 0 ;;
- --localdir=* | --l*=* )
- localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -l | --localdir | --l*)
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- localdir="${1}"
- shift ;;
+ --localdir=* | --l*=* )
+ localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
+ shift ;;
+ -l | --localdir | --l*)
+ shift
+ test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
+ localdir="${1}"
+ shift ;;
--macrodir=* | --m*=* )
AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`"
shift ;;
shift ;;
--verbose | --verb*)
verbose=yes; shift ;;
+ -f | --force)
+ force=yes; shift ;;
--version | --vers*)
show_version=yes; shift ;;
--) # Stop option processing.
esac
case "$localdir" in
- "") localdir_opt= ;;
- /*) localdir_opt="--localdir=$localdir" ;;
- *) localdir_opt="--localdir=$dots$localdir" ;;
+ "") localdir_opt=
+ aclocal=aclocal.m4 ;;
+ /*) localdir_opt="--localdir=$localdir"
+ aclocal=$localdir/aclocal.m4 ;;
+ *) localdir_opt="--localdir=$dots$localdir"
+ aclocal=$dots$localdir/aclocal.m4 ;;
esac
- test $verbose = yes && echo running autoconf in $dir
- $autoconf $macrodir_opt $localdir_opt
+ test ! -f $aclocal && aclocal=
+
+ if test $force = no && test -f configure &&
+ ls -lt configure configure.in $aclocal | sed 1q |
+ grep 'configure$' > /dev/null
+ then
+ :
+ else
+ test $verbose = yes && echo running autoconf in $dir
+ $autoconf $macrodir_opt $localdir_opt
+ fi
if grep AC_CONFIG_HEADER configure.in >/dev/null; then
template=`sed -n '/AC_CONFIG_HEADER/{
q
}' configure.in`
if test ! -f $template || grep autoheader $template >/dev/null; then
- test $verbose = yes && echo running autoheader in $dir
- $autoheader $macrodir_opt $localdir_opt
+ if test $force = no && test -f $template &&
+ ls -lt $template configure.in $aclocal | sed 1q |
+ grep "$template$" > /dev/null
+ then
+ :
+ else
+ test $verbose = yes && echo running autoheader in $dir
+ $autoheader $macrodir_opt $localdir_opt
+ fi
fi
fi
)
@node Invoking autoreconf, , Invoking autoconf, Making configure Scripts
@section Using @code{autoreconf} to Update @code{configure} Scripts
-If you have a lot of Autoconf-generated @code{configure} scripts and you
-get a new version of Autoconf, the @code{autoreconf} program can be
-handy. It runs @code{autoconf} (and @code{autoheader}, where
-appropriate) repeatedly to remake all of the Autoconf @code{configure}
-scripts in the directory tree rooted at the current directory. If you
-give the @samp{--macrodir=@var{dir}} or @samp{--localdir=@var{dir}}
-options, it passes them down (with relative paths adjusted properly).
-
-@xref{Automatic Remaking}, for information about automatic remaking of
-@code{configure} scripts when their source files change.
+If you have a lot of Autoconf-generated @code{configure} scripts, the
+@code{autoreconf} program can save you some work. It runs
+@code{autoconf} (and @code{autoheader}, where appropriate) repeatedly to
+remake the Autoconf @code{configure} scripts and configuration header
+templates in the directory tree rooted at the current directory. By
+default, it only remakes those files that are older than their
+@file{configure.in} or (if present) @file{aclocal.m4}. Since
+@code{autoheader} does not change the timestamp of its output file if
+the file wouldn't be changing, this is not necessarily the minimum
+amount of work. If you install a new version of Autoconf, you can make
+@code{autoreconf} remake @emph{all} of the files by giving it the
+@samp{--force} option.
+
+If you give @code{autoreconf} the @samp{--macrodir=@var{dir}} or
+@samp{--localdir=@var{dir}} options, it passes them down to
+@code{autoconf} and @code{autoheader} (with relative paths adjusted
+properly).
+
+@xref{Automatic Remaking}, for @file{Makefile} rules to automatically
+remake @code{configure} scripts when their source files change. That
+method handles the timestamps of configuration header templates
+properly, but does not pass @samp{--macrodir=@var{dir}} or
+@samp{--localdir=@var{dir}}.
@noindent
@code{autoreconf} accepts the following options:
@itemx -h
Print a summary of the command line options and exit.
+@item --force
+@itemx -f
+Remake even @file{configure} scripts and configuration headers that are
+newer than their input files (@file{configure.in} and, if present,
+@file{aclocal.m4}).
+
@item --localdir=@var{dir}
@itemx -l @var{dir}
Look for the package files @file{aclocal.m4} and @file{acconfig.h} (but