Autotools的ax_check_compile_flag语法错误

autotools syntax error with ax_check_compile_flag

本文关键字:flag 语法 错误 compile check ax Autotools      更新时间:2023-10-16

我正在使用autotools来构建我的c++应用程序。在我的配置中。ac我有以下行:

AX_CHECK_COMPILE_FLAG([-Wall], [CPPFLAGS="$CPPFLAGS -Wall"])

在执行时会导致以下错误。/configure(运行autoreconf -i后):

./configure: line 3825: syntax error near unexpected token `-Wall,'
./configure: line 3825: `AX_CHECK_COMPILE_FLAG(-Wall, CPPFLAGS="$CPPFLAGS -Wall")'

我的系统:Linux web 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux

在我的Ubuntu机器上它工作得很好,为什么我得到这个错误?

autoreconf并不是魔法(尽管我遇到过明显相信这一点的软件包维护者)。当您运行autoreconf时,它无法找到AX_CHECK_COMPILE_FLAG宏,并产生损坏的configure脚本。通常这会同时产生一个错误/诊断消息。

'AX_CHECK_COMPILE_FLAG '来自autoconf归档项目,Debian有一个包提供这个,名为autoconf-archive。很可能是你忘记安装了:

sudo apt-get install autoconf-archive