forked from hgneng/ekho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
196 lines (172 loc) · 6.14 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#AC_PREREQ(2.60)
AC_INIT(ekho, 7.5.1, hgneng at gmail.com)
AC_CONFIG_AUX_DIR([.])
AM_PROG_AR
AM_INIT_AUTOMAKE([-Wall foreign 1.9 tar-pax subdir-objects])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_LIBTOOL
# 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_HEADER_STDC
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], [main], [], [AC_MSG_FAILURE([espeak test 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,
[AC_HELP_STRING([--enable-speechd],
[Enable speech-dispatcher API])],
[AM_CONDITIONAL(ENABLE_SPEECHD, true)],
[AM_CONDITIONAL(ENABLE_SPEECHD, false)]
)
AC_SUBST([LIB_FESTIVAL])
AC_SUBST([CFLAG_FESTIVAL])
AC_ARG_ENABLE(festival,
[AC_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_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
# ], [])])
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