dnl =======================================================
dnl FILE: ./admin/configure.in.min
dnl =======================================================

dnl    This file is part of the KDE libraries/packages
dnl    Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
 
dnl    This file is free software; you can redistribute it and/or
dnl    modify it under the terms of the GNU Library General Public
dnl    License as published by the Free Software Foundation; either
dnl    version 2 of the License, or (at your option) any later version.
 
dnl    This library is distributed in the hope that it will be useful,
dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl    Library General Public License for more details.
 
dnl    You should have received a copy of the GNU Library General Public License
dnl    along with this library; see the file COPYING.LIB.  If not, write to
dnl    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
dnl    Boston, MA 02110-1301, USA.

# Original Author was Kalle@kde.org
# I lifted it in some mater. (Stephan Kulow)
# I used much code from Janos Farkas

dnl Process this file with autoconf to produce a configure script.

AC_INIT(acinclude.m4) dnl a source file from your sub dir

dnl This is so we can use kde-common
AC_CONFIG_AUX_DIR(admin)

dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
unset CDPATH

dnl Checking host/target/build systems, for make, install etc.
AC_CANONICAL_SYSTEM 
dnl Perform program name transformation
AC_ARG_PROGRAM

dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(kdemultimedia, "3.5.2") dnl searches for some needed programs

KDE_SET_PREFIX

dnl generate the config header
AM_CONFIG_HEADER(config.h) dnl at the distribution this done

dnl Checks for programs.
AC_CHECK_COMPILERS
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
KDE_PROG_LIBTOOL

dnl for NLS support. Call them in this order!
dnl WITH_NLS is for the po files
AM_KDE_WITH_NLS

dnl KDE_USE_QT
AC_PATH_KDE
dnl =======================================================
dnl FILE: configure.in.in
dnl =======================================================

#MIN_CONFIG

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
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)

dnl First, setup HAVE_LINUX_CDROM_H.
dnl This gets cached, so later we can selectively
dnl disable applications by using _CHECK_HEADER
AC_CHECK_HEADERS(linux/cdrom.h)

AC_CHECK_FUNCS(usleep snprintf)

AC_MSG_CHECKING(machine architecture)
AC_SUBST(ARCH_TYPE)
ARCH_TYPE=`uname -m`
if test `uname -s` = "FreeBSD"
then
	HW_MODEL=`sysctl -n hw.model`

	case "$HW_MODEL" in
		"Pentium II/Pentium II Xeon/Celeron")
			ARCH_TYPE="i686"
		;;
	esac
fi;
AC_MSG_RESULT($ARCH_TYPE)

case "$ARCH_TYPE" in
i?86)
	AC_MSG_CHECKING(for a binutils new enough to support MMX)
	as_ver=`echo|as -v 2>&1|grep ".*version.*"`
	if test -z "$as_ver"
	then
		MMX_SUPPORT="no"
	else
		as_ver=`echo $as_ver |sed -e "s/.*version //;s/ .*//"`
		as_major=`echo $as_ver |cut -d. -f1`
		if test $as_major -gt 2
		then
			MMX_SUPPORT="yes"
		else
			if test $as_major -lt 2
			then
				MMX_SUPPORT="no"
			else
				as_minor=`echo $as_ver |cut -d. -f2`
				if test $as_minor -ge 10
				then
					MMX_SUPPORT="yes"
				else
					MMX_SUPPORT="no"
				fi
			fi
		fi
	fi
	AC_MSG_RESULT($MMX_SUPPORT)
	;;
*)
	dnl No MMX support on non-x86 architecture toolchains
	MMX_SUPPORT="no"
  ;;
esac

dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_TIME
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"

dnl check if the assembler supports SSE instructions
AC_MSG_CHECKING([for x86 SSE instructions])
AC_CACHE_VAL(ac_cv_x86_sse,
[
AC_TRY_COMPILE(,
[
#if defined(__GNUC__) && defined(__i386__)
__asm__("movups %xmm0, (%esp)");
#else
#error Not gcc on x86
#endif
],
ac_cv_x86_sse=yes,
ac_cv_x86_sse=no)
])
AC_MSG_RESULT($ac_cv_x86_sse)
if test "x$ac_cv_x86_sse" = "xyes"; then
	    AC_DEFINE(HAVE_X86_SSE,1,
		        [Define if your assembler supports x86 SSE instructions])
fi

AC_DEFUN([KDE_CHECK_OGGVORBIS],
[
  have_oggvorbis=yes

  KDE_CHECK_LIB(ogg, ogg_page_version,
    [:], [have_oggvorbis=no])

  KDE_CHECK_HEADER(vorbis/vorbisfile.h,
    [:], [have_oggvorbis=no])

  KDE_CHECK_LIB(vorbis, vorbis_info_init,
    [:], [have_oggvorbis=no])

  KDE_CHECK_LIB(vorbisfile, ov_open,
    [:], [have_oggvorbis=no], -lvorbis -logg)

  KDE_CHECK_LIB(vorbisenc, vorbis_encode_init,
    [:], [have_oggvorbis=no], -lvorbis -logg)

  KDE_CHECK_LIB(vorbisenc, vorbis_bitrate_addblock,
    [have_vorbis_value=2], [have_vorbis_value=1])

  if test "x$have_oggvorbis" = xyes; then
    # for akode/plugins/xiph_decoder/ kioslave/audiocd/plugins/ and krec/ogg_export/
    VORBIS_LIBS="-lvorbis -logg"
    VORBISFILE_LIBS="-lvorbisfile"
    VORBISENC_LIBS="-lvorbisenc"

    # for akode/plugins/xiph_decoder/
    AC_DEFINE_UNQUOTED(HAVE_OGG_VORBIS, 1, [Define if you have ogg/vorbis installed])

    # for kioslave/audiocd/plugins/ and krec/ogg_export/
    AC_DEFINE_UNQUOTED(HAVE_VORBIS, $have_vorbis_value, [Define if you ogg/vorbis installed])

    # for mpeglib/
    OGG_VORBISLIBS="-lvorbisfile -lvorbis -logg"
    AC_DEFINE(OGG_VORBIS, 1, [Define if you have ogg/vorbis installed])
  fi

  AC_SUBST(VORBIS_LIBS)
  AC_SUBST(VORBISFILE_LIBS)
  AC_SUBST(VORBISENC_LIBS)
])

AC_DEFUN([KDE_CHECK_OSSAUDIO],
[
  have_ossaudio=no

  AC_CHECK_HEADERS([soundcard.h sys/soundcard.h],
    [have_ossaudio=yes])

  AC_CHECK_LIB(ossaudio, _oss_ioctl,
    [:], [have_ossaudio=no])

  if test "x$have_ossaudio" = xyes; then
    # for kmix/ and akode/
    LIBOSSAUDIO="-lossaudio"
  fi

  AC_SUBST(LIBOSSAUDIO)
])

AC_DEFUN([KDE_CHECK_ALSA],
[
  have_alsa=no

  AC_CHECK_HEADERS([sys/asoundlib.h alsa/asoundlib.h],
    [have_alsa=yes])

  AC_CHECK_LIB(asound, snd_seq_create_simple_port,
    [:], [have_alsa=no])

  AC_LANG_SAVE
  AC_LANG_C
  if test "x$have_alsa" = xyes; then
    AC_TRY_COMPILE([
      #include "confdefs.h"
      #ifdef HAVE_SYS_ASOUNDLIB_H
      #include <sys/asoundlib.h>
      #endif
      #ifdef HAVE_ALSA_ASOUNDLIB_H
      #include <alsa/asoundlib.h>
      #endif
    ],[
      #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
        /* we have ALSA 0.5.x */
      #else
        #error not ALSA 0.5.x
      #endif
    ],
    have_alsa_0_5=yes)

    AC_TRY_COMPILE([
      #include "confdefs.h"
      #ifdef HAVE_SYS_ASOUNDLIB_H
      #include <sys/asoundlib.h>
      #endif
      #ifdef HAVE_ALSA_ASOUNDLIB_H
      #include <alsa/asoundlib.h>
      #endif
    ],[
      #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
        /* we have ALSA 0.9.x */
      #else
        #error not ALSA 0.9.x
      #endif
    ],
    have_alsa_0_9=yes)

    AC_TRY_COMPILE([
      #include "confdefs.h"
      #ifdef HAVE_SYS_ASOUNDLIB_H
      #include <sys/asoundlib.h>
      #endif
      #ifdef HAVE_ALSA_ASOUNDLIB_H
      #include <alsa/asoundlib.h>
      #endif
    ],[
      #if (SND_LIB_MAJOR == 1)
        /* we have ALSA 1.x */
      #else
        #error not ALSA 1.x
      #endif
    ],
    have_alsa_1=yes)
  fi
  AC_LANG_RESTORE

  if test "x$have_alsa_0_9" = xyes || test "x$have_alsa_1" = xyes; then
    # for kmix/ and akode/
    LIBASOUND="-lasound"
    AC_DEFINE(HAVE_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])

    # for arts/
    ARTS_LIBASOUND="-lasound"
    AC_DEFINE(HAVE_ARTS_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
  fi

  if test "x$have_alsa_0_5" = xyes; then
    # for arts/
    ARTS_LIBASOUND="-lasound"
    AC_DEFINE(HAVE_ARTS_LIBASOUND, 1, [Define if you have libasound.so.1 (required for ALSA 0.5.x support)])
  fi

  AC_SUBST(LIBASOUND)
  AC_SUBST(ARTS_LIBASOUND)
])

