I'm referring to this guide to pkg-config for learning how to write one.
At one place, it mentions the following about the Requires and Requires.private fields.
Requires and Requires.private define other modules needed by the library. It is usually preferred to use the private variant of Requires to avoid exposing unnecessary libraries to the program that is linking with your library. If the program will not be using the symbols of the required library, it should not be linking directly to that library.
I understand the implications, but I don't compltely understand how will the linking process differ in the two cases. i.e given these two versions of *.pc, how will the linking process work?
bar1.pc:
prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: bar
Description: The bar library
Version: 2.1.2
Requires.private: foo >= 0.7
Cflags: -I${includedir}
Libs: -L${libdir} -lbar
bar2.pc:
prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: bar
Description: The bar library
Version: 2.1.2
Requires: foo >= 0.7
Cflags: -I${includedir}
Libs: -L${libdir} -lbar