diff --git a/.gitignore b/.gitignore index aeb1414..c6a1e36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,14 @@ +.deps +aclocal.m4 +autom4te.cache +config.* +configure +depcomp espeakup -*.d +install-sh +Makefile +Makefile.in +missing +stamp-h1 *.o +*.swp diff --git a/Makefile b/Makefile deleted file mode 100644 index 482d916..0000000 --- a/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -INSTALL ?= install - -PREFIX ?= /usr/local -BINDIR ?= $(PREFIX)/bin -MANDIR ?= $(PREFIX)/share/man - -AUDIO ?= portaudio - -alsa_SRCS = alsa.c -portaudio_SRCS = portaudio.c - -SRCS = $($(AUDIO)_SRCS) \ - cli.c \ - espeak.c \ - espeakup.c \ - queue.c \ - signal.c \ - softsynth.c -OBJS = $(SRCS:.c=.o) - -DEPFLAGS = -MMD -WARNFLAGS = -Wall -ifeq ($(AUDIO),alsa) -SOUNDLIB = -lasound -endif -LDLIBS = -lespeak $(SOUNDLIB) - -all: espeakup - -install: espeakup - $(INSTALL) -d $(DESTDIR)$(BINDIR) - $(INSTALL) -d $(DESTDIR)$(MANDIR)/man8 - $(INSTALL) -m 755 $< $(DESTDIR)$(BINDIR) - $(INSTALL) -m 644 espeakup.8 $(DESTDIR)$(MANDIR)/man8 - -espeakup: $(OBJS) - -clean: - $(RM) *.d *.o - -distclean: clean - $(RM) espeakup - -%.o: %.c - $(COMPILE.c) $(DEPFLAGS) $(WARNFLAGS) $(OUTPUT_OPTION) $< - --include $(SRCS:.c=.d) diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..c516fe1 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,10 @@ +bin_PROGRAMS = espeakup +espeakup_SOURCES = espeakup.c espeakup.h cli.c espeak.c queue.c queue.h signal.c softsynth.c + +if ALSA +espeakup_SOURCES += alsa.c +else +espeakup_SOURCES += portaudio.c +endif + +dist_man8_MANS = espeakup.8 diff --git a/alsa.c b/alsa.c index 392b149..35235fc 100644 --- a/alsa.c +++ b/alsa.c @@ -22,6 +22,10 @@ * Description: Produce audio by calling the ALSA library directly. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/cli.c b/cli.c index 023d6cc..af8ec14 100644 --- a/cli.c +++ b/cli.c @@ -17,6 +17,10 @@ * along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -24,9 +28,6 @@ #include "espeakup.h" -/* program version */ -extern const char *Version; - /* default voice */ extern char *defaultVoice; @@ -53,10 +54,11 @@ static void show_help() static void show_version(void) { - printf("espeakup %s\n", Version); + printf("%s\n", PACKAGE_STRING); printf("Copyright (C) 2008 William Hubbs\n"); printf("License GPLv3+: GNU GPL version 3 or later\n"); printf("You are free to change and redistribute this software.\n"); + printf("Please report bugs to %s\n", PACKAGE_BUGREPORT); exit(0); } diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..d20967a --- /dev/null +++ b/configure.ac @@ -0,0 +1,43 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.65]) +AC_INIT([espeakup], [0.71], [w.d.hubbs@gmail.com]) +AM_INIT_AUTOMAKE([foreign]) +AC_CONFIG_SRCDIR([espeakup.c]) +AC_CONFIG_HEADERS([config.h]) + +# process command line options +AC_ARG_WITH([alsa], + [AS_HELP_STRING([--with-alsa],[build with ALSA support])], + [], + [with_alsa=no]) +AM_CONDITIONAL([ALSA], [test x$with_alsa = xyes]) + +# Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL + +# Checks for libraries. +if test x$with_alsa = xyes; then +AC_SEARCH_LIBS([snd_pcm_open], [asound]) +fi +AC_SEARCH_LIBS([espeak_Synth], [espeak]) + +# Checks for header files. +AC_CHECK_HEADERS([fcntl.h limits.h stddef.h stdlib.h string.h unistd.h espeak/speak_lib.h]) +if test x$with_alsa = xyes; then +AC_CHECK_HEADERS([alsa/asoundlib.h]) +fi + +# Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T + +# Checks for library functions. +AC_FUNC_MALLOC +AC_CHECK_FUNCS([memmove select strdup strrchr]) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/espeak.c b/espeak.c index 4a987b1..b308832 100644 --- a/espeak.c +++ b/espeak.c @@ -17,6 +17,10 @@ * along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/espeakup.c b/espeakup.c index b749bcb..38dcf4f 100644 --- a/espeakup.c +++ b/espeakup.c @@ -17,6 +17,10 @@ * along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -26,9 +30,6 @@ #include "espeakup.h" -/* program version */ -const char *Version = "0.71"; - /* path to our pid file */ const char *pidPath = "/var/run/espeakup.pid"; diff --git a/portaudio.c b/portaudio.c index 6e24b8c..82af6c6 100644 --- a/portaudio.c +++ b/portaudio.c @@ -1,3 +1,7 @@ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "espeakup.h" void select_audio_mode(void) diff --git a/queue.c b/queue.c index e1827da..9815e48 100644 --- a/queue.c +++ b/queue.c @@ -21,6 +21,10 @@ * along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/signal.c b/signal.c index 5996986..52f3ec6 100644 --- a/signal.c +++ b/signal.c @@ -17,6 +17,10 @@ * along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/softsynth.c b/softsynth.c index 9747963..4bac4f2 100644 --- a/softsynth.c +++ b/softsynth.c @@ -17,6 +17,10 @@ * along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tarball b/tarball deleted file mode 100755 index 12bf7ee..0000000 --- a/tarball +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Makes a tarball release - -VER=$(./version) -PREFIX=espeakup-${VER} -REL=${1:-v${VER}} - -if [ "$REL" != "v${VER}" ]; then - TIMESTAMP=`git show $REL --pretty=format:%ai |head -1` - PATCHLEVEL=`date --utc -d "$TIMESTAMP" +_p%Y%m%d%H%M` -fi - -TARFILE=${PREFIX}${PATCHLEVEL}.tar - -git archive --format=tar --prefix=${PREFIX}/ $REL > ${TARFILE} -tar f ${TARFILE} --delete ${PREFIX}/.gitignore --delete ${PREFIX}/tarball -mkdir ${PREFIX} -git log ${REL} > ${PREFIX}/ChangeLog -tar rf ${TARFILE} ${PREFIX} -rm -rf ${PREFIX} -bzip2 ${TARFILE} -echo "Produced ${TARFILE}.bz2" diff --git a/version b/version deleted file mode 100755 index de85fd8..0000000 --- a/version +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -ver=$(grep "const char.*Version" espeakup.c) -ver=${ver%\"*} -ver=${ver#*\"} -echo ${ver}