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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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([mkstemp])
  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 ronn checks.
  225. dnl ================================================================
  226. AC_CHECK_PROG(RONN, ronn, ronn, no)
  227. AM_CONDITIONAL(HAVE_RONN, [test ! x"$RONN" = xno])
  228. dnl ================================================================
  229. dnl Extended dictionary checks.
  230. dnl ================================================================
  231. AC_ARG_WITH([extdict-ru],
  232. [AS_HELP_STRING([--with-extdict-ru], [use the extended Russian Dictionary file @<:@default=no@:>@])],
  233. [])
  234. if test "$with_extdict_ru" = "yes" ; then
  235. have_extdict_ru=yes
  236. else
  237. have_extdict_ru=no
  238. fi
  239. AC_ARG_WITH([extdict-zh],
  240. [AS_HELP_STRING([--with-extdict-zh], [use the extended Mandarin Chinese Dictionary file @<:@default=no@:>@])],
  241. [])
  242. if test "$with_extdict_zh" = "yes" ; then
  243. have_extdict_zh=yes
  244. else
  245. have_extdict_zh=no
  246. fi
  247. AC_ARG_WITH([extdict-zhy],
  248. [AS_HELP_STRING([--with-extdict-zhy], [use the extended Cantonese Chinese Dictionary file @<:@default=no@:>@])],
  249. [])
  250. if test "$with_extdict_zhy" = "yes" ; then
  251. have_extdict_zhy=yes
  252. else
  253. have_extdict_zhy=no
  254. fi
  255. AM_CONDITIONAL(HAVE_RU_EXTENDED_DICTIONARY, [test x"$have_extdict_ru" = xyes])
  256. AM_CONDITIONAL(HAVE_ZH_EXTENDED_DICTIONARY, [test x"$have_extdict_zh" = xyes])
  257. AM_CONDITIONAL(HAVE_ZHY_EXTENDED_DICTIONARY, [test x"$have_extdict_zhy" = xyes])
  258. dnl ================================================================
  259. dnl Generate output.
  260. dnl ================================================================
  261. AC_CONFIG_FILES([Makefile espeak-ng.pc])
  262. AC_OUTPUT
  263. AC_MSG_NOTICE([
  264. Configuration for eSpeak NG complete.
  265. Source code location: ${srcdir}
  266. C99 Compiler: ${CC}
  267. C99 Compiler flags: ${CFLAGS}
  268. pulseaudio: ${have_pulseaudio}
  269. portaudio: ${have_portaudio}
  270. sada: ${have_sada}
  271. audio configuration: ${AUDIO}
  272. Klatt: ${have_klatt}
  273. MBROLA: ${have_mbrola}
  274. Sonic: ${have_sonic}
  275. Async: ${have_async}
  276. Extended Dictionaries:
  277. Russian: ${have_extdict_ru}
  278. Chinese (Mandarin): ${have_extdict_zh}
  279. Chinese (Cantonese): ${have_extdict_zhy}
  280. ])