]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Move the AC_SUBST
authorAkim Demaille <akim@epita.fr>
Sun, 6 Jan 2002 20:48:10 +0000 (20:48 +0000)
committerAkim Demaille <akim@epita.fr>
Sun, 6 Jan 2002 20:48:10 +0000 (20:48 +0000)
of PACKAGE_NAME, PACKAGE_TARNAME, PACKAGE_VERSION, PACKAGE_STRING,
and PACKAGE_BUGREPORT from here...
(_AC_INIT_DEFAULTS): to here, since it is unrelated to the
arguments.
(_AC_INIT_PREPARE): AC_DEFINE these symbols.
* lib/autotest/general.m4: Use AT_PACKAGE_*, not PACKAGE_*.
(AT_INIT): No longer catch `^PACKAGE_(BUGREPORT|STRING)$'.
* tests/tools.at (autoheader): Adjust.
* tests/atspecific.m4 (AT_CHECK_DEFINES): Adjust.

ChangeLog
NEWS
doc/autoconf.texi
lib/autoconf/general.m4
lib/autotest/general.m4
tests/atspecific.m4
tests/tools.at
tests/torture.at

index 4bb1faac4746550bbff671209c2a2cc95a42634c..a12a868714e270d3954df9166f8b35eb3c11179c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2002-01-06  Akim Demaille  <akim@epita.fr>
+
+       * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Move the AC_SUBST
+       of PACKAGE_NAME, PACKAGE_TARNAME, PACKAGE_VERSION, PACKAGE_STRING,
+       and PACKAGE_BUGREPORT from here...
+       (_AC_INIT_DEFAULTS): to here, since it is unrelated to the
+       arguments.
+       (_AC_INIT_PREPARE): AC_DEFINE these symbols.
+       * lib/autotest/general.m4: Use AT_PACKAGE_*, not PACKAGE_*.
+       (AT_INIT): No longer catch `^PACKAGE_(BUGREPORT|STRING)$'.
+       * tests/tools.at (autoheader): Adjust.
+       * tests/atspecific.m4 (AT_CHECK_DEFINES): Adjust.
+
+       
 2002-01-06  Akim Demaille  <akim@epita.fr>
 
        * bin/autoscan.in (scan_file): Use `&used'.
diff --git a/NEWS b/NEWS
index ea8520d247be232a02663e2172a35959cf5213c0..44444c167fe416495505024ce85c69881816f30b 100644 (file)
--- a/NEWS
+++ b/NEWS
 
 ** Generic macros
 
+- AC_INIT
+  It now defines the preprocessor symbols PACKAGE_NAME,
+  PACKAGE_TARNAME, PACKAGE_VERSION, PACKAGE_STRING, and
+  PACKAGE_BUGREPORT.
+
 - AC_CONFIG_COMMANDS, HEADERS, FILES, LINKS.
   Provide the user with srcdir, ac_srcdir, ac_top_srcdir, ac_builddir,
   ac_top_builddir, ac_abs_srcdir, ac_abs_top_srcdir, ac_abs_builddir,
index ca192e5dbefd6f2d1fdd73d0b98ef15e23492454..36e43902fa11d94ad52d306075d7fb67b06b8456 100644 (file)
@@ -1483,34 +1483,41 @@ and verifications.  Set the name of the @var{package} and its
 @var{version}.  The optional argument @var{bug-report-address} should be
 the email to which users should send bug reports.
 
-These three arguments must be @emph{static}, i.e., there must not be any
-shell computation, but they can be computed by M4.  The following macros
-and output variables are then defined:
+These three arguments should be @emph{static}, i.e., there should not be
+any shell computation, but they can be computed by M4.  The following M4
+macros (e.g., @code{AC_PACKAGE_NAME}), output variables (e.g.,
+@code{PACKAGE_NAME}), and preprocessor symbols (e.g.,
+@code{PACKAGE_NAME}) are then defined:
 
 @table @asis
 @item @code{AC_PACKAGE_NAME}, @code{PACKAGE_NAME}
 @acindex PACKAGE_NAME
 @ovindex PACKAGE_NAME
+@cvindex PACKAGE_NAME
 Exactly @var{package}.
 
 @item @code{AC_PACKAGE_TARNAME}, @code{PACKAGE_TARNAME}
 @acindex PACKAGE_TARNAME
 @ovindex PACKAGE_TARNAME
+@cvindex PACKAGE_TARNAME
 @var{package} once @samp{GNU } strip, and lower cased.
 
 @item @code{AC_PACKAGE_VERSION}, @code{PACKAGE_VERSION}
 @acindex PACKAGE_VERSION
 @ovindex PACKAGE_VERSION
+@cvindex PACKAGE_VERSION
 Exactly @var{version}.
 
 @item @code{AC_PACKAGE_STRING}, @code{PACKAGE_STRING}
 @acindex PACKAGE_STRING
 @ovindex PACKAGE_STRING
+@cvindex PACKAGE_STRING
 Exactly @samp{@var{package} @var{version}}.
 
 @item @code{AC_PACKAGE_BUGREPORT}, @code{PACKAGE_BUGREPORT}
 @acindex PACKAGE_BUGREPORT
 @ovindex PACKAGE_BUGREPORT
+@cvindex PACKAGE_BUGREPORT
 Exactly @var{bug-report-address}.
 @end table
 @end defmac
index b04bdd46c566203cf50dd6a91801404a2e9f540f..1e1ea3e715fcda7ca27d514f858365d9f6314c6e 100644 (file)
@@ -448,6 +448,18 @@ AC_SUBST([PATH_SEPARATOR])dnl
 # only ac_max_sed_lines should be used.
 : ${ac_max_here_lines=38}
 
+# Identity of this package.
+AC_SUBST([PACKAGE_NAME],
+         [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])dnl
+AC_SUBST([PACKAGE_TARNAME],
+         [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])dnl
+AC_SUBST([PACKAGE_VERSION],
+         [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])dnl
+AC_SUBST([PACKAGE_STRING],
+         [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])dnl
+AC_SUBST([PACKAGE_BUGREPORT],
+         [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
+
 m4_divert_pop([DEFAULTS])dnl
 ])# _AC_INIT_DEFAULTS
 
@@ -567,18 +579,6 @@ AC_SUBST([oldincludedir],  ['/usr/include'])dnl
 AC_SUBST([infodir],        ['${prefix}/info'])dnl
 AC_SUBST([mandir],         ['${prefix}/man'])dnl
 
-# Identity of this package.
-AC_SUBST([PACKAGE_NAME],
-         [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])dnl
-AC_SUBST([PACKAGE_TARNAME],
-         [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])dnl
-AC_SUBST([PACKAGE_VERSION],
-         [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])dnl
-AC_SUBST([PACKAGE_STRING],
-         [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])dnl
-AC_SUBST([PACKAGE_BUGREPORT],
-         [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
-
 ac_prev=
 for ac_option
 do
@@ -1187,6 +1187,19 @@ rm -rf conftest* confdefs.h
 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
 echo >confdefs.h
 
+# Predefined preprocessor variables.
+AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"],
+                   [Define to the full name of this package.])
+AC_DEFINE_UNQUOTED([PACKAGE_TARNAME], ["$PACKAGE_TARNAME"],
+                   [Define to the one symbol short name of this package.])
+AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["$PACKAGE_VERSION"],
+                   [Define to the version of this package.])
+AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"],
+                   [Define to the full name and version of this package.])
+AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"],
+                   [Define to the address where bug reports for this package
+                    should be sent.])
+
 # Let the site file select an alternate cache file if it wants to.
 AC_SITE_LOAD
 AC_CACHE_LOAD
index ac34b32fb0ff387f5198d816116437408e7c58e1..1940bfcbc306d200cfed5efe5b3ec39365924058 100644 (file)
@@ -89,9 +89,8 @@ m4_define([AT_LINE],
 # Begin test suite.
 m4_define([AT_INIT],
 [m4_pattern_forbid([^_?AT_])
-m4_pattern_forbid([PACKAGE_(BUGREPORT|STRING)$])
 m4_define([AT_TESTSUITE_NAME],
-          m4_defn([PACKAGE_STRING])[ test suite]m4_ifval([$1], [: $1]))
+          m4_defn([AT_PACKAGE_STRING])[ test suite]m4_ifval([$1], [: $1]))
 m4_define([AT_ordinal], 0)
 m4_define([AT_banner_ordinal], 0)
 AS_INIT
@@ -184,7 +183,7 @@ while test $[@%:@] -gt 0; do
         ;;
 
     --version | -V )
-        echo "$as_me (PACKAGE_STRING)"
+        echo "$as_me (AT_PACKAGE_STRING)"
         exit 0
         ;;
 
@@ -318,7 +317,7 @@ Execution tuning:
                  default for debugging scripts
   -x, --trace    enable tests shell tracing
 
-Report bugs to <PACKAGE_BUGREPORT>.
+Report bugs to <AT_PACKAGE_BUGREPORT>.
 _ATEOF
   exit 0
 fi
@@ -544,7 +543,7 @@ m4_divert([TAIL])[]dnl
         sed "s/^ */$as_me: warning: /" <<_ATEOF
         A failure happened in a test group before any test could be
         run. This means that test suite is improperly designed.  Please
-        report this failure to <PACKAGE_BUGREPORT>.
+        report this failure to <AT_PACKAGE_BUGREPORT>.
 _ATEOF
        echo "$at_setup_line" >$at_check_line_file
       fi
@@ -671,7 +670,7 @@ elif test $at_debug_p = false; then
   AS_BOX([$as_me.log is created.])
 
   echo
-  echo "Please send \`$as_me.log' to <PACKAGE_BUGREPORT>,"
+  echo "Please send \`$as_me.log' to <AT_PACKAGE_BUGREPORT>,"
   echo "along with all information you think might help."
   exit 1
 fi
index 33ef7b0a18f6201338882678055e4fdbfc0a0f80..2e308bd637c04e2b7b0779437837b50938c4819a 100644 (file)
@@ -214,13 +214,14 @@ fi
 
 # AT_CHECK_DEFINES(CONTENT)
 # -------------------------
-# Verify that config.h, once stripped is CONTENT.
+# Verify that config.h, once stripped, is CONTENT.
 # Stripping consists of keeping CPP lines (i.e. containing a hash),
-# but those of automatically checked features (STDC_HEADERS etc.).
+# but those of automatically checked features (STDC_HEADERS etc.)
+# and symbols (PACKAGE_...).
 # AT_CHECK_HEADER is a better name, but too close from AC_CHECK_HEADER.
 m4_define([AT_CHECK_DEFINES],
 [AT_CHECK([[fgrep '#' config.h |
- egrep -v 'STDC_HEADERS|STD(INT|LIB)|INTTYPES|MEMORY|STRING|UNISTD|SYS_(TYPES|STAT)']],,
+ egrep -v 'STDC_HEADERS|STD(INT|LIB)|INTTYPES|MEMORY|PACKAGE_|STRING|SYS_(TYPES|STAT)|UNISTD']],,
           [$1])])
 
 
index 665d2621ab033ce048faee484954afe9c926cb12..1888eea27ec8ef44dfc934b153106fb7c6495beb 100644 (file)
@@ -377,6 +377,21 @@ AT_CHECK([cat config.hin], 0,
 [[/* config.hin.  Generated from configure.ac by autoheader.  */
 /* Define this to whatever you want. */
 #undef this
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
 ]])
 
 
@@ -429,6 +444,21 @@ Top2 from configure.ac.
 
 Middle from configure.ac.
 
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
 Bottom1 from configure.ac.
 
 Bottom2 from configure.ac.
index 06ab6e62f5adda56420176c3b21333183bf2c5f4..8626ddd2721d997ae2ac9e7be3b50156f6e1b566 100644 (file)
@@ -326,10 +326,10 @@ AT_DATA([expout],
 ]])
 AT_CHECK([cat config.h], 0, expout)
 
-# Check the value of DEFS.  Note the leading space.
+# Check the value of DEFS.
 AT_DATA([expout],
-[[-Dfoo=toto -Dbar=tata -Dbaz=titi -Dfubar=tutu -Da=A -Daaa=AAA -Daa=AA]
-])
+[[-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -Dfoo=toto -Dbar=tata -Dbaz=titi -Dfubar=tutu -Da=A -Daaa=AAA -Daa=AA
+]])
 
 # Because we strip trailing spaces in `testsuite' we can't leave one in
 # expout, hence nuke the one left by AC_OUTPUT_MAKE_DEFS.
@@ -426,12 +426,26 @@ AT_CHECK_CONFIGURE
 
 # Checking that AC_DEFINE worked properly.
 AT_DATA([expout],
-[m4_for(AT_Count, 1, 100, 1,
+[/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+m4_for(AT_Count, 1, 100, 1,
 [
 /* AT_DESCRIPTION */
 [#define] AT_DUMMY_VAR(AT_Count) "AT_BIG_VALUE"
 ])])
-AT_CHECK([sed -n '3,$ p' config.h], 0, expout)
+AT_CHECK([sed -n '4,$ p' config.h], 0, expout)
 
 # Checking that AC_SUBST worked properly.
 AT_DATA([expout],