speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] remove libsdaudio library


From: William Hubbs
Subject: [PATCH 2/2] remove libsdaudio library
Date: Sat, 18 Dec 2010 16:51:05 -0600

libsdaudio now consists of one object which is only used in the modules,
so link it directly into the modules instead of using a shared library.
A future change will make this code only link into modules that need it.

The original idea for this change came from OpenTTS.
---
 configure.ac                        |   12 +-------
 src/modules/Makefile.am             |   51 +++++++++++++++-------------------
 src/modules/audio/Makefile.am       |    8 -----
 src/modules/{audio => }/spd_audio.c |    0
 src/modules/{audio => }/spd_audio.h |    0
 5 files changed, 24 insertions(+), 47 deletions(-)
 rename src/modules/{audio => }/spd_audio.c (100%)
 rename src/modules/{audio => }/spd_audio.h (100%)

diff --git a/configure.ac b/configure.ac
index b68d531..079de31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,19 +78,16 @@ AC_CHECK_FUNCS([strerror strncasecmp strndup strstr strtol])
 if test "$GCC" = yes; then
        EXTRA_SOCKET_LIBS=""
        ERROR_CFLAGS="-Wall"
-       RPATH="-rpath"
        RDYNAMIC="-rdynamic"
 else
        EXTRA_ESPEAK_LIBS="-lCstd -lCrun"
        EXTRA_SOCKET_LIBS="-lsocket -lnsl"
        ERROR_CFLAGS="-errwarn=%all -errtags=yes 
-erroff=E_STATEMENT_NOT_REACHED"
-       RPATH="-R"
        RDYNAMIC=""
 fi
 AC_SUBST([EXTRA_ESPEAK_LIBS])
 AC_SUBST([EXTRA_SOCKET_LIBS])
 AC_SUBST([ERROR_CFLAGS])
-AC_SUBST([RPATH])
 AC_SUBST([RDYNAMIC])
 
 # Check for python support.
@@ -300,14 +297,7 @@ AC_SUBST([default_audio_method])
 # We'll build these modules:
 AC_SUBST([audio_dlopen_modules])
 
-# current, age and revision values for shared libraries.
-LIB_SDAUDIO_CURRENT=2 # Current main version (increment on every API change -- 
incompatible AND extensions)
-LIB_SDAUDIO_REVISION=4 # Current minor version (increment on every 
implementation change)
-LIB_SDAUDIO_AGE=0 # Number of backward compatible main versions 
(LIB_SDAUDIO_CURRENT incrementations since last incompatible)
-AC_SUBST([LIB_SDAUDIO_CURRENT])
-AC_SUBST([LIB_SDAUDIO_REVISION])
-AC_SUBST([LIB_SDAUDIO_AGE])
-
+# current, age and revision values for libspeechd.
 LIB_SPD_CURRENT=5 # Current main version (increment on every API change -- 
incompatible AND extensions)
 LIB_SPD_REVISION=0 # Current minor version (increment on every implementation 
change)
 LIB_SPD_AGE=3 # Number of backward compatible main versions (LIB_SPD_CURRENT 
incrementations since last incompatible)
diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am
index 91af5bd..d18b63f 100644
--- a/src/modules/Makefile.am
+++ b/src/modules/Makefile.am
@@ -2,48 +2,46 @@
 
 SUBDIRS = audio
 
-inc_local = -I$(top_srcdir)/include -I$(top_srcdir)/src/modules/audio
-lib_audio = -L$(top_builddir)/src/modules/audio
+inc_local = -I$(top_srcdir)/include
+audio_SOURCES = spd_audio.c spd_audio.h
 common_SOURCES = module_main.c module_utils.c module_utils.h
 
 AM_CFLAGS = $(ERROR_CFLAGS)
 AM_CPPFLAGS = $(inc_local) -DDATADIR=\"$(snddatadir)\" -D_GNU_SOURCE \
+       -DPLUGIN_DIR="\"$(audiodir)\"" \
        $(DOTCONF_CFLAGS) $(GLIB_CFLAGS) $(GTHREAD_CFLAGS) \
        $(ibmtts_include) $(SNDFILE_CFLAGS)
 
 modulebin_PROGRAMS = sd_dummy sd_generic sd_festival sd_cicero
 
-sd_dummy_SOURCES = dummy.c $(common_SOURCES) module_utils_addvoice.c
-sd_dummy_LDFLAGS = $(RPATH) '$(spdlibdir)' $(lib_audio)
-sd_dummy_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio \
+sd_dummy_SOURCES = dummy.c $(audio_SOURCES) $(common_SOURCES) \
+       module_utils_addvoice.c
+sd_dummy_LDADD = $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) -lpthread \
        $(SNDFILE_LIBS) $(DOTCONF_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS)
 dist_snddata_DATA = dummy-message.wav
 
 sd_festival_SOURCES = festival.c festival_client.c festival_client.h \
-       $(common_SOURCES)
-sd_festival_LDFLAGS = $(RPATH) '$(spdlibdir)' $(lib_audio)
-sd_festival_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio \
+       $(audio_SOURCES) $(common_SOURCES)
+sd_festival_LDADD = $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) \
        -lpthread $(DOTCONF_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS) 
$(EXTRA_SOCKET_LIBS)
 
