autoconfm4

How to put logical or in autoconf m4 AS_IF


In the official documentation the AS_IF macro is described pretty much like:

Macro: AS_IF (test1, [run-if-true1], ..., [run-if-false]) 

How can I make test1 include several conditions? (combination of "logical and" and "logical or")

Thanks


Solution

  • The test1 is just a bash command. So it should be used as a regular bash code. For example:

    AS_IF ([test "x$a" == "xb" || test "x$a" == "xc"], [echo "test passed"], [echo "test has not passed"]