How to override environment variables when run configure?

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

 Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, eg -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, eg -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 to use these variables to include a directory? I tried running ./configure --CFLAGS="-I/home/package/custom/" and ./configure CFLAGS="-I/home/package/custom/" , however this will not work. Any suggestions?

+4
source share
2 answers

These are not flags passed for customization. These are the environment variables that need to be set. for example export CFLAGS="-I foo" .

+1
source

The variable to use for -I is CPPFLAGS , not CFLAGS . (As stated directly in the help message you copied.) CPP means "C preprocessor," not C ++. So:

 ./configure CPPFLAGS='-I/home/package/custom' 
+5
source

Source: https://habr.com/ru/post/1308086/


All Articles