2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(flite+hts_engine, 1.05, hts-engine-users@lists.sourceforge.net)
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)
11 # Checks for C compiler
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, :)])
22 # Checks for libraries.
23 AC_CHECK_LIB([m], [log])
26 # Checks for header files.
28 AC_CHECK_HEADERS([stdlib.h string.h])
30 # Checks for typedefs, structures, and compiler characteristics.
34 # Checks for library functions.
36 AC_CHECK_FUNCS([sqrt strchr strrchr strstr])
41 AC_CHECK_SIZEOF([void *])
43 # Checks library for windows audio devices
45 *win32* | *wince* | *cygwin* | *mingw* )
46 AC_HAVE_LIBRARY([winmm],,AC_MSG_ERROR(No winmm))
53 AC_CONFIG_FILES([Makefile bin/Makefile lib/Makefile])
56 # Checks for embedded device compile
57 AC_ARG_ENABLE(embedded, [ --enable-embedded turn on compiling for embedded devices (default=no)],
59 AC_MSG_CHECKING(whether to enable compiling for embedded devices)
60 if test x$enable_embedded = xyes; then
62 AC_DEFINE(HTS_EMBEDDED)
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)
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
80 # Define HTS_ENGINE_HEADER_DIR
81 AC_ARG_VAR([HTS_ENGINE_HEADER_DIR],[])
82 HTS_ENGINE_HEADER_DIR=${hts_engine_header_path}
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)
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
97 # Define HTS_ENGINE_LIBRARY_DIR
98 AC_ARG_VAR([HTS_ENGINE_LIBRARY_DIR],[])
99 HTS_ENGINE_LIBRARY_DIR=${hts_engine_library_path}
101 # Define compile option
102 AC_DEFINE(FLITE_PLUS_HTS_ENGINE)