aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: ee9d081f10daed45b8d243c3ff04d9979e11766e (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
63
64
65
# This file is part of tallyman                              -*- Autoconf -*-
# Copyright (C) 2018, 2019 Sergey Poznyakoff
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.

AC_PREREQ([2.69])
AC_INIT([tallyman], [1.1], [gray+tallyman@gnu.org])
AC_CONFIG_SRCDIR([src/tallyman.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.15 foreign])

# Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
# Check for Net-SNMP
AC_PATH_PROG([NET_SNMP_CONFIG], net-snmp-config, none, $PATH)
if test "$NET_SNMP_CONFIG" = "none"; then
  AC_MSG_ERROR([cannot find Net-SNMP (net-snmp-config not found)])
fi

AC_SUBST(NET_SNMP_LIBS, `$NET_SNMP_CONFIG --agent-libs`)
AC_SUBST(NET_SNMP_MIBDIRS, `$NET_SNMP_CONFIG --mibdirs`)
AC_SUBST(NET_SNMP_MIBS, `$NET_SNMP_CONFIG --default-mibs`)


# Checks for libraries.
save_LIBS=$LIBS
AC_CHECK_LIB([microhttpd],[MHD_start_daemon],[],
             [AC_MSG_ERROR([required library microhttpd not found

Please see https://www.gnu.org/software/libmicrohttpd for download instructions.])])
AC_CHECK_LIB([pthread],[pthread_sigmask])
AC_CHECK_LIB([wrap], [main])
AC_CHECK_LIB([nsl], [main])
DAEMON_LIBS="$LIBS"
LIBS=$save_LIBS
AC_SUBST(DAEMON_LIBS)

# Checks for header files.
AC_CHECK_HEADERS([tcpd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T

# Checks for library functions.

GRECS_SETUP(,[tree-api json])
RUNCAP_SETUP

AM_CONDITIONAL([TMD_WRAP],[test x$ac_cv_lib_wrap_main = xyes && test x$ac_cv_header_tcpd_h = xyes])

# Directories
AC_SUBST([MIBDIR],['$(datarootdir)/snmp/mibs'])
AC_ARG_WITH([mibdir],
 [AC_HELP_STRING([--with-mibdir=DIR],
                 [installation directory for MIB files])],
 [case $withval in
  /*) MIBDIR=$withval;;
  *)  AC_MSG_ERROR([argument to --with-mibdir must be absolute pathname])
  esac])

AC_OUTPUT([Makefile
           src/Makefile])

Return to:

Send suggestions and report system problems to the System administrator.