]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
add autoreconf --force
authorDavid MacKenzie <djm@djmnet.org>
Fri, 4 Nov 1994 14:44:38 +0000 (14:44 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Fri, 4 Nov 1994 14:44:38 +0000 (14:44 +0000)
NEWS
autoconf.texi
autoreconf.in
autoreconf.sh
bin/autoreconf.in
doc/autoconf.texi

diff --git a/NEWS b/NEWS
index af1bbe2e68d1b889df83ddde473a7c6e0603a050..cb226556cd8a42d3bd0d1afedfec2e95fbd05275 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ Major changes in release 2.1:
 * 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
index f4de634789b1f962aec8c0f6be288f5b33b6cfc5..3ec9655cb166210936434866a9d27edb89bdbff6 100644 (file)
@@ -661,16 +661,29 @@ Print the version number of Autoconf and exit.
 @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:
@@ -680,6 +693,12 @@ options, it passes them down (with relative paths adjusted properly).
 @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
index d6fd5caebbf784ce904749566121c335c13dadae..4b83f80425c3467aff60832fe3f65163445713d3 100644 (file)
 # 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@
 
@@ -30,14 +31,14 @@ while test $# -gt 0; do
   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 ;;
@@ -48,6 +49,8 @@ while test $# -gt 0; do
     shift ;;
   --verbose | --verb*)
     verbose=yes; shift ;;
+  -f | --force)
+    force=yes; shift ;;
   --version | --vers*)
     show_version=yes; shift ;;
   --)     # Stop option processing.
@@ -97,13 +100,25 @@ while read dir; do
   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/{
@@ -118,8 +133,15 @@ p
 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
   )
index d6fd5caebbf784ce904749566121c335c13dadae..4b83f80425c3467aff60832fe3f65163445713d3 100644 (file)
 # 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@
 
@@ -30,14 +31,14 @@ while test $# -gt 0; do
   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 ;;
@@ -48,6 +49,8 @@ while test $# -gt 0; do
     shift ;;
   --verbose | --verb*)
     verbose=yes; shift ;;
+  -f | --force)
+    force=yes; shift ;;
   --version | --vers*)
     show_version=yes; shift ;;
   --)     # Stop option processing.
@@ -97,13 +100,25 @@ while read dir; do
   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/{
@@ -118,8 +133,15 @@ p
 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
   )
index d6fd5caebbf784ce904749566121c335c13dadae..4b83f80425c3467aff60832fe3f65163445713d3 100644 (file)
 # 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@
 
@@ -30,14 +31,14 @@ while test $# -gt 0; do
   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 ;;
@@ -48,6 +49,8 @@ while test $# -gt 0; do
     shift ;;
   --verbose | --verb*)
     verbose=yes; shift ;;
+  -f | --force)
+    force=yes; shift ;;
   --version | --vers*)
     show_version=yes; shift ;;
   --)     # Stop option processing.
@@ -97,13 +100,25 @@ while read dir; do
   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/{
@@ -118,8 +133,15 @@ p
 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
   )
index f4de634789b1f962aec8c0f6be288f5b33b6cfc5..3ec9655cb166210936434866a9d27edb89bdbff6 100644 (file)
@@ -661,16 +661,29 @@ Print the version number of Autoconf and exit.
 @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:
@@ -680,6 +693,12 @@ options, it passes them down (with relative paths adjusted properly).
 @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