From 965051cdcfc6e6e6f149534634b04a3d78895226 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 23 Mar 2012 14:51:01 -0700 Subject: [PATCH] fix build with XCode 4.3 - avoid use of FlatCarbon headers - remove sysroot/syslibroot - fix gemspec files attribute --- Rakefile | 4 ++-- bindings/SigarBuild.pm | 18 ++---------------- bindings/java/hyperic_jni/jni-build.xml | 2 -- bindings/ruby/extconf.rb | 15 +++------------ configure.ac | 1 - src/CMakeLists.txt | 1 - src/os/darwin/darwin_sigar.c | 3 +-- 7 files changed, 8 insertions(+), 36 deletions(-) diff --git a/Rakefile b/Rakefile index bac93ae0..dd135bd3 100644 --- a/Rakefile +++ b/Rakefile @@ -22,7 +22,7 @@ spec = Gem::Specification.new do |s| s.name = GEM # s.version = props['version.major'] + '.' + props['version.minor'] + '.' + props['version.maint'] # '0.7.x' until the sigar-1.7.0 release - s.version = '0' + '.' + props['version.minor'] + '.' + '0' + s.version = '0' + '.' + props['version.minor'] + '.' + '1' s.summary = props['project.summary'] s.description = s.summary s.author = props['project.author'] @@ -32,7 +32,7 @@ spec = Gem::Specification.new do |s| s.has_rdoc = false s.extensions = 'bindings/ruby/extconf.rb' s.files = - %w(COPYING EXCEPTIONS README Rakefile version.properties) + + %w(LICENSE NOTICE README Rakefile version.properties) + %w(bindings/SigarWrapper.pm bindings/SigarBuild.pm) + Dir.glob("bindings/ruby/**/*") + Dir.glob("include/*.h") + diff --git a/bindings/SigarBuild.pm b/bindings/SigarBuild.pm index 6662ea9c..d81e6f44 100644 --- a/bindings/SigarBuild.pm +++ b/bindings/SigarBuild.pm @@ -108,22 +108,8 @@ sub flags { } elsif ($os =~ /(darwin)/) { $os = $1; - my(@sdks) = reverse sort ; - my $sdk; - if (@sdks == 0) { - die - "Xcode Developer Tools not installed\n". - "Download from http://developer.apple.com/technology/xcode.html"; - } - else { - #print "Available SDKs...\n(*) " . join("\n ", @sdks) . "\n"; - $sdk = $sdks[0]; - } - @cppflags = ('-DDARWIN', - "-I/Developer/Headers/FlatCarbon -isysroot $sdk"); - @ldflags = ("-Wl,-syslibroot,$sdk", - '-framework CoreServices', - '-framework IOKit'); + @cppflags = ('-DDARWIN'); + @ldflags = ('-framework CoreServices', '-framework IOKit'); if (-e "/usr/local/libproc.h") { push @cppflags, '-DDARWIN_HAS_LIBPROC_H'; } diff --git a/bindings/java/hyperic_jni/jni-build.xml b/bindings/java/hyperic_jni/jni-build.xml index d4556c3a..38abedd9 100644 --- a/bindings/java/hyperic_jni/jni-build.xml +++ b/bindings/java/hyperic_jni/jni-build.xml @@ -356,8 +356,6 @@ - - diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb index 5a03b70b..296a6cd9 100644 --- a/bindings/ruby/extconf.rb +++ b/bindings/ruby/extconf.rb @@ -1,7 +1,7 @@ # # Copyright (c) 2007, 2009 Hyperic, Inc. # Copyright (c) 2009 SpringSource, Inc. -# Copyright (c) 2010 VMware, Inc. +# Copyright (c) 2010-2012 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,20 +26,11 @@ print 'Ruby platform=' + RUBY_PLATFORM + "\n" case RUBY_PLATFORM when /darwin/ os = 'darwin' - sdks = Dir.glob('/Developer/SDKs/MacOSX10.*.sdk').sort.reverse - if sdks.length == 0 - print "Xcode Developer Tools not installed\n" - print "Download from http://developer.apple.com/technology/xcode.html\n" - exit 1 - else - print "Available SDKs...\n(*) " + sdks.join("\n ") + "\n" - sdk = sdks[0] - end if File.file?("/usr/include/libproc.h") $CPPFLAGS += ' -DDARWIN_HAS_LIBPROC_H' end - $CPPFLAGS += ' -DDARWIN -I/Developer/Headers/FlatCarbon -isysroot ' + sdk - $LDFLAGS += ' -Wl,-syslibroot,' + sdk + ' -framework CoreServices -framework IOKit' + $CPPFLAGS += ' -DDARWIN' + $LDFLAGS += ' -framework CoreServices -framework IOKit' when /bsd/ os = 'darwin' have_library("kvm") diff --git a/configure.ac b/configure.ac index 569d6490..099b973c 100644 --- a/configure.ac +++ b/configure.ac @@ -35,7 +35,6 @@ case $host_os in SRC_OS="darwin" AC_DEFINE(DARWIN,[],[running on MacOS X]) AC_DEFINE(SIGAR_TEST_OS_DARWIN, [1], [for the tests]) - SIGAR_INCLUDES="-I /Developer/Headers/FlatCarbon/" SIGAR_LIBS="-framework IOKit -framework CoreServices" ;; *netbsd*) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 40137d07..eff9972c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,7 +40,6 @@ IF(CMAKE_SYSTEM_NAME MATCHES "(Darwin|FreeBSD)") INCLUDE_DIRECTORIES(os/darwin/) IF(CMAKE_SYSTEM_NAME MATCHES "(Darwin)") - INCLUDE_DIRECTORIES(/Developer/Headers/FlatCarbon/) ADD_DEFINITIONS(-DDARWIN) SET(SIGAR_LINK_FLAGS "-framework CoreServices -framework IOKit") ELSE(CMAKE_SYSTEM_NAME MATCHES "(Darwin)") diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index cdcd2b0e..0e154b09 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -50,8 +50,7 @@ #endif #include #define __OPENTRANSPORTPROVIDERS__ -#include -#include +#include #include #include #include