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: Ralf Wildenhues
Subject: Re: Bug#401377: autoconf: AC_FUNC_FSEEKO does not make fseeko()/ftello() visible
Date: Mon, 4 Dec 2006 20:12:09 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Peter Palfrader wrote on Sun, Dec 03, 2006 at 02:27:35PM CET:
> Ralf Wildenhues schrieb am Sonntag, dem 03. Dezember 2006:
> > On Sun, Dec 03, 2006 at 01:41:44AM +0100, Peter Palfrader wrote:
> > >
> > >Starting with 2.61-1 autoconf's AC_FUNC_FSEEKO no longer makes fseeko() or
> > >ftello() visible on sid.  It still worked with 2.60a4-1.

This looks like a regression to me, so  Cc:ing autoconf-patches.
Please see http://bugs.debian.org/401377 for details.

It seems this patch causes the regression:
http://lists.gnu.org/archive/html/autoconf-patches/2006-09/msg00091.html

and there has been a followup change in this area which seems unrelated
(but needs to be reverted to be able to revert the other one cleanly):
http://lists.gnu.org/archive/html/autoconf-patches/2006-10/msg00060.html

It seems the problematic bit here is this part of the change:
|        * lib/autoconf/functions.m4 (AC_FUNC_FSEEKO): Don't compile the
|        fseeko testing program twice; just use the earlier result.
[...]
| @@ -589,17 +589,13 @@ AC_DEFUN([AC_FUNC_FSEEKO],
|  [_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;])
| +   address@hidden:@include <stdio.h>],
| +   [[return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);]])
| 
|  # 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.
| -AC_CACHE_CHECK([for fseeko], [ac_cv_func_fseeko],
| -[AC_LINK_IFELSE([AC_LANG_PROGRAM(address@hidden:@include <stdio.h>],
| -                                [[return fseeko && fseeko (stdin, 0, 0);]])],
| -               [ac_cv_func_fseeko=yes],
| -               [ac_cv_func_fseeko=no])])
| -if test $ac_cv_func_fseeko = yes; then
| +if test $ac_cv_sys_largefile_source != unknown; then
|    AC_DEFINE(HAVE_FSEEKO, 1,
|      [Define to 1 if fseeko (and presumably ftello) exists and is declared.])
|  fi

This now doesn't fail reliably any more when a declaration for fseeko is
not seen.

The patch below reverts that part of the change and applies instead the
change I proposed back then, but I've tested it very lightly only.
Peter, could you try it?

OK to apply?

Cheers, and thanks for the report,
Ralf

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




reply via email to

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