dnl    This file is part of the KDE libraries/packages
dnl    Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
 
dnl    This file is free software; you can redistribute it and/or
dnl    modify it under the terms of the GNU Library General Public
dnl    License as published by the Free Software Foundation; either
dnl    version 2 of the License, or (at your option) any later version.
 
dnl    This library is distributed in the hope that it will be useful,
dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl    Library General Public License for more details.
 
dnl    You should have received a copy of the GNU Library General Public License
dnl    along with this library; see the file COPYING.LIB.  If not, write to
dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
dnl    Boston, MA 02111-1307, USA.

# 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

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

dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
unset CDPATH

dnl Checking host/target/build systems, for make, install etc.
AC_CANONICAL_SYSTEM 
dnl Perform program name transformation
AC_ARG_PROGRAM

dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(kdeutils, "3.0") dnl searches for some needed programs

KDE_SET_PREFIX

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

dnl Checks for programs.
AC_CHECK_COMPILERS
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
KDE_PROG_LIBTOOL

dnl for NLS support. Call them in this order!
dnl WITH_NLS is for the po files
AM_KDE_WITH_NLS

dnl KDE_USE_QT
AC_PATH_KDE
#MIN_CONFIG
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/sysctl.h sys/param.h sys/time.h sys/types.h sys/user.h sys/vmmeter.h sys/resource.h vm/vmparam.h unistd.h)
AC_CHECK_FUNCS(setenv unsetenv)
CXXFLAGS="$CXXFLAGS -DQT_CLEAN_NAMESPACE  -DQT_NO_ASCII_CAST"
AC_CHECK_KDEMAXPATHLEN

KDE_CHECK_KIMGIO
DO_NOT_COMPILE="$DO_NOT_COMPILE kab"
AC_CHECK_HEADERS(ieeefp.h)

AC_CHECK_FUNCS(fabsl)

AC_DEFUN(KDE_C_LONG_DOUBLE,
[
  AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
  [
    AC_TRY_RUN(
    [
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main() {
/* The Stardent Vistra knows sizeof(long double), but does not support it.  */
long double foo = 1.0;
char buffer[10];
/* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
int result = (sizeof(long double) < sizeof(double));
/* the following is needed for a broken printf in glibc2 */
if (!result) {
    foo = foo * 3;
    sprintf(buffer,"%0.0Lf",foo);
    result = strcmp(buffer, "3");
/* and now something mean ;-) */
    foo = powl(fabsl(foo), 1);
}
exit(result); }
    ],
    ac_cv_c_long_double=yes, ac_cv_c_long_double=no,
    ac_cv_c_long_double=no
    )
  ])
  if test $ac_cv_c_long_double = yes; then
    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have support for long double in printf])
  fi
])
KDE_C_LONG_DOUBLE

AC_LANG_C
AC_CHECK_LIB(m, isinf, [
  AC_DEFINE_UNQUOTED(HAVE_FUNC_ISINF, 1, [Define if you have isinf])
])

AC_CHECK_LIB(devstat, selectdevs,
[
  LIB_DEVSTAT="-ldevstat"
  AC_SUBST(LIB_DEVSTAT)
])
AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/mount.h sys/ucred.h)
KDE_CREATE_SUBDIRSLIST
AC_OUTPUT( \
./Makefile \
cdbakeoven/Makefile \
cdbakeoven/audio/Makefile \
cdbakeoven/cdbosettings/Makefile \
cdbakeoven/cdbosettings/info/Makefile \
cdbakeoven/dialogs/Makefile \
cdbakeoven/dialogs/dialogParts/Makefile \
cdbakeoven/icons/Makefile \
cdbakeoven/mimetypes/Makefile \
cdbakeoven/toolbar/Makefile \
cdbakeoven/widgets/Makefile \
cdbakeoven/widgets/fileViews/Makefile \
)
