configure should test for sys/time.h and sys/timeb.h
[mplib] / src / texk / web2c / mpdir / configure.in
1 dnl Copyright 2008 Taco Hoekwater.
2 dnl
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.
7 dnl
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.
12 dnl
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/>.
15
16 AC_INIT(mp.w)
17 AM_INIT_AUTOMAKE(libmplib,1.0.9)
18 AC_CONFIG_HEADERS(config.h)
19 AM_PROG_LIBTOOL
20
21 AC_LANG_C
22
23 AC_PROG_CC
24
25 AC_PROG_MAKE_SET
26
27 AC_HEADER_STDC
28
29 AC_HEADER_DIRENT
30
31 AC_CHECK_HEADERS(unistd.h,, AC_MSG_ERROR(required header file missing))
32
33 AC_CHECK_HEADERS(sys/stat.h sys/wait.h sys/time.h sys/timeb.h)
34
35 AC_ARG_ENABLE([lua],
36      [AS_HELP_STRING([--enable-lua],
37                      [build lua module (default is no)])],
38      [case "${enableval}" in
39        yes) lua=true ;;
40        no)  lua=false ;;
41        *) AC_MSG_ERROR([bad value ${enableval} for --enable-lua]) ;;
42      esac],[lua=false])
43
44 AC_CHECK_HEADERS(lua.h,,[lua=false])
45
46 AS_IF([test x$lua = xtrue],
47       AC_MSG_NOTICE([Will build the Lua module]),
48       AC_MSG_NOTICE([Skipping the lua module]))
49
50 AM_CONDITIONAL([WITH_LUA], [test x$lua = xtrue])
51
52 AC_CHECK_FUNCS(access atoi,,AC_MSG_ERROR(required standard library function missing))
53
54 AC_CHECK_FUNCS(snprintf gettimeofday ftime mkstemp mktemp)
55
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])
63 fi
64 ])
65
66 KPSE_STRUCT_ST_MTIM
67
68
69 AC_OUTPUT(Makefile)
70