summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2021-03-24 15:05:51 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2021-03-24 15:05:51 +0000
commitddfcb260bc499d152249019df35e605c85924aac (patch)
tree5c5a1ba3cd9b9af7da1762a1c1b410d21bb95d4c
parent4cb0bd40097bafd485b5d46db11bf9c38932f9ca (diff)
downloadlibapr-ddfcb260bc499d152249019df35e605c85924aac.tar.gz
Merge r1888017 from trunk:
Follow up to r1887279: fix new APR_TRY_COMPILE_NO_WARNING. AC_LANG_PROGRAM generates an "int main()" prototype which some compilers warn about. Restore AC_LANG_SOURCE to manually set the correct main() but do not #include "confdefs.h" if it is inlined already by AC_LANG_SOURCE (i.e. check whether PACKAGE_NAME is already defined). Github: closes #25 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1888018 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--build/apr_common.m411
1 files changed, 9 insertions, 2 deletions
diff --git a/build/apr_common.m4 b/build/apr_common.m4
index b67a8608a..0c1d2f23f 100644
--- a/build/apr_common.m4
+++ b/build/apr_common.m4
@@ -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])