[Top][All Lists]

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

Re: autoconf-2.69c released [beta]

From: Russ Allbery
Subject: Re: autoconf-2.69c released [beta]
Date: Tue, 29 Sep 2020 17:03:56 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Bob Friesenhahn <> writes:

> Gavin, thanks very much for your help.  Just in case someone reads this
> discussion later, I found that there was a small syntax error in the
> above.  The following is what finally worked for me (a small change after
> ac_cv_have_C__func__='no'):

> # Test for C compiler __func__ support
> if test "$ac_cv_have_C__func__" != 'yes' ; then
> AC_CACHE_CHECK(for C compiler __func__ support, ac_cv_have_C__func__,
> [[const char *func=__func__;
> return (func != 0 ? 0 : 1);
> ]])],
> [ac_cv_have_C__func__='yes'],
> [ac_cv_have_C__func__='no'])])

> if test "$ac_cv_have_C__func__" = 'yes' ; then
>  AC_DEFINE(HAS_C__func__,1,Define if C compiler supports __func__)
> fi
> fi

This is separate from the question of how Autoconf should handle old
configure scripts and how autoupdate should work, but while you're
manually making changes to macros anyway, you will probably be happier in
the long run if you quote all arguments and make a habit of using AS_IF
instead of open-coded shell if statements.

# Test for C compiler __func__ support
AS_IF([test "$ac_cv_have_C__func__" != 'yes'], [
AC_CACHE_CHECK([for C compiler __func__ support], [ac_cv_have_C__func__],
[[const char *func=__func__;
return (func != 0 ? 0 : 1);

AS_IF([test "$ac_cv_have_C__func__" = 'yes'], [
 AC_DEFINE([HAS_C__func__],[1],[Define if C compiler supports __func__])

This will protect against a lot of edge cases.

Russ Allbery (             <>

reply via email to

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