Remove this line
[kdeaccessibility.git] / kttsd / configure.in.in
blob8ace1812799d62df43f542c467e4f8d8853a4683
1 #MIN_CONFIG(3.2)
3 ### AM_INIT_AUTOMAKE(kttsd,0.2.0)
5 dnl ================================================================================
7 dnl Check for GStreamer >= 0.8.7
9 AC_ARG_WITH(gstreamer,
10   [AC_HELP_STRING(--with-gstreamer,
11     [enable support for GStreamer @<:@default=no@:>@])],
12   [], with_gstreamer=no)
14 have_gst=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
22   dnl start with 0.8
23   GST_MAJORMINOR=0.8
24   dnl Actually need 0.8.7, but plugins were version 0.8.5.  argh!
25   GST_REQ=0.8.5
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])
35   fi
38 if test "x$have_gst" = "xno"; then
39   INCLUDES_GST=""
40   LDADD_GST=""
41   LDFLAGS_GST=""
42   AC_DEFINE(HAVE_GSTREAMER, 0, [have GStreamer])
43 else
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
49   # --libs-only-other
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])
58   fi
61 AC_SUBST(INCLUDES_GST)
62 AC_SUBST(LDADD_GST)
63 AC_SUBST(LDFLAGS_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 ================================================================================
75 dnl Check for ALSA.
76 dnl TODO: Don't know if 0.5 works or not.
78 AC_DEFUN([KDE_CHECK_ALSA],
80   have_alsa=no
82   KDE_CHECK_HEADERS([sys/asoundlib.h alsa/asoundlib.h],
83     [have_alsa=yes])
85   KDE_CHECK_LIB(asound, snd_seq_create_simple_port,
86     [:], [have_alsa=no])
88   AC_LANG_SAVE
89   AC_LANG_C
90   if test "x$have_alsa" = xyes; then
91     AC_TRY_COMPILE([
92       #include "confdefs.h"
93       #ifdef HAVE_SYS_ASOUNDLIB_H
94       #include <sys/asoundlib.h>
95       #endif
96       #ifdef HAVE_ALSA_ASOUNDLIB_H
97       #include <alsa/asoundlib.h>
98       #endif
99     ],[
100       #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
101         /* we have ALSA 0.5.x */
102       #else
103         #error not ALSA 0.5.x
104       #endif
105     ],
106     have_alsa_0_5=yes)
108     AC_TRY_COMPILE([
109       #include "confdefs.h"
110       #ifdef HAVE_SYS_ASOUNDLIB_H
111       #include <sys/asoundlib.h>
112       #endif
113       #ifdef HAVE_ALSA_ASOUNDLIB_H
114       #include <alsa/asoundlib.h>
115       #endif
116     ],[
117       #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
118         /* we have ALSA 0.9.x */
119       #else
120         #error not ALSA 0.9.x
121       #endif
122     ],
123     have_alsa_0_9=yes)
125     AC_TRY_COMPILE([
126       #include "confdefs.h"
127       #ifdef HAVE_SYS_ASOUNDLIB_H
128       #include <sys/asoundlib.h>
129       #endif
130       #ifdef HAVE_ALSA_ASOUNDLIB_H
131       #include <alsa/asoundlib.h>
132       #endif
133     ],[
134       #if (SND_LIB_MAJOR == 1)
135         /* we have ALSA 1.x */
136       #else
137         #error not ALSA 1.x
138       #endif
139     ],
140     have_alsa_1=yes)
141   fi
142   AC_LANG_RESTORE
144   if test "x$have_alsa_0_9" = xyes || test "x$have_alsa_1" = xyes; then
145     # for kmix/ and akode/
146     LIBASOUND="-lasound"
147     AC_DEFINE(HAVE_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
149     # for arts/
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)])
152   fi
154   if test "x$have_alsa_0_5" = xyes; then
155     # for arts/
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)])
158   fi
160   AC_SUBST(LIBASOUND)
161   AC_SUBST(ARTS_LIBASOUND)
164 AC_ARG_WITH(alsa,
165   [AC_HELP_STRING(--with-alsa,
166     [enable support for ALSA @<:@default=check@:>@])],
167   [], with_alsa=check)
169 have_alsa=no
170 if test "x$with_alsa" != xno; then
171   KDE_CHECK_ALSA
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])
175   fi
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`
193     have_akode=yes
194   else
195     akode_includes=""
196     akode_libs=""
197     have_akode=no
198   fi
200   AC_SUBST(akode_includes)
201   AC_SUBST(akode_libs)
204 AC_ARG_WITH(akode,
205     [AC_HELP_STRING([--with-akode],
206         [enable the aKode decoder @<:@default=no@:>@])],
207     [], with_akode=no)
209 have_akode=no
210 if test "x$with_akode" != xno; then
211   KDE_CHECK_AKODE
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])
215   fi
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
224 dnl alsaplayer.cpp.
226 AC_HEADER_TIME
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
240         AC_LANG_SAVE
241         CPPFLAGS="$all_includes $CPPFLAGS"
242         AC_LANG_CPLUSPLUS
243         AC_TRY_COMPILE(
244             [#include <kspeech.h>],
245             [
246             if (4 == KSpeech::mtHtml);
247             ],
248             have_latest_kspeech=yes,
249             have_latest_kspeech=no)
250         AC_MSG_RESULT($have_latest_kspeech)
251         CPPFLAGS=$ktts_save_cppflags
252         AC_LANG_RESTORE
253     fi
254     if test "x$have_latest_kspeech" = xyes; then
255         KTTS_KSPEECH_DIR='$(kde_includes)'
256         KTTS_KSPEECH_INCLUDE=""
257         KTTS_INTERFACES_DIR=""
258     else
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.])
263     fi
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])
277 AC_LANG_SAVE
278 AC_LANG_CPLUSPLUS
279 kdeversion_save_CXXFLAGS="$CXXFLAGS"
280 kdeversion_save_LIBS="$LIBS"
281 LIBS="$LIBS $X_EXTRA_LIBS"
282 CXXFLAGS="$CXXFLAGS $all_includes"
284 AC_COMPILE_IFELSE([
285 #include <kdeversion.h>
286 #if ! ( KDE_IS_VERSION( 3, 4, 90 ) )
287 #error KDE 3.4
288 #endif
290     KTTS_ICONS_DIR=""
292     KTTS_ICONS_DIR="icons"
295 CXXFLAGS="$kdeversion_save_CXXFLAGS"
296 LIBS="$kdeversion_save_LIBS"
297 AC_LANG_RESTORE
299 if test "$KTTS_ICONS_DIR" = ""; then
300     AC_MSG_RESULT([KDE 3.4.x or less])
301 else
302     AC_MSG_RESULT([KDE 3.5 or later])
305 AC_SUBST(KTTS_ICONS_DIR)