9e9b4660cf875b5f602b9bcbee88f5188dc68ff3
1 SUBDIRS = libconfig
2 if BUILD_WITH_OWN_LIBOPING
3 SUBDIRS += liboping
4 endif
6 if COMPILER_IS_GCC
7 AM_CFLAGS = -Wall -Werror
8 endif
10 sbin_PROGRAMS = collectd
12 collectd_SOURCES = collectd.c collectd.h \
13 utils_debug.c utils_debug.h \
14 utils_mount.c utils_mount.h \
15 utils_ignorelist.c utils_ignorelist.h \
16 common.c common.h \
17 network.c network.h \
18 plugin.c plugin.h \
19 configfile.c configfile.h
20 collectd_CPPFLAGS = $(LTDLINCL)
21 collectd_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
22 collectd_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
23 if BUILD_FEATURE_DAEMON
24 collectd_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
25 endif
26 collectd_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
27 if BUILD_FEATURE_DEBUG
28 collectd_CPPFLAGS += -DLOGFILE='"${localstatedir}/log/${PACKAGE_NAME}/collectd.log"'
29 endif
31 # Link to these libraries..
32 collectd_LDFLAGS = -export-dynamic
33 if BUILD_WITH_RRDTOOL
34 collectd_LDFLAGS += -lm -lrrd
35 endif
36 if BUILD_WITH_LIBRT
37 collectd_LDFLAGS += -lrt
38 endif
39 if BUILD_WITH_LIBSOCKET
40 collectd_LDFLAGS += -lsocket
41 endif
42 if BUILD_WITH_LIBRESOLV
43 collectd_LDFLAGS += -lresolv
44 endif
45 if BUILD_WITH_LIBKSTAT
46 collectd_LDFLAGS += -lkstat
47 endif
48 if BUILD_WITH_LIBDEVINFO
49 collectd_LDFLAGS += -ldevinfo
50 endif
52 if BUILD_WITH_LIBSTATGRAB
53 if BUILD_WITH_LIBKVM
54 collectd_LDFLAGS += -lkvm
55 endif
56 if BUILD_WITH_LIBDEVSTAT
57 collectd_LDFLAGS += -ldevstat
58 endif
59 collectd_LDFLAGS += -lstatgrab
60 endif
63 collectd_LDADD = $(LIBLTDL) libconfig/libconfig.la "-dlopen" self
64 collectd_DEPENDENCIES = $(LIBLTDL) libconfig/libconfig.la
66 pkglib_LTLIBRARIES =
68 if BUILD_MODULE_APACHE
69 pkglib_LTLIBRARIES += apache.la
70 apache_la_SOURCES = apache.c
71 apache_la_LDFLAGS = -module -avoid-version
72 if BUILD_WITH_LIBCURL
73 apache_la_LDFLAGS += $(BUILD_WITH_LIBCURL_LIBS)
74 endif
75 collectd_LDADD += "-dlopen" apache.la
76 collectd_DEPENDENCIES += apache.la
77 endif
79 if BUILD_MODULE_APCUPS
80 pkglib_LTLIBRARIES += apcups.la
81 apcups_la_SOURCES = apcups.c
82 apcups_la_LDFLAGS = -module -avoid-version
83 if BUILD_WITH_LIBSOCKET
84 apcups_la_LDFLAGS += -lsocket
85 endif
86 collectd_LDADD += "-dlopen" apcups.la
87 collectd_DEPENDENCIES += apcups.la
88 endif
90 if BUILD_MODULE_APPLE_SENSORS
91 pkglib_LTLIBRARIES += apple_sensors.la
92 apple_sensors_la_SOURCES = apple_sensors.c
93 apple_sensors_la_LDFLAGS = -module -avoid-version
94 if BUILD_WITH_LIBIOKIT
95 apple_sensors_la_LDFLAGS += -lIOKit
96 endif
97 collectd_LDADD += "-dlopen" apple_sensors.la
98 collectd_DEPENDENCIES += apple_sensors.la
99 endif
101 if BUILD_MODULE_BATTERY
102 pkglib_LTLIBRARIES += battery.la
103 battery_la_SOURCES = battery.c
104 battery_la_LDFLAGS = -module -avoid-version
105 if BUILD_WITH_LIBIOKIT
106 battery_la_LDFLAGS += -lIOKit
107 endif
108 collectd_LDADD += "-dlopen" battery.la
109 collectd_DEPENDENCIES += battery.la
110 endif
112 if BUILD_MODULE_CPU
113 pkglib_LTLIBRARIES += cpu.la
114 cpu_la_SOURCES = cpu.c
115 cpu_la_LDFLAGS = -module -avoid-version
116 if BUILD_WITH_LIBKSTAT
117 cpu_la_LDFLAGS += -lkstat
118 endif
119 if BUILD_WITH_LIBDEVINFO
120 cpu_la_LDFLAGS += -ldevinfo
121 endif
122 collectd_LDADD += "-dlopen" cpu.la
123 collectd_DEPENDENCIES += cpu.la
124 endif
126 if BUILD_MODULE_CPUFREQ
127 pkglib_LTLIBRARIES += cpufreq.la
128 cpufreq_la_SOURCES = cpufreq.c
129 cpufreq_la_LDFLAGS = -module -avoid-version
130 collectd_LDADD += "-dlopen" cpufreq.la
131 collectd_DEPENDENCIES += cpufreq.la
132 endif
134 if BUILD_MODULE_DF
135 pkglib_LTLIBRARIES += df.la
136 df_la_SOURCES = df.c
137 df_la_LDFLAGS = -module -avoid-version
138 collectd_LDADD += "-dlopen" df.la
139 collectd_DEPENDENCIES += df.la
140 endif
142 if BUILD_MODULE_DISK
143 pkglib_LTLIBRARIES += disk.la
144 disk_la_SOURCES = disk.c
145 disk_la_LDFLAGS = -module -avoid-version
146 if BUILD_WITH_LIBKSTAT
147 disk_la_LDFLAGS += -lkstat
148 endif
149 if BUILD_WITH_LIBDEVINFO
150 disk_la_LDFLAGS += -ldevinfo
151 endif
152 if BUILD_WITH_LIBIOKIT
153 disk_la_LDFLAGS += -lIOKit
154 endif
155 collectd_LDADD += "-dlopen" disk.la
156 collectd_DEPENDENCIES += disk.la
157 endif
159 if BUILD_MODULE_DNS
160 pkglib_LTLIBRARIES += dns.la
161 dns_la_SOURCES = dns.c utils_dns.c
162 dns_la_LDFLAGS = -module -avoid-version
163 if BUILD_WITH_LIBPCAP
164 dns_la_LDFLAGS += -lpcap
165 endif
166 if BUILD_WITH_LIBPTHREAD
167 dns_la_LDFLAGS += -lpthread
168 endif
169 collectd_LDADD += "-dlopen" dns.la
170 collectd_DEPENDENCIES += dns.la
171 endif
173 if BUILD_MODULE_EMAIL
174 pkglib_LTLIBRARIES += email.la
175 email_la_SOURCES = email.c
176 email_la_LDFLAGS = -module -avoid-version -lpthread
177 collectd_LDADD += "-dlopen" email.la
178 collectd_DEPENDENCIES += email.la
179 endif
181 #if BUILD_MODULE_QUOTA
182 #pkglib_LTLIBRARIES += quota.la
183 #quota_la_SOURCES = quota_plugin.c quota_plugin.h
184 #quota_la_SOURCES += quota_fs.c quota_fs.h
185 #quota_la_SOURCES += quota_mnt.c quota_mnt.h
186 #quota_la_LDFLAGS = -module -avoid-version
187 #quota_la_CFLAGS = -Werror
188 #collectd_LDADD += "-dlopen" quota.la
189 #collectd_DEPENDENCIES += quota.la
190 #endif
192 if BUILD_MODULE_HDDTEMP
193 pkglib_LTLIBRARIES += hddtemp.la
194 hddtemp_la_SOURCES = hddtemp.c
195 hddtemp_la_LDFLAGS = -module -avoid-version
196 if BUILD_WITH_LIBSOCKET
197 hddtemp_la_LDFLAGS += -lsocket
198 endif
199 collectd_LDADD += "-dlopen" hddtemp.la
200 collectd_DEPENDENCIES += hddtemp.la
201 endif
203 if BUILD_MODULE_LOAD
204 pkglib_LTLIBRARIES += load.la
205 load_la_SOURCES = load.c
206 load_la_LDFLAGS = -module -avoid-version
207 collectd_LDADD += "-dlopen" load.la
208 collectd_DEPENDENCIES += load.la
209 if BUILD_WITH_LIBSTATGRAB
210 if BUILD_WITH_LIBKVM
211 load_la_LDFLAGS += -lkvm
212 endif
213 if BUILD_WITH_LIBDEVSTAT
214 load_la_LDFLAGS += -ldevstat
215 endif
216 load_la_LDFLAGS += -lstatgrab
217 endif
218 endif
220 if BUILD_MODULE_MEMORY
221 pkglib_LTLIBRARIES += memory.la
222 memory_la_SOURCES = memory.c
223 memory_la_LDFLAGS = -module -avoid-version
224 collectd_LDADD += "-dlopen" memory.la
225 collectd_DEPENDENCIES += memory.la
226 if BUILD_WITH_LIBKSTAT
227 memory_la_LDFLAGS += -lkstat
228 endif
229 if BUILD_WITH_LIBDEVINFO
230 memory_la_LDFLAGS += -ldevinfo
231 endif
232 if BUILD_WITH_LIBSTATGRAB
233 if BUILD_WITH_LIBKVM
234 memory_la_LDFLAGS += -lkvm
235 endif
236 if BUILD_WITH_LIBDEVSTAT
237 memory_la_LDFLAGS += -ldevstat
238 endif
239 memory_la_LDFLAGS += -lstatgrab
240 endif
241 endif
243 if BUILD_MODULE_MULTIMETER
244 pkglib_LTLIBRARIES += multimeter.la
245 multimeter_la_SOURCES = multimeter.c
246 multimeter_la_LDFLAGS = -module -avoid-version
247 collectd_LDADD += "-dlopen" multimeter.la
248 collectd_DEPENDENCIES += multimeter.la
249 endif
251 if BUILD_MODULE_MYSQL
252 pkglib_LTLIBRARIES += mysql.la
253 mysql_la_SOURCES = mysql.c
254 mysql_la_LDFLAGS = -module -avoid-version
255 if BUILD_WITH_LIBMYSQL
256 mysql_la_LDFLAGS += -lmysqlclient
257 endif
258 collectd_LDADD += "-dlopen" mysql.la
259 collectd_DEPENDENCIES += mysql.la
260 endif
262 if BUILD_MODULE_NFS
263 pkglib_LTLIBRARIES += nfs.la
264 nfs_la_SOURCES = nfs.c
265 nfs_la_LDFLAGS = -module -avoid-version
266 collectd_LDADD += "-dlopen" nfs.la
267 collectd_DEPENDENCIES += nfs.la
268 endif
270 if BUILD_MODULE_NTPD
271 pkglib_LTLIBRARIES += ntpd.la
272 ntpd_la_SOURCES = ntpd.c
273 ntpd_la_LDFLAGS = -module -avoid-version
274 if BUILD_WITH_LIBSOCKET
275 ntpd_la_LDFLAGS += -lsocket
276 endif
277 collectd_LDADD += "-dlopen" ntpd.la
278 collectd_DEPENDENCIES += ntpd.la
279 endif
281 if BUILD_MODULE_PING
282 pkglib_LTLIBRARIES += ping.la
283 ping_la_SOURCES = ping.c
284 ping_la_LDFLAGS = -module -avoid-version
285 if BUILD_WITH_LIBOPING
286 if BUILD_WITH_OWN_LIBOPING
287 ping_la_LIBADD = liboping/liboping.la
288 ping_la_DEPENDENCIES = liboping/liboping.la
289 else
290 ping_la_LDFLAGS += -loping
291 endif
292 endif
293 collectd_LDADD += "-dlopen" ping.la
294 collectd_DEPENDENCIES += ping.la
295 endif
297 if BUILD_MODULE_PROCESSES
298 pkglib_LTLIBRARIES += processes.la
299 processes_la_SOURCES = processes.c
300 processes_la_LDFLAGS = -module -avoid-version
301 collectd_LDADD += "-dlopen" processes.la
302 collectd_DEPENDENCIES += processes.la
303 endif
305 if BUILD_MODULE_SENSORS
306 pkglib_LTLIBRARIES += sensors.la
307 sensors_la_SOURCES = sensors.c
308 sensors_la_LDFLAGS = -module -avoid-version
309 if BUILD_WITH_LM_SENSORS
310 sensors_la_LDFLAGS += -lsensors
311 endif
312 collectd_LDADD += "-dlopen" sensors.la
313 collectd_DEPENDENCIES += sensors.la
314 endif
316 if BUILD_MODULE_SERIAL
317 pkglib_LTLIBRARIES += serial.la
318 serial_la_SOURCES = serial.c
319 serial_la_LDFLAGS = -module -avoid-version
320 collectd_LDADD += "-dlopen" serial.la
321 collectd_DEPENDENCIES += serial.la
322 endif
324 if BUILD_MODULE_SWAP
325 pkglib_LTLIBRARIES += swap.la
326 swap_la_SOURCES = swap.c
327 swap_la_LDFLAGS = -module -avoid-version
328 collectd_LDADD += "-dlopen" swap.la
329 collectd_DEPENDENCIES += swap.la
330 if BUILD_WITH_LIBKSTAT
331 swap_la_LDFLAGS += -lkstat
332 endif
333 if BUILD_WITH_LIBDEVINFO
334 swap_la_LDFLAGS += -ldevinfo
335 endif
336 if BUILD_WITH_LIBKVM
337 swap_la_LDFLAGS += -lkvm
338 endif
339 if BUILD_WITH_LIBSTATGRAB
340 if BUILD_WITH_LIBDEVSTAT
341 swap_la_LDFLAGS += -ldevstat
342 endif
343 swap_la_LDFLAGS += -lstatgrab
344 endif
345 endif
347 if BUILD_MODULE_TAPE
348 pkglib_LTLIBRARIES += tape.la
349 tape_la_SOURCES = tape.c
350 tape_la_LDFLAGS = -module -avoid-version
351 if BUILD_WITH_LIBKSTAT
352 tape_la_LDFLAGS += -lkstat
353 endif
354 if BUILD_WITH_LIBDEVINFO
355 tape_la_LDFLAGS += -ldevinfo
356 endif
357 collectd_LDADD += "-dlopen" tape.la
358 collectd_DEPENDENCIES += tape.la
359 endif
361 if BUILD_MODULE_TRAFFIC
362 pkglib_LTLIBRARIES += traffic.la
363 traffic_la_SOURCES = traffic.c
364 traffic_la_LDFLAGS = -module -avoid-version
365 collectd_LDADD += "-dlopen" traffic.la
366 collectd_DEPENDENCIES += traffic.la
367 if BUILD_WITH_LIBKSTAT
368 traffic_la_LDFLAGS += -lkstat
369 endif
370 if BUILD_WITH_LIBDEVINFO
371 traffic_la_LDFLAGS += -ldevinfo
372 endif
373 if BUILD_WITH_LIBSTATGRAB
374 if BUILD_WITH_LIBKVM
375 traffic_la_LDFLAGS += -lkvm
376 endif
377 if BUILD_WITH_LIBDEVSTAT
378 traffic_la_LDFLAGS += -ldevstat
379 endif
380 traffic_la_LDFLAGS += -lstatgrab
381 endif
382 endif
384 if BUILD_MODULE_USERS
385 pkglib_LTLIBRARIES += users.la
386 users_la_SOURCES = users.c
387 users_la_LDFLAGS = -module -avoid-version
388 collectd_LDADD += "-dlopen" users.la
389 collectd_DEPENDENCIES += users.la
390 endif
392 if BUILD_MODULE_VSERVER
393 pkglib_LTLIBRARIES += vserver.la
394 vserver_la_SOURCES = vserver.c
395 vserver_la_LDFLAGS = -module -avoid-version
396 collectd_LDADD += "-dlopen" vserver.la
397 collectd_DEPENDENCIES += vserver.la
398 endif
400 if BUILD_MODULE_WIRELESS
401 pkglib_LTLIBRARIES += wireless.la
402 wireless_la_SOURCES = wireless.c
403 wireless_la_LDFLAGS = -module -avoid-version
404 collectd_LDADD += "-dlopen" wireless.la
405 collectd_DEPENDENCIES += wireless.la
406 endif
408 dist_man_MANS = collectd.1 collectd.conf.5
409 #collectd_1_SOURCES = collectd.pod
411 #EXTRA_DIST = $(man_MANS)
413 .pod.1:
414 pod2man --release=$(VERSION) --center=$(PACKAGE) $< >$@
416 .pod.5:
417 pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< >$@
419 install-exec-hook:
420 $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
421 if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \
422 then \
423 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \
424 else \
425 $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
426 fi