【问题标题】:autotools syntax error with ax_check_compile_flag带有 ax_check_compile_flag 的 autotools 语法错误
【发布时间】:2015-05-23 22:55:12
【问题描述】:

我正在使用自动工具来构建我的 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 机器上运行良好,为什么会出现这个错误?

【问题讨论】:

    标签: c++ linux autotools configure


    【解决方案1】:

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

    'AX_CHECK_COMPILE_FLAG` 来自autoconf archive 项目,Debian 有一个提供此功能的包,名为autoconf-archive。您可能忘记安装它了:

    sudo apt-get install autoconf-archive
    

    【讨论】:

    • 只是想补充一点,对于任何使用此解决方案的人,您确实需要在安装 autoconf-archive 后重新运行 autoconf。
    猜你喜欢
    • 2020-10-25
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 2014-08-17
    • 1970-01-01
    • 2018-05-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多