Skip to content

Commit e019791

Browse files
committed
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
1 parent 7407474 commit e019791

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build/apr_common.m4

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,16 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
467467
CFLAGS="$CFLAGS -Werror"
468468
fi
469469
AC_COMPILE_IFELSE(
470-
[AC_LANG_PROGRAM(
471-
[[$1]],
470+
[AC_LANG_SOURCE(
471+
[
472+
#ifndef PACKAGE_NAME
473+
#include "confdefs.h"
474+
#endif
475+
]
476+
[[$1]]
477+
[int main(int argc, const char *const *argv) {]
472478
[[$2]]
479+
[ return 0; }]
473480
)], [CFLAGS=$apr_save_CFLAGS
474481
$3], [CFLAGS=$apr_save_CFLAGS
475482
$4])

0 commit comments

Comments
 (0)