From: Akim Demaille Date: Wed, 30 Jan 2002 13:08:45 +0000 (+0000) Subject: * lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Support pre-defined X-Git-Tag: AUTOCONF-2.52h~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d6f8defa52d3cfd629e98c97f63c8c18c1dfd68;p=thirdparty%2Fautoconf.git * lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Support pre-defined values. * doc/autoconf.texi (Initializing configure): Explain how to change AC_INIT default values. --- diff --git a/ChangeLog b/ChangeLog index 4b9bc4094..dac98f497 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-01-30 Akim Demaille + + * 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 * tests/torture.at (Configuring subdirectories): Use configure.in, diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 59d3915ba..a27bd9320 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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 diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index b341016f0..2dc0a7053 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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])]) ])