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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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([strcasecmp])
  88. AC_CHECK_FUNCS([strchr])
  89. AC_CHECK_FUNCS([strdup])
  90. AC_CHECK_FUNCS([strerror])
  91. AC_CHECK_FUNCS([strrchr])
  92. AC_CHECK_FUNCS([strstr])
  93. dnl ================================================================
  94. dnl PulseAudio checks.
  95. dnl ================================================================
  96. AC_ARG_WITH([pulseaudio],
  97. [AS_HELP_STRING([--with-pulseaudio], [use the pulseaudio library for audio output @<:@default=yes@:>@])],
  98. [])
  99. if test "$with_pulseaudio" = "no"; then
  100. echo "Disabling pulseaudio output support via pulseaudio"
  101. have_pulseaudio=no
  102. else
  103. PKG_CHECK_MODULES(PULSEAUDIO, [libpulse >= 0.9],
  104. [
  105. have_pulseaudio=yes
  106. ],[
  107. have_pulseaudio=no
  108. ])
  109. fi
  110. dnl ================================================================
  111. dnl PortAudio checks.
  112. dnl ================================================================
  113. AC_ARG_WITH([portaudio],
  114. [AS_HELP_STRING([--with-portaudio], [use the portaudio library for audio output @<:@default=yes@:>@])],
  115. [])
  116. if test "$with_portaudio" = "no"; then
  117. echo "Disabling portaudio output support via portaudio"
  118. have_portaudio=no
  119. else
  120. AC_CHECK_HEADERS([portaudio.h],
  121. [
  122. # Check the portaudio library.
  123. AC_CHECK_LIB([portaudio], [Pa_IsStreamActive]) # portaudio 19
  124. AC_CHECK_LIB([portaudio], [Pa_StreamActive]) # portaudio 18
  125. # Then use the headers to determine the portaudio version.
  126. # This is because on some systems with both libportaudio0 and
  127. # libportaudio2 installed, portaudio.h and -lportaudio refer
  128. # to different versions.
  129. AC_CHECK_FUNC([Pa_IsStreamActive],
  130. [
  131. have_portaudio=19
  132. ],[
  133. AC_CHECK_FUNC([Pa_StreamActive],
  134. [
  135. have_portaudio=18
  136. ],[
  137. have_portaudio=no
  138. ])
  139. ])
  140. ],[
  141. have_portaudio=no
  142. ])
  143. fi
  144. dnl ================================================================
  145. dnl Audio checks.
  146. dnl ================================================================
  147. AC_ARG_WITH([sada],
  148. [AS_HELP_STRING([--with-sada], [use the Solaris SADA audio API @<:@default=no@:>@])],
  149. [])
  150. if test "$with_sada" = "yes" ; then
  151. have_sada=yes
  152. else
  153. have_sada=no
  154. fi
  155. if test "$have_portaudio" = 18 -o "$have_portaudio" = 19 ; then
  156. if test "$have_pulseaudio" = yes ; then
  157. PKG_CHECK_MODULES(PULSEAUDIO_SIMPLE, [libpulse-simple >= 0.9],
  158. [
  159. have_pulseaudio=yes
  160. AUDIO=runtime
  161. ],[
  162. have_pulseaudio=no
  163. AUDIO=portaudio
  164. ])
  165. else
  166. AUDIO=portaudio
  167. fi
  168. elif test "$have_pulseaudio" = yes ; then
  169. AUDIO=pulseaudio
  170. elif test "$have_sada" = yes ; then
  171. AUDIO=sada
  172. else
  173. AUDIO=disabled
  174. fi
  175. AC_SUBST(AUDIO)
  176. AM_CONDITIONAL(AUDIO_RUNTIME, [test x"$AUDIO" = xruntime])
  177. AM_CONDITIONAL(AUDIO_PULSEAUDIO, [test x"$AUDIO" = xpulseaudio])
  178. AM_CONDITIONAL(AUDIO_PORTAUDIO, [test x"$AUDIO" = xportaudio])
  179. AM_CONDITIONAL(AUDIO_SADA, [test x"$AUDIO" = xsada])
  180. dnl ================================================================
  181. dnl Optional compilation checks.
  182. dnl ================================================================
  183. AC_ARG_WITH([klatt],
  184. [AS_HELP_STRING([--with-klatt], [enable the Klatt formant synthesizer @<:@default=yes@:>@])],
  185. [])
  186. if test "$with_klatt" = "no" ; then
  187. have_klatt=no
  188. else
  189. have_klatt=yes
  190. fi
  191. AC_ARG_WITH([mbrola],
  192. [AS_HELP_STRING([--with-mbrola], [enable the MBROLA speech synthesizer @<:@default=yes@:>@])],
  193. [])
  194. if test "$with_mbrola" = "no" ; then
  195. have_mbrola=no
  196. else
  197. have_mbrola=yes
  198. fi
  199. AC_ARG_WITH([sonic],
  200. [AS_HELP_STRING([--with-sonic], [enable the sonic library to speed up the audio @<:@default=yes@:>@])],
  201. [])
  202. if test "$with_sonic" = "no" ; then
  203. have_sonic=no
  204. else
  205. have_sonic=yes
  206. fi
  207. AC_ARG_WITH([async],
  208. [AS_HELP_STRING([--with-async], [enable support for async command processing @<:@default=yes@:>@])],
  209. [])
  210. if test "$with_async" = "no" ; then
  211. have_async=no
  212. else
  213. have_async=yes
  214. fi
  215. AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes])
  216. AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes])
  217. AM_CONDITIONAL(OPT_SONIC, [test x"$have_sonic" = xyes])
  218. AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes])
  219. dnl ================================================================
  220. dnl Extended dictionary checks.
  221. dnl ================================================================
  222. AC_ARG_WITH([extdict-ru],
  223. [AS_HELP_STRING([--with-extdict-ru], [use the extended Russian Dictionary file @<:@default=no@:>@])],
  224. [])
  225. if test "$with_extdict_ru" = "yes" ; then
  226. have_extdict_ru=yes
  227. else
  228. have_extdict_ru=no
  229. fi
  230. AC_ARG_WITH([extdict-zh],
  231. [AS_HELP_STRING([--with-extdict-zh], [use the extended Mandarin Chinese Dictionary file @<:@default=no@:>@])],
  232. [])
  233. if test "$with_extdict_zh" = "yes" ; then
  234. have_extdict_zh=yes
  235. else
  236. have_extdict_zh=no
  237. fi
  238. AC_ARG_WITH([extdict-zhy],
  239. [AS_HELP_STRING([--with-extdict-zhy], [use the extended Cantonese Chinese Dictionary file @<:@default=no@:>@])],
  240. [])
  241. if test "$with_extdict_zhy" = "yes" ; then
  242. have_extdict_zhy=yes
  243. else
  244. have_extdict_zhy=no
  245. fi
  246. AM_CONDITIONAL(HAVE_RU_EXTENDED_DICTIONARY, [test x"$have_extdict_ru" = xyes])
  247. AM_CONDITIONAL(HAVE_ZH_EXTENDED_DICTIONARY, [test x"$have_extdict_zh" = xyes])
  248. AM_CONDITIONAL(HAVE_ZHY_EXTENDED_DICTIONARY, [test x"$have_extdict_zhy" = xyes])
  249. dnl ================================================================
  250. dnl Generate output.
  251. dnl ================================================================
  252. AC_CONFIG_FILES([Makefile])
  253. AC_OUTPUT
  254. AC_MSG_NOTICE([
  255. Configuration for eSpeak NG complete.
  256. Source code location: ${srcdir}
  257. C11 Compiler: ${CC}
  258. C11 Compiler flags: ${CFLAGS}
  259. pulseaudio: ${have_pulseaudio}
  260. portaudio: ${have_portaudio}
  261. sada: ${have_sada}
  262. audio configuration: ${AUDIO}
  263. Klatt: ${have_klatt}
  264. MBROLA: ${have_mbrola}
  265. Sonic: ${have_sonic}
  266. Async: ${have_async}
  267. Extended Dictionaries:
  268. Russian: ${have_extdict_ru}
  269. Chinese (Mandarin): ${have_extdict_zh}
  270. Chinese (Cantonese): ${have_extdict_zhy}
  271. ])