All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [infiniband-diags PATCH 2/2] build-sys: avoid overlinking to libudev
Date: Thu, 25 Jun 2015 16:12:02 +0200	[thread overview]
Message-ID: <1435241522-7721-3-git-send-email-mschmidt@redhat.com> (raw)
In-Reply-To: <1435241522-7721-1-git-send-email-mschmidt-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

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 <mschmidt-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 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`"
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-06-25 14:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 14:12 [infiniband-diags PATCH 0/2] libudev usage fixes Michal Schmidt
     [not found] ` <1435241522-7721-1-git-send-email-mschmidt-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-06-25 14:12   ` [infiniband-diags PATCH 1/2] rdma-ndd: never use udev_get_sys_path() Michal Schmidt
     [not found]     ` <1435241522-7721-2-git-send-email-mschmidt-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-14 15:44       ` ira.weiny
2015-06-25 14:12   ` Michal Schmidt [this message]
     [not found]     ` <1435241522-7721-3-git-send-email-mschmidt-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-14 15:44       ` [infiniband-diags PATCH 2/2] build-sys: avoid overlinking to libudev ira.weiny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435241522-7721-3-git-send-email-mschmidt@redhat.com \
    --to=mschmidt-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.