]> granicus.if.org Git - postgresql/blobdiff - configure.in
Rewrite pg_regress as a C program instead of a shell script.
[postgresql] / configure.in
index 982e2081ce285bee9da8c5af3d9b2db799938e91..03b8f51d641edeb2f78622af5c7ee365ced72b0a 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.458 2006/04/21 23:11:58 momjian Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.468 2006/07/11 16:14:50 tgl Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -248,25 +248,34 @@ else
   fi
 fi
 
-# The Intel compiler on Linux supports most gcc options, but not
-# all of them, so only add these options if we are really using
-# gcc
+# Some versions of GCC support some additional useful warning flags.
+# Check whether they are supported, and add them to CFLAGS if so.
 
 if test "$GCC" = yes; then
+
+# ICC pretends to be GCC but it's lying; it doesn't support these options.
+# So we have to check if "GCC" is really ICC.
 AC_TRY_COMPILE([], [@%:@ifndef __INTEL_COMPILER
 choke me
 @%:@endif], [ICC=[yes]], [ICC=[no]])
+
   if test "$ICC" = no; then
     CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
 
-    # Some versions of GCC support some additional useful warning flags.
-    # Check whether they are supported, and add them to CFLAGS if so.
     PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement])
     PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels])
+  else
+    # Intel compiler has a bug/misoptimization in checking for
+    # division by NAN (NaN == 0), -mp1 fixes it, so add it to the
+    # CFLAGS.
+    PGAC_PROG_CC_CFLAGS_OPT([-mp1])
   fi
 
   # Disable strict-aliasing rules; needed for gcc 3.3+
   PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])
+elif test ${CC} = "xlc"; then
+  # AIX xlc has to have strict aliasing turned off too
+  PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias])
 fi
 
 # supply -g if --enable-debug
@@ -662,8 +671,6 @@ if test "$with_krb5" = yes ; then
   if test "$PORTNAME" != "win32"; then
      AC_SEARCH_LIBS(com_err, [krb5 'krb5 -ldes -lasn1 -lroken' com_err], [],
                     [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
-     AC_SEARCH_LIBS(krb5_encrypt, [krb5 'krb5 -ldes -lasn1 -lroken' crypto k5crypto], [],
-                    [AC_MSG_ERROR([could not find function 'krb5_encrypt' required for Kerberos 5])])
      AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -ldes -lasn1 -lroken'], [],
                     [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
   else
@@ -855,6 +862,7 @@ PGAC_FUNC_GETTIMEOFDAY_1ARG
 AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs])
 
 AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
+AC_CHECK_DECLS(posix_fadvise, [], [], [#include <fcntl.h>])
 
 HAVE_IPV6=no
 AC_CHECK_TYPE([struct sockaddr_in6],
@@ -985,6 +993,7 @@ AC_LIBOBJ(gettimeofday)
 AC_LIBOBJ(kill)
 AC_LIBOBJ(open)
 AC_LIBOBJ(rand)
+AC_LIBOBJ(win32error)
 AC_DEFINE([HAVE_SYMLINK], 1,
           [Define to 1 if you have the `symlink' function.])
 fi
@@ -1261,17 +1270,22 @@ AC_FUNC_MEMCMP
 
 
 # Select semaphore implementation type.
-if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
-  AC_DEFINE(USE_NAMED_POSIX_SEMAPHORES, 1, [Define to select named POSIX semaphores.])
-  SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
-else
-  if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
-    AC_DEFINE(USE_UNNAMED_POSIX_SEMAPHORES, 1, [Define to select unnamed POSIX semaphores.])
+if test "$PORTNAME" != "win32"; then
+  if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
+    AC_DEFINE(USE_NAMED_POSIX_SEMAPHORES, 1, [Define to select named POSIX semaphores.])
     SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
   else
-    AC_DEFINE(USE_SYSV_SEMAPHORES, 1, [Define to select SysV-style semaphores.])
-    SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
+    if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
+      AC_DEFINE(USE_UNNAMED_POSIX_SEMAPHORES, 1, [Define to select unnamed POSIX semaphores.])
+      SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
+    else
+      AC_DEFINE(USE_SYSV_SEMAPHORES, 1, [Define to select SysV-style semaphores.])
+      SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
+    fi
   fi
+else
+  AC_DEFINE(USE_WIN32_SEMAPHORES, 1, [Define to select Win32-style semaphores.])
+  SEMA_IMPLEMENTATION="src/backend/port/win32_sema.c"
 fi
 
 
@@ -1412,5 +1426,11 @@ AC_CONFIG_HEADERS([src/include/pg_config.h],
 echo >src/include/stamp-h
 ])
 
+#
+# Warn about unknown options
+#
+
+PGAC_CHECK_ARGS
+
 AC_OUTPUT