From 33c7edf6232f60e4ee8bb6561e98654e1c0331a3 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Wed, 27 May 2015 22:58:02 -0700 Subject: [PATCH 01/22] fixes problem when gcc == clang in os x and C++ tr1 or C++11 headers --- ext/extconf.rb | 114 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 92 insertions(+), 22 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index d4f5dff..a69a06c 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -20,8 +20,8 @@ def have_member_func(klass,member,header) abort("wx version outdated, please update to 3.0.0 or newer") end - ruby_cc = CONFIG["CC"] - ruby_cxx = CONFIG["CXX"] + ruby_cc = RbConfig::CONFIG["CC"] + ruby_cxx = RbConfig::CONFIG["CXX"] # An ruby extension does need to be build against # the same compiler as ruby was unless ruby_cc && find_executable(ruby_cc) @@ -32,19 +32,67 @@ def have_member_func(klass,member,header) end cc = `#{wx_config} --cc`.chomp - unless cc == ruby_cc - abort("CC compiler missmatch %s == %s" % [cc, ruby_cc]) - end cxx = `#{wx_config} --cxx`.chomp - unless cxx == ruby_cxx - abort("CXX compiler missmatch %s == %s" % [cxx, ruby_cxx]) + cxxversion_wx = `#{cxx} -v 2>&1`.split("\n") + cxxversion_rb = `#{ruby_cxx} -v 2>&1`.split("\n") + ccversion_wx = `#{cc} -v 2>&1`.split("\n") + ccversion_rb = `#{ruby_cc} -v 2>&1`.split("\n") + puts ccversion_wx[0],ccversion_rb[0] + unless ccversion_rb.include?(ccversion_wx[0]) + abort("CC compiler missmatch %s == %s" % [ccversion_wx, ccversion_rb]) + end + unless cxxversion_rb.include?(cxxversion_wx[0]) + abort("CXX compiler missmatch %s == %s" % [cxxversion_wx,cxxversion_rb]) end #earlier versions of ruby does not have that constant - $CXXFLAGS = CONFIG["CXXFLAGS"] unless defined?($CXXFLAGS) - - #for some function add the base classes + #remove bad paths in flags + rmnonpaths = lambda {|x| + if (x[0,2]=="-L" ||x[0,2]=="-I") then + if File.exist?(x[2,x.length-2]) then + x + else + nil + end + else + x + end + } + if (RbConfig::CONFIG["CXXFLAGS"]) then + $CXXFLAGS = RbConfig::CONFIG["CXXFLAGS"] + $CXXFLAGS=$CXXFLAGS.split() + $CXXFLAGS.map!(&rmnonpaths) + end + if (RbConfig::CONFIG["CPPFLAGS"]) then + $CPPFLAGS = RbConfig::CONFIG["CXXFLAGS"] + $CPPFLAGS=$CPPFLAGS.split() + $CPPFLAGS.map!(&rmnonpaths) + end + if (RbConfig::CONFIG["CCFLAGS"]) then + $CCFLAGS = RbConfig::CONFIG["CXXFLAGS"] + $CCFLAGS=$CCFLAGS.split() + $CCFLAGS.map!(&rmnonpaths) + end + if (RbConfig::CONFIG["LDFLAGS"]) then + $LDFLAGS = RbConfig::CONFIG["CXXFLAGS"] + $LDFLAGS=$LDFLAGS.split() + $LDFLAGS.map!(&rmnonpaths) + end + if ($CXXFLAGS) then + $CXXFLAGS=$CXXFLAGS.join(" ") + end + if ($CPPFLAGS) then + $CPPFLAGS=$CPPFLAGS.join(" ") + end + if ($CCFLAGS) then + $CCFLAGS=$CCFLAGS.join(" ") + end + if ($LDFLAGS) then + $LDFLAGS=$LDFLAGS.join(" ") + end + $CXXFLAGS = RbConfig::CONFIG["CXXFLAGS"] unless defined?($CXXFLAGS) + #for some function add the base classes extra_libs = [] case `#{wx_config} --basename` when /gtk2/ @@ -56,30 +104,52 @@ def have_member_func(klass,member,header) extra_libs.each {|l| pkg = pkg_config(l) #because pkg forgot to add the include paths to cxx flags + puts L + puts pkg[0] $CXXFLAGS << " " << pkg[0] if pkg && !$CXXFLAGS[pkg[0]] } - all = " -fvisibility-inlines-hidden" $CFLAGS << all << " -x c++ -g -Wall " $CXXFLAGS << all << " -g -Wall " - $CPPFLAGS << all << " -g " + $CPPFLAGS << all << " -g -x c++ " $LDFLAGS << all << " " + #set up special flags for testing + moreflags = "" + with_cflags(" -x c++ ") { + moreflags += " -DHAVE_TYPE_TRAITS " if have_header("type_traits") + moreflags += " -DHAVE_TR1_TYPE_TRAITS " if have_header("tr1/type_traits") + moreflags += " -DHAVE_STD_UNORDERED_MAP " if have_header("unordered_map") + moreflags += " -DHAVE_TR1_UNORDERED_MAP " if have_header("tr1/unordered_map") + } # add the wx-config flags $CFLAGS << `#{wx_config} --cflags`.chomp $CXXFLAGS << `#{wx_config} --cxxflags`.chomp $CPPFLAGS << `#{wx_config} --cppflags`.chomp $LDFLAGS << `#{wx_config} --libs all`.chomp - + puts $LDFLAGS # TODO add extra check if a lib of wx is missing - with_cflags(" -x c++ ") { + with_cflags(" -x c++ "+moreflags) { # need c++ for some of the tests - RbConfig::CONFIG["CC"] = CONFIG["CXX"] - - have_header("wx/preferences.h") - - #check for better Bind commmand + CONFIG["CC"] = CONFIG["CXX"] + #C++98tr1 c++11 differences + have_header("type_traits") + have_header("tr1/type_traits") + if try_header("unordered_map") + checking_for "unordered_map" do + $defs.push(format("-DHAVE_STD_%s", "unordered_map".tr_cpp)) + end + end + have_header("tr1/unordered_map") + if try_header("unordered_set") + checking_for "unordered_set" do + $defs.push(format("-DHAVE_STD_%s", "unordered_set".tr_cpp)) + end + end + have_header("tr1/unordered_set") + have_header("wx/preferences.h","wx/defs.h") + #check for better Bind commmand unless have_macro("wxHAS_EVENT_BIND","wx/wx.h") abort("need wxHAS_EVENT_BIND, update your compiler!") end @@ -104,7 +174,7 @@ def have_member_func(klass,member,header) have_const("wxFD_NO_FOLLOW","wx/filedlg.h") have_const("wxDIRCTRL_DEFAULT_STYLE",["wx/wx.h", "wx/dirctrl.h"]) have_func("wxDirCtrl()",["wx/wx.h", "wx/dirctrl.h"]) - have_const("wxSTC_LEX_DMAP",["wx/wx.h", "wx/stc/stc.h"]) + have_const("wxSTC_LEX_DMAP",["wx/wx.h", "wx/stc/stc.h"]) have_const("wxALIGN_CENTER_VERTICAL","wx/sizer.h") have_member_func("wxSizerFlags","CenterVertical","wx/sizer.h") @@ -124,7 +194,7 @@ def have_member_func(klass,member,header) "-Wextra" #wxAUI is a bit buggy ), "") -#with_cppflags("-std=c++11") { +with_cppflags("-std=c++11") { create_header create_makefile "rwx" -#} +} From 07aa262911bf8a5b52386783a845c865791b0553 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Wed, 27 May 2015 23:06:23 -0700 Subject: [PATCH 02/22] extconf fixes fixes to remove extraneous paths in some ruby builds to non system paths adds C++tr1 versus C++11 header changes --- ext/#extconf.rb# | 130 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 ext/#extconf.rb# diff --git a/ext/#extconf.rb# b/ext/#extconf.rb# new file mode 100644 index 0000000..a6362c6 --- /dev/null +++ b/ext/#extconf.rb# @@ -0,0 +1,130 @@ +require "mkmf" + +# add check for member function, does need default constructor for class +def have_member_func(klass,member,header) + if have_func("#{klass}().#{member}()",header) + $defs[-1] = "-DHAVE_#{klass.tr_cpp}_#{member.tr_cpp}" + end +end + +unless have_macro("HAVE_RB_DATA_TYPE_T_PARENT") + abort("rb_data_type_t needs parent attribute!") +end + + +dir_config "rwx" + +if(wx_config = find_executable('wx-config')) + + if `#{wx_config} --version`.chomp < "3.0.0" + abort("wx version outdated, please update to 3.0.0 or newer") + end + + ruby_cc = CONFIG["CC"] + ruby_cxx = CONFIG["CXX"] + # An ruby extension does need to be build against + # the same compiler as ruby was + unless ruby_cc && find_executable(ruby_cc) + abort("C compiler not found!") + end + unless ruby_cxx && find_executable(ruby_cxx) + abort("C++ compiler not found!") + end + + cc = `#{wx_config} --cc`.chomp +# unless cc == ruby_cc +# abort("CC compiler missmatch %s == %s" % [cc, ruby_cc]) +# end + + cxx = `#{wx_config} --cxx`.chomp +# unless cxx == ruby_cxx +# abort("CXX compiler missmatch %s == %s" % [cxx, ruby_cxx]) +# end + + #earlier versions of ruby does not have that constant + $CXXFLAGS = CONFIG["CXXFLAGS"] unless defined?($CXXFLAGS) + + #for some function add the base classes + extra_libs = [] + case `#{wx_config} --basename` + when /gtk2/ + extra_libs << "gtk+-x11-2.0" << "gdk-x11-2.0" + when /gtk3/ + extra_libs << "gtk+-x11-3.0" << "gdk-x11-3.0" + end + + extra_libs.each {|l| + pkg = pkg_config(l) + #because pkg forgot to add the include paths to cxx flags + $CXXFLAGS << " " << pkg[0] if pkg && !$CXXFLAGS[pkg[0]] + } + + all = " -fvisibility-inlines-hidden" + $CFLAGS << all << " -x c++ -g -Wall " + $CXXFLAGS << all << " -g -Wall " + $CPPFLAGS << all << " -g " + $LDFLAGS << all << " " + + # add the wx-config flags + $CFLAGS << `#{wx_config} --cflags`.chomp + $CXXFLAGS << `#{wx_config} --cxxflags`.chomp + $CPPFLAGS << `#{wx_config} --cppflags`.chomp + $LDFLAGS << `#{wx_config} --libs all`.chomp + + # TODO add extra check if a lib of wx is missing + + with_cflags(" -x c++ ") { + # need c++ for some of the tests + RbConfig::CONFIG["CC"] = CONFIG["CXX"] + + have_header("wx/preferences.h") + + #check for better Bind commmand + unless have_macro("wxHAS_EVENT_BIND","wx/wx.h") + abort("need wxHAS_EVENT_BIND, update your compiler!") + end + + #check for Default-Constructors + have_func("wxContextHelpButton()","wx/cshelp.h") + have_func("wxNumberEntryDialog()","wx/numdlg.h") + have_func("wxPasswordEntryDialog()","wx/textdlg.h") + have_func("wxProgressDialog()","wx/progdlg.h") + have_func("wxMessageDialog()","wx/msgdlg.h") + have_func("wxGenericMessageDialog()","wx/generic/msgdlgg.h") + have_func("wxRichMessageDialog()","wx/richmsgdlg.h") + have_func("wxBusyInfoFlags()","wx/busyinfo.h") + + #check for instance methods, that classes need to have default constuctor + have_member_func("wxFontPickerCtrl","GetSelectedColour","wx/fontpicker.h") + have_member_func("wxInfoBar","GetButtonCount","wx/infobar.h") + + have_member_func("wxOwnerDrawnComboBox","IsListEmpty","wx/odcombo.h") + + #check for enum flags + have_const("wxFD_NO_FOLLOW","wx/filedlg.h") + have_const("wxDIRCTRL_DEFAULT_STYLE",["wx/wx.h", "wx/dirctrl.h"]) + have_func("wxDirCtrl()",["wx/wx.h", "wx/dirctrl.h"]) + have_const("wxSTC_LEX_DMAP",["wx/wx.h", "wx/stc/stc.h"]) + + have_const("wxALIGN_CENTER_VERTICAL","wx/sizer.h") + have_member_func("wxSizerFlags","CenterVertical","wx/sizer.h") + } +else + abort("wx-config executable not found!") + +end + +$defs.push("-DRUBY_UNTYPED_DATA_WARNING=1") + +#drop some of the warn flags because they are not valid for C++ +CONFIG["warnflags"].gsub!( + Regexp.union( + "-Wdeclaration-after-statement", + "-Wimplicit-function-declaration", + "-Wextra" #wxAUI is a bit buggy + ), "") + +#with_cppflags("-std=c++11") { + create_header + create_makefile "rwx" +#} From a450ead5b81f7d14c35446740eeb90d2c2330c18 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Fri, 29 May 2015 21:31:31 -0700 Subject: [PATCH 03/22] fix CFLAGS to use correct string recomment header makefile section --- ext/extconf.rb | 55 ++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index a69a06c..963a202 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -38,7 +38,7 @@ def have_member_func(klass,member,header) cxxversion_rb = `#{ruby_cxx} -v 2>&1`.split("\n") ccversion_wx = `#{cc} -v 2>&1`.split("\n") ccversion_rb = `#{ruby_cc} -v 2>&1`.split("\n") - puts ccversion_wx[0],ccversion_rb[0] + #puts ccversion_wx[0],ccversion_rb[0] unless ccversion_rb.include?(ccversion_wx[0]) abort("CC compiler missmatch %s == %s" % [ccversion_wx, ccversion_rb]) end @@ -63,19 +63,21 @@ def have_member_func(klass,member,header) $CXXFLAGS = RbConfig::CONFIG["CXXFLAGS"] $CXXFLAGS=$CXXFLAGS.split() $CXXFLAGS.map!(&rmnonpaths) - end + end if (RbConfig::CONFIG["CPPFLAGS"]) then - $CPPFLAGS = RbConfig::CONFIG["CXXFLAGS"] + $CPPFLAGS = RbConfig::CONFIG["CPPFLAGS"] $CPPFLAGS=$CPPFLAGS.split() + #puts $CPPFLAGS $CPPFLAGS.map!(&rmnonpaths) - end - if (RbConfig::CONFIG["CCFLAGS"]) then - $CCFLAGS = RbConfig::CONFIG["CXXFLAGS"] - $CCFLAGS=$CCFLAGS.split() - $CCFLAGS.map!(&rmnonpaths) - end + #puts $CPPFLAGS + end + if (RbConfig::CONFIG["CFLAGS"]) then + $CFLAGS = RbConfig::CONFIG["CFLAGS"] + $CFLAGS=$CFLAGS.split() + $CFLAGS.map!(&rmnonpaths) + end if (RbConfig::CONFIG["LDFLAGS"]) then - $LDFLAGS = RbConfig::CONFIG["CXXFLAGS"] + $LDFLAGS = RbConfig::CONFIG["LDFLAGS"] $LDFLAGS=$LDFLAGS.split() $LDFLAGS.map!(&rmnonpaths) end @@ -85,8 +87,8 @@ def have_member_func(klass,member,header) if ($CPPFLAGS) then $CPPFLAGS=$CPPFLAGS.join(" ") end - if ($CCFLAGS) then - $CCFLAGS=$CCFLAGS.join(" ") + if ($CFLAGS) then + $CFLAGS=$CFLAGS.join(" ") end if ($LDFLAGS) then $LDFLAGS=$LDFLAGS.join(" ") @@ -104,17 +106,15 @@ def have_member_func(klass,member,header) extra_libs.each {|l| pkg = pkg_config(l) #because pkg forgot to add the include paths to cxx flags - puts L - puts pkg[0] - $CXXFLAGS << " " << pkg[0] if pkg && !$CXXFLAGS[pkg[0]] + $CXXFLAGS << " " << pkg[0] if pkg && !$CXXFLAGS[pkg[0]] } all = " -fvisibility-inlines-hidden" $CFLAGS << all << " -x c++ -g -Wall " $CXXFLAGS << all << " -g -Wall " $CPPFLAGS << all << " -g -x c++ " $LDFLAGS << all << " " - #set up special flags for testing - moreflags = "" + #set up special flags for testing + moreflags = "" with_cflags(" -x c++ ") { moreflags += " -DHAVE_TYPE_TRAITS " if have_header("type_traits") moreflags += " -DHAVE_TR1_TYPE_TRAITS " if have_header("tr1/type_traits") @@ -124,16 +124,19 @@ def have_member_func(klass,member,header) # add the wx-config flags $CFLAGS << `#{wx_config} --cflags`.chomp - $CXXFLAGS << `#{wx_config} --cxxflags`.chomp - $CPPFLAGS << `#{wx_config} --cppflags`.chomp - $LDFLAGS << `#{wx_config} --libs all`.chomp - puts $LDFLAGS + #puts $CFLAGS + $CXXFLAGS << `#{wx_config} --cxxflags`.chomp + #puts $CXXFLAGS + $CPPFLAGS << `#{wx_config} --cppflags`.chomp + #puts $CPPFLAGS + $LDFLAGS << `#{wx_config} --libs all`.chomp + #puts $LDFLAGS # TODO add extra check if a lib of wx is missing with_cflags(" -x c++ "+moreflags) { # need c++ for some of the tests CONFIG["CC"] = CONFIG["CXX"] - #C++98tr1 c++11 differences + #C++03tr1 c++11 differences have_header("type_traits") have_header("tr1/type_traits") if try_header("unordered_map") @@ -174,7 +177,7 @@ def have_member_func(klass,member,header) have_const("wxFD_NO_FOLLOW","wx/filedlg.h") have_const("wxDIRCTRL_DEFAULT_STYLE",["wx/wx.h", "wx/dirctrl.h"]) have_func("wxDirCtrl()",["wx/wx.h", "wx/dirctrl.h"]) - have_const("wxSTC_LEX_DMAP",["wx/wx.h", "wx/stc/stc.h"]) + have_const("wxSTC_LEX_DMAP",["wx/wx.h", "wx/stc/stc.h"]) have_const("wxALIGN_CENTER_VERTICAL","wx/sizer.h") have_member_func("wxSizerFlags","CenterVertical","wx/sizer.h") @@ -193,8 +196,8 @@ def have_member_func(klass,member,header) "-Wimplicit-function-declaration", "-Wextra" #wxAUI is a bit buggy ), "") - -with_cppflags("-std=c++11") { +puts $CXXFLAGS +#with_cppflags("-std=c++11") { create_header create_makefile "rwx" -} +#} From fb81c8f3a1babecc0c79189c67bd81763f69eb13 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Fri, 29 May 2015 22:02:01 -0700 Subject: [PATCH 04/22] gdk flags need to be set in right order --- ext/extconf.rb | 261 ++++++++++++++++++++++++------------------------- 1 file changed, 127 insertions(+), 134 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index 963a202..d8327d9 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -2,60 +2,60 @@ # add check for member function, does need default constructor for class def have_member_func(klass,member,header) - if have_func("#{klass}().#{member}()",header) - $defs[-1] = "-DHAVE_#{klass.tr_cpp}_#{member.tr_cpp}" - end + if have_func("#{klass}().#{member}()",header) + $defs[-1] = "-DHAVE_#{klass.tr_cpp}_#{member.tr_cpp}" + end end unless have_macro("HAVE_RB_DATA_TYPE_T_PARENT") - abort("rb_data_type_t needs parent attribute!") + abort("rb_data_type_t needs parent attribute!") end dir_config "rwx" if(wx_config = find_executable('wx-config')) - - if `#{wx_config} --version`.chomp < "3.0.0" - abort("wx version outdated, please update to 3.0.0 or newer") - end - + + if `#{wx_config} --version`.chomp < "3.0.0" + abort("wx version outdated, please update to 3.0.0 or newer") + end + ruby_cc = RbConfig::CONFIG["CC"] - ruby_cxx = RbConfig::CONFIG["CXX"] - # An ruby extension does need to be build against - # the same compiler as ruby was - unless ruby_cc && find_executable(ruby_cc) - abort("C compiler not found!") - end - unless ruby_cxx && find_executable(ruby_cxx) - abort("C++ compiler not found!") - end - - cc = `#{wx_config} --cc`.chomp - - cxx = `#{wx_config} --cxx`.chomp - cxxversion_wx = `#{cxx} -v 2>&1`.split("\n") - cxxversion_rb = `#{ruby_cxx} -v 2>&1`.split("\n") - ccversion_wx = `#{cc} -v 2>&1`.split("\n") - ccversion_rb = `#{ruby_cc} -v 2>&1`.split("\n") - #puts ccversion_wx[0],ccversion_rb[0] - unless ccversion_rb.include?(ccversion_wx[0]) - abort("CC compiler missmatch %s == %s" % [ccversion_wx, ccversion_rb]) - end - unless cxxversion_rb.include?(cxxversion_wx[0]) - abort("CXX compiler missmatch %s == %s" % [cxxversion_wx,cxxversion_rb]) - end - - #earlier versions of ruby does not have that constant + ruby_cxx = RbConfig::CONFIG["CXX"] + # An ruby extension does need to be build against + # the same compiler as ruby was + unless ruby_cc && find_executable(ruby_cc) + abort("C compiler not found!") + end + unless ruby_cxx && find_executable(ruby_cxx) + abort("C++ compiler not found!") + end + + cc = `#{wx_config} --cc`.chomp + + cxx = `#{wx_config} --cxx`.chomp + cxxversion_wx = `#{cxx} -v 2>&1`.split("\n") + cxxversion_rb = `#{ruby_cxx} -v 2>&1`.split("\n") + ccversion_wx = `#{cc} -v 2>&1`.split("\n") + ccversion_rb = `#{ruby_cc} -v 2>&1`.split("\n") + #puts ccversion_wx[0],ccversion_rb[0] + unless ccversion_rb.include?(ccversion_wx[0]) + abort("CC compiler missmatch %s == %s" % [ccversion_wx, ccversion_rb]) + end + unless cxxversion_rb.include?(cxxversion_wx[0]) + abort("CXX compiler missmatch %s == %s" % [cxxversion_wx,cxxversion_rb]) + end + + #earlier versions of ruby does not have that constant #remove bad paths in flags rmnonpaths = lambda {|x| if (x[0,2]=="-L" ||x[0,2]=="-I") then if File.exist?(x[2,x.length-2]) then x - else + else nil end - else + else x end } @@ -63,79 +63,68 @@ def have_member_func(klass,member,header) $CXXFLAGS = RbConfig::CONFIG["CXXFLAGS"] $CXXFLAGS=$CXXFLAGS.split() $CXXFLAGS.map!(&rmnonpaths) - end + $CXXFLAGS=$CXXFLAGS.join(" ") + end if (RbConfig::CONFIG["CPPFLAGS"]) then $CPPFLAGS = RbConfig::CONFIG["CPPFLAGS"] $CPPFLAGS=$CPPFLAGS.split() - #puts $CPPFLAGS $CPPFLAGS.map!(&rmnonpaths) - #puts $CPPFLAGS - end + $CPPFLAGS=$CPPFLAGS.join(" ") + end if (RbConfig::CONFIG["CFLAGS"]) then $CFLAGS = RbConfig::CONFIG["CFLAGS"] $CFLAGS=$CFLAGS.split() $CFLAGS.map!(&rmnonpaths) - end + $CFLAGS=$CFLAGS.join(" ") + end if (RbConfig::CONFIG["LDFLAGS"]) then $LDFLAGS = RbConfig::CONFIG["LDFLAGS"] $LDFLAGS=$LDFLAGS.split() $LDFLAGS.map!(&rmnonpaths) - end - if ($CXXFLAGS) then - $CXXFLAGS=$CXXFLAGS.join(" ") - end - if ($CPPFLAGS) then - $CPPFLAGS=$CPPFLAGS.join(" ") - end - if ($CFLAGS) then - $CFLAGS=$CFLAGS.join(" ") - end - if ($LDFLAGS) then $LDFLAGS=$LDFLAGS.join(" ") end + #set up special flags for testing + moreflags = "" + with_cflags(" -x c++ ") { + moreflags += " -DHAVE_TYPE_TRAITS " if have_header("type_traits") + moreflags += " -DHAVE_TR1_TYPE_TRAITS " if have_header("tr1/type_traits") + moreflags += " -DHAVE_STD_UNORDERED_MAP " if have_header("unordered_map") + moreflags += " -DHAVE_TR1_UNORDERED_MAP " if have_header("tr1/unordered_map") + } + $CXXFLAGS = RbConfig::CONFIG["CXXFLAGS"] unless defined?($CXXFLAGS) #for some function add the base classes - extra_libs = [] - case `#{wx_config} --basename` - when /gtk2/ - extra_libs << "gtk+-x11-2.0" << "gdk-x11-2.0" - when /gtk3/ - extra_libs << "gtk+-x11-3.0" << "gdk-x11-3.0" - end - - extra_libs.each {|l| - pkg = pkg_config(l) - #because pkg forgot to add the include paths to cxx flags - $CXXFLAGS << " " << pkg[0] if pkg && !$CXXFLAGS[pkg[0]] - } - all = " -fvisibility-inlines-hidden" - $CFLAGS << all << " -x c++ -g -Wall " - $CXXFLAGS << all << " -g -Wall " - $CPPFLAGS << all << " -g -x c++ " - $LDFLAGS << all << " " - #set up special flags for testing - moreflags = "" - with_cflags(" -x c++ ") { - moreflags += " -DHAVE_TYPE_TRAITS " if have_header("type_traits") - moreflags += " -DHAVE_TR1_TYPE_TRAITS " if have_header("tr1/type_traits") - moreflags += " -DHAVE_STD_UNORDERED_MAP " if have_header("unordered_map") - moreflags += " -DHAVE_TR1_UNORDERED_MAP " if have_header("tr1/unordered_map") - } - - # add the wx-config flags - $CFLAGS << `#{wx_config} --cflags`.chomp - #puts $CFLAGS - $CXXFLAGS << `#{wx_config} --cxxflags`.chomp - #puts $CXXFLAGS - $CPPFLAGS << `#{wx_config} --cppflags`.chomp - #puts $CPPFLAGS - $LDFLAGS << `#{wx_config} --libs all`.chomp - #puts $LDFLAGS - # TODO add extra check if a lib of wx is missing - - with_cflags(" -x c++ "+moreflags) { - # need c++ for some of the tests - CONFIG["CC"] = CONFIG["CXX"] + extra_libs = [] + case `#{wx_config} --basename` + when /gtk2/ + extra_libs << "gtk+-x11-2.0" << "gdk-x11-2.0" + when /gtk3/ + extra_libs << "gtk+-x11-3.0" << "gdk-x11-3.0" + end + + extra_libs.each {|l| + pkg = pkg_config(l) + #because pkg forgot to add the include paths to cxx flags + $CXXFLAGS << " " << pkg[0] if pkg && !$CXXFLAGS[pkg[0]] + } + all = " -fvisibility-inlines-hidden" + $CFLAGS << all << " -x c++ -g -Wall " + $CXXFLAGS << all << " -g -Wall " + $CPPFLAGS << all << " -g -x c++ " + $LDFLAGS << all << " " + # add the wx-config flags + $CFLAGS << `#{wx_config} --cflags`.chomp + #puts $CFLAGS + $CXXFLAGS << `#{wx_config} --cxxflags`.chomp + #puts $CXXFLAGS + $CPPFLAGS << `#{wx_config} --cppflags`.chomp + #puts $CPPFLAGS + $LDFLAGS << `#{wx_config} --libs all`.chomp + #puts $LDFLAGS + # TODO add extra check if a lib of wx is missing + with_cflags(" -x c++ ") { + # need c++ for some of the tests + CONFIG["CC"] = CONFIG["CXX"] #C++03tr1 c++11 differences have_header("type_traits") have_header("tr1/type_traits") @@ -150,54 +139,58 @@ def have_member_func(klass,member,header) $defs.push(format("-DHAVE_STD_%s", "unordered_set".tr_cpp)) end end + } + with_cflags(" -x c++ "+moreflags) { + # need c++ for some of the tests + CONFIG["CC"] = CONFIG["CXX"] + #C++03tr1 c++11 differences have_header("tr1/unordered_set") have_header("wx/preferences.h","wx/defs.h") #check for better Bind commmand - unless have_macro("wxHAS_EVENT_BIND","wx/wx.h") - abort("need wxHAS_EVENT_BIND, update your compiler!") - end - - #check for Default-Constructors - have_func("wxContextHelpButton()","wx/cshelp.h") - have_func("wxNumberEntryDialog()","wx/numdlg.h") - have_func("wxPasswordEntryDialog()","wx/textdlg.h") - have_func("wxProgressDialog()","wx/progdlg.h") - have_func("wxMessageDialog()","wx/msgdlg.h") - have_func("wxGenericMessageDialog()","wx/generic/msgdlgg.h") - have_func("wxRichMessageDialog()","wx/richmsgdlg.h") - have_func("wxBusyInfoFlags()","wx/busyinfo.h") - - #check for instance methods, that classes need to have default constuctor - have_member_func("wxFontPickerCtrl","GetSelectedColour","wx/fontpicker.h") - have_member_func("wxInfoBar","GetButtonCount","wx/infobar.h") - - have_member_func("wxOwnerDrawnComboBox","IsListEmpty","wx/odcombo.h") - - #check for enum flags - have_const("wxFD_NO_FOLLOW","wx/filedlg.h") - have_const("wxDIRCTRL_DEFAULT_STYLE",["wx/wx.h", "wx/dirctrl.h"]) - have_func("wxDirCtrl()",["wx/wx.h", "wx/dirctrl.h"]) - have_const("wxSTC_LEX_DMAP",["wx/wx.h", "wx/stc/stc.h"]) - - have_const("wxALIGN_CENTER_VERTICAL","wx/sizer.h") - have_member_func("wxSizerFlags","CenterVertical","wx/sizer.h") - } -else - abort("wx-config executable not found!") - + unless have_macro("wxHAS_EVENT_BIND","wx/wx.h") + abort("need wxHAS_EVENT_BIND, update your compiler!") + end + + #check for Default-Constructors + have_func("wxContextHelpButton()","wx/cshelp.h") + have_func("wxNumberEntryDialog()","wx/numdlg.h") + have_func("wxPasswordEntryDialog()","wx/textdlg.h") + have_func("wxProgressDialog()","wx/progdlg.h") + have_func("wxMessageDialog()","wx/msgdlg.h") + have_func("wxGenericMessageDialog()","wx/generic/msgdlgg.h") + have_func("wxRichMessageDialog()","wx/richmsgdlg.h") + have_func("wxBusyInfoFlags()","wx/busyinfo.h") + + #check for instance methods, that classes need to have default constuctor + have_member_func("wxFontPickerCtrl","GetSelectedColour","wx/fontpicker.h") + have_member_func("wxInfoBar","GetButtonCount","wx/infobar.h") + + have_member_func("wxOwnerDrawnComboBox","IsListEmpty","wx/odcombo.h") + + #check for enum flags + have_const("wxFD_NO_FOLLOW","wx/filedlg.h") + have_const("wxDIRCTRL_DEFAULT_STYLE",["wx/wx.h", "wx/dirctrl.h"]) + have_func("wxDirCtrl()",["wx/wx.h", "wx/dirctrl.h"]) + have_const("wxSTC_LEX_DMAP",["wx/wx.h", "wx/stc/stc.h"]) + + have_const("wxALIGN_CENTER_VERTICAL","wx/sizer.h") + have_member_func("wxSizerFlags","CenterVertical","wx/sizer.h") + } + else + abort("wx-config executable not found!") + end $defs.push("-DRUBY_UNTYPED_DATA_WARNING=1") #drop some of the warn flags because they are not valid for C++ CONFIG["warnflags"].gsub!( - Regexp.union( - "-Wdeclaration-after-statement", - "-Wimplicit-function-declaration", - "-Wextra" #wxAUI is a bit buggy - ), "") -puts $CXXFLAGS + Regexp.union( + "-Wdeclaration-after-statement", + "-Wimplicit-function-declaration", + "-Wextra" #wxAUI is a bit buggy + ), "") #with_cppflags("-std=c++11") { - create_header - create_makefile "rwx" +create_header +create_makefile "rwx" #} From 4b4d76d5d7c8bb163ee2262392924f5a6988e80a Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Fri, 29 May 2015 22:16:27 -0700 Subject: [PATCH 05/22] test --- ext/extconf.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index d8327d9..dc99f7c 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -52,10 +52,11 @@ def have_member_func(klass,member,header) if (x[0,2]=="-L" ||x[0,2]=="-I") then if File.exist?(x[2,x.length-2]) then x - else + else + puts "removing %s"%x nil end - else + else x end } From 322558f18e5941ca67c040df03afffa946307d22 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Fri, 29 May 2015 22:46:48 -0700 Subject: [PATCH 06/22] prints --- ext/extconf.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index dc99f7c..f9534a4 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -45,7 +45,7 @@ def have_member_func(klass,member,header) unless cxxversion_rb.include?(cxxversion_wx[0]) abort("CXX compiler missmatch %s == %s" % [cxxversion_wx,cxxversion_rb]) end - + puts "compilers matched" #earlier versions of ruby does not have that constant #remove bad paths in flags rmnonpaths = lambda {|x| @@ -60,6 +60,7 @@ def have_member_func(klass,member,header) x end } + puts "removing nonexistent paths" if (RbConfig::CONFIG["CXXFLAGS"]) then $CXXFLAGS = RbConfig::CONFIG["CXXFLAGS"] $CXXFLAGS=$CXXFLAGS.split() @@ -92,7 +93,7 @@ def have_member_func(klass,member,header) moreflags += " -DHAVE_STD_UNORDERED_MAP " if have_header("unordered_map") moreflags += " -DHAVE_TR1_UNORDERED_MAP " if have_header("tr1/unordered_map") } - + print "moreflags set" $CXXFLAGS = RbConfig::CONFIG["CXXFLAGS"] unless defined?($CXXFLAGS) #for some function add the base classes extra_libs = [] @@ -102,7 +103,7 @@ def have_member_func(klass,member,header) when /gtk3/ extra_libs << "gtk+-x11-3.0" << "gdk-x11-3.0" end - + puts "fixing",extra_libs extra_libs.each {|l| pkg = pkg_config(l) #because pkg forgot to add the include paths to cxx flags @@ -115,9 +116,9 @@ def have_member_func(klass,member,header) $LDFLAGS << all << " " # add the wx-config flags $CFLAGS << `#{wx_config} --cflags`.chomp - #puts $CFLAGS + puts $CFLAGS $CXXFLAGS << `#{wx_config} --cxxflags`.chomp - #puts $CXXFLAGS + puts $CXXFLAGS $CPPFLAGS << `#{wx_config} --cppflags`.chomp #puts $CPPFLAGS $LDFLAGS << `#{wx_config} --libs all`.chomp @@ -177,7 +178,7 @@ def have_member_func(klass,member,header) have_const("wxALIGN_CENTER_VERTICAL","wx/sizer.h") have_member_func("wxSizerFlags","CenterVertical","wx/sizer.h") } - else +else abort("wx-config executable not found!") end From d8abad410f9dd8e47fd7f73c66313d2d2d7eaa17 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Fri, 29 May 2015 23:48:39 -0700 Subject: [PATCH 07/22] wxconfig get flags --- ext/extconf.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index f9534a4..267da63 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -115,14 +115,18 @@ def have_member_func(klass,member,header) $CPPFLAGS << all << " -g -x c++ " $LDFLAGS << all << " " # add the wx-config flags + puts "cflags" $CFLAGS << `#{wx_config} --cflags`.chomp - puts $CFLAGS + puts `#{wx_config} --cflags` + puts "cxxflags" $CXXFLAGS << `#{wx_config} --cxxflags`.chomp - puts $CXXFLAGS + puts `#{wx_config} --cxxflags` + puts "cppflags" $CPPFLAGS << `#{wx_config} --cppflags`.chomp - #puts $CPPFLAGS + #puts `#{wx_config} --cppflags` + puts "ldflags" $LDFLAGS << `#{wx_config} --libs all`.chomp - #puts $LDFLAGS + #puts `#{wx_config} --libs all` # TODO add extra check if a lib of wx is missing with_cflags(" -x c++ ") { # need c++ for some of the tests From 4097b9b97c168e407f1d3fffdcc8c38223d11d46 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 02:31:28 -0700 Subject: [PATCH 08/22] Fixed config checks no more ad hoc checks, use pkg_config fixed flags to update properly from pkg_config --- ext/extconf.rb | 116 +++++++++++++++++++++---------------------------- mkmf.log | 48 ++++++++++++++++++++ 2 files changed, 97 insertions(+), 67 deletions(-) create mode 100644 mkmf.log diff --git a/ext/extconf.rb b/ext/extconf.rb index 267da63..aa00f84 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -14,9 +14,9 @@ def have_member_func(klass,member,header) dir_config "rwx" -if(wx_config = find_executable('wx-config')) +if(wxversion = pkg_config("wx","version")) - if `#{wx_config} --version`.chomp < "3.0.0" + if wxversion.chomp < "3.0.0" abort("wx version outdated, please update to 3.0.0 or newer") end @@ -31,60 +31,30 @@ def have_member_func(klass,member,header) abort("C++ compiler not found!") end - cc = `#{wx_config} --cc`.chomp + cc = pkg_config("wx","cc") + cxx = pkg_config("wx","cxx") - cxx = `#{wx_config} --cxx`.chomp cxxversion_wx = `#{cxx} -v 2>&1`.split("\n") cxxversion_rb = `#{ruby_cxx} -v 2>&1`.split("\n") ccversion_wx = `#{cc} -v 2>&1`.split("\n") ccversion_rb = `#{ruby_cc} -v 2>&1`.split("\n") - #puts ccversion_wx[0],ccversion_rb[0] unless ccversion_rb.include?(ccversion_wx[0]) abort("CC compiler missmatch %s == %s" % [ccversion_wx, ccversion_rb]) end unless cxxversion_rb.include?(cxxversion_wx[0]) abort("CXX compiler missmatch %s == %s" % [cxxversion_wx,cxxversion_rb]) end - puts "compilers matched" + #earlier versions of ruby does not have that constant #remove bad paths in flags - rmnonpaths = lambda {|x| - if (x[0,2]=="-L" ||x[0,2]=="-I") then - if File.exist?(x[2,x.length-2]) then - x - else - puts "removing %s"%x - nil - end - else - x - end - } - puts "removing nonexistent paths" - if (RbConfig::CONFIG["CXXFLAGS"]) then - $CXXFLAGS = RbConfig::CONFIG["CXXFLAGS"] - $CXXFLAGS=$CXXFLAGS.split() - $CXXFLAGS.map!(&rmnonpaths) - $CXXFLAGS=$CXXFLAGS.join(" ") - end - if (RbConfig::CONFIG["CPPFLAGS"]) then - $CPPFLAGS = RbConfig::CONFIG["CPPFLAGS"] - $CPPFLAGS=$CPPFLAGS.split() - $CPPFLAGS.map!(&rmnonpaths) - $CPPFLAGS=$CPPFLAGS.join(" ") - end - if (RbConfig::CONFIG["CFLAGS"]) then - $CFLAGS = RbConfig::CONFIG["CFLAGS"] - $CFLAGS=$CFLAGS.split() - $CFLAGS.map!(&rmnonpaths) - $CFLAGS=$CFLAGS.join(" ") - end - if (RbConfig::CONFIG["LDFLAGS"]) then - $LDFLAGS = RbConfig::CONFIG["LDFLAGS"] - $LDFLAGS=$LDFLAGS.split() - $LDFLAGS.map!(&rmnonpaths) - $LDFLAGS=$LDFLAGS.join(" ") - end + $CPPFLAGS=CONFIG["CPPFLAGS"] + $CFLAGS=CONFIG["CFLAGS"] + $CFLAGS=$CFLAGS.split.delete_if {|x| x[0,2]=="-I" && !File.exist?(x[2,x.length-2])}.join(" ") + $CXXFLAGS=CONFIG["CXXFLAGS"] + $LDFLAGS=CONFIG["LDFLAGS"] + $LDFLAGS=$LDFLAGS.split.delete_if {|x| x[0,2]=="-L" && !File.exist?(x[2,x.length-2])}.join(" ") + $LIBS=CONFIG["LIBS"] + #set up special flags for testing moreflags = "" with_cflags(" -x c++ ") { @@ -93,40 +63,52 @@ def have_member_func(klass,member,header) moreflags += " -DHAVE_STD_UNORDERED_MAP " if have_header("unordered_map") moreflags += " -DHAVE_TR1_UNORDERED_MAP " if have_header("tr1/unordered_map") } - print "moreflags set" - $CXXFLAGS = RbConfig::CONFIG["CXXFLAGS"] unless defined?($CXXFLAGS) + wxcppflags=pkg_config("wx","cppflags") + $CPPFLAGS << " " << wxcppflags + wxcflags=pkg_config("wx","cflags") + $CFLAGS << " " << wxcflags + wxcxxflags=pkg_config("wx","cxxflags") + $CPPFLAGS << " " << wxcxxflags + wxlibs=pkg_config("wx","libs all") + $LIBS << " " << wxlibs + wxldflags=pkg_config("wx","linkdeps") + $LDFLAGS << " " << wxldflags #for some function add the base classes - extra_libs = [] - case `#{wx_config} --basename` + wxpkg = pkg_config("wx","basename") + case wxpkg when /gtk2/ - extra_libs << "gtk+-x11-2.0" << "gdk-x11-2.0" + gdkflags = pkg_config("gdk-x11-2.0") + if gdkflags + $CXXFLAGS << " " << gdkflags[0] + $LIBS << " " << gdkflags[1] + $LDFLAGS << " " << gdkflags[2] + end + gtkflags = pkg_config("gtk+-x11-2.0") + if gtkflags + $CXXFLAGS << " " << gtkflags[0] + $LIBS << " " << gtkflags[1] + $LDFLAGS << " " << gtkflags[2] + end when /gtk3/ - extra_libs << "gtk+-x11-3.0" << "gdk-x11-3.0" + gdkflags = pkg_config("gdk-x11-3.0") + if gdkflags + $CXXFLAGS << " " << gdkflags[0] + $LIBS << " " << gdkflags[1] + $LDFLAGS << " " << gdkflags[2] + end + gtkflags = pkg_config("gtk+-x11-3.0") + if gtkflags + $CXXFLAGS << " " << gtkflags[0] + $LIBS << " " << gtkflags[1] + $LDFLAGS << " " << gtkflags[2] + end end - puts "fixing",extra_libs - extra_libs.each {|l| - pkg = pkg_config(l) - #because pkg forgot to add the include paths to cxx flags - $CXXFLAGS << " " << pkg[0] if pkg && !$CXXFLAGS[pkg[0]] - } all = " -fvisibility-inlines-hidden" $CFLAGS << all << " -x c++ -g -Wall " $CXXFLAGS << all << " -g -Wall " $CPPFLAGS << all << " -g -x c++ " $LDFLAGS << all << " " # add the wx-config flags - puts "cflags" - $CFLAGS << `#{wx_config} --cflags`.chomp - puts `#{wx_config} --cflags` - puts "cxxflags" - $CXXFLAGS << `#{wx_config} --cxxflags`.chomp - puts `#{wx_config} --cxxflags` - puts "cppflags" - $CPPFLAGS << `#{wx_config} --cppflags`.chomp - #puts `#{wx_config} --cppflags` - puts "ldflags" - $LDFLAGS << `#{wx_config} --libs all`.chomp - #puts `#{wx_config} --libs all` # TODO add extra check if a lib of wx is missing with_cflags(" -x c++ ") { # need c++ for some of the tests diff --git a/mkmf.log b/mkmf.log new file mode 100644 index 0000000..28740a5 --- /dev/null +++ b/mkmf.log @@ -0,0 +1,48 @@ +"gcc -o conftest -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 -pipe conftest.c -L. -L/Users/macuser/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -arch x86_64 -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc " +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return 0; +6: } +/* end */ + +"gcc -o conftest -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 -pipe conftest.c -L. -L/Users/macuser/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -arch x86_64 -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc " +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main() {return 0;} +/* end */ + +package configuration for gdk-x11-2.0 +cflags: -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include -I/opt/X11/include/freetype2 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include +ldflags: -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib +libs: -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl + +"gcc -o conftest -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 -pipe -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include -I/opt/X11/include/freetype2 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include conftest.c -L. -L/Users/macuser/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/usr/local/Cellar/atk/2.16.0/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib -L/opt/X11/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -arch x86_64 -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc " +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main() {return 0;} +/* end */ + +package configuration for gtk+-x11-2.0 +cflags: -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/atk/2.16.0/include/atk-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/0.9.40/include/harfbuzz -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/opt/X11/include -I/opt/X11/include/freetype2 +ldflags: -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/usr/local/Cellar/atk/2.16.0/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib -L/opt/X11/lib +libs: -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype + +"gcc -o conftest -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 -pipe -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include -I/opt/X11/include/freetype2 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/atk/2.16.0/include/atk-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/0.9.40/include/harfbuzz -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/opt/X11/include -I/opt/X11/include/freetype2 conftest.c -L. -L/Users/macuser/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_xrc-3.0 -lwx_osx_cocoau_webview-3.0 -lwx_osx_cocoau_html-3.0 -lwx_osx_cocoau_qa-3.0 -lwx_osx_cocoau_adv-3.0 -lwx_osx_cocoau_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -arch x86_64 -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc " +ld: library not found for -lintl +clang: error: linker command failed with exit code 1 (use -v to see invocation) +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main() {return 0;} +/* end */ + +package configuration for wx is not found From 819c193128475754792310a1de4ea58a9ae8ed4e Mon Sep 17 00:00:00 2001 From: rinkevichjm Date: Sun, 31 May 2015 12:44:52 -0700 Subject: [PATCH 09/22] Delete #extconf.rb# unneeded edit file --- ext/#extconf.rb# | 130 ----------------------------------------------- 1 file changed, 130 deletions(-) delete mode 100644 ext/#extconf.rb# diff --git a/ext/#extconf.rb# b/ext/#extconf.rb# deleted file mode 100644 index a6362c6..0000000 --- a/ext/#extconf.rb# +++ /dev/null @@ -1,130 +0,0 @@ -require "mkmf" - -# add check for member function, does need default constructor for class -def have_member_func(klass,member,header) - if have_func("#{klass}().#{member}()",header) - $defs[-1] = "-DHAVE_#{klass.tr_cpp}_#{member.tr_cpp}" - end -end - -unless have_macro("HAVE_RB_DATA_TYPE_T_PARENT") - abort("rb_data_type_t needs parent attribute!") -end - - -dir_config "rwx" - -if(wx_config = find_executable('wx-config')) - - if `#{wx_config} --version`.chomp < "3.0.0" - abort("wx version outdated, please update to 3.0.0 or newer") - end - - ruby_cc = CONFIG["CC"] - ruby_cxx = CONFIG["CXX"] - # An ruby extension does need to be build against - # the same compiler as ruby was - unless ruby_cc && find_executable(ruby_cc) - abort("C compiler not found!") - end - unless ruby_cxx && find_executable(ruby_cxx) - abort("C++ compiler not found!") - end - - cc = `#{wx_config} --cc`.chomp -# unless cc == ruby_cc -# abort("CC compiler missmatch %s == %s" % [cc, ruby_cc]) -# end - - cxx = `#{wx_config} --cxx`.chomp -# unless cxx == ruby_cxx -# abort("CXX compiler missmatch %s == %s" % [cxx, ruby_cxx]) -# end - - #earlier versions of ruby does not have that constant - $CXXFLAGS = CONFIG["CXXFLAGS"] unless defined?($CXXFLAGS) - - #for some function add the base classes - extra_libs = [] - case `#{wx_config} --basename` - when /gtk2/ - extra_libs << "gtk+-x11-2.0" << "gdk-x11-2.0" - when /gtk3/ - extra_libs << "gtk+-x11-3.0" << "gdk-x11-3.0" - end - - extra_libs.each {|l| - pkg = pkg_config(l) - #because pkg forgot to add the include paths to cxx flags - $CXXFLAGS << " " << pkg[0] if pkg && !$CXXFLAGS[pkg[0]] - } - - all = " -fvisibility-inlines-hidden" - $CFLAGS << all << " -x c++ -g -Wall " - $CXXFLAGS << all << " -g -Wall " - $CPPFLAGS << all << " -g " - $LDFLAGS << all << " " - - # add the wx-config flags - $CFLAGS << `#{wx_config} --cflags`.chomp - $CXXFLAGS << `#{wx_config} --cxxflags`.chomp - $CPPFLAGS << `#{wx_config} --cppflags`.chomp - $LDFLAGS << `#{wx_config} --libs all`.chomp - - # TODO add extra check if a lib of wx is missing - - with_cflags(" -x c++ ") { - # need c++ for some of the tests - RbConfig::CONFIG["CC"] = CONFIG["CXX"] - - have_header("wx/preferences.h") - - #check for better Bind commmand - unless have_macro("wxHAS_EVENT_BIND","wx/wx.h") - abort("need wxHAS_EVENT_BIND, update your compiler!") - end - - #check for Default-Constructors - have_func("wxContextHelpButton()","wx/cshelp.h") - have_func("wxNumberEntryDialog()","wx/numdlg.h") - have_func("wxPasswordEntryDialog()","wx/textdlg.h") - have_func("wxProgressDialog()","wx/progdlg.h") - have_func("wxMessageDialog()","wx/msgdlg.h") - have_func("wxGenericMessageDialog()","wx/generic/msgdlgg.h") - have_func("wxRichMessageDialog()","wx/richmsgdlg.h") - have_func("wxBusyInfoFlags()","wx/busyinfo.h") - - #check for instance methods, that classes need to have default constuctor - have_member_func("wxFontPickerCtrl","GetSelectedColour","wx/fontpicker.h") - have_member_func("wxInfoBar","GetButtonCount","wx/infobar.h") - - have_member_func("wxOwnerDrawnComboBox","IsListEmpty","wx/odcombo.h") - - #check for enum flags - have_const("wxFD_NO_FOLLOW","wx/filedlg.h") - have_const("wxDIRCTRL_DEFAULT_STYLE",["wx/wx.h", "wx/dirctrl.h"]) - have_func("wxDirCtrl()",["wx/wx.h", "wx/dirctrl.h"]) - have_const("wxSTC_LEX_DMAP",["wx/wx.h", "wx/stc/stc.h"]) - - have_const("wxALIGN_CENTER_VERTICAL","wx/sizer.h") - have_member_func("wxSizerFlags","CenterVertical","wx/sizer.h") - } -else - abort("wx-config executable not found!") - -end - -$defs.push("-DRUBY_UNTYPED_DATA_WARNING=1") - -#drop some of the warn flags because they are not valid for C++ -CONFIG["warnflags"].gsub!( - Regexp.union( - "-Wdeclaration-after-statement", - "-Wimplicit-function-declaration", - "-Wextra" #wxAUI is a bit buggy - ), "") - -#with_cppflags("-std=c++11") { - create_header - create_makefile "rwx" -#} From e8d7b74c7d9cc5244a185bb2564e382231ce2812 Mon Sep 17 00:00:00 2001 From: rinkevichjm Date: Sun, 31 May 2015 12:45:50 -0700 Subject: [PATCH 10/22] Delete mkmf.log unneeded --- mkmf.log | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 mkmf.log diff --git a/mkmf.log b/mkmf.log deleted file mode 100644 index 28740a5..0000000 --- a/mkmf.log +++ /dev/null @@ -1,48 +0,0 @@ -"gcc -o conftest -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 -pipe conftest.c -L. -L/Users/macuser/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -arch x86_64 -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc " -checked program was: -/* begin */ -1: #include "ruby.h" -2: -3: int main(int argc, char **argv) -4: { -5: return 0; -6: } -/* end */ - -"gcc -o conftest -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 -pipe conftest.c -L. -L/Users/macuser/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -arch x86_64 -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc " -checked program was: -/* begin */ -1: #include "ruby.h" -2: -3: int main() {return 0;} -/* end */ - -package configuration for gdk-x11-2.0 -cflags: -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include -I/opt/X11/include/freetype2 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -ldflags: -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib -libs: -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl - -"gcc -o conftest -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 -pipe -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include -I/opt/X11/include/freetype2 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include conftest.c -L. -L/Users/macuser/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/usr/local/Cellar/atk/2.16.0/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib -L/opt/X11/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -arch x86_64 -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc " -checked program was: -/* begin */ -1: #include "ruby.h" -2: -3: int main() {return 0;} -/* end */ - -package configuration for gtk+-x11-2.0 -cflags: -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/atk/2.16.0/include/atk-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/0.9.40/include/harfbuzz -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/opt/X11/include -I/opt/X11/include/freetype2 -ldflags: -L/usr/local/Cellar/gtk+/2.24.28/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/usr/local/Cellar/atk/2.16.0/lib -L/opt/X11/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/usr/local/Cellar/glib/2.44.1/lib -L/usr/local/opt/gettext/lib -L/opt/X11/lib -libs: -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype - -"gcc -o conftest -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/macuser/.rvm/rubies/ruby-2.1.2/include/ruby-2.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -I/Users/travis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 -pipe -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include -I/opt/X11/include/freetype2 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -D_REENTRANT -I/usr/local/Cellar/gtk+/2.24.28/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.28/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/atk/2.16.0/include/atk-1.0 -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/opt/X11/include/libpng15 -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/0.9.40/include/harfbuzz -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/glib/2.44.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/opt/X11/include -I/opt/X11/include/freetype2 conftest.c -L. -L/Users/macuser/.rvm/rubies/ruby-2.1.2/lib -L/usr/local/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_xrc-3.0 -lwx_osx_cocoau_webview-3.0 -lwx_osx_cocoau_html-3.0 -lwx_osx_cocoau_qa-3.0 -lwx_osx_cocoau_adv-3.0 -lwx_osx_cocoau_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -arch x86_64 -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc " -ld: library not found for -lintl -clang: error: linker command failed with exit code 1 (use -v to see invocation) -checked program was: -/* begin */ -1: #include "ruby.h" -2: -3: int main() {return 0;} -/* end */ - -package configuration for wx is not found From 1a263f76489c635eda95093a16b85b0705984649 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 14:17:58 -0700 Subject: [PATCH 11/22] remove extra code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit remove $LIBS, mkmf uses $libs (scons uses $LIBS) remove pig-config updates to $CFLAGS and $LIBS note: Ruby docs of pkg_config source code show $CXXFLAGS updated, but actual source doesn’t do it. --- ext/extconf.rb | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index aa00f84..060ca2a 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -53,7 +53,7 @@ def have_member_func(klass,member,header) $CXXFLAGS=CONFIG["CXXFLAGS"] $LDFLAGS=CONFIG["LDFLAGS"] $LDFLAGS=$LDFLAGS.split.delete_if {|x| x[0,2]=="-L" && !File.exist?(x[2,x.length-2])}.join(" ") - $LIBS=CONFIG["LIBS"] + #set up special flags for testing moreflags = "" @@ -64,13 +64,13 @@ def have_member_func(klass,member,header) moreflags += " -DHAVE_TR1_UNORDERED_MAP " if have_header("tr1/unordered_map") } wxcppflags=pkg_config("wx","cppflags") - $CPPFLAGS << " " << wxcppflags + $CPPFLAGS += " " << wxcppflags wxcflags=pkg_config("wx","cflags") - $CFLAGS << " " << wxcflags + $CFLAGS += " " << wxcflags wxcxxflags=pkg_config("wx","cxxflags") - $CPPFLAGS << " " << wxcxxflags + $CXXFLAGS += " " << wxcxxflags wxlibs=pkg_config("wx","libs all") - $LIBS << " " << wxlibs + $libs += " " << wxlibs wxldflags=pkg_config("wx","linkdeps") $LDFLAGS << " " << wxldflags #for some function add the base classes @@ -78,30 +78,14 @@ def have_member_func(klass,member,header) case wxpkg when /gtk2/ gdkflags = pkg_config("gdk-x11-2.0") - if gdkflags - $CXXFLAGS << " " << gdkflags[0] - $LIBS << " " << gdkflags[1] - $LDFLAGS << " " << gdkflags[2] - end + $CXXFLAGS += " " << gdkflags[0] if gdkflags[0] # because even though the Ruby doc source code says it does this, it doesn't gtkflags = pkg_config("gtk+-x11-2.0") - if gtkflags - $CXXFLAGS << " " << gtkflags[0] - $LIBS << " " << gtkflags[1] - $LDFLAGS << " " << gtkflags[2] - end + $CXXFLAGS += " " << gtkflags[0] if gtkflags[0] when /gtk3/ gdkflags = pkg_config("gdk-x11-3.0") - if gdkflags - $CXXFLAGS << " " << gdkflags[0] - $LIBS << " " << gdkflags[1] - $LDFLAGS << " " << gdkflags[2] - end + $CXXFLAGS += " " << gdkflags[0] if gdkflags[0] gtkflags = pkg_config("gtk+-x11-3.0") - if gtkflags - $CXXFLAGS << " " << gtkflags[0] - $LIBS << " " << gtkflags[1] - $LDFLAGS << " " << gtkflags[2] - end + $CXXFLAGS += " " << gtkflags[0] if gtkflags[0] end all = " -fvisibility-inlines-hidden" $CFLAGS << all << " -x c++ -g -Wall " From 0c9cb603ee7c682a1a9f43b60154b9fc49eed4a6 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 14:53:29 -0700 Subject: [PATCH 12/22] test include files --- ext/extconf.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/extconf.rb b/ext/extconf.rb index 060ca2a..fdfa263 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -75,18 +75,22 @@ def have_member_func(klass,member,header) $LDFLAGS << " " << wxldflags #for some function add the base classes wxpkg = pkg_config("wx","basename") + print "#{$CFLAGS} \n" case wxpkg when /gtk2/ gdkflags = pkg_config("gdk-x11-2.0") $CXXFLAGS += " " << gdkflags[0] if gdkflags[0] # because even though the Ruby doc source code says it does this, it doesn't + print "#{$INCFLAGS} \n" gtkflags = pkg_config("gtk+-x11-2.0") $CXXFLAGS += " " << gtkflags[0] if gtkflags[0] + print "#{$INCFLAGS} \n" when /gtk3/ gdkflags = pkg_config("gdk-x11-3.0") $CXXFLAGS += " " << gdkflags[0] if gdkflags[0] gtkflags = pkg_config("gtk+-x11-3.0") $CXXFLAGS += " " << gtkflags[0] if gtkflags[0] end + print "#{$CFLAGS} \n" all = " -fvisibility-inlines-hidden" $CFLAGS << all << " -x c++ -g -Wall " $CXXFLAGS << all << " -g -Wall " From 7c773a469243d4486ccc2cb39546ebb832fb9c67 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 15:44:37 -0700 Subject: [PATCH 13/22] try changing the order --- ext/extconf.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index fdfa263..c31e481 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -63,18 +63,7 @@ def have_member_func(klass,member,header) moreflags += " -DHAVE_STD_UNORDERED_MAP " if have_header("unordered_map") moreflags += " -DHAVE_TR1_UNORDERED_MAP " if have_header("tr1/unordered_map") } - wxcppflags=pkg_config("wx","cppflags") - $CPPFLAGS += " " << wxcppflags - wxcflags=pkg_config("wx","cflags") - $CFLAGS += " " << wxcflags - wxcxxflags=pkg_config("wx","cxxflags") - $CXXFLAGS += " " << wxcxxflags - wxlibs=pkg_config("wx","libs all") - $libs += " " << wxlibs - wxldflags=pkg_config("wx","linkdeps") - $LDFLAGS << " " << wxldflags - #for some function add the base classes - wxpkg = pkg_config("wx","basename") + wxpkg = pkg_config("wx","basename") print "#{$CFLAGS} \n" case wxpkg when /gtk2/ @@ -91,6 +80,17 @@ def have_member_func(klass,member,header) $CXXFLAGS += " " << gtkflags[0] if gtkflags[0] end print "#{$CFLAGS} \n" + wxcppflags=pkg_config("wx","cppflags") + $CPPFLAGS += " " << wxcppflags + wxcflags=pkg_config("wx","cflags") + $CFLAGS += " " << wxcflags + wxcxxflags=pkg_config("wx","cxxflags") + $CXXFLAGS += " " << wxcxxflags + wxlibs=pkg_config("wx","libs all") + $libs += " " << wxlibs + wxldflags=pkg_config("wx","linkdeps") + $LDFLAGS << " " << wxldflags + #for some function add the base classes all = " -fvisibility-inlines-hidden" $CFLAGS << all << " -x c++ -g -Wall " $CXXFLAGS << all << " -g -Wall " From 387d066e1dbd9af9b40071639b14941067e14a4c Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 16:32:10 -0700 Subject: [PATCH 14/22] work around pkg_config issues with different ruby versions --- ext/extconf.rb | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index c31e481..a4aacbd 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -63,23 +63,41 @@ def have_member_func(klass,member,header) moreflags += " -DHAVE_STD_UNORDERED_MAP " if have_header("unordered_map") moreflags += " -DHAVE_TR1_UNORDERED_MAP " if have_header("tr1/unordered_map") } - wxpkg = pkg_config("wx","basename") - print "#{$CFLAGS} \n" - case wxpkg - when /gtk2/ - gdkflags = pkg_config("gdk-x11-2.0") - $CXXFLAGS += " " << gdkflags[0] if gdkflags[0] # because even though the Ruby doc source code says it does this, it doesn't + wxpkg = pkg_config("wx","basename") + # create a proc that works across all ruby versions to replace pkg_config issues + pkg_conf = proc {|pkg| + print "#{$CFLAGS} \n" + print "#{$CXXFLAGS} \n" + print "#{$libs} \n" print "#{$INCFLAGS} \n" - gtkflags = pkg_config("gtk+-x11-2.0") - $CXXFLAGS += " " << gtkflags[0] if gtkflags[0] + if (pkglibs = pkg_config(pkg,"libs")) then + if (pkgcinc = pkg_config(pkg,"cflags-only-I")) then + pkgcflags = pkg_config(pkg,"cflags-only-other") + else + pkgcflags = pkg_config(pkg,"cflags") + end + pkglibsonly = pkg_config(pkg,"libs-only-l") + pkgldflags = (Shellwords.shellwords(pkglibs) - Shellwords.shellwords(pkglibsonly)).quote.join(" ") + $CFLAGS += " " << pkgcflags + $CXXFLAGS += " " << pkgcflags + $INCFLAGS += " " << pkgcinc + $libs += " " << pkglibsonly + else + abort("package configuration for %s is missing\n" % [pkg]) + end + print "#{$CFLAGS} \n" + print "#{$CXXFLAGS} \n" + print "#{$libs} \n" print "#{$INCFLAGS} \n" + } + case wxpkg + when /gtk2/ + pkg_conf("gdk-x11-2.0") + pkg_conf("gtk+-x11-2.0") when /gtk3/ - gdkflags = pkg_config("gdk-x11-3.0") - $CXXFLAGS += " " << gdkflags[0] if gdkflags[0] - gtkflags = pkg_config("gtk+-x11-3.0") - $CXXFLAGS += " " << gtkflags[0] if gtkflags[0] + pkg_conf("gdk-x11-3.0") + pkg_conf("gtk+-x11-3.0") end - print "#{$CFLAGS} \n" wxcppflags=pkg_config("wx","cppflags") $CPPFLAGS += " " << wxcppflags wxcflags=pkg_config("wx","cflags") From 8db087138277668b386aee5f6be4fe1108d192aa Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 16:38:07 -0700 Subject: [PATCH 15/22] change pkg_conf to a function --- ext/extconf.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ext/extconf.rb b/ext/extconf.rb index a4aacbd..dddaf6e 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -6,6 +6,31 @@ def have_member_func(klass,member,header) $defs[-1] = "-DHAVE_#{klass.tr_cpp}_#{member.tr_cpp}" end end +def pkg_conf(pkg) + print "#{$CFLAGS} \n" + print "#{$CXXFLAGS} \n" + print "#{$libs} \n" + print "#{$INCFLAGS} \n" + if (pkglibs = pkg_config(pkg,"libs")) then + if (pkgcinc = pkg_config(pkg,"cflags-only-I")) then + pkgcflags = pkg_config(pkg,"cflags-only-other") + else + pkgcflags = pkg_config(pkg,"cflags") + end + pkglibsonly = pkg_config(pkg,"libs-only-l") + pkgldflags = (Shellwords.shellwords(pkglibs) - Shellwords.shellwords(pkglibsonly)).quote.join(" ") + $CFLAGS += " " << pkgcflags + $CXXFLAGS += " " << pkgcflags + $INCFLAGS += " " << pkgcinc + $libs += " " << pkglibsonly + else + abort("package configuration for %s is missing\n" % [pkg]) + end + print "#{$CFLAGS} \n" + print "#{$CXXFLAGS} \n" + print "#{$libs} \n" + print "#{$INCFLAGS} \n" +end unless have_macro("HAVE_RB_DATA_TYPE_T_PARENT") abort("rb_data_type_t needs parent attribute!") From 5424083479b02646401907d1991ae654f0f42718 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 16:56:48 -0700 Subject: [PATCH 16/22] remove duplicates from flags --- ext/extconf.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/extconf.rb b/ext/extconf.rb index dddaf6e..06fb8bb 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -20,9 +20,13 @@ def pkg_conf(pkg) pkglibsonly = pkg_config(pkg,"libs-only-l") pkgldflags = (Shellwords.shellwords(pkglibs) - Shellwords.shellwords(pkglibsonly)).quote.join(" ") $CFLAGS += " " << pkgcflags + $CFLAGS = $CFLAGS.split.uniq.join(" ") $CXXFLAGS += " " << pkgcflags + $CXXFLAGS = $CXXFLAGS.split.uniq.join(" ") $INCFLAGS += " " << pkgcinc + $INCFLAGS = $INCFLAGS.split.uniq.join(" ") $libs += " " << pkglibsonly + $libs = $libs.split.uniq.join(" ") else abort("package configuration for %s is missing\n" % [pkg]) end From 72eab1a1d65af195de7c47dd35fcbc00a9a53593 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 17:05:11 -0700 Subject: [PATCH 17/22] remove print statements --- ext/extconf.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index 06fb8bb..1e7d315 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -7,10 +7,6 @@ def have_member_func(klass,member,header) end end def pkg_conf(pkg) - print "#{$CFLAGS} \n" - print "#{$CXXFLAGS} \n" - print "#{$libs} \n" - print "#{$INCFLAGS} \n" if (pkglibs = pkg_config(pkg,"libs")) then if (pkgcinc = pkg_config(pkg,"cflags-only-I")) then pkgcflags = pkg_config(pkg,"cflags-only-other") @@ -30,10 +26,6 @@ def pkg_conf(pkg) else abort("package configuration for %s is missing\n" % [pkg]) end - print "#{$CFLAGS} \n" - print "#{$CXXFLAGS} \n" - print "#{$libs} \n" - print "#{$INCFLAGS} \n" end unless have_macro("HAVE_RB_DATA_TYPE_T_PARENT") From b08e9d7aff7214af2a57d225e73fb73ab8ace548 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 21:15:15 -0700 Subject: [PATCH 18/22] add have_std_header function based on have_header code use it to replace to code sections and remove duplicate tests --- ext/extconf.rb | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index 1e7d315..671fce8 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -6,6 +6,18 @@ def have_member_func(klass,member,header) $defs[-1] = "-DHAVE_#{klass.tr_cpp}_#{member.tr_cpp}" end end + +def have_std_header(header, preheaders = nil, opt = "", &b) + checking_for header do + if try_header(cpp_include(preheaders)+cpp_include(header), opt, &b) + $defs.push(format("-DHAVE_STD_%s", header.tr_cpp)) + true + else + false + end + end +end + def pkg_conf(pkg) if (pkglibs = pkg_config(pkg,"libs")) then if (pkgcinc = pkg_config(pkg,"cflags-only-I")) then @@ -76,14 +88,6 @@ def pkg_conf(pkg) $LDFLAGS=$LDFLAGS.split.delete_if {|x| x[0,2]=="-L" && !File.exist?(x[2,x.length-2])}.join(" ") - #set up special flags for testing - moreflags = "" - with_cflags(" -x c++ ") { - moreflags += " -DHAVE_TYPE_TRAITS " if have_header("type_traits") - moreflags += " -DHAVE_TR1_TYPE_TRAITS " if have_header("tr1/type_traits") - moreflags += " -DHAVE_STD_UNORDERED_MAP " if have_header("unordered_map") - moreflags += " -DHAVE_TR1_UNORDERED_MAP " if have_header("tr1/unordered_map") - } wxpkg = pkg_config("wx","basename") # create a proc that works across all ruby versions to replace pkg_config issues pkg_conf = proc {|pkg| @@ -137,29 +141,23 @@ def pkg_conf(pkg) $LDFLAGS << all << " " # add the wx-config flags # TODO add extra check if a lib of wx is missing + #set up special flags for testing + olddefs = $defs + $defs.clear with_cflags(" -x c++ ") { - # need c++ for some of the tests - CONFIG["CC"] = CONFIG["CXX"] - #C++03tr1 c++11 differences have_header("type_traits") have_header("tr1/type_traits") - if try_header("unordered_map") - checking_for "unordered_map" do - $defs.push(format("-DHAVE_STD_%s", "unordered_map".tr_cpp)) - end - end + have_std_header("unordered_map") have_header("tr1/unordered_map") - if try_header("unordered_set") - checking_for "unordered_set" do - $defs.push(format("-DHAVE_STD_%s", "unordered_set".tr_cpp)) - end - end + have_std_header("unordered_set") + have_header("tr1/unordered_set") } - with_cflags(" -x c++ "+moreflags) { + moreflags = $defs.join(" ") + $defs = olddefs + $defs + with_cflags(" -x c++ " + moreflags) { # need c++ for some of the tests CONFIG["CC"] = CONFIG["CXX"] #C++03tr1 c++11 differences - have_header("tr1/unordered_set") have_header("wx/preferences.h","wx/defs.h") #check for better Bind commmand unless have_macro("wxHAS_EVENT_BIND","wx/wx.h") @@ -179,7 +177,6 @@ def pkg_conf(pkg) #check for instance methods, that classes need to have default constuctor have_member_func("wxFontPickerCtrl","GetSelectedColour","wx/fontpicker.h") have_member_func("wxInfoBar","GetButtonCount","wx/infobar.h") - have_member_func("wxOwnerDrawnComboBox","IsListEmpty","wx/odcombo.h") #check for enum flags From 152d4c6257056cb72e8b7f9669039bb8e4444b4f Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Sun, 31 May 2015 21:26:28 -0700 Subject: [PATCH 19/22] remove proc replaced by function definition --- ext/extconf.rb | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index 671fce8..c992e10 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -89,32 +89,6 @@ def pkg_conf(pkg) wxpkg = pkg_config("wx","basename") - # create a proc that works across all ruby versions to replace pkg_config issues - pkg_conf = proc {|pkg| - print "#{$CFLAGS} \n" - print "#{$CXXFLAGS} \n" - print "#{$libs} \n" - print "#{$INCFLAGS} \n" - if (pkglibs = pkg_config(pkg,"libs")) then - if (pkgcinc = pkg_config(pkg,"cflags-only-I")) then - pkgcflags = pkg_config(pkg,"cflags-only-other") - else - pkgcflags = pkg_config(pkg,"cflags") - end - pkglibsonly = pkg_config(pkg,"libs-only-l") - pkgldflags = (Shellwords.shellwords(pkglibs) - Shellwords.shellwords(pkglibsonly)).quote.join(" ") - $CFLAGS += " " << pkgcflags - $CXXFLAGS += " " << pkgcflags - $INCFLAGS += " " << pkgcinc - $libs += " " << pkglibsonly - else - abort("package configuration for %s is missing\n" % [pkg]) - end - print "#{$CFLAGS} \n" - print "#{$CXXFLAGS} \n" - print "#{$libs} \n" - print "#{$INCFLAGS} \n" - } case wxpkg when /gtk2/ pkg_conf("gdk-x11-2.0") From 04b5859589694bd5fdbd98e339579176ac123a69 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Mon, 1 Jun 2015 21:13:45 -0700 Subject: [PATCH 20/22] compiler tests more rigorous testing of compilers --- ext/extconf.rb | 52 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index c992e10..38fb2f7 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -52,30 +52,48 @@ def pkg_conf(pkg) if wxversion.chomp < "3.0.0" abort("wx version outdated, please update to 3.0.0 or newer") end - - ruby_cc = RbConfig::CONFIG["CC"] - ruby_cxx = RbConfig::CONFIG["CXX"] + # ruby compilers + ruby_cc = find_executable CONFIG["CC"] + ruby_cxx = find_executable CONFIG["CXX"] # An ruby extension does need to be build against # the same compiler as ruby was unless ruby_cc && find_executable(ruby_cc) - abort("C compiler not found!") + abort("C compiler %s not found!"%ruby_cc) end unless ruby_cxx && find_executable(ruby_cxx) abort("C++ compiler not found!") end - - cc = pkg_config("wx","cc") - cxx = pkg_config("wx","cxx") - - cxxversion_wx = `#{cxx} -v 2>&1`.split("\n") - cxxversion_rb = `#{ruby_cxx} -v 2>&1`.split("\n") - ccversion_wx = `#{cc} -v 2>&1`.split("\n") - ccversion_rb = `#{ruby_cc} -v 2>&1`.split("\n") - unless ccversion_rb.include?(ccversion_wx[0]) - abort("CC compiler missmatch %s == %s" % [ccversion_wx, ccversion_rb]) + # wx compilers + cc = find_executable Shellwords.shellwords(pkg_config("wx","cc"))[0] + cxx = find_executable "clang++" # Shellwords.shellwords(pkg_config("wx","cxx"))[0] + # check if cc compilers are matched + unless (cc == ruby_cc) + unless RbConfig::CONFIG["host_os"].include?("darwin") + abort("CC compiler missmatch %s == %s" % [cc, ruby_cc]) + else # Apple Mac OS X + optwx = IO.popen(["#{cc}","--version"],:err=>[:child,:out],&:read) + optrwx = IO.popen(["#{ruby_cc}","--version"],:err=>[:child,:out],&:read) + unless optrwx.include?(optwx) + # good to go + else + # good to go + end + end end - unless cxxversion_rb.include?(cxxversion_wx[0]) - abort("CXX compiler missmatch %s == %s" % [cxxversion_wx,cxxversion_rb]) + # check if cxx compilers are matched + unless (cxx == ruby_cxx) + unless RbConfig::CONFIG["host_os"].include?("darwin") + abort("CXX compiler missmatch1 %s == %s" % [cxx, ruby_cxx]) + else # Apple Mac OS X + optwx = IO.popen(["#{cxx}","--version"],:err=>[:child,:out],&:read) + optrwx = IO.popen(["#{ruby_cxx}","--version"],:err=>[:child,:out],&:read) + unless optrwx.include?(optwx) + # need to tell clang to be compatible + abort("Apple CXX compiler missmatch %s == %s" % [cxx, ruby_cxx]) # clang needs $CFLAGS += " -std=c++11 -stdlib=libc++ -nostdinc++" + else + # good to go + end + end end #earlier versions of ruby does not have that constant @@ -163,7 +181,7 @@ def pkg_conf(pkg) have_member_func("wxSizerFlags","CenterVertical","wx/sizer.h") } else - abort("wx-config executable not found!") + abort("wx-config executable not found!\n for MSWindows see https://sites.google.com/site/wxconfig/") end From 300b79f8e07b004e4834741bff2614f5de31a205 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Mon, 1 Jun 2015 21:27:45 -0700 Subject: [PATCH 21/22] clang test remove --- ext/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index 38fb2f7..3235c48 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -65,7 +65,7 @@ def pkg_conf(pkg) end # wx compilers cc = find_executable Shellwords.shellwords(pkg_config("wx","cc"))[0] - cxx = find_executable "clang++" # Shellwords.shellwords(pkg_config("wx","cxx"))[0] + cxx = find_executable # Shellwords.shellwords(pkg_config("wx","cxx"))[0] # check if cc compilers are matched unless (cc == ruby_cc) unless RbConfig::CONFIG["host_os"].include?("darwin") From 314805fa548394ea9200b4c0dd4f8fe33dd48595 Mon Sep 17 00:00:00 2001 From: James Rinkevich Date: Tue, 2 Jun 2015 23:42:53 -0700 Subject: [PATCH 22/22] remove commented code --- ext/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index 3235c48..ad16629 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -65,7 +65,7 @@ def pkg_conf(pkg) end # wx compilers cc = find_executable Shellwords.shellwords(pkg_config("wx","cc"))[0] - cxx = find_executable # Shellwords.shellwords(pkg_config("wx","cxx"))[0] + cxx = find_executable Shellwords.shellwords(pkg_config("wx","cxx"))[0] # check if cc compilers are matched unless (cc == ruby_cc) unless RbConfig::CONFIG["host_os"].include?("darwin")