AC_DEFUN([KDE_CHECK_CDPARANOIA],
[
  have_cdparanoia=yes

  if test -z "$CDPARANOIA"; then
    KDE_FIND_PATH(cdparanoia, CDPARANOIA, [/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin])
  fi

  if test -z "$CDPARANOIA"; then
    have_cdparanoia=no
  fi

  KDE_CHECK_HEADER(cdda_interface.h,
    [:], [have_cdparanoia=no])

  # Older versions of FreeBSD's cdparanoia lack cdrom_drive.cdda_device_name
  AC_MSG_CHECKING([for cdrom_drive.cdda_device_name in cdda_interface.h])
  kde_save_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS $all_includes"
  AC_LANG_SAVE
  AC_LANG_C
  AC_TRY_COMPILE([
    #include <cdda_interface.h>
    ],
    [
        struct cdrom_drive device;
        device.cdda_device_name = 0;
    ],
    [
        AC_MSG_RESULT([yes])
    ], [
        AC_MSG_RESULT([no])
        have_cdparanoia=no
    ])
  AC_LANG_RESTORE
  CPPFLAGS=$kde_save_CPPFLAGS

  KDE_CHECK_LIB(cdda_paranoia, paranoia_init,
    [:], [have_cdparanoia=no], [-lcdda_interface -lm])

  # because of the horrible hack we need shared cdparanoia
  for ext in so sl la a; do
    AC_FIND_FILE(libcdda_paranoia.$ext, $kde_libraries /usr/lib /usr/local/lib,
      para_libdir)
    if test -r $para_libdir/libcdda_paranoia.$ext; then
      if test $ext = a && ls "$para_libdir" | grep "^libcdda_paranoia.so.*" 2>&1 >/dev/null; then
        ext=so
      fi
      break
    fi
  done
  if test "$ext" = la; then
      grep "^library_names='.*[a-z].*'" $para_libdir/libcdda_paranoia.$ext 2>&1 > /dev/null || have_cdparanoia_only_static=yes
  fi
  if test "$ext" = a; then
    have_cdparanoia_only_static=yes
  fi

  if test "x$have_cdparanoia" = xyes; then
    # for kioslave/audiocd/
    CDPARANOIA_LIBS="-lcdda_paranoia -lcdda_interface -lm"

    # for mpeglib/
    CDDALIBS="-lcdda_paranoia -lcdda_interface -lm"
    AC_DEFINE(CDDA_PARANOIA, 1, [Define if you have cdparanoia installed])
  fi

  if test "x$have_cdparanoia_only_static" = xyes; then
    # for kioslave/audiocd/
    AC_DEFINE_UNQUOTED(CDPARANOIA_STATIC, 1, [Define if you only have a static cdparanoia])
  fi

  AC_SUBST(CDPARANOIA_LIBS)
])

AC_DEFUN([KDE_CHECK_LAME],
[
  have_lame=yes

  KDE_CHECK_HEADER(lame/lame.h,
    [:], [have_lame=no])

  KDE_CHECK_LIB(mp3lame, lame_init,
    [:], [have_lame=no], [-lm])

  if test "x$have_lame" = xyes; then
    # for krec/mp3_export/ (kioslave/audiocd/ uses the lame binary at runtime)
    LAME_LIBS="-lmp3lame -lm"
  fi

  AC_SUBST(LAME_LIBS)
])

AC_DEFUN([KDE_CHECK_TAGLIB],
[
  AC_PATH_PROG(TAGLIB_CONFIG, taglib-config, [no], [$PATH:$prefix/bin])

  if test "x$TAGLIB_CONFIG" != xno; then
    AC_DEFINE(HAVE_TAGLIB, 1, [define if you have TagLib])
    taglib_includes=`$TAGLIB_CONFIG --cflags`
    taglib_libs=`$TAGLIB_CONFIG --libs`
    have_taglib=yes
  else
    taglib_includes=""
    taglib_libs=""
    have_taglib=no
  fi

  KDE_CHECK_HEADER(taglib/mpcfile.h, have_taglib_mpc=yes, have_taglib_mpc=no)

  AC_SUBST(taglib_includes)
  AC_SUBST(taglib_libs)
])

AC_DEFUN([KDE_CHECK_AKODE],
[
  AC_PATH_PROG(AKODE_CONFIG, akode-config, [no], [$PATH:$prefix/bin])

  if test "x$AKODE_CONFIG" != xno; then
    AC_DEFINE(HAVE_AKODE, 1, [define if you have aKodelib installed])
    akode_includes=`$AKODE_CONFIG --cflags`
    akode_libs=`$AKODE_CONFIG --libs`
    have_akode=yes
  else
    akode_includes=""
    akode_libs=""
    have_akode=no
  fi

  AC_SUBST(akode_includes)
  AC_SUBST(akode_libs)

  KDE_CHECK_LIB(akode_mpeg_decoder,   mpeg_decoder,   have_akode_mpeg=yes,   have_akode_mpeg=no,   -lakode)
  KDE_CHECK_LIB(akode_mpc_decoder,    mpc_decoder,    have_akode_mpc=yes,    have_akode_mpc=no,    -lakode)
  KDE_CHECK_LIB(akode_xiph_decoder,   xiph_decoder,   have_akode_xiph=yes,   have_akode_xiph=no,   -lakode)
  KDE_CHECK_LIB(akode_ffmpeg_decoder, ffmpeg_decoder, have_akode_ffmpeg=yes, have_akode_ffmpeg=no, -lakode)

  AM_CONDITIONAL(include_akode_mpeg,   test x$have_akode_mpeg = xyes)
  AM_CONDITIONAL(include_akode_mpc,    test x$have_akode_mpc = xyes)
  AM_CONDITIONAL(include_akode_xiph,   test x$have_akode_xiph = xyes)
  AM_CONDITIONAL(include_akode_ffmpeg, test x$have_akode_ffmpeg = xyes)

])


AC_DEFUN([KDE_CHECK_MPEGLIB_ARTS],
[
  MPEGLIB_ARTS_MAJOR_VERSION=0
  MPEGLIB_ARTS_MINOR_VERSION=3
  MPEGLIB_ARTS_MICRO_VERSION=0

  MPEGLIB_ARTS_VERSION=$MPEGLIB_ARTS_MAJOR_VERSION.$MPEGLIB_ARTS_MINOR_VERSION.$MPEGLIB_ARTS_MICRO_VERSION

  AC_SUBST(MPEGLIB_ARTS_MAJOR_VERSION)
  AC_SUBST(MPEGLIB_ARTS_MINOR_VERSION)
  AC_SUBST(MPEGLIB_ARTS_MICRO_VERSION)
  AC_SUBST(MPEGLIB_ARTS_VERSION)

  dnl build search PATH
  artsc_config_test_path=$prefix/bin:$exec_prefix/bin:$KDEDIR/bin:$PATH
  AC_PATH_PROG(kde_artsplug_compiles,artsc-config,no,$artsc_config_test_path)

  dnl if we found it here set variable
  if test x$kde_artsplug_compiles != xno; then
    ARTSCCONFIG=$kde_artsplug_compiles;
    kde_artsplug_compiles=yes
  fi

  dnl this is needed for a standalone mpeglib
  dnl it should compile without KDE installed
  dnl but if we find arts we need the include
  dnl path for it.

  if test x$kde_artsplug_compiles = xyes; then
    ARTSC_INCLUDE=`${ARTSCCONFIG} --cflags`
    AC_MSG_RESULT([arts includes... $ARTSC_INCLUDE])
    AC_SUBST(ARTSC_INCLUDE)
    ARTSC_LIBS=`${ARTSCCONFIG} --libs`
    AC_MSG_RESULT([arts libraries... $ARTSC_LIBS])
    AC_SUBST(ARTSC_LIBS)
    AC_SUBST(LIBDL)
  fi

  if test x$kde_mpeglib_compiles = xno; then
    AC_MSG_RESULT([** mpeglib disabled we disable artsplug **])
    kde_artsplug_compiles=no;
    fi

  if test x$kde_artsplug_compiles = xno; then
    AC_MSG_RESULT([** DO NOT COMPILE mpeglib_artsplug **])
    DO_NOT_COMPILE="$DO_NOT_COMPILE mpeglib_artsplug"
  fi
])dnl KDE_CHECK_MPEGLIB_ARTS

AC_TYPE_SIGNAL

AC_ARG_WITH(vorbis,
  [AC_HELP_STRING(--with-vorbis,
    [enable support for Ogg Vorbis @<:@default=check@:>@])],
  [], with_vorbis=check)

have_oggvorbis=no
if test "x$with_vorbis" != xno; then
  KDE_CHECK_OGGVORBIS

  if test "x$with_vorbis" != xcheck && test "x$have_oggvorbis" != xyes; then
    AC_MSG_ERROR([--with-vorbis was given, but test for Ogg Vorbis failed])
  fi
fi

# for krec/ogg_export
AM_CONDITIONAL(compile_ogg_export, test "x$have_oggvorbis" = xyes)

if test "x$kde_mpeglib_compiles" = xyes -o "x$have_oggvorbis" = xno; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE oggvorbis_artsplugin"
fi

AC_ARG_WITH(ossaudio,
  [AC_HELP_STRING(--with-ossaudio,
    [enable support for OpenBSD ossaudio @<:@default=check@:>@])],
  [], with_ossaudio=check)

if test "x$with_ossaudio" != xno; then
  KDE_CHECK_OSSAUDIO

  if test "x$with_ossaudio" != xcheck && test "x$have_ossaudio" != xyes; then
    AC_MSG_ERROR([--with-ossaudio was given, but test for ossaudio failed])
  fi
fi

AC_ARG_WITH(alsa,
  [AC_HELP_STRING(--with-alsa,
    [enable support for ALSA @<:@default=check@:>@])],
  [], with_alsa=check)

have_alsa=no
if test "x$with_alsa" != xno; then
  KDE_CHECK_ALSA

  if test "x$with_alsa" != xcheck && test "x$have_alsa" != xyes; then
    AC_MSG_ERROR([--with-alsa was given, but test for ALSA failed])
  fi
fi

AC_ARG_WITH(cdparanoia,
  [AC_HELP_STRING(--with-cdparanoia,
    [enable support for CD ripping thorugh cdparanoia @<:@default=check@:>@])],
  [], with_cdparanoia=check)

have_cdparanoia=no
if test "x$with_cdparanoia" != xno; then
  KDE_CHECK_CDPARANOIA

  if test "x$with_cdparanoia" != xcheck && test "x$have_cdparanoia" != xyes; then
    AC_MSG_ERROR([--with-cdparanoia was given, but test for cdparanoia failed])
  fi
fi

# for kioslave/audiocd/
AM_CONDITIONAL(include_kioslave_audiocd, test "x$have_cdparanoia" = xyes)
AM_CONDITIONAL(include_kcm_audiocd, test "x$have_cdparanoia" = xyes)
if test "x$have_cdparanoia" != xyes; then
    # kaudiocreator depends on kio_audiocd
    DO_NOT_COMPILE="$DO_NOT_COMPILE kaudiocreator"
