]> granicus.if.org Git - postgresql/blobdiff - configure
Allow ConditionVariable[PrepareTo]Sleep to auto-switch between CVs.
[postgresql] / configure
index 98cb8b2881475ab8ef1d7f2205339b9d560d5fc3..45221e1ea3b40eadd9a16168521b1fc2be6113a8 100755 (executable)
--- a/configure
+++ b/configure
@@ -11,7 +11,7 @@
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 #
-# Copyright (c) 1996-2017, PostgreSQL Global Development Group
+# Copyright (c) 1996-2018, PostgreSQL Global Development Group
 ## -------------------- ##
 ## M4sh Initialization. ##
 ## -------------------- ##
@@ -630,12 +630,10 @@ vpath_build
 PG_VERSION_NUM
 PROVE
 FOP
-OSX
 XSLTPROC
-XMLLINT
 DBTOEPUB
 have_docbook
-NSGMLS
+XMLLINT
 TCL_SHLIB_LD_LIBS
 TCL_SHARED_BUILD
 TCL_LIB_SPEC
@@ -1637,7 +1635,7 @@ Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 
-Copyright (c) 1996-2017, PostgreSQL Global Development Group
+Copyright (c) 1996-2018, PostgreSQL Global Development Group
 _ACEOF
   exit
 fi
@@ -7820,12 +7818,19 @@ $as_echo "$perl_embed_ccflags" >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flags to link embedded Perl" >&5
 $as_echo_n "checking for flags to link embedded Perl... " >&6; }
 if test "$PORTNAME" = "win32" ; then
-perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
-test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
+       perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
+       if test -e "$perl_archlibexp/CORE/$perl_lib.lib"; then
+               perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
+       else
+               perl_lib=`basename $perl_archlibexp/CORE/libperl[5-9]*.a .a | sed 's/^lib//'`
+               if test -e "$perl_archlibexp/CORE/lib$perl_lib.a"; then
+                       perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
+               fi
+       fi
 else
-pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
-pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
-perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
+       pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
+       pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
+       perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
 fi
 if test -z "$perl_embed_ldflags" ; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -10120,12 +10125,13 @@ else
 fi
 
   fi
-  for ac_func in SSL_get_current_compression
+  for ac_func in SSL_get_current_compression X509_get_signature_nid
 do :
-  ac_fn_c_check_func "$LINENO" "SSL_get_current_compression" "ac_cv_func_SSL_get_current_compression"
-if test "x$ac_cv_func_SSL_get_current_compression" = xyes; then :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
     else
       LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
     fi
+    for ac_func in ldap_initialize
+do :
+  ac_fn_c_check_func "$LINENO" "ldap_initialize" "ac_cv_func_ldap_initialize"
+if test "x$ac_cv_func_ldap_initialize" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LDAP_INITIALIZE 1
+_ACEOF
+
+fi
+done
+
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lwldap32" >&5
 $as_echo_n "checking for ldap_bind in -lwldap32... " >&6; }
@@ -11896,7 +11913,10 @@ if ${pgac_cv__builtin_constant_p+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-static int x; static int y[__builtin_constant_p(x) ? x : 1];
+static int x;
+  static int y[__builtin_constant_p(x) ? x : 1];
+  static int z[__builtin_constant_p("string literal") ? 1 : x];
+
 
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
@@ -12462,6 +12482,71 @@ $as_echo "#define LOCALE_T_IN_XLOCALE 1" >>confdefs.h
 
 fi
 
+# MSVC doesn't cope well with defining restrict to __restrict, the
+# spelling it understands, because it conflicts with
+# __declspec(restrict). Therefore we define pg_restrict to the
+# appropriate definition, which presumably won't conflict.
+#
+# Allow platforms with buggy compilers to force restrict to not be
+# used by setting $FORCE_DISABLE_RESTRICT=yes in the relevant
+# template.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
+$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
+if ${ac_cv_c_restrict+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_restrict=no
+   # The order here caters to the fact that C++ does not require restrict.
+   for ac_kw in __restrict __restrict__ _Restrict restrict; do
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+typedef int * int_ptr;
+       int foo (int_ptr $ac_kw ip) {
+       return ip[0];
+       }
+int
+main ()
+{
+int s[1];
+       int * $ac_kw t = s;
+       t[0] = 0;
+       return foo(t)
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_restrict=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     test "$ac_cv_c_restrict" != no && break
+   done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
+$as_echo "$ac_cv_c_restrict" >&6; }
+
+ case $ac_cv_c_restrict in
+   restrict) ;;
+   no) $as_echo "#define restrict /**/" >>confdefs.h
+ ;;
+   *)  cat >>confdefs.h <<_ACEOF
+#define restrict $ac_cv_c_restrict
+_ACEOF
+ ;;
+ esac
+
+if test "$ac_cv_c_restrict" = "no" -o "x$FORCE_DISABLE_RESTRICT" = "xyes"; then
+  pg_restrict=""
+else
+  pg_restrict="$ac_cv_c_restrict"
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define pg_restrict $pg_restrict
+_ACEOF
+
+
 ac_fn_c_check_type "$LINENO" "struct cmsgcred" "ac_cv_type_struct_cmsgcred" "#include <sys/socket.h>
 #include <sys/param.h>
 #ifdef HAVE_SYS_UCRED_H
