7

在 Linux 的任何主要包中,running./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/"但是这些不起作用。有什么建议么?

4

2 回答 2

7

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

./configure CPPFLAGS='-I/home/package/custom'
于 2010-04-27T19:32:49.727 回答
3

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

于 2010-04-26T23:21:45.480 回答