我想使用automake将标记添加到configure.ac文件中,以便可以根据主机上gcc的版本更改标记包。 我尝试这样做:
configure.ac(我在此文件的顶部输入以下命令)
AM_CONDITIONAL([gcc_v_above_4_9],[test x$(expr `gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$/&00/'` \>= 40900) = x1])
Makefile.am
if gcc_v_above_4_9
AM_CflaGS += -fstack-protector-strong
endif
然后我运行一个脚本./autogen.sh(一切都清楚),然后运行./configure,我得到了如下消息:
configure: error: conditional "gcc_v_above_4_9" was never defined.
Usually this means the macro was only invoked conditionally.
我该怎么做才能使标志依赖于gcc版本?