[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 <bfriesen@simple.dallas.tx.us> 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__,
> [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
> [[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__],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
[[const char *func=__func__;
return (func != 0 ? 0 : 1);
]])],
[ac_cv_have_C__func__='yes'],
[ac_cv_have_C__func__='no'])])
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 (eagle@eyrie.org) <https://www.eyrie.org/~eagle/>
- Re: autoconf-2.69c released [beta], (continued)
- Re: autoconf-2.69c released [beta], Bob Friesenhahn, 2020/09/27
- Re: autoconf-2.69c released [beta], Gavin Smith, 2020/09/27
- Re: autoconf-2.69c released [beta], Bob Friesenhahn, 2020/09/27
- Re: autoconf-2.69c released [beta], Gavin Smith, 2020/09/27
- Re: autoconf-2.69c released [beta], Gavin Smith, 2020/09/27
- Re: autoconf-2.69c released [beta], Bob Friesenhahn, 2020/09/29
- Re: autoconf-2.69c released [beta],
Russ Allbery <=
- Re: autoconf-2.69c released [beta], Zack Weinberg, 2020/09/30
Re: autoconf-2.69c released [beta], Zack Weinberg, 2020/09/30
Message not available
- Message not available
- Re: autoconf-2.69c released [beta], Bruno Haible, 2020/09/27
- Re: autoconf-2.69c released [beta], Paul Eggert, 2020/09/27
- Re: autoconf-2.69c released [beta], Bruno Haible, 2020/09/27
- Re: autoconf-2.69c released [beta], Zack Weinberg, 2020/09/30
- Re: autoconf-2.69c released [beta], Eric Blake, 2020/09/30