]> granicus.if.org Git - postgresql/blobdiff - configure.in
Allow float8, int8, and related datatypes to be passed by value on machines
[postgresql] / configure.in
index c6dcf9fce0eb7e3f433ae21993b6b40f265a4130..dd832477d9863a29aacb210539d1f77ed89ed6b1 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.528 2007/10/02 00:25:20 tgl Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.556 2008/04/21 00:26:44 tgl Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -17,10 +17,13 @@ dnl Read the Autoconf manual for details.
 dnl
 m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
 
-AC_INIT([PostgreSQL], [8.3devel], [pgsql-bugs@postgresql.org])
+AC_INIT([PostgreSQL], [8.4devel], [pgsql-bugs@postgresql.org])
 
-AC_PREREQ(2.59)
-AC_COPYRIGHT([Copyright (c) 1996-2007, PostgreSQL Global Development Group])
+m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.61], [], [m4_fatal([Autoconf version 2.61 is required.
+Untested combinations of 'autoconf' and PostgreSQL versions are not
+recommended.  You can remove the check from 'configure.in' but it is then
+your responsibility whether the result works or not.])])
+AC_COPYRIGHT([Copyright (c) 1996-2008, PostgreSQL Global Development Group])
 AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
 AC_CONFIG_AUX_DIR(config)
 AC_PREFIX_DEFAULT(/usr/local/pgsql)
@@ -108,18 +111,6 @@ tas_file=dummy.s
 ## Command line options
 ##
 
-#
-# Installation directory for documentation
-#
-PGAC_ARG(with, docdir, [  --with-docdir=DIR       install the documentation in DIR [[PREFIX/doc]]
-  --without-docdir        do not install the documentation],
-         [AC_MSG_ERROR([option --with-docdir requires an argument])],
-         [docdir=],
-         [docdir=$withval],
-         [docdir='${prefix}/doc'])
-AC_SUBST(docdir)
-
-
 #
 # Add non-standard directories to the include path
 #
@@ -137,10 +128,10 @@ PGAC_ARG_REQ(with, libs,      [  --with-libs=DIRS        alternative spelling of
 
 
 #
-# 64-bit integer date/time storage (--enable-integer-datetimes)
+# 64-bit integer date/time storage: enabled by default.
 #
 AC_MSG_CHECKING([whether to build with 64-bit integer date/time support])
-PGAC_ARG_BOOL(enable, integer-datetimes, no, [  --enable-integer-datetimes  enable 64-bit integer date/time support],
+PGAC_ARG_BOOL(enable, integer-datetimes, yes, [  --disable-integer-datetimes  disable 64-bit integer date/time support],
               [AC_DEFINE([USE_INTEGER_DATETIMES], 1,
                          [Define to 1 if you want 64-bit integer timestamp and interval support. (--enable-integer-datetimes)])])
 AC_MSG_RESULT([$enable_integer_datetimes])
@@ -226,6 +217,12 @@ fi
 AC_SUBST(DTRACEFLAGS)])
 AC_SUBST(enable_dtrace)
 
+#
+# Data file segmentation
+#
+PGAC_ARG_BOOL(enable, segmented-files, yes,
+              [  --disable-segmented-files disable data file segmentation (requires largefile support)])
+
 #
 # C compiler
 #
@@ -287,6 +284,8 @@ if test "$GCC" = yes -a "$ICC" = no; then
   PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels])
   # Disable strict-aliasing rules; needed for gcc 3.3+
   PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])
+  # Disable optimizations that assume no overflow; needed for gcc 4.3+
+  PGAC_PROG_CC_CFLAGS_OPT([-fwrapv])
 elif test "$ICC" = yes; then
   # Intel's compiler has a bug/misoptimization in checking for
   # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
@@ -569,7 +568,7 @@ PGAC_ARG_BOOL(with, libedit-preferred, no,
 #
 # OSSP UUID library
 #
-PGAC_ARG_BOOL(with, ossp-uuid, no, [  --with-ossp-uuid        build with OSSP UUID library for UUID generation])
+PGAC_ARG_BOOL(with, ossp-uuid, no, [  --with-ossp-uuid        use OSSP UUID library when building contrib/uuid-ossp])
 AC_SUBST(with_ossp_uuid)
 
 
@@ -600,8 +599,8 @@ AC_SUBST(with_libxml)
 #
 # XSLT
 #
-PGAC_ARG_BOOL(with, libxslt, no, [  --with-libxslt          build with XSLT support],
-              [AC_DEFINE([USE_LIBXSLT], 1, [Define to 1 to build with XSLT support. (--with-libxslt)])])
+PGAC_ARG_BOOL(with, libxslt, no, [  --with-libxslt          use XSLT support when building contrib/xml2],
+              [AC_DEFINE([USE_LIBXSLT], 1, [Define to 1 to use XSLT support when building contrib/xml2. (--with-libxslt)])])
 
 
 AC_SUBST(with_libxslt)
@@ -793,6 +792,16 @@ if test "$with_libxslt" = yes ; then
   AC_CHECK_LIB(xslt, xsltLibxmlVersion, [], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])])
 fi
 
