aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--aclocal.m473
1 files changed, 73 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 1c013640eff..0238e0c8cda 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -277,3 +277,76 @@ else
277 AC_MSG_RESULT(no) 277 AC_MSG_RESULT(no)
278fi 278fi
279])# AC_C_PROTOTYPES 279])# AC_C_PROTOTYPES
280
281dnl By default, many hosts won't let programs access large files;
282dnl one must use special compiler options to get large-file access to work.
283dnl For more details about this brain damage please see:
284dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
285
286dnl Written by Paul Eggert <eggert@twinsun.com>.
287
288dnl Internal subroutine of AC_SYS_LARGEFILE.
289dnl AC_SYS_LARGEFILE_TEST_INCLUDES
290AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
291 [[#include <sys/types.h>
292 int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
293 ]])
294
295dnl Internal subroutine of AC_SYS_LARGEFILE.
296dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY)
297AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
298 [AC_CACHE_CHECK([for $1 value needed for large files], $3,
299 [$3=no
300 AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES
301$5
302 ,
303 [$6],
304 ,
305 [AC_TRY_COMPILE([#define $1 $2]
306AC_SYS_LARGEFILE_TEST_INCLUDES
307$5
308 ,
309 [$6],
310 [$3=$2])])])
311 if test "[$]$3" != no; then
312 AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
313 fi])
314
315AC_DEFUN(AC_SYS_LARGEFILE,
316 [AC_ARG_ENABLE(largefile,
317 [ --disable-largefile omit support for large files])
318 if test "$enable_largefile" != no; then
319
320 AC_CACHE_CHECK([for special C compiler options needed for large files],
321 ac_cv_sys_largefile_CC,
322 [ac_cv_sys_largefile_CC=no
323 if test "$GCC" != yes; then
324 # IRIX 6.2 and later do not support large files by default,
325 # so use the C compiler's -n32 option if that helps.
326 AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
327 [ac_save_CC="$CC"
328 CC="$CC -n32"
329 AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
330 ac_cv_sys_largefile_CC=' -n32')
331 CC="$ac_save_CC"])
332 fi])
333 if test "$ac_cv_sys_largefile_CC" != no; then
334 CC="$CC$ac_cv_sys_largefile_CC"
335 fi
336
337 AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
338 ac_cv_sys_file_offset_bits,
339 [Number of bits in a file offset, on hosts where this is settable.])
340 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
341 ac_cv_sys_largefile_source,
342 [Define to make ftello visible on some hosts (e.g. HP-UX 10.20).],
343 [#include <stdio.h>], [return !ftello;])
344 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
345 ac_cv_sys_large_files,
346 [Define for large files, on AIX-style hosts.])
347 AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500,
348 ac_cv_sys_xopen_source,
349 [Define to make ftello visible on some hosts (e.g. glibc 2.1.3).],
350 [#include <stdio.h>], [return !ftello;])
351 fi
352 ])