fi

AC_ARG_WITH(lame,
  [AC_HELP_STRING(--with-lame,
    [enable support for MP3 encoding thorugh lame @<:@default=check@:>@])],
  [], with_lame=check)

have_lame=no
if test "x$with_lame" != xno; then
  KDE_CHECK_LAME

  if test "x$with_lame" != xcheck && test "x$have_lame" != xyes; then
    AC_MSG_ERROR([--with-lame was given, but test for lame failed])
  fi
fi

# for krec/mp3_export
AM_CONDITIONAL(compile_mp3_export, test "x$have_lame" = xyes)

AC_ARG_WITH(taglib,
  [AC_HELP_STRING(--with-taglib,
    [enable support for TagLib @<:@default=check@:>@])],
  [], with_taglib=check)

have_taglib=no
have_taglib_mpc=no
if test "x$with_taglib" != xno; then
  KDE_CHECK_TAGLIB

  if test "x$with_taglib" != xcheck && test "x$have_taglib" != xyes; then
    AC_MSG_ERROR([--with-taglib was given, but test for TagLib failed])
  fi
fi

AC_ARG_WITH(akode,
    [AC_HELP_STRING([--with-akode],
        [enable the aKode decoder @<:@default=check@:>@])],
    [], with_akode=check)

have_akode=no
if test "x$with_akode" != xno; then
  KDE_CHECK_AKODE

  if test "x$with_akode" != xcheck && test "x$have_akode" != xyes; then
    AC_MSG_ERROR([--with-akode was given, but test for aKode failed])
  fi
fi

KDE_CHECK_MPEGLIB_ARTS
dnl =======================================================
dnl FILE: ./akode_artsplugin/configure.in.in
dnl =======================================================

if test x$build_arts != xyes || test x$have_akode != xyes
then
DO_NOT_COMPILE="$DO_NOT_COMPILE akode_artsplugin"
fi
dnl =======================================================
dnl FILE: ./arts/configure.in.in
dnl =======================================================


if test "x$build_arts" = "xno"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE arts"
fi

dnl Find aRts using artsc-config
AC_DEFUN([AC_FIND_ARTS],
[
	AC_PATH_PROG(ARTSCCONFIG, artsc-config, no)
	if test "x$ARTSCCONFIG" = "xno" ; then
		AC_MSG_ERROR(Cannot find artsc-config - missing from path?)
	fi
	ARTSDIR=[`$ARTSCCONFIG --arts-prefix`]
])

KDE_CHECK_THREADING

dnl Check if we are building as part of KDE. 

AC_MSG_CHECKING(if building standalone aRts snapshot without KDE)
if test "$DCOPIDL" = ""; then
	AC_MSG_RESULT(yes)

	AC_FIND_ARTS

	dnl find mcopidl
	MCOPIDL="$ARTSDIR/bin/mcopidl"
	AC_SUBST(MCOPIDL)

	dnl fake KDE_RPATH, moc, uic
	KDE_RPATH=""
	MOC=true
	UIC=true
	AC_SUBST(KDE_RPATH)
	AC_SUBST(MOC)
	AC_SUBST(UIC)

	dnl variables
	arts_datadir="$ARTSDIR/share"
	arts_includes="$ARTSDIR/include/arts"
	arts_libraries="$ARTSDIR/lib"
	ARTS_BUILD_KDE=""
	ARTS_BUILD_KDE_GUI=""
else
	AC_MSG_RESULT(no)

	dnl variables
	arts_datadir="$kde_datadir"
	arts_includes="$kde_includes/arts"
	arts_libraries="$kde_libraries"

	dnl conditional build some things
	ARTS_BUILD_KDE="builder tools"
	ARTS_BUILD_KDE_GUI="kde"
fi

AC_SUBST(arts_datadir)
AC_SUBST(arts_includes)
AC_SUBST(arts_libraries)
AM_CONDITIONAL(arts_within_KDE, test -n "$ARTS_BUILD_KDE")
dnl =======================================================
dnl FILE: ./audiofile_artsplugin/configure.in.in
dnl =======================================================

if test "x$build_arts" = "xno"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE audiofile_artsplugin"
fi

dnl libaudiofile is used for loading wave files
AC_DEFUN([AC_CHECK_LIBAUDIOFILE],
[
  ac_ldflags_save="$LDFLAGS"
  ac_CPPFLAGS_save="$CPPFLAGS"
  LDFLAGS="$all_libraries $LDFLAGS"
  CPPFLAGS="$CPPFLAGS $all_includes"
  arts_audiolib_found=no
  dnl WAV reading
  AC_LANG_SAVE
  AC_LANG_C
  kde_has_audio_lib=no
  AC_CHECK_HEADER(audiofile.h,
  [ 
     kde_has_audio_lib=yes
    ])
  if test "x$kde_has_audio_lib" = "xyes"; then
      KDE_CHECK_LIB(audiofile,afOpenFile,[
      dnl LDFLAGS in case it's in KDEDIR/lib
      LIBAUDIOFILE="$LDFLAGS -laudiofile"
      AC_DEFINE(HAVE_LIBAUDIOFILE, 1,
        [Define if you have libaudiofile (required for playing wavs with aRts)])
      arts_audiolib_found=yes
      ])
  fi
  AC_SUBST(LIBAUDIOFILE)
  AC_LANG_RESTORE
  CPPFLAGS="$ac_CPPFLAGS_save"
  LDFLAGS="$ac_ldflags_save"
])

AC_ARG_WITH(audiofile,
  [AC_HELP_STRING(--with-audiofile,
    [enable support for audiofile @<:@default=check@:>@])],
  [], with_audiofile=check)

arts_audiolib_found=no
if test "x$with_audiofile" != xno; then
  AC_CHECK_LIBAUDIOFILE

  if test "x$with_audiofile" != xcheck && test "x$arts_audiolib_found" != xyes; then
    AC_MSG_ERROR([--with-audiofile was given, but test for audiofile failed])
  fi
fi

if test x$arts_audiolib_found = xno; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE audiofile_artsplugin"
fi
dnl =======================================================
dnl FILE: ./juk/configure.in.in
dnl =======================================================

#MIN_CONFIG(3)

dnl PACKAGE set before

artsc_config_test_path=$prefix/bin:$exec_prefix/bin:$KDEDIR/bin:$PATH
AC_PATH_PROG(ARTSCCONFIG, artsc-config, no, $artsc_config_test_path)

if test "x$build_arts" = "xyes" && test "x$ARTSCCONFIG" != "xno" ; then
	LIB_ARTS="-lartskde"
	ARTS_PREFIX=[`$ARTSCCONFIG --arts-prefix`]
	ARTS_CFLAGS="-I$ARTS_PREFIX/include/arts"
	AC_DEFINE(HAVE_ARTS, 1, [have arts support in juk])
else
	build_arts="no"
	LIB_ARTS=""
	ARTS_CFLAGS=""
	AC_DEFINE(HAVE_ARTS, 0, [no arts support in juk])
fi

AC_SUBST(LIB_ARTS)
AC_SUBST(ARTS_CFLAGS)

AC_ARG_WITH(musicbrainz,
  	[AC_HELP_STRING(--with-musicbrainz,
	[enable support for MusicBrainz @<:@default=check@:>@])],
	[], with_musicbrainz=check)

have_musicbrainz=no

if test "x$with_musicbrainz" != xno; then
  	KDE_CHECK_HEADER(tunepimp/tp_c.h, have_musicbrainz=yes)

  	if test "x$with_musicbrainz" != xcheck && test "x$have_musicbrainz" != xyes; then
    		AC_MSG_ERROR([--with-musicbrainz was given, but test for MusicBrainz failed])
  	fi
fi

if test "x$have_musicbrainz" = xyes; then
  	AC_CHECK_LIB(tunepimp, tp_SetFileNameEncoding,
	AC_DEFINE(HAVE_MUSICBRAINZ, 4, [have MusicBrainz 0.4.x]), 
	AC_DEFINE(HAVE_MUSICBRAINZ, 1, [have MusicBrainz]))
else
  	AC_DEFINE(HAVE_MUSICBRAINZ, 0, [have MusicBrainz])
fi

AM_CONDITIONAL(link_lib_MB, test "x$have_musicbrainz" = xyes)

AC_ARG_WITH(gstreamer,
  	[AC_HELP_STRING(--with-gstreamer,
    	[enable support for GStreamer @<:@default=check@:>@])],
	[], with_gstreamer=check)

have_gst=no

if test "x$with_gstreamer" != xno; then
  	# pkg-config seems to have a bug where it masks needed -L entries when it
	# shouldn't, so disable that.

  	PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
	export PKG_CONFIG_ALLOW_SYSTEM_LIBS

	GST_MAJORMINOR=0.10
	GST_REQ=0.10.0
	GST_VERSION=10

	PKG_CHECK_MODULES(GST, \
		gstreamer-$GST_MAJORMINOR >= $GST_REQ, \
		have_gst=yes, have_gst=no)

	if test "x$have_gst" != xyes; then

		GST_MAJORMINOR=0.8
		GST_REQ=0.8.0
		GST_VERSION=8

		PKG_CHECK_MODULES(GST, \
			gstreamer-$GST_MAJORMINOR >= $GST_REQ, \
			have_gst=yes, have_gst=no)
	fi

	if test "x$with_gstreamer" != xcheck && test "x$have_gst" != xyes; then
		AC_MSG_ERROR([--with-gstreamer was given, but test for GStreamer failed])
	fi
fi

if test "x$have_gst" = "xno"; then
	GST_CFLAGS=""
	LDADD_GST=""
	LDFLAGS_GST=""
	AC_DEFINE(HAVE_GSTREAMER, 0, [have GStreamer])
else
	LDADD_GST=`$PKG_CONFIG --libs-only-l gstreamer-$GST_MAJORMINOR`
	LDFLAGS_GST=`$PKG_CONFIG --libs-only-other gstreamer-$GST_MAJORMINOR`

	# Append -L entries, since they are masked by --libs-only-l and
	# --libs-only-other
	LIBDIRS_GST=`$PKG_CONFIG --libs-only-L gstreamer-$GST_MAJORMINOR`
	LDADD_GST="$LDADD_GST $LIBDIRS_GST"

	AC_MSG_NOTICE([GStreamer version >= $GST_REQ found.])
	AC_DEFINE(HAVE_GSTREAMER, 1, [have GStreamer])
	AC_DEFINE_UNQUOTED(GSTREAMER_VERSION, $GST_VERSION, [GStreamer Version])
