summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2005-12-02 12:32:47 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2005-12-02 12:32:47 +0000
commit24eab4b77aca9f4717149932c0be0989f680981a (patch)
tree589b1dd3e921ff810aeaa3907525747ce28eae65
parent785a3300dfe4159947c31a20bdaa01f8f27f2f35 (diff)
downloadnavit-24eab4b77aca9f4717149932c0be0989f680981a.tar.gz
Converting to autoconf/automake
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@9 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--AUTHORS0
-rw-r--r--ChangeLog0
-rw-r--r--Makefile.am1
-rw-r--r--NEWS0
-rw-r--r--README0
-rwxr-xr-xautogen.sh2
-rw-r--r--configure.in24
-rw-r--r--src/speech.c18
8 files changed, 43 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/AUTHORS
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ChangeLog
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 000000000..1bfdcf486
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS=src
diff --git a/NEWS b/NEWS
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/README
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 000000000..fd0be89ce
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+autoreconf --force --install -I config -I m4
diff --git a/configure.in b/configure.in
new file mode 100644
index 000000000..300497d9d
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,24 @@
+AC_INIT(navit, 0.0.1)
+AM_INIT_AUTOMAKE
+AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE
+
+AC_PROG_CC
+
+pkg_modules="glib-2.0 gtk+-2.0 ORBit-2.0"
+PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
+AC_SUBST(PACKAGE_CFLAGS)
+AC_SUBST(PACKAGE_LIBS)
+AC_CHECK_HEADER(libspeechd.h, AC_DEFINE([HAVE_LIBSPEECHD],[],Define to 1 if you have the <libspeechd.h> header file.), AC_MSG_WARN([*** no libspeechd.h -- Speech output disabled]))
+
+
+AC_CONFIG_SUBDIRS(src/fib-1.0)
+
+AC_OUTPUT([
+Makefile
+src/Makefile
+src/gui/Makefile
+src/gui/gtk/Makefile
+src/graphics/Makefile
+src/graphics/gtk_drawing_area/Makefile
+])
diff --git a/src/speech.c b/src/speech.c
index c913629c5..8823e1550 100644
--- a/src/speech.c
+++ b/src/speech.c
@@ -1,5 +1,5 @@
/* speechd simple client program
- * CVS revision: $Id: speech.c,v 1.1 2005-12-02 10:41:56 martin-s Exp $
+ * CVS revision: $Id: speech.c,v 1.2 2005-12-02 12:32:47 martin-s Exp $
* Author: Tomas Cerha <cerha@brailcom.cz> */
#include <sys/types.h>
@@ -11,8 +11,10 @@
#include <stdlib.h>
#include <glib.h>
#include <stdarg.h>
-
+#include "config.h"
+#ifdef HAVE_LIBSPEECHD
#include <libspeechd.h>
+#endif
#include "speech.h"
struct speech {
@@ -21,6 +23,7 @@ struct speech {
struct speech *
speech_new(void) {
+#ifdef HAVE_LIBSPEECHD
struct speech *this;
int sockfd;
@@ -32,30 +35,41 @@ speech_new(void) {
this->sockfd=sockfd;
}
return this;
+#else
+ return NULL;
+#endif
}
int
speech_say(struct speech *this, char *text) {
+#ifdef HAVE_LIBSPEECHD
int err;
err = spd_sayf(this->sockfd, 2, 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->sockfd);
g_free(this);
+#endif
return 0;
}