# -*- Mode: sh -*-
# SUMMARY:      
#
# $Id$
#
# AUTHOR:       Christophe Prud'homme
# ORG:          Christophe Prud'homme company
# ORIG-DATE:    26-Apr-89
# LAST-MOD:      7-Sep-97 at 19:50:29 by Christophe Prud'homme
# DESCRIPTION:  
#
# $Log$
# DESCRIP-END.

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

AC_REVISION($Id$)dnl

AC_INIT(acinclude.m4) dnl a source file from your sub dir

dnl Where are the files for the configure script
AC_CONFIG_AUX_DIR(config)

dnl configure in freefem
AC_CONFIG_SUBDIRS( freefem )

dnl some message for very alpha software
AC_MSG_WARN("This Code is alpha. It may not even compile.  Use at your own risk.")

dnl What the current system and host
AC_CANONICAL_HOST
AC_CANONICAL_SYSTEM

AC_ARG_PROGRAM

dnl Automake doc recommends to do this only here.
AM_INIT_AUTOMAKE(kfem, 0.0.1) 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  kfem/Makefile config/Makefile )

