fix build with XCode 4.3

- avoid use of FlatCarbon headers

- remove sysroot/syslibroot

- fix gemspec files attribute
This commit is contained in:
Doug MacEachern 2012-03-23 14:51:01 -07:00
parent edf041dc7a
commit 965051cdcf
7 changed files with 8 additions and 36 deletions

View File

@ -22,7 +22,7 @@ spec = Gem::Specification.new do |s|
s.name = GEM s.name = GEM
# s.version = props['version.major'] + '.' + props['version.minor'] + '.' + props['version.maint'] # s.version = props['version.major'] + '.' + props['version.minor'] + '.' + props['version.maint']
# '0.7.x' until the sigar-1.7.0 release # '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.summary = props['project.summary']
s.description = s.summary s.description = s.summary
s.author = props['project.author'] s.author = props['project.author']
@ -32,7 +32,7 @@ spec = Gem::Specification.new do |s|
s.has_rdoc = false s.has_rdoc = false
s.extensions = 'bindings/ruby/extconf.rb' s.extensions = 'bindings/ruby/extconf.rb'
s.files = s.files =
%w(COPYING EXCEPTIONS README Rakefile version.properties) + %w(LICENSE NOTICE README Rakefile version.properties) +
%w(bindings/SigarWrapper.pm bindings/SigarBuild.pm) + %w(bindings/SigarWrapper.pm bindings/SigarBuild.pm) +
Dir.glob("bindings/ruby/**/*") + Dir.glob("bindings/ruby/**/*") +
Dir.glob("include/*.h") + Dir.glob("include/*.h") +

View File

@ -108,22 +108,8 @@ sub flags {
} }
elsif ($os =~ /(darwin)/) { elsif ($os =~ /(darwin)/) {
$os = $1; $os = $1;
my(@sdks) = reverse sort </Developer/SDKs/MacOSX10.*.sdk>; @cppflags = ('-DDARWIN');
my $sdk; @ldflags = ('-framework CoreServices', '-framework IOKit');
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');
if (-e "/usr/local/libproc.h") { if (-e "/usr/local/libproc.h") {
push @cppflags, '-DDARWIN_HAS_LIBPROC_H'; push @cppflags, '-DDARWIN_HAS_LIBPROC_H';
} }

View File

@ -356,8 +356,6 @@
<compilerarg value="${uni.arch}"/> <compilerarg value="${uni.arch}"/>
<compilerarg value="-mmacosx-version-min=${osx.min}"/> <compilerarg value="-mmacosx-version-min=${osx.min}"/>
<sysincludepath location="/Developer/Headers/FlatCarbon"/>
<defineset> <defineset>
<define name="DARWIN"/> <define name="DARWIN"/>
<define name="DARWIN_HAS_LIBPROC_H" if="libproc.h"/> <define name="DARWIN_HAS_LIBPROC_H" if="libproc.h"/>

View File

@ -1,7 +1,7 @@
# #
# Copyright (c) 2007, 2009 Hyperic, Inc. # Copyright (c) 2007, 2009 Hyperic, Inc.
# Copyright (c) 2009 SpringSource, 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"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with 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 case RUBY_PLATFORM
when /darwin/ when /darwin/
os = '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") if File.file?("/usr/include/libproc.h")
$CPPFLAGS += ' -DDARWIN_HAS_LIBPROC_H' $CPPFLAGS += ' -DDARWIN_HAS_LIBPROC_H'
end end
$CPPFLAGS += ' -DDARWIN -I/Developer/Headers/FlatCarbon -isysroot ' + sdk $CPPFLAGS += ' -DDARWIN'
$LDFLAGS += ' -Wl,-syslibroot,' + sdk + ' -framework CoreServices -framework IOKit' $LDFLAGS += ' -framework CoreServices -framework IOKit'
when /bsd/ when /bsd/
os = 'darwin' os = 'darwin'
have_library("kvm") have_library("kvm")

View File

@ -35,7 +35,6 @@ case $host_os in
SRC_OS="darwin" SRC_OS="darwin"
AC_DEFINE(DARWIN,[],[running on MacOS X]) AC_DEFINE(DARWIN,[],[running on MacOS X])
AC_DEFINE(SIGAR_TEST_OS_DARWIN, [1], [for the tests]) AC_DEFINE(SIGAR_TEST_OS_DARWIN, [1], [for the tests])
SIGAR_INCLUDES="-I /Developer/Headers/FlatCarbon/"
SIGAR_LIBS="-framework IOKit -framework CoreServices" SIGAR_LIBS="-framework IOKit -framework CoreServices"
;; ;;
*netbsd*) *netbsd*)

View File

@ -40,7 +40,6 @@ IF(CMAKE_SYSTEM_NAME MATCHES "(Darwin|FreeBSD)")
INCLUDE_DIRECTORIES(os/darwin/) INCLUDE_DIRECTORIES(os/darwin/)
IF(CMAKE_SYSTEM_NAME MATCHES "(Darwin)") IF(CMAKE_SYSTEM_NAME MATCHES "(Darwin)")
INCLUDE_DIRECTORIES(/Developer/Headers/FlatCarbon/)
ADD_DEFINITIONS(-DDARWIN) ADD_DEFINITIONS(-DDARWIN)
SET(SIGAR_LINK_FLAGS "-framework CoreServices -framework IOKit") SET(SIGAR_LINK_FLAGS "-framework CoreServices -framework IOKit")
ELSE(CMAKE_SYSTEM_NAME MATCHES "(Darwin)") ELSE(CMAKE_SYSTEM_NAME MATCHES "(Darwin)")

View File

@ -50,8 +50,7 @@
#endif #endif
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
#define __OPENTRANSPORTPROVIDERS__ #define __OPENTRANSPORTPROVIDERS__
#include <Gestalt.h> #include <CoreServices/CoreServices.h>
#include <CFString.h>
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOBSD.h> #include <IOKit/IOBSD.h>
#include <IOKit/IOKitLib.h> #include <IOKit/IOKitLib.h>