CFLAGS represents an option for the C compiler.
Cxxflags represents options for the C + + compiler.
These two variables actually cover the two steps of compiling and assembling.
CFLAGS: Specifies the path to the header file (. h file), such as: Cflags=-i/usr/include-i/path/include. Similarly, when a package is installed, an include directory is created under the installation path, and when a problem occurs during the installation, try adding the Include directory of the previously installed package to the variable.
Some of the optimization parameters used by the compiler, such as LDFLAGS:GCC, can also specify the location of the library files. Usage: ldflags=-l/usr/lib-l/path/to/your/lib. Each installation of a package will almost certainly create a Lib directory in the installation directory. If you install a package clearly, and install another package, it Leng said to find, you can express the Lib path of the package to join the Ldfalgs to try.
LIBS: Tell the linker which library files to link to, such as LIBS =-lpthread-liconv
Simply put, Ldflags is telling the linker where to look for library files, and Libs is telling the linker which library files to link to. However, when using the link stage these two parameters will be added, so you can even swap these two values, there is no problem.
Sometimes ldflags specifies-l Although the linker can find the library to link, but the runtime linker could not find the library, if you want to let the Software runtime library file path also extended, then we need to add the two libraries to "-wl,r":
Ldflags =-l/var/xxx/lib-l/opt/mysql/lib-wl,r/var/xxx/lib-wl,r/opt/mysql/lib
If you set the environment variable before you execute./configure export ldflags= "-l/var/xxx/lib-l/opt/mysql/lib-wl,r/var/xxx/lib-wl,r/opt/mysql/lib", Note Set environment variables there can be no spaces on either side of the equals sign, and enclose the quotation marks (shell usage). Then after the execution of configure, Makefile will set this option, the link will have this parameter, compiled executable program library file search path is extended.
Makefile Option Cflags,ldflags,libs