Skip to content

Commit

Permalink
fix build with XCode 4.3
Browse files Browse the repository at this point in the history
- avoid use of FlatCarbon headers

- remove sysroot/syslibroot

- fix gemspec files attribute
  • Loading branch information
dougm committed Mar 26, 2012
1 parent edf041d commit 965051c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 36 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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") +
Expand Down
18 changes: 2 additions & 16 deletions bindings/SigarBuild.pm
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,8 @@ sub flags {
}
elsif ($os =~ /(darwin)/) {
$os = $1;
my(@sdks) = reverse sort </Developer/SDKs/MacOSX10.*.sdk>;
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';
}
Expand Down
2 changes: 0 additions & 2 deletions bindings/java/hyperic_jni/jni-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,6 @@
<compilerarg value="${uni.arch}"/>
<compilerarg value="-mmacosx-version-min=${osx.min}"/>

<sysincludepath location="/Developer/Headers/FlatCarbon"/>

<defineset>
<define name="DARWIN"/>
<define name="DARWIN_HAS_LIBPROC_H" if="libproc.h"/>
Expand Down
15 changes: 3 additions & 12 deletions bindings/ruby/extconf.rb
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -26,20 +26,11 @@
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")
Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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*)
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down
3 changes: 1 addition & 2 deletions src/os/darwin/darwin_sigar.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
#endif
#include <mach-o/dyld.h>
#define __OPENTRANSPORTPROVIDERS__
#include <Gestalt.h>
#include <CFString.h>
#include <CoreServices/CoreServices.h>
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOBSD.h>
#include <IOKit/IOKitLib.h>
Expand Down

0 comments on commit 965051c

Please sign in to comment.