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

标签 include environment-variables autotools configure

在 Linux 的任何主要软件包中,运行 ./configure --help最后会输出:

Some influential environment variables:
      CC          C compiler command
      CFLAGS      C compiler flags
      LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
                  nonstandard directory <lib dir>
      CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
                  headers in a nonstandard directory <include dir>
      CPP         C preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

如何使用这些变量来包含目录?我试过运行 ./configure --CFLAGS="-I/home/package/custom/"./configure CFLAGS="-I/home/package/custom/" ,但是这些都不起作用。有什么建议?

最佳答案

您需要用于 -I 的变量是 CPPFLAGS ,不是 CFLAGS . (正如您复制的帮助消息中所说的那样。)CPP 代表“C 预处理器”,而不是 C++。所以:

./configure CPPFLAGS='-I/home/package/custom'

关于include - 运行configure时如何覆盖环境变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2717623/

相关文章:

html - 不一致的#include css 外观

linux - grep 使用 X 但不使用 Y

ruby-on-rails - "Error installing rails"因为 "extconf.rb failed"在 Ubuntu 18.04

powershell - 如何将文件下载到 $env :temp directory using powershell from cmd console?

每个子项目 LIBS 可以使用自动工具吗?

java - 在 Java 中包含 Perl

javascript - 如何在网页上多次使用JavaScript生成的类?

Python:从特定的 .env 文件中获取 env 变量的值

build-process - 如何针对另一个未安装的 autotools 项目构建一个 autotools 项目?

autotools - 使用 automake 配置脚本在 64 位 Linux 上构建 32 位?