* configure.ac: Improve checks for flite.

* configure: Regnerate
* Tools/speech/GNUmakefile: Use variables for flite libraries.
* Tools/speech/FliteSpeechEngine.m: Switch to use register_cmu_us_kal16.
This commit is contained in:
fredkiefer 2018-01-28 21:45:16 +01:00
parent 78b330ff70
commit 9a889f5c48
5 changed files with 78 additions and 8 deletions

View file

@ -1,3 +1,10 @@
2018-01-28 Fred Kiefer <FredKiefer@gmx.de>
* configure.ac: Improve checks for flite.
* configure: Regnerate
* Tools/speech/GNUmakefile: Use variables for flite libraries.
* Tools/speech/FliteSpeechEngine.m: Switch to use register_cmu_us_kal16.
2018-01-24 Fred Kiefer <FredKiefer@gmx.de>
* Printing/GSCUPS/GSCUPSPrintOperation.m:

View file

@ -1,7 +1,7 @@
#import "GSSpeechEngine.h"
#include <flite/flite.h>
cst_voice *register_cmu_us_kal();
cst_voice *register_cmu_us_kal16();
/**
* Implementation of a speech engine using flite. This should be the default
@ -30,7 +30,7 @@ cst_voice *register_cmu_us_kal();
if (nil == (self = [super init])) { return nil; }
// Only one voice supported by flite unless others are compiled in.
v = register_cmu_us_kal();
v = register_cmu_us_kal16();
if (NULL == v)
{
[self release];

View file

@ -24,8 +24,8 @@ GSSpeechServer_OBJC_FILES += FliteSpeechEngine.m
GSSpeechServer_INCLUDE_DIRS += -I/usr/local/include/flite -I../../Headers \
-I../../Headers/Additions
GSSpeechServer_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR) \
-L/usr/local/lib -lgnustep-gui -lflite_cmu_us_kal \
-lflite_usenglish -lflite_cmulex -lflite
-L/usr/local/lib -lgnustep-gui $(FLITE_EXTRA_LIBS) \
$(FLITE_BASE_LIBS)
endif
include $(GNUSTEP_MAKEFILES)/application.make

58
configure vendored
View file

@ -635,6 +635,8 @@ GSCUPS_LIBS
GSCUPS_LDFLAGS
GSCUPS_CFLAGS
have_cups
FLITE_EXTRA_LIBS
FLITE_BASE_LIBS
BUILD_SPEECH
BUILD_SOUND
HAVE_ICU
@ -5576,14 +5578,66 @@ if test "x$ac_cv_header_flite_flite_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_FLITE_FLITE_H 1
_ACEOF
have_flite=yes
else
have_flite=no
fi
done
if test $have_speech = yes -a $enable_speech = yes; then
if test $have_flite = yes -a $have_speech = yes -a $enable_speech = yes; then
BUILD_SPEECH="speech say"
FLITE_BASE_LIBS="-lflite_usenglish -lflite_cmulex -lflite"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for register_cmu_us_kal16 in -lflite_cmu_us_kal16" >&5
$as_echo_n "checking for register_cmu_us_kal16 in -lflite_cmu_us_kal16... " >&6; }
if ${ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lflite_cmu_us_kal16 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char register_cmu_us_kal16 ();
int
main ()
{
return register_cmu_us_kal16 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16=yes
else
ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16" >&5
$as_echo "$ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16" >&6; }
if test "x$ac_cv_lib_flite_cmu_us_kal16_register_cmu_us_kal16" = xyes; then :
have_kal16=yes
else
have_kal16=no
fi
if test $have_kal16; then
FLITE_EXTRA_LIBS="-lflite_cmu_us_kal16"
else
BUILD_SPEECH=
fi
fi
#--------------------------------------------------------------------

View file

@ -525,11 +525,20 @@ BUILD_SPEECH=
# has flite, for speech synthesis.
AC_CHECK_LIB(flite, new_utterance, have_speech=yes, have_speech=no)
AC_CHECK_HEADERS(flite/flite.h)
if test $have_speech = yes -a $enable_speech = yes; then
AC_CHECK_HEADERS(flite/flite.h, have_flite=yes, have_flite=no)
if test $have_flite = yes -a $have_speech = yes -a $enable_speech = yes; then
BUILD_SPEECH="speech say"
FLITE_BASE_LIBS="-lflite_usenglish -lflite_cmulex -lflite"
AC_CHECK_LIB(flite_cmu_us_kal16, register_cmu_us_kal16, have_kal16=yes, have_kal16=no)
if test $have_kal16; then
FLITE_EXTRA_LIBS="-lflite_cmu_us_kal16"
else
BUILD_SPEECH=
fi
fi
AC_SUBST(BUILD_SPEECH)
AC_SUBST(FLITE_BASE_LIBS)
AC_SUBST(FLITE_EXTRA_LIBS)
#--------------------------------------------------------------------
# Find CUPS