2010-04-26 489 views
4

在任何大包适用于Linux,运行./configure --help将输出结尾:如何在运行configure时重写环境变量?

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/",但是这些都不起作用。有什么建议么?

回答

1

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

+2

但是,您也可以将它们作为标志传递给进行配置。 – ptomato 2010-04-27 19:30:40

5

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

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