pkg-config

To add a new lib to pkg-config environment:

1. fabricate a .pc file:

libme.pc
prefix=/home/y/.programs/libme
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
bindir=${exec_prefix}/bin

Name: libme
Description: misc execution Library
Version: 1.0.0
Libs: -L${libdir} -lme
Libs.private:flags: -I${includedir}

system examples in
/usr/lib/pkgconfig
/usr/share/pkgconfig/

2. set PKG_CONFIG_PATH

export PKG_CONFIG_PATH=xxx

3. test

pkg-config –cflags –libs libme