autoconf
[Top][All Lists]
Advanced

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

Nested AS_IF calls


From: Adam Mercer
Subject: Nested AS_IF calls
Date: Thu, 7 Jun 2012 14:59:07 +0100

Hi

I'm trying to add a check to my configure.ac to determine if clang is
being used, I have the following:

CLANG_CC=
if test "$GCC" = yes; then
  if test "`$CC -v 2>&1 | grep -c 'clang version'`" != "0"; then
    CLANG_CC=1
  fi
fi

And I'm trying to use AS_IF instead, I've been reading to
documentation[1], and have come up with the following:

AS_IF([test "$GCC" = yes],[
  [AS_IF([test "`$CC -v 2>&1 | grep -c 'clang_version'`" != "0"],[CLANG_CC=1])],
  [CLANG_CC=])

but it doesn't seem to be working, whereas the version using if does.
Therefore I must be incorrectly constructing the nested use of AS_IF.
Can anyone spot what I'm doing wrong? Or know of a better way to check
if clang is being used?

Cheers

Adam

[1] 
<http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Common-Shell-Constructs.html>



reply via email to

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