aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>2023-07-28 12:55:15 +0000
committerRobert Clausecker <fuz@FreeBSD.org>2023-07-30 22:59:04 +0000
commit08691f29f5c8d5040ccdda864e174ef1db529ca3 (patch)
tree2d08b7a1834cd329f997cb94391b5d6aa760ee38
parente9e9321d57b42d3b9020973ae2eede23d41b8793 (diff)
downloadports-08691f29f5c8d5040ccdda864e174ef1db529ca3.tar.gz
ports-08691f29f5c8d5040ccdda864e174ef1db529ca3.zip
Mk/Uses/pkgconfig.mk: add support for PKGCONFIG_PATHS
USES=pkgconfig now allows you to specify PKGCONFIG_PATHS to allow management of PKG_CONFIG_PATHS in a cooperative fashion. PR: 260960 Reported by: Martin Neubauer <m.ne@gmx.net> Approved by: bofh Differential Revision: https://reviews.freebsd.org/D40194
-rw-r--r--Mk/Uses/pkgconfig.mk16
1 files changed, 16 insertions, 0 deletions
diff --git a/Mk/Uses/pkgconfig.mk b/Mk/Uses/pkgconfig.mk
index 499be51f1336..671a4f0608c1 100644
--- a/Mk/Uses/pkgconfig.mk
+++ b/Mk/Uses/pkgconfig.mk
@@ -28,4 +28,20 @@ RUN_DEPENDS+= ${_PKGCONFIG_DEPENDS}
IGNORE= USES=pkgconfig - invalid args: [${pkgconfig_ARGS}] specified
. endif
+_USES_POST+= pkgconfig
+.endif
+
+.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_PKGCONFIG_POST_MK)
+_INCLUDE_USES_PKGCONFIG_POST_MK=yes
+
+# Provide a cooperative mechanism for managing PKG_CONFIG_PATH.
+. if defined(PKGCONFIG_PATHS)
+. if !${CONFIGURE_ENV:MPKG_CONFIG_PATH=*} && !${MAKE_ENV:MPKG_CONFIG_PATH=*}
+CONFIGURE_ENV+= PKG_CONFIG_PATH=${PKGCONFIG_PATHS:ts:}
+MAKE_ENV+= PKG_CONFIG_PATH=${PKGCONFIG_PATHS:ts:}
+. else
+DEV_WARNING+= "PKGCONFIG_PATHS was ignored due to conflict with CONFIGURE_ENV or MAKE_ENV"
+. endif
+. endif
+
.endif