Converting to autoconf/automake
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 2 Dec 2005 12:32:47 +0000 (12:32 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 2 Dec 2005 12:32:47 +0000 (12:32 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@9 ffa7fe5e-494d-0410-b361-a75ebd5db220

AUTHORS [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
NEWS [new file with mode: 0644]
README [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.in [new file with mode: 0644]
src/speech.c

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..1bfdcf4
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS=src
diff --git a/NEWS b/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..fd0be89
--- /dev/null
@@ -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 (file)
index 0000000..300497d
--- /dev/null
@@ -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
+])
index c913629..8823e15 100644 (file)
@@ -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>
 #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;
 }