开发者

How to override environment variables when running configure?

开发者 https://www.devze.com 2022-12-28 01:23 出处:网络
In any major package for Linux, running ./configure --help will output at the end: Some influential environment variables:

In any major package for Linux, running ./configure --help will output at the end:

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
                  non开发者_开发知识库standard 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.

How do I use these variables to include a directory? I tried running ./configure --CFLAGS="-I/home/package/custom/" and ./configure CFLAGS="-I/home/package/custom/", however these do not work. Any suggestions?


The variable you need to use for -I is CPPFLAGS, not CFLAGS. (As it says right there in the help message you copied.) CPP stands for "C preprocessor", not C++. So:

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


These are not flags passed to configure. These are environment variables you need to set. e.g. export CFLAGS="-I foo".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号