dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.522 2007/07/19 17:15:30 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
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)
## 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
#
AC_PROG_CC([$pgac_cc_list])
+# Check if it's Intel's compiler, which (usually) pretends to be gcc,
+# but has idiosyncrasies of its own. We assume icc will define
+# __INTEL_COMPILER regardless of CFLAGS.
+AC_TRY_COMPILE([], [@%:@ifndef __INTEL_COMPILER
+choke me
+@%:@endif], [ICC=[yes]], [ICC=[no]])
+
unset CFLAGS
#
# 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"
-
- 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
+if test "$GCC" = yes -a "$ICC" = no; then
+ CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
+ # These work in some but not all gcc versions
+ PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement])
+ 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.
+ PGAC_PROG_CC_CFLAGS_OPT([-mp1])
+ # Make sure strict aliasing is off (though this is said to be the default)
+ PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])
elif test x"${CC}" = x"xlc"; then
# AIX xlc has to have strict aliasing turned off too
PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias])
if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
if test "$GCC" = yes; then
AC_DEFINE([PROFILE_PID_DIR], 1,
- [Define to 1 to enable profiling. (--enable-profiling)])
- CFLAGS="$CFLAGS -pg"
+ [Define to 1 to allow profiling output to be saved separately for each process.])
+ CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS"
else
AC_MSG_ERROR([--enable-profiling is supported only when using GCC])
fi
#
# 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)
#
# 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)
+#
+# tzdata
+#
+PGAC_ARG_REQ(with, system-tzdata,
+ [ --with-system-tzdata=DIR use system time zone data in DIR])
+AC_SUBST(with_system_tzdata)
+
#
# Zlib
#
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
if test "$with_openssl" = yes ; then
AC_CHECK_HEADER(openssl/ssl.h, [], [AC_MSG_ERROR([header file <openssl/ssl.h> is required for OpenSSL])])
AC_CHECK_HEADER(openssl/err.h, [], [AC_MSG_ERROR([header file <openssl/err.h> is required for OpenSSL])])
+ AC_CHECK_FUNCS([ERR_set_mark])
fi
if test "$with_pam" = 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
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_LIBOBJ(gettimeofday)
+AC_REPLACE_FUNCS(gettimeofday)
AC_LIBOBJ(kill)
AC_LIBOBJ(open)
AC_LIBOBJ(rand)
[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