diff options
author | Yann Ylavic <ylavic@apache.org> | 2021-03-24 15:02:52 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2021-03-24 15:02:52 +0000 |
commit | ea9344182b7559b12aa523548bb6d37d0e009028 (patch) | |
tree | 0abf9200714b67c0326e5d8dff1683684a338e23 /build | |
parent | 90b2324c3f59fab62d7d44b81e4107852e23d3a4 (diff) | |
download | apr-ea9344182b7559b12aa523548bb6d37d0e009028.tar.gz |
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/trunk@1888017 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build')
-rw-r--r-- | build/apr_common.m4 | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/build/apr_common.m4 b/build/apr_common.m4 index 67d004983..3be864702 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]) |