autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#401377: autoconf: AC_FUNC_FSEEKO does not make fseeko()/ftello()


From: Peter Palfrader
Subject: Re: Bug#401377: autoconf: AC_FUNC_FSEEKO does not make fseeko()/ftello() visible
Date: Mon, 4 Dec 2006 21:10:18 +0100
User-agent: Mutt/1.5.9i

On Mon, 04 Dec 2006, Ralf Wildenhues wrote:

> 2006-12-04  Ralf Wildenhues  <address@hidden>
> 
>       * lib/autoconf/functions.m4 (AC_FUNC_FSEEKO): Revert the
>       2006-09-26 change.  To avoid picky compiler warnings, instead
>       use a typedef, to catch a missing declaration.  In the second
>       test, avoid testing of a constant address.
>       Reported by Peter Palfrader <address@hidden>.
> 
> Index: lib/autoconf/functions.m4
> ===================================================================
> RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/functions.m4,v
> retrieving revision 1.114
> diff -u -r1.114 functions.m4
> --- lib/autoconf/functions.m4 17 Nov 2006 21:04:54 -0000      1.114
> +++ lib/autoconf/functions.m4 4 Dec 2006 19:03:23 -0000
> @@ -589,13 +589,19 @@
>  [_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
>     [ac_cv_sys_largefile_source],
>     [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).],
> -   address@hidden:@include <stdio.h>],
> -   [[return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);]])
> +   address@hidden:@include <stdio.h>], [typedef int (*fp);
> +                          fp p = (fp) fseeko;
> +                          return !p;])
>  
>  # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
>  # in glibc 2.1.3, but that breaks too many other things.
>  # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
> -if test $ac_cv_sys_largefile_source != unknown; then
> +AC_CACHE_CHECK([for fseeko], [ac_cv_func_fseeko],
> +[AC_LINK_IFELSE([AC_LANG_PROGRAM(address@hidden:@include <stdio.h>],
> +                              [[return fseeko (stdin, 0, 0);]])],
> +             [ac_cv_func_fseeko=yes],
> +             [ac_cv_func_fseeko=no])])
> +if test $ac_cv_func_fseeko = yes; then
>    AC_DEFINE(HAVE_FSEEKO, 1,
>      [Define to 1 if fseeko (and presumably ftello) exists and is declared.])
>  fi
> 


> Peter, could you try it?

Works for me.  Thanks.



} checking stdio.h presence... yes
} checking for stdio.h... yes
} checking for _LARGEFILE_SOURCE value needed for large files... 1
} checking for fseeko... yes
} checking for special C compiler options needed for large files... no
} checking for _FILE_OFFSET_BITS value needed for large files... no

} address@hidden:/tmp/c# grep LARGE config.h
} #define _LARGEFILE_SOURCE 1
} /* #undef _LARGE_FILES */

config.h:
[...]
} configure:4052: checking stdio.h presence
} configure:4067: gcc -E  conftest.c
} configure:4073: $? = 0
} configure:4087: result: yes
} configure:4115: checking for stdio.h
} configure:4123: result: yes
} configure:4141: checking for _LARGEFILE_SOURCE value needed for large files
} configure:4170: gcc -o conftest -g -O2   conftest.c  >&5
} conftest.c: In function 'main':
} conftest.c:27: error: 'fseeko' undeclared (first use in this function)
} conftest.c:27: error: (Each undeclared identifier is reported only once
} conftest.c:27: error: for each function it appears in.)
} configure:4176: $? = 1
} configure: failed program was:
} | /* confdefs.h.  */
} | #define PACKAGE_NAME ""
} | #define PACKAGE_TARNAME ""
} | #define PACKAGE_VERSION ""
} | #define PACKAGE_STRING ""
} | #define PACKAGE_BUGREPORT ""
} | #define PACKAGE "programm"
} | #define VERSION "0.0.1"
} | #define STDC_HEADERS 1
} | #define HAVE_SYS_TYPES_H 1
} | #define HAVE_SYS_STAT_H 1
} | #define HAVE_STDLIB_H 1
} | #define HAVE_STRING_H 1
} | #define HAVE_MEMORY_H 1
} | #define HAVE_STRINGS_H 1
} | #define HAVE_INTTYPES_H 1
} | #define HAVE_STDINT_H 1
} | #define HAVE_UNISTD_H 1
} | #define HAVE_STDLIB_H 1
} | #define HAVE_STDIO_H 1
} | /* end confdefs.h.  */
} | #include <stdio.h>
} | int
} | main ()
} | {
} | typedef int (*fp);
} |                            fp p = (fp) fseeko;
} |                            return !p;
} |   ;
} |   return 0;
} | }
} configure:4216: gcc -o conftest -g -O2   conftest.c  >&5
} configure:4222: $? = 0
} configure:4242: result: 1
} configure:4257: checking for fseeko
} configure:4283: gcc -o conftest -g -O2   conftest.c  >&5
} configure:4289: $? = 0
} configure:4306: result: yes
} configure:4323: checking for special C compiler options needed for large files
} configure:4416: result: no
[..]

Cheers,
Peter
-- 
                           |  .''`.  ** Debian GNU/Linux **
      Peter Palfrader      | : :' :      The  universal
 http://www.palfrader.org/ | `. `'      Operating System
                           |   `-    http://www.debian.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]