[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_FUNC_FSEEKO and optional execution
From: |
Russ Allbery |
Subject: |
Re: AC_FUNC_FSEEKO and optional execution |
Date: |
Mon, 23 Mar 2009 10:17:38 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Eric Blake <address@hidden> writes:
> According to Russ Allbery on 3/22/2009 1:18 PM:
>> Could AC_FUNC_FSEEKO acquire ACTION_IF_FOUND and ACTION_IF_NOT_FOUND
>> arguments so that I can implement this conditional probing and
>> AC_LIBOBJ calls in a sane fashion without relying on undocumented and
>> unsupported macro internals?
> Why not ditch AC_FUNC_FSEEKO, and write a portable variant yourself?
> AC_DEFUN([INN_FSEEKO],
> [AC_REQUIRE([AC_SYS_LARGEFILE])dnl
> AC_CACHE_CHECK([for fseeko], [inn_cv_func_fseeko],
> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
> #include <sys/types.h> /* for off_t */
> #include <stdio.h>
> ]], [[int (*fp) (FILE *, off_t, int) = fseeko;
> return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);]])]
> [inn_cv_func_fseeko=yes], [inn_cv_func_fseeko=no])])
> if test x"$inn_cv_func_fseeko" != xyes ; then
> INN_TYPE_FPOS_T_LARGE
> AC_CHECK_DECLS([fseeko, ftello])
> AC_LIBOBJ([fseeko])
> AC_LIBOBJ([ftello])
> fi
> ])
Hm, yeah, I could do that. It seems like a bit of a waste to check for
fseeko twice given that Autoconf is already doing so and I'd still need to
call the Autoconf AC_FUNC_FSEEKO function to get the prototype handling
right, though.
> That said, if others agree with you that exporting ac_cv_func_fseeko for
> compatibility is still worthwhile (it was dropped in commit 90fcd46
> autoconf 2.60a-37), then we could probably modify AC_FUNC_FSEEKO to once
> again set that variable to yes or no for 2.64 and beyond.
Wouldn't it be better to add two arguments to the function? It's
backwards-compatible and I think it's a lot cleaner than documenting a
cache variable.
--
Russ Allbery (address@hidden) <http://www.eyrie.org/~eagle/>