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 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. AC_PREREQ([2.63])
  2. AC_INIT([eSpeak NG], [1.49.1], [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. AC_CHECK_PROG(NDKBUILD_CHECK,[ndk-build],yes)
  18. if test x"$NDKBUILD_CHECK" != xyes ; then
  19. AC_MSG_ERROR([Please ensure that the Android NDK is installed and ndk-build is usable from the command line.])
  20. fi
  21. dnl ================================================================
  22. dnl gradle checks.
  23. dnl ================================================================
  24. AC_ARG_WITH([gradle],
  25. [AS_HELP_STRING([--with-gradle], [specify the gradle program to use @<:@default=gradle@:>@])],
  26. [GRADLE=$with_gradle],
  27. [GRADLE=gradle])
  28. AC_MSG_CHECKING([for gradle])
  29. if test -e ${GRADLE} ; then
  30. AC_MSG_RESULT([${GRADLE}])
  31. else
  32. AC_MSG_RESULT([no])
  33. fi
  34. AC_SUBST(GRADLE)
  35. dnl ================================================================
  36. dnl C99 compiler checks.
  37. dnl ================================================================
  38. AC_LANG_PUSH(C)
  39. AC_MSG_CHECKING([if $CC supports C99 without any flags])
  40. AC_COMPILE_IFELSE(
  41. [AC_LANG_PROGRAM(
  42. [[static inline int c99_restrict(int *restrict c99_restrict) {}]],
  43. [[]])],
  44. [AC_MSG_RESULT([yes])
  45. have_c99_native=yes],
  46. [AC_MSG_RESULT([no])
  47. have_c99_native=no])
  48. AC_LANG_POP(C)
  49. AC_LANG_PUSH(C)
  50. TEMP_CFLAGS="$CFLAGS"
  51. CFLAGS="$CFLAGS -std=c99"
  52. AC_MSG_CHECKING([if $CC supports C99 with the -std=c99 flag])
  53. AC_COMPILE_IFELSE(
  54. [AC_LANG_PROGRAM(
  55. [[static inline int c99_restrict(int *restrict c99_restrict) {}]],
  56. [[]])],
  57. [AC_MSG_RESULT([yes])
  58. have_c99_c99=yes],
  59. [AC_MSG_RESULT([no])
  60. have_c99_c99=no])
  61. CFLAGS="$TEMP_CFLAGS"
  62. AC_LANG_POP(C)
  63. AC_MSG_CHECKING([if $CC supports C99])
  64. if test "$have_c99_c99" = yes ; then
  65. AC_MSG_RESULT([-std=c99])
  66. CFLAGS="$CFLAGS -std=c99"
  67. elif test "$have_c99_native" = yes ; then
  68. AC_MSG_RESULT([yes])
  69. else
  70. AC_MSG_RESULT([no])
  71. AC_MSG_ERROR([C99 is not supported by $CC.])
  72. fi
  73. dnl ================================================================
  74. dnl library checks.
  75. dnl ================================================================
  76. AC_CHECK_HEADERS([fcntl.h]) dnl POSIX
  77. AC_CHECK_HEADERS([getopt.h]) dnl POSIX
  78. AC_CHECK_HEADERS([locale.h]) dnl C89
  79. AC_CHECK_HEADERS([stddef.h]) dnl C89
  80. AC_CHECK_HEADERS([stdbool.h]) dnl C99
  81. AC_CHECK_HEADERS([sys/time.h]) dnl POSIX
  82. AC_CHECK_HEADERS([wchar.h]) dnl C89
  83. AC_CHECK_HEADERS([wctype.h]) dnl C89
  84. AC_TYPE_SIZE_T
  85. AC_TYPE_SSIZE_T
  86. AC_TYPE_UINT16_T
  87. AC_TYPE_UINT32_T
  88. AC_TYPE_UINT64_T
  89. AC_FUNC_FORK
  90. AC_FUNC_MALLOC
  91. AC_FUNC_REALLOC
  92. AC_FUNC_STRCOLL
  93. AC_FUNC_ERROR_AT_LINE
  94. AC_CHECK_FUNCS([dup2])
  95. AC_CHECK_FUNCS([getopt_long])
  96. AC_CHECK_FUNCS([gettimeofday])
  97. AC_CHECK_FUNCS([memchr])
  98. AC_CHECK_FUNCS([memmove])
  99. AC_CHECK_FUNCS([memset])
  100. AC_CHECK_FUNCS([mkdir])
  101. AC_CHECK_FUNCS([mkstemp])
  102. AC_CHECK_FUNCS([pow])
  103. AC_CHECK_FUNCS([setlocale])
  104. AC_CHECK_FUNCS([sqrt])
  105. AC_CHECK_FUNCS([strchr])
  106. AC_CHECK_FUNCS([strdup])
  107. AC_CHECK_FUNCS([strerror])
  108. AC_CHECK_FUNCS([strrchr])
  109. AC_CHECK_FUNCS([strstr])
  110. dnl ================================================================
  111. dnl PCAudioLib checks.
  112. dnl ================================================================
  113. AC_ARG_WITH([pcaudiolib],
  114. [AS_HELP_STRING([--with-pcaudiolib], [use the pcaudiolib library for audio output @<:@default=yes@:>@])],
  115. [])
  116. if test "$with_pcaudiolib" = "no"; then
  117. echo "Disabling audio output support via pcaudiolib"
  118. have_pcaudiolib=no
  119. else
  120. AC_CHECK_HEADERS([pcaudiolib/audio.h],
  121. [
  122. have_pcaudiolib=yes
  123. PCAUDIOLIB_CFLAGS=
  124. PCAUDIOLIB_LIBS=-lpcaudio
  125. ],[
  126. have_pcaudiolib=no
  127. ])
  128. fi
  129. AC_SUBST(PCAUDIOLIB_CFLAGS)
  130. AC_SUBST(PCAUDIOLIB_LIBS)
  131. dnl ================================================================
  132. dnl Optional compilation checks.
  133. dnl ================================================================
  134. AC_ARG_WITH([klatt],
  135. [AS_HELP_STRING([--with-klatt], [enable the Klatt formant synthesizer @<:@default=yes@:>@])],
  136. [])
  137. if test "$with_klatt" = "no" ; then
  138. have_klatt=no
  139. else
  140. have_klatt=yes
  141. fi
  142. AC_ARG_WITH([mbrola],
  143. [AS_HELP_STRING([--with-mbrola], [enable the MBROLA speech synthesizer @<:@default=yes@:>@])],
  144. [])
  145. if test "$with_mbrola" = "no" ; then
  146. have_mbrola=no
  147. else
  148. have_mbrola=yes
  149. fi
  150. AC_ARG_WITH([sonic],
  151. [AS_HELP_STRING([--with-sonic], [enable the sonic library to speed up the audio @<:@default=yes@:>@])],
  152. [])
  153. if test "$with_sonic" = "no" ; then
  154. have_sonic=no
  155. else
  156. AC_CHECK_HEADERS([sonic.h],
  157. [
  158. AC_CHECK_LIB([sonic], [sonicCreateStream])
  159. have_sonic=yes
  160. ],[
  161. have_sonic=no
  162. ])
  163. fi
  164. AC_ARG_WITH([async],
  165. [AS_HELP_STRING([--with-async], [enable support for async command processing @<:@default=yes@:>@])],
  166. [])
  167. if test "$with_async" = "no" ; then
  168. have_async=no
  169. else
  170. have_async=yes
  171. fi
  172. AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes])
  173. AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes])
  174. AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes])
  175. dnl ================================================================
  176. dnl ronn checks.
  177. dnl ================================================================
  178. AC_CHECK_PROG(RONN, ronn, ronn, no)
  179. AM_CONDITIONAL(HAVE_RONN, [test ! x"$RONN" = xno])
  180. dnl ================================================================
  181. dnl Extended dictionary checks.
  182. dnl ================================================================
  183. AC_ARG_WITH([extdict-ru],
  184. [AS_HELP_STRING([--with-extdict-ru], [use the extended Russian Dictionary file @<:@default=no@:>@])],
  185. [])
  186. if test "$with_extdict_ru" = "yes" ; then
  187. have_extdict_ru=yes
  188. else
  189. have_extdict_ru=no
  190. fi
  191. AC_ARG_WITH([extdict-zh],
  192. [AS_HELP_STRING([--with-extdict-zh], [use the extended Mandarin Chinese Dictionary file @<:@default=no@:>@])],
  193. [])
  194. if test "$with_extdict_zh" = "yes" ; then
  195. have_extdict_zh=yes
  196. else
  197. have_extdict_zh=no
  198. fi
  199. AC_ARG_WITH([extdict-zhy],
  200. [AS_HELP_STRING([--with-extdict-zhy], [use the extended Cantonese Chinese Dictionary file @<:@default=no@:>@])],
  201. [])
  202. if test "$with_extdict_zhy" = "yes" ; then
  203. have_extdict_zhy=yes
  204. else
  205. have_extdict_zhy=no
  206. fi
  207. AM_CONDITIONAL(HAVE_RU_EXTENDED_DICTIONARY, [test x"$have_extdict_ru" = xyes])
  208. AM_CONDITIONAL(HAVE_ZH_EXTENDED_DICTIONARY, [test x"$have_extdict_zh" = xyes])
  209. AM_CONDITIONAL(HAVE_ZHY_EXTENDED_DICTIONARY, [test x"$have_extdict_zhy" = xyes])
  210. dnl ================================================================
  211. dnl Generate output.
  212. dnl ================================================================
  213. AC_CONFIG_FILES([Makefile espeak-ng.pc])
  214. AC_OUTPUT
  215. AC_MSG_NOTICE([
  216. Configuration for eSpeak NG complete.
  217. Source code location: ${srcdir}
  218. C99 Compiler: ${CC}
  219. C99 Compiler flags: ${CFLAGS}
  220. Sonic: ${have_sonic}
  221. PCAudioLib: ${have_pcaudiolib}
  222. gradle (Android): ${GRADLE}
  223. Klatt: ${have_klatt}
  224. MBROLA: ${have_mbrola}
  225. Async: ${have_async}
  226. Extended Dictionaries:
  227. Russian: ${have_extdict_ru}
  228. Chinese (Mandarin): ${have_extdict_zh}
  229. Chinese (Cantonese): ${have_extdict_zhy}
  230. ])