From d4a93caffe79cb5506c25b78995f0327179a903e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 11 Dec 2012 22:19:13 +0100 Subject: [PATCH] build: Support building client without tools enabled --- Makefile.tools | 12 ++++++------ configure.ac | 17 +++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Makefile.tools b/Makefile.tools index df728e737..ef58588f7 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -1,4 +1,10 @@ +if CLIENT +noinst_PROGRAMS += client/bluetoothctl +client_bluetoothctl_SOURCES = client/main.c +client_bluetoothctl_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ -lreadline +endif + if TOOLS bin_PROGRAMS += tools/rfcomm tools/l2ping tools/l2test tools/rctest \ tools/hciattach tools/hciconfig \ @@ -71,12 +77,6 @@ emulator_btvirt_SOURCES = emulator/main.c monitor/bt.h \ emulator_b1ee_SOURCES = emulator/b1ee.c monitor/mainloop.h monitor/mainloop.c if READLINE -if CLIENT -noinst_PROGRAMS += client/bluetoothctl -client_bluetoothctl_SOURCES = client/main.c -client_bluetoothctl_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -endif - bin_PROGRAMS += attrib/gatttool attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \ attrib/gattrib.c btio/btio.c \ diff --git a/configure.ac b/configure.ac index 203d6473f..e8a389ddf 100644 --- a/configure.ac +++ b/configure.ac @@ -99,14 +99,6 @@ AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools], [disable Bluetooth tools]), [enable_tools=${enableval}]) AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no") -AC_ARG_ENABLE(readline, AC_HELP_STRING([--disable-readline], - [disable readline support]), [enable_readline=${enableval}]) -if (test "${enable_tools}" != "no" && test "${enable_readline}" != "no" ); then - AC_CHECK_HEADERS(readline/readline.h, dummy=yes, - AC_MSG_ERROR(readline header files are required)) -fi -AM_CONDITIONAL(READLINE, test "${enable_readline}" != "no") - AC_ARG_ENABLE(usb, AC_HELP_STRING([--disable-usb], [disable USB support]), [enable_usb=${enableval}]) if (test "${enable_tools}" != "no" && test "${enable_usb}" != "no" ); then @@ -170,8 +162,13 @@ AM_CONDITIONAL(OBEX, test "${enable_obex}" != "no") AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client], [disable command line client]), [enable_client=${enableval}]) -AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no" && - test "${enable_readline}" != "no") +AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no") + +if (test "${enable_client}" != "no"); then + AC_CHECK_HEADERS(readline/readline.h, enable_readline=yes, + AC_MSG_ERROR(readline header files are required)) +fi +AM_CONDITIONAL(READLINE, test "${enable_readline}" = "yes") AC_ARG_ENABLE(systemd, AC_HELP_STRING([--disable-systemd], [disable systemd integration]), [enable_systemd=${enableval}]) -- 2.47.3