-
Notifications
You must be signed in to change notification settings - Fork 266
/
Copy pathconfigure.ac
255 lines (226 loc) · 7.91 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.71])
AC_INIT([ekho],[10.0],[hgneng at gmail.com])
AC_CONFIG_AUX_DIR([.])
AM_PROG_AR
AC_PROG_RANLIB
AM_INIT_AUTOMAKE([-Wall foreign 1.9 tar-pax subdir-objects])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
LT_INIT
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lpthread':
AC_CHECK_LIB([pthread], [main])
# Checks for header files.
AC_HEADER_DIRENT
AC_CHECK_HEADERS([locale.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_MALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([memset setlocale strstr])
# Manually added
AC_SUBST([FESTIVAL_HEADER])
AC_SUBST([SPEECH_TOOLS_HEADER])
FESTIVAL_HEADER="" #"`find ${srcdir}/include/festival -name "*.h" -print0 -printf ' '`"
SPEECH_TOOLS_HEADER="" #"`find ${srcdir}/include/speech_tools -name "*.h" -print0 -printf ' '`"
# don't use GTK any more
LIB_GTK2=""
CFLAG_GTK2=""
AC_SUBST([LIB_GTK2])
AC_SUBST([CFLAG_GTK2])
#AC_ARG_WITH([gtk2],
# [AS_HELP_STRING([--with-gtk2],
# [support GTK2 interface. @<:@default=check@:>@])],
# [],
# [with_gtk2=check])
#AS_IF([test "x$with_gtk2" != xno],
# [AC_CHECK_LIB([gtk-x11-2.0], [main],
# [AC_SUBST([LIB_GTK2], ["`pkg-config --libs gtk+-2.0`"])
# AC_SUBST([CFLAG_GTK2], ["`pkg-config --cflags gtk+-2.0`"])
# AC_DEFINE([HAVE_GTK2], [1], [Define if you have GTK-2.0])
# ],
# [if test "x$with_gtk2" != xcheck; then
# AC_MSG_FAILURE([gtk2 test failed (with-gtk2=no to disable)])
# fi
# ], [])])
AC_CHECK_LIB([sndfile], [main], [],
[AC_MSG_FAILURE([sndfile test failed])],[]
)
AC_CHECK_LIB([espeak-ng], [main], [], [AC_MSG_FAILURE([espeak-ng test failed])],[])
LIB_SONIC=""
AC_CHECK_LIB([sonic], [main],
[AC_SUBST([LIB_SONIC], ["-lsonic"])
AC_DEFINE([HAVE_SONIC], [1],
[Define if you have sonic])
],
[],
[])
AC_ARG_WITH([soxr],
[AS_HELP_STRING([--with-soxr],
[support sample rate change. @<:@default=no@:>@])],
[],
[with_soxr=no])
LIB_SOXR=""
AS_IF([test "x$with_soxr" != xno],
[AC_CHECK_LIB([soxr], [main],
[AC_SUBST([LIB_SOXR], ["-lsoxr"])
AC_DEFINE([HAVE_SOXR], [1],
[Define if you have libsoxr])
],
[AC_MSG_FAILURE(
[--with-soxr was given, but test for soxr failed])],
[])])
LIB_PULSEAUDIO=""
CFLAG_PULSEAUDIO=""
AS_IF([test "x$with_pulseaudio" != xno],
[AC_CHECK_LIB([pulse], [main],
[AC_SUBST([LIB_PULSEAUDIO], ["`pkg-config --libs libpulse-simple`"])
AC_SUBST([CFLAG_PULSEAUDIO], ["`pkg-config --cflags libpulse-simple`"])
AC_DEFINE([HAVE_PULSEAUDIO], [1],
[Define if you have libpulse])
],
[AC_MSG_FAILURE(
[pulseaudio test failed (--without-pulseaudio to disable)])],
[])])
AC_ARG_ENABLE(speechd,
[AS_HELP_STRING([--enable-speechd],[Enable speech-dispatcher API])],
[AM_CONDITIONAL(ENABLE_SPEECHD, true)],
[AM_CONDITIONAL(ENABLE_SPEECHD, false)]
)
AC_SUBST([LIB_FLITE])
AC_SUBST([CFLAG_FLITE])
AC_ARG_ENABLE(flite,
[AS_HELP_STRING([--enable-flite],[synthesize English through Flite])],
[
AC_DEFINE(ENABLE_FLITE,,[Enable Flite])
LIB_FLITE="${srcdir}/flite/build/x86_64-darwin21.6.0/lib/*.a"
CFLAG_FLITE="-I${srcdir}/flite/include"
], [
LIB_FLITE=""
CFLAG_FLITE=""
])
AC_SUBST([LIB_FESTIVAL])
AC_SUBST([CFLAG_FESTIVAL])
AC_ARG_ENABLE(festival,
[AS_HELP_STRING([--enable-festival],[synthesize English through Festival])],
[AC_CHECK_LIB([ncurses], [main],
[
#AC_DEFINE(ENABLE_FESTIVAL,,[Enable Festival])
#LIB_FESTIVAL="${srcdir}/lib/libFestival.a ${srcdir}/lib/libestools.a ${srcdir}/lib/libestbase.a ${srcdir}/lib/libeststring.a -lncurses"
# CFLAG_FESTIVAL="-I${srcdir}/include/festival -I${srcdir}/include/speech_tools"
],
[AC_MSG_FAILURE([ncurses test failed])],
[])
AC_CHECK_LIB([estools], [main], [],
[AC_MSG_FAILURE([estool test failed])],
[]
)
AC_CHECK_LIB([Festival], [main], [
AC_DEFINE(ENABLE_FESTIVAL,,[Enable Festival])
LIB_FESTIVAL="-lFestival -lestbase -lestools -leststring -lncurses"
CFLAG_FESTIVAL="-I/usr/include/festival -I/usr/include/speech_tools"
],
[
AC_DEFINE(ENABLE_FESTIVAL,,[Enable Festival])
LIB_FESTIVAL="${srcdir}/lib/libFestival.a ${srcdir}/lib/libestools.a ${srcdir}/lib/libestbase.a ${srcdir}/lib/libeststring.a -lncurses"
CFLAG_FESTIVAL="-I${srcdir}/include -I${srcdir}/include/festival -I${srcdir}/include/speech_tools"
],
[]
)
],
[LIB_FESTIVAL=""
CFLAG_FESTIVAL=""]
)
#CFLAG_MUSICXML=""
#LIB_MUSICXML=""
#AC_SUBST([CFLAG_MUSICXML])
#AC_SUBST([LIB_MUSICXML])
#AC_ARG_ENABLE(musicxml,
# [AS_HELP_STRING([--enable-musicxml],[Enable musicxml])],
# [AC_DEFINE(ENABLE_MUSICXML,,[Enable musicxml])
# CFLAG_MUSICXML="-fopenmp"
# LIB_MUSICXML="-lpitch_detection -lffts -lopus -lmlpack -larmadillo"
# AM_CONDITIONAL(ENABLE_MUSICXML, true)
# ],
# [AM_CONDITIONAL(ENABLE_MUSICXML, false)]
# )
#CFLAG_FRISO=""
#LIB_FRISO=""
#AC_SUBST([CFLAG_FRISO])
#AC_SUBST([LIB_FRISO])
#AC_ARG_ENABLE(friso,
# [ --enable-friso],
# [AC_DEFINE(ENABLE_FRISO,,[Enable Friso])
# CFLAG_FRISO="-I${srcdir}/friso-src"
# LIB_FRISO="libfriso.a"
# AM_CONDITIONAL(ENABLE_FRISO, true)
# ],
# [AM_CONDITIONAL(ENABLE_FRISO, false)]
# )
AC_ARG_ENABLE(win32,
[ --enable-win32],
[AC_DEFINE(ENABLE_WIN32,,[Enable Windows])
# LIB_FESTIVAL+=-lws2_32
],
[])
#AC_ARG_WITH([vorbisenc],
# [AS_HELP_STRING([--with-vorbisenc],
# [support OGG audio output file format. @<:@default=check@:>@])],
# [],
# [with_vorbisenc=check])
#LIB_OGG=""
#AS_IF([test "x$with_vorbisenc" != xno],
# [AC_CHECK_LIB([vorbisenc], [main],
# [AC_SUBST([LIB_OGG], ["-lvorbisenc -lvorbis -lm -logg"])
# AC_DEFINE([HAVE_OGG], [1],
# [Define if you have libvorbisenc])
# ],
# [if test "x$with_vorbisenc" != xcheck; then
# AC_MSG_FAILURE(
# [--with-vorbisenc was given, but test for vorbisenc failed])
# fi
# ], [])])
LIB_MPG123=""
AC_CHECK_LIB([mpg123], [main],
[AC_SUBST([LIB_MPG123], ["-lmpg123"])
AC_DEFINE([HAVE_MPG123], [1],
[Define if you have mpg123])
],
[],
[])
AC_ARG_WITH([mp3lame],
[AS_HELP_STRING([--with-mp3lame],
[support MP3 audio output file format. @<:@default=no@:>@])],
[],
[with_mp3lame=no])
LIB_MP3LAME=""
AS_IF([test "x$with_mp3lame" != xno],
[AC_CHECK_LIB([mp3lame], [main],
[AC_SUBST([LIB_MP3LAME], ["-lmp3lame -lm"])
AC_DEFINE([HAVE_MP3LAME], [1],
[Define if you have libmp3lame])
],
[if test "x$with_mp3lame" != xcheck; then
AC_MSG_FAILURE(
[--with-mp3lame was given, but test for mp3lame failed])
fi
], [])])
AC_ARG_ENABLE(dist-voice,
[ --disable-dist-voice],
[dist_voice=false],
[dist_voice=true])
AM_CONDITIONAL([DIST_VOICE_DATA], [test x$dist_voice = xtrue])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT