7

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.

これらの変数を使用してディレクトリを含めるにはどうすればよいですか? と を実行./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

これらは configure に渡されるフラグではありません。これらは、設定する必要がある環境変数です。例えばexport CFLAGS="-I foo"

于 2010-04-26T23:21:45.480 に答える