Include 如何在运行configure时覆盖环境变量?
在Linux的任何主要软件包中,运行Include 如何在运行configure时覆盖环境变量?,include,environment-variables,autotools,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
/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.
一些有影响的环境变量:
CC编译器命令
CFLAGS C编译器标志
LDFLAGS链接器标志,例如,-L,如果在
非标准目录
CPPFLAGS C/C++预处理器标志,例如-I(如果有)
非标准目录中的标题
cppc预处理器
使用这些变量覆盖“配置”所做的选择或帮助
查找具有非标准名称/位置的库和程序非常困难。
如何使用这些变量包含目录?我尝试运行了
/configure--CFLAGS=“-I/home/package/custom/”
和/configure CFLAGS=“-I/home/package/custom/”
,但是这些都不起作用。有什么建议吗?这些不是传递给配置的标志。这些是您需要设置的环境变量。e、 g.export CFLAGS=“-I foo”
需要用于-I
的变量是cppfagas
,而不是CFLAGS
。(正如它在你所复制的帮助消息中所说的)CPP代表“C预处理器”,而不是C++。因此:
./configure CPPFLAGS='-I/home/package/custom'
但是,您也可以将它们作为标志传递以进行配置。