fi

AC_SUBST(GST_CFLAGS)
AC_SUBST(LDADD_GST)
AC_SUBST(LDFLAGS_GST)

if test "x$have_taglib" != xyes || ( test "x$build_arts" = "xno" && test "x$have_gst" = "xno" && test "x$have_akode" = "xno") ; then
	DO_NOT_COMPILE="$DO_NOT_COMPILE juk"
fi
dnl =======================================================
dnl FILE: ./kaboodle/configure.in.in
dnl =======================================================

if test "x$build_arts" = "xno"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE kaboodle"
fi

dnl =======================================================
dnl FILE: ./kaudiocreator/configure.in.in
dnl =======================================================

dnl =======================================================
dnl FILE: ./kfile-plugins/flac/configure.in.in
dnl =======================================================

AM_CONDITIONAL(include_flac_SUBDIR, test "x$have_taglib" = xyes)
dnl =======================================================
dnl FILE: ./kfile-plugins/mp3/configure.in.in
dnl =======================================================

AM_CONDITIONAL(include_mp3_SUBDIR, test "x$have_taglib" = xyes)
dnl =======================================================
dnl FILE: ./kfile-plugins/mpc/configure.in.in
dnl =======================================================

AM_CONDITIONAL(include_mpc_SUBDIR, test "x$have_taglib_mpc" = xyes)
dnl =======================================================
dnl FILE: ./kfile-plugins/ogg/configure.in.in
dnl =======================================================

AM_CONDITIONAL(include_ogg_SUBDIR, test "x$have_oggvorbis" = xyes)
dnl =======================================================
dnl FILE: ./kfile-plugins/theora/configure.in.in
dnl =======================================================

AC_DEFUN([KDE_CHECK_THEORA],
[
have_theora=yes

KDE_CHECK_HEADER(theora/theora.h,
  [], [have_theora=no])

KDE_CHECK_LIB(theora, theora_info_init,
  [], [have_theora=no], [-lvorbis -logg])
])

AC_ARG_WITH(theora,
  [AC_HELP_STRING(--with-theora,
    [enable support for Ogg Theora @<:@default=check@:>@])],
  [], with_theora=check)

have_theora=no
if test "x$with_theora" != xno; then
  KDE_CHECK_THEORA

  if test "x$with_theora" != xcheck && test "x$have_theora" != xyes; then
    AC_MSG_ERROR([--with-theora was given, but test for Theora failed])
  fi
fi

AM_CONDITIONAL(include_theora_SUBDIR, test "x$have_theora" = xyes)
dnl =======================================================
dnl FILE: ./kioslave/audiocd/configure.in.in
dnl =======================================================

AC_DEFUN([AC_CHECK_LIBFLAC],
[
  AC_LANG_SAVE
  AC_LANG_C
  have_libFLAC=no
  KDE_CHECK_HEADER(FLAC/metadata.h,
  [
     KDE_CHECK_LIB(FLAC,FLAC__seekable_stream_decoder_process_single,
	          have_libFLAC=yes)

    ])
  if test "x$have_libFLAC" = "xyes"; then
      LIBFLAC="-lFLAC"
      AC_DEFINE(HAVE_LIBFLAC, 1,
        [Define if you have libFLAC (required for loading FLAC files)])
  fi
  AC_SUBST(LIBFLAC)
  AC_LANG_RESTORE
])

AC_DEFUN([AC_CHECK_LIBOGGFLAC],
[
  AC_LANG_SAVE
  AC_LANG_C
  have_libOggFLAC=no
  KDE_CHECK_HEADER(OggFLAC/seekable_stream_decoder.h,
  [
     KDE_CHECK_LIB(OggFLAC,OggFLAC__seekable_stream_decoder_process_single,
	          have_libOggFLAC=yes,,[-lm -lOggFLAC -lFLAC])

    ])
  if test "x$have_libOggFLAC" = "xyes"; then
      LIBOGGFLAC="-lOggFLAC"
      AC_DEFINE(HAVE_LIBOGGFLAC, 1,
        [Define if you have libOggFLAC (required for loading OggFLAC files)])
  fi
  AC_SUBST(LIBOGGFLAC)
  AC_LANG_RESTORE
])

AC_ARG_WITH(flac,AC_HELP_STRING([--with-flac],[Enable FLAC support @<:@default=check@:>@]),[flac_test="$withval"],[flac_test="yes"])

if test "x$flac_test" = "xyes" ; then
  AC_CHECK_LIBFLAC
  AC_CHECK_LIBOGGFLAC
fi
dnl =======================================================
dnl FILE: ./kmid/configure.in.in
dnl =======================================================

KDE_CHECK_HEADER([libkmid/libkmid.h], [kde_mid_compiles=yes], [kde_mid_compiles=no])
if test $kde_mid_compiles = no; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE kmid"
fi

dnl =======================================================
dnl FILE: ./kmix/configure.in.in
dnl =======================================================

dnl =======================================================
dnl FILE: ./krec/configure.in.in
dnl =======================================================

if test "x$build_arts" = "xno"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE krec"
fi
dnl =======================================================
dnl FILE: ./kscd/configure.in.in
dnl =======================================================

dnl +-------------------------+
dnl |   Checks for KSCD       |   
dnl +-------------------------+
AC_CHECK_LIB(cdaudio, main, [LIBCDAUDIO="-lcdaudio -lmediad -lds"],[],[-lmedia -lds]) dnl for Irix
AC_SUBST(LIBCDAUDIO)
AC_CHECK_LIB(fpe, main, [LIBFPE="-lfpe"]) dnl for Irix CDDA
AC_SUBST(LIBFPE) dnl for Irix CDDA
AC_CHECK_LIB(cdrom, main, [LIBCDROM="-lcdrom"],[],[-lcdrom]) dnl for kscd FreeBSD
AC_SUBST(LIBCDROM)

dnl Checks for libraries.
dnl added by wuebben Nov 27 1997
AC_CHECK_LIB(Alib, main, [LIBALIB="-lAlib"]) dnl HP-UX network audio server
AC_SUBST(LIBALIB)
AC_CHECK_LIB(audio,main,[LIBAUDIO="-laudio"]) dnl SunOS audio driver
AC_SUBST(LIBAUDIO)
AC_CHECK_LIB(mme, main, [LIBMME="-lmme";EXTRAINCS="-I/usr/include/mme"]) dnl DEC MMS audio server
AC_SUBST(LIBMME)

AC_SUBST(EXTRAINCS)
AC_SUBST(EXTRALIBS) 

AC_ARG_ENABLE(kscd-defaults,[  --enable-kscd-defaults  use kscd default configs [default=yes]],
[
if test $enableval = "no"; dnl
  then use_kscd_defaults="no"
  else use_kscd_defaults="yes"
fi
], use_kscd_defaults="yes"
)

AC_DEFUN([KDE_COPY_KSCD_DEFAULTS],
[
if echo $TOPSUBDIRS | grep "kscd" > /dev/null 2> /dev/null; then
  if test "$use_kscd_defaults" = "yes"; then
    test -d kscd || mkdir kscd
    cp $srcdir/kscd/config.h.std kscd/config.h
  else
    cd kscd && $srcdir/kscd-script
    cd $topdir
  fi
fi 
])

AC_OUTPUT_COMMANDS(KDE_COPY_KSCD_DEFAULTS)

dnl +-------------------------+
dnl | End KSCD checks         |
dnl +-------------------------+

AC_MSG_CHECKING(if kscd can be compiled)
case "$host" in
  *-*-linux*) kscd_compile=yes;;
  *-*-*bsdi*) kscd_compile=yes;; 
  *-*-*freebsd*) kscd_compile=yes;;
  *-*-*netbsd*) kscd_compile=yes;;
  *-*-*openbsd*) kscd_compile=yes;;
  *) kscd_compile=yes;;
esac
AC_MSG_RESULT($kscd_compile)
if test "$kscd_compile" = "no"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE kscd"
fi

if test "x$build_arts" != "xno"; then
  AC_DEFINE_UNQUOTED(USE_ARTS, 1, [Define if aRts is available])
fi

dnl =======================================================
dnl FILE: ./kscd/libwm/configure.in.in
dnl =======================================================

dnl +-------------------------------+
dnl |   Checks for LIBWORKMAN       |
dnl +-------------------------------+
AC_MSG_CHECKING(for CDDA)

AC_ARG_WITH(kscd-cdda, [  --with-kscd-cdda             build CDDA support in kscd [default=yes]],
[
  if test $withval = yes; then
    libwm_with_cdda=yes
  else
    libwm_with_cdda=no
  fi
],libwm_with_cdda=yes)

if test "$libwm_with_cdda" = "yes"; then
case $host in
  *-*-linux*)
  AC_CHECK_HEADERS(pthread.h)
  AC_TRY_COMPILE(
  [
#define asm __asm__
#include <linux/types.h>
#include <linux/cdrom.h>
  ],[
#if defined(__linux__)
ioctl(1, CDROMREADAUDIO, 0);
#else
  #error platform?
#endif
  ],, libwm_with_cdda=no)
  ;;
  *-*-sunos*)
  AC_CHECK_HEADERS(pthread.h)
  AC_TRY_COMPILE(
  [
#include <sys/types.h>
#include <sys/cdio.h>
  ],[
#if defined(__sun) || defined(sun)
ioctl(1, CDROMCDDA, 0);
#else
  #error platform?
#endif
  ],, libwm_with_cdda=no)
  ;;
  *)
      libwm_with_cdda=no
  ;;
esac
fi

if test "$libwm_with_cdda" = "yes"; then
    AC_DEFINE(BUILD_CDDA, 1, [Define if you will CDDA support in kscd])
fi
AM_CONDITIONAL(libwm_with_cdda, test "$libwm_with_cdda" = "yes")

AC_MSG_RESULT($libwm_with_cdda)


