Build the builtin plugins along with the daemon

This commit is contained in:
Marcel Holtmann 2009-08-09 14:05:57 -07:00
parent 6c7c4ec6b0
commit 33f51f71f9
4 changed files with 50 additions and 61 deletions

2
.gitignore vendored
View File

@ -32,7 +32,7 @@ parser.c
bluez.pc
include/bluetooth
src/bluetoothd
plugins/builtin.h
src/builtin.h
audio/telephony.c
scripts/bluetooth.rules

View File

@ -1,5 +1,5 @@
SUBDIRS = include lib sbc gdbus common plugins src client\
SUBDIRS = include lib sbc gdbus common src client plugins \
network serial input audio tools \
rfcomm compat cups test scripts doc
@ -9,12 +9,10 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = bluez.pc
DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
--disable-udevrules
DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc --disable-udevrules
DISTCLEANFILES = $(pkgconfig_DATA)
MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 configure config.h.in config.sub config.guess \
ltmain.sh depcomp compile missing install-sh mkinstalldirs ylwrap

View File

@ -3,39 +3,12 @@ plugindir = $(libdir)/bluetooth/plugins
plugin_LTLIBRARIES =
builtin_modules =
builtin_sources =
builtin_cflags =
if SERVICEPLUGIN
builtin_modules += service
builtin_sources += service.c
endif
builtin_modules += hciops
builtin_sources += hciops.c
if NETLINK
plugin_LTLIBRARIES += netlink.la
netlink_la_LIBADD = @NETLINK_LIBS@
endif
builtin_modules += hal
builtin_sources += hal.c
builtin_modules += storage
builtin_sources += storage.c
noinst_LTLIBRARIES = libbuiltin.la echo.la
libbuiltin_la_SOURCES = $(builtin_sources)
libbuiltin_la_LDFLAGS =
libbuiltin_la_CFLAGS = $(AM_CFLAGS) \
$(builtin_cflags) -DBLUETOOTH_PLUGIN_BUILTIN
BUILT_SOURCES = builtin.h
nodist_libbuiltin_la_SOURCES = $(BUILT_SOURCES)
noinst_LTLIBRARIES = echo.la
AM_LDFLAGS = -module -avoid-version -no-undefined
@ -44,28 +17,4 @@ AM_CFLAGS = -fvisibility=hidden @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ \
INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/src
CLEANFILES = $(BUILT_SOURCES)
MAINTAINERCLEANFILES = Makefile.in
builtin.h:
echo "" > $@
list='$(builtin_modules)'; for i in $$list; \
do echo "extern struct bluetooth_plugin_desc __bluetooth_builtin_$$i;" >> $@; done
echo "" >> $@
echo "static struct bluetooth_plugin_desc *__bluetooth_builtin[] = {" >> $@
list='$(builtin_modules)'; for i in $$list; \
do echo "&__bluetooth_builtin_$$i," >> $@; done
echo "NULL };" >> $@
all-local:
@$(LN_S) -f $(top_srcdir)/input/.libs/input.so
@$(LN_S) -f $(top_srcdir)/audio/.libs/audio.so
@$(LN_S) -f $(top_srcdir)/serial/.libs/serial.so
@$(LN_S) -f $(top_srcdir)/network/.libs/network.so
clean-local:
@rm -f network.so
@rm -f serial.so
@rm -f audio.so
@rm -f input.so

View File

@ -13,6 +13,37 @@ statedir = $(localstatedir)/lib/bluetooth
state_DATA =
endif
builtin_modules =
builtin_sources =
builtin_cflags =
if SERVICEPLUGIN
builtin_modules += service
builtin_sources += $(top_srcdir)/plugins/service.c
endif
builtin_modules += hciops
builtin_sources += $(top_srcdir)/plugins/hciops.c
builtin_modules += hal
builtin_sources += $(top_srcdir)/plugins/hal.c
builtin_modules += storage
builtin_sources += $(top_srcdir)/plugins/storage.c
noinst_LTLIBRARIES = libbuiltin.la
libbuiltin_la_SOURCES = $(builtin_sources)
libbuiltin_la_LDFLAGS =
libbuiltin_la_CFLAGS = $(AM_CFLAGS) \
$(builtin_cflags) -DBLUETOOTH_PLUGIN_BUILTIN
BUILT_SOURCES = builtin.h
nodist_libbuiltin_la_SOURCES = $(BUILT_SOURCES)
CLEANFILES = $(BUILT_SOURCES)
sbin_PROGRAMS = bluetoothd
bluetoothd_SOURCES = main.c security.c hcid.h sdpd.h \
@ -21,14 +52,15 @@ bluetoothd_SOURCES = main.c security.c hcid.h sdpd.h \
error.h error.c manager.h manager.c adapter.h adapter.c \
device.h device.c dbus-common.c dbus-common.h dbus-hci.h dbus-hci.c
bluetoothd_LDADD = $(top_builddir)/common/libhelper.a \
$(top_builddir)/plugins/libbuiltin.la \
bluetoothd_LDADD = $(top_builddir)/common/libhelper.a libbuiltin.la \
@GDBUS_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ @BLUEZ_LIBS@ -ldl
bluetoothd_LDFLAGS = -Wl,--export-dynamic
bluetoothd_DEPENDENCIES = libbuiltin.la
if MAINTAINER_MODE
plugindir = $(abs_top_srcdir)/plugins
plugindir = $(abs_top_srcdir)/plugins/.libs
else
plugindir = $(libdir)/bluetooth/plugins
endif
@ -36,7 +68,7 @@ endif
AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ \
-DPLUGINDIR=\""$(plugindir)"\"
INCLUDES = -I$(top_srcdir)/common -I$(top_builddir)/plugins
INCLUDES = -I$(top_srcdir)/common
if MANPAGES
man_MANS = bluetoothd.8
@ -45,3 +77,13 @@ endif
EXTRA_DIST = bluetooth.conf bluetoothd.8 main.conf
MAINTAINERCLEANFILES = Makefile.in
builtin.h:
echo "" > $@
list='$(builtin_modules)'; for i in $$list; \
do echo "extern struct bluetooth_plugin_desc __bluetooth_builtin_$$i;" >> $@; done
echo "" >> $@
echo "static struct bluetooth_plugin_desc *__bluetooth_builtin[] = {" >> $@
list='$(builtin_modules)'; for i in $$list; \
do echo "&__bluetooth_builtin_$$i," >> $@; done
echo "NULL };" >> $@