-sd_generic_SOURCES = generic.c $(common_SOURCES) module_utils_addvoice.c
-sd_generic_LDFLAGS = $(RPATH) '$(spdlibdir)' $(lib_audio)
-sd_generic_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio \
+sd_generic_SOURCES = generic.c $(audio_SOURCES) $(common_SOURCES) \
+       module_utils_addvoice.c
+sd_generic_LDADD = $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) \
        -lpthread $(DOTCONF_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS)
 
-sd_cicero_SOURCES = cicero.c $(common_SOURCES)
-sd_cicero_LDFLAGS = $(RPATH) '$(spdlibdir)' $(lib_audio)
-sd_cicero_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio \
+sd_cicero_SOURCES = cicero.c $(audio_SOURCES) $(common_SOURCES)
+sd_cicero_LDADD = $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) \
        -lpthread $(DOTCONF_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS)
 
 if flite_support
 modulebin_PROGRAMS += sd_flite
-sd_flite_SOURCES = flite.c $(common_SOURCES)
-sd_flite_LDFLAGS = $(RPATH) '$(spdlibdir)' $(lib_audio)
-sd_flite_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio \
+sd_flite_SOURCES = flite.c $(audio_SOURCES) $(common_SOURCES)
+sd_flite_LDADD = $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) \
        $(flite_kal) $(flite_basic) -lpthread $(DOTCONF_LIBS) $(GLIB_LIBS) \
        $(GTHREAD_LIBS)
@@ -51,9 +49,9 @@ endif
 
 if ibmtts_support
 modulebin_PROGRAMS += sd_ibmtts
-sd_ibmtts_SOURCES = ibmtts.c $(common_SOURCES) module_utils_addvoice.c
-sd_ibmtts_LDFLAGS = $(RPATH) '$(spdlibdir)' $(lib_audio)
-sd_ibmtts_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio \
+sd_ibmtts_SOURCES = ibmtts.c $(audio_SOURCES) $(common_SOURCES) \
+       module_utils_addvoice.c
+sd_ibmtts_LDADD = $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) \
        -lm -lpthread -libmeci $(SNDFILE_LIBS) $(DOTCONF_LIBS) \
        $(GLIB_LIBS) $(GTHREAD_LIBS)
@@ -61,9 +59,8 @@ endif
 
 if espeak_support
 modulebin_PROGRAMS += sd_espeak
-sd_espeak_SOURCES = espeak.c $(common_SOURCES)
-sd_espeak_LDFLAGS = $(RPATH) '$(spdlibdir)' $(lib_audio)
-sd_espeak_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio \
+sd_espeak_SOURCES = espeak.c $(audio_SOURCES) $(common_SOURCES)
+sd_espeak_LDADD = $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) \
        -lespeak $(SNDFILE_LIBS) $(EXTRA_ESPEAK_LIBS) $(DOTCONF_LIBS) \
        $(GLIB_LIBS) $(GTHREAD_LIBS)
@@ -72,8 +69,7 @@ endif
 if ivona_support
 modulebin_PROGRAMS += sd_ivona
 sd_ivona_SOURCES = ivona.c ivona_client.c ivona_client.h $(common_SOURCES)
-sd_ivona_LDFLAGS = $(RPATH) '$(spdlibdir)' $(lib_audio)
-sd_ivona_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio \
+sd_ivona_LDADD = $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) \
        -ldumbtts -lpthread $(SNDFILE_LIBS) $(DOTCONF_LIBS) $(GLIB_LIBS) \
        $(GTHREAD_LIBS)
@@ -81,9 +77,8 @@ endif
 
 if pico_support
 modulebin_PROGRAMS += sd_pico
-sd_pico_SOURCES = pico.c $(common_SOURCES)
-sd_pico_LDFLAGS = $(RPATH) '$(spdlibdir)' $(lib_audio)
-sd_pico_LDADD = $(top_builddir)/src/common/libcommon.la -lsdaudio \
+sd_pico_SOURCES = pico.c $(audio_SOURCES) $(common_SOURCES)
+sd_pico_LDADD = $(top_builddir)/src/common/libcommon.la \
        $(audio_dlopen_modules) -lttspico \
        $(DOTCONF_LIBS) $(GLIB_LIBS) $(GTHREAD_LIBS)
 endif
diff --git a/src/modules/audio/Makefile.am b/src/modules/audio/Makefile.am
index 4635ea4..d84fcdb 100644
--- a/src/modules/audio/Makefile.am
+++ b/src/modules/audio/Makefile.am
@@ -2,14 +2,6 @@
 
 inc_local = -I$(top_srcdir)/include/
 
-spdlib_LTLIBRARIES = libsdaudio.la
-libsdaudio_la_SOURCES = spd_audio.c spd_audio.h
-libsdaudio_la_CPPFLAGS = $(GLIB_CFLAGS) $(inc_local) \
-       -DPLUGIN_DIR="\"$(audiodir)\""
-libsdaudio_la_LDFLAGS = -version-info \
-       $(LIB_SDAUDIO_CURRENT):$(LIB_SDAUDIO_REVISION):$(LIB_SDAUDIO_AGE)
-libsdaudio_la_LIBADD = $(GLIB_LIBS) -lpthread
-
 audio_LTLIBRARIES =
 
 if alsa_support
diff --git a/src/modules/audio/spd_audio.c b/src/modules/spd_audio.c
similarity index 100%
rename from src/modules/audio/spd_audio.c
rename to src/modules/spd_audio.c
diff --git a/src/modules/audio/spd_audio.h b/src/modules/spd_audio.h
similarity index 100%
rename from src/modules/audio/spd_audio.h
rename to src/modules/spd_audio.h
-- 
1.7.2.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]