+modulebindingdir=$(pkglibdir)/binding
moduledatadir=$(pkglibdir)/data
modulegraphicsdir=$(pkglibdir)/graphics
moduleguidir=$(pkglibdir)/gui
AC_SUBST(IMLIB2_CFLAGS)
AC_SUBST(IMLIB2_LIBS)
+
+AC_ARG_ENABLE(MODULE_GUI_SDL, [ --disable-speech-speechd don't create speech speechd ], MODULE_SPEECH_SPEECHD=$enableval, MODULE_SPEECH_SPEECHD=yes)
AC_CHECK_HEADER(libspeechd.h, AC_DEFINE([HAVE_LIBSPEECHD],[],Define to 1 if you have the <libspeechd.h> header file.) SPEECHD_LIBS="-lspeechd" speechd=yes, AC_MSG_WARN([*** no libspeechd.h -- Speech output disabled]))
AC_SUBST(SPEECHD_CFLAGS)
AC_SUBST(SPEECHD_LIBS)
AM_CONDITIONAL(SPEECH_SPEECH_DISPATCHER, [test "x$speechd" = "xyes"])
-AC_ARG_ENABLE(MODULE_GUI_SDL, [ --disable-gui-sdl don't create gui sdl ],
-MODULE_GUI_SDL=$enableval, MODULE_GUI_SDL=yes)
+AC_ARG_ENABLE(MODULE_GUI_SDL, [ --disable-gui-sdl don't create gui sdl ], MODULE_GUI_SDL=$enableval, MODULE_GUI_SDL=yes)
if test "x$MODULE_GUI_GTK" = "xyes"; then
AC_CHECK_HEADER(
SDL/SDL.h,
AC_SUBST(GPSD_LIBS)
AM_CONDITIONAL(VEHICLE_GPSD, [test "x$gpsd" = "xyes"])
-PYTHON_LIB=""
-PYTHON_INC=""
+AC_ARG_ENABLE(MODULE_BINDING_PYTHON, [ --disable-binding-python don't create binding python ], MODULE_BINDING_PYTHON=$enableval, MODULE_BINDING_PYTHON=yes)
if test "$cross_compiling" = no; then
- AC_PATH_PROG(_PATH_PYTHON,[python])
- dnl Libraries and flags for embedded Python.
- dnl FIXME: I wish there was a less icky way to get this.
- if test x"$_PATH_PYTHON" != x ; then
- AC_MSG_CHECKING(for Python linkage)
- py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
- py_ver=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
- py_libdir="${py_prefix}/lib/python${py_ver}"
- PYTHON_INC="-I${py_prefix}/include/python${py_ver}"
- if test -f $py_libdir/config/Makefile ; then
- py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
- py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
- py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
- py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
- py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
- PYTHON_LIB="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $py_liblocalmod $py_libbasemod"
- PYTHON_LIB=`echo $PYTHON_LIB | sed -e 's/[ \\t]*/ /g'`
- CFLAGS="$CFLAGS $PYTHON_INC"
- LIBS="$LIBS $PYTHON_LIB"
- AC_MSG_RESULT($py_libdir)
- else
- AC_MSG_WARN([$py_libdir/config/Makefile missing, support for python disabled])
+ if test "x$MODULE_BINDING_PYTHON" = "xyes"; then
+ AC_PATH_PROG(_PATH_PYTHON,[python])
+ dnl Libraries and flags for embedded Python.
+ dnl FIXME: I wish there was a less icky way to get this.
+ if test x"$_PATH_PYTHON" != x ; then
+ AC_MSG_CHECKING(for Python linkage)
+ py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
+ py_ver=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
+ py_libdir="${py_prefix}/lib/python${py_ver}"
+ PYTHON_CFLAGS="-I${py_prefix}/include/python${py_ver}"
+ if test -f $py_libdir/config/Makefile ; then
+ py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
+ py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
+ py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
+ py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
+ py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
+ PYTHON_LIBS="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $py_liblocalmod $py_libbasemod"
+ PYTHON_LIBS=`echo $PYTHON_LIB | sed -e 's/[ \\t]*/ /g'`
+ AC_DEFINE(HAVE_PYTHON, 1, [Define to 1 if you have python])
+ python=yes
+ AC_MSG_RESULT($py_libdir)
+ else
+ AC_MSG_WARN([$py_libdir/config/Makefile missing, support for python disabled])
+ fi
fi
fi
else
AC_MSG_WARN([*** cross compiling, support for python disabled])
fi
-AC_SUBST(PYTHON_LIB)
-AC_SUBST(PYTHON_INC)
+AC_SUBST(PYTHON_CFLAGS)
+AC_SUBST(PYTHON_LIBS)
+AM_CONDITIONAL(BINDING_PYTHON, [test "x$python" = "xyes"])
LIBS="$LIBS -lm -rdynamic"
Makefile
src/Makefile
src/binding/Makefile
+src/binding/python/Makefile
src/data/Makefile
src/data/mg/Makefile
src/data/textfile/Makefile
include $(top_srcdir)/Makefile.inc
SUBDIRS=binding data fib-1.1 gui graphics osd speech vehicle xpm
-AM_CPPFLAGS = -I$(top_srcdir)/src/fib-1.1 @NAVIT_CFLAGS@ @SPEECHD_CFLAGS@ -DMODULE=\"navit\"
+AM_CPPFLAGS = -I$(top_srcdir)/src/fib-1.1 @NAVIT_CFLAGS@ -DMODULE=\"navit\"
bin_PROGRAMS = navit
navit_SOURCES = attr.c callback.c compass.c coord.c country.c cursor.c data_window.c debug.c \
file.c graphics.c gui.c item.c layout.c log.c main.c map.c \
mapset.c maptype.c menu.c navit.c navigation.c param.c phrase.c plugin.c popup.c \
- profile.c python.c route.c search.c speech.c transform.c track.c \
+ profile.c route.c search.c speech.c transform.c track.c \
util.c vehicle.c xmlconfig.c attr.h attr_def.h callback.h color.h compass.h coord.h country.h \
cursor.h data.h data_window.h data_window_int.h debug.h destination.h draw_info.h \
file.h graphics.h gtkext.h gui.h item.h item_def.h log.h layer.h layout.h map-share.h map.h\
param.h phrase.h plugin.h point.h plugin_def.h projection.h popup.h route.h profile.h search.h speech.h statusbar.h \
transform.h track.h util.h vehicle.h xmlconfig.h
-navit_LDADD = @NAVIT_LIBS@ @GPSD_LIBS@ @SPEECHD_LIBS@ -Lfib-1.1 -lfib
+navit_LDADD = @NAVIT_LIBS@ @GPSD_LIBS@ -Lfib-1.1 -lfib
SUBDIRS=
+if BINDING_PYTHON
+ SUBDIRS+=python
+endif
--- /dev/null
+include $(top_srcdir)/Makefile.inc
+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
#include "config.h"
-#ifdef HAVE_PYTHON
#include <Python.h>
#include <fcntl.h>
#include "coord.h"
#include "map.h"
#include "mapset.h"
+#include "plugin.h"
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
#define Obj_HEAD PyObject_HEAD_INIT(NULL);
if (!PyArg_ParseTuple(args, "O!:navit.map_rect_rect",&coord_rect_Type,&r))
return NULL;
ret=PyObject_NEW(map_rectObject, &map_rect_Type);
- ret->mr=map_rect_new(self->m, r->r, NULL, 0);
+ ret->mr=map_rect_new(self->m, NULL);
return (PyObject *)ret;
}
};
-void python_init(void)
+void
+plugin_init(void)
{
int fd,size;
char buffer[65536];
Py_Finalize();
exit(0);
}
-#endif
#include "debug.h"
#include "navit.h"
#include "gui.h"
-#ifdef HAVE_PYTHON
-#include "python.h"
-#endif
#include "plugin.h"
#include "xmlconfig.h"
gdk_rgb_init();
#endif
-#ifdef HAVE_PYTHON
- python_init();
-#endif
if (argc > 1)
config_file=argv[1];
else {
void
phrase_route_calc(void *speech)
{
+#if 0
if (! speech)
return;
speech_say(speech,"Die Route wird berechnet\n");
+#endif
}
void
+++ /dev/null
-void python_init(void);
-
-/* speechd simple client program
- * CVS revision: $Id: speech.c,v 1.4 2006-01-03 21:37:48 martin-s Exp $
- * Author: Tomas Cerha <cerha@brailcom.cz> */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <stdarg.h>
-#include "config.h"
-#ifdef HAVE_LIBSPEECHD
-#include <libspeechd.h>
-#endif
#include "speech.h"
-
-struct speech {
-#ifdef HAVE_LIBSPEECHD
- SPDConnection *conn;
-#endif
-};
-
-struct speech *
-speech_new(void) {
-#ifdef HAVE_LIBSPEECHD
- struct speech *this;
- SPDConnection *conn;
-
- conn = spd_open("navit","main",NULL,SPD_MODE_SINGLE);
- if (! conn)
- return NULL;
- this=g_new(struct speech,1);
- if (this) {
- this->conn=conn;
- spd_set_punctuation(conn, SPD_PUNCT_NONE);
- }
- return this;
-#else
- return NULL;
-#endif
-}
-
-int
-speech_say(struct speech *this, char *text) {
-#ifdef HAVE_LIBSPEECHD
- int err;
-
- err = spd_sayf(this->conn, SPD_MESSAGE, text);
- if (err != 1)
- return 1;
-#endif
- return 0;
-}
-
-int
-speech_sayf(struct speech *this, char *format, ...) {
-#ifdef HAVE_LIBSPEECHD
- char buffer[8192];
- va_list ap;
- va_start(ap,format);
- vsnprintf(buffer, 8192, format, ap);
- return speech_say(this, buffer);
-#else
- return 0;
-#endif
-}
-
-int
-speech_destroy(struct speech *this) {
-#ifdef HAVE_LIBSPEECHD
- spd_close(this->conn);
- g_free(this);
-#endif
- return 0;
-}
+#if 0
struct speech;
struct speech *speech_new(void);
int speech_say(struct speech *this, char *text);
int speech_sayf(struct speech *this, char *format, ...);
int speech_destroy(struct speech *this);
+#endif
+
+/* speechd simple client program
+ * CVS revision: $Id: speech_speech_dispatcher.c,v 1.2 2007-07-08 16:42:16 martin-s Exp $
+ * Author: Tomas Cerha <cerha@brailcom.cz> */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <glib.h>
+#include <stdarg.h>
+#include "config.h"
+#include <libspeechd.h>
#include "plugin.h"
+#include "speech.h"
+
+struct speech {
+ SPDConnection *conn;
+};
+
+struct speech *
+speech_new(void) {
+ struct speech *this;
+ SPDConnection *conn;
+
+ conn = spd_open("navit","main",NULL,SPD_MODE_SINGLE);
+ if (! conn)
+ return NULL;
+ this=g_new(struct speech,1);
+ if (this) {
+ this->conn=conn;
+ spd_set_punctuation(conn, SPD_PUNCT_NONE);
+ }
+ return this;
+}
+static int
+speech_say(struct speech *this, char *text) {
+ int err;
+
+ err = spd_sayf(this->conn, SPD_MESSAGE, text);
+ if (err != 1)
+ return 1;
+ return 0;
+}
+
+static int
+speech_sayf(struct speech *this, char *format, ...) {
+ char buffer[8192];
+ va_list ap;
+ va_start(ap,format);
+ vsnprintf(buffer, 8192, format, ap);
+ return speech_say(this, buffer);
+}
+
+static void
+speech_destroy(struct speech *this) {
+ spd_close(this->conn);
+ g_free(this);
+}
void
plugin_init(void)
{