如何检查GNU Make是否支持Guile [英] How to check whether GNU Make supports Guile
本文介绍了如何检查GNU Make是否支持Guile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从命令行检查 是否在Guile的支持下构建了GNU Make?
How to check from the command line whether GNU Make is built with support of Guile?
在Makefile内部,可以通过分析.FEATURES
变量来确定(请参见
Inside Makefile it can be determined via analyzing .FEATURES
variable (see documentation).
推荐答案
一种可能的方法是在stdin中创建一个准makefile.
One possible way is a quasi makefile in stdin.
因此,可以使用以下方式打印.FEATURES
变量:
So, .FEATURES
variable can be printed in the following way:
echo '$(info $(.FEATURES))' | make -f -
以下命令输出 guile
字符串(如果受支持),否则不输出:
The following command outputs guile
string if it is supported or nothing in otherwise:
echo '$(info $(filter guile,$(.FEATURES)))' | make -f - 2>/dev/null
使用grep
的变体形式:
echo '$(info $(.FEATURES))' | make -f - 2>/dev/null | grep -wo guile
解决方案
The solution
As @bobbogo mentioned, we can avoid the pipe at all, using --eval
option:
make --eval '$(info $(filter guile,$(.FEATURES)))' 2>/dev/null
此命令将打印"guile"或不显示任何内容.
This command will print 'guile' or nothing.
这篇关于如何检查GNU Make是否支持Guile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文