Large files support on FreeBSD

Russ Allbery rra at stanford.edu
Sun Mar 22 18:59:33 UTC 2009


Johan van Selst <johans at stack.nl> writes:

> But fseeko and ftello have been in FreeBSD for almost 10 years now
> (since 3.2, and definately in 6.2). So there shouldn't be a reason to
> use INN's alternative function here. Could it be that a configure check
> fails?
>
> The relevant part of the configure script seems to be:
>
>  dnl Probe for fseeko and ftello, which take off_t instead of int.
>  if test x"$inn_enable_largefiles" = xyes ; then
>      AC_FUNC_FSEEKO
>      if test x"$ac_cv_func_fseeko" != xyes ; then
>          INN_TYPE_FPOS_T_LARGE
>          AC_CHECK_DECLS([fseeko, ftello])
>          AC_LIBOBJ([fseeko])
>          AC_LIBOBJ([ftello])
>      fi
>  else
>      AC_CHECK_DECLS([fseeko])
>  fi
>
> But AC_FUNC_FSEEKO never sets $ac_cv_func_fseeko(!), even if fseeko is
> defined (it does define HAVE_FSEEKO, but doesn't seem to set any useful
> shellvariable). So the first check, AC_CHECK_DECLS([fseeko, ftello])
> will always be executed. The result of this isn't checked
> either. Consequently inn will always use its own version of fseeko and
> ftello, even if the operating system defines other alternatives.

Aha!  Autoconf changed under the hood.  It *used* to define
$ac_cv_func_fseeko.  Now it defines ac_cv_sys_largefile_source.  Feh.

The inside of the if should now say:

    AC_FUNC_FSEEKO
    if test x"$ac_cv_sys_largefile_source" != xunknown ; then
        INN_TYPE_FPOS_T_LARGE
        AC_CHECK_DECLS([fseeko, ftello])
        AC_LIBOBJ([fseeko])
        AC_LIBOBJ([ftello])
    fi

Could someone try that on a BSD system and see if it then works?

This of course is going to just break again later when they change the
internals again, since there's no defined interface.  I should probably
complain at the Autoconf mailing list.

We'll probably need to bump the Autoconf version requirement to something
with this change.  It looks like 2.62 should be good (although that may be
a bit conservative).

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>



More information about the inn-workers mailing list