Disable LFS flags to avoid 32-bit solaris sys/swap.h error
authorDoug MacEachern <dougm@hyperic.com>
Fri, 22 May 2009 22:03:57 +0000 (15:03 -0700)
committerFlorian Forster <octo@huhu.verplant.org>
Wed, 27 May 2009 08:58:49 +0000 (10:58 +0200)
configure.in
src/swap.c

index 0fd6e78..062f8aa 100644 (file)
@@ -266,6 +266,8 @@ AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [],
 have_sys_swap_h="yes"
 AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"],
 [
+#undef _FILE_OFFSET_BITS
+#undef _LARGEFILE64_SOURCE
 #if HAVE_SYS_TYPES_H
 #  include <sys/types.h>
 #endif
index 1779f86..de9b5f3 100644 (file)
  *   Florian octo Forster <octo at verplant.org>
  **/
 
+#if HAVE_CONFIG_H
+# include "config.h"
+# undef HAVE_CONFIG_H
+#endif
+/* avoid swap.h error "Cannot use swapctl in the large files compilation environment" */
+#if HAVE_SYS_SWAP_H && !defined(_LP64) && _FILE_OFFSET_BITS == 64
+#  undef _FILE_OFFSET_BITS
+#  undef _LARGEFILE64_SOURCE
+#endif
+
 #include "collectd.h"
 #include "common.h"
 #include "plugin.h"