diff --git a/CHANGELOG.md b/CHANGELOG.md index 3707d73c..4d1b6ed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ Release history for s390-tools (MIT version) - dbginfo.sh: rework crypto data collection - dbginfo.sh: add nstat for network and SNMP stats - `pkg-config` is now mandatory for the build process + - Add `PKG_CONFIG` Makefile variable to select pkg-config program; + default `pkg-config` or `$(CROSS_COMPILE)pkg-config` if + `CROSS_COMPILE` is set Bug Fixes: diff --git a/cmsfs-fuse/Makefile b/cmsfs-fuse/Makefile index a77206bd..d83c8d4d 100644 --- a/cmsfs-fuse/Makefile +++ b/cmsfs-fuse/Makefile @@ -22,8 +22,8 @@ check_dep: all: check_dep cmsfs-fuse -FUSE_CFLAGS = $(shell pkg-config --silence-errors --cflags fuse3) -FUSE_LDLIBS = $(shell pkg-config --silence-errors --libs fuse3) +FUSE_CFLAGS = $(shell $(PKG_CONFIG) --silence-errors --cflags fuse3) +FUSE_LDLIBS = $(shell $(PKG_CONFIG) --silence-errors --libs fuse3) ALL_CFLAGS += -DHAVE_SETXATTR $(FUSE_CFLAGS) LDLIBS += $(FUSE_LDLIBS) -lm diff --git a/common.mak b/common.mak index 0d44a999..1d88254f 100644 --- a/common.mak +++ b/common.mak @@ -87,6 +87,8 @@ $(eval $(call cmd_define, GZIP," GZIP ",gzip)) $(eval $(call cmd_define, MV," MV ",mv)) $(eval $(call cmd_define, PERLC," PERLC ",perl -c)) +PKG_CONFIG = pkg-config + CHECK = sparse CHECK_SILENT := $(CHECK) CHECKTOOL = $(call echocmd," CHECK ",/$@)$(CHECK_SILENT) diff --git a/dasdview/Makefile b/dasdview/Makefile index 4e54821f..be89305a 100644 --- a/dasdview/Makefile +++ b/dasdview/Makefile @@ -16,8 +16,8 @@ check_dep: BUILDTARGET = check_dep -CURL_CFLAGS = $(shell pkg-config --silence-errors --cflags libcurl) -CURL_LDLIBS = $(shell pkg-config --silence-errors --libs libcurl) +CURL_CFLAGS = $(shell $(PKG_CONFIG) --silence-errors --cflags libcurl) +CURL_LDLIBS = $(shell $(PKG_CONFIG) --silence-errors --libs libcurl) endif # HAVE_CURL diff --git a/genprotimg/src/Makefile b/genprotimg/src/Makefile index a59ff935..67b61dc5 100644 --- a/genprotimg/src/Makefile +++ b/genprotimg/src/Makefile @@ -36,12 +36,12 @@ ALL_CPPFLAGS += $(INCLUDE_PARMS) LDLIBS += $(GLIB2_LIBS) $(LIBCRYPTO_LIBS) $(LIBCURL_LIBS) -GLIB2_CFLAGS := $(shell pkg-config --silence-errors --cflags glib-2.0) -GLIB2_LIBS := $(shell pkg-config --silence-errors --libs glib-2.0) -LIBCRYPTO_CFLAGS := $(shell pkg-config --silence-errors --cflags libcrypto) -LIBCRYPTO_LIBS := $(shell pkg-config --silence-errors --libs libcrypto) -LIBCURL_CFLAGS := $(shell pkg-config --silence-errors --cflags libcurl) -LIBCURL_LIBS := $(shell pkg-config --silence-errors --libs libcurl) +GLIB2_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags glib-2.0) +GLIB2_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs glib-2.0) +LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags libcrypto) +LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs libcrypto) +LIBCURL_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags libcurl) +LIBCURL_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs libcurl) BUILD_TARGETS := skip-$(bin_PROGRAM) INSTALL_TARGETS := skip-$(bin_PROGRAM) diff --git a/hmcdrvfs/Makefile b/hmcdrvfs/Makefile index 3908ca35..93309281 100644 --- a/hmcdrvfs/Makefile +++ b/hmcdrvfs/Makefile @@ -19,8 +19,8 @@ check_dep: "fuse3-devel or libfuse3-dev", \ "HAVE_FUSE=0") -FUSE_CFLAGS = $(shell pkg-config --silence-errors --cflags fuse3) -FUSE_LDLIBS = $(shell pkg-config --silence-errors --libs fuse3) +FUSE_CFLAGS = $(shell $(PKG_CONFIG) --silence-errors --cflags fuse3) +FUSE_LDLIBS = $(shell $(PKG_CONFIG) --silence-errors --libs fuse3) ALL_CFLAGS += -DFUSE_USE_VERSION=30 -D_LARGEFILE_SOURCE $(FUSE_CFLAGS) LDLIBS += $(FUSE_LDLIBS) -lpthread -lrt -ldl -lm diff --git a/hsavmcore/Makefile b/hsavmcore/Makefile index 4d3deb98..ed98ef87 100644 --- a/hsavmcore/Makefile +++ b/hsavmcore/Makefile @@ -22,16 +22,16 @@ else # HAVE_FUSE # # FUSE # -FUSE_CFLAGS = $(shell pkg-config --silence-errors --cflags fuse3) -FUSE_LDLIBS = $(shell pkg-config --silence-errors --libs fuse3) +FUSE_CFLAGS = $(shell $(PKG_CONFIG) --silence-errors --cflags fuse3) +FUSE_LDLIBS = $(shell $(PKG_CONFIG) --silence-errors --libs fuse3) # # systemd # ifneq (${HAVE_SYSTEMD},0) ifeq ($(call check_header_prereq,"systemd/sd-daemon.h"),yes) - SYSTEMD_CFLAGS = $(shell pkg-config --silence-errors --cflags libsystemd) - SYSTEMD_LDLIBS = $(shell pkg-config --silence-errors --libs libsystemd) + SYSTEMD_CFLAGS = $(shell $(PKG_CONFIG) --silence-errors --cflags libsystemd) + SYSTEMD_LDLIBS = $(shell $(PKG_CONFIG) --silence-errors --libs libsystemd) ALL_CPPFLAGS += -DHAVE_SYSTEMD else $(warning "systemd support disabled") diff --git a/libpv/Makefile b/libpv/Makefile index 3ee27868..46742261 100644 --- a/libpv/Makefile +++ b/libpv/Makefile @@ -5,12 +5,12 @@ include ../common.mak LIB := libpv.a -GLIB2_CFLAGS := $(shell pkg-config --silence-errors --cflags glib-2.0) -GLIB2_LIBS := $(shell pkg-config --silence-errors --libs glib-2.0) -LIBCRYPTO_CFLAGS := $(shell pkg-config --silence-errors --cflags libcrypto) -LIBCRYPTO_LIBS := $(shell pkg-config --silence-errors --libs libcrypto) -LIBCURL_CFLAGS := $(shell pkg-config --silence-errors --cflags libcurl) -LIBCURL_LIBS := $(shell pkg-config --silence-errors --libs libcurl) +GLIB2_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags glib-2.0) +GLIB2_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs glib-2.0) +LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags libcrypto) +LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs libcrypto) +LIBCURL_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags libcurl) +LIBCURL_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs libcurl) LDLIBS += $(GLIB2_LIBS) $(LIBCRYPTO_LIBS) $(LIBCURL_LIBS) WARNINGS := -Wall -Wextra -Wshadow \ diff --git a/pvattest/src/Makefile b/pvattest/src/Makefile index 458212cb..881d1fdf 100644 --- a/pvattest/src/Makefile +++ b/pvattest/src/Makefile @@ -28,12 +28,12 @@ $(BIN_PROGRAM)_SRCS := \ $(BIN_PROGRAM)_OBJS := $($(BIN_PROGRAM)_SRCS:.c=.o) -GLIB2_CFLAGS := $(shell pkg-config --silence-errors --cflags glib-2.0) -GLIB2_LIBS := $(shell pkg-config --silence-errors --libs glib-2.0) -LIBCRYPTO_CFLAGS := $(shell pkg-config --silence-errors --cflags libcrypto) -LIBCRYPTO_LIBS := $(shell pkg-config --silence-errors --libs libcrypto) -LIBCURL_CFLAGS := $(shell pkg-config --silence-errors --cflags libcurl) -LIBCURL_LIBS := $(shell pkg-config --silence-errors --libs libcurl) +GLIB2_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags glib-2.0) +GLIB2_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs glib-2.0) +LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags libcrypto) +LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs libcrypto) +LIBCURL_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags libcurl) +LIBCURL_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs libcurl) ALL_CFLAGS += -std=gnu11 \ -DPKGDATADIR=$(PKGDATADIR) \ diff --git a/zdsfs/Makefile b/zdsfs/Makefile index aeb511f5..da35891d 100644 --- a/zdsfs/Makefile +++ b/zdsfs/Makefile @@ -39,10 +39,10 @@ check_dep: "curl-devel or libcurl-dev", \ "HAVE_CURL=0") -FUSE_CFLAGS = $(shell pkg-config --silence-errors --cflags fuse3) -FUSE_LDLIBS = $(shell pkg-config --silence-errors --libs fuse3) -CURL_CFLAGS = $(shell pkg-config --silence-errors --cflags libcurl) -CURL_LDLIBS = $(shell pkg-config --silence-errors --libs libcurl) +FUSE_CFLAGS = $(shell $(PKG_CONFIG) --silence-errors --cflags fuse3) +FUSE_LDLIBS = $(shell $(PKG_CONFIG) --silence-errors --libs fuse3) +CURL_CFLAGS = $(shell $(PKG_CONFIG) --silence-errors --cflags libcurl) +CURL_LDLIBS = $(shell $(PKG_CONFIG) --silence-errors --libs libcurl) ALL_CPPFLAGS += -DSYSFS ALL_CFLAGS += -DHAVE_SETXATTR -pthread $(FUSE_CFLAGS) $(CURL_CFLAGS) LDLIBS += $(FUSE_LDLIBS) $(CURL_LDLIBS) -lpthread -lrt -lm diff --git a/zdump/Makefile b/zdump/Makefile index 8b0462f0..37059a9d 100644 --- a/zdump/Makefile +++ b/zdump/Makefile @@ -79,10 +79,10 @@ OBJECTS = zgetdump.o opts.o zg.o zg_error.o zg_print.o \ ngdump.o dt_ngdump.o dfi_ngdump.o dfi_vmdump.o \ pv_utils.o -GLIB2_CFLAGS := $(shell pkg-config --silence-errors --cflags glib-2.0) -GLIB2_LIBS := $(shell pkg-config --silence-errors --libs glib-2.0) -LIBCRYPTO_CFLAGS := $(shell pkg-config --silence-errors --cflags libcrypto) -LIBCRYPTO_LIBS := $(shell pkg-config --silence-errors --libs libcrypto) +GLIB2_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags glib-2.0) +GLIB2_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs glib-2.0) +LIBCRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --silence-errors --cflags libcrypto) +LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --silence-errors --libs libcrypto) LIBPV = $(rootdir)/libpv/libpv.a LIBPV_CFLAGS := -DOPENSSL_API_COMPAT=0x10100000L \ @@ -95,8 +95,8 @@ ifeq ("$(HAVE_FUSE)","0") FUSE_CFLAGS = -DHAVE_FUSE=0 -D_FILE_OFFSET_BITS=64 FUSE_LDLIBS = else -FUSE_CFLAGS = -DHAVE_FUSE=1 $(shell pkg-config --silence-errors --cflags fuse3) -FUSE_LDLIBS = $(shell pkg-config --silence-errors --libs fuse3) +FUSE_CFLAGS = -DHAVE_FUSE=1 $(shell $(PKG_CONFIG) --silence-errors --cflags fuse3) +FUSE_LDLIBS = $(shell $(PKG_CONFIG) --silence-errors --libs fuse3) endif LDLIBS += -lz $(FUSE_LDLIBS) $(LIBPV_LIBS) ALL_CFLAGS += $(FUSE_CFLAGS) $(LIBPV_CFLAGS)