Linux bluetooth development
 help / color / mirror / Atom feed
From: Sheldon Demario <sheldon.demario@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Claudio Takahasi <claudio.takahasi@openbossa.org>
Subject: [PATCH 6/7] Add autoconf macro for interactive gatttool
Date: Fri, 21 Jan 2011 10:46:25 -0300	[thread overview]
Message-ID: <1295617586-3398-6-git-send-email-sheldon.demario@openbossa.org> (raw)
In-Reply-To: <1295617586-3398-1-git-send-email-sheldon.demario@openbossa.org>

From: Claudio Takahasi <claudio.takahasi@openbossa.org>

Interactive gatttool will be built automatically if readline library
is found and attribute plugin is enabled.
---
 Makefile.am  |    8 ++++++--
 acinclude.m4 |    8 ++++++++
 configure.ac |    1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 79365ad..f9e05fd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -175,7 +175,7 @@ builtin_sources += plugins/service.c
 endif
 
 if ATTRIBPLUGIN
-bin_PROGRAMS += attrib/gatttool attrib/igatttool
+bin_PROGRAMS += attrib/gatttool
 
 attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \
 			  attrib/gattrib.c btio/btio.c \
@@ -183,10 +183,14 @@ attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \
 			  attrib/gtcommon.h attrib/gtcommon.c
 attrib_gatttool_LDADD = lib/libbluetooth.la @GLIB_LIBS@
 
+if IGATTTOOL
+bin_PROGRAMS += attrib/igatttool
+
 attrib_igatttool_SOURCES = attrib/igatttool.c btio/btio.c \
 			   attrib/gtcommon.h attrib/gtcommon.c \
 			  src/glib-helper.h src/glib-helper.c
-attrib_igatttool_LDADD =  lib/libbluetooth.la @GLIB_LIBS@ -lreadline
+attrib_igatttool_LDADD =  lib/libbluetooth.la @GLIB_LIBS@ @READLINE_LIBS@
+endif
 
 builtin_modules += attrib
 builtin_sources += attrib/main.c \
diff --git a/acinclude.m4 b/acinclude.m4
index ecf4b4b..2b4b515 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -153,6 +153,13 @@ AC_DEFUN([AC_PATH_SNDFILE], [
 	AC_SUBST(SNDFILE_LIBS)
 ])
 
+AC_DEFUN([AC_PATH_READLINE], [
+	AC_CHECK_LIB(readline, main,
+		[ readline_found=yes
+		 AC_SUBST(READLINE_LIBS, "-lreadline")
+		], readline_found=no)
+])
+
 AC_DEFUN([AC_PATH_OUI], [
 	AC_ARG_WITH(ouifile,
 		    AS_HELP_STRING([--with-ouifile=PATH],[Path to the oui.txt file @<:@auto@:>@]),
@@ -357,6 +364,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
 	AM_CONDITIONAL(MCAP, test "${health_enable}" = "yes")
 	AM_CONDITIONAL(HAL, test "${hal_enable}" = "yes")
 	AM_CONDITIONAL(ATTRIBPLUGIN, test "${attrib_enable}" = "yes")
+	AM_CONDITIONAL(IGATTTOOL, test "${attrib_enable}" = "yes" && test "${readline_found}" = "yes")
 	AM_CONDITIONAL(ECHOPLUGIN, test "no" = "yes")
 	AM_CONDITIONAL(PNATPLUGIN, test "${pnat_enable}" = "yes")
 	AM_CONDITIONAL(TRACER, test "${tracer_enable}" = "yes")
diff --git a/configure.ac b/configure.ac
index 4a979f0..6925344 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,7 @@ AC_PATH_ALSA
 AC_PATH_GSTREAMER
 AC_PATH_USB
 AC_PATH_SNDFILE
+AC_PATH_READLINE
 AC_PATH_OUI
 
 AC_ARG_BLUEZ
-- 
1.7.1


  parent reply	other threads:[~2011-01-21 13:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21 13:46 [PATCH 1/7] Create a file to hold the generic code from gatttool Sheldon Demario
2011-01-21 13:46 ` [PATCH 2/7] Move do_connect from gatttool to gtcommon Sheldon Demario
2011-01-21 13:46 ` [PATCH 3/7] Initial version of igatttool - a interactive gatttool Sheldon Demario
2011-01-21 13:46 ` [PATCH 4/7] Add psm option to " Sheldon Demario
2011-01-21 13:46 ` [PATCH 5/7] Add transport " Sheldon Demario
2011-01-21 17:50   ` Anderson Lizardo
2011-01-21 13:46 ` Sheldon Demario [this message]
2011-01-21 13:46 ` [PATCH 7/7] Initial primary service discovery in igatttool Sheldon Demario

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=1295617586-3398-6-git-send-email-sheldon.demario@openbossa.org \
    --to=sheldon.demario@openbossa.org \
    --cc=claudio.takahasi@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox