I would like ./configure
to link to a library and some include files. My library is stored in /home/foo/sw/lib/
and my files are stored in /home/foo/sw/include
.
./configure --help
throws out the following:
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>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
I have tried various combinations:
./configure --prefix=/home/foo/sw -I</home/foo/sw/include> -L</home/foo/sw/lib/>
./configure --prefix=/home/foo/sw -I=/home/foo/sw/include -L=/home/foo/sw/lib/
./configure --prefix=/home/foo/sw -I/home/foo/sw/include -L/home/foo/sw/lib/
etc..
But I can't seem to get the syntax right. If anyone can help me out, that would be greatly appreciated. THANKS!
You missed the meaning of
So you set them as an environment variable; configure determines LDFLAGS and CPPFLAGS by checking config files and the environment. You can set them like this ...
or as a one-liner:
Please note that it is possible that you cannot use subdirectories under
/home/foo/sw/lib/
f.e. putting your library in
/home/foo/sw/lib/bar/
might show you alib not found
error.However you can use multiple entries:
LDFLAGS="-L/home/foo/sw/lib/ -L/home/foo/bar/lib/"