How to check whether GNU Make supports Guile

别来无恙 提交于 2019-12-11 06:41:17

问题


How to check from the command line whether GNU Make is built with support of Guile?

Inside Makefile it can be determined via analyzing .FEATURES variable (see documentation).


回答1:


As @ruvim points out, the manual says

You can determine whether GNU Guile support is available by checking the .FEATURES variable for the word guile.

$(if $(filter guile,${.FEATURES}) \
  ,$(info Guile suppoerted, yay!) \
  ,$(error Guile not supported - update your make))



回答2:


One possible way is a quasi makefile in stdin.

So, .FEATURES variable can be printed in the following way:

echo '$(info $(.FEATURES))' | make -f -

The following command outputs guile string if it is supported or nothing in otherwise:

echo '$(info $(filter guile,$(.FEATURES)))' | make -f -  2>/dev/null

A variation using 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

This command will print 'guile' or nothing.



来源:https://stackoverflow.com/questions/54670790/how-to-check-whether-gnu-make-supports-guile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!