Code

configure.in: Some improvements for Solaris, expecially the swap plugin.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 3 Dec 2008 21:07:24 +0000 (22:07 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 3 Dec 2008 21:50:28 +0000 (22:50 +0100)
If Solaris is detected, "-D_POSIX_PTHREAD_SEMANTICS" will be added to
CPPFLAGS automatically now.

If sys/swap.h is not found, print a message suggesting to build a 64bit
binary. (sys/swap.h cannot be included when a 32bit binary is being built,
but it's most likely present under Solaris.)

Enable the swap plugin only if sys/swap.h has been found (when under
Solaris).

configure.in

index 6fd080a667dc13ba339166be7320536ecbd6f514..8332429ebd0105ae58afe53e5f3fbfea097f1973 100644 (file)
@@ -62,6 +62,11 @@ then
        AC_SUBST(KERNEL_CFLAGS)
 fi
 
+if test "x$ac_system" = "xSolaris"
+then
+       CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+fi
+
 #
 # Checks for header files.
 #
@@ -237,7 +242,8 @@ AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
 ])
 
 # For the swap module
-AC_CHECK_HEADERS(sys/swap.h, [], [],
+have_sys_swap_h="yes"
+AC_CHECK_HEADERS(sys/swap.h, [], [have_sys_swap_h="no"],
 [
 #if HAVE_SYS_TYPES_H
 #  include <sys/types.h>
@@ -247,6 +253,11 @@ AC_CHECK_HEADERS(sys/swap.h, [], [],
 #endif
 ])
 
+if test "x$have_sys_swap_h$ac_system" = "xnoSolaris"
+then
+       AC_MSG_NOTICE([Solaris detected and sys/swap.h not found: Try building a 64bit binary.])
+fi
+
 # For load module
 # For the processes plugin
 # For users module
@@ -2379,10 +2390,14 @@ then
        plugin_disk="yes"
        plugin_interface="yes"
        plugin_memory="yes"
-       plugin_swap="yes"
        plugin_tape="yes"
 fi
 
+if test "x$have_sys_swap_h$with_kstat$ac_system" = "xyesyesSolaris"
+then
+       plugin_swap="yes"
+fi
+
 # libstatgrab
 if test "x$with_libstatgrab" = "xyes"
 then