bcpierce00 / unison

Unison file synchronizer
GNU General Public License v3.0
4.08k stars 229 forks source link

Add pkg-config support #925

Open gdt opened 1 year ago

gdt commented 1 year ago

When looking for C libraries, unison's must determine CPPFLAGS and LDFLAGS. Lacking a system like autoconf, this is necessarily a bit ad hoc. Because for many libraries, pkg-config is the standard interface to obtain this information, it makes sense to rely on it, both to avoid encoding platform-specific information in our makefiles, and to enable building in a wide variety of environments.

It is important to keep the build system simple and for failures to be easy to understand. A possible path to this is to have a build target "check-pkg-config" which succeeds if pkg-config exists by something like pkg-config --version > /dev/null, and for rules using pkg-config to depend on that rule and simply assume pkg-config exists.

Note that this is an intentional choice to optimize for maintainability and minimizing time responding to misfiled bug reports, rather than a better experience for people that haven't read INSTALL.md.

The concept has been floated on unison-users@.