]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
general: deprecate 'configure.in' as autoconf input
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 6 May 2012 08:38:01 +0000 (10:38 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 22 May 2012 22:13:01 +0000 (00:13 +0200)
It has been years since that has been deprecated in the documentation,
in favour of 'configure.ac':

  Previous versions of Autoconf promoted the name configure.in, which
  is somewhat ambiguous (the tool needed to process this file is not
  described by its extension), and introduces a slight confusion with
  config.h.in and so on (for which '.in' means "to be processed by
  configure"). Using configure.ac is now preferred.

It's now time to start giving runtime warning about the use of
'configure.in', so that support for it can be removed in future
versions of autoconf/automake.

* lib/Autom4te/Configure_ac.pm: Issue a warning in the 'obsolete'
category if 'configure.in' is detected.  Since this module is synced
from Automake, this change is to be backported there (and will be
soon).
* doc/autoconf.texi: Update.
* tests/tools.at: Adjust to avoid spurious failures.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
NEWS
doc/autoconf.texi
lib/Autom4te/Configure_ac.pm
tests/tools.at

diff --git a/NEWS b/NEWS
index 61e3bd2b1b9578bf5b422603bf42314db4ed85e0..54296981dfb0fbf3fbae218239e8a9aa1469c0d1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ GNU Autoconf NEWS - User visible changes.
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** The use of the long-deprecated name 'configure.in' for the autoconf
+   input file now elicits a warning in the 'obsolete' category.
 
 * Noteworthy changes in release 2.69 (2012-04-24) [stable]
 
index 393e38f2dc9d0debaf93361b4dca1227e7f68c4b..3457f12087d0c49c3dfc7b40c4af42cb6063ab56 100644 (file)
@@ -1004,10 +1004,9 @@ a file called @file{config.log} containing any messages produced by
 compilers, to help debugging if @command{configure} makes a mistake.
 @end itemize
 
-@cindex @file{configure.in}
 @cindex @file{configure.ac}
-To create a @command{configure} script with Autoconf, you need to write an
-Autoconf input file @file{configure.ac} (or @file{configure.in}) and run
+To create a @command{configure} script with Autoconf, you need
+to write an Autoconf input file @file{configure.ac} and run
 @command{autoconf} on it.  If you write your own feature tests to
 supplement those that come with Autoconf, you might also write files
 called @file{aclocal.m4} and @file{acsite.m4}.  If you use a C header
@@ -1095,12 +1094,14 @@ Programming}.  The @command{autoscan} program can give you a good start
 in writing @file{configure.ac} (@pxref{autoscan Invocation}, for more
 information).
 
+@cindex @file{configure.in}
 Previous versions of Autoconf promoted the name @file{configure.in},
 which is somewhat ambiguous (the tool needed to process this file is not
 described by its extension), and introduces a slight confusion with
 @file{config.h.in} and so on (for which @samp{.in} means ``to be
 processed by @command{configure}'').  Using @file{configure.ac} is now
-preferred.
+preferred, while the use of @file{configure.in} will cause warnings
+from @command{autoconf}.
 
 @menu
 * Shell Script Compiler::       Autoconf as solution of a problem
index 924b23c522dad2f9b346663292e5110f0f4bc175..854ee0de05316ef1d0fd2da42725c56b99d2997c 100644 (file)
@@ -75,19 +75,21 @@ sub find_configure_ac (;@)
   my $configure_in =
     File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.in'));
 
-  if (-f $configure_ac)
+  if (-f $configure_in)
     {
-      if (-f $configure_in)
+      msg ('obsolete', "autoconf input should be named 'configure.ac'," .
+                       " not 'configure.in'");
+      if (-f $configure_ac)
        {
          msg ('unsupported',
               "'$configure_ac' and '$configure_in' both present.\n"
               . "proceeding with '$configure_ac'");
+          return $configure_ac
        }
-      return $configure_ac
-    }
-  elsif (-f $configure_in)
-    {
-      return $configure_in;
+      else
+        {
+          return $configure_in;
+        }
     }
   return $configure_ac;
 }
