1 dnl Copyright 2008 Taco Hoekwater.
3 dnl This program is free software: you can redistribute it and/or modify
4 dnl it under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation, either version 2 of the License, or
6 dnl (at your option) any later version.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 dnl GNU General Public License for more details.
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AM_INIT_AUTOMAKE(libmplib,1.0.9)
18 AC_CONFIG_HEADERS(config.h)
31 AC_CHECK_HEADERS(unistd.h,, AC_MSG_ERROR(required header file missing))
33 AC_CHECK_HEADERS(sys/stat.h sys/wait.h sys/time.h sys/timeb.h)
36 [AS_HELP_STRING([--enable-lua],
37 [build lua module (default is no)])],
38 [case "${enableval}" in
41 *) AC_MSG_ERROR([bad value ${enableval} for --enable-lua]) ;;
44 AC_CHECK_HEADERS(lua.h,,[lua=false])
46 AS_IF([test x$lua = xtrue],
47 AC_MSG_NOTICE([Will build the Lua module]),
48 AC_MSG_NOTICE([Skipping the lua module]))
50 AM_CONDITIONAL([WITH_LUA], [test x$lua = xtrue])
52 AC_CHECK_FUNCS(access atoi,,AC_MSG_ERROR(required standard library function missing))
54 AC_CHECK_FUNCS(snprintf gettimeofday ftime mkstemp mktemp)
56 AC_DEFUN([KPSE_STRUCT_ST_MTIM],
57 [AC_CACHE_CHECK([for st_mtim in struct stat], ac_cv_struct_st_mtim,
58 [AC_TRY_COMPILE([#include <sys/types.h>
59 #include <sys/stat.h>], [struct stat s; s.st_mtim;],
60 ac_cv_struct_st_mtim=yes, ac_cv_struct_st_mtim=no)])
61 if test $ac_cv_struct_st_mtim = yes; then
62 AC_DEFINE([HAVE_ST_MTIM],[1],[Whatever])