2
# Process this file with autoconf to produce a configure script.
5
AC_INIT([speech-dispatcher], [0.8], [speechd@lists.freebsoft.org])
6
AM_INIT_AUTOMAKE([foreign])
7
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
10
AC_CONFIG_SRCDIR([src/server/speechd.c])
11
AC_CONFIG_HEADERS([config.h])
12
IT_PROG_INTLTOOL([0.40.0])
16
AC_CONFIG_TESTDIR(src/tests)
18
# Checks for programs.
22
# Checks for libraries.
23
AC_SEARCH_LIBS([sqrt], [m], [],
24
[AC_MSG_FAILURE([Math library missing])])
25
AC_SEARCH_LIBS([pthread_create], [pthread], [],
26
[AC_MSG_FAILURE([Threads library missing])])
27
AC_SEARCH_LIBS([lt_dlopen], [ltdl], [],
28
[AC_MSG_FAILURE([ltdl library missing])])
30
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])
31
AC_SUBST([GLIB_CFLAGS])
34
PKG_CHECK_MODULES([GTHREAD], [gthread-2.0])
35
AC_SUBST([GTHREAD_CFLAGS])
36
AC_SUBST([GTHREAD_LIBS])
38
PKG_CHECK_MODULES([GMODULE], [gmodule-2.0])
39
AC_SUBST([GMODULE_CFLAGS])
40
AC_SUBST([GMODULE_LIBS])
42
PKG_CHECK_MODULES([DOTCONF], [dotconf >= 1.3])
43
AC_SUBST([DOTCONF_CFLAGS])
44
AC_SUBST([DOTCONF_LIBS])
46
PKG_CHECK_MODULES([SNDFILE], [sndfile >= 1.0.2],
47
[ac_cv_sndfile=1], [ac_cv_sndfile=0])
48
AC_SUBST([SNDFILE_CFLAGS])
49
AC_SUBST([SNDFILE_LIBS])
50
AC_DEFINE_UNQUOTED([HAVE_SNDFILE], [${ac_cv_sndfile}],
51
[Set to 1 if you have libsndfile.])
53
# Checks for header files.
54
AC_CHECK_HEADERS([arpa/inet.h fcntl.h langinfo.h limits.h netdb.h])
55
AC_CHECK_HEADERS([ netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h])
56
AC_CHECK_HEADERS([sys/socket.h sys/time.h unistd.h wchar.h wctype.h])
58
# Checks for typedefs, structures, and compiler characteristics.
66
# Checks for library functions.
70
AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday memmove memset mkdir])
71
AC_CHECK_FUNCS([select socket strcasecmp strchr strcspn strdup])
72
AC_CHECK_FUNCS([strerror strncasecmp strndup strstr strtol])
74
# Extra libraries for sockets and espeak added by Willie Walker
75
# based upon how SunStudio libraries work. Also
76
# conditionally set other compiler/linker flags.
78
if test "$GCC" = yes; then
83
EXTRA_ESPEAK_LIBS="-lCstd -lCrun"
84
EXTRA_SOCKET_LIBS="-lsocket -lnsl"
85
ERROR_CFLAGS="-errwarn=%all -errtags=yes -erroff=E_STATEMENT_NOT_REACHED"
88
AC_SUBST([EXTRA_ESPEAK_LIBS])
89
AC_SUBST([EXTRA_SOCKET_LIBS])
90
AC_SUBST([ERROR_CFLAGS])
93
# Check for python support.
94
# Python 3 or greater required
95
AC_ARG_ENABLE([python],
96
[AS_HELP_STRING([--disable-python], [do not install python bindings])],
98
[enable_python=check])
99
AS_IF([test $enable_python != "no"],
100
[AM_PATH_PYTHON([3.0],
102
[AS_IF([test $enable_python = "yes"],
103
[AC_MSG_FAILURE([python 3 or greater is not available])])])])
104
AM_CONDITIONAL([HAVE_PYTHON], [test $enable_python = "yes"])
106
output_modules="cicero dummy festival generic"
107
# checks for output modules
108
# check for espeak support
109
AC_ARG_WITH([espeak],
110
[AS_HELP_STRING([--with-espeak], [Compile with espeak support])],
113
AS_IF([test $with_espeak != "no"],
114
[AC_CHECK_LIB([espeak], [espeak_Synth],
116
[AS_IF([test $with_espeak = "yes"],
117
[AC_MSG_FAILURE([espeak is not available])])],
118
[$EXTRA_ESPEAK_LIBS])])
119
AM_CONDITIONAL([espeak_support], [test $with_espeak = "yes"])
120
AS_IF([test $with_espeak = "yes"], [output_modules="${output_modules} espeak"])
122
# check for flite support
124
[AS_HELP_STRING([--with-flite], [include Festival Lite (Flite) support])],
127
AS_IF([test $with_flite != "no"],
128
[AC_CHECK_LIB([flite], [flite_init],
129
[flite_basic="-lflite"],
130
[AS_IF([test $with_flite = "yes"],
131
[AC_MSG_FAILURE([libflite is not available])])],
133
AC_CHECK_LIB([flite_usenglish], [usenglish_init],
134
[flite_basic="-lflite_usenglish ${flite_basic}"],
135
[AS_IF([test $with_flite = "yes"],
136
[AC_MSG_FAILURE([libflite_usenglish is not available])])],
138
AC_CHECK_LIB([flite_cmulex], [cmu_lex_init],
139
[flite_basic="-lflite_cmulex ${flite_basic}"],
140
[AS_IF([test $with_flite = "yes"],
141
[AC_MSG_FAILURE([libflite_cmulex is not available])])],
143
AC_CHECK_LIB([flite_cmu_us_kal16], [register_cmu_us_kal16],
145
flite_kal="-lflite_cmu_us_kal16";
146
AC_DEFINE([HAVE_REGISTER_CMU_US_KAL16], [1],
147
[Use cmu_register_us_kal16 to register the 16-bit voice.])],
148
[AC_CHECK_LIB([flite_cmu_us_kal16], [register_cmu_us_kal],
150
flite_kal="-lflite_cmu_us_kal16"],
151
[AC_CHECK_LIB([flite_cmu_us_kal], [register_cmu_us_kal],
153
flite_kal="-lflite_cmu_us_kal"],
154
[AS_IF([test $with_flite = "yes"],
155
[AC_MSG_FAILURE([no flite voices found])])],
156
[$flite_basic -lm])],
157
[$flite_basic -lm])],
158
[$flite_basic -lm])])
159
AM_CONDITIONAL([flite_support], [test $with_flite = "yes"])
160
AC_SUBST([flite_basic])
161
AC_SUBST([flite_kal])
162
AS_IF([test $with_flite = "yes"], [output_modules="${output_modules} flite"])
164
# check for IBMTTS support
165
AC_ARG_WITH([ibmtts],
166
[AS_HELP_STRING([--with-ibmtts], [include IBM TTS support])],
169
AS_IF([test $with_ibmtts != "no"],
170
[AC_CHECK_LIB([ibmeci], [eciStop],
172
ibmtts_include="-I/opt/IBM/ibmtts/inc/"],
173
[AS_IF([test $with_ibmtts = "yes"],
174
[AC_MSG_FAILURE([IBMTTS is not available])])])])
175
AM_CONDITIONAL([ibmtts_support], [test $with_ibmtts = "yes"])
176
AC_SUBST([ibmtts_include])
177
AS_IF([test $with_ibmtts = "yes"], [output_modules="${output_modules} ibmtts"])
179
# check for ivona support
181
[AS_HELP_STRING([--with-ivona], [include ivona support])],
184
AS_IF([test $with_ivona != "no"],
185
[AC_CHECK_LIB([dumbtts], [dumbtts_TTSInit],
187
[AS_IF([test $with_ivona = "yes"],
188
[AC_MSG_FAILURE([ivona is not available])])])])
189
AM_CONDITIONAL([ivona_support], [test $with_ivona = "yes"])
190
AS_IF([test $with_ivona = "yes"], [output_modules="${output_modules} ivona"])
192
# check for svox pico support
194
[AS_HELP_STRING([--with-pico], [include SVOX pico support])],
197
AS_IF([test $with_pico != "no"],
198
[AC_CHECK_LIB([ttspico], [pico_initialize],
200
[AS_IF([test $with_pico = "yes"],
201
[AC_MSG_FAILURE([SVOX pico is not available])])])])
202
AM_CONDITIONAL([pico_support], [test $with_pico = "yes"])
203
AS_IF([test $with_pico = "yes"], [output_modules="${output_modules} pico"])
205
audio_dlopen_modules='-dlopen force'
207
# clear default audio method
208
default_audio_method=""
211
# checks for audio subsystems
212
# check for pulseaudio support
214
[AS_HELP_STRING([--with-pulse], [include pulseaudio support])],
217
AS_IF([test $with_pulse != "no"],
218
[PKG_CHECK_MODULES([PULSE], [libpulse-simple],
220
AS_IF([test -z "$default_audio_method"],
221
[default_audio_method=pulse])
222
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_pulse.la"],
223
[AS_IF([test $with_pulse = "yes"],
224
[AC_MSG_FAILURE([pulseaudio is not available])])])])
225
AM_CONDITIONAL([pulse_support], [test $with_pulse = "yes"])
226
AC_SUBST([PULSE_CFLAGS])
227
AC_SUBST([PULSE_LIBS])
228
AS_IF([test $with_pulse = "yes"], [audio_methods="${audio_methods} pulse"])
230
# check for alsa support
232
[AS_HELP_STRING([--with-alsa], [include ALSA support])],
235
AS_IF([test $with_alsa != "no"],
236
[PKG_CHECK_MODULES([ALSA], [alsa],
238
AS_IF([test -z "$default_audio_method"],
239
[default_audio_method=alsa])
240
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_alsa.la"],
241
[AS_IF([test $with_alsa = "yes"],
242
[AC_MSG_FAILURE([ALSA is not available])])])])
243
AM_CONDITIONAL([alsa_support], [test $with_alsa = "yes"])
244
AC_SUBST([ALSA_CFLAGS])
245
AC_SUBST([ALSA_LIBS])
246
AS_IF([test $with_alsa = "yes"], [audio_methods="${audio_methods} alsa"])
248
# check for libao support
250
[AS_HELP_STRING([--with-libao], [include libao support])],
253
AS_IF([test $with_libao != "no"],
254
[PKG_CHECK_MODULES([LIBAO], [ao],
256
AS_IF([test -z "$default_audio_method"],
257
[default_audio_method=libao])
258
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_libao.la"],
259
[AS_IF([test $with_libao = yes],
260
[AC_MSG_FAILURE([libao is not available])])])])
261
AM_CONDITIONAL([libao_support], [test $with_libao = "yes"])
262
AC_SUBST([LIBAO_CFLAGS])
263
AC_SUBST([LIBAO_LIBS])
264
AS_IF([test $with_libao = "yes"], [audio_methods="${audio_methods} libao"])
266
#check for OSS support
268
[AS_HELP_STRING([--with-oss], [include oss support])],
271
AS_IF([test $with_oss != "no"],
272
[AC_CHECK_HEADER([sys/soundcard.h],
274
AS_IF([test -z "$default_audio_method"],
275
[default_audio_method=oss])
276
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_oss.la"],
277
[AS_IF([test $with_oss = "yes"],
278
[AC_MSG_FAILURE([oss is not available])])])])
279
AM_CONDITIONAL([oss_support], [test $with_oss = "yes"])
280
AS_IF([test $with_oss = "yes"], [audio_methods="${audio_methods} oss"])
282
# check for NAS support
284
[AS_HELP_STRING([--with-nas], [include network audio system (nas) support])],
287
AS_IF([test $with_nas != "no"],
288
[AC_CHECK_LIB([audio], [AuOpenServer],
290
AS_IF([test -z "$default_audio_method"],
291
[default_audio_method=nas])
292
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_nas.la";
293
NAS_LIBS="-L/usr/X11R6/lib -lXau -laudio"],
294
[AS_IF([test $with_nas = "yes"],
295
[AC_MSG_FAILURE([nas is not available])])],
296
[-L/usr/X11R6/lib -lXau])])
297
AM_CONDITIONAL([nas_support], [test $with_nas = "yes"])
299
AS_IF([test $with_nas = "yes"], [audio_methods="${audio_methods} nas"])
301
AC_ARG_WITH([default-audio-method],
302
[AS_HELP_STRING([--with-default-audio-method=<name>],
303
[defines default audio method (default - first discovered)])],
304
[default_audio_method="$withval"],
306
AC_SUBST([default_audio_method])
308
# We'll build these modules:
309
AC_SUBST([audio_dlopen_modules])
311
# current, age and revision values for libspeechd.
312
LIB_SPD_CURRENT=6 # Current main version (increment on every API change -- incompatible AND extensions)
313
LIB_SPD_REVISION=0 # Current minor version (increment on every implementation change)
314
LIB_SPD_AGE=4 # Number of backward compatible main versions (LIB_SPD_CURRENT incrementations since last incompatible)
315
AC_SUBST([LIB_SPD_CURRENT])
316
AC_SUBST([LIB_SPD_REVISION])
317
AC_SUBST([LIB_SPD_AGE])
320
GETTEXT_PACKAGE=speech-dispatcher
321
AC_SUBST([GETTEXT_PACKAGE])
323
# Paths for configuration files:
324
spdconfdir='${sysconfdir}/speech-dispatcher'
325
AC_SUBST([spdconfdir])
326
clientconfdir='${spdconfdir}/clients'
327
AC_SUBST([clientconfdir])
328
moduleconfdir='${spdconfdir}/modules'
329
AC_SUBST([moduleconfdir])
331
# Paths for read-only copy of configuration files:
332
spdconforigdir='${datadir}/speech-dispatcher/conf'
333
AC_SUBST([spdconforigdir])
334
clientconforigdir='${spdconforigdir}/clients'
335
AC_SUBST([clientconforigdir])
336
spddesktopconforigdir='${spdconforigdir}/desktop'
337
AC_SUBST([spddesktopconforigdir])
338
moduleconforigdir='${spdconforigdir}/modules'
339
AC_SUBST([moduleconforigdir])
341
# Path for sound files:
342
snddatadir='${datadir}/sounds/speech-dispatcher'
343
AC_SUBST([snddatadir])
345
# Path for module binaries:
346
AC_ARG_WITH([module-bindir],
347
AS_HELP_STRING([--with-module-bindir],[Directory where to install speech-dispatcher modules (defaults to ${libdir}/speech-dispatcher-modules)]),
348
[modulebindir=$withval], [modulebindir='${libdir}/speech-dispatcher-modules'])
350
AC_SUBST([modulebindir])
352
# Path for speech-dispatcher libraries:
353
spdlibdir='${libdir}/speech-dispatcher'
354
AC_SUBST([spdlibdir])
356
# Path for audio libraries and plugins:
357
audiodir="$spdlibdir"
360
# Path for speech-dispatcher include files:
361
spdincludedir=${includedir}/speech-dispatcher
362
AC_SUBST([spdincludedir])
364
AC_CONFIG_FILES([Makefile
367
config/clients/Makefile
368
config/modules/Makefile
375
src/api/python/Makefile
376
src/api/python/speechd/Makefile
377
src/api/python/speechd_config/Makefile
380
src/clients/say/Makefile
381
src/clients/spdsend/Makefile
387
AC_MSG_NOTICE([output modules to be built are $output_modules])
388
AC_MSG_NOTICE([audio methods to be built are $audio_methods])
389
AC_MSG_NOTICE([Default audio method is $default_audio_method])