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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. AC_PREREQ([2.63])
  2. AC_INIT([eSpeak NG], [1.48.15], [https://github.com/espeak-ng/espeak-ng/issues], [espeak-ng], [https://github.com/espeak-ng/espeak-ng])
  3. AM_INIT_AUTOMAKE()
  4. LT_INIT
  5. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES])
  6. AM_SILENT_RULES([yes])
  7. AC_CONFIG_SRCDIR([src])
  8. AC_CONFIG_MACRO_DIR([m4])
  9. AC_CONFIG_HEADERS([config.h])
  10. dnl ================================================================
  11. dnl Program checks.
  12. dnl ================================================================
  13. AC_PROG_CC
  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. AC_C_INLINE
  55. AC_C_RESTRICT
  56. dnl ================================================================
  57. dnl library checks.
  58. dnl ================================================================
  59. AC_CHECK_HEADER_STDBOOL
  60. AC_CHECK_HEADERS([fcntl.h])
  61. AC_CHECK_HEADERS([getopt.h])
  62. AC_CHECK_HEADERS([locale.h])
  63. AC_CHECK_HEADERS([stddef.h])
  64. AC_CHECK_HEADERS([sys/time.h])
  65. AC_CHECK_HEADERS([wchar.h])
  66. AC_CHECK_HEADERS([wctype.h])
  67. AC_TYPE_SIZE_T
  68. AC_TYPE_SSIZE_T
  69. AC_TYPE_UINT16_T
  70. AC_TYPE_UINT32_T
  71. AC_TYPE_UINT64_T
  72. AC_FUNC_FORK
  73. AC_FUNC_MALLOC
  74. AC_FUNC_REALLOC
  75. AC_FUNC_STRCOLL
  76. AC_FUNC_ERROR_AT_LINE
  77. AC_CHECK_FUNCS([dup2])
  78. AC_CHECK_FUNCS([getopt_long])
  79. AC_CHECK_FUNCS([gettimeofday])
  80. AC_CHECK_FUNCS([memchr])
  81. AC_CHECK_FUNCS([memmove])
  82. AC_CHECK_FUNCS([memset])
  83. AC_CHECK_FUNCS([mkdir])
  84. AC_CHECK_FUNCS([pow])
  85. AC_CHECK_FUNCS([setlocale])
  86. AC_CHECK_FUNCS([sqrt])
  87. AC_CHECK_FUNCS([strchr])
  88. AC_CHECK_FUNCS([strdup])
  89. AC_CHECK_FUNCS([strerror])
  90. AC_CHECK_FUNCS([strrchr])
  91. AC_CHECK_FUNCS([strstr])
  92. dnl ================================================================
  93. dnl PulseAudio checks.
  94. dnl ================================================================
  95. AC_ARG_WITH([pulseaudio],
  96. [AS_HELP_STRING([--with-pulseaudio], [use the pulseaudio library for audio output @<:@default=yes@:>@])],
  97. [])
  98. if test "$with_pulseaudio" = "no"; then
  99. echo "Disabling pulseaudio output support via pulseaudio"
  100. have_pulseaudio=no
  101. else
  102. PKG_CHECK_MODULES(PULSEAUDIO, [libpulse >= 0.9],
  103. [
  104. have_pulseaudio=yes
  105. ],[
  106. have_pulseaudio=no
  107. ])
  108. fi
  109. dnl ================================================================
  110. dnl PortAudio checks.
  111. dnl ================================================================
  112. AC_ARG_WITH([portaudio],
  113. [AS_HELP_STRING([--with-portaudio], [use the portaudio library for audio output @<:@default=yes@:>@])],
  114. [])
  115. if test "$with_portaudio" = "no"; then
  116. echo "Disabling portaudio output support via portaudio"
  117. have_portaudio=no
  118. else
  119. AC_CHECK_HEADERS([portaudio.h],
  120. [
  121. # Check the portaudio library.
  122. AC_CHECK_LIB([portaudio], [Pa_IsStreamActive]) # portaudio 19
  123. AC_CHECK_LIB([portaudio], [Pa_StreamActive]) # portaudio 18
  124. # Then use the headers to determine the portaudio version.
  125. # This is because on some systems with both libportaudio0 and
  126. # libportaudio2 installed, portaudio.h and -lportaudio refer
  127. # to different versions.
  128. AC_CHECK_FUNC([Pa_IsStreamActive],
  129. [
  130. have_portaudio=19
  131. ],[
  132. AC_CHECK_FUNC([Pa_StreamActive],
  133. [
  134. have_portaudio=18
  135. ],[
  136. have_portaudio=no
  137. ])
  138. ])
  139. ],[
  140. have_portaudio=no
  141. ])
  142. fi
  143. dnl ================================================================
  144. dnl Audio checks.
  145. dnl ================================================================
  146. AC_ARG_WITH([sada],
  147. [AS_HELP_STRING([--with-sada], [use the Solaris SADA audio API @<:@default=no@:>@])],
  148. [])
  149. if test "$with_sada" = "yes" ; then
  150. have_sada=yes
  151. else
  152. have_sada=no
  153. fi
  154. if test "$have_portaudio" = 18 -o "$have_portaudio" = 19 ; then
  155. if test "$have_pulseaudio" = yes ; then
  156. PKG_CHECK_MODULES(PULSEAUDIO_SIMPLE, [libpulse-simple >= 0.9],
  157. [
  158. have_pulseaudio=yes
  159. AUDIO=runtime
  160. ],[
  161. have_pulseaudio=no
  162. AUDIO=portaudio
  163. ])
  164. else
  165. AUDIO=portaudio
  166. fi
  167. elif test "$have_pulseaudio" = yes ; then
  168. AUDIO=pulseaudio
  169. elif test "$have_sada" = yes ; then
  170. AUDIO=sada
  171. else
  172. AUDIO=disabled
  173. fi
  174. AC_SUBST(AUDIO)
  175. AM_CONDITIONAL(AUDIO_RUNTIME, [test x"$AUDIO" = xruntime])
  176. AM_CONDITIONAL(AUDIO_PULSEAUDIO, [test x"$AUDIO" = xpulseaudio])
  177. AM_CONDITIONAL(AUDIO_PORTAUDIO, [test x"$AUDIO" = xportaudio])
  178. AM_CONDITIONAL(AUDIO_SADA, [test x"$AUDIO" = xsada])
  179. dnl ================================================================
  180. dnl Optional compilation checks.
  181. dnl ================================================================
  182. AC_ARG_WITH([klatt],
  183. [AS_HELP_STRING([--with-klatt], [enable the Klatt formant synthesizer @<:@default=yes@:>@])],
  184. [])
  185. if test "$with_klatt" = "no" ; then
  186. have_klatt=no
  187. else
  188. have_klatt=yes
  189. fi
  190. AC_ARG_WITH([mbrola],
  191. [AS_HELP_STRING([--with-mbrola], [enable the MBROLA speech synthesizer @<:@default=yes@:>@])],
  192. [])
  193. if test "$with_mbrola" = "no" ; then
  194. have_mbrola=no
  195. else
  196. have_mbrola=yes
  197. fi
  198. AC_ARG_WITH([sonic],
  199. [AS_HELP_STRING([--with-sonic], [enable the sonic library to speed up the audio @<:@default=yes@:>@])],
  200. [])
  201. if test "$with_sonic" = "no" ; then
  202. have_sonic=no
  203. else
  204. AC_CHECK_HEADERS([sonic.h],
  205. [
  206. AC_CHECK_LIB([sonic], [sonicCreateStream])
  207. have_sonic=yes
  208. ],[
  209. have_sonic=no
  210. ])
  211. fi
  212. AC_ARG_WITH([async],
  213. [AS_HELP_STRING([--with-async], [enable support for async command processing @<:@default=yes@:>@])],
  214. [])
  215. if test "$with_async" = "no" ; then
  216. have_async=no
  217. else
  218. have_async=yes
  219. fi
  220. AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes])
  221. AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes])
  222. AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes])
  223. dnl ================================================================
  224. dnl Extended dictionary checks.
  225. dnl ================================================================
  226. AC_ARG_WITH([extdict-ru],
  227. [AS_HELP_STRING([--with-extdict-ru], [use the extended Russian Dictionary file @<:@default=no@:>@])],
  228. [])
  229. if test "$with_extdict_ru" = "yes" ; then
  230. have_extdict_ru=yes
  231. else
  232. have_extdict_ru=no
  233. fi
  234. AC_ARG_WITH([extdict-zh],
  235. [AS_HELP_STRING([--with-extdict-zh], [use the extended Mandarin Chinese Dictionary file @<:@default=no@:>@])],
  236. [])
  237. if test "$with_extdict_zh" = "yes" ; then
  238. have_extdict_zh=yes
  239. else
  240. have_extdict_zh=no
  241. fi
  242. AC_ARG_WITH([extdict-zhy],
  243. [AS_HELP_STRING([--with-extdict-zhy], [use the extended Cantonese Chinese Dictionary file @<:@default=no@:>@])],
  244. [])
  245. if test "$with_extdict_zhy" = "yes" ; then
  246. have_extdict_zhy=yes
  247. else
  248. have_extdict_zhy=no
  249. fi
  250. AM_CONDITIONAL(HAVE_RU_EXTENDED_DICTIONARY, [test x"$have_extdict_ru" = xyes])
  251. AM_CONDITIONAL(HAVE_ZH_EXTENDED_DICTIONARY, [test x"$have_extdict_zh" = xyes])
  252. AM_CONDITIONAL(HAVE_ZHY_EXTENDED_DICTIONARY, [test x"$have_extdict_zhy" = xyes])
  253. dnl ================================================================
  254. dnl Generate output.
  255. dnl ================================================================
  256. AC_CONFIG_FILES([Makefile])
  257. AC_OUTPUT
  258. AC_MSG_NOTICE([
  259. Configuration for eSpeak NG complete.
  260. Source code location: ${srcdir}
  261. C11 Compiler: ${CC}
  262. C11 Compiler flags: ${CFLAGS}
  263. pulseaudio: ${have_pulseaudio}
  264. portaudio: ${have_portaudio}
  265. sada: ${have_sada}
  266. audio configuration: ${AUDIO}
  267. Klatt: ${have_klatt}
  268. MBROLA: ${have_mbrola}
  269. Sonic: ${have_sonic}
  270. Async: ${have_async}
  271. Extended Dictionaries:
  272. Russian: ${have_extdict_ru}
  273. Chinese (Mandarin): ${have_extdict_zh}
  274. Chinese (Cantonese): ${have_extdict_zhy}
  275. ])