+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,
@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
@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
[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])])
])