1) Clean up: Consolidate Views and MixDeviceWidgets, so that there is
[kdemultimedia.git] / configure.in.in
blob017248552b8369f4c83d9184f4706a95b48434f2
1 #MIN_CONFIG
3 dnl Checks for header files.
4 AC_HEADER_DIRENT
5 AC_HEADER_STDC
6 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h features.h alloca.h linux/awe_voice.h awe_voice.h /usr/src/sys/i386/isa/sound/awe_voice.h /usr/src/sys/gnu/i386/isa/sound/awe_voice.h linux/ucdrom.h sys/stdtypes.h sys/filio.h sys/audioio.h Alib.h sys/sem.h string.h getopt.h machine/endian.h sys/awe_voice.h)
8 dnl First, setup HAVE_LINUX_CDROM_H.
9 dnl This gets cached, so later we can selectively
10 dnl disable applications by using _CHECK_HEADER
11 AC_CHECK_HEADERS(linux/cdrom.h)
13 AC_CHECK_FUNCS(usleep snprintf)
15 AC_MSG_CHECKING(machine architecture)
16 AC_SUBST(ARCH_TYPE)
17 ARCH_TYPE=`uname -m`
18 if test `uname -s` = "FreeBSD"
19 then
20         HW_MODEL=`sysctl -n hw.model`
22         case "$HW_MODEL" in
23                 "Pentium II/Pentium II Xeon/Celeron")
24                         ARCH_TYPE="i686"
25                 ;;
26         esac
27 fi;
28 AC_MSG_RESULT($ARCH_TYPE)
30 case "$ARCH_TYPE" in
31 i?86)
32         AC_MSG_CHECKING(for a binutils new enough to support MMX)
33         as_ver=`echo|as -v 2>&1|grep ".*version.*"`
34         if test -z "$as_ver"
35         then
36                 MMX_SUPPORT="no"
37         else
38                 as_ver=`echo $as_ver |sed -e "s/.*version //;s/ .*//"`
39                 as_major=`echo $as_ver |cut -d. -f1`
40                 if test $as_major -gt 2
41                 then
42                         MMX_SUPPORT="yes"
43                 else
44                         if test $as_major -lt 2
45                         then
46                                 MMX_SUPPORT="no"
47                         else
48                                 as_minor=`echo $as_ver |cut -d. -f2`
49                                 if test $as_minor -ge 10
50                                 then
51                                         MMX_SUPPORT="yes"
52                                 else
53                                         MMX_SUPPORT="no"
54                                 fi
55                         fi
56                 fi
57         fi
58         AC_MSG_RESULT($MMX_SUPPORT)
59         ;;
61         dnl No MMX support on non-x86 architecture toolchains
62         MMX_SUPPORT="no"
63   ;;
64 esac
66 dnl Checks for typedefs, structures, and compiler characteristics.
67 AC_HEADER_TIME
68 CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
70 dnl check if the assembler supports SSE instructions
71 AC_MSG_CHECKING([for x86 SSE instructions])
72 AC_CACHE_VAL(ac_cv_x86_sse,
74 AC_TRY_COMPILE(,
76 #if defined(__GNUC__) && defined(__i386__)
77 __asm__("movups %xmm0, (%esp)");
78 #else
79 #error Not gcc on x86
80 #endif
82 ac_cv_x86_sse=yes,
83 ac_cv_x86_sse=no)
85 AC_MSG_RESULT($ac_cv_x86_sse)
86 if test "x$ac_cv_x86_sse" = "xyes"; then
87             AC_DEFINE(HAVE_X86_SSE,1,
88                         [Define if your assembler supports x86 SSE instructions])
91 AC_DEFUN([KDE_CHECK_OGGVORBIS],
93   have_oggvorbis=yes
95   KDE_CHECK_LIB(ogg, ogg_page_version,
96     [:], [have_oggvorbis=no])
98   KDE_CHECK_HEADER(vorbis/vorbisfile.h,
99     [:], [have_oggvorbis=no])
101   KDE_CHECK_LIB(vorbis, vorbis_info_init,
102     [:], [have_oggvorbis=no])
104   KDE_CHECK_LIB(vorbisfile, ov_open,
105     [:], [have_oggvorbis=no], -lvorbis -logg)
107   KDE_CHECK_LIB(vorbisenc, vorbis_info_clear,
108     [:], [have_oggvorbis=no])
110   KDE_CHECK_LIB(vorbis, vorbis_bitrate_addblock,
111     [have_vorbis_value=2], [have_vorbis_value=1])
113   if test "x$have_oggvorbis" = xyes; then
114     # for akode/plugins/xiph_decoder/ kioslave/audiocd/plugins/ and krec/ogg_export/
115     VORBIS_LIBS="-lvorbis -logg"
116     VORBISFILE_LIBS="-lvorbisfile"
117     VORBISENC_LIBS="-lvorbisenc"
119     # for akode/plugins/xiph_decoder/
120     AC_DEFINE_UNQUOTED(HAVE_OGG_VORBIS, 1, [Define if you have ogg/vorbis installed])
122     # for kioslave/audiocd/plugins/ and krec/ogg_export/
123     AC_DEFINE_UNQUOTED(HAVE_VORBIS, $have_vorbis_value, [Define if you ogg/vorbis installed])
125     # for mpeglib/
126     OGG_VORBISLIBS="-lvorbisfile -lvorbis -logg"
127     AC_DEFINE(OGG_VORBIS, 1, [Define if you have ogg/vorbis installed])
128   fi
130   AC_SUBST(VORBIS_LIBS)
131   AC_SUBST(VORBISFILE_LIBS)
132   AC_SUBST(VORBISENC_LIBS)
135 AC_DEFUN([KDE_CHECK_OSSAUDIO],
137   have_ossaudio=no
139   AC_CHECK_HEADERS([soundcard.h sys/soundcard.h],
140     [have_ossaudio=yes])
142   AC_CHECK_LIB(ossaudio, _oss_ioctl,
143     [:], [have_ossaudio=no])
145   if test "x$have_ossaudio" = xyes; then
146     # for kmix/ and akode/
147     LIBOSSAUDIO="-lossaudio"
148   fi
150   AC_SUBST(LIBOSSAUDIO)
153 AC_DEFUN([KDE_CHECK_ALSA],
155   have_alsa=no
157   AC_CHECK_HEADERS([sys/asoundlib.h alsa/asoundlib.h],
158     [have_alsa=yes])
160   AC_CHECK_LIB(asound, snd_seq_create_simple_port,
161     [:], [have_alsa=no])
163   AC_LANG_SAVE
164   AC_LANG_C
165   if test "x$have_alsa" = xyes; then
166     AC_TRY_COMPILE([
167       #include "confdefs.h"
168       #ifdef HAVE_SYS_ASOUNDLIB_H
169       #include <sys/asoundlib.h>
170       #endif
171       #ifdef HAVE_ALSA_ASOUNDLIB_H
172       #include <alsa/asoundlib.h>
173       #endif
174     ],[
175       #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
176         /* we have ALSA 0.5.x */
177       #else
178         #error not ALSA 0.5.x
179       #endif
180     ],
181     have_alsa_0_5=yes)
183     AC_TRY_COMPILE([
184       #include "confdefs.h"
185       #ifdef HAVE_SYS_ASOUNDLIB_H
186       #include <sys/asoundlib.h>
187       #endif
188       #ifdef HAVE_ALSA_ASOUNDLIB_H
189       #include <alsa/asoundlib.h>
190       #endif
191     ],[
192       #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
193         /* we have ALSA 0.9.x */
194       #else
195         #error not ALSA 0.9.x
196       #endif
197     ],
198     have_alsa_0_9=yes)
200     AC_TRY_COMPILE([
201       #include "confdefs.h"
202       #ifdef HAVE_SYS_ASOUNDLIB_H
203       #include <sys/asoundlib.h>
204       #endif
205       #ifdef HAVE_ALSA_ASOUNDLIB_H
206       #include <alsa/asoundlib.h>
207       #endif
208     ],[
209       #if (SND_LIB_MAJOR == 1)
210         /* we have ALSA 1.x */
211       #else
212         #error not ALSA 1.x
213       #endif
214     ],
215     have_alsa_1=yes)
216   fi
217   AC_LANG_RESTORE
219   if test "x$have_alsa_0_9" = xyes || test "x$have_alsa_1" = xyes; then
220     # for kmix/ and akode/
221     LIBASOUND="-lasound"
222     AC_DEFINE(HAVE_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
224     # for arts/
225     ARTS_LIBASOUND="-lasound"
226     AC_DEFINE(HAVE_ARTS_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
227   fi
229   if test "x$have_alsa_0_5" = xyes; then
230     # for arts/
231     ARTS_LIBASOUND="-lasound"
232     AC_DEFINE(HAVE_ARTS_LIBASOUND, 1, [Define if you have libasound.so.1 (required for ALSA 0.5.x support)])
233   fi
235   AC_SUBST(LIBASOUND)
236   AC_SUBST(ARTS_LIBASOUND)
239 AC_DEFUN([KDE_CHECK_CDPARANOIA],
241   have_cdparanoia=yes
243   if test -z "$CDPARANOIA"; then
244     KDE_FIND_PATH(cdparanoia, CDPARANOIA, [/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin])
245   fi
247   if test -z "$CDPARANOIA"; then
248     have_cdparanoia=no
249   fi
251   KDE_CHECK_HEADER(cdda_interface.h,
252     [:], [have_cdparanoia=no])
254   KDE_CHECK_LIB(cdda_paranoia, paranoia_init,
255     [:], [have_cdparanoia=no], [-lcdda_interface -lm])
257   # because of the horrible hack we need shared cdparanoia
258   for ext in so sl la a; do
259     AC_FIND_FILE(libcdda_paranoia.$ext, $kde_libraries /usr/lib /usr/local/lib,
260       para_libdir)
261     if test -r $para_libdir/libcdda_paranoia.$ext; then
262       if test $ext = a && ls "$para_libdir" | grep "^libcdda_paranoia.so.*" 2>&1 >/dev/null; then
263         ext=so
264       fi
265       break
266     fi
267   done
268   if test "$ext" = la; then
269       grep "^library_names='.*[a-z].*'" $para_libdir/libcdda_paranoia.$ext 2>&1 > /dev/null || have_cdparanoia_only_static=yes
270   fi
271   if test "$ext" = a; then
272     have_cdparanoia_only_static=yes
273   fi
275   if test "x$have_cdparanoia" = xyes; then
276     # for kioslave/audiocd/
277     CDPARANOIA_LIBS="-lcdda_paranoia -lcdda_interface -lm"
279     # for mpeglib/
280     CDDALIBS="-lcdda_paranoia -lcdda_interface -lm"
281     AC_DEFINE(CDDA_PARANOIA, 1, [Define if you have cdparanoia installed])
282   fi
284   if test "x$have_cdparanoia_only_static" = xyes; then
285     # for kioslave/audiocd/
286     AC_DEFINE_UNQUOTED(CDPARANOIA_STATIC, 1, [Define if you only have a static cdparanoia])
287   fi
289   AC_SUBST(CDPARANOIA_LIBS)
292 AC_DEFUN([KDE_CHECK_LAME],
294   have_lame=yes
296   KDE_CHECK_HEADER(lame/lame.h,
297     [:], [have_lame=no])
299   KDE_CHECK_LIB(mp3lame, lame_init,
300     [:], [have_lame=no], [-lm])
302   if test "x$have_lame" = xyes; then
303     # for krec/mp3_export/ (kioslave/audiocd/ uses the lame binary at runtime)
304     LAME_LIBS="-lmp3lame -lm"
305   fi
307   AC_SUBST(LAME_LIBS)
310 AC_DEFUN([KDE_CHECK_TAGLIB],
312   AC_PATH_PROG(TAGLIB_CONFIG, taglib-config, [no], [$PATH:$prefix/bin])
314   if test "x$TAGLIB_CONFIG" != xno; then
315     AC_DEFINE(HAVE_TAGLIB, 1, [define if you have TagLib])
316     taglib_includes=`$TAGLIB_CONFIG --cflags`
317     taglib_libs=`$TAGLIB_CONFIG --libs`
318     have_taglib=yes
319   else
320     taglib_includes=""
321     taglib_libs=""
322     have_taglib=no
323   fi
325   KDE_CHECK_HEADER(taglib/mpcfile.h, have_taglib_mpc=yes, have_taglib_mpc=no)
327   AC_SUBST(taglib_includes)
328   AC_SUBST(taglib_libs)
331 AC_DEFUN([KDE_CHECK_AKODE],
333   AC_PATH_PROG(AKODE_CONFIG, akode-config, [no], [$PATH:$prefix/bin])
335   if test "x$AKODE_CONFIG" != xno; then
336     AC_DEFINE(HAVE_AKODE, 1, [define if you have aKodelib installed])
337     akode_includes=`$AKODE_CONFIG --cflags`
338     akode_libs=`$AKODE_CONFIG --libs`
339     have_akode=yes
340   else
341     akode_includes=""
342     akode_libs=""
343     have_akode=no
344   fi
346   AC_SUBST(akode_includes)
347   AC_SUBST(akode_libs)
351 AC_DEFUN([KDE_CHECK_MPEGLIB_ARTS],
353   MPEGLIB_ARTS_MAJOR_VERSION=0
354   MPEGLIB_ARTS_MINOR_VERSION=3
355   MPEGLIB_ARTS_MICRO_VERSION=0
357   MPEGLIB_ARTS_VERSION=$MPEGLIB_ARTS_MAJOR_VERSION.$MPEGLIB_ARTS_MINOR_VERSION.$MPEGLIB_ARTS_MICRO_VERSION
359   AC_SUBST(MPEGLIB_ARTS_MAJOR_VERSION)
360   AC_SUBST(MPEGLIB_ARTS_MINOR_VERSION)
361   AC_SUBST(MPEGLIB_ARTS_MICRO_VERSION)
362   AC_SUBST(MPEGLIB_ARTS_VERSION)
364   dnl build search PATH
365   artsc_config_test_path=$prefix/bin:$exec_prefix/bin:$KDEDIR/bin:$PATH
366   AC_PATH_PROG(kde_artsplug_compiles,artsc-config,no,$artsc_config_test_path)
368   dnl if we found it here set variable
369   if test x$kde_artsplug_compiles != xno; then
370     ARTSCCONFIG=$kde_artsplug_compiles;
371     kde_artsplug_compiles=yes
372   fi
374   dnl this is needed for a standalone mpeglib
375   dnl it should compile without KDE installed
376   dnl but if we find arts we need the include
377   dnl path for it.
379   if test x$kde_artsplug_compiles = xyes; then
380     ARTSC_INCLUDE=`${ARTSCCONFIG} --cflags`
381     AC_MSG_RESULT([arts includes... $ARTSC_INCLUDE])
382     AC_SUBST(ARTSC_INCLUDE)
383     ARTSC_LIBS=`${ARTSCCONFIG} --libs`
384     AC_MSG_RESULT([arts libraries... $ARTSC_LIBS])
385     AC_SUBST(ARTSC_LIBS)
386     AC_SUBST(LIBDL)
387   fi
389   if test x$kde_mpeglib_compiles = xno; then
390     AC_MSG_RESULT([** mpeglib disabled we disable artsplug **])
391     kde_artsplug_compiles=no;
392     fi
394   if test x$kde_artsplug_compiles = xno; then
395     AC_MSG_RESULT([** DO NOT COMPILE mpeglib_artsplug **])
396     DO_NOT_COMPILE="$DO_NOT_COMPILE mpeglib_artsplug"
397   fi
398 ])dnl KDE_CHECK_MPEGLIB_ARTS
400 AC_TYPE_SIGNAL
402 AC_ARG_WITH(vorbis,
403   [AC_HELP_STRING(--with-vorbis,
404     [enable support for Ogg Vorbis @<:@default=check@:>@])],
405   [], with_vorbis=check)
407 have_oggvorbis=no
408 if test "x$with_vorbis" != xno; then
409   KDE_CHECK_OGGVORBIS
411   if test "x$with_vorbis" != xcheck && test "x$have_oggvorbis" != xyes; then
412     AC_MSG_ERROR([--with-vorbis was given, but test for Ogg Vorbis failed])
413   fi
416 # for krec/ogg_export
417 AM_CONDITIONAL(compile_ogg_export, test "x$have_oggvorbis" = xyes)
419 if test "x$kde_mpeglib_compiles" = xyes -o "x$have_oggvorbis" = xno; then
420   DO_NOT_COMPILE="$DO_NOT_COMPILE oggvorbis_artsplugin"
423 AC_ARG_WITH(ossaudio,
424   [AC_HELP_STRING(--with-ossaudio,
425     [enable support for OpenBSD ossaudio @<:@default=check@:>@])],
426   [], with_ossaudio=check)
428 if test "x$with_ossaudio" != xno; then
429   KDE_CHECK_OSSAUDIO
431   if test "x$with_ossaudio" != xcheck && test "x$have_ossaudio" != xyes; then
432     AC_MSG_ERROR([--with-ossaudio was given, but test for ossaudio failed])
433   fi
436 AC_ARG_WITH(alsa,
437   [AC_HELP_STRING(--with-alsa,
438     [enable support for ALSA @<:@default=check@:>@])],
439   [], with_alsa=check)
441 have_alsa=no
442 if test "x$with_alsa" != xno; then
443   KDE_CHECK_ALSA
445   if test "x$with_alsa" != xcheck && test "x$have_alsa" != xyes; then
446     AC_MSG_ERROR([--with-alsa was given, but test for ALSA failed])
447   fi
450 AC_ARG_WITH(cdparanoia,
451   [AC_HELP_STRING(--with-cdparanoia,
452     [enable support for CD ripping thorugh cdparanoia @<:@default=check@:>@])],
453   [], with_cdparanoia=check)
455 have_cdparanoia=no
456 if test "x$with_cdparanoia" != xno; then
457   KDE_CHECK_CDPARANOIA
459   if test "x$with_cdparanoia" != xcheck && test "x$have_cdparanoia" != xyes; then
460     AC_MSG_ERROR([--with-cdparanoia was given, but test for cdparanoia failed])
461   fi
464 # for kioslave/audiocd/
465 AM_CONDITIONAL(include_kioslave_audiocd, test "x$have_cdparanoia" = xyes)
466 AM_CONDITIONAL(include_kcm_audiocd, test "x$have_cdparanoia" = xyes)
467 if test "x$have_cdparanoia" != xyes; then
468     # kaudiocreator depends on kio_audiocd
469     DO_NOT_COMPILE="$DO_NOT_COMPILE kaudiocreator"
472 AC_ARG_WITH(lame,
473   [AC_HELP_STRING(--with-lame,
474     [enable support for MP3 encoding thorugh lame @<:@default=check@:>@])],
475   [], with_lame=check)
477 have_lame=no
478 if test "x$with_lame" != xno; then
479   KDE_CHECK_LAME
481   if test "x$with_lame" != xcheck && test "x$have_lame" != xyes; then
482     AC_MSG_ERROR([--with-lame was given, but test for lame failed])
483   fi
486 # for krec/mp3_export
487 AM_CONDITIONAL(compile_mp3_export, test "x$have_lame" = xyes)
489 AC_ARG_WITH(taglib,
490   [AC_HELP_STRING(--with-taglib,
491     [enable support for TagLib @<:@default=check@:>@])],
492   [], with_taglib=check)
494 have_taglib=no
495 have_taglib_mpc=no
496 if test "x$with_taglib" != xno; then
497   KDE_CHECK_TAGLIB
499   if test "x$with_taglib" != xcheck && test "x$have_taglib" != xyes; then
500     AC_MSG_ERROR([--with-taglib was given, but test for TagLib failed])
501   fi
504 AC_ARG_WITH(akode,
505     [AC_HELP_STRING([--with-akode],
506         [enable the aKode decoder @<:@default=check@:>@])],
507     [], with_akode=check)
509 have_akode=no
510 if test "x$with_akode" != xno; then
511   KDE_CHECK_AKODE
513   if test "x$with_akode" != xcheck && test "x$have_akode" != xyes; then
514     AC_MSG_ERROR([--with-akode was given, but test for aKode failed])
515   fi
518 KDE_CHECK_MPEGLIB_ARTS