
dnl aRts specific configure tests
dnl

dnl
dnl ensure that the user has aRts-1.1.0 or newer installed
dnl

dnl Check for artsc-config
dnl no need to, AC_BASE_PATH_KDE does it for us already (see also
dnl comment below for mcopidl)
dnl AC_PATH_PROG(ARTSCCONFIG, artsc-config, no)

ARTS_WANT_VERSION=1.1.x
ARTS_HAVE_VERSION=none
ARTS_HAVE_PREFIX=none

dnl Check for Glib-2.0
AC_MSG_CHECKING(for aRts-$ARTS_WANT_VERSION)

ARTS_OK=no

if test "x$ARTSCCONFIG" != "xno"; then
	ARTS_HAVE_VERSION=`$ARTSCCONFIG --arts-version`
	ARTS_HAVE_PREFIX=`$ARTSCCONFIG --arts-prefix`
fi

# And delete superflous '/' to make compares easier
ARTS_HAVE_PREFIX=`echo "$ARTS_HAVE_PREFIX" | sed 's,//*,/,g' | sed -e 's,/$,,'`

dnl don't look at the micro version
if test "x`echo $ARTS_HAVE_VERSION | sed 's/\.[[0-9]]*$/.x/'`" = "x$ARTS_WANT_VERSION"; then
        realartsprefix=`(cd $ARTS_HAVE_PREFIX; /bin/pwd)`
        realprefix=`(cd $prefix; /bin/pwd)`
	if test "x$realartsprefix" = "x$realprefix"; then
		ARTS_OK=yes
	else
AC_MSG_ERROR([aRts $ARTS_WANT_VERSION not installed in the same prefix as KDE!
Please reinstall aRts in the same prefix as KDE, different prefixes are not
supported right now.

(kdelibs prefix is $prefix, aRts prefix is $ARTS_HAVE_PREFIX)
])
	fi
fi

AC_MSG_RESULT($ARTS_OK)

if test "x$ARTS_OK" = "xno"; then
AC_MSG_ERROR([aRts $ARTS_WANT_VERSION not found.

You'll need to install a suitable version of aRts in the same prefix as KDE
before you build kdelibs.

(found
 * artsc-config: $ARTSCCONFIG
 * kdelibs prefix: $prefix
 * aRts prefix: $ARTS_HAVE_PREFIX
 * aRts version: $ARTS_HAVE_VERSION (required: $ARTS_WANT_VERSION)
)
])
fi

dnl AC_BASE_PATH_KDE already checks for mcopidl, and it does it the
dnl right way using KDE_FIND_PATH
dnl AC_PATH_PROG(MCOPIDL, mcopidl, no)
dnl AC_SUBST(MCOPIDL)
