configure.ac: Fix detection of Large File Support

Support for files over 2 gigabytes has been broken for some time on
32 bit systems and no one noticed.
This commit is contained in:
Erik de Castro Lopo 2016-11-14 18:14:41 +11:00
parent d92d86cc3f
commit e4572180c3

View File

@ -155,8 +155,6 @@ AC_CHECK_SIZEOF(long long,8)
# Check for common 64 bit file offset types. # Check for common 64 bit file offset types.
AC_CHECK_SIZEOF(off_t,1) AC_CHECK_SIZEOF(off_t,1)
AC_CHECK_SIZEOF(loff_t,1)
AC_CHECK_SIZEOF(off64_t,1)
if test "$enable_largefile:$ac_cv_sizeof_off_t" = "no:8" ; then if test "$enable_largefile:$ac_cv_sizeof_off_t" = "no:8" ; then
echo echo
@ -165,7 +163,6 @@ if test "$enable_largefile:$ac_cv_sizeof_off_t" = "no:8" ; then
exit 1 exit 1
fi fi
case "$host_os" in case "$host_os" in
mingw32*) mingw32*)
TYPEOF_SF_COUNT_T="__int64" TYPEOF_SF_COUNT_T="__int64"
@ -180,14 +177,6 @@ case "$host_os" in
TYPEOF_SF_COUNT_T="int64_t" TYPEOF_SF_COUNT_T="int64_t"
SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
SIZEOF_SF_COUNT_T=8 SIZEOF_SF_COUNT_T=8
elif test "x$ac_cv_sizeof_loff_t" = "x8" ; then
TYPEOF_SF_COUNT_T="int64_t"
SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
SIZEOF_SF_COUNT_T=8
elif test "x$ac_cv_sizeof_off64_t" = "x8" ; then
TYPEOF_SF_COUNT_T="int64_t"
SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
SIZEOF_SF_COUNT_T=8
else else
# Save the old sizeof (off_t) value and then unset it to see if it # Save the old sizeof (off_t) value and then unset it to see if it
# changes when Large File Support is enabled. # changes when Large File Support is enabled.
@ -195,7 +184,6 @@ case "$host_os" in
unset ac_cv_sizeof_off_t unset ac_cv_sizeof_off_t
AC_SYS_LARGEFILE AC_SYS_LARGEFILE
if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then
ac_cv_sys_largefile_CFLAGS="" ac_cv_sys_largefile_CFLAGS=""
fi fi
@ -211,6 +199,7 @@ case "$host_os" in
if test "x$ac_cv_sizeof_off_t" = "x8" ; then if test "x$ac_cv_sizeof_off_t" = "x8" ; then
TYPEOF_SF_COUNT_T="int64_t" TYPEOF_SF_COUNT_T="int64_t"
SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL"
SIZEOF_SF_COUNT_T=8
elif test "x$TYPEOF_SF_COUNT_T" = "xunknown" ; then elif test "x$TYPEOF_SF_COUNT_T" = "xunknown" ; then
echo echo
echo "*** The configure process has determined that this system is capable" echo "*** The configure process has determined that this system is capable"