Skip to main content
1 of 2
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

The LDFLAGS and CPPFLAGS variables contains command line flags that are passed to tools at various stages when compiling software. These should contain space-delimited flags.

export LDFLAGS=-L/some/directory

Later (note, you only have to export a variable once):

LDFLAGS="$LDFLAGS -L/other/directory"

Or,

LDFLAGS+=" -L/other/directory"

The PKG_CONFIG_PATH variable is used by the pkg-config tool. It's manual states (my emphasis):

PKG_CONFIG_PATH
This can be used to specify a colon-separated list of paths to search for package files. If given, this list of paths is prepended to the standard search path.

So,

export PKG_CONFIG_PATH=/some/directory

Later:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/other/directory

Or,

PKG_CONFIG_PATH+=:/other/directory
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k