Mercurial > hg > octave-shane > gnulib-hg
annotate m4/fseeko.m4 @ 14910:6d0e0db0535e
fseek: Respect rules for use of AC_LIBOBJ.
* m4/fseeko.m4 (gl_FUNC_FSEEKO): Move gl_REPLACE_FSEEK invocation from
here...
* m4/fseek.m4 (gl_FUNC_FSEEK): ... to here.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 07 May 2011 13:23:50 +0200 |
parents | 6927d3a4e13a |
children | bd2854b5a2ef |
rev | line source |
---|---|
14910
6d0e0db0535e
fseek: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14909
diff
changeset
|
1 # fseeko.m4 serial 14 |
14079
97fc9a21a8fb
maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents:
13942
diff
changeset
|
2 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. |
8708 | 3 dnl This file is free software; the Free Software Foundation |
4 dnl gives unlimited permission to copy and/or distribute it, | |
5 dnl with or without modifications, as long as this notice is preserved. | |
6 | |
7 AC_DEFUN([gl_FUNC_FSEEKO], | |
8 [ | |
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_HAVE_FSEEKO]) |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
11 AC_REQUIRE([gl_STDIN_LARGE_OFFSET]) |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
12 |
13942
525c4e92ae7e
fseeko: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13169
diff
changeset
|
13 AC_CHECK_DECLS_ONCE([fseeko]) |
525c4e92ae7e
fseeko: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13169
diff
changeset
|
14 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
|
15 HAVE_DECL_FSEEKO=0 |
525c4e92ae7e
fseeko: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13169
diff
changeset
|
16 fi |
525c4e92ae7e
fseeko: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13169
diff
changeset
|
17 |
13169
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
18 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
|
19 HAVE_FSEEKO=0 |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
20 else |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
21 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
|
22 REPLACE_FSEEKO=1 |
13169
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
23 fi |
14909
6927d3a4e13a
fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14696
diff
changeset
|
24 m4_ifdef([gl_FUNC_FFLUSH_STDIN], [ |
6927d3a4e13a
fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14696
diff
changeset
|
25 gl_FUNC_FFLUSH_STDIN |
6927d3a4e13a
fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14696
diff
changeset
|
26 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
|
27 REPLACE_FSEEKO=1 |
6927d3a4e13a
fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14696
diff
changeset
|
28 fi |
6927d3a4e13a
fseeko: Respect rules for use of AC_LIBOBJ.
Bruno Haible <bruno@clisp.org>
parents:
14696
diff
changeset
|
29 ]) |
13169
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
30 fi |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
31 ]) |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
32 |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
33 dnl Tests whether fseeko is available. |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
34 dnl Result is gl_cv_func_fseeko. |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
35 AC_DEFUN([gl_HAVE_FSEEKO], |
b55181348b50
fseeko: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
13121
diff
changeset
|
36 [ |
8708 | 37 AC_REQUIRE([AC_PROG_CC]) |
9770
4e00098ae436
Ensure that fseeko is declared when possible.
Bruno Haible <bruno@clisp.org>
parents:
8872
diff
changeset
|
38 |
4e00098ae436
Ensure that fseeko is declared when possible.
Bruno Haible <bruno@clisp.org>
parents:
8872
diff
changeset
|
39 dnl Persuade glibc <stdio.h> to declare fseeko(). |
4e00098ae436
Ensure that fseeko is declared when possible.
Bruno Haible <bruno@clisp.org>
parents:
8872
diff
changeset
|
40 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) |
4e00098ae436
Ensure that fseeko is declared when possible.
Bruno Haible <bruno@clisp.org>
parents:
8872
diff
changeset
|
41 |
8708 | 42 AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko], |
43 [ | |
12222 | 44 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> |
45 ]], [fseeko (stdin, 0, 0);])], | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12222
diff
changeset
|
46 [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no]) |
8708 | 47 ]) |
48 ]) | |
8868
90e71310a07f
Fix fseeko/ftello on cygwin 1.5.24.
Eric Blake <ebb9@byu.net>
parents:
8718
diff
changeset
|
49 |
14401
b0fdfaeb0a77
stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
50 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
|
51 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
|
52 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
|
53 [ |
b0fdfaeb0a77
stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
54 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
|
55 [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
|
56 [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
|
57 [[#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
|
58 /* 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
|
59 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
|
60 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
|
61 # 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
|
62 # 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
|
63 choke me |
b0fdfaeb0a77
stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
64 # endif |
b0fdfaeb0a77
stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
65 #endif]])], |
b0fdfaeb0a77
stdio: simplify by moving gl_STDIN_LARGE_OFFSET to fseeko, ftello
Paul Eggert <eggert@cs.ucla.edu>
parents:
14079
diff
changeset
|
66 [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
|
67 [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
|
68 ]) |