autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02-fyi-define-package-id.patch


From: Akim Demaille
Subject: 02-fyi-define-package-id.patch
Date: Sun, 06 Jan 2002 21:49:18 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * 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.
        
        
Index: NEWS
--- NEWS Fri, 04 Jan 2002 17:28:33 +0100 akim
+++ NEWS Sat, 05 Jan 2002 13:53:18 +0100 akim
@@ -77,6 +77,11 @@
 
 ** 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: doc/autoconf.texi
--- doc/autoconf.texi Fri, 04 Jan 2002 17:28:33 +0100 akim
+++ doc/autoconf.texi Sat, 05 Jan 2002 13:51:27 +0100 akim
@@ -1483,34 +1483,41 @@ @node Initializing configure
 @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.,
address@hidden), and preprocessor symbols (e.g.,
address@hidden) are then defined:
 
 @table @asis
 @item @code{AC_PACKAGE_NAME}, @code{PACKAGE_NAME}
 @acindex PACKAGE_NAME
 @ovindex PACKAGE_NAME
address@hidden PACKAGE_NAME
 Exactly @var{package}.
 
 @item @code{AC_PACKAGE_TARNAME}, @code{PACKAGE_TARNAME}
 @acindex PACKAGE_TARNAME
 @ovindex PACKAGE_TARNAME
address@hidden 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
address@hidden PACKAGE_VERSION
 Exactly @var{version}.
 
 @item @code{AC_PACKAGE_STRING}, @code{PACKAGE_STRING}
 @acindex PACKAGE_STRING
 @ovindex PACKAGE_STRING
address@hidden PACKAGE_STRING
 Exactly @address@hidden @var{version}}.
 
 @item @code{AC_PACKAGE_BUGREPORT}, @code{PACKAGE_BUGREPORT}
 @acindex PACKAGE_BUGREPORT
 @ovindex PACKAGE_BUGREPORT
address@hidden PACKAGE_BUGREPORT
 Exactly @var{bug-report-address}.
 @end table
 @end defmac
Index: lib/autoconf/general.m4
--- lib/autoconf/general.m4 Fri, 04 Jan 2002 17:28:33 +0100 akim
+++ lib/autoconf/general.m4 Sat, 05 Jan 2002 14:13:47 +0100 akim
@@ -448,6 +448,18 @@ subdirs=
 # 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 @@ m4_define([_AC_INIT_PARSE_ARGS],
 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
@@ -1186,6 +1186,19 @@ m4_define([_AC_INIT_PREPARE],
 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
Index: lib/autotest/general.m4
--- lib/autotest/general.m4 Sat, 24 Nov 2001 18:34:10 +0100 akim
+++ lib/autotest/general.m4 Sat, 05 Jan 2002 15:14:42 +0100 akim
@@ -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 @@ m4_define([AT_banner_ordinal], 0)
         ;;
 
     --version | -V )
-        echo "$as_me (PACKAGE_STRING)"
+        echo "$as_me (AT_PACKAGE_STRING)"
         exit 0
         ;;
 
@@ -318,7 +317,7 @@ Usage: $[0] [[OPTION]... [VARIABLE=VALUE
                  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_define([AS_MESSAGE_LOG_FD], [6])
         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 @@ m4_define([AS_MESSAGE_LOG_FD], [6])
   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: tests/atspecific.m4
--- tests/atspecific.m4 Fri, 04 Jan 2002 17:28:33 +0100 akim
+++ tests/atspecific.m4 Sat, 05 Jan 2002 14:36:06 +0100 akim
@@ -214,13 +214,14 @@ m4_define([AT_CHECK_ENV],
 
 # 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: tests/tools.at
--- tests/tools.at Fri, 04 Jan 2002 17:28:33 +0100 akim
+++ tests/tools.at Sat, 05 Jan 2002 15:17:37 +0100 akim
@@ -377,6 +377,21 @@ configure.ac:14: error: possibly undefin
 [[/* 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
 ]])
 
 
@@ -428,6 +443,21 @@ configure.ac:14: error: possibly undefin
 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.
 
Index: tests/torture.at
--- tests/torture.at Wed, 14 Nov 2001 20:54:00 +0100 akim
+++ tests/torture.at Sat, 05 Jan 2002 15:19:24 +0100 akim
@@ -326,10 +326,10 @@ m4_define([AT_CHECK_CONFIG_CREATION],
 ]])
 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 @@ m4_define([AT_DUMMY_VAR],
 
 # 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],



reply via email to

[Prev in Thread] Current Thread [Next in Thread]