c++ - 带有 ax_check_compile_flag 的 autotools 语法错误

标签 c++ linux autotools configure

我正在使用 autotools 构建我的 C++ 应用程序。在我的 configure.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 archive项目,Debian 有一个提供此功能的软件包,名为 autoconf-archive .您可能忘记安装它:

sudo apt-get install autoconf-archive

关于c++ - 带有 ax_check_compile_flag 的 autotools 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30412576/

相关文章:

configure.in 还是 configure.ac?

c++ - Armadillo - 长 vector 中每个小块的范数

linux - Eclipse、Ubuntu - Eclipse IDE 未启动(嗯有点)

c++ - 使用指针获取用户输入

c - c中的poll函数是如何工作的?

python - 使用 python c api 获取共享对象的完整路径

autotools - LDFLAGS 在带有 libtool 的自动工具中的使用

include - 运行configure时如何覆盖环境变量?

android - 内部错误 : Could not find . pro 文件

c++ - 如何更改 "show hidden files"设置?