如何放置逻辑或放入autoconf m4 AS_IF中

问题描述 投票:1回答:1

在官方文档中,AS_IF宏的描述非常像:

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

如何使test1包含多个条件? (“逻辑与”和“逻辑或”的组合)

谢谢

autoconf m4
1个回答
3
投票

test1只是一个bash命令。因此,应将其用作常规bash代码。例如:

AS_IF ([test "x$a" == "xb" || test "x$a" == "xc"], [echo "test passed"], [echo "test has not passed"]
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.