Karsten Hopp 6f8699
diff -urN autoconf-2.62/ChangeLog autoconf-2.62_new/ChangeLog
Karsten Hopp 6f8699
--- autoconf-2.62/ChangeLog	2008-06-24 15:18:34.000000000 +0200
Karsten Hopp 6f8699
+++ autoconf-2.62_new/ChangeLog	2008-06-24 15:24:35.000000000 +0200
Karsten Hopp 6f8699
@@ -1,3 +1,14 @@
Karsten Hopp 6f8699
+2008-06-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
Karsten Hopp 6f8699
+
Karsten Hopp 6f8699
+	Fix '#undef variable /* comment */' transform in config headers.
Karsten Hopp 6f8699
+	* lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS_PREPARE): For
Karsten Hopp 6f8699
+	undefined preprocessor macros that are followed by a comment
Karsten Hopp 6f8699
+	in the header template, do not create nested comments in the
Karsten Hopp 6f8699
+	output.
Karsten Hopp 6f8699
+	* tests/torture.at (@%:@define header templates): Extend test.
Karsten Hopp 6f8699
+	* NEWS: Update.
Karsten Hopp 6f8699
+	Report by Karsten Hopp <karsten@redhat.com>.
Karsten Hopp 6f8699
+
Karsten Hopp 6f8699
 2008-06-05  Eric Blake  <ebb9@byu.net>
Karsten Hopp 6f8699
 
Karsten Hopp 6f8699
 	Fix regression in AT_KEYWORDS([Macro]), from 2007-10-18.
Karsten Hopp 6f8699
diff -urN autoconf-2.62/lib/autoconf/status.m4 autoconf-2.62_new/lib/autoconf/status.m4
Karsten Hopp 6f8699
--- autoconf-2.62/lib/autoconf/status.m4	2008-04-06 01:04:48.000000000 +0200
Karsten Hopp 6f8699
+++ autoconf-2.62_new/lib/autoconf/status.m4	2008-06-24 15:21:54.000000000 +0200
Karsten Hopp 6f8699
@@ -832,9 +832,9 @@
Karsten Hopp 6f8699
   }
Karsten Hopp 6f8699
   split(mac1, mac2, "(") #)
Karsten Hopp 6f8699
   macro = mac2[1]
Karsten Hopp 6f8699
+  prefix = substr(line, 1, index(line, defundef) - 1)
Karsten Hopp 6f8699
   if (D_is_set[macro]) {
Karsten Hopp 6f8699
     # Preserve the white space surrounding the "#".
Karsten Hopp 6f8699
-    prefix = substr(line, 1, index(line, defundef) - 1)
Karsten Hopp 6f8699
     print prefix "define", macro P[macro] D[macro]
Karsten Hopp 6f8699
     next
Karsten Hopp 6f8699
   } else {
Karsten Hopp 6f8699
@@ -842,7 +842,7 @@
Karsten Hopp 6f8699
     # in the case of _POSIX_SOURCE, which is predefined and required
Karsten Hopp 6f8699
     # on some systems where configure will not decide to define it.
Karsten Hopp 6f8699
     if (defundef == "undef") {
Karsten Hopp 6f8699
-      print "/*", line, "*/"
Karsten Hopp 6f8699
+      print "/*", prefix defundef, macro, "*/"
Karsten Hopp 6f8699
       next
Karsten Hopp 6f8699
     }
Karsten Hopp 6f8699
   }
Karsten Hopp 6f8699
diff -urN autoconf-2.62/NEWS autoconf-2.62_new/NEWS
Karsten Hopp 6f8699
--- autoconf-2.62/NEWS	2008-06-24 15:18:34.000000000 +0200
Karsten Hopp 6f8699
+++ autoconf-2.62_new/NEWS	2008-06-24 15:25:28.000000000 +0200
Karsten Hopp 6f8699
@@ -25,6 +25,9 @@
Karsten Hopp 6f8699
    like '__restrict' if the variant spelling is available, as this is
Karsten Hopp 6f8699
    more likely to work when mixing C and C++ code.
Karsten Hopp 6f8699
 
Karsten Hopp 6f8699
+** Config header templates `#undef UNDEFINED /* comment */' do not lead to
Karsten Hopp 6f8699
+   nested comments any more; regression introduced in 2.62.
Karsten Hopp 6f8699
+
Karsten Hopp 6f8699
 ** AC_CHECK_ALIGNOF's type argument T is now documented better: it must
Karsten Hopp 6f8699
    be a string of tokens such that "T y;" is a valid member declaration
Karsten Hopp 6f8699
    in a struct.
Karsten Hopp 6f8699
diff -urN autoconf-2.62/tests/torture.at autoconf-2.62_new/tests/torture.at
Karsten Hopp 6f8699
--- autoconf-2.62/tests/torture.at	2008-04-06 01:04:48.000000000 +0200
Karsten Hopp 6f8699
+++ autoconf-2.62_new/tests/torture.at	2008-06-24 15:23:21.000000000 +0200
Karsten Hopp 6f8699
@@ -497,6 +497,8 @@
Karsten Hopp 6f8699
 #define str(define) \
Karsten Hopp 6f8699
 #define
Karsten Hopp 6f8699
 #define stringify(arg) str(arg)
Karsten Hopp 6f8699
+#undef aaa /* with comments */
Karsten Hopp 6f8699
+#undef not_substed /* with comments */
Karsten Hopp 6f8699
 ]])
Karsten Hopp 6f8699
 
Karsten Hopp 6f8699
 AT_CHECK_AUTOCONF
Karsten Hopp 6f8699
@@ -527,6 +529,8 @@
Karsten Hopp 6f8699
 #define str(define) \
Karsten Hopp 6f8699
 #define
Karsten Hopp 6f8699
 #define stringify(arg) str(arg)
Karsten Hopp 6f8699
+#define aaa AAA
Karsten Hopp 6f8699
+/* #undef not_substed */
Karsten Hopp 6f8699
 ]])
Karsten Hopp 6f8699
 AT_CHECK([cat config.h], 0, expout)
Karsten Hopp 6f8699