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!
LDFLAGS=-L
andLIBS=-l
. According to the help, they seems to be the same thing. Is there any difference? – user15964 Mar 01 '17 at 02:21-L
refers to a directory to search for libraries while-l
informs the linker to link against a specific library (to find which it will search the supplied-L
directories alongside the default set. – sherrellbc Jun 04 '19 at 16:58/
afterLDFLAGS
but not afterCPPFLAGS
? Is that a typo, or is it important? – vy32 Jun 07 '19 at 15:14lib
directory to the$LD_LIBRARY_PATH
environment variable. – chb Nov 14 '19 at 06:30