dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.7.alpha1)
+AC_INIT(collectd, 3.7.alpha2)
AC_CONFIG_SRCDIR(src/collectd.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
+AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
dnl configure libtool
AC_DISABLE_STATIC
#
AC_HEADER_SYS_WAIT
AC_HEADER_DIRENT
+AC_CHECK_HEADERS(errno.h)
+AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(signal.h)
+AC_CHECK_HEADERS(assert.h)
+AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(sys/select.h)
AC_CHECK_HEADERS(netdb.h)
+AC_CHECK_HEADERS(arpa/inet.h)
+AC_CHECK_HEADERS(netinet/in.h)
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/param.h)
-AC_CHECK_HEADERS(errno.h)
-AC_CHECK_HEADERS(syslog.h)
# For cpu modules
AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
# For load module
AC_CHECK_HEADERS(sys/loadavg.h)
-# For ping module
-AC_CHECK_HEADERS(arpa/inet.h)
-AC_CHECK_HEADERS(netinet/in.h)
-
# For users module
AC_CHECK_HEADERS(utmp.h)
AC_CHECK_HEADERS(utmpx.h)
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNCS(gettimeofday select strdup strtol)
AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket))
-AC_CHECK_FUNCS(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
+AC_CHECK_FUNCS(getaddrinfo getnameinfo)
AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen)
AC_CHECK_FUNCS(strncasecmp strcasecmp)
AC_CHECK_FUNCS(openlog syslog closelog)
AC_MSG_RESULT([$ac_system])
dnl Checks for libraries.
+# FIXME don't link all plugins against these libraries!
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(resolv, res_search)
SUBDIRS += libping
endif
+if COMPILER_IS_GCC
+AM_CFLAGS = -Wall -Werror
+endif
+
sbin_PROGRAMS = collectd
collectd_SOURCES = collectd.c collectd.h \
collectd_CPPFLAGS += -DLOGFILE='"${localstatedir}/log/${PACKAGE_NAME}/collectd.log"'
endif
collectd_LDFLAGS = -export-dynamic
-collectd_CFLAGS = -Wall -Werror
collectd_LDADD = $(LIBLTDL) libconfig/libconfig.la "-dlopen" self
collectd_DEPENDENCIES = $(LIBLTDL) libconfig/libconfig.la
pkglib_LTLIBRARIES += battery.la
battery_la_SOURCES = battery.c
battery_la_LDFLAGS = -module -avoid-version
-battery_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" battery.la
collectd_DEPENDENCIES += battery.la
endif
pkglib_LTLIBRARIES += cpu.la
cpu_la_SOURCES = cpu.c cpu.h
cpu_la_LDFLAGS = -module -avoid-version
-cpu_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" cpu.la
collectd_DEPENDENCIES += cpu.la
endif
pkglib_LTLIBRARIES += cpufreq.la
cpufreq_la_SOURCES = cpufreq.c cpufreq.h
cpufreq_la_LDFLAGS = -module -avoid-version
-cpufreq_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" cpufreq.la
collectd_DEPENDENCIES += cpufreq.la
endif
pkglib_LTLIBRARIES += df.la
df_la_SOURCES = df.c
df_la_LDFLAGS = -module -avoid-version
-df_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" df.la
collectd_DEPENDENCIES += df.la
endif
pkglib_LTLIBRARIES += disk.la
disk_la_SOURCES = disk.c disk.h
disk_la_LDFLAGS = -module -avoid-version
-disk_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" disk.la
collectd_DEPENDENCIES += disk.la
endif
pkglib_LTLIBRARIES += hddtemp.la
hddtemp_la_SOURCES = hddtemp.c hddtemp.h
hddtemp_la_LDFLAGS = -module -avoid-version
-hddtemp_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" hddtemp.la
collectd_DEPENDENCIES += hddtemp.la
endif
pkglib_LTLIBRARIES += load.la
load_la_SOURCES = load.c load.h
load_la_LDFLAGS = -module -avoid-version
-load_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" load.la
collectd_DEPENDENCIES += load.la
endif
pkglib_LTLIBRARIES += memory.la
memory_la_SOURCES = memory.c memory.h
memory_la_LDFLAGS = -module -avoid-version
-memory_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" memory.la
collectd_DEPENDENCIES += memory.la
endif
mysql_la_LDFLAGS += -lmysqlclient
endif
#mysql_la_LIBADD = -lmysqlclient
-mysql_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" mysql.la
collectd_DEPENDENCIES += mysql.la
endif
pkglib_LTLIBRARIES += nfs.la
nfs_la_SOURCES = nfs.c nfs.h
nfs_la_LDFLAGS = -module -avoid-version
-nfs_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" nfs.la
collectd_DEPENDENCIES += nfs.la
endif
ping_la_LDFLAGS = -module -avoid-version
ping_la_LIBADD = libping/libping.la
ping_la_DEPENDENCIES = libping/libping.la
-ping_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" ping.la
collectd_DEPENDENCIES += ping.la
endif
pkglib_LTLIBRARIES += processes.la
processes_la_SOURCES = processes.c processes.h
processes_la_LDFLAGS = -module -avoid-version
-processes_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" processes.la
collectd_DEPENDENCIES += processes.la
endif
sensors_la_LDFLAGS += -lsensors
endif
sensors_la_LIBADD = -lsensors
-sensors_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" sensors.la
collectd_DEPENDENCIES += sensors.la
endif
pkglib_LTLIBRARIES += serial.la
serial_la_SOURCES = serial.c serial.h
serial_la_LDFLAGS = -module -avoid-version
-serial_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" serial.la
collectd_DEPENDENCIES += serial.la
endif
pkglib_LTLIBRARIES += swap.la
swap_la_SOURCES = swap.c swap.h
swap_la_LDFLAGS = -module -avoid-version
-swap_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" swap.la
collectd_DEPENDENCIES += swap.la
endif
pkglib_LTLIBRARIES += tape.la
tape_la_SOURCES = tape.c tape.h
tape_la_LDFLAGS = -module -avoid-version
-tape_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" tape.la
collectd_DEPENDENCIES += tape.la
endif
pkglib_LTLIBRARIES += traffic.la
traffic_la_SOURCES = traffic.c traffic.h
traffic_la_LDFLAGS = -module -avoid-version
-traffic_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" traffic.la
collectd_DEPENDENCIES += traffic.la
endif
pkglib_LTLIBRARIES += users.la
users_la_SOURCES = users.c users.h
users_la_LDFLAGS = -module -avoid-version
-users_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" users.la
collectd_DEPENDENCIES += users.la
endif