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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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 PCAudioLib checks.
  94. dnl ================================================================
  95. AC_ARG_WITH([pcaudiolib],
  96. [AS_HELP_STRING([--with-pcaudiolib], [use the pcaudiolib library for audio output @<:@default=yes@:>@])],
  97. [])
  98. if test "$with_pcaudiolib" = "no"; then
  99. echo "Disabling audio output support via pcaudiolib"
  100. have_pcaudiolib=no
  101. else
  102. AC_CHECK_HEADERS([pcaudiolib/audio.h],
  103. [
  104. have_pcaudiolib=yes
  105. PCAUDIOLIB_CFLAGS=
  106. PCAUDIOLIB_LIBS=-lpcaudio
  107. ],[
  108. have_pcaudiolib=no
  109. ])
  110. fi
  111. AC_SUBST(PCAUDIOLIB_CFLAGS)
  112. AC_SUBST(PCAUDIOLIB_LIBS)
  113. dnl ================================================================
  114. dnl Optional compilation checks.
  115. dnl ================================================================
  116. AC_ARG_WITH([klatt],
  117. [AS_HELP_STRING([--with-klatt], [enable the Klatt formant synthesizer @<:@default=yes@:>@])],
  118. [])
  119. if test "$with_klatt" = "no" ; then
  120. have_klatt=no
  121. else
  122. have_klatt=yes
  123. fi
  124. AC_ARG_WITH([mbrola],
  125. [AS_HELP_STRING([--with-mbrola], [enable the MBROLA speech synthesizer @<:@default=yes@:>@])],
  126. [])
  127. if test "$with_mbrola" = "no" ; then
  128. have_mbrola=no
  129. else
  130. have_mbrola=yes
  131. fi
  132. AC_ARG_WITH([sonic],
  133. [AS_HELP_STRING([--with-sonic], [enable the sonic library to speed up the audio @<:@default=yes@:>@])],
  134. [])
  135. if test "$with_sonic" = "no" ; then
  136. have_sonic=no
  137. else
  138. AC_CHECK_HEADERS([sonic.h],
  139. [
  140. AC_CHECK_LIB([sonic], [sonicCreateStream])
  141. have_sonic=yes
  142. ],[
  143. have_sonic=no
  144. ])
  145. fi
  146. AC_ARG_WITH([async],
  147. [AS_HELP_STRING([--with-async], [enable support for async command processing @<:@default=yes@:>@])],
  148. [])
  149. if test "$with_async" = "no" ; then
  150. have_async=no
  151. else
  152. have_async=yes
  153. fi
  154. AM_CONDITIONAL(OPT_KLATT, [test x"$have_klatt" = xyes])
  155. AM_CONDITIONAL(OPT_MBROLA, [test x"$have_mbrola" = xyes])
  156. AM_CONDITIONAL(OPT_ASYNC, [test x"$have_async" = xyes])
  157. dnl ================================================================
  158. dnl ronn checks.
  159. dnl ================================================================
  160. AC_CHECK_PROG(RONN, ronn, ronn, no)
  161. AM_CONDITIONAL(HAVE_RONN, [test ! x"$RONN" = xno])
  162. dnl ================================================================
  163. dnl Extended dictionary checks.
  164. dnl ================================================================
  165. AC_ARG_WITH([extdict-ru],
  166. [AS_HELP_STRING([--with-extdict-ru], [use the extended Russian Dictionary file @<:@default=no@:>@])],
  167. [])
  168. if test "$with_extdict_ru" = "yes" ; then
  169. have_extdict_ru=yes
  170. else
  171. have_extdict_ru=no
  172. fi
  173. AC_ARG_WITH([extdict-zh],
  174. [AS_HELP_STRING([--with-extdict-zh], [use the extended Mandarin Chinese Dictionary file @<:@default=no@:>@])],
  175. [])
  176. if test "$with_extdict_zh" = "yes" ; then
  177. have_extdict_zh=yes
  178. else
  179. have_extdict_zh=no
  180. fi
  181. AC_ARG_WITH([extdict-zhy],
  182. [AS_HELP_STRING([--with-extdict-zhy], [use the extended Cantonese Chinese Dictionary file @<:@default=no@:>@])],
  183. [])
  184. if test "$with_extdict_zhy" = "yes" ; then
  185. have_extdict_zhy=yes
  186. else
  187. have_extdict_zhy=no
  188. fi
  189. AM_CONDITIONAL(HAVE_RU_EXTENDED_DICTIONARY, [test x"$have_extdict_ru" = xyes])
  190. AM_CONDITIONAL(HAVE_ZH_EXTENDED_DICTIONARY, [test x"$have_extdict_zh" = xyes])
  191. AM_CONDITIONAL(HAVE_ZHY_EXTENDED_DICTIONARY, [test x"$have_extdict_zhy" = xyes])
  192. dnl ================================================================
  193. dnl Generate output.
  194. dnl ================================================================
  195. AC_CONFIG_FILES([Makefile espeak-ng.pc])
  196. AC_OUTPUT
  197. AC_MSG_NOTICE([
  198. Configuration for eSpeak NG complete.
  199. Source code location: ${srcdir}
  200. C99 Compiler: ${CC}
  201. C99 Compiler flags: ${CFLAGS}
  202. Sonic: ${have_sonic}
  203. PCAudioLib: ${have_pcaudiolib}
  204. Klatt: ${have_klatt}
  205. MBROLA: ${have_mbrola}
  206. Async: ${have_async}
  207. Extended Dictionaries:
  208. Russian: ${have_extdict_ru}
  209. Chinese (Mandarin): ${have_extdict_zh}
  210. Chinese (Cantonese): ${have_extdict_zhy}
  211. ])