--- configure.in.orig	2005-11-24 04:07:18.000000000 -0800
+++ configure.in	2006-01-08 08:28:15.000000000 -0800
@@ -1461,9 +1461,28 @@
 AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
 AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
 
+AC_ARG_WITH(vendordir,
+	    [  --with-vendordir=DIR      vendor libraries in DIR [PREFIX/lib/ruby/vendor_ruby]],
+            [vendordir=$withval],
+            [vendordir='${prefix}/lib/ruby/vendor_ruby'])
+VENDOR_DIR="`eval \"echo ${vendordir}\"`"
+case "$target_os" in
+  cygwin*|mingw*|*djgpp*|os2_emx*)
+    RUBY_VENDOR_LIB_PATH="`expr "$VENDOR_DIR" : "$prefix\(/.*\)"`" ||
+    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
+  *)
+    RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
+esac
+RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}"
+
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
+
 AC_SUBST(arch)dnl
 AC_SUBST(sitearch)dnl
+AC_SUBST(vendorarch)dnl
 AC_SUBST(sitedir)dnl
+AC_SUBST(vendordir)dnl
 
 configure_args=$ac_configure_args
 AC_SUBST(configure_args)dnl
@@ -1476,6 +1495,8 @@
 
     AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
                  "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+    AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
+                 "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
     AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
 else
     arch="${target_cpu}-${target_os}"
@@ -1483,12 +1504,15 @@
 fi
 
 case "$target_os" in
-  mingw*) sitearch="i386-$rb_cv_msvcrt" ;;
-  *) sitearch="${arch}" ;;
+  mingw*) sitearch="i386-$rb_cv_msvcrt"
+  		  vendorarch="i386-$rb_cv_msvcrt" ;;
+  *) sitearch="${arch}"
+     vendorarch="${arch}" ;;
 esac
 
 AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
 AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${vendorarch}")
 
 AC_ARG_WITH(search-path,
 		[  --with-search-path=DIR specify the additional search path],
