なかだです。

  ruby-gtk-0.25をソースと別ディレクトリでコンパイルするためのパッ
チです。1.6以降じゃないと動かない可能性もありますが。


diff -ru2p gtk-0.25.orig/extconf.rb gtk-0.25/extconf.rb --- gtk-0.25.orig/extconf.rb Fri Feb 23 23:36:21 2001 +++ gtk-0.25/extconf.rb Mon Aug 20 07:40:19 2001 @@ -5,4 +5,6 @@ extconf.rb for gtk extention library require "mkmf" +TOPDIR = File.expand_path(File.dirname(__FILE__)) + # # detect GTK+ configurations @@ -60,4 +62,5 @@ mdir = $mdir begin $mdir = "gtk/src" + Dir.mkdir "src" unless File.directory? "src" Dir.chdir "src" @@ -92,38 +95,29 @@ begin $CFLAGS = $CFLAGS + " -DUSE_XIM" end + $CPPFLAGS += " -I." obj_ext = ".#{$OBJEXT}" $libs = $libs.split(/\s/).uniq.join(' ') - $source_files = Dir.glob('*.c') - $objs = $source_files.collect do |item| - item.gsub(/\.c$/, obj_ext) - end +# $objs = Dir.glob(TOPDIR+'/src/*.c').collect do |item| +# File.basename(item, '.c') + obj_ext +# end if /mswin32/ =~ PLATFORM - $objs << "rbgdkkeysyms.lib" + $LOCAL_LIBS = "rbgdkkeysyms.lib" else - $objs << "librbgdkkeysyms.a" + $LOCAL_LIBS = "librbgdkkeysyms.a" end - create_makefile("gtk") + create_makefile("gtk", TOPDIR+"/src") raise Interrupt if not FileTest.exist? "Makefile" mfile = File.open("Makefile", "a") - if /mswin32/ =~ PLATFORM - mfile.puts " copy /Y gtk.lib .." - mfile.puts - end - mfile.print "\n" - $source_files.each do |e| - mfile.print "#{e.gsub(/\.c$/, obj_ext)}: #{e} rbgtk.h global.h\n" - end - mfile.print "rbgdkconst#{obj_ext}: rbgdkconst.c rbgdkcursors.h\n" - mfile.print "rbgdk#{obj_ext}: rbgdk.c global.h\n" - - if /mswin32/ =~ PLATFORM + if /nmake/i =~ $make mfile.print "\ +$(OBJS): {$(srcdir)}rbgtk.h {$(srcdir)}global.h + rbgdkkeysyms.lib: makedefconst.rb rbgdkkeysyms.h - $(RUBY) makedefconst.rb rbgdkkeysyms.h Init_gtk_gdkkeysyms + $(RUBY) $(srcdir)/makedefconst.rb rbgdkkeysyms.h Init_gtk_gdkkeysyms cd rbgdkkeysyms nmake ..\\$@ @@ -132,7 +126,8 @@ rbgdkkeysyms.lib: makedefconst.rb rbgdkk else mfile.print "\ +$(OBJS): rbgtk.h global.h -librbgdkkeysyms.a: makedefconst.rb rbgdkkeysyms.h - $(RUBY) makedefconst.rb rbgdkkeysyms.h Init_gtk_gdkkeysyms +#{$LOCAL_LIBS}: makedefconst.rb rbgdkkeysyms.h + $(RUBY) $(srcdir)/makedefconst.rb rbgdkkeysyms.h Init_gtk_gdkkeysyms cd rbgdkkeysyms; make ../$@; cd .. " @@ -141,6 +136,10 @@ librbgdkkeysyms.a: makedefconst.rb rbgdk mfile.print "\ -rbgdkcursors.h:; $(RUBY) makecursors.rb #{gdkincl}/gdkcursors.h > $@ -rbgdkkeysyms.h:; $(RUBY) makekeysyms.rb #{gdkincl}/gdkkeysyms.h > $@ +rbgdkcursors.h: + $(RUBY) $(srcdir)/makecursors.rb #{gdkincl}/gdkcursors.h > $@ +rbgdkkeysyms.h: + $(RUBY) $(srcdir)/makekeysyms.rb #{gdkincl}/gdkkeysyms.h > $@ + +$(DLLIB): $(LOCAL_LIBS) allclean: clean @@ -151,5 +150,5 @@ allclean: clean mfile = File.open("Makefile", "w") - if /mswin32/ =~ PLATFORM + if /nmake/i =~ $make mfile.print "\ @@ -157,4 +156,5 @@ all: @cd src @nmake -nologo + @copy /Y gtk.lib .. install: diff -ru2p gtk-0.25.orig/src/makedefconst.rb gtk-0.25/src/makedefconst.rb --- gtk-0.25.orig/src/makedefconst.rb Wed Aug 25 12:21:44 1999 +++ gtk-0.25/src/makedefconst.rb Sun Aug 19 13:51:54 2001 @@ -80,5 +80,5 @@ cfile = File.open("#{name}.c", "a") cfile.puts("#include \"ruby.h\"") cfile.puts("#include <gdk/gdkkeysyms.h>") -cfile.puts("#include \"../global.h\"") +cfile.puts("#include \"global.h\"") cfile.puts("#include \"#{name}.h\"") cfile.puts("void #{func}() {") @@ -102,5 +102,5 @@ for i in Dir.glob("_#{name}.[a-z][a-z]") cfile2.puts("#include \"ruby.h\"") cfile2.puts("#include <gdk/gdkkeysyms.h>") - cfile2.puts("#include \"../global.h\"") + cfile2.puts("#include \"global.h\"") cfile2.puts("void Init_gtk_#{j}() {") cfile2.puts(" #include \"#{i}\"")
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