summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-07-27 13:01:42 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-07-27 13:01:42 +0000
commitc37be1ab2480c43fdaec098f75ec5e25a65ceb59 (patch)
treef0eaa2724a40b1b253b320f90d70747a665b44f4
parentd040d4f33ef0c6388ea70b4b9f3ef3537f0ed60a (diff)
Make more parts optional
-rw-r--r--Makefile.am2
-rw-r--r--acinclude.m462
-rw-r--r--configure.in4
-rw-r--r--cups/Makefile.am13
-rw-r--r--hcid/Makefile.am26
-rw-r--r--pcmcia/Makefile.am19
-rw-r--r--rfcomm/Makefile.am10
-rw-r--r--test/Makefile.am8
-rw-r--r--tools/Makefile.am21
9 files changed, 68 insertions, 97 deletions
diff --git a/Makefile.am b/Makefile.am
index c027e1c6..82416cd8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@
# $Id$
#
-SUBDIRS = hcid tools rfcomm sdpd dund pand hidd cups test scripts pcmcia
+SUBDIRS = hcid tools rfcomm sdpd dund pand hidd cups test scripts pcmcia extra
EXTRA_DIST = utils.spec
diff --git a/acinclude.m4 b/acinclude.m4
index 6f69c3df..3e9add0c 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -76,8 +76,8 @@ AC_DEFUN([AC_PATH_USB], [
USB_CFLAGS=""
test -d "${usb_prefix}/include" && USB_CFLAGS="$USB_CFLAGS -I${usb_prefix}/include"
- CPPFLAGS="$CPPFLAGS $USB_CFLAGS"
- AC_CHECK_HEADER(usb.h,, AC_MSG_ERROR(USB header files not found))
+ CPPFLAGS="$CPPFLAGS $USB_CFLAGS"
+ AC_CHECK_HEADER(usb.h, usb_enable=yes, usb_enable=no)
USB_LIBS=""
if (test "${prefix}" = "${usb_prefix}"); then
@@ -88,7 +88,7 @@ AC_DEFUN([AC_PATH_USB], [
fi
LDFLAGS="$LDFLAGS $USB_LIBS"
- AC_CHECK_LIB(usb, usb_open, USB_LIBS="$USB_LIBS -lusb", AC_MSG_ERROR(USB library not found))
+ AC_CHECK_LIB(usb, usb_open, USB_LIBS="$USB_LIBS -lusb", usb_enable=no)
CPPFLAGS=$ac_save_CPPFLAGS
LDFLAGS=$ac_save_LDFLAGS
@@ -147,48 +147,30 @@ AC_DEFUN([AC_PATH_DBUS], [
AM_CONDITIONAL(DBUS, test "${dbus_enable}" = "yes")
])
-AC_DEFUN([AC_PATH_CUPS], [
- AC_ARG_ENABLE(cups, AC_HELP_STRING([--enable-cups], [enable CUPS support]), [
- cups_enable=${enableval}
- cups_prefix=${prefix}
+AC_DEFUN([AC_PATH_EXTRA], [
+ AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test], [install test programs]), [
+ test_enable=${enableval}
])
- AC_ARG_WITH(cups, AC_HELP_STRING([--with-cups=DIR], [CUPS is installed in DIR]), [
- if (test "${withval}" = "yes"); then
- cups_prefix=${prefix}
- else
- cups_prefix=${withval}
- fi
- cups_enable=yes
+ AC_ARG_ENABLE(cups, AC_HELP_STRING([--enable-cups], [install CUPS backend support]), [
+ cups_enable=${enableval}
+ ])
+
+ AC_ARG_ENABLE(pcmcia, AC_HELP_STRING([--enable-pcmcia], [install PCMCIA configuration files ]), [
+ pcmcia_enable=${enableval}
])
- CUPS_BACKEND_DIR=""
-
- AC_MSG_CHECKING(for CUPS backend directory)
-
- if (test "${prefix}" = "${cups_prefix}"); then
- if (test -d "${libdir}/cups/backend"); then
- CUPS_BACKEND_DIR="${libdir}/cups/backend"
- else
- cups_enable=no
- fi
- else
- if (test -d "${cups_prefix}/lib64/cups/backend"); then
- CUPS_BACKEND_DIR="${cups_prefix}/lib64/cups/backend"
- elif (test -d "${cups_prefix}/lib/cups/backend"); then
- CUPS_BACKEND_DIR="${cups_prefix}/lib/cups/backend"
- else
- cups_enable=no
- fi
- fi
-
- if test "${cups_enable}" = "yes"; then
- AC_MSG_RESULT($CUPS_BACKEND_DIR)
- else
- AC_MSG_RESULT($cups_enable)
- fi
+ AC_ARG_ENABLE(hid2hci, AC_HELP_STRING([--enable-hid2hci], [install HID mode switching utility]), [
+ hid2hci_enable=${enableval}
+ ])
- AC_SUBST(CUPS_BACKEND_DIR)
+ AC_ARG_ENABLE(bcm203x, AC_HELP_STRING([--enable-bcm203x], [install Broadcom 203x firmware loader]), [
+ bcm203x_enable=${enableval}
+ ])
+ AM_CONDITIONAL(TEST, test "${test_enable}" = "yes")
AM_CONDITIONAL(CUPS, test "${cups_enable}" = "yes")
+ AM_CONDITIONAL(PCMCIA, test "${pcmcia_enable}" = "yes")
+ AM_CONDITIONAL(HID2HCI, test "${hid2hci_enable}" = "yes" && test "${usb_enable}" = "yes")
+ AM_CONDITIONAL(BCM203X, test "${bcm203x_enable}" = "yes" && test "${usb_enable}" = "yes")
])
diff --git a/configure.in b/configure.in
index c8cf06f9..84db287c 100644
--- a/configure.in
+++ b/configure.in
@@ -24,6 +24,6 @@ AM_PROG_LEX
AC_PATH_BLUEZ
AC_PATH_USB
AC_PATH_DBUS
-AC_PATH_CUPS
+AC_PATH_EXTRA
-AC_OUTPUT(Makefile hcid/Makefile tools/Makefile rfcomm/Makefile sdpd/Makefile dund/Makefile pand/Makefile hidd/Makefile cups/Makefile test/Makefile scripts/Makefile pcmcia/Makefile)
+AC_OUTPUT(Makefile hcid/Makefile tools/Makefile rfcomm/Makefile sdpd/Makefile dund/Makefile pand/Makefile hidd/Makefile cups/Makefile test/Makefile scripts/Makefile pcmcia/Makefile extra/Makefile)
diff --git a/cups/Makefile.am b/cups/Makefile.am
index 42f3ac2f..c43cac54 100644
--- a/cups/Makefile.am
+++ b/cups/Makefile.am
@@ -2,17 +2,16 @@
# $Id$
#
-noinst_PROGRAMS = bluetooth
+if CUPS
+cupsdir = $(libdir)/cups/backend
+
+cups_PROGRAMS = bluetooth
bluetooth_SOURCES = main.c sdp.c spp.c hcrp.c
-LIBS = @BLUEZ_LIBS@
+LDADD = @BLUEZ_LIBS@
AM_CFLAGS = @BLUEZ_CFLAGS@
+endif
MAINTAINERCLEANFILES = Makefile.in
-
-if CUPS
-install-data-local: bluetooth
- $(INSTALL) -D -m 755 $(srcdir)/bluetooth $(DESTDIR)@CUPS_BACKEND_DIR@/bluetooth
-endif
diff --git a/hcid/Makefile.am b/hcid/Makefile.am
index 5201855d..256eba76 100644
--- a/hcid/Makefile.am
+++ b/hcid/Makefile.am
@@ -2,6 +2,10 @@
# $Id$
#
+confdir = $(sysconfdir)/bluetooth
+
+conf_DATA = hcid.conf
+
sbin_PROGRAMS = hcid
if DBUS
@@ -15,7 +19,6 @@ dbus_hcid_cflags =
endif
hcid_SOURCES = main.c security.c hcid.h lib.c lib.h parser.h parser.y lexer.l kword.h kword.c glib-ectomy.h glib-ectomy.c $(dbus_hcid_sources)
-hcid_CONFIG = hcid.conf
LIBS = $(dbus_hcid_libs) @BLUEZ_LIBS@
@@ -27,25 +30,6 @@ AM_YFLAGS = -d
CLEANFILES = lexer.c parser.c parser.h
-EXTRA_DIST = $(hcid_CONFIG) $(man_MANS) dbus.c
+EXTRA_DIST = $(man_MANS) $(conf_DATA) dbus.c
MAINTAINERCLEANFILES = Makefile.in
-
-#
-# Install configuration files
-#
-confdir = $(sysconfdir)/bluetooth
-conf_FILE = $(confdir)/$(hcid_CONFIG)
-pin_FILE = $(confdir)/pin
-
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(confdir)
- [ -f $(DESTDIR)$(conf_FILE) ] || \
- $(INSTALL_DATA) $(srcdir)/$(hcid_CONFIG) $(DESTDIR)$(conf_FILE)
- [ -f $(DESTDIR)$(pin_FILE) ] || \
- echo "BlueZ" > $(DESTDIR)$(pin_FILE); \
- chmod 600 $(DESTDIR)$(pin_FILE)
-
-uninstall-local:
- @rm -f $(DESTDIR)$(conf_FILE)
- @rm -f $(DESTDIR)$(pin_FILE)
diff --git a/pcmcia/Makefile.am b/pcmcia/Makefile.am
index f46cdf04..59c16334 100644
--- a/pcmcia/Makefile.am
+++ b/pcmcia/Makefile.am
@@ -2,19 +2,14 @@
# $Id$
#
-pcmciadir = $(sysconfdir)/pcmcia
+datafiles = bluetooth bluetooth.conf
-EXTRA_DIST = bluetooth bluetooth.conf
+if PCMCIA
+pcmciadir = $(sysconfdir)/pcmcia
-MAINTAINERCLEANFILES = Makefile.in
+pcmcia_DATA = $(datafiles)
+endif
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(pcmciadir)
- [ -f $(DESTDIR)$(pcmciadir)/bluetooth ] || \
- $(INSTALL_DATA) $(srcdir)/bluetooth $(DESTDIR)$(pcmciadir)
- [ -f $(DESTDIR)$(pcmciadir)/bluetooth.conf ] || \
- $(INSTALL_DATA) $(srcdir)/bluetooth.conf $(DESTDIR)$(pcmciadir)
+EXTRA_DIST = $(datafiles)
-uninstall-local:
- @rm -f $(DESTDIR)$(pcmciadir)/bluetooth
- @rm -f $(DESTDIR)$(pcmciadir)/bluetooth.conf
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/rfcomm/Makefile.am b/rfcomm/Makefile.am
index dd7f4082..bedb07f6 100644
--- a/rfcomm/Makefile.am
+++ b/rfcomm/Makefile.am
@@ -4,10 +4,11 @@
confdir = $(sysconfdir)/bluetooth
+conf_DATA = rfcomm.conf
+
bin_PROGRAMS = rfcomm
rfcomm_SOURCES = main.c parser.h parser.y lexer.l kword.h kword.c
-rfcomm_CONFIG = rfcomm.conf
LIBS = @BLUEZ_LIBS@
@@ -19,11 +20,6 @@ AM_YFLAGS = -d
CLEANFILES = lexer.c parser.c parser.h
-EXTRA_DIST = $(man_MANS) $(rfcomm_CONFIG)
+EXTRA_DIST = $(man_MANS) $(conf_DATA)
MAINTAINERCLEANFILES = Makefile.in
-
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(confdir)
- [ -f $(DESTDIR)$(confdir)/$(rfcomm_CONFIG) ] || \
- $(INSTALL_DATA) $(srcdir)/$(rfcomm_CONFIG) $(DESTDIR)$(confdir)/$(rfcomm_CONFIG)
diff --git a/test/Makefile.am b/test/Makefile.am
index 5b3f1ff3..5b05c43d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -2,11 +2,15 @@
# $Id$
#
-noinst_PROGRAMS = l2test scotest rctest attest hstest
+if TEST
+bin_PROGRAMS = l2test rctest
-LIBS = @BLUEZ_LIBS@
+noinst_PROGRAMS = scotest attest hstest
+
+LDADD = @BLUEZ_LIBS@
AM_CFLAGS = @BLUEZ_CFLAGS@
+endif
EXTRA_DIST = hsplay hsmicro
diff --git a/tools/Makefile.am b/tools/Makefile.am
index ca0514ce..79871391 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -2,7 +2,20 @@
# $Id$
#
-sbin_PROGRAMS = hciattach hciconfig hid2hci
+manfiles = hid2hci.8
+
+if HID2HCI
+xbindir = $(sbindir)
+xmandir = $(mandir)
+
+xbin_PROGRAMS = hid2hci
+
+hid2hci_LDADD = @USB_LIBS@
+
+xman_MANS = $(manfiles)
+endif
+
+sbin_PROGRAMS = hciattach hciconfig
bin_PROGRAMS = hcitool l2ping sdptool ciptool
@@ -22,12 +35,10 @@ ciptool_LDADD = @BLUEZ_LIBS@
ppporc_LDADD = @BLUEZ_LIBS@
-hid2hci_LDADD = @USB_LIBS@
-
AM_CFLAGS = @BLUEZ_CFLAGS@ @USB_CFLAGS@
-man_MANS = hciattach.8 hciconfig.8 hid2hci.8 hcitool.1 l2ping.1 sdptool.1 ciptool.1
+man_MANS = hciattach.8 hciconfig.8 hcitool.1 l2ping.1 sdptool.1 ciptool.1
-EXTRA_DIST = $(man_MANS)
+EXTRA_DIST = $(man_MANS) $(manfiles)
MAINTAINERCLEANFILES = Makefile.in