Nested AS_IF calls

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


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>

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf


[GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [USB]     [Samba]

Add to Google Powered by Linux