1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(db/db.c)
AC_CONFIG_HEADER(obj/db-config.h)
dnl checks for programs
AC_PROG_CC
AC_PROG_RANLIB
AC_PATH_PROG(FALSE,false,:)
AC_PATH_PROG(SH,sh,$FALSE)
AC_PATH_PROG(SH5,sh5,$FALSE)
AC_PATH_PROG(BASH,bash,$FALSE)
AC_CACHE_CHECK([checking for shell with functions],local_cv_program_fctsh,
[if $SH -c 'foo() { true; }; foo' > /dev/null 2>&1; then
local_cv_program_fctsh=$SH
else
if $SH5 -c 'foo() { true; }; foo' > /dev/null 2>&1; then
local_cv_program_fctsh=$SH5
else
if $BASH -c 'foo() { true; }; foo' > /dev/null 2>&1; then
local_cv_program_fctsh=$BASH
else
local_cv_program_fctsh=$FALSE
fi
fi
fi])
FCTSH=$local_cv_program_fctsh
AC_SUBST(FCTSH)
dnl checks for libraries
dnl checks for header files
AC_CHECK_HEADERS(unistd.h)
dnl checks for typedefs
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(u_char, unsigned char)
AC_CHECK_TYPE(u_short, unsigned short)
AC_CHECK_TYPE(u_int, unsigned int)
AC_CHECK_TYPE(u_long, unsigned long)
AC_CHECK_TYPE(int8_t, signed char)
AC_CHECK_TYPE(u_int8_t, unsigned char)
AC_CHECK_TYPE(int16_t, short)
AC_CHECK_TYPE(u_int16_t, unsigned short)
AC_CHECK_TYPE(int32_t, int)
AC_CHECK_TYPE(u_int32_t, unsigned int)
dnl checks for structures
dnl checks for compiler characteristics
AC_C_BIGENDIAN
AC_C_CONST
AC_CHECK_SIZEOF(int)
dnl checks for library functions
AC_CHECK_FUNC(memmove,,MEMMOVE_OBJ=memmove.o)
AC_CHECK_FUNC(mkstemp,,MKSTEMP_OBJ=mkstemp.o)
AC_CHECK_FUNC(strerror,,STRERROR_OBJ=strerror.o)
AC_SUBST(MEMMOVE_OBJ)
AC_SUBST(MKSTEMP_OBJ)
AC_SUBST(STRERROR_OBJ)
AC_CHECK_FUNCS(memmove mkstemp strerror)
dnl checks for system services
AC_OUTPUT(Makefile obj/Makefile)
|