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 9.7KB

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