defs.mk: Make common PKG_CONFIG build dir opt-in
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m21s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m16s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m56s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 5m13s
CI / Packaging test (push) Successful in 0s

f70b14e92 ("defs.mk: Disable BUILD_PKG_CONFIG") disabled the
BUILD_PKG_CONFIG copy target, but the dir_build_PKG_CONFIG.done rule
still runs `mkdir -p $(BUILD_PKG_CONFIGDIR)`, and that directory is
keyed off DEVELOPMENT. A dev-version downstream package built against an
installed, read-only jw-pkg therefore resolves BUILD_PKG_CONFIGDIR to
$(JWBDIR)/pkgconfig and fails the build with "mkdir: Permission denied".

Default BUILD_PKG_CONFIGDIR to project-local $(TOPDIR)/make regardless of
DEVELOPMENT, and leave it overridable so that a self-contained build over
multiple projects can point it at some shared $(JWBDIR)/pkgconfig
directory at the user's discretion.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-10-20 09:57:11 +02:00
commit 944df09aa7
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -491,11 +491,11 @@ endif
ifeq ($(CREATE_PKG_CONFIG),true) ifeq ($(CREATE_PKG_CONFIG),true)
INSTALLATION_FILE_TYPES += PKG_CONFIG INSTALLATION_FILE_TYPES += PKG_CONFIG
PKG_CONFIG += $(sort $(filter-out $(DONT_INSTALL),$(wildcard *.pc) $(LOCAL_PKG_CONFIG))) PKG_CONFIG += $(sort $(filter-out $(DONT_INSTALL),$(wildcard *.pc) $(LOCAL_PKG_CONFIG)))
ifeq ($(DEVELOPMENT),true) # Having BUILD_PKG_CONFIGDIR point to $(TOPDIR)/make makes it a build-time
BUILD_PKG_CONFIGDIR = $(JWBDIR)/pkgconfig # no-op. Override BUILD_PKG_CONFIGDIR to $(JWBDIR)/pkgconfig if you want a
else # self-contained (i.e. non-installed) build over multiple projects to share
BUILD_PKG_CONFIGDIR = $(TOPDIR)/make # a common PKG_CONFIG directory.
endif BUILD_PKG_CONFIGDIR ?= $(TOPDIR)/make
LOCAL_PKG_CONFIG = $(PROJECT).pc LOCAL_PKG_CONFIG = $(PROJECT).pc
# As of now, this is not used by any downstream project, so disable it to reduce complexity. # As of now, this is not used by any downstream project, so disable it to reduce complexity.
#BUILD_PKG_CONFIG = $(BUILD_PKG_CONFIGDIR)/$(LOCAL_PKG_CONFIG) #BUILD_PKG_CONFIG = $(BUILD_PKG_CONFIGDIR)/$(LOCAL_PKG_CONFIG)