
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")
