forked from NETWAYS/check_interfaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
92 lines (68 loc) · 2.38 KB
/
configure.ac
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
AC_PREREQ([2.71])
AC_INIT([check_interfaces],[1.4.1])
AC_PREFIX_DEFAULT(/usr/local/nagios)
AC_PROG_CC()
AC_PROG_INSTALL()
AM_INIT_AUTOMAKE([1.16.5])
AM_SILENT_RULES([yes])
if test "$cross_compiling" != "yes";
then
dnl look for net-snmp-config
AC_PATH_PROG(NETSNMPCONFIG, net-snmp-config)
if test "$ac_cv_path_netsnmpconfig" == "no";
then
AC_MSG_WARN([could not find net-snmp-config - did you install the development package for net-snmp? ])
else
SNMP_CFLAGS=`$NETSNMPCONFIG --cflags`
SNMP_LIBS=`$NETSNMPCONFIG --libs`
CFLAGS="$CFLAGS $SNMP_CFLAGS"
fi
fi
AC_ARG_WITH(snmp-headers,
AS_HELP_STRING([--with-snmp-headers=DIR], [Net-SNMP Include files location]),
[SNMP_HDR_DIR="$withval"]
[CPPFLAGS="$CPPFLAGS -I$withval"])
dnl if specified override SNMP_LIBS
AC_ARG_WITH(snmp-libs,
AS_HELP_STRING([--with-snmp-libs=DIR], [Net-SNMP Shared Library files location]),
[SNMP_LIBS="-lnetsnmp"]
[CFLAGS="$CFLAGS -L$withval"])
AC_CHECK_HEADERS([net-snmp/net-snmp-config.h])
AC_CHECK_LIB(netsnmp, snmp_open)
if test "$ac_cv_header_net_snmp_net_snmp_config_h" != "yes";
then
AC_MSG_ERROR([Net-SNMP Headers Missing])
fi
if test "$ac_cv_lib_netsnmp_snmp_open" != "yes";
then
AC_MSG_ERROR([Net-SNMP library unusable - either it is missing or there are unfulfilled dependencies (e.g. libcrypto)])
fi
dnl look for the pow() function
AC_SEARCH_LIBS(pow, [c m], AC_DEFINE([HAVE_POW]))
dnl look for the getaddrinfo() function
AC_SEARCH_LIBS(getaddrinfo, [c], AC_DEFINE([HAVE_GETADDRINFO]))
AC_CHECK_FUNCS([clock_gettime])
AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([pow])
AC_CHECK_FUNCS([regcomp])
AC_CHECK_FUNCS([setenv])
AC_CHECK_FUNCS([strchr])
AC_CHECK_FUNCS([strrchr])
AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNCS([strtol])
AC_CHECK_FUNCS([strtoull])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADER_STDBOOL
AC_CHECK_TYPES([ptrdiff_t])
AC_FUNC_MALLOC
AC_TYPE_SIZE_T
AC_SUBST([SNMP_LIBS])
dnl Check whether DES encryption is available (might not on RHEL)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>]], [[oid *foo = usmDESPrivProtocol;]])],[AC_DEFINE(HAVE_USM_DES_PRIV_PROTOCOL,1,Define whether we have DES Privacy Protocol)],[])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT