dnl ---------------------------------------------------------------------------
dnl check if compiler compiles correctly something like this :
dnl class A { virtual A* me(); };
dnl class X {};
dnl class B : public X, public A { virtual B* me(); };
dnl stupid gcc doesn't even bother to warn it can't do it correctly
dnl ---------------------------------------------------------------------------

AC_MSG_CHECKING(if covariant return works)
AC_CACHE_VAL(kde_cv_covariant_return,
    [
    kde_cv_covariant_return=no
    AC_LANG_SAVE
    AC_LANG_CPLUSPLUS
    AC_TRY_RUN( 
        [
        class A { public: virtual A* me(); };
        class X { public: int x; virtual void ff() {}; };
        class B : public X, public A { public: virtual B* me(); };
        int foo( A* a )
            {
            A* aa = a->me();
            return a == aa;
            }
        int main()
            {
            B* b = new B;
            return foo( b ) == 0;
            }
        A* A::me() { return this; }
        B* B::me() { return this; }
        ],
        [ kde_cv_covariant_return=yes ])
    AC_LANG_RESTORE
    ])

if test "$kde_cv_covariant_return" = "no"; then
    AC_MSG_RESULT(no)
    AC_DEFINE(COVARIANT_RETURN_BROKEN, 1,
        [Define if covariant return in virtual methods works])
else
    AC_MSG_RESULT(yes)
fi


dnl ---------------------------------------------------------------------------
dnl check for arts for speech recognition
dnl ---------------------------------------------------------------------------


artsc_config_test_path=$prefix/bin:$exec_prefix/bin:$TDEDIR/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, [Defined for arts support in khotkeys])
        KHOTKEYS_ARTS_SUBDIR=arts
else
	LIB_ARTS=""
	ARTS_CFLAGS=""
        KHOTKEYS_ARTS_SUBDIR=
fi

AC_SUBST(LIB_ARTS)
AC_SUBST(ARTS_CFLAGS)
AC_SUBST(KHOTKEYS_ARTS_SUBDIR)
