Makefile: Limit `pkgconf --static` workaround to OpenBSD
The flag was added in commit facfadb4b771 (Makefile: use pkg-config
--libs --static for LDFLAGS) to work around missing shared `libpci`
on OpenBSD. Usually it doesn't hurt to add the flag even when link-
ing against shared libraries, but it turns out that this can create
issues in corner cases. For instance, Fedora doesn't ship symbolic
links to shared libraries without version number by default, i.e. a
plain `.so` without further suffix. These links are shipped in the
`-devel` packages which normally aren't required in case of transi-
tive dependencies (like libusb1 depending on libudev in our case).
Our `meson.build` already limits the quirk to OpenBSD.
Change-Id: Ie0dcbb8b70ade5c98736138591eb9fac31e1e00c
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/554
diff --git a/Makefile.include b/Makefile.include
index 1bca4f3..a0b5fa9 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -66,5 +66,5 @@
endef
define dependency_ldflags
-$(call debug_shell, $(if $(PKG_CONFIG_LIBDIR),PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR),) $(PKG_CONFIG) --libs --static $1 2>/dev/null)
+$(call debug_shell, $(if $(PKG_CONFIG_LIBDIR),PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR),) $(PKG_CONFIG) --libs $(if $(filter OpenBSD,$(TARGET_OS)),--static) $1 2>/dev/null)
endef