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 INCLUDES_GST=`$PKG_CONFIG --cflags-only-I gstreamer-$GST_MAJORMINOR`
45 LDADD_GST=`$PKG_CONFIG --libs-only-l gstreamer-$GST_MAJORMINOR`
46 LDFLAGS_GST=`$PKG_CONFIG --libs-only-other gstreamer-$GST_MAJORMINOR`
48 # Append -L entries, since they are masked by --libs-only-l and
50 LIBDIRS_GST=`$PKG_CONFIG --libs-only-L gstreamer-$GST_MAJORMINOR`
51 LDADD_GST="$LDADD_GST $LIBDIRS_GST"
53 AC_MSG_NOTICE([GStreamer version >= $GST_REQ found.])
54 AC_DEFINE(HAVE_GSTREAMER, 1, [have GStreamer])
56 if test "x$with_gstreamer" != xcheck && test "x$have_gst" != xyes; then
57 AC_MSG_ERROR([--with-gstreamer was given, but test for GStreamer >= 0.8.7 failed])
61 AC_SUBST(INCLUDES_GST)
65 AM_CONDITIONAL(include_kttsd_gstplayer, [test "x$have_gst" = "xyes"])
67 dnl ================================================================================
69 dnl Do not compile artsplayer plugin if user specifies --without-arts
71 AM_CONDITIONAL(include_kttsd_artsplayer, [test "x$build_arts" = "xyes"])
73 dnl ================================================================================
76 dnl TODO: Don't know if 0.5 works or not.
78 AC_DEFUN([KDE_CHECK_ALSA],
82 KDE_CHECK_HEADERS([sys/asoundlib.h alsa/asoundlib.h],
85 KDE_CHECK_LIB(asound, snd_seq_create_simple_port,
90 if test "x$have_alsa" = xyes; then
93 #ifdef HAVE_SYS_ASOUNDLIB_H
94 #include <sys/asoundlib.h>
96 #ifdef HAVE_ALSA_ASOUNDLIB_H
97 #include <alsa/asoundlib.h>
100 #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
101 /* we have ALSA 0.5.x */
103 #error not ALSA 0.5.x
109 #include "confdefs.h"
110 #ifdef HAVE_SYS_ASOUNDLIB_H
111 #include <sys/asoundlib.h>
113 #ifdef HAVE_ALSA_ASOUNDLIB_H
114 #include <alsa/asoundlib.h>
117 #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
118 /* we have ALSA 0.9.x */
120 #error not ALSA 0.9.x
126 #include "confdefs.h"
127 #ifdef HAVE_SYS_ASOUNDLIB_H
128 #include <sys/asoundlib.h>
130 #ifdef HAVE_ALSA_ASOUNDLIB_H
131 #include <alsa/asoundlib.h>
134 #if (SND_LIB_MAJOR == 1)
135 /* we have ALSA 1.x */
144 if test "x$have_alsa_0_9" = xyes || test "x$have_alsa_1" = xyes; then
145 # for kmix/ and akode/
147 AC_DEFINE(HAVE_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
150 ARTS_LIBASOUND="-lasound"
151 AC_DEFINE(HAVE_ARTS_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
154 if test "x$have_alsa_0_5" = xyes; then
156 ARTS_LIBASOUND="-lasound"
157 AC_DEFINE(HAVE_ARTS_LIBASOUND, 1, [Define if you have libasound.so.1 (required for ALSA 0.5.x support)])
161 AC_SUBST(ARTS_LIBASOUND)
165 [AC_HELP_STRING(--with-alsa,
166 [enable support for ALSA @<:@default=check@:>@])],
170 if test "x$with_alsa" != xno; then
173 if test "x$with_alsa" != xcheck && test "x$have_alsa" != xyes; then
174 AC_MSG_ERROR([--with-alsa was given, but test for ALSA failed])
178 AM_CONDITIONAL(include_kttsd_alsaplayer, [test "x$have_alsa" = "xyes"])
180 dnl ================================================================================
182 dnl Check for aKode library. Note: As of about 16 Jul 2005, it got moved
183 dnl from kdemultimedia to kdesupport.
185 AC_DEFUN([KDE_CHECK_AKODE],
187 AC_PATH_PROG(AKODE_CONFIG, akode-config, [no], [$PATH:$prefix/bin])
189 if test "x$AKODE_CONFIG" != xno; then
190 AC_DEFINE(HAVE_AKODE, 1, [define if you have aKodelib installed])
191 akode_includes=`$AKODE_CONFIG --cflags`
192 akode_libs=`$AKODE_CONFIG --libs`
200 AC_SUBST(akode_includes)
205 [AC_HELP_STRING([--with-akode],
206 [enable the aKode decoder @<:@default=no@:>@])],
210 if test "x$with_akode" != xno; then
213 if test "x$with_akode" != xcheck && test "x$have_akode" != xyes; then
214 AC_MSG_ERROR([--with-akode was given, but test for aKode failed])
218 AM_CONDITIONAL(include_kttsd_akodeplayer, [test "x$have_akode" = "xyes"])
220 dnl ================================================================================
222 dnl Check whether to include sys/time.h and time.h, or just sys/time.h.
223 dnl Defines TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H, which are used in
227 AC_CHECK_HEADERS(sys/time.h)
229 dnl ================================================================================
231 dnl See if the latest kspeech.h is installed and if not, compile against
232 dnl kttsd/compat directory.
234 if test "$KTTS_KSPEECH_DIR" = ""; then
235 KDE_CHECK_HEADER(kspeech.h, ktts_have_kspeech_h=yes, ktts_have_kspeech_h=no)
236 have_latest_kspeech=no
237 if test "x$ktts_have_kspeech_h" = xyes; then
238 AC_MSG_CHECKING([whether installed kspeech.h is latest version])
239 ktts_save_cppflags=$CPPFLAGS
241 CPPFLAGS="$all_includes $CPPFLAGS"
244 [#include <kspeech.h>],
246 if (4 == KSpeech::mtHtml);
248 have_latest_kspeech=yes,
249 have_latest_kspeech=no)
250 AC_MSG_RESULT($have_latest_kspeech)
251 CPPFLAGS=$ktts_save_cppflags
254 if test "x$have_latest_kspeech" = xyes; then
255 KTTS_KSPEECH_DIR='$(kde_includes)'
256 KTTS_KSPEECH_INCLUDE=""
257 KTTS_INTERFACES_DIR=""
259 KTTS_KSPEECH_DIR='$(top_srcdir)/kttsd/compat/interfaces/kspeech'
260 KTTS_KSPEECH_INCLUDE='-I$(top_srcdir)/kttsd/compat/interfaces/kspeech'
261 KTTS_INTERFACES_DIR="interfaces"
262 AC_MSG_WARN([Latest kspeech.h not installed. Compiling using kttsd/compat directory.])
265 AC_SUBST(KTTS_KSPEECH_DIR)
266 AC_SUBST(KTTS_KSPEECH_INCLUDE)
267 AC_SUBST(KTTS_INTERFACES_DIR)
270 dnl ================================================================================
272 # --- Check for KDE < 3.5 ---
273 # If so, install icons.
275 AC_MSG_CHECKING([for KDE version])
279 kdeversion_save_CXXFLAGS="$CXXFLAGS"
280 kdeversion_save_LIBS="$LIBS"
281 LIBS="$LIBS $X_EXTRA_LIBS"
282 CXXFLAGS="$CXXFLAGS $all_includes"
285 #include <kdeversion.h>
286 #if ! ( KDE_IS_VERSION( 3, 4, 90 ) )
292 KTTS_ICONS_DIR="icons"
295 CXXFLAGS="$kdeversion_save_CXXFLAGS"
296 LIBS="$kdeversion_save_LIBS"
299 if test "$KTTS_ICONS_DIR" = ""; then
300 AC_MSG_RESULT([KDE 3.4.x or less])
302 AC_MSG_RESULT([KDE 3.5 or later])
305 AC_SUBST(KTTS_ICONS_DIR)