mirror of git://git.sysmocom.de/ofono
Add directory for driver plugins
This commit is contained in:
parent
f2e2cd7787
commit
0acaee5e1e
|
@ -27,3 +27,4 @@ src/ofonod
|
|||
src/ofono.exp
|
||||
src/ofono.ver
|
||||
plugins/builtin.h
|
||||
drivers/builtin.h
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
SUBDIRS = gdbus gatchat include plugins src doc
|
||||
SUBDIRS = gdbus gatchat include plugins drivers src doc
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles
|
||||
|
||||
|
|
|
@ -86,5 +86,5 @@ AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
|
|||
AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
|
||||
|
||||
AC_OUTPUT(Makefile gdbus/Makefile gatchat/Makefile
|
||||
include/Makefile include/version.h
|
||||
src/Makefile plugins/Makefile doc/Makefile)
|
||||
include/Makefile include/version.h src/Makefile
|
||||
plugins/Makefile drivers/Makefile doc/Makefile)
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
builtin_modules =
|
||||
builtin_sources =
|
||||
builtin_cflags =
|
||||
|
||||
noinst_LTLIBRARIES = libbuiltin.la
|
||||
|
||||
libbuiltin_la_SOURCES = $(builtin_sources)
|
||||
libbuiltin_la_LDFLAGS =
|
||||
libbuiltin_la_CFLAGS = $(AM_CFLAGS) $(builtin_cflags) -DOFONO_PLUGIN_BUILTIN
|
||||
|
||||
BUILT_SOURCES = builtin.h
|
||||
|
||||
nodist_libbuiltin_la_SOURCES = $(BUILT_SOURCES)
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
builtin.h:
|
||||
echo "" > $@
|
||||
list='$(builtin_modules)'; for i in $$list; \
|
||||
do echo "extern struct ofono_plugin_desc __ofono_builtin_$$i;" >> $@; done
|
||||
echo "" >> $@
|
||||
echo "static struct ofono_plugin_desc *__ofono_drivers[] = {" >> $@
|
||||
list='$(builtin_modules)'; for i in $$list; \
|
||||
do echo "&__ofono_builtin_$$i," >> $@; done
|
||||
echo "NULL };" >> $@
|
|
@ -22,7 +22,7 @@ builtin.h:
|
|||
list='$(builtin_modules)'; for i in $$list; \
|
||||
do echo "extern struct ofono_plugin_desc __ofono_builtin_$$i;" >> $@; done
|
||||
echo "" >> $@
|
||||
echo "static struct ofono_plugin_desc *__ofono_builtin[] = {" >> $@
|
||||
echo "static struct ofono_plugin_desc *__ofono_plugins[] = {" >> $@
|
||||
list='$(builtin_modules)'; for i in $$list; \
|
||||
do echo "&__ofono_builtin_$$i," >> $@; done
|
||||
echo "NULL };" >> $@
|
||||
|
|
|
@ -14,6 +14,7 @@ ofonod_SOURCES = main.c ofono.h log.c plugin.c \
|
|||
call-settings.c call-waiting.c call-forwarding.c call-meter.c
|
||||
|
||||
ofonod_LDADD = $(top_builddir)/plugins/libbuiltin.la \
|
||||
$(top_builddir)/drivers/libbuiltin.la \
|
||||
@GDBUS_LIBS@ @GLIB_LIBS@ @GTHREAD_LIBS@ -ldl
|
||||
|
||||
ofonod_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=ofono.ver
|
||||
|
|
17
src/plugin.c
17
src/plugin.c
|
@ -89,6 +89,7 @@ static gboolean check_plugin(struct ofono_plugin_desc *desc,
|
|||
}
|
||||
|
||||
#include "plugins/builtin.h"
|
||||
#include "drivers/builtin.h"
|
||||
|
||||
int __ofono_plugin_init(const char *pattern, const char *exclude)
|
||||
{
|
||||
|
@ -100,12 +101,20 @@ int __ofono_plugin_init(const char *pattern, const char *exclude)
|
|||
|
||||
DBG("");
|
||||
|
||||
for (i = 0; __ofono_builtin[i]; i++) {
|
||||
if (check_plugin(__ofono_builtin[i],
|
||||
pattern, exclude) == FALSE)
|
||||
for (i = 0; __ofono_plugins[i]; i++) {
|
||||
if (check_plugin(__ofono_plugins[i],
|
||||
pattern, exclude) == FALSE)
|
||||
continue;
|
||||
|
||||
add_plugin(NULL, __ofono_builtin[i]);
|
||||
add_plugin(NULL, __ofono_plugins[i]);
|
||||
}
|
||||
|
||||
for (i = 0; __ofono_drivers[i]; i++) {
|
||||
if (check_plugin(__ofono_drivers[i],
|
||||
pattern, exclude) == FALSE)
|
||||
continue;
|
||||
|
||||
add_plugin(NULL, __ofono_drivers[i]);
|
||||
}
|
||||
|
||||
dir = g_dir_open(PLUGINDIR, 0, NULL);
|
||||
|
|
Loading…
Reference in New Issue