-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
64 lines (55 loc) · 1.82 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
AC_PREREQ([2.65])
AC_INIT([transitiv-nagios-plugins], [0.8], [nagios@transitiv.co.uk])
AC_SUBST(PACKAGE_COPYRIGHT,
"Copyright 2015 (c) Transitiv Technologies <info@transitiv.co.uk>"
)
AM_INIT_AUTOMAKE([color-tests dist-bzip2 foreign no-dist-gzip parallel-tests])
# Check for perl
AC_PATH_PROG([PERL], perl, perl)
# Check for required perl modules
# Taken from http://ac-archive.sourceforge.net/ac-archive/ac_prog_perl_modules.html
# Written by Dean Povey <povey@wedgetail.com>
AC_DEFUN([AC_PROG_PERL_MODULES],[dnl
ac_perl_modules="$1"
ac_perl_modules_failed=0
for ac_perl_module in $ac_perl_modules; do
AC_MSG_CHECKING([for perl module $ac_perl_module])
# Would be nice to log result here, but can't rely on autoconf internals
$PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1
if test $? -ne 0; then
AC_MSG_RESULT([no]);
ac_perl_modules_failed=1
else
AC_MSG_RESULT([ok]);
fi
done
# Run optional shell commands
if test "$ac_perl_modules_failed" = 0; then
:
$2
else
:
$3
fi])dnl
AC_PROG_PERL_MODULES([Nagios::Plugin LWP::UserAgent Net::SNMP],,
AC_MSG_ERROR([One or more required Perl modules are missing]))
AC_MSG_CHECKING([whether to install PNP4Nagios templates])
AC_ARG_WITH([pnp-templates],
AS_HELP_STRING([--with-pnp-templates=DIR],
[Specify location to install PNP4Nagios templates @<:@default=DATAROOTDIR/pnp4nagios/html/templates@:>@]),
AC_MSG_RESULT([$with_pnp_templates]), AC_MSG_RESULT([no])
)
# set the default template location if no path is supplied
if test "x$with_pnp_templates" = xyes ; then
with_pnp_templates='${datarootdir}/pnp4nagios/templates'
fi
AC_SUBST(pnpdir, [$with_pnp_templates])
AM_CONDITIONAL([PNPTEMPLATES],
[test -n "${with_pnp_templates}" && test "${with_pnp_template+no}" != no])
AC_CONFIG_FILES([
Makefile
configs/Makefile
plugins/Makefile
templates/Makefile
])
AC_OUTPUT