How do I know where to install my .pc file? These files are put in different places on different operating systems. The goal is to be able to use something like $(INSTALL) mylib.pc $$(pkg-config --pcdir) in the install target. I thought pkg-config would be able to tell me somehow, but can’t find anything.
I’m looking for a “standalone” solution usable in plain Makefile (must not require support from autotools or similar).
UPDATE: Evidently there is now a way to do this:
Found in this bug report (see comment #4). The current man page appears to document this.
Original answer:
Horrible hackish solution (assuming bourne shell):
This may give you more than one location.
edit by @just somebody
shorter version
and to stop after the first directory: