Merge pull request #487 from alexeykovac/add-PKG_CONFIG

add PKG_CONFIG make variable
This commit is contained in:
Benedikt Heine 2018-01-26 02:52:37 +01:00 committed by GitHub
commit 4c6af492bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -19,26 +19,26 @@ SYSTEMD := 0
endif endif
endif endif
SERVICEDIR_DBUS ?= $(shell pkg-config dbus-1 --variable=session_bus_services_dir) SERVICEDIR_DBUS ?= $(shell $(PKG_CONFIG) dbus-1 --variable=session_bus_services_dir)
SERVICEDIR_DBUS := ${SERVICEDIR_DBUS} SERVICEDIR_DBUS := ${SERVICEDIR_DBUS}
ifeq (,${SERVICEDIR_DBUS}) ifeq (,${SERVICEDIR_DBUS})
$(error "Failed to query pkg-config for package 'dbus-1'!") $(error "Failed to query $(PKG_CONFIG) for package 'dbus-1'!")
endif endif
ifneq (0,${SYSTEMD}) ifneq (0,${SYSTEMD})
SERVICEDIR_SYSTEMD ?= $(shell pkg-config systemd --variable=systemduserunitdir) SERVICEDIR_SYSTEMD ?= $(shell $(PKG_CONFIG) systemd --variable=systemduserunitdir)
SERVICEDIR_SYSTEMD := ${SERVICEDIR_SYSTEMD} SERVICEDIR_SYSTEMD := ${SERVICEDIR_SYSTEMD}
ifeq (,${SERVICEDIR_SYSTEMD}) ifeq (,${SERVICEDIR_SYSTEMD})
$(error "Failed to query pkg-config for package 'systemd'!") $(error "Failed to query $(PKG_CONFIG) for package 'systemd'!")
endif endif
endif endif
LIBS := $(shell pkg-config --libs ${pkg_config_packs}) LIBS := $(shell $(PKG_CONFIG) --libs ${pkg_config_packs})
INCS := $(shell pkg-config --cflags ${pkg_config_packs}) INCS := $(shell $(PKG_CONFIG) --cflags ${pkg_config_packs})
ifneq (clean, $(MAKECMDGOALS)) ifneq (clean, $(MAKECMDGOALS))
ifeq ($(and $(INCS),$(LIBS)),) ifeq ($(and $(INCS),$(LIBS)),)
$(error "pkg-config failed!") $(error "$(PKG_CONFIG) failed!")
endif endif
endif endif

View File

@ -2,6 +2,8 @@
PREFIX ?= /usr/local PREFIX ?= /usr/local
MANPREFIX = ${PREFIX}/share/man MANPREFIX = ${PREFIX}/share/man
PKG_CONFIG ?= pkg-config
# Disable systemd service file installation, # Disable systemd service file installation,
# if you don't want to use systemd albeit installed # if you don't want to use systemd albeit installed
#SYSTEMD ?= 0 #SYSTEMD ?= 0