autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] AC_INIT: Use correct value for PACKAGE_TARNAME


From: Jim Meyering
Subject: [PATCH] AC_INIT: Use correct value for PACKAGE_TARNAME
Date: Tue, 15 Sep 2009 20:26:17 +0200

Hi,

I was surprised to find that the latest from autoconf's
master branch (v2.64-47-ge5ddeae) fails a simple "make dist":

    $ make dist
    { test ! -d "-autoconf--2.64.47-e5dd" || { find "-autoconf--2.64.47-e5dd" 
-type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr 
"-autoconf--2.64.47-e5dd"; }; }
    test -d "-autoconf--2.64.47-e5dd" || mkdir "-autoconf--2.64.47-e5dd"
    mkdir: invalid option -- 'a'
    Try `mkdir --help' for more information.
    make: *** [distdir] Error 1
    [Exit 2]

That's using m4-1.4.12.

Here's the direct culprit.  Note the stray hyphens:

  $ grep PACKAGE_TARNAME configure
  PACKAGE_TARNAME='-autoconf-'
  ...

But how did that get there?

Surprised there's no test that notices the failure?  I was.

I haven't dug into the origin but did write a patch and add a test:

>From b2c8ce3b7a00bfd2af297f8882882fa8e50cc803 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 15 Sep 2009 19:21:21 +0200
Subject: [PATCH] AC_INIT: Use correct value for PACKAGE_TARNAME.

* lib/autoconf/general.m4 (AC_PACKAGE_NAME): Remove excess
quotes around package name.
* tests/base.at (AC_INIT): Test for this.
---
 lib/autoconf/general.m4 |    2 +-
 tests/base.at           |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index c119088..bd19e82 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -237,7 +237,7 @@ m4_ifndef([AC_PACKAGE_NAME],
 m4_ifndef([AC_PACKAGE_TARNAME],
          [m4_define([AC_PACKAGE_TARNAME],
                     m4_default([$4],
-                               [m4_bpatsubst(m4_tolower(m4_bpatsubst([[[$1]]],
+                               [m4_bpatsubst(m4_tolower(m4_bpatsubst([[$1]],
                                                                     [GNU ])),
                                 [[^_abcdefghijklmnopqrstuvwxyz0123456789]],
                                 [-])]))])
diff --git a/tests/base.at b/tests/base.at
index 5929927..a8f8de7 100644
--- a/tests/base.at
+++ b/tests/base.at
@@ -198,6 +198,27 @@ AT_CHECK_CONFIGURE
 AT_CLEANUP


+## -------- ##
+## AC_INIT. ##
+## -------- ##
+
+# Make sure AC_INIT sets PACKAGE_TARNAME properly.
+
+AT_SETUP([AC_INIT])
+
+AT_DATA([configure.ac],
+[[AC_INIT([GNU fu], [1.0], address@hidden)
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([-q])
+
+# Ensure we get the expected definition:
+AT_CHECK([grep "^PACKAGE_TARNAME='fu'\$" configure], [], [ignore])
+
+AT_CLEANUP
+
+
 ## ---------------- ##
 ## AC_CACHE_CHECK.  ##
 ## ---------------- ##
--
1.6.5.rc1.171.g3f463




reply via email to

[Prev in Thread] Current Thread [Next in Thread]