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

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