[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_INIT translates PACKAGE to lower case
From: |
Akim Demaille |
Subject: |
Re: AC_INIT translates PACKAGE to lower case |
Date: |
30 Jan 2002 14:15:02 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) |
>>>>> "Ralf" == Ralf Corsepius <address@hidden> writes:
Ralf> If using the new AC_INIT and AM_INIT_AUTOMAKE syntax, PACKAGE
Ralf> gets translated to lower case letters. - Why this change?
Because that's the case for most packages. But that's not true:
PACKAGE_NAME is not lower cased.
Ralf> Furthermore, PACKAGE_TARNAME also is transformed to lower case
Ralf> letters - Why this change?
It _is_ true for TARNAME. Which is the one that makes sense for
Automake when it makes dist.
Ralf> IMO, both changes unnecessarily complicate things and avoidably
Ralf> break well-known features of automake, without further reason.
Unification. Let's say that you are used to the present scheme, but
for a fresh person, there is obviously a problem.
Ralf> In particular this change is in contradiction to this sentence
Ralf> from info automake.info (1.4):
Ralf> Automake doesn't do any interpretation of `PACKAGE' or
Ralf> `VERSION'.
Ralf> [Strictly speaking this sentence remains valid. It's autoconf
Ralf> that interferes.]
Right.
What do you think about the following patch, that I just applied.
Index: ChangeLog
from Akim Demaille <address@hidden>
* lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Support pre-defined
values.
* doc/autoconf.texi (Initializing configure): Explain how to
change AC_INIT default values.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.577
diff -u -u -r1.577 autoconf.texi
--- doc/autoconf.texi 28 Jan 2002 10:46:13 -0000 1.577
+++ doc/autoconf.texi 30 Jan 2002 13:05:46 -0000
@@ -1502,7 +1502,8 @@
@acindex PACKAGE_TARNAME
@ovindex PACKAGE_TARNAME
@cvindex PACKAGE_TARNAME
address@hidden once @samp{GNU } strip, and lower cased.
address@hidden once @samp{GNU } strip, lower cased, and all non
+alphanumeric character mapped onto @samp{_}.
@item @code{AC_PACKAGE_VERSION}, @code{PACKAGE_VERSION}
@acindex PACKAGE_VERSION
@@ -1522,6 +1523,24 @@
@cvindex PACKAGE_BUGREPORT
Exactly @var{bug-report-address}.
@end table
+
+All these values may be changed. For instance if the default value for
address@hidden does not suit your application, you can either
+use:
+
address@hidden
+m4_define([AC_PACKAGE_TARNAME], [GNU-Foo-Bar-1.0])
+AC_INIT([GNU Foo Bar], [1.0])
address@hidden example
+
address@hidden
+or
+
address@hidden
+AC_INIT([GNU Foo Bar], [1.0])
+m4_define([AC_PACKAGE_TARNAME], [GNU-Foo-Bar-1.0])
+AC_SUBST([PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])
address@hidden example
@end defmac
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.783
diff -u -u -r1.783 general.m4
--- lib/autoconf/general.m4 24 Jan 2002 17:15:55 -0000 1.783
+++ lib/autoconf/general.m4 30 Jan 2002 13:05:46 -0000
@@ -289,12 +289,19 @@
[AS_LITERAL_IF([$1], [], [m4_warn([syntax], [AC_INIT: not a literal: $1])])
AS_LITERAL_IF([$2], [], [m4_warn([syntax], [AC_INIT: not a literal: $2])])
AS_LITERAL_IF([$3], [], [m4_warn([syntax], [AC_INIT: not a literal: $3])])
-m4_define([AC_PACKAGE_NAME], [$1])
-m4_define([AC_PACKAGE_TARNAME],
- m4_tolower(m4_bpatsubst([[[$1]]], [GNU ])))
-m4_define([AC_PACKAGE_VERSION], [$2])
-m4_define([AC_PACKAGE_STRING], [$1 $2])
-m4_define([AC_PACKAGE_BUGREPORT], [$3])
+m4_ifndef([AC_PACKAGE_NAME],
+ [m4_define([AC_PACKAGE_NAME], [$1])])
+m4_ifndef([AC_PACKAGE_TARNAME],
+ [m4_define([AC_PACKAGE_TARNAME],
+ m4_bpatsubst(m4_tolower(m4_bpatsubst([[[$1]]], [GNU ])),
+ [[^abcdefghijklmnopqrstuvwxyz0123456789]],
+ [_]))])
+m4_ifndef([AC_PACKAGE_VERSION],
+ [m4_define([AC_PACKAGE_VERSION], [$2])])
+m4_ifndef([AC_PACKAGE_STRING],
+ [m4_define([AC_PACKAGE_STRING], [$1 $2])])
+m4_ifndef([AC_PACKAGE_BUGREPORT],
+ [m4_define([AC_PACKAGE_BUGREPORT], [$3])])
])
- AC_INIT translates PACKAGE to lower case, Ralf Corsepius, 2002/01/30
- Re: AC_INIT translates PACKAGE to lower case,
Akim Demaille <=
- Re: AC_INIT translates PACKAGE to lower case, Ralf Corsepius, 2002/01/30
- Re: AC_INIT translates PACKAGE to lower case, Alexandre Duret-Lutz, 2002/01/30
- Re: AC_INIT translates PACKAGE to lower case, Tom Tromey, 2002/01/30
- Re: AC_INIT translates PACKAGE to lower case, Ralf Corsepius, 2002/01/30
- Re: AC_INIT translates PACKAGE to lower case, Akim Demaille, 2002/01/31
- Re: AC_INIT translates PACKAGE to lower case, Ralf Corsepius, 2002/01/31
- Re: AC_INIT translates PACKAGE to lower case, Akim Demaille, 2002/01/31
- Re: AC_INIT translates PACKAGE to lower case, Ralf Corsepius, 2002/01/31
- Re: AC_INIT translates PACKAGE to lower case, Tim Van Holder, 2002/01/31