convert to autotools

This commit is contained in:
William Hubbs 2010-05-04 12:59:53 -05:00
commit 056dcf70fe
14 changed files with 99 additions and 82 deletions

13
.gitignore vendored
View file

@ -1,3 +1,14 @@
.deps
aclocal.m4
autom4te.cache
config.*
configure
depcomp
espeakup
*.d
install-sh
Makefile
Makefile.in
missing
stamp-h1
*.o
*.swp

View file

@ -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)

10
Makefile.am Normal file
View file

@ -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

4
alsa.c
View file

@ -22,6 +22,10 @@
* Description: Produce audio by calling the ALSA library directly.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

10
cli.c
View file

@ -17,6 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
@ -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);
}

43
configure.ac Normal file
View file

@ -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

View file

@ -17,6 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -17,6 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include <signal.h>
#include <stdio.h>
@ -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";

View file

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "espeakup.h"
void select_audio_mode(void)

View file

@ -21,6 +21,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -17,6 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <signal.h>
#include <stdio.h>
#include <string.h>

View file

@ -17,6 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>

22
tarball
View file

@ -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"

View file

@ -1,5 +0,0 @@
#!/bin/bash
ver=$(grep "const char.*Version" espeakup.c)
ver=${ver%\"*}
ver=${ver#*\"}
echo ${ver}