From: Michael Graff Date: 2010-03-24T03:15:26+09:00 Subject: [ruby-core:28899] Patch for ext/tk/extconf.rb This is a multi-part message in MIME format. --------------090307070800080401030809 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I'm attempting to make ruby 1.9.1 build more easily/cleanly on NetBSD 5, and ran into a problem inside ext/tk. Provided is a patch that does two things: (1) Fixes what I believe is a cut and paste error. In places, TclConfig_Info['TK...'] is used where I I belive these should be TkConfig_Info[]. (2) Adds includes from TK_XINCLUDES if we found X11 libraries, AND it is set, to the build command line. These make things compile on NetBSD. I do not have commit access so it's not easy to test these on other OSs (MacOS is the only one I have easy access to) but I do not believe they should affect other systems negatively. --Michael --------------090307070800080401030809 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="ruby.ext.tk.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ruby.ext.tk.diff" Index: extconf.rb =================================================================== --- extconf.rb (revision 27020) +++ extconf.rb (working copy) @@ -999,7 +999,7 @@ end if TkConfig_Info['TK_INCLUDE_SPEC'] && - have_tk_h = try_cpp('tk.h', TclConfig_Info['TK_INCLUDE_SPEC']) + have_tk_h = try_cpp('tk.h', TkConfig_Info['TK_INCLUDE_SPEC']) $INCFLAGS << " " << TkConfig_Info['TK_INCLUDE_SPEC'] elsif have_tk_h = have_header('tk.h') # find @@ -1026,12 +1026,12 @@ if File.exist?(dir = File.join(TkLib_Config["tcltk-framework"], 'Tcl.framework', 'Headers')) TclConfig_Info['TCL_INCLUDE_SPEC'] = "-I#{dir} " - TclConfig_Info['TK_INCLUDE_SPEC'] = "-I#{File.join(TkLib_Config['tcltk-framework'], 'Tk.framework', 'Headers')} " + TkConfig_Info['TK_INCLUDE_SPEC'] = "-I#{File.join(TkLib_Config['tcltk-framework'], 'Tk.framework', 'Headers')} " else dir = Dir.glob(File.join(TkLib_Config["tcltk-framework"], 'Tcl.framework', '*', 'Headers')) TclConfig_Info['TCL_INCLUDE_SPEC'] = "-I#{dir[0]} " unless dir.empty? - TclConfig_Info['TK_INCLUDE_SPEC'] = "-I#{Dir.glob(File.join(TkLib_Config['tcltk-framework'], 'Tk.framework', '*', 'Headers'))[0]} " + TkConfig_Info['TK_INCLUDE_SPEC'] = "-I#{Dir.glob(File.join(TkLib_Config['tcltk-framework'], 'Tk.framework', '*', 'Headers'))[0]} " end $LDFLAGS << ' -framework Tk -framework Tcl' @@ -1384,8 +1384,13 @@ # search X libraries use_X = search_X_libraries +if use_X + if TkConfig_Info['TK_XINCLUDES'] && + !TkConfig_Info['TK_XINCLUDES'].strip.empty? + $INCFLAGS << " " << TkConfig_Info['TK_XINCLUDES'].strip + end +end - #--------------------------------------------------- if (TkLib_Config["tcltk-framework"] || --------------090307070800080401030809--