]>
Commit | Line | Data |
---|---|---|
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 | ||
21 | AC_PREREQ([2.64]) | |
22 | ||
23 | AC_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 | ||
29 | AC_CONFIG_MACRO_DIR([m4]) | |
30 | AC_CONFIG_AUX_DIR([build-aux]) | |
31 | ||
32 | AC_PREFIX_DEFAULT([/usr]) | |
33 | ||
34 | AM_INIT_AUTOMAKE([ | |
35 | foreign | |
36 | 1.11 | |
37 | -Wall | |
38 | -Wno-portability | |
39 | silent-rules | |
40 | tar-pax | |
41 | subdir-objects | |
42 | ]) | |
43 | AM_SILENT_RULES([yes]) | |
30777a6c MT |
44 | LT_PREREQ(2.2) |
45 | LT_INIT([disable-static]) | |
2fc9f9a2 MT |
46 | |
47 | IT_PROG_INTLTOOL([0.40.0]) | |
48 | ||
49 | GETTEXT_PACKAGE=collecty | |
50 | AC_SUBST(GETTEXT_PACKAGE) | |
51 | ||
52 | AC_PROG_LN_S | |
53 | AC_PROG_MKDIR_P | |
54 | AC_PROG_SED | |
55 | ||
30777a6c MT |
56 | # C Compiler |
57 | AC_PROG_CC | |
58 | AC_PROG_CC_C99 | |
59 | AC_PROG_CC_C_O | |
60 | AC_PROG_GCC_TRADITIONAL | |
61 | ||
9823dfef | 62 | AC_CHECK_HEADERS_ONCE([ |
a114ba52 MT |
63 | errno.h |
64 | fcntl.h | |
65 | linux/hdreg.h | |
9823dfef | 66 | mntent.h |
a114ba52 MT |
67 | stdbool.h |
68 | string.h | |
69 | sys/ioctl.h | |
70 | time.h | |
9823dfef MT |
71 | ]) |
72 | ||
2fc9f9a2 MT |
73 | AC_PATH_PROG([XSLTPROC], [xsltproc]) |
74 | ||
63f9f8be MT |
75 | PKG_CHECK_MODULES([OPING], [liboping]) |
76 | ||
2fc9f9a2 | 77 | # Python |
f37913e8 | 78 | AM_PATH_PYTHON([3.2]) |
297fa319 | 79 | PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}]) |
30777a6c MT |
80 | |
81 | # libatasmart | |
82 | PKG_CHECK_MODULES([LIBATASMART], [libatasmart >= 0.19]) | |
2fc9f9a2 MT |
83 | |
84 | save_LIBS="$LIBS" | |
85 | ||
c389fccf MT |
86 | # lm-sensors |
87 | AC_CHECK_HEADERS([sensors/sensors.h sensors/errors.h]) | |
88 | ||
89 | LIBS= | |
90 | AC_CHECK_LIB(sensors, sensors_init, [], [AC_MSG_ERROR([*** sensors library not found])]) | |
91 | SENSORS_LIBS="$LIBS" | |
92 | AC_SUBST(SENSORS_LIBS) | |
93 | ||
94 | LIBS="$save_LIBS" | |
95 | ||
2fc9f9a2 MT |
96 | # pkg-config |
97 | PKG_PROG_PKG_CONFIG | |
98 | # This makes sure pkg.m4 is available. | |
99 | m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) | |
100 | ||
101 | # ------------------------------------------------------------------------------ | |
102 | have_manpages=no | |
103 | AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages], | |
104 | [do not install man pages])) | |
105 | AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes]) | |
106 | AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"]) | |
107 | ||
108 | # ------------------------------------------------------------------------------ | |
109 | ||
110 | AC_ARG_WITH([systemd], | |
111 | AS_HELP_STRING([--with-systemd], [Enable systemd support.]) | |
112 | ) | |
113 | ||
c968f6d9 MT |
114 | AC_ARG_WITH([dbuspolicydir], |
115 | AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]), | |
116 | [], | |
117 | [with_dbuspolicydir=${sysconfdir}/dbus-1/system.d] | |
118 | ) | |
119 | ||
120 | AC_ARG_WITH([dbussystemservicedir], | |
121 | AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]), | |
122 | [], | |
123 | [with_dbussystemservicedir=${datadir}/dbus-1/system-services] | |
124 | ) | |
125 | ||
2fc9f9a2 | 126 | AS_IF([test "x$with_systemd" != "xno"], |
32ce4696 | 127 | [PKG_CHECK_MODULES(systemd, [libsystemd], |
2fc9f9a2 MT |
128 | [have_systemd=yes], [have_systemd=no])], |
129 | [have_systemd=no] | |
130 | ) | |
131 | ||
132 | AS_IF([test "x$have_systemd" = "xyes"], | |
133 | [AC_MSG_CHECKING([for systemd system unit directory]) | |
134 | AC_ARG_WITH([systemdsystemunitdir], | |
135 | AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), | |
136 | [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)] | |
137 | ) | |
138 | ||
139 | AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) | |
140 | ||
141 | if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then | |
142 | AC_MSG_RESULT([$systemdsystemunitdir]) | |
143 | else | |
144 | AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)]) | |
145 | fi | |
146 | ], | |
147 | [AS_IF([test "x$with_systemd" = "xyes"], | |
148 | [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.]) | |
149 | ]) | |
150 | ]) | |
151 | ||
152 | AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"]) | |
153 | ||
c968f6d9 MT |
154 | AC_SUBST([dbuspolicydir], [$with_dbuspolicydir]) |
155 | AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir]) | |
156 | ||
2fc9f9a2 MT |
157 | # ------------------------------------------------------------------------------ |
158 | ||
159 | AC_CONFIG_FILES([ | |
160 | Makefile | |
161 | po/Makefile.in | |
73241420 | 162 | src/collecty/__version__.py |
2fc9f9a2 MT |
163 | ]) |
164 | ||
165 | AC_OUTPUT | |
166 | AC_MSG_RESULT([ | |
167 | ${PACKAGE_NAME} ${VERSION} | |
168 | ||
169 | prefix: ${prefix} | |
c968f6d9 MT |
170 | D-Bus policy dir: ${with_dbuspolicydir} |
171 | D-Bus system dir: ${with_dbussystemservicedir} | |
2fc9f9a2 MT |
172 | |
173 | Systemd support ${have_systemd} | |
174 | Generate man-pages: ${have_manpages} | |
175 | ]) |