]> git.ipfire.org Git - collecty.git/blame - configure.ac
psi: Add graph template
[collecty.git] / configure.ac
CommitLineData
2fc9f9a2
MT
1###############################################################################
2# #
3# collecty - The IPFire statictics collection daemon #
4# Copyright (C) 2015 collecty development team #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
21AC_PREREQ([2.64])
22
23AC_INIT([collecty],
0a6887c4 24 [004],
2fc9f9a2
MT
25 [info@ipfire.org],
26 [collecty],
27 [http://git.ipfire.org/?p=oddments/collecty.git;a=summary])
28
29AC_CONFIG_MACRO_DIR([m4])
30AC_CONFIG_AUX_DIR([build-aux])
31
32AC_PREFIX_DEFAULT([/usr])
33
34AM_INIT_AUTOMAKE([
35 foreign
36 1.11
37 -Wall
38 -Wno-portability
39 silent-rules
40 tar-pax
41 subdir-objects
42])
43AM_SILENT_RULES([yes])
30777a6c
MT
44LT_PREREQ(2.2)
45LT_INIT([disable-static])
2fc9f9a2
MT
46
47IT_PROG_INTLTOOL([0.40.0])
48
e3f84d1b
MT
49# Interpret embedded Python in HTML files
50XGETTEXT="${XGETTEXT} -L Python --keyword=_:1,2 --keyword=N_:1,2 --no-location"
51
52GETTEXT_PACKAGE=${PACKAGE_TARNAME}
2fc9f9a2
MT
53AC_SUBST(GETTEXT_PACKAGE)
54
55AC_PROG_LN_S
56AC_PROG_MKDIR_P
57AC_PROG_SED
58
30777a6c
MT
59# C Compiler
60AC_PROG_CC
61AC_PROG_CC_C99
62AC_PROG_CC_C_O
63AC_PROG_GCC_TRADITIONAL
64
9823dfef 65AC_CHECK_HEADERS_ONCE([
a114ba52
MT
66 errno.h
67 fcntl.h
68 linux/hdreg.h
9823dfef 69 mntent.h
a114ba52
MT
70 stdbool.h
71 string.h
72 sys/ioctl.h
73 time.h
9823dfef
MT
74])
75
2fc9f9a2
MT
76AC_PATH_PROG([XSLTPROC], [xsltproc])
77
63f9f8be
MT
78PKG_CHECK_MODULES([OPING], [liboping])
79
2fc9f9a2 80# Python
f37913e8 81AM_PATH_PYTHON([3.2])
297fa319 82PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
30777a6c
MT
83
84# libatasmart
85PKG_CHECK_MODULES([LIBATASMART], [libatasmart >= 0.19])
2fc9f9a2
MT
86
87save_LIBS="$LIBS"
88
c389fccf
MT
89# lm-sensors
90AC_CHECK_HEADERS([sensors/sensors.h sensors/errors.h])
91
92LIBS=
93AC_CHECK_LIB(sensors, sensors_init, [], [AC_MSG_ERROR([*** sensors library not found])])
94SENSORS_LIBS="$LIBS"
95AC_SUBST(SENSORS_LIBS)
96
97LIBS="$save_LIBS"
98
2fc9f9a2
MT
99# pkg-config
100PKG_PROG_PKG_CONFIG
101# This makes sure pkg.m4 is available.
102m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
103
104# ------------------------------------------------------------------------------
105have_manpages=no
106AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages],
107 [do not install man pages]))
108AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
109AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
110
111# ------------------------------------------------------------------------------
112
113AC_ARG_WITH([systemd],
114 AS_HELP_STRING([--with-systemd], [Enable systemd support.])
115)
116
c968f6d9
MT
117AC_ARG_WITH([dbuspolicydir],
118 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
119 [],
120 [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d]
121)
122
123AC_ARG_WITH([dbussystemservicedir],
124 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
125 [],
126 [with_dbussystemservicedir=${datadir}/dbus-1/system-services]
127)
128
2fc9f9a2 129AS_IF([test "x$with_systemd" != "xno"],
32ce4696 130 [PKG_CHECK_MODULES(systemd, [libsystemd],
2fc9f9a2
MT
131 [have_systemd=yes], [have_systemd=no])],
132 [have_systemd=no]
133)
134
135AS_IF([test "x$have_systemd" = "xyes"],
136 [AC_MSG_CHECKING([for systemd system unit directory])
137 AC_ARG_WITH([systemdsystemunitdir],
138 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
139 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]
140 )
141
142 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
143
144 if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then
145 AC_MSG_RESULT([$systemdsystemunitdir])
146 else
147 AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)])
148 fi
149 ],
150 [AS_IF([test "x$with_systemd" = "xyes"],
151 [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.])
152 ])
153])
154
155AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"])
156
c968f6d9
MT
157AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
158AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
159
2fc9f9a2
MT
160# ------------------------------------------------------------------------------
161
162AC_CONFIG_FILES([
163 Makefile
164 po/Makefile.in
73241420 165 src/collecty/__version__.py
2fc9f9a2
MT
166])
167
168AC_OUTPUT
169AC_MSG_RESULT([
170 ${PACKAGE_NAME} ${VERSION}
171
172 prefix: ${prefix}
c968f6d9
MT
173 D-Bus policy dir: ${with_dbuspolicydir}
174 D-Bus system dir: ${with_dbussystemservicedir}
2fc9f9a2
MT
175
176 Systemd support ${have_systemd}
177 Generate man-pages: ${have_manpages}
178])