projects/package-update-indicator

changeset 52:707e9e3deeac tip

Do not hardcode pkg-config

Using a macro allows passing a different executable in case of
cross-compilation.
author Helmut Grohne <helmut@subdivi.de>
date Sat Dec 12 01:08:21 2020 -0500 (9 months ago)
parents f27122a7bb02
children
files Makefile
line diff
     1.1 --- a/Makefile	Thu Dec 03 08:51:48 2020 +0100
     1.2 +++ b/Makefile	Sat Dec 12 01:08:21 2020 -0500
     1.3 @@ -48,9 +48,10 @@
     1.4  PAX :=		pax
     1.5  GZIP :=		gzip
     1.6  SED :=		sed
     1.7 -GLIB_COMPILE_SCHEMAS := $(shell pkg-config --variable=glib_compile_schemas gio-2.0)
     1.8 -GLIB_COMPILE_RESOURCES := $(shell pkg-config --variable=glib_compile_resources gio-2.0)
     1.9 -GLIB_MKENUMS :=	$(shell pkg-config --variable=glib_mkenums glib-2.0)
    1.10 +PKG_CONFIG :=	pkg-config
    1.11 +GLIB_COMPILE_SCHEMAS := $(shell $(PKG_CONFIG) --variable=glib_compile_schemas gio-2.0)
    1.12 +GLIB_COMPILE_RESOURCES := $(shell $(PKG_CONFIG) --variable=glib_compile_resources gio-2.0)
    1.13 +GLIB_MKENUMS :=	$(shell $(PKG_CONFIG) --variable=glib_mkenums glib-2.0)
    1.14  XSLTPROC :=	xsltproc
    1.15  DOCBOOK5_MANPAGES_STYLESHEET = http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
    1.16  DOCBOOK5_MANPAGES_FLAGS = --stringparam man.authors.section.enabled 0 \
    1.17 @@ -71,9 +72,9 @@
    1.18  		--keyword=g_dngettext:2,3 \
    1.19  		--add-comments
    1.20  INDICATOR_LIB := $(or \
    1.21 -		    $(shell pkg-config --exists appindicator3-0.1 && \
    1.22 +		    $(shell $(PKG_CONFIG) --exists appindicator3-0.1 && \
    1.23  		        printf '%s\\\n' appindicator3-0.1), \
    1.24 -		    $(shell pkg-config --exists ayatana-appindicator3-0.1 && \
    1.25 +		    $(shell $(PKG_CONFIG) --exists ayatana-appindicator3-0.1 && \
    1.26  		        printf '%s\\\n' ayatana-appindicator3-0.1), \
    1.27  		    appindicator3-0.1)
    1.28  INDICATOR_FLAG := $(if $(findstring ayatana,$(INDICATOR_LIB)), \
    1.29 @@ -160,10 +161,10 @@
    1.30  			-DSETTINGS_SCHEMA_ID=\"$(APPLICATION_ID)\" \
    1.31  			-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
    1.32  			$(INDICATOR_FLAG)
    1.33 -$(PACKAGE): XCFLAGS =	$(shell pkg-config --cflags gtk+-3.0 \
    1.34 +$(PACKAGE): XCFLAGS =	$(shell $(PKG_CONFIG) --cflags gtk+-3.0 \
    1.35  			    $(INDICATOR_LIB) packagekit-glib2 \
    1.36  			    polkit-gobject-1 upower-glib)
    1.37 -$(PACKAGE): LDLIBS =	$(shell pkg-config --libs gtk+-3.0 \
    1.38 +$(PACKAGE): LDLIBS =	$(shell $(PKG_CONFIG) --libs gtk+-3.0 \
    1.39  			    $(INDICATOR_LIB) packagekit-glib2 \
    1.40  			    polkit-gobject-1 upower-glib)
    1.41  
    1.42 @@ -174,8 +175,8 @@
    1.43  			-DPACKAGE_LOCALE_DIR="\"$(localedir)\"" \
    1.44  			-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
    1.45  			-DSETTINGS_SCHEMA_ID=\"$(APPLICATION_ID)\"
    1.46 -$(PACKAGE)-prefs: XCFLAGS = $(shell pkg-config --cflags gtk+-3.0)
    1.47 -$(PACKAGE)-prefs: LDLIBS = $(shell pkg-config --libs gtk+-3.0)
    1.48 +$(PACKAGE)-prefs: XCFLAGS = $(shell $(PKG_CONFIG) --cflags gtk+-3.0)
    1.49 +$(PACKAGE)-prefs: LDLIBS = $(shell $(PKG_CONFIG) --libs gtk+-3.0)
    1.50  
    1.51  ifneq ($(findstring $(OS_NAME),FreeBSD DragonFly OpenBSD),)
    1.52    $(PACKAGE): XCPPFLAGS +=	-I/usr/local/include