dnl +-------------------------------+
dnl | End LIBWORKMAN checks         |
dnl +-------------------------------+
dnl =======================================================
dnl FILE: ./mpeglib/configure.in.in
dnl =======================================================

dnl ***** end of KDE specific configure things *********
dnl [START]   for mpeglib checks


THIS_LIB_MAJOR_VERSION=0
THIS_LIB_MINOR_VERSION=3
THIS_LIB_MICRO_VERSION=0
THIS_LIB_NAME=mpeglib
THIS_LIB_VERSION=$THIS_LIB_MAJOR_VERSION.$THIS_LIB_MINOR_VERSION.$THIS_LIB_MICRO_VERSION

AC_SUBST(THIS_LIB_MAJOR_VERSION)
AC_SUBST(THIS_LIB_MINOR_VERSION)
AC_SUBST(THIS_LIB_MICRO_VERSION)
AC_SUBST(THIS_LIB_VERSION)
AC_SUBST(THIS_LIB_NAME)
dnl this does not work, but to have no errors we subst it



dnl Checks for header files.
AC_CHECK_HEADERS(pthread.h pthread/mit/pthread.h)
AC_CHECK_HEADERS(sys/soundcard.h soundcard.h)


AC_C_BIGENDIAN




dnl AC_C_ATTRIBUTE_ALIGNED
dnl define ATTRIBUTE_ALIGNED_MAX to the maximum alignment if this is supported
AC_DEFUN([AC_C_ATTRIBUTE_ALIGNED],
    [AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
	[ac_cv_c_attribute_aligned],
	[ac_cv_c_attribute_aligned=0
	for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
	    AC_TRY_COMPILE([],
		[static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
		[ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try])
	done])
    if test x"$ac_cv_c_attribute_aligned" != x"0"; then
	AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
	    [$ac_cv_c_attribute_aligned],[maximum supported data alignment])
    fi])

AC_C_ATTRIBUTE_ALIGNED






# later AC_CHECK_LIB is used, which uses ac_save_*, so don't use them
# here
mpg_save_CPPFLAGS="$CPPFLAGS"
mpg_save_LDFLAGS="$LDFLAGS"
mpg_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $X_INCLUDES $USER_INCLUDES"
LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
LIBS="$LIBS $LIB_XEXT -lX11 $X_EXTRA_LIBS"

AC_MSG_CHECKING(for X11 shared mem extension)
x11_shared_mem=no
AC_TRY_COMPILE([
                #include <X11/Xlib.h>
                #include <X11/extensions/XShm.h>
                #include <sys/ipc.h>
                #include <sys/shm.h>
                ],[
                ],[
                x11_shared_mem=yes
                ])
AC_MSG_RESULT($x11_shared_mem)
if test x$x11_shared_mem = xyes; then
   AC_DEFINE(X11_SHARED_MEM,1,[Define if you have X11 shared mem])
fi


AC_MSG_CHECKING(for X11 DGA2.0 extension)
x11_dga2=no
AC_TRY_COMPILE([
                #include <X11/Xlib.h>
                #include <X11/extensions/xf86dga1.h>
                ],[
                ],[
                x11_dga2=yes
                ])
AC_MSG_RESULT($x11_dga2)
if test x$x11_dga2 = xyes; then
   AC_DEFINE(X11_DGA2,1,[Define if you have XFree4.0 DGA 2.0])
   DGALIBS="-lXxf86dga"
fi

AC_MSG_CHECKING(for X11 video extension)
x11_xv=no
AC_TRY_COMPILE([
                #include <X11/Xlib.h>
                #include <X11/extensions/Xvlib.h>
                ],[
                ],[
                x11_xv=yes
                ])
AC_MSG_RESULT($x11_xv)
if test x$x11_xv = xyes; then
   AC_DEFINE(X11_XV,1,[Define if you have XFree4.0 XV extension])
   XVLIBS="-lXv"
fi

AC_MSG_CHECKING(for X11 videomode extension)
x11_xvidmode=no
AC_TRY_COMPILE([
                #include <X11/Xlib.h>
                #include <X11/extensions/xf86vmode.h>
                ],[
                ],[
                x11_xvidmode=yes
                ])
AC_MSG_RESULT($x11_xvidmode)
if test x$x11_xvidmode = xyes; then
   AC_DEFINE(X11_XVIDMODE,1,[Define if you have XVidModeextension])
   XVIDMODELIBS="-lXxf86vm"
fi


dnl
dnl if we do an SDL build we remove now all determined X11 dependencies
dnl

X11_LIBS="-lX11 -lXext"

if test x$disable_x11 = xyes; then
   DGALIBS=""
   XVLIBS=""
   X11_LIBS=""
fi

LIBS="$mpg_save_LIBS"
LDFLAGS="$mpg_save_LDFLAGS"
CPPFLAGS="$mpg_save_CPPFLAGS"

AC_MSG_CHECKING(checking OS)
AC_SUBST(OS_TYPE)
OS_TYPE=`uname -s`
AC_MSG_RESULT($OS_TYPE)

INTELCPPFLAG=
dnl MMX_SUPPORT is set as variable in main configure.in.in
dnl now make it a config.h entry
if test x$MMX_SUPPORT = xyes; then
   AC_DEFINE(INTEL,1,[Define if you have MMX support on x86 with gcc])
   INTELCPPFLAG="-DINTEL"
fi
AC_SUBST(INTELCPPFLAG)

AC_DEFUN([KDE_MPEGLIB_COMPILES],
[
dnl disable everything which is not supported
kde_mpeglib_compiles=no

case "$OS_TYPE" in
  FreeBSD)
    kde_mpeglib_compiles=yes
    ;;
  NetBSD)
    kde_mpeglib_compiles=yes
    ;;
  Linux)
    kde_mpeglib_compiles=yes
    ;;
  AIX)
    kde_mpeglib_compiles=yes
    ;;
  SunOS)
    kde_mpeglib_compiles=yes
    ;;
  *)
    AC_MSG_RESULT([*** We disable mpeglib for this platform ***])
    DO_NOT_COMPILE="$DO_NOT_COMPILE mpeglib mpeglib_artsplug"
    ;;
esac


KDE_CHECK_LIBPTHREAD
case "$OS_TYPE" in
  AIX)
    AC_MSG_RESULT([AIX :Unknown hardware. You will have problems!!])
    AC_DEFINE(OS_AIX,1,[Define if you have AIX for sound])
    ;;

  Linux)
    AC_DEFINE(OS_Linux,1,[Define if you have linux pthread])
    ;;

  FreeBSD)
    OS_TYPE="BSD"
    AC_DEFINE(OS_BSD,1,[Define if you have BSD pthread])
    ;;

  BSD/OS)
    OS_TYPE="BSD"
    AC_DEFINE(OS_BSD,1,[Define if you have BSD pthread in -lc])
    ;;

  NetBSD)
    AC_MSG_RESULT([NetBSD :Unknown hardware. You will have problems!!])
    OS_TYPE="BSD"
    AC_DEFINE(OS_BSD,1,[Define if you have BSD pthread in -lc_r])
    ;;

  SunOS)
    OS_TYPE="SunOS"
    AC_DEFINE(OS_SunOS,1,[Define if you have solaris -lpthread]) 
    ;;

  IRIX)
    AC_MSG_RESULT([IRIX :Unknown hardware. You will have problems!!])
    AC_DEFINE(OS_IRIX,1,[Define if you have iris])
    ;;

  HPUX)
    AC_MSG_RESULT([HPUX :Unknown hardware. You will have problems!!])
    AC_DEFINE(OS_HPUX,1,[Define if you have HP_UX])
    ;;

  *)
    AC_MSG_RESULT([Very Unknown hardware. **Better give up!**])
    ;;

esac

])

KDE_MPEGLIB_COMPILES

THIS_LIB_LIBS="-lX11 -lXext -lm ${XVLIBS} ${DGALIBS} "
THIS_LIB_LIBS="${THIS_LIB_LIBS} ${XVIDMODELIBS} ${SDLLIB} ${CDDALIBS} "
THIS_LIB_LIBS="${THIS_LIB_LIBS} ${OGG_VORBISLIBS} ${LIBPTHREAD}"
AC_SUBST(THIS_LIB_LIBS)
dnl =======================================================
dnl FILE: ./mpeglib/lib/mpegplay/configure.in.in
dnl =======================================================

AM_PROG_AS
dnl =======================================================
dnl FILE: ./mpeglib_artsplug/configure.in.in
dnl =======================================================

if test "x$build_arts" = "xno"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE mpeglib_artsplug"
fi
dnl =======================================================
dnl FILE: ./mpg123_artsplugin/configure.in.in
dnl =======================================================

dnl ============
dnl Machine type
dnl ============
 
ARCH_CFLAGS="$CFLAGS -O2 -funroll-all-loops -finline-functions -ffast-math"

case "$ARCH_TYPE" in
	i486)
		AC_DEFINE(ARCH_486, 1, [WE ARE BUILDING FOR A 486])
		OPTIMIZED_ARCH="YES"
	;;
	i586)
		AC_DEFINE(ARCH_586, 1, [WE ARE BUILDING FOR A PENTIUM])
		OPTIMIZED_ARCH="YES"
	;;
	i686)
		AC_DEFINE(ARCH_686, 1, [WE ARE BUILDING FOR A PPRO])
		OPTIMIZED_ARCH="YES"
		#EXTRA_CPU_CFLAGS=$(if $CC -march=i686 -S -o /dev/null -xc /dev/null > /dev/null; then echo "-march=i686"; fi)
	;;
	ppc)
		AC_DEFINE(ARCH_PPC, 1, [WE ARE BUILDING FOR A POWERPC])
		OPTIMIZED_ARCH="YES"
	;;
	sun4u)
		AC_DEFINE(ARCH_ULTRA, 1, [WE ARE BUILDING FOR A SUN ULTRASPARC])
		# Is there mpg123 optimization for UltraSparc?
	;;
esac

# ARCH_X86
if test "$ARCH_TYPE" = "i486" || test "$ARCH_TYPE" = "i586" || test "$ARCH_TYPE" = "i686"; then
	MPG123_PLAT_LIB="$MPG123_PLAT_LIB libmpx86.la"
