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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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. have_sonic=yes
  205. fi
  206. AC_ARG_WITH([async],
  207. [AS_HELP_STRING([--with-async], [enable support for async command processing @<:@default=yes@:>@])],
  208. [])
  209. if test "$with_async" = "no" ; then
  210. have_async=no
  211. else
  212. have_async=yes
  213. fi
  214. AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes])
  215. AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes])
  216. AM_CONDITIONAL(OPT_SONIC, [test x"$have_sonic" = xyes])
  217. AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes])
  218. dnl ================================================================
  219. dnl Extended dictionary checks.
  220. dnl ================================================================
  221. AC_ARG_WITH([extdict-ru],
  222. [AS_HELP_STRING([--with-extdict-ru], [use the extended Russian Dictionary file @<:@default=no@:>@])],
  223. [])
  224. if test "$with_extdict_ru" = "yes" ; then
  225. have_extdict_ru=yes
  226. else
  227. have_extdict_ru=no
  228. fi
  229. AC_ARG_WITH([extdict-zh],
  230. [AS_HELP_STRING([--with-extdict-zh], [use the extended Mandarin Chinese Dictionary file @<:@default=no@:>@])],
  231. [])
  232. if test "$with_extdict_zh" = "yes" ; then
  233. have_extdict_zh=yes
  234. else
  235. have_extdict_zh=no
  236. fi
  237. AC_ARG_WITH([extdict-zhy],
  238. [AS_HELP_STRING([--with-extdict-zhy], [use the extended Cantonese Chinese Dictionary file @<:@default=no@:>@])],
  239. [])
  240. if test "$with_extdict_zhy" = "yes" ; then
  241. have_extdict_zhy=yes
  242. else
  243. have_extdict_zhy=no
  244. fi
  245. AM_CONDITIONAL(HAVE_RU_EXTENDED_DICTIONARY, [test x"$have_extdict_ru" = xyes])
  246. AM_CONDITIONAL(HAVE_ZH_EXTENDED_DICTIONARY, [test x"$have_extdict_zh" = xyes])
  247. AM_CONDITIONAL(HAVE_ZHY_EXTENDED_DICTIONARY, [test x"$have_extdict_zhy" = xyes])
  248. dnl ================================================================
  249. dnl Generate output.
  250. dnl ================================================================
  251. AC_CONFIG_FILES([Makefile])
  252. AC_OUTPUT
  253. AC_MSG_NOTICE([
  254. Configuration for eSpeak NG complete.
  255. Source code location: ${srcdir}
  256. C11 Compiler: ${CC}
  257. C11 Compiler flags: ${CFLAGS}
  258. pulseaudio: ${have_pulseaudio}
  259. portaudio: ${have_portaudio}
  260. sada: ${have_sada}
  261. audio configuration: ${AUDIO}
  262. Klatt: ${have_klatt}
  263. MBROLA: ${have_mbrola}
  264. Sonic: ${have_sonic}
  265. Async: ${have_async}
  266. Extended Dictionaries:
  267. Russian: ${have_extdict_ru}
  268. Chinese (Mandarin): ${have_extdict_zh}
  269. Chinese (Cantonese): ${have_extdict_zhy}
  270. ])