]> 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 8ef5c738379f5ef4ddf17f6c04a4dae6f59daa6c..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.546 2008/02/01 04:16:29 scrappy 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,9 +17,9 @@ dnl Read the Autoconf manual for details.
 dnl
 m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
 
-AC_INIT([PostgreSQL], [8.3.0], [pgsql-bugs@postgresql.org])
+AC_INIT([PostgreSQL], [8.4devel], [pgsql-bugs@postgresql.org])
 
-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.59], [], [m4_fatal([Autoconf version 2.59 is required.
+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.])])
@@ -111,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
 #
@@ -140,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])
@@ -229,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
 #
@@ -290,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.
@@ -1092,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"
 
@@ -1107,20 +1103,18 @@ 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_REPLACE_FUNCS(gettimeofday)
@@ -1172,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
@@ -1365,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.])
 
@@ -1402,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
@@ -1416,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