annotate m4/fseeko.m4 @ 17252:7a29ec33d6c5

missing @item
author Karl Berry <karl@freefriends.org>
date Tue, 01 Jan 2013 09:17:08 -0800
parents e542fd46ad6f
children 161070f4cae7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16795
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
1 # fseeko.m4 serial 16
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16795
diff changeset
2 dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
8708
53c8c606b9b7 New module 'fseeko'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
53c8c606b9b7 New module 'fseeko'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
53c8c606b9b7 New module 'fseeko'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
53c8c606b9b7 New module 'fseeko'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
53c8c606b9b7 New module 'fseeko'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 AC_DEFUN([gl_FUNC_FSEEKO],
53c8c606b9b7 New module 'fseeko'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 [
53c8c606b9b7 New module 'fseeko'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
13169
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
10 AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
16795
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
11 AC_REQUIRE([gl_SYS_TYPES_H])
14912
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
12 AC_REQUIRE([AC_PROG_CC])
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
13
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
14 dnl Persuade glibc <stdio.h> to declare fseeko().
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
15 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
16
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
17 AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
18 [
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
19 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
20 ]], [fseeko (stdin, 0, 0);])],
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
21 [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
bd2854b5a2ef fseeko: Simplify.
Bruno Haible <bruno@clisp.org>
parents: 14910
diff changeset
22 ])
13169
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
23
13942
525c4e92ae7e fseeko: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 13169
diff changeset
24 AC_CHECK_DECLS_ONCE([fseeko])
525c4e92ae7e fseeko: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 13169
diff changeset
25 if test $ac_cv_have_decl_fseeko = no; then
525c4e92ae7e fseeko: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 13169
diff changeset
26 HAVE_DECL_FSEEKO=0
525c4e92ae7e fseeko: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 13169
diff changeset
27 fi
525c4e92ae7e fseeko: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 13169
diff changeset
28
13169
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
29 if test $gl_cv_func_fseeko = no; then
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
30 HAVE_FSEEKO=0
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
31 else
16795
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
32 if test $WINDOWS_64_BIT_OFF_T = 1; then
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
33 REPLACE_FSEEKO=1
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
34 fi
13169
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
35 if test $gl_cv_var_stdin_large_offset = no; then
14909
6927d3a4e13a fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14696
diff changeset
36 REPLACE_FSEEKO=1
13169
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
37 fi
14909
6927d3a4e13a fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14696
diff changeset
38 m4_ifdef([gl_FUNC_FFLUSH_STDIN], [
6927d3a4e13a fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14696
diff changeset
39 gl_FUNC_FFLUSH_STDIN
6927d3a4e13a fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14696
diff changeset
40 if test $gl_cv_func_fflush_stdin = no; then
6927d3a4e13a fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14696
diff changeset
41 REPLACE_FSEEKO=1
6927d3a4e13a fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14696
diff changeset
42 fi
6927d3a4e13a fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents: 14696
diff changeset
43 ])
13169
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
44 fi
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
45 ])
b55181348b50 fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 13121
diff changeset
46
14401
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
47 dnl Code shared by fseeko and ftello. Determine if large files are supported,
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
48 dnl but stdin does not start as a large file by default.
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
49 AC_DEFUN([gl_STDIN_LARGE_OFFSET],
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
50 [
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
51 AC_CACHE_CHECK([whether stdin defaults to large file offsets],
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
52 [gl_cv_var_stdin_large_offset],
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
53 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
54 [[#if defined __SL64 && defined __SCLE /* cygwin */
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
55 /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
56 fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
57 it is easier to do a version check than building a runtime test. */
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
58 # include <cygwin/version.h>
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
59 # if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
60 choke me
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
61 # endif
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
62 #endif]])],
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
63 [gl_cv_var_stdin_large_offset=yes],
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
64 [gl_cv_var_stdin_large_offset=no])])
b0fdfaeb0a77 stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents: 14079
diff changeset
65 ])
16795
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
66
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
67 # Prerequisites of lib/fseeko.c.
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
68 AC_DEFUN([gl_PREREQ_FSEEKO],
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
69 [
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
70 dnl Native Windows has the function _fseeki64. mingw hides it, but mingw64
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
71 dnl makes it usable again.
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
72 AC_CHECK_FUNCS([_fseeki64])
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
73 ])