/
configure.in
434 lines (382 loc) · 12.2 KB
/
configure.in
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
dnl Copyright (c) 1991-2013 Kawahara Lab., Kyoto University
dnl Copyright (c) 1997-2000 Information-technology Promotion Agency, Japan
dnl Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
dnl Copyright (c) 2005-2013 Julius project team, Nagoya Institute of Technology
dnl All rights reserved
dnl
dnl $Id: configure.in,v 1.21 2014/01/16 05:41:03 sumomo Exp $
dnl
AC_INIT(src/search_bestfirst_main.c)
AC_CONFIG_HEADER(include/julius/config.h)
AC_CONFIG_AUX_DIR(../support)
JULIUS_PRODUCTNAME=JuliusLib
JULIUS_MAJOR_VERSION=4
JULIUS_MINOR_VERSION=5
JULIUS_VERSION=${JULIUS_MAJOR_VERSION}.${JULIUS_MINOR_VERSION}
EXTRAOBJ=""
dnl Checks for options
dnl pthread support
AC_ARG_ENABLE(pthread,
[ --disable-pthread [debug] do not use pthread for speech input],
want_pthread=$enableval
,want_pthread=yes)
dnl easy setup
AC_ARG_ENABLE(setup,
[ --enable-setup=... select algorithm set
standard high accuracy, slow speed
fast balanced for both speed and accuracy (default)
v2.1 backward compatible with Rev.2.1],
easy_setup=$enableval,
easy_setup=fast
)
dnl expand easy setup
if test "$easy_setup" = standard; then
dnl JULIUS related begin
dnl AC_DEFINE(UNIGRAM_FACTORING)
want_unigram_factoring=yes
dnl JULIUS related end
dnl AC_DEFINE(PASS1_IWCD)
want_pass1_iwcd=yes
dnl AC_DEFINE(PASS2_STRICT_IWCD)
want_pass2_strict_iwcd=yes
dnl AC_DEFINE(GPRUNE_DEFAULT_SAFE)
want_gprune_default=safe
elif test "$easy_setup" = fast; then
dnl JULIUS related begin
dnl AC_DEFINE(UNIGRAM_FACTORING)
want_unigram_factoring=yes
dnl AC_DEFINE(LOWMEM2)
want_lowmem2=yes
dnl JULIUS related end
dnl AC_DEFINE(PASS1_IWCD)
want_pass1_iwcd=yes
dnl AC_DEFINE(GPRUNE_DEFAULT_BEAM)
want_gprune_default=beam
elif test "$easy_setup" = v2.1; then
dnl AC_DEFINE(GPRUNE_DEFAULT_SAFE)
want_gprune_default=safe
fi
dnl multipath version
dnl AC_ARG_ENABLE(multipath,
dnl [ --enable-multipath compile as multipath version],
dnl want_multipath=$enableval
dnl ,want_multipath=no)
dnl JULIUS related begin
dnl enable 1-gram factoring
AC_ARG_ENABLE(factor1,
[ --enable-factor1 use 1-gram factoring on 1st pass],
dnl AC_DEFINE(UNIGRAM_FACTORING)
want_unigram_factoring=$enableval)
AC_ARG_ENABLE(factor2,
[ --enable-factor2 use 2-gram factoring on 1st pass],
if test "$enableval" = yes; then
want_unigram_factoring=no
else
want_unigram_factoring=yes
fi)
dnl no linear tree separation
AC_ARG_ENABLE(lowmem,
[ --enable-lowmem all words share a single root on lexicon tree],
if test "$enableval" = yes; then
AC_DEFINE(LOWMEM)
fi)
dnl linear tree separation for hi-freq words
AC_ARG_ENABLE(lowmem2,
[ --enable-lowmem2 separate hi-freq words from lexicon tree],
dnl AC_DEFINE(LOWMEM2)
want_lowmem2=$enableval)
dnl JULIUS related end
dnl use monophone tree on 1st pass
AC_ARG_ENABLE(monotree,
[ --enable-monotree monophone lexicon on 1st pass (EXPERIMENTAL)],
if test "$enableval" = yes; then
AC_DEFINE(MONOTREE)
fi)
dnl enable score envelope beaming on 2nd pass forward scan
AC_ARG_ENABLE(score-beam,
[ --disable-score-beam enable score envelope beaming on 2nd pass scan],
if test "$enableval" = yes; then
AC_DEFINE(SCAN_BEAM)
fi
,AC_DEFINE(SCAN_BEAM))
dnl enable inter-word context dependency handling on 1st pass
AC_ARG_ENABLE(iwcd1,
[ --enable-iwcd1 handle inter-word triphone on 1st pass],
dnl AC_DEFINE(PASS1_IWCD)
want_pass1_iwcd=$enableval)
dnl enable strict inter-word context handling on 2nd pass (slow)
AC_ARG_ENABLE(strict-iwcd2,
[ --enable-strict-iwcd2 strict IWCD scoring on 2nd pass],
dnl AC_DEFINE(PASS2_STRICT_IWCD)
want_pass2_strict_iwcd=$enableval)
dnl use word-pair approximation on 1st pass
AC_ARG_ENABLE(wpair,
[ --enable-wpair use word-pair approximation on 1st pass],
if test "$enableval" = yes; then
AC_DEFINE(WPAIR)
fi)
dnl use N-best approximation
AC_ARG_ENABLE(wpair-nlimit,
[ --enable-wpair-nlimit keep only N-best path with wpair (-nlimit)],
if test "$enableval" = yes; then
AC_DEFINE(WPAIR)
AC_DEFINE(WPAIR_KEEP_NLIMIT)
fi)
dnl output word graph on 1st pass (default: trellis)
AC_ARG_ENABLE(word-graph,
[ --enable-word-graph use word graph instead of trellis between passes],
if test "$enableval" = yes; then
AC_DEFINE(WORD_GRAPH)
fi)
dnl disable confidence measure computation
AC_ARG_ENABLE(cm,
[ --disable-cm disable confidence measure computation],
use_cm=$enableval
,use_cm=yes)
dnl use confidence measure based on N-best candidate
AC_ARG_ENABLE(cm-nbest,
[ --enable-cm-nbest use N-best CM instead of search CM],
use_cm_nbest=$enableval
,use_cm_nbest=no)
dnl for exprtiment: confidence measure output for multiple alphas
AC_ARG_ENABLE(cm-multiple-alpha,
[ --enable-cm-multiple-alpha EXPERIMENTAL: test multi alphas (need much mem)],
use_cm_multiple_alpha=$enableval
,use_cm_multiple_alpha=no)
# disable lmfix
AC_ARG_ENABLE(lmfix,
[ --disable-lmfix make LM computing compatible with < 3.4],
if test "$enableval" = yes; then
AC_DEFINE(LM_FIX_DOUBLE_SCORING)
fi
,AC_DEFINE(LM_FIX_DOUBLE_SCORING))
# enable word graph output from N-best sentences
AC_ARG_ENABLE(graphout-nbest,
[ --enable-graphout-nbest word graph output from N-best sentence],
use_graphout_nbest=$enableval
,use_graphout_nbest=no)
# enable pruning by confidence score on 2nd pass
AC_ARG_ENABLE(cmthres,
[ --enable-cmthres enable confidence score based pruning on 2nd pass],
use_cmthres=$enableval
,use_cmthres=no)
dnl GMM VAD
AC_ARG_ENABLE(gmm-vad,
[ --enable-gmm-vad enable GMM-based VAD (EXPERIMENTAL)],
want_gmm_vad=$enableval
,want_gmm_vad=no
)
dnl naist spsegment
AC_ARG_ENABLE(decoder-vad,
[ --enable-decoder-vad enable a new decoder-based VAD by NAIST team],
want_spseg_naist=$enableval
,want_spseg_naist=no
)
dnl naist spsegment
AC_ARG_ENABLE(power-reject,
[ --enable-power-reject enable post rejection by power],
want_power_reject=$enableval
,want_power_reject=no
)
dnl plugin support
AC_ARG_ENABLE(plugin,
[ --disable-plugin disable plugin support],
if test "$enableval" = yes; then
AC_DEFINE(ENABLE_PLUGIN)
fi
,AC_DEFINE(ENABLE_PLUGIN))
dnl libfvad
AC_ARG_ENABLE(libfvad,
[ --disable-libfvad disable libfvad library],
use_libfvad=$enableval
,use_libfvad=yes)
dnl CM options check
if test "$use_cm" = yes; then
AC_DEFINE(CONFIDENCE_MEASURE)
fi
if test "$use_cm_nbest" = yes; then
if test "$use_cm" = yes; then
AC_DEFINE(CM_NBEST)
else
AC_MSG_ERROR([--disable-cm and --enable-cm-nbest conflicts])
fi
fi
if test "$use_cm_multiple_alpha" = yes; then
if test "$use_cm" = yes; then
AC_DEFINE(CM_MULTIPLE_ALPHA)
else
AC_MSG_ERROR([--disable-cm and --enable-cm-multiple-alpha conflicts])
fi
fi
if test "$use_cmthres" = yes; then
if test "$use_cm" = yes; then
if test "$use_cm_nbest" = yes; then
AC_MSG_ERROR([--enable-cmthres cannot be used with --enable-cm-nbest])
elif test "$use_cm_multiple_alpha" = yes; then
AC_MSG_ERROR([--enable-cmthres cannot be used with --enable-cm-multiple-alpha])
else
AC_DEFINE(CM_SEARCH_LIMIT)
fi
else
AC_MSG_ERROR([--disable-cm and --enable-cmthres conflicts])
fi
fi
dnl graphout option
if test "$use_graphout_nbest" = no; then
AC_DEFINE(GRAPHOUT_DYNAMIC)
AC_DEFINE(GRAPHOUT_SEARCH)
fi
dnl final definition based on easy setup and separate option
if test ! -z "$want_unigram_factoring"; then
if test "$want_unigram_factoring" = yes; then
AC_DEFINE(UNIGRAM_FACTORING)
fi
fi
if test ! -z "$want_pass1_iwcd"; then
if test "$want_pass1_iwcd" = yes; then
AC_DEFINE(PASS1_IWCD)
fi
fi
if test ! -z "$want_pass2_strict_iwcd"; then
if test "$want_pass2_strict_iwcd" = yes; then
AC_DEFINE(PASS2_STRICT_IWCD)
fi
fi
if test ! -z "$want_lowmem2"; then
if test "$want_lowmem2" = yes; then
AC_DEFINE(LOWMEM2)
fi
fi
if test "$want_gprune_default" = safe; then
AC_DEFINE(GPRUNE_DEFAULT_SAFE)
elif test "$want_gprune_default" = beam; then
AC_DEFINE(GPRUNE_DEFAULT_BEAM)
fi
dnl multipath version
dnl if test "$want_multipath" = yes; then
dnl AC_DEFINE(MULTIPATH_VERSION)
dnl VERSION="${VERSION}-multipath"
dnl fi
if test "$want_gmm_vad" = yes; then
AC_DEFINE(GMM_VAD)
AC_DEFINE(BACKEND_VAD)
fi
if test "$want_spseg_naist" = yes; then
AC_DEFINE(SPSEGMENT_NAIST)
AC_DEFINE(BACKEND_VAD)
fi
if test "$want_power_reject" = yes; then
AC_DEFINE(POWER_REJECT)
fi
dnl -------------------------------------------------------------------
dnl Checks for system.
AC_CANONICAL_HOST
dnl Checks for optimization flag
AC_MSG_CHECKING([host-specific optimization flag])
if test -z "$CFLAGS" ; then
OPTFLAG=../support/cflags.${host_cpu}-${host_vendor}-${host_os}
if test -f "$OPTFLAG" ; then
. $OPTFLAG
AC_MSG_RESULT([$OPTFLAG])
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([skipped])
fi
dnl Checks for compiler.
AC_PROG_CC
AC_PROG_CPP
dnl Checks for programs.
AC_PROG_INSTALL
AC_PATH_PROG(RM, rm)
AC_PROG_RANLIB
AC_EXEEXT
AM_PROG_AR
AM_PROG_AR
test -n "$ARFLAGS" || ARFLAGS="cr"
dnl Checks for libraries.
dnl add '-lLIBRARY' to LIBS and define 'HAVE_LIBLIBRARY'
dnl AC_CHECK_LIB(m, log10)
dnl Checks for header files.
AC_HEADER_STDC
dnl AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h sys/ioctl.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl AC_TYPE_SIZE_T
dnl Checks for library functions.
dnl AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
dnl AC_CHECK_FUNCS(strdup strstr)
dnl AC_CHECK_FUNC(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
dnl AC_CHECK_FUNC(connect,,AC_CHECK_LIB(socket, connect))
dnl Checks whether fPIC compiler option is accepted
AC_MSG_CHECKING(whether fPIC compiler option is accepted)
xxxCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fPIC -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
[AC_MSG_RESULT(yes)
CFLAGS="$xxxCFLAGS -fPIC"],
[AC_MSG_RESULT(no)
CFLAGS="$xxxCFLAGS"])
dnl check for POSIX thread support
if test "$want_pthread" = yes; then
case "$host_os" in
freebsd*)
# FreeBSD
AC_MSG_CHECKING([for linking POSIX threaded process])
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -pthread"
AC_TRY_LINK([#include <pthread.h>],[pthread_equal(NULL,NULL);],
use_pthread=yes
AC_DEFINE(HAVE_PTHREAD)
CPPFLAGS="$CPPFLAGS -pthread",
use_pthread=no
)
CFLAGS="$ac_save_CFLAGS"
;;
mingw*)
;;
*)
# other with libpthread
AC_MSG_CHECKING([for POSIX thread library in -lpthread])
ac_save_LIBS_p="$LIBS"
LIBS="$LIBS -lpthread"
AC_TRY_LINK([#include <pthread.h>],[pthread_equal(NULL,NULL);],
use_pthread=yes
AC_DEFINE(HAVE_PTHREAD),
use_pthread=no
LIBS="$ac_save_LIBS_p"
)
esac
AC_MSG_RESULT("$use_pthread")
else
use_pthread=no
fi
AC_CHECK_FUNC(dlopen,,AC_CHECK_LIB(dl, dlopen))
dnl check for libfvad
if test "$use_libfvad" = yes; then
TMPCPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I."
AC_CHECK_HEADER(libfvad/libfvad/include/fvad.h,
EXTRAOBJ="$EXTRAOBJ libfvad/libfvad/src/fvad.o libfvad/libfvad/src/signal_processing/division_operations.o libfvad/libfvad/src/signal_processing/energy.o libfvad/libfvad/src/signal_processing/get_scaling_square.o libfvad/libfvad/src/signal_processing/resample_48khz.o libfvad/libfvad/src/signal_processing/resample_by_2_internal.o libfvad/libfvad/src/signal_processing/resample_fractional.o libfvad/libfvad/src/signal_processing/spl_inl.o libfvad/libfvad/src/vad/vad_core.o libfvad/libfvad/src/vad/vad_filterbank.o libfvad/libfvad/src/vad/vad_gmm.o libfvad/libfvad/src/vad/vad_sp.o"
AC_DEFINE(HAVE_LIBFVAD))
CPPFLAGS="$TMPCPPFLAGS"
fi
dnl write names
AC_DEFINE_UNQUOTED(JULIUS_PRODUCTNAME, "$JULIUS_PRODUCTNAME")
AC_DEFINE_UNQUOTED(JULIUS_VERSION, "$JULIUS_VERSION")
AC_DEFINE_UNQUOTED(JULIUS_SETUP, "$easy_setup")
AC_DEFINE_UNQUOTED(JULIUS_HOSTINFO, "$host")
AC_DEFINE_UNQUOTED(JULIUS_BUILD_INFO, "$CC $CFLAGS")
AC_SUBST(JULIUS_PRODUCTNAME)
AC_SUBST(JULIUS_MAJOR_VERSION)
AC_SUBST(JULIUS_MINOR_VERSION)
AC_SUBST(JULIUS_VERSION)
AC_SUBST(easy_setup)
AC_SUBST(EXTRAOBJ)
AC_SUBST(ARFLAGS)
AC_OUTPUT_COMMANDS(
[chmod +x libjulius-config libjulius-config-dist
])
AC_OUTPUT(Makefile libjulius-config libjulius-config-dist julius-$JULIUS_MAJOR_VERSION.pc:julius.pc.in doxygen.conf.ver)