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
93
94
95
96
97
98
|
# This file is part of Mysqlstat -*- autoconf -*-
# Copyright (C) 2014-2016 Sergey Poznyakoff
#
# Mysqlstat is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# Mysqlstat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mysqlstat. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.69)
AC_INIT([mysqlstat], 0.0.91, [gray@gnu.org])
AC_CONFIG_SRCDIR(src/mysqlstat_mib.mib2c)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
AC_LANG(C)
AM_INIT_AUTOMAKE([gnu tar-ustar])
AC_GNU_SOURCE
AC_PROG_CC
AC_PROG_CC_STDC
if test "x$ac_cv_prog_cc_c99" = xno; then
AC_MSG_ERROR([could not find a C99 compatible compiler])
fi
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
# 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_CONFIG)
# Check for MySQL
AC_SUBST(MYSQL_LIBS)
dirs="/usr/lib/mysql /usr/local/lib/mysql"
case $(uname -m) in
x86_64) dirs=$(echo "$dirs" | sed 's|/lib/|/lib64/|g')" $dirs"
esac
MY_CHECK_LIB(mysqlclient, mysql_real_connect, -lm,
[MYSQL_LIBS="$my_cv_lib_mysqlclient"],
[AC_MSG_ERROR(required library libmysqlclient not found)],
[$dirs])
# Checks for header files.
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Directories
AC_SUBST([DLMODDIR],['$(libdir)/snmp'])
AC_ARG_WITH([dlmoddir],
[AC_HELP_STRING([--with-dlmoddir=DIR],
[installation directory for net-snmp loadable agents])],
[case $withval in
/*) DLMODDIR=$withval;;
*) AC_MSG_ERROR([argument to --with-dlmoddir must be absolute pathname])
esac])
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_SUBST([CONFDIR],['$(sysconfdir)/snmp'])
AC_ARG_WITH([snmp-config-dir],
[AC_HELP_STRING([--with-snmp-config-dir=DIR],
[configuration directory ($(sysconfdir)/snmp)])],
[case $withval in
/*) CONFDIR=$withval;;
*) AC_MSG_ERROR([argument to --with-snmp-config-dir must be absolute pathname])
esac])
# Generate output
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT
|