dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.542 2008/01/01 19:45:44 momjian 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
dnl
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
-AC_INIT([PostgreSQL], [8.3beta4], [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.])])
## 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
#
#
-# 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])
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
#
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.
#
# OSSP UUID library
#
-PGAC_ARG_BOOL(with, ossp-uuid, no, [ --with-ossp-uuid use OSSP UUID library when building /contrib/uuid-ossp ])
+PGAC_ARG_BOOL(with, ossp-uuid, no, [ --with-ossp-uuid use OSSP UUID library when building contrib/uuid-ossp])
AC_SUBST(with_ossp_uuid)
#
# XSLT
#
-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)])])
+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)
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"
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)
[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
# 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.])
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
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