fi
# ARCH_486
if test "$ARCH_TYPE" = "i486"; then
	MPG123_PLAT_LIB="$MPG123_PLAT_LIB libmp486.la"
	ARCH_CFLAGS="$ARCH_CFLAGS -DROT_I386 -DI386_ASSEM -DI486_OPT -DLINUX -DREAL_IS_FLOAT"
fi
# ARCH_586
if test "$ARCH_TYPE" = "i586" -a "$MMX_SUPPORT" = "no"; then
        MPG123_PLAT_LIB="$MPG123_PLAT_LIB libmp586.la"
	ARCH_CFLAGS="$ARCH_CFLAGS -DROT_I386 -DI386_ASSEM -DPENTIUM_OPT -DLINUX -DREAL_IS_FLOAT"
fi
# ARCH_586_MMX
if test "$ARCH_TYPE" = "i586" -a "$MMX_SUPPORT" = "yes"; then
	ARCH_CFLAGS="$ARCH_CFLAGS -DROT_I386 -DI386_ASSEM -DPENTIUM_OPT -DLINUX -DREAL_IS_FLOAT"
	MPG123_PLAT_LIB=libmp586mmx.la
fi
# ARCH_686
if test "$ARCH_TYPE" = "i686" -a "$MMX_SUPPORT" = "no"; then
	ARCH_CFLAGS="$ARCH_CFLAGS -DROT_I386 -DI386_ASSEM -DPENTIUM_OPT -DLINUX -DREAL_IS_FLOAT -march=pentiumpro"
	MPG123_PLAT_LIB=libmp686.la
fi
# ARCH_686_MMX
if test "$ARCH_TYPE" = "i686" -a "$MMX_SUPPORT" = "yes"; then
	ARCH_CFLAGS="$ARCH_CFLAGS -DROT_I386 -DI386_ASSEM -DPENTIUM_OPT -DUSE_MMX -DLINUX -DREAL_IS_FLOAT -march=pentiumpro"
	MPG123_PLAT_LIB=libmp686mmx.la
fi
# ARCH_PPC
if test "$ARCH_TYPE" = "ppc"; then
	MPG123_PLAT_LIB=libmpppc.la
fi
# ARCH_ULTRA
if test "$ARCH_TYPE" = "sun4u"; then
	:
	# nothing for now
fi
# ARCH_PLAIN
if test -z "$OPTIMIZED_ARCH"; then
	MPG123_PLAT_LIB=libmpplain.la
fi

AC_SUBST(ARCH_CFLAGS)
AC_SUBST(MPG123_PLAT_LIB)

if test "$kde_mpeglib_compiles" = "yes"
then
DO_NOT_COMPILE="$DO_NOT_COMPILE mpg123_artsplugin"
fi

# this is run after libtool configure parts, which set AS to as
# which is the wrong one for us.  E.g. libtool doesn't recognize that as
# tag.  So we unset it here, so the below macro can set it.
save_AS=$AS
unset AS
ifdef([AM_PROG_AS],[AM_PROG_AS],[])
#if the macro did set something usefull fallback.
test -z "$AS" && AS=$save_AS
#and if AS was set to as by the macro, and we have a saved value,
#it's likely it contains a better guess (or it's also as)
test "x$AS" = xas && test -n "$save_AS" && AS=$save_AS
dnl =======================================================
dnl FILE: ./noatun/configure.in.in
dnl =======================================================

#MIN_CONFIG
 
dnl These are common macros that you might or might not want to use

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h stdlib.h paths.h)
AC_CHECK_FUNCS(usleep)

if test "x$build_arts" = "xno"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE noatun"
fi

dnl =======================================================
dnl FILE: ./oggvorbis_artsplugin/configure.in.in
dnl =======================================================

if test "$kde_mpeglib_compiles" = "yes"
then
DO_NOT_COMPILE="$DO_NOT_COMPILE oggvorbis_artsplugin"
fi

dnl =======================================================
dnl FILE: ./xine_artsplugin/configure.in.in
dnl =======================================================

dnl Configure paths for XINE
dnl
dnl Copyright (C) 2001 Daniel Caujolle-Bert <segfault@club-internet.fr>
dnl  
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl  
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl  
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dnl  
dnl  
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a configuration
dnl script generated by Autoconf, you may include it under the same
dnl distribution terms that you use for the rest of that program.
dnl  
if test "x$build_arts" = "xno"; then
		DO_NOT_COMPILE="$DO_NOT_COMPILE xine_artsplugin"
fi


