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.6KB

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