+# for contrib/uuid-ossp
+if test "$with_ossp_uuid" = yes ; then
+  AC_CHECK_LIB(ossp-uuid, uuid_export,
+    [OSSP_UUID_LIBS="-lossp-uuid"],
+    [AC_CHECK_LIB(uuid, uuid_export,
+      [OSSP_UUID_LIBS="-luuid"],
+      [AC_MSG_ERROR([library 'ossp-uuid' or 'uuid' is required for OSSP-UUID])])])
+fi
+AC_SUBST(OSSP_UUID_LIBS)
+
 
 ##
 ## Header files
@@ -899,6 +908,13 @@ if test "$with_bonjour" = yes ; then
   AC_CHECK_HEADER(DNSServiceDiscovery/DNSServiceDiscovery.h, [], [AC_MSG_ERROR([header file <DNSServiceDiscovery/DNSServiceDiscovery.h> is required for Bonjour])])
 fi
 
+# for contrib/uuid-ossp
+if test "$with_ossp_uuid" = yes ; then
+  AC_CHECK_HEADERS(ossp/uuid.h, [], [
+    AC_CHECK_HEADERS(uuid.h, [],
+      [AC_MSG_ERROR([header file <ossp/uuid.h> or <uuid.h> is required for OSSP-UUID])])])
+fi
+
 
 ##
 ## Types, structures, compiler characteristics
@@ -1072,7 +1088,7 @@ fi
 pgac_save_LIBS="$LIBS"
 LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
 
-AC_REPLACE_FUNCS([crypt fseeko getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul unsetenv])
+AC_REPLACE_FUNCS([crypt getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul unsetenv])
 
 LIBS="$pgac_save_LIBS"
 
@@ -1087,23 +1103,21 @@ else
   AC_LIBOBJ(getaddrinfo)
 fi
 
-# similarly, use system's getopt_long() only if system provides struct option.
-if test x"$ac_cv_type_struct_option" = xyes ; then
+# Similarly, use system's getopt_long() only if system provides struct option.
+# Solaris' getopt() doesn't do what we want for long options, so always use
+# our versions on that platform.
+if test "$PORTNAME" = "solaris"; then
+  AC_LIBOBJ(getopt)
+  AC_LIBOBJ(getopt_long)
+elif test x"$ac_cv_type_struct_option" = xyes ; then
   AC_REPLACE_FUNCS([getopt_long])
 else
   AC_LIBOBJ(getopt_long)
 fi
 
-# BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos
-# We override the previous test that said fseeko/ftello didn't exist
-# OS tests are also done in include/c.h and port/fseeko.c
-case $host_os in bsdi*|netbsd*)
-ac_cv_func_fseeko=yes
-esac
-
 # Win32 support
 if test "$PORTNAME" = "win32"; then
-AC_LIBOBJ(gettimeofday)
+AC_REPLACE_FUNCS(gettimeofday)
 AC_LIBOBJ(kill)
 AC_LIBOBJ(open)
 AC_LIBOBJ(rand)
@@ -1152,7 +1166,16 @@ AC_CHECK_FUNCS(atexit, [],
                [AC_CHECK_FUNCS(on_exit, [],
                [AC_MSG_ERROR([neither atexit() nor on_exit() found])])])
 
-AC_FUNC_FSEEKO
+AC_REPLACE_FUNCS(fseeko)
+case $host_os in
+       # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos
+       bsdi*|netbsd*)
+               AC_DEFINE(HAVE_FSEEKO, 1, [Define to 1 because replacement version used.])
+               ac_cv_func_fseeko=yes;;
+       *)
+               AC_FUNC_FSEEKO;;
+esac
+
 
 #
 # Pthreads
@@ -1345,26 +1368,59 @@ AC_CHECK_SIZEOF([unsigned long])
 # And one for the size of size_t (enables tweaks for > 32bit address space)
 AC_CHECK_SIZEOF([size_t])
 