dnl AC_PATH_XINE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for XINE, and define XINE_CFLAGS and XINE_LIBS
dnl
AC_DEFUN([AC_PATH_XINE],
[dnl 
dnl Get the cflags and libraries from the xine-config script
dnl
AC_ARG_WITH(xine-prefix,
    [  --with-xine-prefix=PFX	Prefix where XINE is installed (optional)],
            xine_config_prefix="$withval", xine_config_prefix="")
AC_ARG_WITH(xine-exec-prefix,
    [  --with-xine-exec-prefix=PFX	Exec prefix where XINE is installed (optional)],
            xine_config_exec_prefix="$withval", xine_config_exec_prefix="")
AC_ARG_ENABLE(xinetest, 
    [  --disable-xinetest	Do not try to compile and run a test XINE program],, enable_xinetest=yes)

  if test x$xine_config_exec_prefix != x ; then
     xine_config_args="$xine_config_args --exec-prefix=$xine_config_exec_prefix"
     if test x${XINE_CONFIG+set} != xset ; then
        XINE_CONFIG=$xine_config_exec_prefix/bin/xine-config
     fi
  fi
  if test x$xine_config_prefix != x ; then
     xine_config_args="$xine_config_args --prefix=$xine_config_prefix"
     if test x${XINE_CONFIG+set} != xset ; then
        XINE_CONFIG=$xine_config_prefix/bin/xine-config
     fi
  fi

  min_xine_version=ifelse([$1], ,0.5.0,$1)
  if test "x$enable_xinetest" != "xyes" ; then
    AC_MSG_CHECKING([for XINE-LIB version >= $min_xine_version])
  else
    AC_PATH_PROG(XINE_CONFIG, xine-config, no)
    AC_MSG_CHECKING([for XINE-LIB version >= $min_xine_version])
    no_xine=""
    if test "$XINE_CONFIG" = "no" ; then
      no_xine=yes
    else
      XINE_CFLAGS=`$XINE_CONFIG $xine_config_args --cflags`
      XINE_LIBS=`$XINE_CONFIG $xine_config_args --libs`
      xine_config_major_version=`$XINE_CONFIG $xine_config_args --version | \
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
      xine_config_minor_version=`$XINE_CONFIG $xine_config_args --version | \
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
      xine_config_sub_version=`$XINE_CONFIG $xine_config_args --version | \
             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
      xine_script_dir=`$XINE_CONFIG $xine_config_args --scriptdir`
      xine_plugin_dir=`$XINE_CONFIG $xine_config_args --plugindir`
      xine_locale_dir=`$XINE_CONFIG $xine_config_args --localedir`
      dnl    if test "x$enable_xinetest" = "xyes" ; then
      ac_save_CFLAGS="$CFLAGS"
      ac_save_LIBS="$LIBS"
      CFLAGS="$CFLAGS $XINE_CFLAGS $all_includes"
      LIBS="$XINE_LIBS $LIBS $all_libraries"
dnl
dnl Now check if the installed XINE is sufficiently new. (Also sanity
dnl checks the results of xine-config to some extent
dnl
      AC_LANG_SAVE()
      AC_LANG_C()
      rm -f conf.xinetest
      AC_TRY_RUN([
#include <xine.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int 
main ()
{
  int major, minor, sub;
   char *tmp_version;

  system ("touch conf.xinetest");

  /* HP/UX 9 (%@#!) writes to sscanf strings */
  tmp_version = (char *) strdup("$min_xine_version");
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &sub) != 3) {
     printf("%s, bad version string\n", "$min_xine_version");
     exit(1);
   }

  if ((XINE_MAJOR_VERSION != $xine_config_major_version) ||
      (XINE_MINOR_VERSION != $xine_config_minor_version) ||
      (XINE_SUB_VERSION != $xine_config_sub_version))
    {
      printf("\n*** 'xine-config --version' returned %d.%d.%d, but XINE (%d.%d.%d)\n", 
             $xine_config_major_version, $xine_config_minor_version, $xine_config_sub_version,
             XINE_MAJOR_VERSION, XINE_MINOR_VERSION, XINE_SUB_VERSION);
      printf ("*** was found! If xine-config was correct, then it is best\n");
      printf ("*** to remove the old version of XINE. You may also be able to fix the error\n");
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
      printf("*** required on your system.\n");
      printf("*** If xine-config was wrong, set the environment variable XINE_CONFIG\n");
      printf("*** to point to the correct copy of xine-config, and remove the file config.cache\n");
      printf("*** before re-running configure\n");
    } 
  else
    {
      if ((XINE_MAJOR_VERSION > major) ||
        ((XINE_MAJOR_VERSION == major) && (XINE_MINOR_VERSION > minor)) ||
        ((XINE_MAJOR_VERSION == major) && (XINE_MINOR_VERSION == minor) && (XINE_SUB_VERSION >= sub)))
      {
        return 0;
       }
     else
      {
        printf("\n*** An old version of XINE (%d.%d.%d) was found.\n",
               XINE_MAJOR_VERSION, XINE_MINOR_VERSION, XINE_SUB_VERSION);
        printf("*** You need a version of XINE newer than %d.%d.%d. The latest version of\n",
	       major, minor, sub);
        printf("*** XINE is always available from:\n");
        printf("***        http://xine.sourceforge.net\n");
        printf("***\n");
        printf("*** If you have already installed a sufficiently new version, this error\n");
        printf("*** probably means that the wrong copy of the xine-config shell script is\n");
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
        printf("*** of XINE, but you can also set the XINE_CONFIG environment to point to the\n");
        printf("*** correct copy of xine-config. (In this case, you will have to\n");
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
        printf("*** so that the correct libraries are found at run-time))\n");
      }
    }
  return 1;
}
],, no_xine=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
       CFLAGS="$ac_save_CFLAGS"
       LIBS="$ac_save_LIBS"
     fi
    fi
    if test "x$no_xine" = x ; then
       AC_MSG_RESULT(yes)
       ifelse([$2], , :, [$2])     
    else
      AC_MSG_RESULT(no)
      if test "$XINE_CONFIG" = "no" ; then
        echo "*** The xine-config script installed by XINE could not be found"
        echo "*** If XINE was installed in PREFIX, make sure PREFIX/bin is in"
        echo "*** your path, or set the XINE_CONFIG environment variable to the"
        echo "*** full path to xine-config."
      else
        if test -f conf.xinetest ; then
          :
        else
          echo "*** Could not run XINE test program, checking why..."
          CFLAGS="$CFLAGS $XINE_CFLAGS"
          LIBS="$LIBS $XINE_LIBS"
          AC_TRY_LINK([
#include <xine.h>
#include <stdio.h>
],      [ return ((XINE_MAJOR_VERSION) || (XINE_MINOR_VERSION) || (XINE_SUB_VERSION)); ],
        [ echo "*** The test program compiled, but did not run. This usually means"
          echo "*** that the run-time linker is not finding XINE or finding the wrong"
          echo "*** version of XINE. If it is not finding XINE, you'll need to set your"
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
          echo "*** is required on your system"
	  echo "***"
          echo "*** If you have an old version installed, it is best to remove it, although"
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
          echo "***"],
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
          echo "*** exact error that occured. This usually means XINE was incorrectly installed"
          echo "*** or that you have moved XINE since it was installed. In the latter case, you"
          echo "*** may want to edit the xine-config script: $XINE_CONFIG" ])
          CFLAGS="$ac_save_CFLAGS"
          LIBS="$ac_save_LIBS"
        fi
      fi
    XINE_CFLAGS=""
    XINE_LIBS=""
    ifelse([$3], , :, [$3])
  fi
  AC_SUBST(XINE_CFLAGS)
  AC_SUBST(XINE_LIBS)
  AC_LANG_RESTORE()
  rm -f conf.xinetest

dnl Make sure HAVE_STRSEP, HAVE_SETENV and HAVE_STRPBRK are defined as
dnl necessary.
  AC_CHECK_FUNCS([strsep strpbrk setenv])
])

dnl Check for XShmGetEventBase
AC_MSG_CHECKING([for XShmGetEventBase])
AC_LANG_SAVE()
AC_LANG_CPLUSPLUS()
AC_TRY_COMPILE([
#include <X11/Xlib.h>
#include <X11/extensions/XShm.h>
  ],[
static Display *display = NULL;
int shmCompletionType = XShmGetEventBase( display );
  ],[
    AC_MSG_RESULT(yes)
    AC_DEFINE(HAVE_XSHMGETEVENTBASE, 1, [Define if you have XShmGetEventBase in <X11/extensions/XShm.h])
  ],[
    AC_MSG_RESULT(no)
  ]
)
AC_LANG_RESTORE()

dnl Check for new internal xine symbol names
KDE_CHECK_LIB(xine, _x_ao_new_port, :, 
[
  AC_DEFINE(_x_ao_new_port, ao_new_port, [Compatibility with older version of xine])
])
AC_CHECK_FUNC([ao_new_port])

AC_ARG_WITH([xine],
  [AC_HELP_STRING([--with-xine],
    [Enable support for Xine @<:@default=check@:>@])],
  [], with_xine=check)

have_xine=no
if test "x$with_xine" != xno; then
  AC_PATH_XINE(1.0.0, have_xine=yes)

  if test "x$with_xine" != xcheck && test "x$have_xine" != xyes; then
    AC_MSG_ERROR([--with-xine was given, but test for Xine failed])
  fi
fi

if test "x$have_xine" != xyes; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE xine_artsplugin"
fi
KDE_CREATE_SUBDIRSLIST
AM_CONDITIONAL(arts_SUBDIR_included, test "x$arts_SUBDIR_included" = xyes)
AM_CONDITIONAL(audiofile_artsplugin_SUBDIR_included, test "x$audiofile_artsplugin_SUBDIR_included" = xyes)
AM_CONDITIONAL(doc_SUBDIR_included, test "x$doc_SUBDIR_included" = xyes)
AM_CONDITIONAL(juk_SUBDIR_included, test "x$juk_SUBDIR_included" = xyes)
AM_CONDITIONAL(kaboodle_SUBDIR_included, test "x$kaboodle_SUBDIR_included" = xyes)
AM_CONDITIONAL(kappfinder_data_SUBDIR_included, test "x$kappfinder_data_SUBDIR_included" = xyes)
AM_CONDITIONAL(kfile_plugins_SUBDIR_included, test "x$kfile_plugins_SUBDIR_included" = xyes)
AM_CONDITIONAL(kmid_SUBDIR_included, test "x$kmid_SUBDIR_included" = xyes)
AM_CONDITIONAL(kmix_SUBDIR_included, test "x$kmix_SUBDIR_included" = xyes)
AM_CONDITIONAL(libkcddb_SUBDIR_included, test "x$libkcddb_SUBDIR_included" = xyes)
AM_CONDITIONAL(mpeglib_SUBDIR_included, test "x$mpeglib_SUBDIR_included" = xyes)
AM_CONDITIONAL(mpg123_artsplugin_SUBDIR_included, test "x$mpg123_artsplugin_SUBDIR_included" = xyes)
AM_CONDITIONAL(oggvorbis_artsplugin_SUBDIR_included, test "x$oggvorbis_artsplugin_SUBDIR_included" = xyes)
AM_CONDITIONAL(xine_artsplugin_SUBDIR_included, test "x$xine_artsplugin_SUBDIR_included" = xyes)
AM_CONDITIONAL(akode_artsplugin_SUBDIR_included, test "x$akode_artsplugin_SUBDIR_included" = xyes)
AM_CONDITIONAL(krec_SUBDIR_included, test "x$krec_SUBDIR_included" = xyes)
AM_CONDITIONAL(noatun_SUBDIR_included, test "x$noatun_SUBDIR_included" = xyes)
AM_CONDITIONAL(kscd_SUBDIR_included, test "x$kscd_SUBDIR_included" = xyes)
AM_CONDITIONAL(kioslave_SUBDIR_included, test "x$kioslave_SUBDIR_included" = xyes)
AM_CONDITIONAL(kaudiocreator_SUBDIR_included, test "x$kaudiocreator_SUBDIR_included" = xyes)
AM_CONDITIONAL(mpeglib_artsplug_SUBDIR_included, test "x$mpeglib_artsplug_SUBDIR_included" = xyes)
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ akode_artsplugin/Makefile ])
AC_CONFIG_FILES([ arts/Makefile ])
AC_CONFIG_FILES([ arts/builder/Makefile ])
AC_CONFIG_FILES([ arts/builder/pics/Makefile ])
AC_CONFIG_FILES([ arts/examples/Makefile ])
AC_CONFIG_FILES([ arts/gui/Makefile ])
AC_CONFIG_FILES([ arts/gui/common/Makefile ])
AC_CONFIG_FILES([ arts/gui/kde/Makefile ])
AC_CONFIG_FILES([ arts/gui/kde/mcopclass/Makefile ])
AC_CONFIG_FILES([ arts/midi/Makefile ])
AC_CONFIG_FILES([ arts/midi/mcopclass/Makefile ])
AC_CONFIG_FILES([ arts/modules/Makefile ])
AC_CONFIG_FILES([ arts/modules/common/Makefile ])
AC_CONFIG_FILES([ arts/modules/effects/Makefile ])
AC_CONFIG_FILES([ arts/modules/effects/freeverb/Makefile ])
AC_CONFIG_FILES([ arts/modules/mixers/Makefile ])
AC_CONFIG_FILES([ arts/modules/synth/Makefile ])
AC_CONFIG_FILES([ arts/runtime/Makefile ])
AC_CONFIG_FILES([ arts/tools/Makefile ])
AC_CONFIG_FILES([ arts/tools/pics/Makefile ])
AC_CONFIG_FILES([ audiofile_artsplugin/Makefile ])
AC_CONFIG_FILES([ doc/Makefile ])
AC_CONFIG_FILES([ doc/artsbuilder/Makefile ])
AC_CONFIG_FILES([ doc/artsbuilder/images/Makefile ])
AC_CONFIG_FILES([ doc/juk/Makefile ])
AC_CONFIG_FILES([ doc/kaboodle/Makefile ])
AC_CONFIG_FILES([ doc/kaudiocreator/Makefile ])
AC_CONFIG_FILES([ doc/kioslave/Makefile ])
AC_CONFIG_FILES([ doc/kmid/Makefile ])
AC_CONFIG_FILES([ doc/kmix/Makefile ])
AC_CONFIG_FILES([ doc/krec/Makefile ])
AC_CONFIG_FILES([ doc/kscd/Makefile ])
AC_CONFIG_FILES([ doc/noatun/Makefile ])
AC_CONFIG_FILES([ juk/Makefile ])
AC_CONFIG_FILES([ juk/pics/Makefile ])
AC_CONFIG_FILES([ kaboodle/Makefile ])
AC_CONFIG_FILES([ kaboodle/actions/Makefile ])
AC_CONFIG_FILES([ kaboodle/pics/Makefile ])
AC_CONFIG_FILES([ kappfinder-data/Makefile ])
AC_CONFIG_FILES([ kaudiocreator/Makefile ])
AC_CONFIG_FILES([ kaudiocreator/icons/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/au/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/avi/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/flac/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/m3u/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/mp3/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/mpc/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/mpeg/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/ogg/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/sid/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/theora/Makefile ])
AC_CONFIG_FILES([ kfile-plugins/wav/Makefile ])
AC_CONFIG_FILES([ kioslave/Makefile ])
AC_CONFIG_FILES([ kioslave/audiocd/Makefile ])
AC_CONFIG_FILES([ kioslave/audiocd/kcmaudiocd/Makefile ])
AC_CONFIG_FILES([ kioslave/audiocd/plugins/Makefile ])
AC_CONFIG_FILES([ kioslave/audiocd/plugins/flac/Makefile ])
AC_CONFIG_FILES([ kioslave/audiocd/plugins/lame/Makefile ])
AC_CONFIG_FILES([ kioslave/audiocd/plugins/vorbis/Makefile ])
AC_CONFIG_FILES([ kioslave/audiocd/plugins/wav/Makefile ])
AC_CONFIG_FILES([ kmid/Makefile ])
AC_CONFIG_FILES([ kmid/examples/Makefile ])
AC_CONFIG_FILES([ kmid/maps/Makefile ])
AC_CONFIG_FILES([ kmid/pics/Makefile ])
AC_CONFIG_FILES([ kmix/Makefile ])
AC_CONFIG_FILES([ kmix/pics/Makefile ])
AC_CONFIG_FILES([ krec/Makefile ])
AC_CONFIG_FILES([ krec/mp3_export/Makefile ])
AC_CONFIG_FILES([ krec/ogg_export/Makefile ])
AC_CONFIG_FILES([ krec/pics/Makefile ])
AC_CONFIG_FILES([ kscd/Makefile ])
AC_CONFIG_FILES([ kscd/bitmaps/Makefile ])
AC_CONFIG_FILES([ kscd/kscdmagic/Makefile ])
AC_CONFIG_FILES([ kscd/libwm/Makefile ])
AC_CONFIG_FILES([ kscd/libwm/audio/Makefile ])
AC_CONFIG_FILES([ libkcddb/Makefile ])
AC_CONFIG_FILES([ libkcddb/kcmcddb/Makefile ])
AC_CONFIG_FILES([ libkcddb/test/Makefile ])
AC_CONFIG_FILES([ mpeglib/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/cddaplay/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/mpgplay/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/splay/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/tplay/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/yaf/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/yaf/yafcdda/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/yaf/yafcore/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/yaf/yafmpgplay/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/yaf/yafsplay/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/yaf/yaftplay/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/yaf/yafvorbis/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/yaf/yafxplayer/Makefile ])
AC_CONFIG_FILES([ mpeglib/example/yaf/yafyuv/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/decoder/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/frame/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/input/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/mpegplay/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/mpgplayer/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/oggvorbis/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/output/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/splay/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/tplay/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/abstract/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/audio/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/file/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/mmx/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/render/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/render/dither/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/render/dither2YUV/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/render/sdl/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/util/render/x11/Makefile ])
AC_CONFIG_FILES([ mpeglib/lib/yuv/Makefile ])
AC_CONFIG_FILES([ mpeglib_artsplug/Makefile ])
AC_CONFIG_FILES([ mpg123_artsplugin/Makefile ])
AC_CONFIG_FILES([ mpg123_artsplugin/mpg123/Makefile ])
AC_CONFIG_FILES([ noatun/Makefile ])
AC_CONFIG_FILES([ noatun/app/Makefile ])
AC_CONFIG_FILES([ noatun/library/Makefile ])
AC_CONFIG_FILES([ noatun/library/noatun/Makefile ])
AC_CONFIG_FILES([ noatun/library/noatunarts/Makefile ])
AC_CONFIG_FILES([ noatun/library/noatuntags/Makefile ])
AC_CONFIG_FILES([ noatun/modules/Makefile ])
AC_CONFIG_FILES([ noatun/modules/artseffects/Makefile ])
AC_CONFIG_FILES([ noatun/modules/dcopiface/Makefile ])
AC_CONFIG_FILES([ noatun/modules/excellent/Makefile ])
AC_CONFIG_FILES([ noatun/modules/htmlexport/Makefile ])
AC_CONFIG_FILES([ noatun/modules/infrared/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kaiman/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kaiman/skins/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kaiman/skins/car-preset/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kaiman/skins/circle/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kaiman/skins/k9/Makefile ])
AC_CONFIG_FILES([ noatun/modules/keyz/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kjofol-skin/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kjofol-skin/skins/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kjofol-skin/skins/HexoBronx/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kjofol-skin/skins/kjofol/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kjofol-skin/skins/phong/Makefile ])
AC_CONFIG_FILES([ noatun/modules/kjofol-skin/skins/vibrocentric/Makefile ])
AC_CONFIG_FILES([ noatun/modules/marquis/Makefile ])
AC_CONFIG_FILES([ noatun/modules/metatag/Makefile ])
AC_CONFIG_FILES([ noatun/modules/monoscope/Makefile ])
AC_CONFIG_FILES([ noatun/modules/net/Makefile ])
AC_CONFIG_FILES([ noatun/modules/noatunui/Makefile ])
AC_CONFIG_FILES([ noatun/modules/simple/Makefile ])
AC_CONFIG_FILES([ noatun/modules/splitplaylist/Makefile ])
AC_CONFIG_FILES([ noatun/modules/systray/Makefile ])
AC_CONFIG_FILES([ noatun/modules/voiceprint/Makefile ])
AC_CONFIG_FILES([ noatun/modules/winskin/Makefile ])
AC_CONFIG_FILES([ noatun/modules/winskin/mimetypes/Makefile ])
AC_CONFIG_FILES([ noatun/modules/winskin/mimetypes/interface/Makefile ])
AC_CONFIG_FILES([ noatun/modules/winskin/skins/Makefile ])
AC_CONFIG_FILES([ noatun/modules/winskin/skins/winamp/Makefile ])
AC_CONFIG_FILES([ noatun/modules/winskin/vis/Makefile ])
AC_CONFIG_FILES([ noatun/pics/Makefile ])
AC_CONFIG_FILES([ oggvorbis_artsplugin/Makefile ])
AC_CONFIG_FILES([ xine_artsplugin/Makefile ])
AC_CONFIG_FILES([ xine_artsplugin/tools/Makefile ])
AC_CONFIG_FILES([ xine_artsplugin/tools/thumbnail/Makefile ])
AC_OUTPUT
if test "x$with_audiofile" = xcheck && test "x$arts_audiolib_found" = xno; then
  echo ""
  echo "You're missing libaudiofile. aRts won't be able to load or play"
  echo "any samples without it, so please install it."
  echo "Have a look at http://oss.sgi.com/projects/audiofile/ or find a"
  echo "binary package for your platform."
  echo ""
  all_tests=bad
fi
if test "x$with_taglib" = xcheck && test "x$have_taglib" != xyes; then
	echo "**************************************************"
	echo "*"
	echo "* JuK will not be built without TagLib." 
	echo "* See the notice below for where to find TagLib."
	echo "*"
	echo "**************************************************"
fi

if test "x$with_gstreamer" = xcheck && test "x$have_gst" = xno; then
	echo "**************************************************"
	echo "*"
	echo "* You do not seem to have GStreamer 0.8.x installed."
	echo "* Without this aRts and/or aKode output will be used exclusively."
	echo "*"
	echo "* If you actually have gstreamer installed make sure you also have"
	echo "* the gst-plugins collection installed.  Both gstreamer and"
	echo "* gst-plugins need to be 0.8.x (0.9 is not supported)"
	echo "* http://gstreamer.freedesktop.org/modules/"
	echo "*"
	echo "* JuK supports GStreamer output but will also"
	echo "* work with aRts and aKode."
	echo "*"
	echo "**************************************************"
fi

if test "x$with_musicbrainz" = xcheck && test "x$have_musicbrainz" = xno; then
	echo "**************************************************"
	echo "*"
	echo "* You do not seem to have libmusicbrainz and"
        echo "* libtunepimp.  JuK will be compiled without"
	echo "* MusicBrainz support and automatic song"
	echo "* recognition will not be supported."
	echo "* Please download libmusicbrainz 2.x and libtunepimp"
	echo "* 0.3.x from:"
	echo "* http://www.musicbrainz.org/products/client/download.html "
	echo "* http://www.musicbrainz.org/products/tunepimp/download.html"
	echo "*"
	echo "**************************************************"
fi
if test "x$with_theora" = xcheck && test "x$have_theora" = xno; then
  echo ""
  echo "Ogg Theora support was not found."
  echo "a KFile-plugin for displaying Ogg Theora Information"
  echo "has been disabled from compilation."
  all_tests=bad
fi
dnl put here things which have to be done as very last part of configure

if test "x$with_vorbis" = xcheck && test "x$have_oggvorbis" = xno; then
  echo ""
  echo "Ogg Vorbis support was not found."
  echo "a KFile-plugin for displaying Ogg Vorbis Information"
  echo "has been disabled from compilation."
  echo "audiocd:/ will be built without Vorbis support."
  all_tests=bad
fi

if test "x$with_taglib" = xcheck && test "x$have_taglib" = xno; then
  echo ""
  echo "You're missing TagLib.  Without TagLib KDE will not support ID3"
  echo "tags in mp3 files.  You can find taglib either in KDE's Subversion"
  echo "repository under trunk/kdesupport/taglib or at"
  echo "http://ktown.kde.org/~wheeler/taglib"
  all_tests=bad
fi

if test "x$with_lame" = xcheck && test "x$have_lame" = xno; then
  echo ""
  echo "lame not found, MP3 support will be built into audiocd:/, but"
  echo "if the library isn't present at runtime it will be disabled."
  echo "See http://lame.sourceforge.net/"
  all_tests=bad
fi

if test "x$with_akode" = xcheck && test "x$have_akode" = xno; then
  echo ""
  echo "aKode was not found. Without it the aKode aRts-plugin will not be"
  echo "installed, and aRts will be unable to play many music formats."
  echo "You can find aKode in KDE's Subversion repository under"
  echo "trunk/kdesupport/akode."
  all_tests=bad
fi
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
  # And if so, warn when they don't match
  if test "$kde_libs_prefix" != "$given_prefix"; then
    # And if kde doesn't know about the prefix yet
    echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
    if test $? -ne 0; then
      echo ""
      echo "Warning: you chose to install this package in $given_prefix,"
      echo "but KDE was found in $kde_libs_prefix."
      echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
      echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
      echo "Then restart KDE."
      echo ""
    fi
  fi
fi

if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
  echo ""
  echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
  echo "was not included. Therefore, GCC symbol visibility support remains disabled."
  echo ""
  echo "For better performance, consider including the Qt visibility supporting patch"
  echo "located at:"
  echo ""
  echo "http://bugs.kde.org/show_bug.cgi?id=109386"
  echo ""
  echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
  echo "everything will continue to work just fine without it."
  echo ""
fi

if test "$all_tests" = "bad"; then
  if test ! "$cache_file" = "/dev/null"; then
    echo ""
    echo "Please remove the file $cache_file after changing your setup"
    echo "so that configure will find the changes next time."
    echo ""
  fi
else
  echo ""
  echo "Good - your configure finished. Start make now"
  echo ""
fi
