configure.ac: use AC_SYS_LARGEFILE to determine how to enable 64-bit file size support

Defining -D_FILE_OFFSET_BITS=64 works on most platforms, but not on all (i.e.
Solaris). Also, the Autoconf macro offers the user a switch to disable the
functionality in case of problems.
This commit is contained in:
Peter Simons 2009-10-06 09:14:06 +00:00
parent 96f1517831
commit 18f0ff003d

View file

@ -55,7 +55,7 @@ test "$localstatedir" = '${prefix}/var' && localstatedir=/nix/var
# except that it requires the ATerm "lib" directory to be in $PATH, as # except that it requires the ATerm "lib" directory to be in $PATH, as
# Windows doesn't have anything like an RPATH embedded in executable. # Windows doesn't have anything like an RPATH embedded in executable.
# Since this is kind of annoying, we use static libraries for now. # Since this is kind of annoying, we use static libraries for now.
AC_ARG_ENABLE(static-nix, AC_HELP_STRING([--enable-static-nix], AC_ARG_ENABLE(static-nix, AC_HELP_STRING([--enable-static-nix],
[produce statically linked binaries]), [produce statically linked binaries]),
static_nix=$enableval, static_nix=no) static_nix=$enableval, static_nix=no)
@ -63,13 +63,13 @@ AC_ARG_ENABLE(static-nix, AC_HELP_STRING([--enable-static-nix],
if test "$sys_name" = cygwin; then if test "$sys_name" = cygwin; then
static_nix=yes static_nix=yes
fi fi
if test "$static_nix" = yes; then if test "$static_nix" = yes; then
AC_DISABLE_SHARED AC_DISABLE_SHARED
AC_ENABLE_STATIC AC_ENABLE_STATIC
fi fi
# Windows-specific stuff. # Windows-specific stuff.
if test "$sys_name" = "cygwin"; then if test "$sys_name" = "cygwin"; then
# We cannot delete open files. # We cannot delete open files.
@ -88,8 +88,7 @@ AC_PROG_LIBTOOL
# Use 64-bit file system calls so that we can support files > 2 GiB. # Use 64-bit file system calls so that we can support files > 2 GiB.
CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS" AC_SYS_LARGEFILE
CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS"
# Check for pubsetbuf. # Check for pubsetbuf.
@ -259,7 +258,7 @@ else
bzip2_include="-I$bzip2/include" bzip2_include="-I$bzip2/include"
bzip2_bin="$bzip2/bin" bzip2_bin="$bzip2/bin"
bzip2_bin_test="$bzip2/bin" bzip2_bin_test="$bzip2/bin"
fi fi
AC_SUBST(bzip2_lib) AC_SUBST(bzip2_lib)
AC_SUBST(bzip2_include) AC_SUBST(bzip2_include)
AC_SUBST(bzip2_bin) AC_SUBST(bzip2_bin)