]> granicus.if.org Git - imagemagick/blob - m4/ac_func_fseeko.m4
(no commit message)
[imagemagick] / m4 / ac_func_fseeko.m4
1 # This file is part of Autoconf.                        -*- Autoconf -*-
2 # Checking for functions.
3 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
4 # Foundation, Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20 #
21 # As a special exception, the Free Software Foundation gives unlimited
22 # permission to copy, distribute and modify the configure scripts that
23 # are the output of Autoconf.  You need not follow the terms of the GNU
24 # General Public License when using or distributing such scripts, even
25 # though portions of the text of Autoconf appear in them.  The GNU
26 # General Public License (GPL) does govern all other use of the material
27 # that constitutes the Autoconf program.
28 #
29 # Certain portions of the Autoconf source text are designed to be copied
30 # (in certain cases, depending on the input) into the output of
31 # Autoconf.  We call these the "data" portions.  The rest of the Autoconf
32 # source text consists of comments plus executable code that decides which
33 # of the data portions to output in any given case.  We call these
34 # comments and executable code the "non-data" portions.  Autoconf never
35 # copies any of the non-data portions into its output.
36 #
37 # This special exception to the GPL applies to versions of Autoconf
38 # released by the Free Software Foundation.  When you make and
39 # distribute a modified version of Autoconf, you may extend this special
40 # exception to the GPL to apply to your modified version as well, *unless*
41 # your modified version has the potential to copy into its output some
42 # of the text that was the non-data portion of the version that you started
43 # with.  (In other words, unless your change moves or copies text from
44 # the non-data portions to the data portions.)  If your modification has
45 # such potential, you must delete any notice of this special exception
46 # to the GPL from your modified version.
47 #
48 # Written by David MacKenzie, with help from
49 # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
50 # Roland McGrath, Noah Friedman, david d zuhn, and many others.
51
52 # AC_FUNC_FSEEKO
53 # --------------
54 AN_FUNCTION([ftello], [AC_FUNC_FSEEKO])
55 AN_FUNCTION([fseeko], [AC_FUNC_FSEEKO])
56 AC_DEFUN([AC_FUNC_FSEEKO],
57 [_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
58    [ac_cv_sys_largefile_source],
59    [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).],
60    [[#include <sys/types.h> /* for off_t */
61      #include <stdio.h>]],
62    [[int (*fp) (FILE *, off_t, int) = fseeko;
63      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);]])
64
65 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
66 # in glibc 2.1.3, but that breaks too many other things.
67 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
68 if test $ac_cv_sys_largefile_source != unknown; then
69   AC_DEFINE(HAVE_FSEEKO, 1,
70     [Define to 1 if fseeko (and presumably ftello) exists and is declared.])
71 fi
72 ])# AC_FUNC_FSEEKO