fix build with XCode 4.3
- avoid use of FlatCarbon headers - remove sysroot/syslibroot - fix gemspec files attribute
This commit is contained in:
		
							parent
							
								
									edf041dc7a
								
							
						
					
					
						commit
						965051cdcf
					
				
							
								
								
									
										4
									
								
								Rakefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								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") +
 | 
			
		||||
 | 
			
		||||
@ -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';
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -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"/>
 | 
			
		||||
 | 
			
		||||
@ -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")
 | 
			
		||||
 | 
			
		||||
@ -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*)
 | 
			
		||||
 | 
			
		||||
@ -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)")
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user