diff -crB wxruby-2.0.1/rake/rakeconfigure.rb wxruby-2.0.1-fix/rake/rakeconfigure.rb *** wxruby-2.0.1/rake/rakeconfigure.rb 2009-09-09 06:36:50.000000000 +1000 --- wxruby-2.0.1-fix/rake/rakeconfigure.rb 2011-10-01 18:17:02.129813171 +1000 *************** *** 24,33 **** # case anyone is using it $unicode_build = ENV['WXRUBY_NO_UNICODE'] ? false : true - # Exclude certian classes from being built, even if they are present - # in the configuration of wxWidgets. - $excluded_classes = ENV['WXRUBY_EXCLUDED'] ? ENV['WXRUBY_EXCLUDED'].split(",") : [] - # SECOND: get a series of settings from rbconfig; these may be overridden # in the platform-specific rakefiles below # Get ruby's info on how it was built --- 24,29 ---- *************** *** 57,65 **** $link_output_flag = "-o " OBJ_EXT = Config::CONFIG["OBJEXT"] ! # This is now set with the detection of WXRUBY_EXCLUDED ! # some classes are not implemented by WxWidgets on all platforms ! # $excluded_classes = [] # THIRD: load the platform-specific rakefiles; these can extend or # override many of the previously set options. These variables are set --- 53,132 ---- $link_output_flag = "-o " OBJ_EXT = Config::CONFIG["OBJEXT"] ! class WxRubyFeatureInfo ! @explicit_excluded_classes = [] ! ! # Testing the relevant wxWidgets setup.h file to see what ! # features are supported. Note that the presence of OpenGL (for ! # GLCanvas) and Scintilla (for StyledTextCtrl) is tested for in the ! # platform-specific rakefiles. ! ! # The wxWidgets setup.h file contains a series of definitions like ! # #define wxUSE_FOO 1. The location of the file should be set ! # by the platform-specific rakefile. Parse it into a ruby hash: ! def self.features(wxwidgets_setup_h) ! if !@features ! @features = _retrieve_features(wxwidgets_setup_h) ! end ! ! @features ! end ! ! def self.excluded_class?(wxwidgets_setup_h, class_name) ! excluded_classes(wxwidgets_setup_h).include?(class_name) ! end ! ! def self.excluded_classes(wxwidgets_setup_h) ! if !@excluded_classes ! @excluded_classes = _calculate_excluded_classes(wxwidgets_setup_h) ! end ! ! @excluded_classes ! end ! ! def self.exclude_class(class_name) ! @explicit_excluded_classes << class_name ! @excluded_classes = nil ! end ! ! def self._calculate_excluded_classes(wxwidgets_setup_h) ! excluded_classes = [] ! ! # MediaCtrl is not always included or easily built, esp on Linux ! unless features(wxwidgets_setup_h)['wxUSE_MEDIACTRL'] ! excluded_classes += %w|MediaCtrl MediaEvent| ! end ! ! # GraphicsContext is not enabled by default on some platforms ! unless features(wxwidgets_setup_h)['wxUSE_GRAPHICS_CONTEXT'] ! excluded_classes += %w|GCDC GraphicsBrush GraphicsContext GraphicsFont ! GraphicsMatrix GraphicsObject GraphicsPath GraphicsPen| ! end ! ! if not excluded_classes.empty? ! puts "The following wxWidgets features are not available and will be skipped:" ! puts " " + excluded_classes.sort.join("\n ") ! end ! ! excluded_classes + @explicit_excluded_classes ! end ! ! def self._retrieve_features(wxwidgets_setup_h) ! features = {} ! ! File.read(wxwidgets_setup_h).scan(/^#define\s+(\w+)\s+([01])/) do | define | ! features[$1] = $2.to_i.zero? ? false : true ! end ! ! features ! end ! end ! ! # Exclude certian classes from being built, even if they are present ! # in the configuration of wxWidgets. ! if ENV['WXRUBY_EXCLUDED'] ! ENV['WXRUBY_EXCLUDED'].split(",").each { |classname| WxRubyFeatureInfo.exclude_class(classname) } ! end # THIRD: load the platform-specific rakefiles; these can extend or # override many of the previously set options. These variables are set *************** *** 103,138 **** $verbose_flag = '' end - # FIFTH: Testing the relevant wxWidgets setup.h file to see what - # features are supported. Note that the presence of OpenGL (for - # GLCanvas) and Scintilla (for StyledTextCtrl) is tested for in the - # platform-specific rakefiles. - - # The wxWidgets setup.h file contains a series of definitions like - # #define wxUSE_FOO 1. The location of the file should be set - # by the platform-specific rakefile. Parse it into a ruby hash: - WX_FEATURES = {} - - File.read(WXWIDGETS_SETUP_H).scan(/^#define\s+(\w+)\s+([01])/) do | define | - WX_FEATURES[$1] = $2.to_i.zero? ? false : true - end - - # MediaCtrl is not always included or easily built, esp on Linux - unless WX_FEATURES['wxUSE_MEDIACTRL'] - $excluded_classes += %w|MediaCtrl MediaEvent| - end - - # GraphicsContext is not enabled by default on some platforms - unless WX_FEATURES['wxUSE_GRAPHICS_CONTEXT'] - $excluded_classes += %w|GCDC GraphicsBrush GraphicsContext GraphicsFont - GraphicsMatrix GraphicsObject GraphicsPath GraphicsPen| - end - - if not $excluded_classes.empty? - puts "The following wxWidgets features are not available and will be skipped:" - puts " " + $excluded_classes.sort.join("\n ") - end - # SIXTH: Putting it all together # Flags to be passed to the C++ compiler --- 170,175 ---- diff -crB wxruby-2.0.1/rake/rakelinux.rb wxruby-2.0.1-fix/rake/rakelinux.rb *** wxruby-2.0.1/rake/rakelinux.rb 2009-09-09 06:36:50.000000000 +1000 --- wxruby-2.0.1-fix/rake/rakelinux.rb 2011-10-01 18:07:03.818935638 +1000 *************** *** 14,20 **** $extra_ldflags = '-shared' # This class is not available on WXGTK ! $excluded_classes << 'PrinterDC' # Extra libraries that are required on Linux $extra_libs = "-Wl,-Bdynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 " + --- 14,20 ---- $extra_ldflags = '-shared' # This class is not available on WXGTK ! WxRubyFeatureInfo.exclude_class('PrinterDC') # Extra libraries that are required on Linux $extra_libs = "-Wl,-Bdynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 " + diff -crB wxruby-2.0.1/rake/rakemingw.rb wxruby-2.0.1-fix/rake/rakemingw.rb *** wxruby-2.0.1/rake/rakemingw.rb 2009-09-09 06:36:50.000000000 +1000 --- wxruby-2.0.1-fix/rake/rakemingw.rb 2011-10-01 18:51:41.632863159 +1000 *************** *** 79,85 **** if File.exists?(scintilla_lib) windows_libs << scintilla_lib else ! $excluded_classes += %w|StyledTextCtrl StyledTextEvent| end # Test for presence of OpenGL library; link it in if present, skip that --- 79,86 ---- if File.exists?(scintilla_lib) windows_libs << scintilla_lib else ! WxRubyFeatureInfo.exclude_class('StyledTextCtrl') ! WxRubyFeatureInfo.exclude_class('StyledTextEvent') end # Test for presence of OpenGL library; link it in if present, skip that *************** *** 90,96 **** windows_libs << gl_lib WINDOWS_SYS_LIBS << 'opengl32' else ! $excluded_classes += %w|GLCanvas GLContext| end # If either of the above classes are in use, we need to add the contrib --- 91,98 ---- windows_libs << gl_lib WINDOWS_SYS_LIBS << 'opengl32' else ! WxRubyFeatureInfo.exclude_class('GLCanvas') ! WxRubyFeatureInfo.exclude_class('GLContext') end # If either of the above classes are in use, we need to add the contrib Only in wxruby-2.0.1-fix/rake: rakemingw.rb~ diff -crB wxruby-2.0.1/rake/rakemswin.rb wxruby-2.0.1-fix/rake/rakemswin.rb *** wxruby-2.0.1/rake/rakemswin.rb 2009-09-09 06:36:50.000000000 +1000 --- wxruby-2.0.1-fix/rake/rakemswin.rb 2011-10-01 18:49:53.182704105 +1000 *************** *** 64,70 **** if File.exists?(scintilla_lib) windows_libs << scintilla_lib else ! $excluded_classes += %w|StyledTextCtrl StyledTextEvent| end # Test for presence of OpenGL library; link it in if --- 64,71 ---- if File.exists?(scintilla_lib) windows_libs << scintilla_lib else ! WxRubyFeatureInfo.exclude_class('StyledTextCtrl') ! WxRubyFeatureInfo.exclude_class('StyledTextEvent') end # Test for presence of OpenGL library; link it in if *************** *** 73,79 **** if File.exists?(gl_lib) windows_libs << gl_lib else ! $excluded_classes += %w|GLCanvas GLContext| end # Glue them all together into an argument passed to the linker --- 74,81 ---- if File.exists?(gl_lib) windows_libs << gl_lib else ! WxRubyFeatureInfo.exclude_class('GLCanvas') ! WxRubyFeatureInfo.exclude_class('GLContext') end # Glue them all together into an argument passed to the linker Only in wxruby-2.0.1-fix/rake: rakemswin.rb~ diff -crB wxruby-2.0.1/rake/rakeunixish.rb wxruby-2.0.1-fix/rake/rakeunixish.rb *** wxruby-2.0.1/rake/rakeunixish.rb 2009-09-09 06:36:50.000000000 +1000 --- wxruby-2.0.1-fix/rake/rakeunixish.rb 2011-10-01 18:13:17.519483743 +1000 *************** *** 95,108 **** if $macosx stc_lib = $wx_libs[/\S+wx_mac\S+_stc\S+/] if stc_lib.nil? or ( stc_lib !~ /^-l/ and not File.exists?(stc_lib) ) ! $excluded_classes += %w|StyledTextCtrl StyledTextEvent| else libs_str << ',stc' end else stc_lib = $wx_libs[/\S+wx_gtk\S+_stc\S+/] if stc_lib.nil? ! $excluded_classes += %w|StyledTextCtrl StyledTextEvent| else libs_str << ',stc' end --- 95,110 ---- if $macosx stc_lib = $wx_libs[/\S+wx_mac\S+_stc\S+/] if stc_lib.nil? or ( stc_lib !~ /^-l/ and not File.exists?(stc_lib) ) ! WxRubyFeatureInfo.exclude_class('StyledTextCtrl') ! WxRubyFeatureInfo.exclude_class('StyledTextEvent') else libs_str << ',stc' end else stc_lib = $wx_libs[/\S+wx_gtk\S+_stc\S+/] if stc_lib.nil? ! WxRubyFeatureInfo.exclude_class('StyledTextCtrl') ! WxRubyFeatureInfo.exclude_class('StyledTextEvent') else libs_str << ',stc' end *************** *** 110,116 **** else stc_lib = $wx_libs[/\S+libwx\S+_stc\S+/] if stc_lib.nil? or not File.exists?(stc_lib) ! $excluded_classes += %w|StyledTextCtrl StyledTextEvent| else libs_str << ',stc' end --- 112,119 ---- else stc_lib = $wx_libs[/\S+libwx\S+_stc\S+/] if stc_lib.nil? or not File.exists?(stc_lib) ! WxRubyFeatureInfo.exclude_class('StyledTextCtrl') ! WxRubyFeatureInfo.exclude_class('StyledTextEvent') else libs_str << ',stc' end *************** *** 122,135 **** if $macosx gl_lib = $wx_libs[/\S+wx_mac\S+_gl\S+/] if gl_lib.nil? or ( gl_lib !~ /^-l/ and not File.exists?(gl_lib) ) ! $excluded_classes << 'GLCanvas' else libs_str << ',gl' end else gl_lib = $wx_libs[/\S+wx_gtk\S+_gl\S+/] if gl_lib.nil? ! $excluded_classes << 'GLCanvas' else libs_str << ',gl' end --- 125,138 ---- if $macosx gl_lib = $wx_libs[/\S+wx_mac\S+_gl\S+/] if gl_lib.nil? or ( gl_lib !~ /^-l/ and not File.exists?(gl_lib) ) ! WxRubyFeatureInfo.exclude_class('GLCanvas') else libs_str << ',gl' end else gl_lib = $wx_libs[/\S+wx_gtk\S+_gl\S+/] if gl_lib.nil? ! WxRubyFeatureInfo.exclude_class('GLCanvas') else libs_str << ',gl' end *************** *** 137,143 **** else gl_lib = $wx_libs[/\S+libwx\S+_gl\S+/] if gl_lib.nil? or not File.exists?(gl_lib) ! $excluded_classes << 'GLCanvas' else libs_str << ',gl' end --- 140,146 ---- else gl_lib = $wx_libs[/\S+libwx\S+_gl\S+/] if gl_lib.nil? or not File.exists?(gl_lib) ! WxRubyFeatureInfo.exclude_class('GLCanvas') else libs_str << ',gl' end *************** *** 147,153 **** # 1) we have a dynamic build (esp Linux, non-monolithic) # 2) we have a non-monolithic static build (identified by linkdeps) # PRobably not 100% correct but deals with the common cases.. ! if not $excluded_classes.include?('MediaCtrl') if $dynamic_build or wx_config('--linkdeps std') != wx_config('--linkdeps std,media') # 2) libs_str << ',media' --- 150,156 ---- # 1) we have a dynamic build (esp Linux, non-monolithic) # 2) we have a non-monolithic static build (identified by linkdeps) # PRobably not 100% correct but deals with the common cases.. ! if not WxRubyFeatureInfo.excluded_class?(WXWIDGETS_SETUP_H, 'MediaCtrl') if $dynamic_build or wx_config('--linkdeps std') != wx_config('--linkdeps std,media') # 2) libs_str << ',media' diff -crB wxruby-2.0.1/rake/rakewx.rb wxruby-2.0.1-fix/rake/rakewx.rb *** wxruby-2.0.1/rake/rakewx.rb 2009-09-09 06:36:50.000000000 +1000 --- wxruby-2.0.1-fix/rake/rakewx.rb 2011-10-01 18:15:44.539699370 +1000 *************** *** 53,59 **** # The plain names of all normal Wx classes to be built def all_build_classes ! ALL_CLASSES - $excluded_classes end # The plain module names of every SWIG module (in an .i file) to be built --- 53,59 ---- # The plain names of all normal Wx classes to be built def all_build_classes ! ALL_CLASSES - WxRubyFeatureInfo.excluded_classes(WXWIDGETS_SETUP_H) end # The plain module names of every SWIG module (in an .i file) to be built