
dnl AC_PREREQ([2.13])

dnl without this order in this file, autoconf will not work!
dnl the argument is a source file out of your sources. But
dnl acinclude.m4 makes the job for all programs ;-)
AC_INIT(acinclude.m4)

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

dnl without this order in this file, automake will be confused!
dnl the argument 
AM_CONFIG_HEADER(config.h)
AC_CHECK_COMPILERS

if test "$GCC" = "yes"; then
  CXXFLAGS="$CXXFLAGS"
fi

AM_INIT_AUTOMAKE(koffice, 0.1)

dnl make $KDEDIR the default for the installation
AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})

AM_ENABLE_SHARED(yes)
AM_ENABLE_STATIC(no)
KDE_PROG_LIBTOOL
AC_PATH_KDE 
AM_KDE_WITH_NLS

dnl Check for MICO. The argument is the minimal version required.
KDE_CHECK_MICO(2.2.3)
KDE_CHECK_MINI_STL

idldir="\$(includedir)/idl"
AC_SUBST(idldir)

KDE_CHECK_PYTHON(1.5)
AC_CHECK_HEADERS(unistd.h sys/param.h floatingpoint.h)
AC_FIND_GIF
AC_FIND_JPEG
AC_FIND_TIFF
KDE_CHECK_KIMGIO
AC_FIND_QIMGIO
AC_C_BIGENDIAN

KDE_CHECK_NEWLIBS

KOML_INCLUDES='-I$(top_srcdir)/lib/koml -I$(top_builddir)/lib/koml'
AC_SUBST(KOML_INCLUDES)

KSTORE_INCLUDES='-I$(top_srcdir)/lib/store -I$(top_builddir)/lib/store'
AC_SUBST(KSTORE_INCLUDES)

KOFFICECORE_INCLUDES='-I$(top_srcdir)/lib/kofficecore -I$(top_builddir)/lib/kofficecore'
AC_SUBST(KOFFICECORE_INCLUDES)

KOFFICEUI_INCLUDES='-I$(top_srcdir)/lib/kofficeui -I$(top_builddir)/lib/kofficeui'
AC_SUBST(KOFFICEUI_INCLUDES)

LIB_KOFFICEUI='$(top_builddir)/lib/kofficeui/libkofficeui.la'
LIB_KOFFICECORE='$(top_builddir)/lib/kofficecore/libkofficecore.la'
LIB_KSTORE='$(top_builddir)/lib/store/libkstore.la'
LIB_KOML='$(top_builddir)/lib/koml/libkoml.la'
AC_SUBST(LIB_KOFFICEUI)
AC_SUBST(LIB_KOFFICECORE)
AC_SUBST(LIB_KSTORE)
AC_SUBST(LIB_KOML)

interfacedir='$(top_srcdir)/lib/interfaces'
AC_SUBST(interfacedir)

KOFFICE_LIBS='$(LIB_KOFFICEUI) $(LIB_KOFFICECORE) $(LIB_KSTORE) $(LIB_KOML)'
AC_SUBST(KOFFICE_LIBS)

KOFFICE_INCLUDES='-I$(top_srcdir)/lib $(KOFFICEUI_INCLUDES) $(KOFFICECORE_INCLUDES) $(KOML_INCLUDES) $(KSTORE_INCLUDES)'
AC_SUBST(KOFFICE_INCLUDES)

dnl add here all your Makefiles. These are created by configure
AC_OUTPUT( \
	Makefile \
	kchart/Makefile	\
	kchart/core/Makefile \
	kchart/pics/Makefile \
	kchart/ui/Makefile \
	kformula/Makefile \
	kformula/pics/Makefile \
	killustrator/Makefile \
	killustrator/doc/Makefile \
	killustrator/filter/Makefile \
	killustrator/koffice/Makefile \
	killustrator/pics/Makefile \
	killustrator/share/Makefile \
	killustrator/standalone/Makefile \
	killustrator/xmlutils/Makefile \
	kohtml/Makefile \
	kohtml/toolbar/Makefile \
	kimage/Makefile \
	kpresenter/Makefile \
	kpresenter/autoformEdit/Makefile \
	kpresenter/autoforms/Makefile \
	kpresenter/autoforms/Arrows/Makefile \
	kpresenter/autoforms/Connections/Makefile \
	kpresenter/pics/Makefile \
	kpresenter/templates/Makefile \
	kpresenter/templates/Screenpresentations/Makefile \
	kpresenter/templates/Professional/Makefile \
	kpresenter/toolbar/Makefile \
	kpresenter/dtd/Makefile \
	kspread/Makefile \
	kspread/pics/Makefile \
	kspread/scripts/Makefile \
	kspread/dtd/Makefile \
	kspread/filters/Makefile \
	kspread/filters/komma/Makefile \
	kword/Makefile \
	kword/toolbar/Makefile \
	kword/templates/Makefile \
	kword/templates/Wordprocessing/Makefile \
	kword/templates/DTP/Makefile \
	kword/dtd/Makefile \
	kdiagramm/Makefile \
	kdiagramm/pics/Makefile \
	kimage/Makefile \
	koshell/Makefile \
	lib/Makefile \
	lib/kofficecore/Makefile \
	lib/kofficeui/Makefile \
	lib/kofficeui/pics/Makefile \
	lib/kofficeui/test/Makefile \
	lib/koml/Makefile \
	lib/store/Makefile \
	tools/Makefile \
	tools/spell/Makefile \
	trader/Makefile \
	trader/data/Makefile \
	plugins/Makefile \
	plugins/recorder/Makefile \
	plugins/recorder/pics/Makefile \
	plugins/calc/Makefile \
	plugins/calc/pics/Makefile \
	pics/Makefile
	pics/toolbar/Makefile \
	po/Makefile \
	po/de/Makefile \
	po/fr/Makefile \
	po/is/Makefile \
	po/no/Makefile \
	po/pt/Makefile \
	po/sk/Makefile 
	po/sv/Makefile 
 )