@@ -14402,6 +14487,45 @@ esac
 
 fi
 
+# has to be down here, rather than with the other builtins, because
+# the test uses PG_INT64_TYPE.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_mul_overflow" >&5
+$as_echo_n "checking for __builtin_mul_overflow... " >&6; }
+if ${pgac_cv__builtin_op_overflow+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+PG_INT64_TYPE a = 1;
+PG_INT64_TYPE b = 1;
+PG_INT64_TYPE result;
+int oflo;
+
+int
+main ()
+{
+oflo = __builtin_mul_overflow(a, b, &result);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  pgac_cv__builtin_op_overflow=yes
+else
+  pgac_cv__builtin_op_overflow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_op_overflow" >&5
+$as_echo "$pgac_cv__builtin_op_overflow" >&6; }
+if test x"$pgac_cv__builtin_op_overflow" = xyes ; then
+
+$as_echo "#define HAVE__BUILTIN_OP_OVERFLOW 1" >>confdefs.h
+
+fi
+
 # Check size of void *, size_t (enables tweaks for > 32bit address space)
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
@@ -14799,7 +14923,10 @@ _ACEOF
 
 # Compute maximum alignment of any basic type.
 # We assume long's alignment is at least as strong as char, short, or int;
-# but we must check long long (if it exists) and double.
+# but we must check long long (if it is being used for int64) and double.
+# Note that we intentionally do not consider any types wider than 64 bits,
+# as allowing MAXIMUM_ALIGNOF to exceed 8 would be too much of a penalty
+# for disk and memory space.
 
 MAX_ALIGNOF=$ac_cv_alignof_long
 if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
@@ -14859,7 +14986,7 @@ _ACEOF
 fi
 
 
-# Check for extensions offering the integer scalar type __int128.
+# Some compilers offer a 128-bit integer scalar type.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __int128" >&5
 $as_echo_n "checking for __int128... " >&6; }
 if ${pgac_cv__128bit_int+:} false; then :
@@ -14909,6 +15036,41 @@ if test x"$pgac_cv__128bit_int" = xyes ; then
 
 $as_echo "#define PG_INT128_TYPE __int128" >>confdefs.h
 
+  # The cast to long int works around a bug in the HP C Compiler,
+# see AC_CHECK_SIZEOF for more information.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking alignment of PG_INT128_TYPE" >&5
+$as_echo_n "checking alignment of PG_INT128_TYPE... " >&6; }
+if ${ac_cv_alignof_PG_INT128_TYPE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_PG_INT128_TYPE"        "$ac_includes_default
+#ifndef offsetof
+# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
+#endif
+typedef struct { char x; PG_INT128_TYPE y; } ac__type_alignof_;"; then :
+
+else
+  if test "$ac_cv_type_PG_INT128_TYPE" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute alignment of PG_INT128_TYPE
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_alignof_PG_INT128_TYPE=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_PG_INT128_TYPE" >&5
+$as_echo "$ac_cv_alignof_PG_INT128_TYPE" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define ALIGNOF_PG_INT128_TYPE $ac_cv_alignof_PG_INT128_TYPE
+_ACEOF
+
+
 fi
 
 # Check for various atomic operations now that we have checked how to declare
 #
 # Check for DocBook and tools
 #
-if test -z "$NSGMLS"; then
-  for ac_prog in onsgmls nsgmls
+if test -z "$XMLLINT"; then
+  for ac_prog in xmllint
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_NSGMLS+:} false; then :
+if ${ac_cv_path_XMLLINT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $NSGMLS in
+  case $XMLLINT in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_NSGMLS="$NSGMLS" # Let the user override the test with a path.
+  ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -16051,7 +16213,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_NSGMLS="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -16062,35 +16224,35 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-NSGMLS=$ac_cv_path_NSGMLS
-if test -n "$NSGMLS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSGMLS" >&5
-$as_echo "$NSGMLS" >&6; }
+XMLLINT=$ac_cv_path_XMLLINT
+if test -n "$XMLLINT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
+$as_echo "$XMLLINT" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$NSGMLS" && break
+  test -n "$XMLLINT" && break
 done
 
 else
