3 ### AM_INIT_AUTOMAKE(kttsd,0.2.0)
5 dnl ================================================================================
7 dnl Check for GStreamer >= 0.8.7
10 [AC_HELP_STRING(--with-gstreamer,
11 [enable support for GStreamer @<:@default=no@:>@])],
12 [], with_gstreamer=no)
15 if test "x$with_gstreamer" != xno; then
16 # pkg-config seems to have a bug where it masks needed -L entries when it
17 # shouldn't, so disable that.
19 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
20 export PKG_CONFIG_ALLOW_SYSTEM_LIBS
24 dnl Actually need 0.8.7, but plugins were version 0.8.5. argh!
27 PKG_CHECK_MODULES(GST, \
28 gstreamer-$GST_MAJORMINOR >= $GST_REQ \
29 gstreamer-control-$GST_MAJORMINOR >= $GST_REQ \
30 gstreamer-libs-$GST_MAJORMINOR >= $GST_REQ,
31 have_gst=yes, have_gst=no)
33 if test "x$with_gstreamer" != xcheck && test "x$have_gst" != xyes; then
34 AC_MSG_ERROR([--with-gstreamer was given, but test for GStreamer >= 0.8.5 failed])
38 if test "x$have_gst" = "xno"; then
42 AC_DEFINE(HAVE_GSTREAMER, 0, [have GStreamer])
44 LDADD_GST=`$PKG_CONFIG --libs-only-l gstreamer-$GST_MAJORMINOR`
45 LDFLAGS_GST=`$PKG_CONFIG --libs-only-other gstreamer-$GST_MAJORMINOR`
47 # Append -L entries, since they are masked by --libs-only-l and
49 LIBDIRS_GST=`$PKG_CONFIG --libs-only-L gstreamer-$GST_MAJORMINOR`
50 LDADD_GST="$LDADD_GST $LIBDIRS_GST"
52 AC_MSG_NOTICE([GStreamer version >= $GST_REQ found.])
53 AC_DEFINE(HAVE_GSTREAMER, 1, [have GStreamer])
55 if test "x$with_gstreamer" != xcheck && test "x$have_gst" != xyes; then
56 AC_MSG_ERROR([--with-gstreamer was given, but test for GStreamer >= 0.8.7 failed])
64 AM_CONDITIONAL(include_kttsd_gstplayer, [test "x$have_gst" = "xyes"])
66 dnl ================================================================================
68 dnl Do not compile artsplayer plugin if user specifies --without-arts
70 AM_CONDITIONAL(include_kttsd_artsplayer, [test "x$build_arts" = "xyes"])
72 dnl ================================================================================
75 dnl TODO: Don't know if 0.5 works or not.
77 AC_DEFUN([KDE_CHECK_ALSA],
81 AC_CHECK_HEADERS([sys/asoundlib.h alsa/asoundlib.h],
84 AC_CHECK_LIB(asound, snd_seq_create_simple_port,
89 if test "x$have_alsa" = xyes; then
92 #ifdef HAVE_SYS_ASOUNDLIB_H
93 #include <sys/asoundlib.h>
95 #ifdef HAVE_ALSA_ASOUNDLIB_H
96 #include <alsa/asoundlib.h>
99 #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
100 /* we have ALSA 0.5.x */
102 #error not ALSA 0.5.x
108 #include "confdefs.h"
109 #ifdef HAVE_SYS_ASOUNDLIB_H
110 #include <sys/asoundlib.h>
112 #ifdef HAVE_ALSA_ASOUNDLIB_H
113 #include <alsa/asoundlib.h>
116 #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
117 /* we have ALSA 0.9.x */
119 #error not ALSA 0.9.x
125 #include "confdefs.h"
126 #ifdef HAVE_SYS_ASOUNDLIB_H
127 #include <sys/asoundlib.h>
129 #ifdef HAVE_ALSA_ASOUNDLIB_H
130 #include <alsa/asoundlib.h>
133 #if (SND_LIB_MAJOR == 1)
134 /* we have ALSA 1.x */
143 if test "x$have_alsa_0_9" = xyes || test "x$have_alsa_1" = xyes; then
144 # for kmix/ and akode/
146 AC_DEFINE(HAVE_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
149 ARTS_LIBASOUND="-lasound"
150 AC_DEFINE(HAVE_ARTS_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
153 if test "x$have_alsa_0_5" = xyes; then
155 ARTS_LIBASOUND="-lasound"
156 AC_DEFINE(HAVE_ARTS_LIBASOUND, 1, [Define if you have libasound.so.1 (required for ALSA 0.5.x support)])
160 AC_SUBST(ARTS_LIBASOUND)
164 [AC_HELP_STRING(--with-alsa,
165 [enable support for ALSA @<:@default=check@:>@])],
169 if test "x$with_alsa" != xno; then
172 if test "x$with_alsa" != xcheck && test "x$have_alsa" != xyes; then
173 AC_MSG_ERROR([--with-alsa was given, but test for ALSA failed])
177 AM_CONDITIONAL(include_kttsd_alsaplayer, [test "x$have_alsa" = "xyes"])
179 dnl ================================================================================
181 dnl Check for aKode library. Note: As of about 16 Jul 2005, it got moved
182 dnl from kdemultimedia to kdesupport.
184 AC_DEFUN([KDE_CHECK_AKODE],
186 AC_PATH_PROG(AKODE_CONFIG, akode-config, [no], [$PATH:$prefix/bin])
188 if test "x$AKODE_CONFIG" != xno; then
189 AC_DEFINE(HAVE_AKODE, 1, [define if you have aKodelib installed])
190 akode_includes=`$AKODE_CONFIG --cflags`
191 akode_libs=`$AKODE_CONFIG --libs`
199 AC_SUBST(akode_includes)
204 [AC_HELP_STRING([--with-akode],
205 [enable the aKode decoder @<:@default=no@:>@])],
209 if test "x$with_akode" != xno; then
212 if test "x$with_akode" != xcheck && test "x$have_akode" != xyes; then
213 AC_MSG_ERROR([--with-akode was given, but test for aKode failed])
217 AM_CONDITIONAL(include_kttsd_akodeplayer, [test "x$have_akode" = "xyes"])
219 dnl ================================================================================
221 dnl Check whether to include sys/time.h and time.h, or just sys/time.h.
222 dnl Defines TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H, which are used in
226 AC_CHECK_HEADERS(sys/time.h)
228 dnl ================================================================================
230 dnl See if the latest kspeech.h is installed and if not, compile against
231 dnl kttsd/compat directory.
233 if test "$KTTS_KSPEECH_DIR" = ""; then
234 KDE_CHECK_HEADER(kspeech.h, ktts_have_kspeech_h=yes, ktts_have_kspeech_h=no)
235 have_latest_kspeech=no
236 if test "x$ktts_have_kspeech_h" = xyes; then
237 AC_MSG_CHECKING([whether installed kspeech.h is latest version])
238 ktts_save_cppflags=$CPPFLAGS
240 CPPFLAGS="$all_includes $CPPFLAGS"
243 [#include <kspeech.h>],
245 if (4 == KSpeech::mtHtml);
247 have_latest_kspeech=yes,
248 have_latest_kspeech=no)
249 AC_MSG_RESULT($have_latest_kspeech)
250 CPPFLAGS=$ktts_save_cppflags
253 if test "x$have_latest_kspeech" = xyes; then
254 KTTS_KSPEECH_DIR='$(kde_includes)'
255 KTTS_KSPEECH_INCLUDE=""
256 KTTS_INTERFACES_DIR=""
258 KTTS_KSPEECH_DIR='$(top_srcdir)/kttsd/compat/interfaces/kspeech'
259 KTTS_KSPEECH_INCLUDE='-I$(top_srcdir)/kttsd/compat/interfaces/kspeech'
260 KTTS_INTERFACES_DIR="interfaces"
261 AC_MSG_WARN([Latest kspeech.h not installed. Compiling using kttsd/compat directory.])
264 AC_SUBST(KTTS_KSPEECH_DIR)
265 AC_SUBST(KTTS_KSPEECH_INCLUDE)
266 AC_SUBST(KTTS_INTERFACES_DIR)
269 dnl ================================================================================
271 # --- Check for KDE < 3.5 ---
272 # If so, install icons.
274 AC_MSG_CHECKING([for KDE version])
278 kdeversion_save_CXXFLAGS="$CXXFLAGS"
279 kdeversion_save_LIBS="$LIBS"
280 LIBS="$LIBS $X_EXTRA_LIBS"
281 CXXFLAGS="$CXXFLAGS $all_includes"
284 #include <kdeversion.h>
285 #if ! ( KDE_IS_VERSION( 3, 4, 90 ) )
291 KTTS_ICONS_DIR="icons"
294 CXXFLAGS="$kdeversion_save_CXXFLAGS"
295 LIBS="$kdeversion_save_LIBS"
298 if test "$KTTS_ICONS_DIR" = ""; then
299 AC_MSG_RESULT([KDE 3.4.x or less])
301 AC_MSG_RESULT([KDE 3.5 or later])
304 AC_SUBST(KTTS_ICONS_DIR)