1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([speech-dispatcher], [0.8], [speechd@lists.freebsoft.org])
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
LT_PREREQ([2.2])
LT_INIT([dlopen])
AC_CONFIG_SRCDIR([src/server/speechd.c])
AC_CONFIG_HEADERS([config.h])
IT_PROG_INTLTOOL([0.40.0])
AM_GLIB_GNU_GETTEXT
# Config test suite
AC_CONFIG_TESTDIR(src/tests)
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
# Checks for libraries.
AC_SEARCH_LIBS([sqrt], [m], [],
[AC_MSG_FAILURE([Math library missing])])
AC_SEARCH_LIBS([pthread_create], [pthread], [],
[AC_MSG_FAILURE([Threads library missing])])
AC_SEARCH_LIBS([lt_dlopen], [ltdl], [],
[AC_MSG_FAILURE([ltdl library missing])])
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])
AC_SUBST([GLIB_CFLAGS])
AC_SUBST([GLIB_LIBS])
PKG_CHECK_MODULES([GTHREAD], [gthread-2.0])
AC_SUBST([GTHREAD_CFLAGS])
AC_SUBST([GTHREAD_LIBS])
PKG_CHECK_MODULES([GMODULE], [gmodule-2.0])
AC_SUBST([GMODULE_CFLAGS])
AC_SUBST([GMODULE_LIBS])
PKG_CHECK_MODULES([DOTCONF], [dotconf >= 1.3])
AC_SUBST([DOTCONF_CFLAGS])
AC_SUBST([DOTCONF_LIBS])
PKG_CHECK_MODULES([SNDFILE], [sndfile >= 1.0.2],
[ac_cv_sndfile=1], [ac_cv_sndfile=0])
AC_SUBST([SNDFILE_CFLAGS])
AC_SUBST([SNDFILE_LIBS])
AC_DEFINE_UNQUOTED([HAVE_SNDFILE], [${ac_cv_sndfile}],
[Set to 1 if you have libsndfile.])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h langinfo.h limits.h netdb.h])
AC_CHECK_HEADERS([ netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h])
AC_CHECK_HEADERS([sys/socket.h sys/time.h unistd.h wchar.h wctype.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT32_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday memmove memset mkdir])
AC_CHECK_FUNCS([select socket strcasecmp strchr strcspn strdup])
AC_CHECK_FUNCS([strerror strncasecmp strndup strstr strtol])
# Extra libraries for sockets and espeak added by Willie Walker
# based upon how SunStudio libraries work. Also
# conditionally set other compiler/linker flags.
#
if test "$GCC" = yes; then
EXTRA_SOCKET_LIBS=""
ERROR_CFLAGS="-Wall"
RDYNAMIC="-rdynamic"
else
EXTRA_ESPEAK_LIBS="-lCstd -lCrun"
EXTRA_SOCKET_LIBS="-lsocket -lnsl"
ERROR_CFLAGS="-errwarn=%all -errtags=yes -erroff=E_STATEMENT_NOT_REACHED"
RDYNAMIC=""
fi
AC_SUBST([EXTRA_ESPEAK_LIBS])
AC_SUBST([EXTRA_SOCKET_LIBS])
AC_SUBST([ERROR_CFLAGS])
AC_SUBST([RDYNAMIC])
# Check for python support.
# Python 3 or greater required
AC_ARG_ENABLE([python],
[AS_HELP_STRING([--disable-python], [do not install python bindings])],
[],
[enable_python=check])
AS_IF([test $enable_python != "no"],
[AM_PATH_PYTHON([3.0],
[enable_python=yes],
[AS_IF([test $enable_python = "yes"],
[AC_MSG_FAILURE([python 3 or greater is not available])])])])
AM_CONDITIONAL([HAVE_PYTHON], [test $enable_python = "yes"])
output_modules="cicero dummy festival generic"
# checks for output modules
# check for espeak support
AC_ARG_WITH([espeak],
[AS_HELP_STRING([--with-espeak], [Compile with espeak support])],
[],
[with_espeak=check])
AS_IF([test $with_espeak != "no"],
[AC_CHECK_LIB([espeak], [espeak_Synth],
[with_espeak="yes"],
[AS_IF([test $with_espeak = "yes"],
[AC_MSG_FAILURE([espeak is not available])])],
[$EXTRA_ESPEAK_LIBS])])
AM_CONDITIONAL([espeak_support], [test $with_espeak = "yes"])
AS_IF([test $with_espeak = "yes"], [output_modules="${output_modules} espeak"])
# check for flite support
AC_ARG_WITH([flite],
[AS_HELP_STRING([--with-flite], [include Festival Lite (Flite) support])],
[],
[with_flite=check])
AS_IF([test $with_flite != "no"],
[AC_CHECK_LIB([flite], [flite_init],
[flite_basic="-lflite"],
[AS_IF([test $with_flite = "yes"],
[AC_MSG_FAILURE([libflite is not available])])],
[-lm])
AC_CHECK_LIB([flite_usenglish], [usenglish_init],
[flite_basic="-lflite_usenglish ${flite_basic}"],
[AS_IF([test $with_flite = "yes"],
[AC_MSG_FAILURE([libflite_usenglish is not available])])],
[-lflite -lm])
AC_CHECK_LIB([flite_cmulex], [cmu_lex_init],
[flite_basic="-lflite_cmulex ${flite_basic}"],
[AS_IF([test $with_flite = "yes"],
[AC_MSG_FAILURE([libflite_cmulex is not available])])],
[-lflite -lm])
AC_CHECK_LIB([flite_cmu_us_kal16], [register_cmu_us_kal16],
[with_flite=yes;
flite_kal="-lflite_cmu_us_kal16";
AC_DEFINE([HAVE_REGISTER_CMU_US_KAL16], [1],
[Use cmu_register_us_kal16 to register the 16-bit voice.])],
[AC_CHECK_LIB([flite_cmu_us_kal16], [register_cmu_us_kal],
[with_flite=yes;
flite_kal="-lflite_cmu_us_kal16"],
[AC_CHECK_LIB([flite_cmu_us_kal], [register_cmu_us_kal],
[with_flite=yes;
flite_kal="-lflite_cmu_us_kal"],
[AS_IF([test $with_flite = "yes"],
[AC_MSG_FAILURE([no flite voices found])])],
[$flite_basic -lm])],
[$flite_basic -lm])],
[$flite_basic -lm])])
AM_CONDITIONAL([flite_support], [test $with_flite = "yes"])
AC_SUBST([flite_basic])
AC_SUBST([flite_kal])
AS_IF([test $with_flite = "yes"], [output_modules="${output_modules} flite"])
# check for IBMTTS support
AC_ARG_WITH([ibmtts],
[AS_HELP_STRING([--with-ibmtts], [include IBM TTS support])],
[],
[with_ibmtts=check])
AS_IF([test $with_ibmtts != "no"],
[AC_CHECK_LIB([ibmeci], [eciStop],
[with_ibmtts=yes;
ibmtts_include="-I/opt/IBM/ibmtts/inc/"],
[AS_IF([test $with_ibmtts = "yes"],
[AC_MSG_FAILURE([IBMTTS is not available])])])])
AM_CONDITIONAL([ibmtts_support], [test $with_ibmtts = "yes"])
AC_SUBST([ibmtts_include])
AS_IF([test $with_ibmtts = "yes"], [output_modules="${output_modules} ibmtts"])
# check for ivona support
AC_ARG_WITH([ivona],
[AS_HELP_STRING([--with-ivona], [include ivona support])],
[],
[with_ivona=check])
AS_IF([test $with_ivona != "no"],
[AC_CHECK_LIB([dumbtts], [dumbtts_TTSInit],
[with_ivona=yes],
[AS_IF([test $with_ivona = "yes"],
[AC_MSG_FAILURE([ivona is not available])])])])
AM_CONDITIONAL([ivona_support], [test $with_ivona = "yes"])
AS_IF([test $with_ivona = "yes"], [output_modules="${output_modules} ivona"])
# check for svox pico support
AC_ARG_WITH([pico],
[AS_HELP_STRING([--with-pico], [include SVOX pico support])],
[],
[with_pico=check])
AS_IF([test $with_pico != "no"],
[AC_CHECK_LIB([ttspico], [pico_initialize],
[with_pico=yes],
[AS_IF([test $with_pico = "yes"],
[AC_MSG_FAILURE([SVOX pico is not available])])])])
AM_CONDITIONAL([pico_support], [test $with_pico = "yes"])
AS_IF([test $with_pico = "yes"], [output_modules="${output_modules} pico"])
audio_dlopen_modules='-dlopen force'
# clear default audio method
default_audio_method=""
audio_methods=""
# checks for audio subsystems
# check for pulseaudio support
AC_ARG_WITH([pulse],
[AS_HELP_STRING([--with-pulse], [include pulseaudio support])],
[],
[with_pulse=check])
AS_IF([test $with_pulse != "no"],
[PKG_CHECK_MODULES([PULSE], [libpulse-simple],
[with_pulse=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=pulse])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_pulse.la"],
[AS_IF([test $with_pulse = "yes"],
[AC_MSG_FAILURE([pulseaudio is not available])])])])
AM_CONDITIONAL([pulse_support], [test $with_pulse = "yes"])
AC_SUBST([PULSE_CFLAGS])
AC_SUBST([PULSE_LIBS])
AS_IF([test $with_pulse = "yes"], [audio_methods="${audio_methods} pulse"])
# check for alsa support
AC_ARG_WITH([alsa],
[AS_HELP_STRING([--with-alsa], [include ALSA support])],
[],
[with_alsa=check])
AS_IF([test $with_alsa != "no"],
[PKG_CHECK_MODULES([ALSA], [alsa],
[with_alsa=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=alsa])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_alsa.la"],
[AS_IF([test $with_alsa = "yes"],
[AC_MSG_FAILURE([ALSA is not available])])])])
AM_CONDITIONAL([alsa_support], [test $with_alsa = "yes"])
AC_SUBST([ALSA_CFLAGS])
AC_SUBST([ALSA_LIBS])
AS_IF([test $with_alsa = "yes"], [audio_methods="${audio_methods} alsa"])
# check for libao support
AC_ARG_WITH([libao],
[AS_HELP_STRING([--with-libao], [include libao support])],
[],
[with_libao=check])
AS_IF([test $with_libao != "no"],
[PKG_CHECK_MODULES([LIBAO], [ao],
[with_libao=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=libao])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_libao.la"],
[AS_IF([test $with_libao = yes],
[AC_MSG_FAILURE([libao is not available])])])])
AM_CONDITIONAL([libao_support], [test $with_libao = "yes"])
AC_SUBST([LIBAO_CFLAGS])
AC_SUBST([LIBAO_LIBS])
AS_IF([test $with_libao = "yes"], [audio_methods="${audio_methods} libao"])
#check for OSS support
AC_ARG_WITH([oss],
[AS_HELP_STRING([--with-oss], [include oss support])],
[],
[with_oss=check])
AS_IF([test $with_oss != "no"],
[AC_CHECK_HEADER([sys/soundcard.h],
[with_oss=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=oss])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_oss.la"],
[AS_IF([test $with_oss = "yes"],
[AC_MSG_FAILURE([oss is not available])])])])
AM_CONDITIONAL([oss_support], [test $with_oss = "yes"])
AS_IF([test $with_oss = "yes"], [audio_methods="${audio_methods} oss"])
# check for NAS support
AC_ARG_WITH([nas],
[AS_HELP_STRING([--with-nas], [include network audio system (nas) support])],
[],
[with_nas=check])
AS_IF([test $with_nas != "no"],
[AC_CHECK_LIB([audio], [AuOpenServer],
[with_nas=yes
AS_IF([test -z "$default_audio_method"],
[default_audio_method=nas])
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_nas.la";
NAS_LIBS="-L/usr/X11R6/lib -lXau -laudio"],
[AS_IF([test $with_nas = "yes"],
[AC_MSG_FAILURE([nas is not available])])],
[-L/usr/X11R6/lib -lXau])])
AM_CONDITIONAL([nas_support], [test $with_nas = "yes"])
AC_SUBST([NAS_LIBS])
AS_IF([test $with_nas = "yes"], [audio_methods="${audio_methods} nas"])
AC_ARG_WITH([default-audio-method],
[AS_HELP_STRING([--with-default-audio-method=<name>],
[defines default audio method (default - first discovered)])],
[default_audio_method="$withval"],
[])
AC_SUBST([default_audio_method])
# We'll build these modules:
AC_SUBST([audio_dlopen_modules])
# current, age and revision values for libspeechd.
LIB_SPD_CURRENT=6 # Current main version (increment on every API change -- incompatible AND extensions)
LIB_SPD_REVISION=0 # Current minor version (increment on every implementation change)
LIB_SPD_AGE=4 # Number of backward compatible main versions (LIB_SPD_CURRENT incrementations since last incompatible)
AC_SUBST([LIB_SPD_CURRENT])
AC_SUBST([LIB_SPD_REVISION])
AC_SUBST([LIB_SPD_AGE])
# Setup GETTEXT
GETTEXT_PACKAGE=speech-dispatcher
AC_SUBST([GETTEXT_PACKAGE])
# Paths for configuration files:
spdconfdir='${sysconfdir}/speech-dispatcher'
AC_SUBST([spdconfdir])
clientconfdir='${spdconfdir}/clients'
AC_SUBST([clientconfdir])
moduleconfdir='${spdconfdir}/modules'
AC_SUBST([moduleconfdir])
# Paths for read-only copy of configuration files:
spdconforigdir='${datadir}/speech-dispatcher/conf'
AC_SUBST([spdconforigdir])
clientconforigdir='${spdconforigdir}/clients'
AC_SUBST([clientconforigdir])
spddesktopconforigdir='${spdconforigdir}/desktop'
AC_SUBST([spddesktopconforigdir])
moduleconforigdir='${spdconforigdir}/modules'
AC_SUBST([moduleconforigdir])
# Path for sound files:
snddatadir='${datadir}/sounds/speech-dispatcher'
AC_SUBST([snddatadir])
# Path for module binaries:
AC_ARG_WITH([module-bindir],
AS_HELP_STRING([--with-module-bindir],[Directory where to install speech-dispatcher modules (defaults to ${libdir}/speech-dispatcher-modules)]),
[modulebindir=$withval], [modulebindir='${libdir}/speech-dispatcher-modules'])
AC_SUBST([modulebindir])
# Path for speech-dispatcher libraries:
spdlibdir='${libdir}/speech-dispatcher'
AC_SUBST([spdlibdir])
# Path for audio libraries and plugins:
audiodir="$spdlibdir"
AC_SUBST([audiodir])
# Path for speech-dispatcher include files:
spdincludedir=${includedir}/speech-dispatcher
AC_SUBST([spdincludedir])
AC_CONFIG_FILES([Makefile
speech-dispatcher.pc
config/Makefile
config/clients/Makefile
config/modules/Makefile
doc/Makefile
include/Makefile
po/Makefile.in
src/Makefile
src/api/Makefile
src/api/c/Makefile
src/api/python/Makefile
src/api/python/speechd/Makefile
src/api/python/speechd_config/Makefile
src/audio/Makefile
src/clients/Makefile
src/clients/say/Makefile
src/clients/spdsend/Makefile
src/common/Makefile
src/modules/Makefile
src/server/Makefile
src/tests/Makefile])
AC_OUTPUT
AC_MSG_NOTICE([output modules to be built are $output_modules])
AC_MSG_NOTICE([audio methods to be built are $audio_methods])
AC_MSG_NOTICE([Default audio method is $default_audio_method])
|