|
From: | Julien ÉLIE |
Subject: | Re: Call the AC_CHECK_HEADER macro on a condition |
Date: | Tue, 19 Apr 2016 22:40:49 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 |
Hi all,
- Second is to rewrite your condition using AS_IF, which automatically "hoists" the dependency AC_PROG_CPP (and any other dependencies) outside of the if condition.I just wanted to thank you for this explanation. I was not affected by the original issue, but your answer was very useful. Until now, I thought AS_IF() was just a stupid wrapper around the shell's if clause, but your answer makes it clear that it is a lot smarter than that.
So did I!Incidentally, I am aware of AS_IF and AS_CASE constructions, as described in <https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Common-Shell-Constructs.html>.
Is it planned to add other macros like AS_FOR, AS_WHILE...? One may consider doing something like: for header in $LIST ; do AC_CHECK_HEADER([$header]) ; doneIf I understand well, in case $LIST happens to be empty, AC_PROG_CPP will never be run, and subsequent calls to AC_CHECK_HEADER in the configure script will fail.
-- Julien ÉLIE « Je sens que ma dernière hure est proche ! » (Astérix)
[Prev in Thread] | Current Thread | [Next in Thread] |