[
AC_DISABLE_SHARED
AC_ENABLE_STATIC
+ plugins=$enableval
],
[
AC_ENABLE_SHARED
AC_DISABLE_STATIC
AC_DEFINE(
- [HAVE_PLUGIN],
+ [USE_PLUGINS],
[],
Define to 1 if you have plugins.
)
+ plugins=yes
]
)
AC_PROG_LIBTOOL
AC_SUBST(GTK2_LIBS)
AM_CONDITIONAL(GUI_GTK, [test "x$gtk2_pkgconfig" = "xyes"])
AM_CONDITIONAL(GRAPHICS_GTK_DRAWING_AREA, [test "x$gtk2_pkgconfig" = "xyes"])
+AM_CONDITIONAL(PLUGINS, [test "x$plugins" = "xyes"])
PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no])
if test "x$freetype2_pkgconfig" = "xyes"; then
SUBDIRS += maps
endif
-AM_CPPFLAGS = -I$(top_srcdir)/src/fib-1.1 @NAVIT_CFLAGS@ -DPREFIX=\"@prefix@\" -DMODULE=\"navit\"
+AM_CPPFLAGS = -I$(top_srcdir)/src/fib-1.1 @NAVIT_CFLAGS@ -DPREFIX=\"@prefix@\" -DMODULE=navit
BUILT_SOURCES=osm2navit
bin_PROGRAMS = navit osm2navit
navit_LDADD = @NAVIT_LIBS@ @ZLIB_LIBS@ -Lfib-1.1 -lfib
+if !PLUGINS
+ navit_SOURCES += builtin.c
+ navit_LDADD += $(wildcard $(top_builddir)/src/*/*/*.la)
+endif
+
+builtin.c:
+ ls $(top_builddir)/src/*/*/*.la | sed -e "s/.la/_init(void);/" -e "s/.*lib/extern void /" >builtin.c
+ echo "extern void builtin_init(void);" >>builtin.c
+ echo "void builtin_init(void) {" >>builtin.c
+ ls $(top_builddir)/src/*/*/*.la | sed -e "s/.la/_init();/" -e "s/.*lib/ module_/" >>builtin.c
+ echo "}" >>builtin.c
+
osm2navit_LDADD = @NAVIT_LIBS@ @ZLIB_LIBS@
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ @PYTHON_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"binding_python\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ @PYTHON_CFLAGS@ -I$(top_srcdir)/src -DMODULE=binding_python
modulebinding_LTLIBRARIES = libbinding_python.la
libbinding_python_la_SOURCES = binding_python.c
libbinding_python_la_LIBADD = @PYTHON_LIBS@
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"data_binfile\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=data_binfile
moduledata_LTLIBRARIES = libdata_binfile.la
libdata_binfile_la_SOURCES = binfile.c
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include "config.h"
#include "debug.h"
#include "plugin.h"
#include "projection.h"
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"data_garmin\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=data_garmin
AM_CPPFLAGS+= @LIBGARMIN_CFLAGS@
INCLUDES=-I$(top_srcdir)/src/data/garmin/libgarmin
AM_CPPFLAGS+=-I$(top_srcdir)/src/data/garmin/libgarmin
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include "config.h"
#include "plugin.h"
#include "data.h"
#include "projection.h"
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"data_garmin_img\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=data_garmin_img
moduledata_LTLIBRARIES = libdata_garmin_img.la
libdata_garmin_img_la_SOURCES = garmin_img.c
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include "config.h"
#include "plugin.h"
#include "data.h"
#include "projection.h"
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"data_mg\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=data_mg
moduledata_LTLIBRARIES = libdata_mg.la
libdata_mg_la_SOURCES = map.c block.c town.c tree.c poly.c street.c mg.h
#include <stdio.h>
#include <string.h>
+#include "config.h"
#include "debug.h"
#include "plugin.h"
#include "maptype.h"
SUBDIRS=libmdb
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -I$(srcdir)/libmdb/include -DMODULE=\"data_poi_geodownload\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -I$(srcdir)/libmdb/include -DMODULE=data_poi_geodownload
moduledata_LTLIBRARIES = libdata_poi_geodownload.la
libdata_poi_geodownload_la_SOURCES = poi_geodownload.c
libdata_poi_geodownload_la_LIBADD = -Llibmdb -lmdb
#include <mdbtools.h>
+#include "config.h"
#include "debug.h"
#include "coord.h"
#include "projection.h"
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"data_textfile\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=data_textfile
moduledata_LTLIBRARIES = libdata_textfile.la
libdata_textfile_la_SOURCES = textfile.c textfile.h
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include "config.h"
#include "debug.h"
#include "plugin.h"
#include "projection.h"
#include <stdarg.h>
extern int debug_level;
-#define dbg(level,fmt...) ({ if (debug_level >= level) debug_printf(level,MODULE,__PRETTY_FUNCTION__,1,fmt); })
+#define dbg_str2(x) #x
+#define dbg_str1(x) dbg_str2(x)
+#define dbg_module dbg_str1(MODULE)
+#define dbg(level,fmt...) ({ if (debug_level >= level) debug_printf(level,dbg_module,__PRETTY_FUNCTION__,1,fmt); })
/* prototypes */
void debug_init(void);
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @GTK2_CFLAGS@ @FREETYPE2_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"graphics_gtk_drawing_area\"
+AM_CPPFLAGS = @GTK2_CFLAGS@ @FREETYPE2_CFLAGS@ -I$(top_srcdir)/src -DMODULE=graphics_gtk_drawing_area
modulegraphics_LTLIBRARIES = libgraphics_gtk_drawing_area.la
libgraphics_gtk_drawing_area_la_SOURCES = graphics_gtk_drawing_area.c
libgraphics_gtk_drawing_area_la_LDFLAGS = @GTK2_LIBS@
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"graphics_null\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=graphics_null
modulegraphics_LTLIBRARIES = libgraphics_null.la
libgraphics_null_la_SOURCES = graphics_null.c
#include <glib.h>
+#include "config.h"
#include "point.h"
#include "graphics.h"
#include "color.h"
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ @OPENGL_CFLAGS@ @GLC_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"graphics_opengl\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ @OPENGL_CFLAGS@ @GLC_CFLAGS@ -I$(top_srcdir)/src -DMODULE=graphics_opengl
modulegraphics_LTLIBRARIES = libgraphics_opengl.la
libgraphics_opengl_la_SOURCES = graphics_opengl.c
libgraphics_opengl_la_LIBADD = @OPENGL_LIBS@ @GLC_LIBS@
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = -I$(top_srcdir)/src @NAVIT_CFLAGS@ @GTK2_CFLAGS@ -DMODULE=\"gui_gtk\"
+AM_CPPFLAGS = -I$(top_srcdir)/src @NAVIT_CFLAGS@ @GTK2_CFLAGS@ -DMODULE=gui_gtk
modulegui_LTLIBRARIES = libgui_gtk.la
libgui_gtk_la_SOURCES = datawindow.c destination.c gui_gtk_statusbar.c gui_gtk_action.c gui_gtk_window.c gui_gtk.h
libgui_gtk_la_LIBADD = @GTK2_LIBS@
#endif
#include <libintl.h>
#include <gtk/gtk.h>
+#include "config.h"
#include "navit.h"
#include "debug.h"
#include "gui.h"
include $(top_srcdir)/Makefile.inc
SUBDIRS=datafiles
-AM_CPPFLAGS = @NAVIT_CFLAGS@ @CEGUI_CFLAGS@ @GLC_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"gui_sdl\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ @CEGUI_CFLAGS@ @GLC_CFLAGS@ -I$(top_srcdir)/src -DMODULE=gui_sdl
modulegui_LTLIBRARIES = libgui_sdl.la
libgui_sdl_la_SOURCES = gui_sdl_window.cpp sdl_events.cpp gui_sdl.h sdl_events.h wmcontrol.c wmcontrol.h cegui_keyboard.cpp cegui_keyboard.h
libgui_sdl_la_LIBADD = @SDL_LIBS@ @CEGUI_LIBS@ @OPENGL_LIBS@ @GLC_LIBS@
#ifdef USE_GTK_MAIN_LOOP
#include <gtk/gtk.h>
#endif
+#include "config.h"
#include "file.h"
#include "debug.h"
#include "main.h"
#include "navit.h"
#include "gui.h"
-#include "plugin.h"
#include "xmlconfig.h"
#define _(STRING) gettext(STRING)
textdomain( "navit" );
debug_init();
+#ifndef USE_PLUGINS
+ extern void builtin_init(void);
+ builtin_init();
+#endif
#if 0
/* handled in gui/gtk */
gtk_set_locale();
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"osd_core\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=osd_core
moduleosd_LTLIBRARIES = libosd_core.la
libosd_core_la_SOURCES = osd_core.c
#include <math.h>
#include <stdio.h>
#include <glib.h>
+#include "config.h"
#include "item.h"
#include "point.h"
#include "coord.h"
#include <glib.h>
#include <gmodule.h>
+#include "config.h"
#include "plugin.h"
#include "file.h"
#define PLUGIN_C
void
plugins_init(struct plugins *pls)
{
+#ifdef USE_PLUGINS
struct plugin *pl;
GList *l;
plugin_call_init(pl);
l=g_list_next(l);
}
+#endif
}
void
#include "plugin_def.h"
+#ifndef USE_PLUGINS
+#define plugin_module_cat3(pre,mod,post) pre##mod##post
+#define plugin_module_cat2(pre,mod,post) plugin_module_cat3(pre,mod,post)
+#define plugin_module_cat(pre,post) plugin_module_cat2(pre,MODULE,post)
+#define plugin_init plugin_module_cat(module_,_init)
+#endif
+
void plugin_init(void);
+
/* prototypes */
struct plugin *plugin_new(char *plugin);
int plugin_load(struct plugin *pl);
#include <mdbtools.h>
+#include "config.h"
#include "display.h"
#include "container.h"
#include "coord.h"
#ifdef __cplusplus
extern "C" {
#endif
-#define profile(level,fmt...) profile_timer(level,MODULE,__PRETTY_FUNCTION__,fmt)
+#define profile_str2(x) #x
+#define profile_str1(x) profile_str2(x)
+#define profile_module profile_str1(MODULE)
+#define profile(level,fmt...) profile_timer(level,profile_module,__PRETTY_FUNCTION__,fmt)
void profile_timer(int level, const char *module, const char *function, const char *fmt, ...);
#ifdef __cplusplus
}
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"speech_cmdline\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=speech_cmdline
modulespeech_LTLIBRARIES = libspeech_cmdline.la
libspeech_cmdline_la_SOURCES = speech_cmdline.c
#include <stdlib.h>
#include <glib.h>
+#include "config.h"
#include "plugin.h"
#include "speech.h"
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"speech_speech_dispatcher\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=speech_speech_dispatcher
modulespeech_LTLIBRARIES = libspeech_speech_dispatcher.la
libspeech_speech_dispatcher_la_SOURCES = speech_speech_dispatcher.c
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"vehicle_demo\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=vehicle_demo
modulevehicle_LTLIBRARIES = libvehicle_demo.la
libvehicle_demo_la_SOURCES = vehicle_demo.c
#include <glib.h>
+#include "config.h"
#include "debug.h"
#include "coord.h"
#include "item.h"
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"vehicle_file\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=vehicle_file
modulevehicle_LTLIBRARIES = libvehicle_file.la
libvehicle_file_la_SOURCES = vehicle_file.c
#include <sys/stat.h>
#include <termios.h>
#include <math.h>
+#include "config.h"
#include "debug.h"
#include "callback.h"
#include "plugin.h"
include $(top_srcdir)/Makefile.inc
-AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"vehicle_gpsd\"
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=vehicle_gpsd
modulevehicle_LTLIBRARIES = libvehicle_gpsd.la
libvehicle_gpsd_la_SOURCES = vehicle_gpsd.c
libvehicle_gpsd_la_LIBADD = @GPSD_LIBS@