-  # Report the value of NSGMLS in configure's output in all cases.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSGMLS" >&5
-$as_echo_n "checking for NSGMLS... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSGMLS" >&5
-$as_echo "$NSGMLS" >&6; }
+  # Report the value of XMLLINT in configure's output in all cases.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLLINT" >&5
+$as_echo_n "checking for XMLLINT... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
+$as_echo "$XMLLINT" >&6; }
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook V4.2" >&5
-$as_echo_n "checking for DocBook V4.2... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML V4.2" >&5
+$as_echo_n "checking for DocBook XML V4.2... " >&6; }
 if ${pgac_cv_check_docbook+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.sgml <<EOF
-<!doctype book PUBLIC "-//OASIS//DTD DocBook V4.2//EN">
+  cat >conftest.xml <<EOF
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 <book>
  <title>test</title>
  <chapter>
@@ -16105,13 +16267,13 @@ EOF
 
 pgac_cv_check_docbook=no
 
-if test -n "$NSGMLS"; then
-  $NSGMLS -s conftest.sgml 1>&5 2>&1
+if test -n "$XMLLINT"; then
+  $XMLLINT --noout --valid conftest.xml 1>&5 2>&1
   if test $? -eq 0; then
     pgac_cv_check_docbook=yes
   fi
 fi
-rm -f conftest.sgml
+rm -f conftest.xml
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
 $as_echo "$pgac_cv_check_docbook" >&6; }
@@ -16173,60 +16335,6 @@ $as_echo_n "checking for DBTOEPUB... " >&6; }
 $as_echo "$DBTOEPUB" >&6; }
 fi
 
-if test -z "$XMLLINT"; then
-  for ac_prog in xmllint
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XMLLINT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $XMLLINT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-XMLLINT=$ac_cv_path_XMLLINT
-if test -n "$XMLLINT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
-$as_echo "$XMLLINT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$XMLLINT" && break
-done
-
-else
-  # Report the value of XMLLINT in configure's output in all cases.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLLINT" >&5
-$as_echo_n "checking for XMLLINT... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5
-$as_echo "$XMLLINT" >&6; }
-fi
-
 if test -z "$XSLTPROC"; then
   for ac_prog in xsltproc
 do
@@ -16281,60 +16389,6 @@ $as_echo_n "checking for XSLTPROC... " >&6; }
 $as_echo "$XSLTPROC" >&6; }
 fi
 
-if test -z "$OSX"; then
-  for ac_prog in osx sgml2xml sx
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_OSX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $OSX in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_OSX="$OSX" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_OSX="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-OSX=$ac_cv_path_OSX
-if test -n "$OSX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OSX" >&5
-$as_echo "$OSX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$OSX" && break
-done
-
-else
-  # Report the value of OSX in configure's output in all cases.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSX" >&5
-$as_echo_n "checking for OSX... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OSX" >&5
-$as_echo "$OSX" >&6; }
-fi
-
 if test -z "$FOP"; then
   for ac_prog in fop
 do
@@ -16742,7 +16796,7 @@ _ACEOF
 # awk -F is a regex on some platforms, and not on others, so make "." a tab
 PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
 tr '.' '       ' |
-$AWK '{printf "%d%02d%02d", $1, $2, (NF >= 3) ? $3 : 0}'`"
+$AWK '{printf "%d%04d", $1, $2}'`"
 
 cat >>confdefs.h <<_ACEOF
 #define PG_VERSION_NUM $PG_VERSION_NUM