In my configure/configure.ac
, I do multiple PKG_CHECK_MODULES
calls. Most of them return the same -I path:-I/usr/local/include
, and also the same -L path: -L/usr/local/lib.
I would say that -I path
doesn't do any difference, because gcc compiles one source at time. It might make a difference when multiple sources would be compiled?
However, it probably does make a difference for libraries, as following constructs are possible:
-L/usr/local/lib -lX11 -L/usr/lib -lcurses -L/opt/lib -lcups
I guess that each -L option
changes current top library search path.
Is this all correct? Should I ignore -I
redundance, or try to collapse the paths? How to collapse them?
(PS. Please don't get confused about letters in -I
, -l
: the first one is capital "i"
, the include path option about which I am asking)