Implement worker thread concept
[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],
08e390fc 24 [002],
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
49GETTEXT_PACKAGE=collecty
50AC_SUBST(GETTEXT_PACKAGE)
51
52AC_PROG_LN_S
53AC_PROG_MKDIR_P
54AC_PROG_SED
55
30777a6c
MT
56# C Compiler
57AC_PROG_CC
58AC_PROG_CC_C99
59AC_PROG_CC_C_O
60AC_PROG_GCC_TRADITIONAL
61
2fc9f9a2
MT
62AC_PATH_PROG([XSLTPROC], [xsltproc])
63
64# Python
65AM_PATH_PYTHON([2.7])
297fa319 66PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
30777a6c
MT
67
68# libatasmart
69PKG_CHECK_MODULES([LIBATASMART], [libatasmart >= 0.19])
2fc9f9a2
MT
70
71save_LIBS="$LIBS"
72
c389fccf
MT
73# lm-sensors
74AC_CHECK_HEADERS([sensors/sensors.h sensors/errors.h])
75
76LIBS=
77AC_CHECK_LIB(sensors, sensors_init, [], [AC_MSG_ERROR([*** sensors library not found])])
78SENSORS_LIBS="$LIBS"
79AC_SUBST(SENSORS_LIBS)
80
81LIBS="$save_LIBS"
82
2fc9f9a2
MT
83# pkg-config
84PKG_PROG_PKG_CONFIG
85# This makes sure pkg.m4 is available.
86m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
87
88# ------------------------------------------------------------------------------
89have_manpages=no
90AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages],
91 [do not install man pages]))
92AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
93AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
94
95# ------------------------------------------------------------------------------
96
97AC_ARG_WITH([systemd],
98 AS_HELP_STRING([--with-systemd], [Enable systemd support.])
99)
100
c968f6d9
MT
101AC_ARG_WITH([dbuspolicydir],
102 AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
103 [],
104 [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d]
105)
106
107AC_ARG_WITH([dbussystemservicedir],
108 AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
109 [],
110 [with_dbussystemservicedir=${datadir}/dbus-1/system-services]
111)
112
2fc9f9a2 113AS_IF([test "x$with_systemd" != "xno"],
32ce4696 114 [PKG_CHECK_MODULES(systemd, [libsystemd],
2fc9f9a2
MT
115 [have_systemd=yes], [have_systemd=no])],
116 [have_systemd=no]
117)
118
119AS_IF([test "x$have_systemd" = "xyes"],
120 [AC_MSG_CHECKING([for systemd system unit directory])
121 AC_ARG_WITH([systemdsystemunitdir],
122 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
123 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]
124 )
125
126 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
127
128 if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then
129 AC_MSG_RESULT([$systemdsystemunitdir])
130 else
131 AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)])
132 fi
133 ],
134 [AS_IF([test "x$with_systemd" = "xyes"],
135 [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.])
136 ])
137])
138
139AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"])
140
c968f6d9
MT
141AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
142AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
143
2fc9f9a2
MT
144# ------------------------------------------------------------------------------
145
146AC_CONFIG_FILES([
147 Makefile
148 po/Makefile.in
149])
150
151AC_OUTPUT
152AC_MSG_RESULT([
153 ${PACKAGE_NAME} ${VERSION}
154
155 prefix: ${prefix}
c968f6d9
MT
156 D-Bus policy dir: ${with_dbuspolicydir}
157 D-Bus system dir: ${with_dbussystemservicedir}
2fc9f9a2
MT
158
159 Systemd support ${have_systemd}
160 Generate man-pages: ${have_manpages}
161])