-
Notifications
You must be signed in to change notification settings - Fork 66
/
configure.ac
615 lines (556 loc) · 21.2 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 2002-2013 Brailcom, o.p.s
# Copyright (C) 2009-2017 Luke Yelavich <[email protected]>
# Copyright (C) 2009 Willie Walker <[email protected]>
# Copyright (C) 2010-2011 William Hubbs <[email protected]>
# Copyright (C) 2010-2011 Andrei Kholodnyi <[email protected]>
# Copyright (C) 2010 Boris Dusek <[email protected]>
# Copyright (C) 2010 Christopher Brannon <[email protected]>
# Copyright (C) 2011 Trevor Saunders <[email protected]>
# Copyright (C) 2012 William Jon McCann <[email protected]>
# Copyright (C) 2017 Colomban Wendling <[email protected]>
# Copyright (C) 2017 Jan Tojnar <[email protected]>
# Copyright (C) 2018 Raphaël POITEVIN <[email protected]>
# Copyright (C) 2018-2024 Samuel Thibault <[email protected]>
# Copyright (C) 2018 Alan Coopersmith <[email protected]>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details (file
# COPYING in the root directory).
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
AC_PREREQ([2.63])
m4_define([MAJOR_VERSION], [0])
m4_define([MINOR_VERSION], [12])
m4_define([MICRO_VERSION], [0])
m4_define([AC_PACKAGE_VERSION],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION-rc4])
AC_INIT([speech-dispatcher], [AC_PACKAGE_VERSION], [[email protected]])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([foreign info-in-builddir])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
LT_PREREQ([2.2])
LT_INIT([dlopen])
AC_CONFIG_SRCDIR([src/server/speechd.c])
AC_CONFIG_HEADERS([config.h])
AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
if test "$ac_cv_path_MSGFMT" = ":"
then
AC_MSG_FAILURE([msgfmt missing from the gettext package])
fi
# Split version number
[MAJOR_VERSION]=MAJOR_VERSION
[MINOR_VERSION]=MINOR_VERSION
[MICRO_VERSION]=MICRO_VERSION
AC_SUBST([MAJOR_VERSION])
AC_SUBST([MINOR_VERSION])
AC_SUBST([MICRO_VERSION])
# Config test suite
AC_CONFIG_TESTDIR(src/tests)
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_CHECK_PROGS([HELP2MAN], [help2man])
AM_CONDITIONAL([HAVE_HELP2MAN], [test "x$HELP2MAN" != "x"])
AC_USE_SYSTEM_EXTENSIONS
# Checks for libraries.
AC_SEARCH_LIBS([sqrt], [m], [],
[AC_MSG_FAILURE([Math library missing])])
AC_SEARCH_LIBS([pthread_create], [pthread], [],
[AC_MSG_FAILURE([Threads library missing])])
AC_ARG_ENABLE([ltdl],
[AS_HELP_STRING([--disable-ltdl], [do not use ltdl for modules])],
[],
[enable_ltdl=check])
if test x$enable_ltdl != xno;
then
AC_SEARCH_LIBS([lt_dlopen], [ltdl], [use_ltdl=yes], [use_ltdl=no])
if test x$use_ltdl = xno ;
then
if test x$enable_ltdl = xyes ;
then
AC_MSG_FAILURE([ltdl requested but missing])
fi
enable_ltdl=no
fi
fi
if test x$enable_ltdl = xno;
then
AC_DEFINE(USE_DLOPEN, [1], [Use dlopen rather than lt_dlopen])
AC_SEARCH_LIBS([dlopen], [dl], [],
[AC_MSG_FAILURE([dlopen missing])])
fi
if test x$enable_shared = xyes;
then
default_shim=shim
else
default_shim=no
fi
case "$host" in
*-*darwin*)
darwin_host=yes
default_shim=no
AC_DEFINE(DARWIN_HOST, [1], [Building for Darwin])
;;
esac
AM_CONDITIONAL(DARWIN_HOST, test "$darwin_host" = yes)
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.36])
AC_SUBST([GLIB_CFLAGS])
AC_SUBST([GLIB_LIBS])
PKG_CHECK_MODULES([GTHREAD], [gthread-2.0])
AC_SUBST([GTHREAD_CFLAGS])
AC_SUBST([GTHREAD_LIBS])
PKG_CHECK_MODULES([GMODULE], [gmodule-2.0])
AC_SUBST([GMODULE_CFLAGS])
AC_SUBST([GMODULE_LIBS])
PKG_CHECK_MODULES([DOTCONF], [dotconf >= 1.3])
AC_SUBST([DOTCONF_CFLAGS])
AC_SUBST([DOTCONF_LIBS])
PKG_CHECK_MODULES([SNDFILE], [sndfile >= 1.0.2])
AC_SUBST([SNDFILE_CFLAGS])
AC_SUBST([SNDFILE_LIBS])
PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd], [have_libsystemd=yes], [:])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h langinfo.h limits.h netdb.h])
AC_CHECK_HEADERS([netinet/in.h stddef.h stdlib.h string.h sys/filio.h])
AC_CHECK_HEADERS([sys/ioctl.h sys/socket.h sys/time.h unistd.h wchar.h wctype.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT32_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([daemon dup2 gethostbyname getline gettimeofday memmove memset])
AC_CHECK_FUNCS([mkdir select socket strcasecmp strcasestr strchr strcspn strdup])
AC_CHECK_FUNCS([strerror strncasecmp strndup strstr strtol])
# Extra libraries for sockets and espeak added by Willie Walker
# based upon how SunStudio compilers and Solaris libraries work.
# Also conditionally set other compiler/linker flags.
#
# SVR4, including Solaris before 11.4, hides these in libraries other than libc
AC_CHECK_LIB([c], [socket], [],
[AC_CHECK_LIB([socket], [socket], [EXTRA_SOCKET_LIBS="-lsocket"])])
AC_CHECK_LIB([c], [gethostbyname], [],
[AC_CHECK_LIB([nsl], [gethostbyname],
[EXTRA_SOCKET_LIBS="${EXTRA_SOCKET_LIBS} -lnsl"])])
if test "$GCC" = yes; then
ERROR_CFLAGS="-Wall"
RDYNAMIC="-rdynamic"
else
EXTRA_ESPEAK_LIBS="-lCstd -lCrun"
ERROR_CFLAGS="-errwarn=%all -errtags=yes -erroff=E_STATEMENT_NOT_REACHED"
RDYNAMIC=""
fi
AC_SUBST([EXTRA_ESPEAK_LIBS])
AC_SUBST([EXTRA_SOCKET_LIBS])
AC_SUBST([ERROR_CFLAGS])
AC_SUBST([RDYNAMIC])
AC_ARG_ENABLE([doc],
[AC_HELP_STRING([--disable-doc], [turn off documentation])])
AM_CONDITIONAL(ENABLE_DOC, test "$enable_doc" != "no")
# Check for python support.
# Python 3 or greater required
AC_ARG_ENABLE([python],
[AS_HELP_STRING([--disable-python], [do not install python bindings])],
[],
[enable_python=check])
AS_IF([test $enable_python != "no"],
[AM_PATH_PYTHON([3.0],
[enable_python=yes],
[AS_IF([test $enable_python = "yes"],
[AC_MSG_FAILURE([python 3 or greater is not available])])])])
AM_CONDITIONAL([HAVE_PYTHON], [test $enable_python = "yes"])
output_modules="cicero dummy festival openjtalk generic"
# checks for output modules
# check for espeak support
AC_ARG_WITH([espeak],
[AS_HELP_STRING([--with-espeak], [Compile with espeak support])],
[],
[with_espeak=check])
AS_IF([test $with_espeak != "no"],
[AC_CHECK_LIB([espeak], [espeak_Synth],
[with_espeak="yes"],
[AS_IF([test $with_espeak = "yes"],
[AC_MSG_FAILURE([espeak is not available])])],
[$EXTRA_ESPEAK_LIBS])])
AM_CONDITIONAL([espeak_support], [test $with_espeak = "yes"])
AS_IF([test $with_espeak = "yes"], [output_modules="${output_modules} espeak"])
# check for espeak-ng support
AC_ARG_WITH([espeak_ng],
[AS_HELP_STRING([--with-espeak-ng], [Compile with espeak-ng support])],
[],
[with_espeak_ng=check])
AS_IF([test $with_espeak_ng != "no"],
[PKG_CHECK_MODULES([ESPEAK_NG], [espeak-ng],
[with_espeak_ng="yes"],
[AS_IF([test $with_espeak_ng = "yes"],
[AC_MSG_FAILURE([espeak-ng is not available])])])])
AM_CONDITIONAL([espeak_ng_support], [test $with_espeak_ng = "yes"])
AC_SUBST([ESPEAK_NG_CFLAGS])
AC_SUBST([ESPEAK_NG_LIBS])
AS_IF([test $with_espeak_ng = "yes"], [output_modules="${output_modules} espeak-ng"])
AC_CHECK_PROGS([ESPEAK], [espeak-ng espeak])
AM_CONDITIONAL([espeak_dummy_message], [test x$ESPEAK != x])
# check for flite support
AC_ARG_WITH([flite],
[AS_HELP_STRING([--with-flite], [include Festival Lite (Flite) support])],
[],
[with_flite=check])
AS_IF([test $with_flite != "no"],
[AC_CHECK_LIB([flite], [flite_init],
[flite_basic="-lflite"],
[AS_IF([test $with_flite = "yes"],
[AC_MSG_FAILURE([libflite is not available])])],
[-lm])
AC_CHECK_LIB([flite_usenglish], [usenglish_init],
[flite_basic="-lflite_usenglish ${flite_basic}"],
[AS_IF([test $with_flite = "yes"],
[AC_MSG_FAILURE([libflite_usenglish is not available])])],
[-lflite -lm])
AC_CHECK_LIB([flite_cmulex], [cmu_lex_init],
[flite_basic="-lflite_cmulex ${flite_basic}"],
[AS_IF([test $with_flite = "yes"],
[AC_MSG_FAILURE([libflite_cmulex is not available])])],
[-lflite -lm])
AC_CHECK_LIB([flite_cmu_us_kal16], [register_cmu_us_kal16],
[with_flite=yes;
flite_kal="-lflite_cmu_us_kal16";
AC_DEFINE([HAVE_REGISTER_CMU_US_KAL16], [1],
[Use cmu_register_us_kal16 to register the 16-bit voice.])],
[AC_CHECK_LIB([flite_cmu_us_kal16], [register_cmu_us_kal],
[with_flite=yes;
flite_kal="-lflite_cmu_us_kal16"],
[AC_CHECK_LIB([flite_cmu_us_kal], [register_cmu_us_kal],
[with_flite=yes;
flite_kal="-lflite_cmu_us_kal"],
[AS_IF([test $with_flite = "yes"],
[AC_MSG_FAILURE([no flite voices found])])],
[$flite_basic -lm])],
[$flite_basic -lm])],
[$flite_basic -lm])])
AM_CONDITIONAL([flite_support], [test $with_flite = "yes"])
AC_SUBST([flite_basic])
AC_SUBST([flite_kal])
AS_IF([test $with_flite = "yes"], [output_modules="${output_modules} flite"])
AC_CHECK_PROGS([FLITE], [flite])
AM_CONDITIONAL([flite_dummy_message], [test x$FLITE != x])
# check for IBMTTS support
case "$host" in
[i[3-6]86-*-linux*])
default_ibmtts=check
;;
*)
default_ibmtts=no
;;
esac
AC_ARG_WITH([ibmtts],
[AS_HELP_STRING([--with-ibmtts[[=yes|no|shim]]], [include IBM TTS support])],
[],
[with_ibmtts=$default_ibmtts])
AS_IF([test $with_ibmtts = yes -o $with_ibmtts = check],
[AC_CHECK_LIB([ibmeci], [eciStop],
[with_ibmtts=yes;
ibmtts_include="-I/opt/IBM/ibmtts/inc/"],
[AS_IF([test $with_ibmtts = "yes"],
[AC_MSG_FAILURE([IBMTTS is not available])])
with_ibmtts=$default_shim])])
AM_CONDITIONAL([ibmtts_support], [test $with_ibmtts != no])
AM_CONDITIONAL([ibmtts_shim], [test $with_ibmtts = shim])
AC_SUBST([ibmtts_include])
AS_IF([test $with_ibmtts != no], [output_modules="${output_modules} ibmtts"])
# check for Voxin support
AC_ARG_WITH([voxin],
[AS_HELP_STRING([--with-voxin[[=yes|no|shim]]], [include Voxin support])],
[],
[with_voxin=check])
AS_IF([test $with_voxin = yes -o $with_voxin = check],
[AC_CHECK_LIB([voxin], [voxToString],
[with_voxin=yes],
[AS_IF([test "$with_voxin" = yes],
[AC_MSG_FAILURE([Voxin is not available])])
with_voxin=$default_shim])])
AM_CONDITIONAL([voxin_support], [test "$with_voxin" != no])
AM_CONDITIONAL([voxin_shim], [test "$with_voxin" = shim])
AS_IF([test "$with_voxin" != no], [output_modules="${output_modules} voxin"])
# check for ivona support
AC_ARG_WITH([ivona],
[AS_HELP_STRING([--with-ivona], [include ivona support])],
[],
[with_ivona=check])
AS_IF([test $with_ivona != "no"],
[AC_CHECK_LIB([dumbtts], [dumbtts_TTSInit],
[with_ivona=yes],
[AS_IF([test $with_ivona = "yes"],
[AC_MSG_FAILURE([ivona is not available])])])])
AM_CONDITIONAL([ivona_support], [test $with_ivona = "yes"])
AS_IF([test $with_ivona = "yes"], [output_modules="${output_modules} ivona"])
# check for svox pico support
AC_ARG_WITH([pico],
[AS_HELP_STRING([--with-pico], [include SVOX pico support])],
[],
[with_pico=check])
AS_IF([test $with_pico != "no"],
[AC_CHECK_LIB([ttspico], [pico_initialize],
[with_pico=yes],
[AS_IF([test $with_pico = "yes"],
[AC_MSG_FAILURE([SVOX pico is not available])])])])
AM_CONDITIONAL([pico_support], [test $with_pico = "yes"])
AS_IF([test $with_pico = "yes"], [output_modules="${output_modules} pico"])
# check for Voxygen Baratinoo support
AC_ARG_WITH([baratinoo],
[AS_HELP_STRING([--with-baratinoo[[=yes|no|shim]]], [include Voxygen Baratinoo support])],
[],
[with_baratinoo=check])
AS_IF([test "$with_baratinoo" = yes -o "$with_baratinoo" = check],
[AC_CHECK_LIB([baratinoo], [BCinitlib],
[with_baratinoo=yes],
[AS_IF([test "$with_baratinoo" = yes],
[AC_MSG_FAILURE([Voxygen Baratinoo is not available])])
with_baratinoo=$default_shim])])
AM_CONDITIONAL([baratinoo_support], [test "$with_baratinoo" != no])
AM_CONDITIONAL([baratinoo_shim], [test "$with_baratinoo" = shim])
AS_IF([test "$with_baratinoo" != no], [output_modules="${output_modules} baratinoo"])
# check for kali support
AC_ARG_WITH([kali],
[AS_HELP_STRING([--with-kali[[=yes|no|shim]]], [include Kali support])],
[],
[with_kali=check])
AS_IF([test $with_kali = yes -o $with_kali = check],
[AC_CHECK_LIB([Kali], [initKali],
[with_kali=yes],
[AS_IF([test $with_kali = "yes"],
[AC_MSG_FAILURE([Kali is not available])])
with_kali=$default_shim],
[-lKGlobal -lKTrans -lKParle -lKAnalyse])])
AM_CONDITIONAL([kali_support], [test $with_kali != no])
AM_CONDITIONAL([kali_shim], [test $with_kali = shim])
AS_IF([test $with_kali != no], [output_modules="${output_modules} kali"])
audio_dlopen='-dlopen force'
audio_dlopen_modules=
# clear default audio method
default_audio_method=""
audio_methods=""
# checks for audio subsystems
# check for pulseaudio support
AC_ARG_WITH([pulse],
[AS_HELP_STRING([--with-pulse], [include pulseaudio support])],
[],
[with_pulse=check])
AS_IF([test $with_pulse != "no"],
[PKG_CHECK_MODULES([PULSE], [libpulse],
[with_pulse=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=pulse])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_pulse.la"],
[AS_IF([test $with_pulse = "yes"],
[AC_MSG_FAILURE([pulseaudio is not available])])])])
AM_CONDITIONAL([pulse_support], [test $with_pulse = "yes"])
AC_SUBST([PULSE_CFLAGS])
AC_SUBST([PULSE_LIBS])
AS_IF([test $with_pulse = "yes"], [audio_methods="${audio_methods} pulse"])
# check for libao support
AC_ARG_WITH([libao],
[AS_HELP_STRING([--with-libao], [include libao support])],
[],
[with_libao=check])
AS_IF([test $with_libao != "no"],
[PKG_CHECK_MODULES([LIBAO], [ao],
[with_libao=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=libao])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_libao.la"],
[AS_IF([test $with_libao = yes],
[AC_MSG_FAILURE([libao is not available])])])])
AM_CONDITIONAL([libao_support], [test $with_libao = "yes"])
AC_SUBST([LIBAO_CFLAGS])
AC_SUBST([LIBAO_LIBS])
AS_IF([test $with_libao = "yes"], [audio_methods="${audio_methods} libao"])
# check for pipewire support
AC_ARG_WITH([pipewire],
[AS_HELP_STRING([--with-pipewire], [include pipewire support])],
[],
[with_pipewire=check])
AS_IF([test $with_pipewire != "no"],
[PKG_CHECK_MODULES([pipewire], [libpipewire-0.3],
[with_pipewire=yes
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_pipewire.la"],
[AS_IF([test $with_pipewire = yes],
[AC_MSG_FAILURE([pipewire is not available])])])])
AM_CONDITIONAL([pipewire_support], [test $with_pipewire = "yes"])
AC_SUBST([pipewire_CFLAGS])
AC_SUBST([pipewire_LIBS])
AS_IF([test $with_pipewire = "yes"], [audio_methods="${audio_methods} pipewire"])
# check for alsa support
AC_ARG_WITH([alsa],
[AS_HELP_STRING([--with-alsa], [include ALSA support])],
[],
[with_alsa=check])
AS_IF([test $with_alsa != "no"],
[PKG_CHECK_MODULES([ALSA], [alsa],
[with_alsa=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=alsa])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_alsa.la"],
[AS_IF([test $with_alsa = "yes"],
[AC_MSG_FAILURE([ALSA is not available])])])])
AM_CONDITIONAL([alsa_support], [test $with_alsa = "yes"])
AC_SUBST([ALSA_CFLAGS])
AC_SUBST([ALSA_LIBS])
AS_IF([test $with_alsa = "yes"], [audio_methods="${audio_methods} alsa"])
#check for OSS support
AC_ARG_WITH([oss],
[AS_HELP_STRING([--with-oss], [include oss support])],
[],
[with_oss=check])
AS_IF([test $with_oss != "no"],
[AC_CHECK_HEADER([sys/soundcard.h],
[with_oss=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=oss])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_oss.la"],
[AS_IF([test $with_oss = "yes"],
[AC_MSG_FAILURE([oss is not available])])])])
AM_CONDITIONAL([oss_support], [test $with_oss = "yes"])
AS_IF([test $with_oss = "yes"], [audio_methods="${audio_methods} oss"])
# check for NAS support
AC_ARG_WITH([nas],
[AS_HELP_STRING([--with-nas], [include network audio system (nas) support])],
[],
[with_nas=check])
AS_IF([test $with_nas != "no"],
[AC_CHECK_LIB([audio], [AuOpenServer],
[with_nas=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=nas])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_nas.la";
NAS_LIBS="-L/usr/X11R6/lib -lXau -laudio"],
[AS_IF([test $with_nas = "yes"],
[AC_MSG_FAILURE([nas is not available])])],
[-L/usr/X11R6/lib -lXau])])
AM_CONDITIONAL([nas_support], [test $with_nas = "yes"])
AC_SUBST([NAS_LIBS])
AS_IF([test $with_nas = "yes"], [audio_methods="${audio_methods} nas"])
AC_ARG_WITH([default-audio-method],
[AS_HELP_STRING([--with-default-audio-method=<name>],
[defines default audio method (default - first discovered)])],
[default_audio_method="$withval"],
[])
AC_SUBST([default_audio_method])
# We'll build these modules:
AC_SUBST([audio_dlopen])
AC_SUBST([audio_dlopen_modules])
# current, age and revision values for libspeechd.
LIB_SPD_CURRENT=8 # 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=6 # Number of backward compatible main versions (LIB_SPD_CURRENT incrementations since last incompatible)
AC_SUBST([LIB_SPD_CURRENT])
AC_SUBST([LIB_SPD_REVISION])
AC_SUBST([LIB_SPD_AGE])
# Setup GETTEXT
GETTEXT_PACKAGE=speech-dispatcher
AC_SUBST([GETTEXT_PACKAGE])
# Paths for configuration files:
spdconfdir='${sysconfdir}/speech-dispatcher'
AC_SUBST([spdconfdir])
clientconfdir='${spdconfdir}/clients'
AC_SUBST([clientconfdir])
moduleconfdir='${spdconfdir}/modules'
AC_SUBST([moduleconfdir])
# Paths for read-only copy of configuration files:
spdconforigdir='${datadir}/speech-dispatcher/conf'
AC_SUBST([spdconforigdir])
clientconforigdir='${spdconforigdir}/clients'
AC_SUBST([clientconforigdir])
spddesktopconforigdir='${spdconforigdir}/desktop'
AC_SUBST([spddesktopconforigdir])
moduleconforigdir='${spdconforigdir}/modules'
AC_SUBST([moduleconforigdir])
# Path for sound files:
snddatadir='${datadir}/sounds/speech-dispatcher'
AC_SUBST([snddatadir])
# Path for locale files:
localedatadir='${datadir}/speech-dispatcher/locale'
AC_SUBST([localedatadir])
# Path for module binaries:
AC_ARG_WITH([module-bindir],
AS_HELP_STRING([--with-module-bindir],[Directory where to install speech-dispatcher modules (defaults to ${libexecdir}/speech-dispatcher-modules)]),
[modulebindir=$withval], [modulebindir='${libexecdir}/speech-dispatcher-modules'])
AC_SUBST([modulebindir])
oldmodulebindir='${libdir}/speech-dispatcher-modules'
AC_SUBST([oldmodulebindir])
# Path for speech-dispatcher libraries:
spdlibdir='${libdir}/speech-dispatcher'
AC_SUBST([spdlibdir])
# Path for audio libraries and plugins:
audiodir="$spdlibdir"
AC_SUBST([audiodir])
# Path for speech-dispatcher include files:
spdincludedir=${includedir}/speech-dispatcher
AC_SUBST([spdincludedir])
includedir=${spdincludedir}
AC_SUBST([includedir])
# support for systemd unit files
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
if test "x$with_systemdsystemunitdir" != xno; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
AC_ARG_WITH([systemduserunitdir],
AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]),
[], [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)])
if test -n "$have_libsystemd" -a -n "$with_systemduserunitdir" -a "x$with_systemduserunitdir" != xno ; then
use_libsystemd=yes
AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
AC_DEFINE([USE_LIBSYSTEMD], [1], [Used for activation via socket])
fi
AM_CONDITIONAL([USE_LIBSYSTEMD], [test "x$use_libsystemd" = "xyes"])
AM_CONDITIONAL(BUILD_HTML_DOC, [test "$EMAIL" = [email protected]])
AC_CONFIG_FILES([Makefile
run-speechd
run-spd-say
speech-dispatcher.pc
config/Makefile
config/clients/Makefile
config/modules/Makefile
doc/Makefile
include/Makefile
locale/Makefile
po/Makevars
po/Makefile.in
src/Makefile
src/api/Makefile
src/api/c/Makefile
src/api/python/Makefile
src/api/python/speechd/Makefile
src/api/python/speechd_config/Makefile
src/audio/Makefile
src/clients/Makefile
src/clients/say/Makefile
src/clients/spdsend/Makefile
src/common/Makefile
src/modules/Makefile
src/server/Makefile
src/tests/Makefile],
[chmod +x run-speechd run-spd-say])
AC_OUTPUT
AC_MSG_NOTICE([output modules to be built are $output_modules])
AC_MSG_NOTICE([audio methods to be built are $audio_methods])
AC_MSG_NOTICE([Default audio method is $default_audio_method])