+# Decide whether float4 is passed by value: user-selectable, enabled by default
+AC_MSG_CHECKING([whether to build with float4 passed by value])   
+PGAC_ARG_BOOL(enable, float4-byval, yes, [  --disable-float4-byval  disable float4 passed by value],
+              [AC_DEFINE([USE_FLOAT4_BYVAL], 1,
+                         [Define to 1 if you want float4 values to be passed by value. (--enable-float4-byval)])
+               float4passbyval=true],
+              [float4passbyval=false])
+AC_MSG_RESULT([$enable_float4_byval])
+AC_DEFINE_UNQUOTED([FLOAT4PASSBYVAL], [$float4passbyval], [float4 values are passed by value if 'true', by reference if 'false'])
+
+# Decide whether float8 is passed by value.
+# Note: this setting also controls int8 and related types such as timestamp.
+# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
+# If not, trying to select it is an error.
+AC_MSG_CHECKING([whether to build with float8 passed by value])   
+if test $ac_cv_sizeof_unsigned_long -ge 8 ; then
+  PGAC_ARG_BOOL(enable, float8-byval, yes, [  --disable-float8-byval  disable float8 passed by value])
+else
+  PGAC_ARG_BOOL(enable, float8-byval, no, [  --disable-float8-byval  disable float8 passed by value])
+  if test "$enable_float8_byval" = yes ; then
+    AC_MSG_ERROR([--enable-float8-byval is not supported on 32-bit platforms.])
+  fi
+fi
+if test "$enable_float8_byval" = yes ; then
+  AC_DEFINE([USE_FLOAT8_BYVAL], 1,
+            [Define to 1 if you want float8, int8, etc values to be passed by value. (--enable-float8-byval)])
+  float8passbyval=true
+else
+  float8passbyval=false
+fi
+AC_MSG_RESULT([$enable_float8_byval])
+AC_DEFINE_UNQUOTED([FLOAT8PASSBYVAL], [$float8passbyval], [float8, int8, and related values are passed by value if 'true', by reference if 'false'])
+
 # Determine memory alignment requirements for the basic C data types.
 
-PGAC_CHECK_ALIGNOF(short)
-PGAC_CHECK_ALIGNOF(int)
-PGAC_CHECK_ALIGNOF(long)
+AC_CHECK_ALIGNOF(short)
+AC_CHECK_ALIGNOF(int)
+AC_CHECK_ALIGNOF(long)
 if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
-  PGAC_CHECK_ALIGNOF(long long int)
+  AC_CHECK_ALIGNOF(long long int)
 fi
-PGAC_CHECK_ALIGNOF(double)
+AC_CHECK_ALIGNOF(double)
 
 # 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.
 
-MAX_ALIGNOF=$pgac_cv_alignof_long
-if test $MAX_ALIGNOF -lt $pgac_cv_alignof_double ; then
-  MAX_ALIGNOF=$pgac_cv_alignof_double
+MAX_ALIGNOF=$ac_cv_alignof_long
+if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then
+  MAX_ALIGNOF=$ac_cv_alignof_double
 fi
-if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $pgac_cv_alignof_long_long_int ; then
-  MAX_ALIGNOF="$pgac_cv_alignof_long_long_int"
+if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ; then
+  MAX_ALIGNOF="$ac_cv_alignof_long_long_int"
 fi
 AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignment requirement of any C data type.])
 
@@ -1382,6 +1438,20 @@ AC_CHECK_TYPES([int8, uint8, int64, uint64], [], [],
 AC_CHECK_TYPES(sig_atomic_t, [], [], [#include <signal.h>])
 
 
+# If the user did not disable integer datetimes, check that
+# there is a working 64-bit integral type to use.
+if test x"$USE_INTEGER_DATETIMES" = x"yes" &&
+   test x"$HAVE_LONG_INT_64" = x"no" &&
+   test x"$HAVE_LONG_LONG_INT_64" = x"no" &&
+   test x"$HAVE_INT64" = x"no" ; then
+  AC_MSG_ERROR([
+Integer-based datetime support requires a 64-bit integer type,
+but no such type could be found. The --disable-integer-datetimes
+configure option can be used to disable integer-based storage
+of datetime values.])
+fi
+
+
 if test "$PORTNAME" != "win32"
 then
 PGAC_FUNC_POSIX_SIGNALS
@@ -1396,6 +1466,13 @@ if test $ac_cv_func_fseeko = yes; then
 AC_SYS_LARGEFILE
 fi
 
+# Check for largefile support (must be after AC_SYS_LARGEFILE)
+AC_CHECK_SIZEOF([off_t])
+
+if test "$ac_cv_sizeof_off_t" -lt 8 -o "$enable_segmented_files" = "yes"; then 
+  AC_DEFINE([USE_SEGMENTED_FILES], 1, [Define to split data files into 1GB segments.]) 
+fi
+
 # SunOS doesn't handle negative byte comparisons properly with +/- return
 AC_FUNC_MEMCMP