Blob Blame History Raw
From dd1eb4ed6a00bd5e25b952962a1dfebc213fa920 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Wed, 12 Aug 2015 16:58:32 +0200
Subject: [PATCH] use pkg-config to find udev rules dir

---
 Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 92e4295740..5568eb84b5 100644
--- a/Makefile
+++ b/Makefile
@@ -116,6 +116,13 @@ VERSION_RELEASE := $(VERSION)-$(RELEASE)
 
 LDLIBS := -lrt -lpthread -ldl ${EXTRA_LIBS}
 
+PKG_CONFIG ?= pkg-config
+
+UDEVDIR := $(shell $(PKG_CONFIG) --variable=udevdir udev 2>/dev/null)
+ifndef UDEVDIR
+	UDEVDIR = /lib/udev
+endif
+
 all: symlinks
 	for subdir in $(SUBDIRS); do \
 		$(MAKE) -C $$subdir $@ ;\
@@ -159,7 +166,7 @@ install: all
 		ln -sf psm2.h psm.h ; \
 		ln -sf psm2_mq.h psm_mq.h ; \
 		ln -sf psm2_am.h psm_am.h)
-	install -m 0644 -D 40-psm-compat.rules ${DESTDIR}/etc/udev/rules.d/40-psm-compat.rules
+	install -m 0644 -D 40-psm-compat.rules ${DESTDIR}$(UDEVDIR)/rules.d/40-psm-compat.rules
 
 install-noship: all
 	mkdir -p ${DESTDIR}/usr/include/hfi1diag
-- 
2.4.3