summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorTom Lane2018-11-19 17:01:47 +0000
committerTom Lane2018-11-19 17:01:47 +0000
commitdcd6200165ca583cc1b0d436774cf4c3cf7e642d (patch)
tree60a210a3c65aadfbaddf25c095fd603bcdf6c052 /configure.in
parenta4db7fe0f71463eb7256d3c42b7a582d3943d604 (diff)
Fix configure's AC_CHECK_DECLS tests to work correctly with clang.
The test case that Autoconf uses to discover whether a function has been declared doesn't work reliably with clang, because clang reports a warning not an error if the name is a known built-in function. On some platforms, this results in a lot of compile-time warnings about strlcpy and related functions not having been declared. There is a fix for this (by Noah Misch) in the upstream Autoconf sources, but since they've not made a release in years and show no indication of doing so anytime soon, let's just absorb their fix directly. We can revert this when and if we update to a newer Autoconf release. Back-patch to all supported branches. Discussion: https://postgr.es/m/26819.1542515567@sss.pgh.pa.us
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in9
1 files changed, 6 insertions, 3 deletions
diff --git a/configure.in b/configure.in
index 3ff842f171a..ecd86541f38 100644
--- a/configure.in
+++ b/configure.in
@@ -384,7 +384,9 @@ PGAC_ARG_BOOL(with, llvm, no, [build with LLVM based JIT support],
[AC_DEFINE([USE_LLVM], 1, [Define to 1 to build with LLVM based JIT support. (--with-llvm)])])
AC_SUBST(with_llvm)
dnl must use AS_IF here, else AC_REQUIRES inside PGAC_LLVM_SUPPORT malfunctions
-AS_IF([test "$with_llvm" = yes], [PGAC_LLVM_SUPPORT()])
+AS_IF([test "$with_llvm" = yes], [
+ PGAC_LLVM_SUPPORT()
+]) # fi
unset CFLAGS
@@ -1582,10 +1584,11 @@ esac
# posix_fadvise() is a no-op on Solaris, so don't incur function overhead
# by calling it, 2009-04-02
# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
-if test "$PORTNAME" != "solaris"; then
+dnl must use AS_IF here, else AC_REQUIRES inside AC_CHECK_DECLS malfunctions
+AS_IF([test "$PORTNAME" != "solaris"], [
AC_CHECK_FUNCS(posix_fadvise)
AC_CHECK_DECLS(posix_fadvise, [], [], [#include <fcntl.h>])
-fi
+]) # fi
AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
AC_CHECK_DECLS([strlcat, strlcpy, strnlen])