From patchwork Sat Sep 5 01:31:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7126901 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64431BEEC1 for ; Sat, 5 Sep 2015 01:37:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C915208AE for ; Sat, 5 Sep 2015 01:37:17 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B159208A2 for ; Sat, 5 Sep 2015 01:37:16 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8DDC0182F39; Fri, 4 Sep 2015 18:37:16 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id 505D8182E35 for ; Fri, 4 Sep 2015 18:37:15 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 04 Sep 2015 18:37:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,471,1437462000"; d="scan'208";a="783126967" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.137]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2015 18:37:14 -0700 Subject: [PATCH 03/11] ndctl: use PKG_CHECK_MODULES for external dependencies From: Dan Williams To: linux-nvdimm@lists.01.org Date: Fri, 04 Sep 2015 21:31:32 -0400 Message-ID: <20150905013132.28464.38371.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20150905012538.28464.18136.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20150905012538.28464.18136.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-8-g92dd MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_BLACK autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some distros place devel material in non-standard locations. Use pkgconfig to find it. Signed-off-by: Dan Williams --- Makefile.am | 17 ++++++++++------- configure.ac | 11 +++-------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Makefile.am b/Makefile.am index 070192f2f2bc..d22e55708474 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,10 @@ AM_CPPFLAGS = \ -DLIBEXECDIR=\""$(libexecdir)"\" \ -I${top_srcdir}/lib/ndctl \ -I${top_srcdir}/lib \ - -I${top_srcdir}/ + -I${top_srcdir}/ \ + $(KMOD_CFLAGS) \ + $(UDEV_CFLAGS) \ + $(UUID_CFLAGS) AM_CFLAGS = ${my_CFLAGS} \ -fvisibility=hidden \ @@ -42,7 +45,7 @@ lib_LTLIBRARIES = lib/libndctl.la lib_libndctl_la_SOURCES =\ lib/libndctl-private.h \ lib/libndctl.c -lib_libndctl_la_LIBADD = -ludev -luuid -lkmod +lib_libndctl_la_LIBADD = $(UDEV_LIBS) $(UUID_LIBS) $(KMOD_LIBS) bin_PROGRAMS = ndctl @@ -69,7 +72,7 @@ ndctl_SOURCES += lib/blk_namespaces.c \ ndctl_SOURCES += builtin-bat.c endif -ndctl_LDADD = lib/libndctl.la -luuid -lkmod +ndctl_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) noinst_LIBRARIES = libccan.a libccan_a_SOURCES = \ @@ -108,13 +111,13 @@ check_PROGRAMS += lib/test-blk-ns lib/test-pmem-ns endif lib_test_libndctl_SOURCES = lib/test-libndctl.c -lib_test_libndctl_LDADD = lib/libndctl.la -luuid -lkmod +lib_test_libndctl_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) lib_test_blk_ns_SOURCES = lib/blk_namespaces.c -lib_test_blk_ns_LDADD = lib/libndctl.la -lkmod +lib_test_blk_ns_LDADD = lib/libndctl.la $(KMOD_LIBS) lib_test_pmem_ns_SOURCES = lib/pmem_namespaces.c -lib_test_pmem_ns_LDADD = lib/libndctl.la -lkmod +lib_test_pmem_ns_LDADD = lib/libndctl.la $(KMOD_LIBS) lib_test_dpa_alloc_SOURCES = lib/test-dpa-alloc.c -lib_test_dpa_alloc_LDADD = lib/libndctl.la -luuid -lkmod +lib_test_dpa_alloc_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) diff --git a/configure.ac b/configure.ac index daa6b3227c8e..8162b723ecab 100644 --- a/configure.ac +++ b/configure.ac @@ -68,14 +68,9 @@ AS_IF([test "x$enable_destructive" = "xyes"], [AC_DEFINE([ENABLE_DESTRUCTIVE], [1], [destructive functional tests support])]) AM_CONDITIONAL([ENABLE_DESTRUCTIVE], [test "x$enable_destructive" = "xyes"]) -AC_CHECK_LIB([udev], [main], [], - [AC_MSG_FAILURE([missing systemd-devel])], []) - -AC_CHECK_LIB([kmod], [main], [], - [AC_MSG_FAILURE([missing kmod-devel])], []) - -AC_CHECK_LIB([uuid], [main], [], - [AC_MSG_FAILURE([missing libuuid-devel])], []) +PKG_CHECK_MODULES([KMOD], [libkmod]) +PKG_CHECK_MODULES([UDEV], [libudev]) +PKG_CHECK_MODULES([UUID], [uuid]) AC_CHECK_HEADER([linux/ndctl.h], [AC_DEFINE([HAVE_NDCTL_H], [1],