Mercurial > emacs
comparison aclocal.m4 @ 34426:14bff16f1d37
(AC_SYS_LARGEFILE, AC_SYS_LARGEFILE_MACRO_VALUE):
Merge fixes from latest GNU tar version. These macros no longer
futz with _XOPEN_SOURCE, as that was not portable in practice.
(AC_FUNC_FSEEKO): New macro.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 11 Dec 2000 11:54:38 +0000 |
parents | b7463306b3ac |
children | b5a4db21c424 |
comparison
equal
deleted
inserted
replaced
34425:70795abe8c40 | 34426:14bff16f1d37 |
---|---|
299 dnl Internal subroutine of AC_SYS_LARGEFILE. | 299 dnl Internal subroutine of AC_SYS_LARGEFILE. |
300 dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY) | 300 dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY) |
301 AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE, | 301 AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE, |
302 [AC_CACHE_CHECK([for $1 value needed for large files], $3, | 302 [AC_CACHE_CHECK([for $1 value needed for large files], $3, |
303 [$3=no | 303 [$3=no |
304 AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES | 304 AC_TRY_COMPILE([$5], |
305 $5 | |
306 , | |
307 [$6], | 305 [$6], |
308 , | 306 , |
309 [AC_TRY_COMPILE([#define $1 $2] | 307 [AC_TRY_COMPILE([#define $1 $2] |
310 AC_SYS_LARGEFILE_TEST_INCLUDES | 308 [$5] |
311 $5 | |
312 , | 309 , |
313 [$6], | 310 [$6], |
314 [$3=$2])])]) | 311 [$3=$2])])]) |
315 if test "[$]$3" != no; then | 312 if test "[$]$3" != no; then |
316 AC_DEFINE_UNQUOTED([$1], [$]$3, [$4]) | 313 AC_DEFINE_UNQUOTED([$1], [$]$3, [$4]) |
317 fi]) | 314 fi]) |
318 | 315 |
319 AC_DEFUN(AC_SYS_LARGEFILE, | 316 AC_DEFUN(AC_SYS_LARGEFILE, |
320 [AC_ARG_ENABLE(largefile, | 317 [AC_REQUIRE([AC_PROG_CC]) |
318 AC_ARG_ENABLE(largefile, | |
321 [ --disable-largefile omit support for large files]) | 319 [ --disable-largefile omit support for large files]) |
322 if test "$enable_largefile" != no; then | 320 if test "$enable_largefile" != no; then |
323 | 321 |
324 AC_CACHE_CHECK([for special C compiler options needed for large files], | 322 AC_CACHE_CHECK([for special C compiler options needed for large files], |
325 ac_cv_sys_largefile_CC, | 323 ac_cv_sys_largefile_CC, |
338 CC="$CC$ac_cv_sys_largefile_CC" | 336 CC="$CC$ac_cv_sys_largefile_CC" |
339 fi | 337 fi |
340 | 338 |
341 AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, | 339 AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, |
342 ac_cv_sys_file_offset_bits, | 340 ac_cv_sys_file_offset_bits, |
343 [Number of bits in a file offset, on hosts where this is settable.]) | 341 [Number of bits in a file offset, on hosts where this is settable.], |
344 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, | 342 AC_SYS_LARGEFILE_TEST_INCLUDES) |
345 ac_cv_sys_largefile_source, | |
346 [Define to make ftello visible on some hosts (e.g. HP-UX 10.20).], | |
347 [#include <stdio.h>], [return !ftello;]) | |
348 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, | 343 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, |
349 ac_cv_sys_large_files, | 344 ac_cv_sys_large_files, |
350 [Define for large files, on AIX-style hosts.]) | 345 [Define for large files, on AIX-style hosts.] |
351 AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500, | 346 AC_SYS_LARGEFILE_TEST_INCLUDES) |
352 ac_cv_sys_xopen_source, | |
353 [Define to make ftello visible on some hosts (e.g. glibc 2.1.3).], | |
354 [#include <stdio.h>], [return !ftello;]) | |
355 fi | 347 fi |
356 ]) | 348 ]) |
349 | |
350 AC_DEFUN(AC_FUNC_FSEEKO, | |
351 [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, | |
352 ac_cv_sys_largefile_source, | |
353 [Define to make fseeko visible on some hosts (e.g. glibc 2.2).], | |
354 [#include <stdio.h>], [return !fseeko;]) | |
355 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug | |
356 # in glibc 2.1.3, but that breaks too many other things. | |
357 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. | |
358 | |
359 AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko, | |
360 [ac_cv_func_fseeko=no | |
361 AC_TRY_LINK([#include <stdio.h>], | |
362 [return fseeko && fseeko (stdin, 0, 0);], | |
363 [ac_cv_func_fseeko=yes])]) | |
364 if test $ac_cv_func_fseeko != no; then | |
365 AC_DEFINE(HAVE_FSEEKO, 1, | |
366 [Define if fseeko (and presumably ftello) exists and is declared.]) | |
367 fi]) | |
357 | 368 |
358 undefine([AC_FUNC_MMAP])dnl | 369 undefine([AC_FUNC_MMAP])dnl |
359 dnl The autoconf 2.13 version loses on OSF, at least, | 370 dnl The autoconf 2.13 version loses on OSF, at least, |
360 dnl by messing up the declaration of malloc. | 371 dnl by messing up the declaration of malloc. |
361 AC_DEFUN([AC_FUNC_MMAP], | 372 AC_DEFUN([AC_FUNC_MMAP], |