On Wed, Mar 24, 2021 at 3:24 PM Joe Orton <jor...@redhat.com> wrote:
>
> This now fails for me in exactly the same way when using ./configure
> --enable-maintainer-mode on autoconf 2.69, both in Fedora 33 and in
> Ubuntu: https://travis-ci.com/github/apache/apr/jobs/492824241

How about the attached patch?
This almost restores the previous APR_TRY_COMPILE_NO_WARNING but
doesn't #include "confdefs.h" if AC_LANG_SOURCE did it already,
assuming PACKAGE_NAME is defined by "confdefs.h"..

Regards;
Yann.
Index: build/apr_common.m4
===================================================================
--- build/apr_common.m4	(revision 1887506)
+++ build/apr_common.m4	(working copy)
@@ -467,9 +467,16 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
    CFLAGS="$CFLAGS -Werror"
  fi
  AC_COMPILE_IFELSE(
-  [AC_LANG_PROGRAM(
-   [[$1]],
+  [AC_LANG_SOURCE(
+   [
+#ifndef PACKAGE_NAME
+#include "confdefs.h"
+#endif
+   ]
+   [[$1]]
+   [int main(int argc, const char *const *argv) {]
    [[$2]]
+   [   return 0; }]
   )], [CFLAGS=$apr_save_CFLAGS
 $3],  [CFLAGS=$apr_save_CFLAGS
 $4])

Reply via email to