Commit a6c75be2 authored by Tom Lane's avatar Tom Lane

Re-order configure tests to reflect the fact that the code generated for

posix_fadvise and other file-related functions can depend on _LARGEFILE_SOURCE
and/or _FILE_OFFSET_BITS.  Per report from Robert Treat.

Back-patch to 8.4.  This has been wrong all along, but we weren't really using
posix_fadvise in anger before, and AC_FUNC_FSEEKO seems to mask the issue well
enough for that function.
parent 196a6ca5
This source diff could not be displayed because it is too large. You can view the blob instead.
dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.620 2010/01/07 03:24:57 tgl Exp $
dnl $PostgreSQL: pgsql/configure.in,v 1.621 2010/01/16 19:50:26 tgl Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
......@@ -1144,6 +1144,20 @@ AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
fi
# Check largefile support. You might think this is a system service not a
# compiler characteristic, but you'd be wrong. We must check this before
# probing existence of related functions such as fseeko, since the largefile
# defines can affect what is generated for that.
AC_SYS_LARGEFILE
# Check for largefile support (must be after AC_SYS_LARGEFILE)
AC_CHECK_SIZEOF([off_t])
# If we don't have largefile support, can't handle segsize >= 2GB.
if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
AC_MSG_ERROR([Large file support is not enabled. Segment size cannot be larger than 1GB.])
fi
##
## Functions, global variables
......@@ -1155,6 +1169,17 @@ PGAC_FUNC_GETTIMEOFDAY_1ARG
AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getifaddrs getpeereid getpeerucred getrlimit memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs])
AC_REPLACE_FUNCS(fseeko)
case $host_os in
# BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos
# 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;;
*)
AC_FUNC_FSEEKO;;
esac
# 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
......@@ -1367,17 +1392,6 @@ AC_CHECK_FUNCS(atexit, [],
[AC_CHECK_FUNCS(on_exit, [],
[AC_MSG_ERROR([neither atexit() nor on_exit() found])])])
AC_REPLACE_FUNCS(fseeko)
case $host_os in
# BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos
# 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;;
*)
AC_FUNC_FSEEKO;;
esac
#
# Pthreads
......@@ -1651,18 +1665,6 @@ operating system; use --disable-thread-safety to disable thread safety.])
fi
fi
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 we don't have largefile support, can't handle segsize >= 2GB.
if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then
AC_MSG_ERROR([Large file support is not enabled. Segment size cannot be larger than 1GB.])
fi
# SunOS doesn't handle negative byte comparisons properly with +/- return
AC_FUNC_MEMCMP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment