# Original Author was Kalle@kde.org
# I lifted it in some mater. (Stephan Kulow)
# I used much code from Janos Farkas

dnl Process this file with autoconf to produce a configure script.

AC_INIT(acinclude.m4) dnl a source file from your sub dir
AC_MSG_WARN("")
AC_CANONICAL_SYSTEM 
AC_ARG_PROGRAM

dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(kpackviewer) dnl searches for some needed programs

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

dnl generate the config header
AM_CONFIG_HEADER(config.h) dnl at the distribution this done

dnl checks, if the debug code is wanted
AC_CHECK_FLAGS

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL

dnl Checks for libraries.
AC_PATH_KDE

dnl Checks for libraries. 
AC_CHECK_LIB(socket, socket, [LIBSOCKET="-lsocket -lnsl"]) dnl for Solaris
AC_SUBST(LIBSOCKET)

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME

dnl check if the compiler has bool
AC_CHECK_BOOL
AC_C_LONG_DOUBLE
AC_CHECK_KSIZE_T
AC_CHECK_SETENV

AC_OUTPUT(Makefile \
	kpackviewer/Makefile)

