From patchwork Thu Jun 25 14:12:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Schmidt X-Patchwork-Id: 6675391 X-Patchwork-Delegate: ira.weiny@intel.com Return-Path: X-Original-To: patchwork-linux-rdma@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 87EDDC05AC for ; Thu, 25 Jun 2015 14:12:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DF062060D for ; Thu, 25 Jun 2015 14:12:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E7C6206E8 for ; Thu, 25 Jun 2015 14:12:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751337AbbFYOMH (ORCPT ); Thu, 25 Jun 2015 10:12:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42145 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751379AbbFYOMG (ORCPT ); Thu, 25 Jun 2015 10:12:06 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id A18F5BB992; Thu, 25 Jun 2015 14:12:06 +0000 (UTC) Received: from hp.brq.redhat.com (dhcp-26-164.brq.redhat.com [10.34.26.164]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5PEC2Ec022944; Thu, 25 Jun 2015 10:12:06 -0400 From: Michal Schmidt To: Ira Weiny Cc: linux-rdma@vger.kernel.org Subject: [infiniband-diags PATCH 2/2] build-sys: avoid overlinking to libudev Date: Thu, 25 Jun 2015 16:12:02 +0200 Message-Id: <1435241522-7721-3-git-send-email-mschmidt@redhat.com> In-Reply-To: <1435241522-7721-1-git-send-email-mschmidt@redhat.com> References: <1435241522-7721-1-git-send-email-mschmidt@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Not all built binaries need to link to udev, only rdma-ndd. Use pkg-config to detect udev in configure.ac. Signed-off-by: Michal Schmidt --- Makefile.am | 6 ++++++ configure.ac | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 057508b18d..93af707ad6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -130,6 +130,12 @@ src_ibcacheedit_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc src_dump_fts_SOURCES = src/dump_fts.c src_dump_fts_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc +if ENABLE_RDMA_NDD +src_rdma_ndd_SOURCES = src/rdma-ndd.c +src_rdma_ndd_CFLAGS = $(AM_CFLAGS) $(UDEV_CFLAGS) +src_rdma_ndd_LDADD = libcommon.a $(UDEV_LIBS) +endif + BUILT_SOURCES = ibdiag_version ibdiag_version: if [ -x $(top_srcdir)/gen_ver.sh ] ; then \ diff --git a/configure.ac b/configure.ac index ece1d530a7..090b6ecf76 100644 --- a/configure.ac +++ b/configure.ac @@ -210,11 +210,12 @@ default_start="null" AC_SUBST(DEFAULT_START, $default_start) AC_SUBST(DEFAULT_STOP, $default_stop) -if test x$rdmandd = xyes; then - AC_CHECK_HEADER(libudev.h, with_udev="yes", with_udev="no") - AC_CHECK_LIB(udev, udev_monitor_ref, [], AC_MSG_ERROR(libudev is required for rdma-ndd...)) +AS_IF([test x$rdmandd = xyes], [ + PKG_CHECK_MODULES([UDEV], [libudev]) AC_CONFIG_FILES([doc/man/rdma-ndd.8 etc/rdma-ndd.init]) -fi + AC_SUBST([UDEV_CFLAGS]) + AC_SUBST([UDEV_LIBS]) +]) dnl Generate doc/man/*.in files if possible DOC_DATE="`date +%Y-%m-%d`"