dnl Copyright 2008 Taco Hoekwater.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation, either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program 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
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see .
AC_INIT(mp.w)
AM_INIT_AUTOMAKE(libmplib,0.1.0)
AC_CONFIG_HEADERS(config.h)
AM_PROG_LIBTOOL
AC_LANG_C
AC_PROG_CC
AC_PROG_MAKE_SET
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS(unistd.h,, AC_MSG_ERROR(required header file missing))
AC_CHECK_HEADERS(sys/stat.h sys/wait.h)
AC_ARG_ENABLE([lua],
[AS_HELP_STRING([--enable-lua],
[build lua module (default is no)])],
[case "${enableval}" in
yes) lua=true ;;
no) lua=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-lua]) ;;
esac],[lua=false])
AC_CHECK_HEADERS(lua.h,,[lua=false])
AS_IF([test x$lua = xtrue],
AC_MSG_NOTICE([Will build the Lua module]),
AC_MSG_NOTICE([Skipping the lua module]))
AM_CONDITIONAL([WITH_LUA], [test x$lua = xtrue])
AC_CHECK_FUNCS(access atoi,,AC_MSG_ERROR(required standard library function missing))
AC_CHECK_FUNCS(snprintf gettimeofday ftime mkstemp mktemp)
AC_DEFUN([KPSE_STRUCT_ST_MTIM],
[AC_CACHE_CHECK([for st_mtim in struct stat], ac_cv_struct_st_mtim,
[AC_TRY_COMPILE([#include
#include ], [struct stat s; s.st_mtim;],
ac_cv_struct_st_mtim=yes, ac_cv_struct_st_mtim=no)])
if test $ac_cv_struct_st_mtim = yes; then
AC_DEFINE([HAVE_ST_MTIM],[1],[Whatever])
fi
])
KPSE_STRUCT_ST_MTIM
AC_OUTPUT(Makefile)