]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Support pre-defined
authorAkim Demaille <akim@epita.fr>
Wed, 30 Jan 2002 13:08:45 +0000 (13:08 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 30 Jan 2002 13:08:45 +0000 (13:08 +0000)
values.
* doc/autoconf.texi (Initializing configure): Explain how to
change AC_INIT default values.

ChangeLog
doc/autoconf.texi
lib/autoconf/general.m4

index 4b9bc40946ef2926dcb06312a8948ccf814ca7b2..dac98f497a120ab569b1f80f74855072b4635f14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-01-30  Akim Demaille  <akim@epita.fr>
+
+       * lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Support pre-defined
+       values.
+       * doc/autoconf.texi (Initializing configure): Explain how to
+       change AC_INIT default values.
+
 2002-01-29  Akim Demaille  <akim@epita.fr>
 
        * tests/torture.at (Configuring subdirectories): Use configure.in,
index 59d3915baac5e7ca54f14dd814f9457fe0e32fd2..a27bd9320b45cb8650bfd218b5fec8cf1c38b1e6 100644 (file)
@@ -1502,7 +1502,8 @@ Exactly @var{package}.
 @acindex PACKAGE_TARNAME
 @ovindex PACKAGE_TARNAME
 @cvindex PACKAGE_TARNAME
-@var{package} once @samp{GNU } strip, and lower cased.
+@var{package} 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 @@ Exactly @samp{@var{package} @var{version}}.
 @cvindex PACKAGE_BUGREPORT
 Exactly @var{bug-report-address}.
 @end table
+
+All these values may be changed.  For instance if the default value for
+@code{AC_PACKAGE_NAME} does not suit your application, you can either
+use:
+
+@example
+m4_define([AC_PACKAGE_TARNAME], [GNU-Foo-Bar-1.0])
+AC_INIT([GNU Foo Bar], [1.0])
+@end example
+
+@noindent
+or
+
+@example
+AC_INIT([GNU Foo Bar], [1.0])
+m4_define([AC_PACKAGE_TARNAME], [GNU-Foo-Bar-1.0])
+AC_SUBST([PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])
+@end example
 @end defmac
 
 
index b341016f06db90254c71db73d35467437d46f51c..2dc0a70539db8be6528bd7dfd0ad9f2374830f23 100644 (file)
@@ -289,12 +289,19 @@ m4_define([_AC_INIT_PACKAGE],
 [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])])
 ])