2010-04-26 491 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'