summaryrefslogtreecommitdiff
path: root/configure.in
blob: adf55f4d45e1f808f49e6130a3e61f977899c6da (plain)
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
# Process this file with autoconf to produce a configure script.
AC_INIT(bsnmp-regex, 0.1.90, nielsen@memberwebs.com)
AM_INIT_AUTOMAKE(bsnmp-regex, 0.1.90)

AC_CONFIG_SRCDIR([module/bsnmp-regex.c])
AM_CONFIG_HEADER([config.h])

LDFLAGS="$LDFLAGS -L/usr/local/lib"
CFLAGS="$CFLAGS -I/usr/local/include"

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL

AC_CHECK_PROG(GENSNMPTREE, gensnmptree, "gensnmptree") 
if test -z "$GENSNMPTREE"; then 
    echo "ERROR: gensnmptree program not found." 
    exit 1 
fi

# Debug mode
AC_ARG_ENABLE(debug, 
        AC_HELP_STRING([--enable-debug],
        [Compile binaries in debug mode]))

if test "$enable_debug" = "yes"; then
    CFLAGS="$CFLAGS -g -O0 -Wall"
    AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
    echo "enabling debug compile mode"
fi

# Checks for header files.
AC_HEADER_STDC

AC_ARG_ENABLE(pcre,
        AC_HELP_STRING([--with-pcre],
        [Use PCRE instead of the default regular expression library]))
        
if test "$enable_pcre" = "yes"; then
    AC_CHECK_LIB(pcre, pcre_compile, , 
        [echo "Couldn't find the pcre library"; exit 1])
    AC_CHECK_HEADERS("pcre.h", , 
        [echo "Couldn't find pcre headers"; exit 1])
    AC_DEFINE_UNQUOTED(WITH_PCRE, 1, [Use PCRE regular expression library])
fi

AC_CHECK_HEADERS([sys/queue.h sys/limits.h sys/stat.h sys/time.h sys/un.h], , 
        [echo "ERROR: required header not found."; exit 1]) 
AC_CHECK_HEADERS([bsnmp/snmpmod.h], , 
        [echo "ERROR: required bsnmp header not found." exit 1]) 
    
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MEMCMP

AC_CONFIG_FILES([Makefile module/Makefile tools/Makefile doc/Makefile])
AC_OUTPUT