From 11b1e65a13bdd28f2cc6a09a7e1cb983b7cc4cdf Mon Sep 17 00:00:00 2001 From: "Manuel Sanmartin (no email)" Date: Mon, 23 Nov 2009 21:52:23 +0100 Subject: [PATCH] =?utf8?q?configure.in:=20When=20building=20on=20AIX,=20ad?= =?utf8?q?d=20=E2=80=9C-lm=E2=80=9D=20when=20checking=20for=20NAN.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- configure.in | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/configure.in b/configure.in index b3d9516e..3d515bf2 100644 --- a/configure.in +++ b/configure.in @@ -61,6 +61,10 @@ case $host_os in *openbsd*) ac_system="OpenBSD" ;; + *aix*) + AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel]) + ac_system="AIX" + ;; *) ac_system="unknown" esac @@ -627,6 +631,8 @@ static float foo = NAN; fi fi if test "x$nan_type" = "xnone"; then + SAVE_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -lm" AC_CACHE_CHECK([whether NAN can be defined by 0/0], [c_cv_have_nan_zero], AC_RUN_IFELSE( @@ -653,6 +659,7 @@ static float foo = NAN; [c_cv_have_nan_zero="no"] ) ) + LDFLAGS=$SAVE_LDFLAGS if test "x$c_cv_have_nan_zero" = "xyes" then nan_type="zero" @@ -1052,6 +1059,38 @@ fi m4_divert_once([HELP_WITH], [ collectd additional packages:]) +AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"]) + +if test "x$ac_system" = "xAIX" +then + with_perfstat="yes" + with_procinfo="yes" +else + with_perfstat="no (AIX only)" + with_procinfo="no (AIX only)" +fi + +if test "x$with_perfstat" = "xyes" +then + AC_CHECK_LIB(perfstat, perfstat_reset, [with_perfstat="yes"], [with_perfstat="no (perfstat not found)"], []) +# AC_CHECK_HEADERS(sys/protosw.h libperfstat.h,, [with_perfstat="no (perfstat not found)"]) +fi +if test "x$with_perfstat" = "xyes" +then + AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)]) +fi +AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes") + +if test "x$with_procinfo" = "xyes" +then + AC_CHECK_HEADERS(procinfo.h,, [with_procinfo="no (procinfo.h not found)"]) +fi +if test "x$with_procinfo" = "xyes" +then + AC_DEFINE(HAVE_PROCINFO_H, 1, [Define to 1 if you have the procinfo.h]) +fi +AM_CONDITIONAL(BUILD_WITH_PROCINFO_H, test "x$with_procinfo" = "xyes") + if test "x$ac_system" = "xSolaris" then with_kstat="yes" @@ -3645,6 +3684,22 @@ then plugin_disk="yes" fi +# AIX +if test "x$with_perfstat" = "xyes" +then + plugin_cpu="yes" + plugin_disk="yes" + plugin_memory="yes" + plugin_swap="yes" + plugin_interface="yes" + plugin_load="yes" +fi + +if test "x$with_procinfo" = "xyes" +then + plugin_processes="yes" +fi + # Solaris if test "x$with_kstat" = "xyes" then -- 2.11.0