whether fseeko and ftello are properly declared.
* acfunctions.m4 (AC_FUNC_FSEEKO): New macro, which worries about
fseeko (and presumably ftello). Do not set _XOPEN_SOURCE; that
causes too many problems in practice.
* acfunctions (fteelo, fseeko): Trigger AC_FUNC_FSEEKO.
* doc/autoconf.texi: Adjust.
+2000-11-14 Paul Eggert <eggert@twinsun.com>
+
+ * acspecific.m4 (AC_SYS_LARGEFILE): Don't worry about
+ whether fseeko and ftello are properly declared.
+ * acfunctions.m4 (AC_FUNC_FSEEKO): New macro, which worries about
+ fseeko (and presumably ftello). Do not set _XOPEN_SOURCE; that
+ causes too many problems in practice.
+ * acfunctions (fteelo, fseeko): Trigger AC_FUNC_FSEEKO.
+ * doc/autoconf.texi: Adjust.
+
2000-11-14 Akim Demaille <akim@epita.fr>
* doc/autoconf.texi (Limitations of Builtins): Comment `true'.
** Specific Macros
- AC_FUNC_CHOWN, AC_FUNC_MALLOC, AC_FUNC_STRERROR_R,
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, AC_FUNC_STAT, AC_FUNC_LSTAT,
- AC_FUNC_ERROR_AT_LINE, AC_FUNC_OBSTACK, AC_FUNC_STRTOD.
+ AC_FUNC_ERROR_AT_LINE, AC_FUNC_OBSTACK, AC_FUNC_STRTOD, AC_FUNC_FSEEKO.
New.
- AC_FUNC_GETGROUPS
error AC_FUNC_ERROR_AT_LINE
error_at_line AC_FUNC_ERROR_AT_LINE
fnmatch AC_FUNC_FNMATCH
+fseeko AC_FUNC_FSEEKO
+ftello AC_FUNC_FSEEKO
getgroups AC_FUNC_GETGROUPS
getloadavg AC_FUNC_GETLOADAVG
getpgrp AC_FUNC_GETPGRP
AU_ALIAS([fp_FUNC_FNMATCH], [AC_FUNC_FNMATCH])
+# AC_FUNC_FSEEKO
+# --------------
+AC_DEFUN([AC_FUNC_FSEEKO],
+[_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
+ [ac_cv_sys_largefile_source],
+ [Define to make fseeko visible on some hosts (e.g. HP-UX 10.20).],
+ [@%:@include <stdio.h>], [return !fseeko;])
+
+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
+# in glibc 2.1.3, but that breaks too many other things.
+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
+AC_CACHE_CHECK([for fseeko], [ac_cv_func_fseeko],
+ [AC_TRY_LINK([@%:@include <stdio.h>],
+ [return fseeko && fseeko (stdin, 0, 0);],
+ [ac_cv_func_fseeko=yes],
+ [ac_cv_func_fseeko=no])])
+if test $ac_cv_func_fseeko = yes; then
+ AC_DEFINE(HAVE_FSEEKO, 1,
+ [Define if fseeko (and presumably ftello) exists and is declared.])
+fi
+])# AC_FUNC_FSEEKO
+
+
# AC_FUNC_GETGROUPS
# -----------------
# Try to find `getgroups', and check that it works.
_AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
ac_cv_sys_file_offset_bits,
[Number of bits in a file offset, on hosts where this is settable.])
- _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
- ac_cv_sys_largefile_source,
- [Define to make ftello visible on some hosts (e.g. HP-UX 10.20).],
- [@%:@include <stdio.h>], [return !ftello;])
_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
ac_cv_sys_large_files,
[Define for large files, on AIX-style hosts.])
- _AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500,
- ac_cv_sys_xopen_source,
- [Define to make ftello visible on some hosts (e.g. glibc 2.1.3).],
- [@%:@include <stdio.h>], [return !ftello;])
fi
])# AC_SYS_LARGEFILE
SunOS 5.4), define @code{HAVE_FNMATCH}.
@end defmac
+@defmac AC_FUNC_FSEEKO
+@maindex FUNC_FSEEKO
+@cvindex _LARGEFILE_SOURCE
+If the @code{fseeko} function is available, define @code{HAVE_FSEEKO}.
+Define @code{_LARGEFILE_SOURCE} if necessary.
+@end defmac
+
@defmac AC_FUNC_GETGROUPS
@maindex FUNC_GETGROUPS
@ovindex GETGROUPS_LIBS
@defmac AC_SYS_LARGEFILE
@maindex SYS_LARGEFILE
@cvindex _FILE_OFFSET_BITS
-@cvindex _LARGEFILE_SOURCE
@cvindex _LARGE_FILES
-@cvindex _XOPEN_SOURCE
@ovindex CC
Arrange for
@uref{http://www.sas.com/standards/large.file/x_open.20Mar96.html,
large-file support}. On some hosts, one must use special compiler
options to build programs that can access large files. Append any such
options to the output variable @code{CC}. Define
-@code{_FILE_OFFSET_BITS}, @code{_LARGEFILE_SOURCE}, @code{_LARGE_FILES},
-and @code{_XOPEN_SOURCE} if necessary.
+@code{_FILE_OFFSET_BITS} and @code{_LARGE_FILES} if necessary.
The user can disable large-file support by configuring with the
@option{--disable-largefile} option.
AU_ALIAS([fp_FUNC_FNMATCH], [AC_FUNC_FNMATCH])
+# AC_FUNC_FSEEKO
+# --------------
+AC_DEFUN([AC_FUNC_FSEEKO],
+[_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
+ [ac_cv_sys_largefile_source],
+ [Define to make fseeko visible on some hosts (e.g. HP-UX 10.20).],
+ [@%:@include <stdio.h>], [return !fseeko;])
+
+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
+# in glibc 2.1.3, but that breaks too many other things.
+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
+AC_CACHE_CHECK([for fseeko], [ac_cv_func_fseeko],
+ [AC_TRY_LINK([@%:@include <stdio.h>],
+ [return fseeko && fseeko (stdin, 0, 0);],
+ [ac_cv_func_fseeko=yes],
+ [ac_cv_func_fseeko=no])])
+if test $ac_cv_func_fseeko = yes; then
+ AC_DEFINE(HAVE_FSEEKO, 1,
+ [Define if fseeko (and presumably ftello) exists and is declared.])
+fi
+])# AC_FUNC_FSEEKO
+
+
# AC_FUNC_GETGROUPS
# -----------------
# Try to find `getgroups', and check that it works.
_AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
ac_cv_sys_file_offset_bits,
[Number of bits in a file offset, on hosts where this is settable.])
- _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
- ac_cv_sys_largefile_source,
- [Define to make ftello visible on some hosts (e.g. HP-UX 10.20).],
- [@%:@include <stdio.h>], [return !ftello;])
_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
ac_cv_sys_large_files,
[Define for large files, on AIX-style hosts.])
- _AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500,
- ac_cv_sys_xopen_source,
- [Define to make ftello visible on some hosts (e.g. glibc 2.1.3).],
- [@%:@include <stdio.h>], [return !ftello;])
fi
])# AC_SYS_LARGEFILE
error AC_FUNC_ERROR_AT_LINE
error_at_line AC_FUNC_ERROR_AT_LINE
fnmatch AC_FUNC_FNMATCH
+fseeko AC_FUNC_FSEEKO
+ftello AC_FUNC_FSEEKO
getgroups AC_FUNC_GETGROUPS
getloadavg AC_FUNC_GETLOADAVG
getpgrp AC_FUNC_GETPGRP
AT_CHECK_MACRO([AC_FUNC_CLOSEDIR_VOID])
AT_CHECK_MACRO([AC_FUNC_ERROR_AT_LINE])
AT_CHECK_MACRO([AC_FUNC_FNMATCH])
+AT_CHECK_MACRO([AC_FUNC_FSEEKO])
AT_CHECK_MACRO([AC_FUNC_GETGROUPS])
AT_CHECK_MACRO([AC_FUNC_GETLOADAVG])
AT_CHECK_MACRO([AC_FUNC_GETMNTENT])