]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
maint: deprecate 'configure.in' as autoconf input
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 1 Jun 2012 17:15:29 +0000 (19:15 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 1 Jun 2012 18:11:01 +0000 (20:11 +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.

See also, in the Autoconf repository, commit 'v2.69-4-g560f16b' of
2012-05-23, "general: deprecate 'configure.in' as autoconf input".

* lib/Automake/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).
* t/help.sh: Adjust.
* t/configure.sh: Adjust and enhance.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/Automake/Configure_ac.pm
t/configure.sh
t/help.sh

index 53e62a5723788a635aed4188b770324de5cad10d..fcaf0f75cb1186ff6c6f7d863706a9ffdd70eeb7 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 cedba5505651dc8e4c09cdfbdadbbcc5d2ce386d..b8e3d0b7cfc5fc046ed9bed437f4ef5b8e9c8654 100755 (executable)
@@ -14,6 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Diagnose if the autoconf input is named configure.in.
 # Diagnose if both configure.in and configure.ac are present, prefer
 # configure.ac.
 
@@ -51,4 +52,8 @@ AUTOMAKE_run -Wno-error
 grep 'configure\.ac.*configure\.in.*both present' stderr
 grep 'proceeding.*configure\.ac' stderr
 
+mv -f configure.ac configure.in
+AUTOMAKE_fails
+grep "autoconf input.*'configure.ac', not 'configure.in'" stderr
+
 :
index 2f7c2d1ba23d8195e5183feaac7dace1b1f6632d..ae918778a9853a0c6aa2930cb94e2eed907fe170 100755 (executable)
--- a/t/help.sh
+++ b/t/help.sh
@@ -38,9 +38,7 @@ $AUTOMAKE --help
 $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 $FGREP configure.ac stderr
-$FGREP configure.in stderr
 AUTOMAKE_fails
 $FGREP configure.ac stderr
-$FGREP configure.in stderr
 
 :