--- ruby-1.6.7/ext/tcltklib/extconf.rb.orig	Thu Oct 17 12:22:00 2002
+++ ruby-1.6.7/ext/tcltklib/extconf.rb	Thu Oct 17 12:35:53 2002
@@ -11,14 +11,14 @@
 
 dir_config("tk")
 dir_config("tcl")
-dir_config("X11")
+dir_config("X11", "/usr/X11R6/include", "/usr/X11R6/lib")
 
 tklib = with_config("tklib")
 tcllib = with_config("tcllib")
 stubs = enable_config("tcltk_stubs") || with_config("tcltk_stubs")
 
 def find_tcl(tcllib, stubs)
-  paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
+  paths = ["@PREFIX@/lib", "/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
   func = stubs ? "Tcl_InitStubs" : "Tcl_FindExecutable"
   if tcllib
     find_library(tcllib, func, *paths)
@@ -40,7 +40,7 @@
 end
 
 def find_tk(tklib, stubs)
-  paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
+  paths = ["@PREFIX@/lib", "/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
   func = stubs ? "Tk_InitStubs" : "Tk_Init"
   if tklib
     find_library(tklib, func, *paths)
--- ruby-1.6.8/configure	2002-11-19 12:49:26.000000000 +0100
+++ ruby-1.6.8.new/configure	2003-06-10 16:28:37.000000000 +0200
@@ -2428,7 +2428,7 @@
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-ldl $LIBS"
+  LIBS="$LDFLAGS -ldl $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
@@ -4585,7 +4585,7 @@
 			LDFLAGS=""
 			DLDFLAGS="$ARCH_FLAG"
 			rb_cv_dlopen=yes ;;
-	darwin*)	LDSHARED='cc -dynamic -bundle -undefined suppress -flat_namespace'
+	darwin*)	LDSHARED='cc -dynamic -bundle'
 			LDFLAGS=""
 			DLDFLAGS="$ARCH_FLAG"
 			rb_cv_dlopen=yes ;;
@@ -5030,7 +5030,7 @@
 
 
 FIRSTMAKEFILE=""
-LIBRUBY_A='lib$(RUBY_INSTALL_NAME).a'
+LIBRUBY_A='libruby.a'
 LIBRUBY='$(LIBRUBY_A)'
 LIBRUBYARG='$(LIBRUBY_A)'
 SOLIBS=
@@ -5058,7 +5058,7 @@
 
 if test "$enable_shared" = 'yes'; then
   LIBRUBY='$(LIBRUBY_SO)'
-  LIBRUBYARG='-L. -l$(RUBY_INSTALL_NAME)'
+  LIBRUBYARG='-L. -lruby'
   CFLAGS="$CFLAGS $CCDLFLAGS"
   ENABLE_SHARED=yes
   if test "$rb_cv_binary_elf" = yes; then
@@ -5122,10 +5122,10 @@

 	;;
     darwin*)
-	LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
+	LIBRUBY_SO='libruby.$(MAJOR).$(MINOR).$(TEENY).dylib'
-	LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
-	LIBRUBY_DLDFLAGS='-install_name $(prefix)/lib/lib$(RUBY_INSTALL_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
-	LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
+	LIBRUBY_LDSHARED='cc -dynamiclib'
+	LIBRUBY_DLDFLAGS='-install_name $(prefix)/lib/libruby.1.dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
+	LIBRUBY_ALIASES='libruby.$(MAJOR).$(MINOR).dylib libruby.1.dylib libruby.dylib'
 	;;
     *)
 	;;
--- ruby-1.6.8/Makefile.in~	2002-04-02 16:34:37.000000000 +0200
+++ ruby-1.6.8/Makefile.in	2003-06-11 14:31:27.000000000 +0200
@@ -13,7 +13,7 @@
 
 prefix = @prefix@
 CFLAGS = @CFLAGS@
-CPPFLAGS = -I. -I$(srcdir)
+CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
 LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
 XLDFLAGS = @XLDFLAGS@
 EXTLIBS = 
--- ruby-1.6.8/ext/extmk.rb.in~	2002-12-24 09:29:10.000000000 +0100
+++ ruby-1.6.8/ext/extmk.rb.in	2003-06-12 13:12:18.000000000 +0200
@@ -75,8 +75,8 @@
 else
   OUTFLAG = '-o '
 end
-LINK = "@CC@ #{OUTFLAG}conftest -I#$topdir -I#$top_srcdir #{CFLAGS} @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@"
-CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} %s %s %s conftest.c"
+LINK = "@CC@ #{OUTFLAG}conftest -I#$topdir -I#$top_srcdir -I#$includedir #{CFLAGS} @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@"
+CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir -I#$includedir #{CFLAGS} %s %s %s conftest.c"
 
 $log = nil
 $orgerr = $stderr.dup
@@ -422,7 +422,7 @@
 CC = @CC@
 
 CFLAGS   = %s #{CFLAGS} #$CFLAGS
-CPPFLAGS = -I$(topdir) -I$(hdrdir) %s #$CPPFLAGS
+CPPFLAGS = -I$(topdir) -I$(hdrdir) -I#$includedir %s #$CPPFLAGS
 DLDFLAGS = #$DLDFLAGS #$LDFLAGS
 LDSHARED = @LDSHARED@ #{defflag}
 ", if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
--- ruby-1.6.8/config.guess~	2001-11-10 14:39:27.000000000 +0100
+++ ruby-1.6.8/config.guess	2003-06-13 15:03:29.000000000 +0200
@@ -1135,7 +1135,7 @@
 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
 	exit 0 ;;
     *:Darwin:*:*)
-	echo `uname -p`-apple-darwin${UNAME_RELEASE}
+	echo `uname -p`-apple-darwin
 	exit 0 ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	if test "${UNAME_MACHINE}" = "x86pc"; then
--- ruby-1.6.8/eval.c	Sun Feb  8 15:56:45 2004
+++ ruby-1.6.8/eval.c	Sun Feb  8 15:56:57 2004
@@ -7458,7 +7458,7 @@
 }
 
 static int
-thread_switch(n)
+rb_thread_switch(n)
     int n;
 {
     switch (n) {
@@ -7490,7 +7490,7 @@
 }
 
 #define THREAD_SAVE_CONTEXT(th) \
-    (rb_thread_save_context(th),thread_switch(setjmp((th)->context)))
+    (rb_thread_save_context(th),rb_thread_switch(setjmp((th)->context)))
 
 static void rb_thread_restore_context _((rb_thread_t,int));
 
@@ -8326,12 +8326,12 @@
     return INT2NUM(th->safe);
 }
 
-static int thread_abort;
+static int ruby_thread_abort;
 
 static VALUE
 rb_thread_s_abort_exc()
 {
-    return thread_abort?Qtrue:Qfalse;
+    return ruby_thread_abort?Qtrue:Qfalse;
 }
 
 static VALUE
@@ -8339,7 +8339,7 @@
     VALUE self, val;
 {
     rb_secure(4);
-    thread_abort = RTEST(val);
+    ruby_thread_abort = RTEST(val);
     return val;
 }
 
@@ -8551,7 +8551,7 @@
 	    rb_thread_raise(1, &ruby_errinfo, main_thread);
 	}
 	else if (th->safe < 4 &&
-		 (thread_abort || th->abort || RTEST(ruby_debug))) {
+		 (ruby_thread_abort || th->abort || RTEST(ruby_debug))) {
 	    VALUE err = rb_exc_new(rb_eSystemExit, 0, 0);
 	    error_print();
 	    /* exit on main_thread */
