eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 8.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. AC_PREREQ([2.63])
  2. AC_INIT([eSpeak], [1.48], [https://github.com/rhdunn/espeak/issues], [espeak], [https://github.com/rhdunn/espeak])
  3. AM_INIT_AUTOMAKE()
  4. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES])
  5. AM_SILENT_RULES([yes])
  6. AC_CONFIG_SRCDIR([src])
  7. AC_CONFIG_MACRO_DIR([m4])
  8. AC_CONFIG_HEADERS([config.h])
  9. dnl ================================================================
  10. dnl Program checks.
  11. dnl ================================================================
  12. AC_PROG_CC
  13. AC_PROG_CXX
  14. AC_PROG_MAKE_SET
  15. AC_PROG_LIBTOOL
  16. dnl ================================================================
  17. dnl C11 compiler checks.
  18. dnl ================================================================
  19. AC_LANG_PUSH(C)
  20. AC_MSG_CHECKING([if $CC supports C11 without any flags])
  21. AC_COMPILE_IFELSE(
  22. [AC_LANG_PROGRAM(
  23. [[// test]],
  24. [[]])],
  25. [AC_MSG_RESULT([yes])
  26. have_c11_native=yes],
  27. [AC_MSG_RESULT([no])
  28. have_c11_native=no])
  29. AC_LANG_POP(C)
  30. AC_LANG_PUSH(C)
  31. TEMP_CFLAGS="$CFLAGS"
  32. CFLAGS="$CFLAGS -std=c11"
  33. AC_MSG_CHECKING([if $CC supports C11 with the -std=c11 flag])
  34. AC_COMPILE_IFELSE(
  35. [AC_LANG_PROGRAM(
  36. [[// test]],
  37. [[]])],
  38. [AC_MSG_RESULT([yes])
  39. have_c11_c11=yes],
  40. [AC_MSG_RESULT([no])
  41. have_c11_c11=no])
  42. CFLAGS="$TEMP_CFLAGS"
  43. AC_LANG_POP(C)
  44. AC_MSG_CHECKING([if $CC supports C11])
  45. if test "$have_c11_c11" = yes ; then
  46. AC_MSG_RESULT([-std=c11])
  47. CFLAGS="$CFLAGS -std=c11"
  48. elif test "$have_c11_native" = yes ; then
  49. AC_MSG_RESULT([yes])
  50. else
  51. AC_MSG_RESULT([no])
  52. AC_MSG_ERROR([C11 is not supported by $CC.])
  53. fi
  54. dnl ================================================================
  55. dnl getopt checks.
  56. dnl ================================================================
  57. AC_CHECK_HEADERS([getopt.h])
  58. AC_CHECK_FUNCS([getopt_long])
  59. dnl ================================================================
  60. dnl PulseAudio checks.
  61. dnl ================================================================
  62. AC_ARG_WITH([pulseaudio],
  63. [AS_HELP_STRING([--with-pulseaudio], [use the pulseaudio library for audio output @<:@default=yes@:>@])],
  64. [])
  65. if test "$with_pulseaudio" = "no"; then
  66. echo "Disabling pulseaudio output support via pulseaudio"
  67. have_pulseaudio=no
  68. else
  69. PKG_CHECK_MODULES(PULSEAUDIO, [libpulse >= 0.9],
  70. [
  71. have_pulseaudio=yes
  72. ],[
  73. have_pulseaudio=no
  74. ])
  75. fi
  76. dnl ================================================================
  77. dnl PortAudio checks.
  78. dnl ================================================================
  79. AC_ARG_WITH([portaudio],
  80. [AS_HELP_STRING([--with-portaudio], [use the portaudio library for audio output @<:@default=yes@:>@])],
  81. [])
  82. if test "$with_portaudio" = "no"; then
  83. echo "Disabling portaudio output support via portaudio"
  84. have_portaudio=no
  85. else
  86. AC_CHECK_HEADERS([portaudio.h],
  87. [
  88. # Check the portaudio library.
  89. AC_CHECK_LIB([portaudio], [Pa_IsStreamActive]) # portaudio 19
  90. AC_CHECK_LIB([portaudio], [Pa_StreamActive]) # portaudio 18
  91. # Then use the headers to determine the portaudio version.
  92. # This is because on some systems with both libportaudio0 and
  93. # libportaudio2 installed, portaudio.h and -lportaudio refer
  94. # to different versions.
  95. AC_CHECK_FUNC([Pa_IsStreamActive],
  96. [
  97. have_portaudio=19
  98. ],[
  99. AC_CHECK_FUNC([Pa_StreamActive],
  100. [
  101. have_portaudio=18
  102. ],[
  103. have_portaudio=no
  104. ])
  105. ])
  106. ],[
  107. have_portaudio=no
  108. ])
  109. fi
  110. dnl ================================================================
  111. dnl Audio checks.
  112. dnl ================================================================
  113. AC_ARG_WITH([sada],
  114. [AS_HELP_STRING([--with-sada], [use the Solaris SADA audio API @<:@default=no@:>@])],
  115. [])
  116. if test "$with_sada" = "yes" ; then
  117. have_sada=yes
  118. else
  119. have_sada=no
  120. fi
  121. if test "$have_portaudio" = 18 -o "$have_portaudio" = 19 ; then
  122. if test "$have_pulseaudio" = yes ; then
  123. PKG_CHECK_MODULES(PULSEAUDIO_SIMPLE, [libpulse-simple >= 0.9],
  124. [
  125. have_pulseaudio=yes
  126. AUDIO=runtime
  127. ],[
  128. have_pulseaudio=no
  129. AUDIO=portaudio
  130. ])
  131. else
  132. AUDIO=portaudio
  133. fi
  134. elif test "$have_pulseaudio" = yes ; then
  135. AUDIO=pulseaudio
  136. elif test "$have_sada" = yes ; then
  137. AUDIO=sada
  138. else
  139. AUDIO=disabled
  140. fi
  141. AC_SUBST(AUDIO)
  142. AM_CONDITIONAL(AUDIO_RUNTIME, [test x"$AUDIO" = xruntime])
  143. AM_CONDITIONAL(AUDIO_PULSEAUDIO, [test x"$AUDIO" = xpulseaudio])
  144. AM_CONDITIONAL(AUDIO_PORTAUDIO, [test x"$AUDIO" = xportaudio])
  145. AM_CONDITIONAL(AUDIO_SADA, [test x"$AUDIO" = xsada])
  146. dnl ================================================================
  147. dnl Optional compilation checks.
  148. dnl ================================================================
  149. AC_ARG_WITH([klatt],
  150. [AS_HELP_STRING([--with-klatt], [enable the Klatt formant synthesizer @<:@default=yes@:>@])],
  151. [])
  152. if test "$with_klatt" = "no" ; then
  153. have_klatt=no
  154. else
  155. have_klatt=yes
  156. fi
  157. AC_ARG_WITH([mbrola],
  158. [AS_HELP_STRING([--with-mbrola], [enable the MBROLA speech synthesizer @<:@default=yes@:>@])],
  159. [])
  160. if test "$with_mbrola" = "no" ; then
  161. have_mbrola=no
  162. else
  163. have_mbrola=yes
  164. fi
  165. AC_ARG_WITH([sonic],
  166. [AS_HELP_STRING([--with-sonic], [enable the sonic library to speed up the audio @<:@default=yes@:>@])],
  167. [])
  168. if test "$with_sonic" = "no" ; then
  169. have_sonic=no
  170. else
  171. have_sonic=yes
  172. fi
  173. AC_ARG_WITH([async],
  174. [AS_HELP_STRING([--with-async], [enable support for async command processing @<:@default=yes@:>@])],
  175. [])
  176. if test "$with_async" = "no" ; then
  177. have_async=no
  178. else
  179. have_async=yes
  180. fi
  181. AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes])
  182. AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes])
  183. AM_CONDITIONAL(OPT_SONIC, [test x"$have_sonic" = xyes])
  184. AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes])
  185. dnl ================================================================
  186. dnl Extended dictionary checks.
  187. dnl ================================================================
  188. AC_ARG_WITH([extdict-ru],
  189. [AS_HELP_STRING([--with-extdict-ru], [use the extended Russian Dictionary file @<:@default=no@:>@])],
  190. [])
  191. if test "$with_extdict_ru" = "yes" ; then
  192. have_extdict_ru=yes
  193. else
  194. have_extdict_ru=no
  195. fi
  196. AC_ARG_WITH([extdict-zh],
  197. [AS_HELP_STRING([--with-extdict-zh], [use the extended Mandarin Chinese Dictionary file @<:@default=no@:>@])],
  198. [])
  199. if test "$with_extdict_zh" = "yes" ; then
  200. have_extdict_zh=yes
  201. else
  202. have_extdict_zh=no
  203. fi
  204. AC_ARG_WITH([extdict-zhy],
  205. [AS_HELP_STRING([--with-extdict-zhy], [use the extended Cantonese Chinese Dictionary file @<:@default=no@:>@])],
  206. [])
  207. if test "$with_extdict_zhy" = "yes" ; then
  208. have_extdict_zhy=yes
  209. else
  210. have_extdict_zhy=no
  211. fi
  212. AM_CONDITIONAL(HAVE_RU_EXTENDED_DICTIONARY, [test x"$have_extdict_ru" = xyes])
  213. AM_CONDITIONAL(HAVE_ZH_EXTENDED_DICTIONARY, [test x"$have_extdict_zh" = xyes])
  214. AM_CONDITIONAL(HAVE_ZHY_EXTENDED_DICTIONARY, [test x"$have_extdict_zhy" = xyes])
  215. dnl ================================================================
  216. dnl wxWidgets checks.
  217. dnl ================================================================
  218. AC_ARG_WITH([wx-config],
  219. [AS_HELP_STRING([--with-wx-config], [specify the location of wx-config @<:@default=wx-config@:>@])],
  220. [WX_CONFIG=$with_wx_config],
  221. [WX_CONFIG=wx-config])
  222. if test ! -e "${WX_CONFIG}" ; then
  223. AC_CHECK_PROG(WXCONFIG_CHECK,${WX_CONFIG},yes)
  224. if test x"$WXCONFIG_CHECK" != x"yes" ; then
  225. AC_MSG_ERROR([Cannot find wxWidgets which is needed for espeakedit to build the voices.])
  226. fi
  227. fi
  228. WX_LIBS=`${WX_CONFIG} --libs`
  229. WX_CXXFLAGS=`${WX_CONFIG} --cxxflags`
  230. WX_VERSION=`${WX_CONFIG} --version`
  231. AC_SUBST(WX_LIBS)
  232. AC_SUBST(WX_CXXFLAGS)
  233. dnl ================================================================
  234. dnl Generate output.
  235. dnl ================================================================
  236. AC_CONFIG_FILES([Makefile])
  237. AC_OUTPUT
  238. AC_MSG_NOTICE([
  239. Configuration for eSpeak complete.
  240. Source code location: ${srcdir}
  241. C11 Compiler: ${CC}
  242. C11 Compiler flags: ${CFLAGS}
  243. C++ Compiler: ${CXX}
  244. C++ Compiler flags: ${CXXFLAGS}
  245. wxWidgets: ${WX_VERSION} (${WX_CONFIG})
  246. pulseaudio: ${have_pulseaudio}
  247. portaudio: ${have_portaudio}
  248. sada: ${have_sada}
  249. audio configuration: ${AUDIO}
  250. Klatt: ${have_klatt}
  251. MBROLA: ${have_mbrola}
  252. Sonic: ${have_sonic}
  253. Async: ${have_async}
  254. Extended Dictionaries:
  255. Russian: ${have_extdict_ru}
  256. Chinese (Mandarin): ${have_extdict_zh}
  257. Chinese (Cantonese): ${have_extdict_zhy}
  258. ])