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

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