KDE_FIND_PATH(perl, PERL, [], 
	[
	  AC_MSG_WARN([Couldn't find perl 5 or later. ical2vcal will no work.])		],
	[-e 'require 5.000;']
)
	
AC_SUBST(PERL)

KDE_CHECK_STL
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/select.h \
	sys/ioctl.h sys/stropts.h malloc.h sys/sockio.h \
	sys/m_wait.h sys/param.h libgen.h)
AC_HEADER_TIME

AC_LANG_C
AC_C_LONG_DOUBLE
AC_TYPE_GETGROUPS

dnl Checks for library functions.
AC_CHECK_FUNCS(socket strdup vsnprintf basename setenv unsetenv)
AC_CHECK_GETDOMAINNAME
AC_CHECK_GETHOSTNAME
AC_CHECK_USLEEP

dnl Check for KNewStuff presence (i.e. kdelibs-3.3)
dnl If not present, use internal knewstuff

AC_DEFUN([KDE_CHECK_KNEWSTUFF],
[
AC_MSG_CHECKING([for KDE library: knewstuff])
ac_knewstuff_includes=NO ac_knewstuff_libraries=NO
knewstuff_libraries=""
knewstuff_includes=""
AC_CACHE_VAL(ac_cv_have_knewstuff,
[
AC_FIND_FILE(knewstuff/downloaddialog.h, $kde_incdirs, knewstuff_incdir)
ac_knewstuff_includes="$knewstuff_incdir"
AC_FIND_FILE(libknewstuff.so, $kde_libdirs, knewstuff_libdir)
ac_knewstuff_libraries="$knewstuff_libdir"
if test "$ac_knewstuff_includes" = NO || test "$ac_knewstuff_libraries" = NO; then
  ac_cv_have_knewstuff="have_knewstuff=no"
  ac_knewstuff_notfound=""
else
  have_knewstuff="yes"
fi
])
eval "$ac_cv_have_knewstuff"
if test "$have_knewstuff" != yes; then
  AC_MSG_RESULT([$have_knewstuff, using internal copy])
  KNEWSTUFF_SUBDIR='knewstuff'
  KNEWSTUFF_LIB='$(top_builddir)/korganizer/knewstuff/libknewstuff.la'
else
  AC_MSG_RESULT([$have_knewstuff])
  KNEWSTUFF_SUBDIR=''
  KNEWSTUFF_LIB='-lknewstuff'
fi
AC_SUBST(KNEWSTUFF_SUBDIR)
AC_SUBST(KNEWSTUFF_LIB)
AM_CONDITIONAL([include_knewstuff], [test "$KNEWSTUFF_SUBDIR" != ""])
])

KDE_CHECK_KNEWSTUFF

dnl AC_OUTPUT(korganizer/ical2vcal)

dnl AC_OUTPUT(korganizer/korganizerIn)

AC_PROG_YACC
