diff mbox series

[1/7] multipath-tools Makefiles: make pkg-config configurable

Message ID 20210326212944.3136-2-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: extended github CI | expand

Commit Message

Martin Wilck March 26, 2021, 9:29 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

This is useful for building in a cross-compilation environment.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 Makefile.inc     | 6 ++++--
 libdmmp/Makefile | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

Comments

Xose Vazquez Perez March 29, 2021, 3:44 p.m. UTC | #1
On 3/26/21 10:29 PM, mwilck@suse.com wrote:

> From: Martin Wilck <mwilck@suse.com>
> 
> This is useful for building in a cross-compilation environment.

Debian has a similar patch:
https://salsa.debian.org/linux-blocks-team/multipath-tools/-/blob/master/debian/patches/0008-Bug-916521-FTCBFS-uses-the-wrong-pkg-config.patch


> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>   Makefile.inc     | 6 ++++--
>   libdmmp/Makefile | 4 ++--
>   2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/Makefile.inc b/Makefile.inc
> index 0542930..f1e2313 100644
> --- a/Makefile.inc
> +++ b/Makefile.inc
> @@ -15,6 +15,8 @@
>   # Uncomment to disable dmevents polling support
>   # ENABLE_DMEVENTS_POLL = 0
>   
> +PKGCONFIG	?= pkg-config
> +
>   ifeq ($(TOPDIR),)
>   	TOPDIR	= ..
>   endif
> @@ -36,8 +38,8 @@ ifndef RUN
>   endif
>   
>   ifndef SYSTEMD
> -	ifeq ($(shell pkg-config --modversion libsystemd >/dev/null 2>&1 && echo 1), 1)
> -		SYSTEMD = $(shell pkg-config --modversion libsystemd | awk '{print $$1}')
> +	ifeq ($(shell $(PKGCONFIG) --modversion libsystemd >/dev/null 2>&1 && echo 1), 1)
> +		SYSTEMD = $(shell $(PKGCONFIG) --modversion libsystemd | awk '{print $$1}')
>   	else
>   		ifeq ($(shell systemctl --version >/dev/null 2>&1 && echo 1), 1)
>   			SYSTEMD = $(shell systemctl --version 2> /dev/null | \
> diff --git a/libdmmp/Makefile b/libdmmp/Makefile
> index 1dd3f34..4175c3f 100644
> --- a/libdmmp/Makefile
> +++ b/libdmmp/Makefile
> @@ -16,9 +16,9 @@ HEADERS = libdmmp/libdmmp.h
>   OBJS = libdmmp.o libdmmp_mp.o libdmmp_pg.o libdmmp_path.o libdmmp_misc.o
>   
>   CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden -I$(libdmmpdir) -I$(mpathcmddir) \
> -	  $(shell pkg-config --cflags json-c)
> +	  $(shell $(PKGCONFIG) --cflags json-c)
>   
> -LIBDEPS += $(shell pkg-config --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread
> +LIBDEPS += $(shell $(PKGCONFIG) --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread
>   
>   all: $(LIBS) doc
>   
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
Martin Wilck March 29, 2021, 3:57 p.m. UTC | #2
On Mon, 2021-03-29 at 17:44 +0200, Xose Vazquez Perez wrote:
> On 3/26/21 10:29 PM, mwilck@suse.com wrote:
> 
> > From: Martin Wilck <mwilck@suse.com>
> > 
> > This is useful for building in a cross-compilation environment.
> 
> Debian has a similar patch:
> https://salsa.debian.org/linux-blocks-team/multipath-tools/-/blob/master/debian/patches/0008-Bug-916521-FTCBFS-uses-the-wrong-pkg-config.patch

Does this mean you disapprove of mine?

Martin



--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
diff mbox series

Patch

diff --git a/Makefile.inc b/Makefile.inc
index 0542930..f1e2313 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -15,6 +15,8 @@ 
 # Uncomment to disable dmevents polling support
 # ENABLE_DMEVENTS_POLL = 0
 
+PKGCONFIG	?= pkg-config
+
 ifeq ($(TOPDIR),)
 	TOPDIR	= ..
 endif
@@ -36,8 +38,8 @@  ifndef RUN
 endif
 
 ifndef SYSTEMD
-	ifeq ($(shell pkg-config --modversion libsystemd >/dev/null 2>&1 && echo 1), 1)
-		SYSTEMD = $(shell pkg-config --modversion libsystemd | awk '{print $$1}')
+	ifeq ($(shell $(PKGCONFIG) --modversion libsystemd >/dev/null 2>&1 && echo 1), 1)
+		SYSTEMD = $(shell $(PKGCONFIG) --modversion libsystemd | awk '{print $$1}')
 	else
 		ifeq ($(shell systemctl --version >/dev/null 2>&1 && echo 1), 1)
 			SYSTEMD = $(shell systemctl --version 2> /dev/null | \
diff --git a/libdmmp/Makefile b/libdmmp/Makefile
index 1dd3f34..4175c3f 100644
--- a/libdmmp/Makefile
+++ b/libdmmp/Makefile
@@ -16,9 +16,9 @@  HEADERS = libdmmp/libdmmp.h
 OBJS = libdmmp.o libdmmp_mp.o libdmmp_pg.o libdmmp_path.o libdmmp_misc.o
 
 CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden -I$(libdmmpdir) -I$(mpathcmddir) \
-	  $(shell pkg-config --cflags json-c)
+	  $(shell $(PKGCONFIG) --cflags json-c)
 
-LIBDEPS += $(shell pkg-config --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread
+LIBDEPS += $(shell $(PKGCONFIG) --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread
 
 all: $(LIBS) doc