dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.580 2009/01/06 03:05:23 momjian Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.595 2009/04/10 00:20:10 scrappy 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.4devel], [pgsql-bugs@postgresql.org])
+AC_INIT([PostgreSQL], [8.4beta1], [pgsql-bugs@postgresql.org])
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
To try a manual configuration, look into the src/template directory
for a similar platform and use the '--with-template=' option.
-Please also contact <pgsql-ports@postgresql.org> to see about
+Please also contact <pgsql-bugs@postgresql.org> to see about
rectifying this. Include the above 'checking host system type...'
line.
*******************************************************************
# else: If the template file set something, that is used.
# else: If coverage was enabled, don't set anything.
# else: If the compiler is GCC, then we use -O2.
-# else: If the compiler is something else, then we use -O.
+# else: If the compiler is something else, then we use -O, unless debugging.
if test "$ac_env_CFLAGS_set" = set; then
CFLAGS=$ac_env_CFLAGS_value
# Some versions of GCC support some additional useful warning flags.
# Check whether they are supported, and add them to CFLAGS if so.
-# ICC pretends to be GCC but it's lying; it doesn't support these options.
+# ICC pretends to be GCC but it's lying; it doesn't support these flags,
+# but has its own. Also check other compiler-specific flags here.
if test "$GCC" = yes -a "$ICC" = no; then
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith"
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
+elif test "$PORTNAME" = "aix"; then
+ # AIX's xlc has to have strict aliasing turned off too
PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias])
fi
AC_PROG_CPP
AC_SUBST(GCC)
-# Create compiler version string
-if test x"$GCC" = x"yes" ; then
- cc_string="GCC `${CC} --version | sed q`"
-else
- cc_string=$CC
-fi
-AC_CHECK_SIZEOF([void *])
-
-AC_DEFINE_UNQUOTED(PG_VERSION_STR,
- ["PostgreSQL $PACKAGE_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
- [A string containing the version number, platform, and C compiler])
-
#
# Set up TAS assembly code if needed; the template file has now had its
fi
fi
-# Supply a numeric version string for use by 3rd party add-ons
-# awk -F is a regex on some platforms, and not on others, so make "." a tab
-[PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
-tr '.' ' ' |
-$AWK '{printf "%d%02d%02d", $1, $2, (NF >= 3) ? $3 : 0}'`"]
-AC_DEFINE_UNQUOTED(PG_VERSION_NUM, $PG_VERSION_NUM, [PostgreSQL version as a number])
##
## Libraries
AC_SEARCH_LIBS(crypt, crypt)
# Solaris:
AC_SEARCH_LIBS(fdatasync, [rt posix4])
+# Required for thread_test.c on Solaris 2.5:
+# Other ports use it too (HP-UX) so test unconditionally
+AC_SEARCH_LIBS(gethostbyname_r, nsl)
# Cygwin:
AC_SEARCH_LIBS(shmget, cygipc)
AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getpeereid getpeerucred getrlimit memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs])
-AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
+# posix_fadvise() is a no-op on Solaris, so don't incur function overhead
+# by calling it, 2009-04-02
+# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c
+if test "$PORTNAME" != "solaris"; then
+AC_CHECK_FUNCS(posix_fadvise)
AC_CHECK_DECLS(posix_fadvise, [], [], [#include <fcntl.h>])
+fi
+
+AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
AC_CHECK_DECLS([strlcat, strlcpy])
# This is probably only present on Darwin, but may as well check always
AC_CHECK_DECLS(F_FULLFSYNC, [], [], [#include <fcntl.h>])
pgac_save_LIBS="$LIBS"
LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
-AC_REPLACE_FUNCS([crypt 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])
+
+case $host_os in
+
+ # Windows uses a specialised env handler
+ mingw*)
+ AC_DEFINE(HAVE_UNSETENV, 1, [Define to 1 because replacement version used.])
+ ac_cv_func_unsetenv=yes;;
+ *)
+ AC_REPLACE_FUNCS([unsetenv])
+ ;;
+esac
+
LIBS="$pgac_save_LIBS"
fi
# 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
+if test x"$ac_cv_type_struct_option" = xyes ; then
AC_REPLACE_FUNCS([getopt_long])
else
AC_LIBOBJ(getopt_long)
fi
+# Solaris' getopt() doesn't do what we want for long options, so always use
+# our version on that platform.
+if test "$PORTNAME" = "solaris"; then
+ AC_LIBOBJ(getopt)
+fi
+
# Win32 support
if test "$PORTNAME" = "win32"; then
AC_REPLACE_FUNCS(gettimeofday)
AC_LIBOBJ(kill)
AC_LIBOBJ(open)
AC_LIBOBJ(rand)
+AC_LIBOBJ(win32env)
AC_LIBOBJ(win32error)
AC_DEFINE([HAVE_SYMLINK], 1,
[Define to 1 if you have the `symlink' function.])
[AC_CHECK_HEADER(syslog.h,
[AC_DEFINE(HAVE_SYSLOG, 1, [Define to 1 if you have the syslog interface.])])])
+AC_CACHE_CHECK([for opterr], pgac_cv_var_int_opterr,
+[AC_TRY_LINK([#include <unistd.h>],
+ [extern int opterr; opterr = 1;],
+ [pgac_cv_var_int_opterr=yes],
+ [pgac_cv_var_int_opterr=no])])
+if test x"$pgac_cv_var_int_opterr" = x"yes"; then
+ AC_DEFINE(HAVE_INT_OPTERR, 1, [Define to 1 if you have the global variable 'int opterr'.])
+fi
+
AC_CACHE_CHECK([for optreset], pgac_cv_var_int_optreset,
[AC_TRY_LINK([#include <unistd.h>],
[extern int optreset; optreset = 1;],
AC_REPLACE_FUNCS(fseeko)
case $host_os in
# BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos
- bsdi*|netbsd*)
+ # Mingw uses macros to access Win32 API calls
+ bsdi*|netbsd*|mingw*)
AC_DEFINE(HAVE_FSEEKO, 1, [Define to 1 because replacement version used.])
ac_cv_func_fseeko=yes;;
*)
# Need a #define for the size of Datum (unsigned long)
AC_CHECK_SIZEOF([unsigned long])
-# And one for the size of size_t (enables tweaks for > 32bit address space)
+# And check size of void *, size_t (enables tweaks for > 32bit address space)
+AC_CHECK_SIZEOF([void *])
AC_CHECK_SIZEOF([size_t])
# Decide whether float4 is passed by value: user-selectable, enabled by default
AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
+# Create compiler version string
+if test x"$GCC" = x"yes" ; then
+ cc_string="GCC `${CC} --version | sed q`"
+elif test x"$SUN_STUDIO_CC" = x"yes" ; then
+ cc_string=`${CC} -V 2>&1 | sed q`
+else
+ cc_string=$CC
+fi
+
+AC_DEFINE_UNQUOTED(PG_VERSION_STR,
+ ["PostgreSQL $PACKAGE_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
+ [A string containing the version number, platform, and C compiler])
+
+# Supply a numeric version string for use by 3rd party add-ons
+# awk -F is a regex on some platforms, and not on others, so make "." a tab
+[PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
+tr '.' ' ' |
+$AWK '{printf "%d%02d%02d", $1, $2, (NF >= 3) ? $3 : 0}'`"]
+AC_DEFINE_UNQUOTED(PG_VERSION_NUM, $PG_VERSION_NUM, [PostgreSQL version as a number])
+
+
# prepare build tree if outside source tree
# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
# Note 2: /bin/pwd might be better than shell's built-in at getting
echo >src/include/stamp-h
])
-AC_CONFIG_HEADERS([src/interfaces/ecpg/include/ecpg_config.h])
+AC_CONFIG_HEADERS([src/interfaces/ecpg/include/ecpg_config.h],
+ [echo >src/interfaces/ecpg/include/stamp-h])
AC_OUTPUT