3 dnl Checks for header files.
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)
18 if test `uname -s` = "FreeBSD"
20 HW_MODEL=`sysctl -n hw.model`
23 "Pentium II/Pentium II Xeon/Celeron")
28 AC_MSG_RESULT($ARCH_TYPE)
32 AC_MSG_CHECKING(for a binutils new enough to support MMX)
33 as_ver=`echo|as -v 2>&1|grep ".*version.*"`
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
44 if test $as_major -lt 2
48 as_minor=`echo $as_ver |cut -d. -f2`
49 if test $as_minor -ge 10
58 AC_MSG_RESULT($MMX_SUPPORT)
61 dnl No MMX support on non-x86 architecture toolchains
66 dnl Checks for typedefs, structures, and compiler characteristics.
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,
76 #if defined(__GNUC__) && defined(__i386__)
77 __asm__("movups %xmm0, (%esp)");
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],
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(vorbisenc, 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])
126 OGG_VORBISLIBS="-lvorbisfile -lvorbis -logg"
127 AC_DEFINE(OGG_VORBIS, 1, [Define if you have ogg/vorbis installed])
130 AC_SUBST(VORBIS_LIBS)
131 AC_SUBST(VORBISFILE_LIBS)
132 AC_SUBST(VORBISENC_LIBS)
135 AC_DEFUN([KDE_CHECK_OSSAUDIO],
139 AC_CHECK_HEADERS([soundcard.h sys/soundcard.h],
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"
150 AC_SUBST(LIBOSSAUDIO)
153 AC_DEFUN([KDE_CHECK_ALSA],
157 AC_CHECK_HEADERS([sys/asoundlib.h alsa/asoundlib.h],
160 AC_CHECK_LIB(asound, snd_seq_create_simple_port,
165 if test "x$have_alsa" = xyes; then
167 #include "confdefs.h"
168 #ifdef HAVE_SYS_ASOUNDLIB_H
169 #include <sys/asoundlib.h>
171 #ifdef HAVE_ALSA_ASOUNDLIB_H
172 #include <alsa/asoundlib.h>
175 #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
176 /* we have ALSA 0.5.x */
178 #error not ALSA 0.5.x
184 #include "confdefs.h"
185 #ifdef HAVE_SYS_ASOUNDLIB_H
186 #include <sys/asoundlib.h>
188 #ifdef HAVE_ALSA_ASOUNDLIB_H
189 #include <alsa/asoundlib.h>
192 #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
193 /* we have ALSA 0.9.x */
195 #error not ALSA 0.9.x
201 #include "confdefs.h"
202 #ifdef HAVE_SYS_ASOUNDLIB_H
203 #include <sys/asoundlib.h>
205 #ifdef HAVE_ALSA_ASOUNDLIB_H
206 #include <alsa/asoundlib.h>
209 #if (SND_LIB_MAJOR == 1)
210 /* we have ALSA 1.x */
219 if test "x$have_alsa_0_9" = xyes || test "x$have_alsa_1" = xyes; then
220 # for kmix/ and akode/
222 AC_DEFINE(HAVE_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
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)])
229 if test "x$have_alsa_0_5" = xyes; then
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)])
236 AC_SUBST(ARTS_LIBASOUND)
239 AC_DEFUN([KDE_CHECK_CDPARANOIA],
243 if test -z "$CDPARANOIA"; then
244 KDE_FIND_PATH(cdparanoia, CDPARANOIA, [/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin])
247 if test -z "$CDPARANOIA"; then
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,
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
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
271 if test "$ext" = a; then
272 have_cdparanoia_only_static=yes
275 if test "x$have_cdparanoia" = xyes; then
276 # for kioslave/audiocd/
277 CDPARANOIA_LIBS="-lcdda_paranoia -lcdda_interface -lm"
280 CDDALIBS="-lcdda_paranoia -lcdda_interface -lm"
281 AC_DEFINE(CDDA_PARANOIA, 1, [Define if you have cdparanoia installed])
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])
289 AC_SUBST(CDPARANOIA_LIBS)
292 AC_DEFUN([KDE_CHECK_LAME],
296 KDE_CHECK_HEADER(lame/lame.h,
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"
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`
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`
346 AC_SUBST(akode_includes)
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
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
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])
389 if test x$kde_mpeglib_compiles = xno; then
390 AC_MSG_RESULT([** mpeglib disabled we disable artsplug **])
391 kde_artsplug_compiles=no;
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"
398 ])dnl KDE_CHECK_MPEGLIB_ARTS
403 [AC_HELP_STRING(--with-vorbis,
404 [enable support for Ogg Vorbis @<:@default=check@:>@])],
405 [], with_vorbis=check)
408 if test "x$with_vorbis" != xno; then
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])
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
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])
437 [AC_HELP_STRING(--with-alsa,
438 [enable support for ALSA @<:@default=check@:>@])],
442 if test "x$with_alsa" != xno; then
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])
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)
456 if test "x$with_cdparanoia" != xno; then
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])
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"
473 [AC_HELP_STRING(--with-lame,
474 [enable support for MP3 encoding thorugh lame @<:@default=check@:>@])],
478 if test "x$with_lame" != xno; then
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])
486 # for krec/mp3_export
487 AM_CONDITIONAL(compile_mp3_export, test "x$have_lame" = xyes)
490 [AC_HELP_STRING(--with-taglib,
491 [enable support for TagLib @<:@default=check@:>@])],
492 [], with_taglib=check)
496 if test "x$with_taglib" != xno; then
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])
505 [AC_HELP_STRING([--with-akode],
506 [enable the aKode decoder @<:@default=check@:>@])],
507 [], with_akode=check)
510 if test "x$with_akode" != xno; then
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])
518 KDE_CHECK_MPEGLIB_ARTS