| 1 |
# -*- Autoconf -*- |
| 2 |
# Process this file with autoconf to produce a configure script. |
| 3 |
|
| 4 |
AC_PREREQ(2.59) |
| 5 |
AC_INIT(flite+hts_engine, 1.05, [email protected]) |
| 6 |
AC_CONFIG_AUX_DIR([config]) |
| 7 |
AC_COPYRIGHT(Copyright 2005-2013 Nagoya Institute of Technology) |
| 8 |
AC_COPYRIGHT(Copyright 2005-2008 Tokyo Institute of Technology) |
| 9 |
AM_INIT_AUTOMAKE(flite+hts_engine, 1.05, nostdinc no-installinfo no-installman) |
| 10 |
|
| 11 |
# Checks for C compiler |
| 12 |
AC_PROG_CC |
| 13 |
AM_PROG_CC_C_O |
| 14 |
AC_PROG_INSTALL |
| 15 |
AC_PROG_RANLIB |
| 16 |
AN_MAKEVAR([AR], [AC_PROG_AR]) |
| 17 |
AN_PROGRAM([ar], [AC_PROG_AR]) |
| 18 |
AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)]) |
| 19 |
AC_PROG_AR |
| 20 |
|
| 21 |
|
| 22 |
# Checks for libraries. |
| 23 |
AC_CHECK_LIB([m], [log]) |
| 24 |
|
| 25 |
|
| 26 |
# Checks for header files. |
| 27 |
AC_HEADER_STDC |
| 28 |
AC_CHECK_HEADERS([stdlib.h string.h]) |
| 29 |
|
| 30 |
# Checks for typedefs, structures, and compiler characteristics. |
| 31 |
AC_C_CONST |
| 32 |
AC_TYPE_SIZE_T |
| 33 |
|
| 34 |
# Checks for library functions. |
| 35 |
AC_FUNC_VPRINTF |
| 36 |
AC_CHECK_FUNCS([sqrt strchr strrchr strstr]) |
| 37 |
|
| 38 |
|
| 39 |
AC_CANONICAL_HOST |
| 40 |
AC_C_BIGENDIAN |
| 41 |
AC_CHECK_SIZEOF([void *]) |
| 42 |
|
| 43 |
# Checks library for windows audio devices |
| 44 |
case "$host_os" in |
| 45 |
*win32* | *wince* | *cygwin* | *mingw* ) |
| 46 |
AC_HAVE_LIBRARY([winmm],,AC_MSG_ERROR(No winmm)) |
| 47 |
;; |
| 48 |
*) |
| 49 |
;; |
| 50 |
esac |
| 51 |
|
| 52 |
|
| 53 |
AC_CONFIG_FILES([Makefile bin/Makefile lib/Makefile]) |
| 54 |
|
| 55 |
|
| 56 |
# Checks for embedded device compile |
| 57 |
AC_ARG_ENABLE(embedded, [ --enable-embedded turn on compiling for embedded devices (default=no)], |
| 58 |
,enable_embedded=no) |
| 59 |
AC_MSG_CHECKING(whether to enable compiling for embedded devices) |
| 60 |
if test x$enable_embedded = xyes; then |
| 61 |
AC_MSG_RESULT(yes) |
| 62 |
AC_DEFINE(HTS_EMBEDDED) |
| 63 |
else |
| 64 |
AC_MSG_RESULT(no) |
| 65 |
fi |
| 66 |
|
| 67 |
# Define HTS_ENGINE_HEADER |
| 68 |
AC_ARG_WITH(hts-engine-header-path, |
| 69 |
AS_HELP_STRING([--with-hts-engine-header-path],[specify the hts_engine_API header path]), |
| 70 |
[hts_engine_header_path=$withval], |
| 71 |
[hts_engine_header_path=/usr/local/include]) |
| 72 |
if test ! -f "${hts_engine_header_path}/HTS_engine.h"; then |
| 73 |
AC_MSG_ERROR(Cannot find HTS_engine.h) |
| 74 |
fi |
| 75 |
AC_MSG_CHECKING(for HTS_engine.h) |
| 76 |
AC_MSG_RESULT($hts_engine_header_path/HTS_engine.h) |
| 77 |
AC_ARG_VAR([HTS_ENGINE_HEADER],[]) |
| 78 |
HTS_ENGINE_HEADER=${hts_engine_header_path}/HTS_engine.h |
| 79 |
|
| 80 |
# Define HTS_ENGINE_HEADER_DIR |
| 81 |
AC_ARG_VAR([HTS_ENGINE_HEADER_DIR],[]) |
| 82 |
HTS_ENGINE_HEADER_DIR=${hts_engine_header_path} |
| 83 |
|
| 84 |
# Define HTS_ENGINE_LIBRARY |
| 85 |
AC_ARG_WITH(hts-engine-library-path, |
| 86 |
AS_HELP_STRING([--with-hts-engine-library-path],[specify the hts_engine_API library path]), |
| 87 |
[hts_engine_library_path=$withval], |
| 88 |
[hts_engine_library_path=/usr/local/lib]) |
| 89 |
if test ! -f "${hts_engine_library_path}/libHTSEngine.a"; then |
| 90 |
AC_MSG_ERROR(Cannot find libHTSEngine.a) |
| 91 |
fi |
| 92 |
AC_MSG_CHECKING(for libHTSEngine.a) |
| 93 |
AC_MSG_RESULT($hts_engine_library_path/libHTSEngine.a) |
| 94 |
AC_ARG_VAR([HTS_ENGINE_LIBRARY],[]) |
| 95 |
HTS_ENGINE_LIBRARY=${hts_engine_library_path}/libHTSEngine.a |
| 96 |
|
| 97 |
# Define HTS_ENGINE_LIBRARY_DIR |
| 98 |
AC_ARG_VAR([HTS_ENGINE_LIBRARY_DIR],[]) |
| 99 |
HTS_ENGINE_LIBRARY_DIR=${hts_engine_library_path} |
| 100 |
|
| 101 |
# Define compile option |
| 102 |
AC_DEFINE(FLITE_PLUS_HTS_ENGINE) |
| 103 |
|
| 104 |
|
| 105 |
AC_OUTPUT |
| 106 |
|