@@ -102,8 +104,7 @@ Like C<find_configure_ac>, but fail if neither is present.
 sub require_configure_ac (;$)
 {
   my $res = find_configure_ac (@_);
-  fatal "'configure.ac' or 'configure.in' is required"
-    unless -f $res;
+  fatal "'configure.ac' is required" unless -f $res;
   return $res
 }
 
index 31d4aadb10ce0345888ffcb8a993f5fa2c19cbeb..5a9ee63ccdc125380620d26ac2fe1a625660de66 100644 (file)
@@ -1135,7 +1135,7 @@ AT_SETUP([autoupdating with aclocal and m4@&t@_include])
 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
 
 mkdir m4 aclocal
-AT_DATA([configure.in],
+AT_DATA([configure.ac],
 [[AC_INIT(x,0)
 AC_UNCHANGED_MACRO
 AC_OLD_MACRO
@@ -1169,7 +1169,7 @@ AT_CHECK([automake --version || exit 77], [], [stdout], [ignore])
 AT_CHECK([[grep '[1-9]\.[0-9]' stdout || exit 77]], [], [ignore])
 AT_CHECK([test ! -f $HOME/.autom4te.cfg || exit 77], [], [ignore], [ignore])
 
-AT_DATA([configure.in],
+AT_DATA([configure.ac],
 [[AC_INIT(GNU foo, 1.0)
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
@@ -1294,9 +1294,9 @@ do
   export TMPDIR
 
   # skip if we cannot create such a file or directory
-  AT_CHECK([mkdir "$dir" "$TMPDIR" && touch "$file.in" || exit 77])
+  AT_CHECK([mkdir "$dir" "$TMPDIR" && touch "$file.ac" || exit 77])
 
-  cat >"$file.in" <<'END'
+  cat >"$file.ac" <<'END'
 [AC_INIT(x,0)
 m4@&t@_include([foo.m4])
 AC_CONFIG_HEADERS([config.h:config.hin])
@@ -1307,20 +1307,20 @@ END
 [AC_DEFUN([AC_MACRO], [echo hi])]
 END
 
-  AT_CHECK_AUTOHEADER([-B "$dir" "$file.in"])
-  AT_CHECK_AUTOHEADER([--force -I "$dir" "$file.in"])
-  AT_CHECK_AUTOUPDATE([-B "$dir" "$file.in"])
-  AT_CHECK_AUTOUPDATE([--force -I "$dir" "$file.in"])
-  AT_CHECK_AUTOUPDATE([-B "$dir" - < "$file.in"], [], [ignore])
-  AT_CHECK_AUTOCONF([-B "$dir" -o "$file" "$file.in"])
-  AT_CHECK_AUTOCONF([-I "$dir" -o "$file" "$file.in"])
+  AT_CHECK_AUTOHEADER([-B "$dir" "$file.ac"])
+  AT_CHECK_AUTOHEADER([--force -I "$dir" "$file.ac"])
+  AT_CHECK_AUTOUPDATE([-B "$dir" "$file.ac"])
+  AT_CHECK_AUTOUPDATE([--force -I "$dir" "$file.ac"])
+  AT_CHECK_AUTOUPDATE([-B "$dir" - < "$file.ac"], [], [ignore])
+  AT_CHECK_AUTOCONF([-B "$dir" -o "$file" "$file.ac"])
+  AT_CHECK_AUTOCONF([-I "$dir" -o "$file" "$file.ac"])
   # In autoconf, these exercise a slightly different code path:
-  AT_CHECK_AUTOCONF([--prepend-include="$dir" -o "$file" "$file.in"])
-  AT_CHECK_AUTOCONF([--include="$dir" -o "$file" "$file.in"])
+  AT_CHECK_AUTOCONF([--prepend-include="$dir" -o "$file" "$file.ac"])
+  AT_CHECK_AUTOCONF([--include="$dir" -o "$file" "$file.ac"])
   AT_CHECK([autoscan -B "$dir"], [], [], [ignore])
   AT_CHECK([autoscan --force -I "$dir"], [], [], [ignore])
   # autoreconf requires a sane input file name.  Also, disable aclocal.
-  mv -f "$file.in" configure.in
+  mv -f "$file.ac" configure.ac
   AT_DATA([aclocal.m4])
   AT_CHECK([autoreconf -B "$dir"])
   AT_CHECK([autoreconf --force -I "$dir"])