[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: small regression in autoconf-2.64 AC_CHECK_MEMBERS
From: |
Ralf Wildenhues |
Subject: |
Re: small regression in autoconf-2.64 AC_CHECK_MEMBERS |
Date: |
Mon, 10 Aug 2009 20:37:09 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-15) |
Hi Paolo, Bruno,
* Paolo Bonzini wrote on Mon, Aug 10, 2009 at 08:01:33PM CEST:
> Fix description of the macro generated by AC_CHECK_MEMBERS.
>
> * lib/autoconf/types.m4 (_AC_CHECK_MEMBERS): Fix regex
> replacement. Reported by Bruno Haible.
Thanks. I'm adding this patch on top, to avoid regressing like this
again (which happened in commit 918763823 BTW), and to add some test
suite exposure of AC_CHECK_MEMBER.
Cheers,
Ralf
Ensure we do not regress with AC_CHECK_MEMBERS.
* tests/semantics.at (AC_CHECK_MEMBERS): Expose the recent
AC_CHECK_MEMBERS fix.
(AC_CHECK_MEMBER): New test group.
diff --git a/tests/semantics.at b/tests/semantics.at
index 9908a15..d25b188 100644
--- a/tests/semantics.at
+++ b/tests/semantics.at
@@ -255,6 +255,32 @@ AT_CHECK_DEFINES(
AT_CLEANUP
+# AC_CHECK_MEMBER
+# ----------------
+# Check that it performs the correct actions.
+# Must define HAVE_STRUCT_YES_S_YES, but not HAVE_STRUCT_YES_S_NO.
+AT_CHECK_MACRO([AC_CHECK_MEMBER],
+[[AC_CHECK_MEMBER([struct yes_s.yes],
+ [AC_DEFINE([HAVE_STRUCT_YES_S_YES], [1],
+ [Define to 1 if `yes' is a member of `struct
yes_s'.])],,
+ [struct sub { int x; };
+ struct yes_s { int yes; struct sub substruct; };])
+ AC_CHECK_MEMBER([struct yes_s.no],
+ [AC_DEFINE([HAVE_STRUCT_YES_S_NO], [1],
+ [Define to 1 if `no' is a member of `struct
yes_s'.])],,
+ [struct sub { int x; };
+ struct yes_s { int yes; struct sub substruct; };])
+ AC_CHECK_MEMBER([struct yes_s.substruct],
+ [AC_DEFINE([HAVE_STRUCT_YES_S_SUBSTRUCT], [1],
+ [Define to 1 if `substruct' is a member of `struct
yes_s'.])],,
+ [struct sub { int x; };
+ struct yes_s { int yes; struct sub substruct; };])]],
+[AT_CHECK_DEFINES(
+[/* #undef HAVE_STRUCT_YES_S_NO */
+#define HAVE_STRUCT_YES_S_SUBSTRUCT 1
+#define HAVE_STRUCT_YES_S_YES 1
+])])
+
# AC_CHECK_MEMBERS
# ----------------
# Check that it performs the correct actions.
@@ -267,7 +293,9 @@ AT_CHECK_MACRO([AC_CHECK_MEMBERS],
[/* #undef HAVE_STRUCT_YES_S_NO */
#define HAVE_STRUCT_YES_S_SUBSTRUCT 1
#define HAVE_STRUCT_YES_S_YES 1
-])])
+])
+AT_CHECK([grep 'yes.*member of.*yes_s' config.h], [], [ignore])
+])
# AC_CHECK_ALIGNOF