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

发布于 2024-08-30 12:46:16 字数 892 浏览 8 评论 0原文

在 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.

How do I use those variables to include a directory?我尝试运行 ./configure --CFLAGS="-I/home/package/custom/"./configure CFLAGS="-I/home/package/custom/",但是这些不起作用。有什么建议吗?

In any major package for Linux, running ./configure --help will output at the end:

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.

How do I use these variables to include a directory? I tried running ./configure --CFLAGS="-I/home/package/custom/" and ./configure CFLAGS="-I/home/package/custom/", however these do not work. Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

酒绊 2024-09-06 12:46:16

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

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

The variable you need to use for -I is CPPFLAGS, not CFLAGS. (As it says right there in the help message you copied.) CPP stands for "C preprocessor", not C++. So:

./configure CPPFLAGS='-I/home/package/custom'
浊酒尽余欢 2024-09-06 12:46:16

这些不是传递给配置的标志。这些是您需要设置的环境变量。例如export CFLAGS="-I foo"

These are not flags passed to configure. These are environment variables you need to set. e.g. export CFLAGS="-I foo".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文