summaryrefslogtreecommitdiff
path: root/lang/ruby18/files
diff options
context:
space:
mode:
Diffstat (limited to 'lang/ruby18/files')
-rw-r--r--lang/ruby18/files/extrapatch-oniguruma-reggnu.c140
-rw-r--r--lang/ruby18/files/patch-configure.in51
-rw-r--r--lang/ruby18/files/patch-ext_socket_socket.c105
-rw-r--r--lang/ruby18/files/patch-ext_tk_tkutil_extconf.rb12
-rw-r--r--lang/ruby18/files/patch-gc.c176
-rw-r--r--lang/ruby18/files/patch-io.c22
-rw-r--r--lang/ruby18/files/patch-lib_uri_generic.rb19
-rw-r--r--lang/ruby18/files/patch-main.c86
-rw-r--r--lang/ruby18/files/patch-mkconfig.rb11
-rw-r--r--lang/ruby18/files/patch-mkmf.rb27
-rw-r--r--lang/ruby18/files/patch-openssl_missing.c30
-rw-r--r--lang/ruby18/files/patch-openssl_missing.h20
12 files changed, 0 insertions, 699 deletions
diff --git a/lang/ruby18/files/extrapatch-oniguruma-reggnu.c b/lang/ruby18/files/extrapatch-oniguruma-reggnu.c
deleted file mode 100644
index 8d09202dbe27..000000000000
--- a/lang/ruby18/files/extrapatch-oniguruma-reggnu.c
+++ /dev/null
@@ -1,140 +0,0 @@
---- reggnu.c.orig 2008-08-15 20:48:50.000000000 +0400
-+++ reggnu.c 2008-08-15 20:49:03.000000000 +0400
-@@ -254,3 +254,137 @@
- }
- #endif
- }
-+typedef unsigned int (*mbc_startpos_func_t) _((const char *string, unsigned int pos));
-+
-+static unsigned int asc_startpos _((const char *string, unsigned int pos));
-+static unsigned int euc_startpos _((const char *string, unsigned int pos));
-+static unsigned int sjis_startpos _((const char *string, unsigned int pos));
-+static unsigned int utf8_startpos _((const char *string, unsigned int pos));
-+
-+/* adjust startpos value to the position between characters. */
-+int
-+re_mbc_startpos(string, size, startpos, range)
-+ const char *string;
-+ int size, startpos, range;
-+{
-+ OnigEncoding current_enc = onigenc_get_default_encoding();
-+ int i;
-+
-+ if (current_enc == ONIG_ENCODING_ASCII)
-+ i = asc_startpos(string, startpos);
-+ else if (current_enc == ONIG_ENCODING_EUC_JP)
-+ i = euc_startpos(string, startpos);
-+ else if (current_enc == ONIG_ENCODING_SJIS)
-+ i = sjis_startpos(string, startpos);
-+ else if (current_enc == ONIG_ENCODING_UTF8)
-+ i = utf8_startpos(string, startpos);
-+ else
-+ return (-1);
-+
-+ if (i < startpos) {
-+ if (range > 0) {
-+ startpos = i + mbclen(string[i]);
-+ }
-+ else {
-+ int len = mbclen(string[i]);
-+ if (i + len <= startpos)
-+ startpos = i + len;
-+ else
-+ startpos = i;
-+ }
-+ }
-+ return startpos;
-+}
-+
-+#define mbc_isfirst(t, c) (t)[(unsigned char)(c)]
-+#define mbc_len(t, c) ((t)[(unsigned char)(c)]+1)
-+
-+static unsigned int
-+asc_startpos(string, pos)
-+ const char *string;
-+ unsigned int pos;
-+{
-+ return pos;
-+}
-+
-+#define euc_islead(c) ((unsigned char)((c) - 0xa1) > 0xfe - 0xa1)
-+#define euc_mbclen(c) mbc_len(mbctab_euc, (c))
-+static unsigned int
-+euc_startpos(string, pos)
-+ const char *string;
-+ unsigned int pos;
-+{
-+ unsigned int i = pos, w;
-+
-+ while (i > 0 && !euc_islead(string[i])) {
-+ --i;
-+ }
-+ if (i == pos || i + (w = euc_mbclen(string[i])) > pos) {
-+ return i;
-+ }
-+ i += w;
-+ return i + ((pos - i) & ~1);
-+}
-+
-+static const unsigned char mbctab_sjis_trail[] = { /* 0x40-0x7E,0x80-0xFC */
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0
-+};
-+
-+#define sjis_isfirst(c) mbc_isfirst(mbctab_sjis, (c))
-+#define sjis_istrail(c) mbctab_sjis_trail[(unsigned char)(c)]
-+#define sjis_mbclen(c) mbc_len(mbctab_sjis, (c))
-+static unsigned int
-+sjis_startpos(string, pos)
-+ const char *string;
-+ unsigned int pos;
-+{
-+ unsigned int i = pos, w;
-+
-+ if (i > 0 && sjis_istrail(string[i])) {
-+ do {
-+ if (!sjis_isfirst(string[--i])) {
-+ ++i;
-+ break;
-+ }
-+ } while (i > 0);
-+ }
-+ if (i == pos || i + (w = sjis_mbclen(string[i])) > pos) {
-+ return i;
-+ }
-+ i += w;
-+ return i + ((pos - i) & ~1);
-+}
-+
-+#define utf8_islead(c) ((unsigned char)((c) & 0xc0) != 0x80)
-+#define utf8_mbclen(c) mbc_len(mbctab_utf8, (c))
-+static unsigned int
-+utf8_startpos(string, pos)
-+ const char *string;
-+ unsigned int pos;
-+{
-+ unsigned int i = pos, w;
-+
-+ while (i > 0 && !utf8_islead(string[i])) {
-+ --i;
-+ }
-+ if (i == pos || i + (w = utf8_mbclen(string[i])) > pos) {
-+ return i;
-+ }
-+ return i + w;
-+}
-+#undef utf8_islead
diff --git a/lang/ruby18/files/patch-configure.in b/lang/ruby18/files/patch-configure.in
deleted file mode 100644
index 391fa3e04897..000000000000
--- a/lang/ruby18/files/patch-configure.in
+++ /dev/null
@@ -1,51 +0,0 @@
---- configure.in.orig 2009-12-24 01:10:03.000000000 -0800
-+++ configure.in 2010-10-10 23:21:07.000000000 -0700
-@@ -502,7 +502,7 @@
- AC_CHECK_LIB(crypt, crypt)
- AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
- AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
--AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux
-+AC_SEARCH_LIBS(clock_gettime, rt) # GNU/Linux
-
- case "$target_cpu" in
- alpha*) case "$target_os"::"$GCC" in
-@@ -1021,7 +1021,7 @@
- case $pthread_lib in
- c)
- ;;
-- c_r)
-+ c_r | pthread)
- MAINLIBS="-pthread $MAINLIBS"
- ;;
- *)
-@@ -1033,11 +1033,19 @@
- fi
- AC_CHECK_FUNCS(nanosleep)
- if test x"$ac_cv_func_nanosleep" = xno; then
-- AC_CHECK_LIB(rt, nanosleep)
-- if test x"$ac_cv_lib_rt_nanosleep" = xyes; then
-+ AC_SEARCH_LIBS(nanosleep, rt)
-+ if test x"$ac_cv_search_nanosleep" != xno; then
- AC_DEFINE(HAVE_NANOSLEEP)
- fi
- fi
-+ AC_MSG_CHECKING([for pthread_np.h])
-+ AC_TRY_COMPILE([
-+ #include <pthread.h>
-+ #include <pthread_np.h>],
-+ [(void)0;],
-+ AC_MSG_RESULT(yes)
-+ AC_DEFINE(HAVE_PTHREAD_NP_H),
-+ AC_MSG_RESULT(no))
- fi
- if test x"$ac_cv_header_ucontext_h" = xyes; then
- if test x"$rb_with_pthread" = xyes; then
-@@ -1446,7 +1454,7 @@
- SOLIBS=
-
- case "$target_os" in
-- cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*)
-+ cygwin*|mingw*|beos*|openstep*|nextstep*|rhapsody*|darwin*|os2-emx*|freebsd*)
- : ${DLDLIBS=""}
- ;;
- *)
diff --git a/lang/ruby18/files/patch-ext_socket_socket.c b/lang/ruby18/files/patch-ext_socket_socket.c
deleted file mode 100644
index 86092a459d58..000000000000
--- a/lang/ruby18/files/patch-ext_socket_socket.c
+++ /dev/null
@@ -1,105 +0,0 @@
---- ext/socket/socket.c.orig 2009-02-23 00:54:12.000000000 +0300
-+++ ext/socket/socket.c 2009-02-23 01:27:13.000000000 +0300
-@@ -1111,81 +1111,33 @@
- fcntl(fd, F_SETFL, mode|NONBLOCKING);
- #endif /* HAVE_FCNTL */
-
-- for (;;) {
- #if defined(SOCKS) && !defined(SOCKS5)
-- if (socks) {
-- status = Rconnect(fd, sockaddr, len);
-- }
-- else
--#endif
-- {
-- status = connect(fd, sockaddr, len);
-- }
-- if (status < 0) {
-- switch (errno) {
-- case EAGAIN:
--#ifdef EINPROGRESS
-- case EINPROGRESS:
--#endif
--#if WAIT_IN_PROGRESS > 0
-- sockerrlen = sizeof(sockerr);
-- status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
-- if (status) break;
-- if (sockerr) {
-- status = -1;
-- errno = sockerr;
-- break;
-- }
--#endif
--#ifdef EALREADY
-- case EALREADY:
--#endif
--#if WAIT_IN_PROGRESS > 0
-- wait_in_progress = WAIT_IN_PROGRESS;
--#endif
-- status = wait_connectable(fd);
-- if (status) {
-- break;
-- }
-- errno = 0;
-- continue;
--
--#if WAIT_IN_PROGRESS > 0
-- case EINVAL:
-- if (wait_in_progress-- > 0) {
-- /*
-- * connect() after EINPROGRESS returns EINVAL on
-- * some platforms, need to check true error
-- * status.
-- */
-- sockerrlen = sizeof(sockerr);
-- status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
-- if (!status && !sockerr) {
-- struct timeval tv = {0, 100000};
-- rb_thread_wait_for(tv);
-- continue;
-- }
-- status = -1;
-- errno = sockerr;
-- }
-- break;
--#endif
--
--#ifdef EISCONN
-- case EISCONN:
-- status = 0;
-- errno = 0;
-- break;
-+ if (socks) {
-+ status = Rconnect(fd, sockaddr, len);
-+ }
-+ else
- #endif
-- default:
-- break;
-+ {
-+ status = connect(fd, sockaddr, len);
-+ }
-+
-+ if (status < 0 && (errno == EINPROGRESS || errno == EWOULDBLOCK)) {
-+ status = wait_connectable(fd);
-+ if (status == 0) {
-+ int buf;
-+ char c;
-+ int len = sizeof(buf);
-+ status = getpeername(fd, (struct sockaddr *)&buf, &len);
-+ if (status == -1) {
-+ read(fd, &c, 1); /* set errno. */
- }
- }
-+ }
-+
- #ifdef HAVE_FCNTL
-- fcntl(fd, F_SETFL, mode);
-+ fcntl(fd, F_SETFL, mode);
- #endif
-- return status;
-- }
-+ return status;
- }
-
- struct inetsock_arg
diff --git a/lang/ruby18/files/patch-ext_tk_tkutil_extconf.rb b/lang/ruby18/files/patch-ext_tk_tkutil_extconf.rb
deleted file mode 100644
index 54f0582041c5..000000000000
--- a/lang/ruby18/files/patch-ext_tk_tkutil_extconf.rb
+++ /dev/null
@@ -1,12 +0,0 @@
---- ext/tk/tkutil/extconf.rb.orig 2009-02-14 01:15:24.000000000 +0300
-+++ ext/tk/tkutil/extconf.rb 2009-02-14 01:15:39.000000000 +0300
-@@ -5,9 +5,7 @@
- has_tk = true
- end
-
--if has_tk
- require 'mkmf'
- have_func("rb_obj_instance_exec", "ruby.h")
- have_func("strndup", "string.h")
- create_makefile('tkutil')
--end
diff --git a/lang/ruby18/files/patch-gc.c b/lang/ruby18/files/patch-gc.c
deleted file mode 100644
index 971b52e2ab9b..000000000000
--- a/lang/ruby18/files/patch-gc.c
+++ /dev/null
@@ -1,176 +0,0 @@
---- gc.c.orig 2009-12-24 00:28:08.000000000 -0800
-+++ gc.c 2010-01-05 18:02:16.000000000 -0800
-@@ -30,6 +30,10 @@
- #include <sys/resource.h>
- #endif
-
-+#if defined(HAVE_PTHREAD_NP_H)
-+#include <pthread_np.h>
-+#endif
-+
- #if defined _WIN32 || defined __CYGWIN__
- #include <windows.h>
- #endif
-@@ -75,6 +79,7 @@
- static void run_final();
- static VALUE nomem_error;
- static void garbage_collect();
-+static void set_stack_limit();
-
- int ruby_gc_stress = 0;
-
-@@ -485,6 +490,8 @@
- # define STACK_LEVEL_MAX 655300
- #endif
-
-+VALUE *stack_bottom_addr = 0x0;
-+
- #ifdef C_ALLOCA
- # define SET_STACK_END VALUE stack_end; alloca(0);
- # define STACK_END (&stack_end)
-@@ -534,9 +541,22 @@
-
- #define GC_WATER_MARK 512
-
--#define CHECK_STACK(ret) do {\
-+#define CHECK_STACK(ret, prev) do {\
- SET_STACK_END;\
-- (ret) = (STACK_LENGTH > STACK_LEVEL_MAX + GC_WATER_MARK);\
-+ ssize_t avail;\
-+ if (stack_bottom_addr != 0) {\
-+ if (STACK_UPPER(&avail, 1, -1) > 0)\
-+ avail = stack_bottom_addr - STACK_END;\
-+ else\
-+ avail = STACK_END - stack_bottom_addr;\
-+ } else {\
-+ avail = STACK_LEVEL_MAX + GC_WATER_MARK - STACK_LENGTH;\
-+ }\
-+ if (avail <= 0 || (prev != 0 && (prev - avail) > avail))\
-+ (ret) = 1;\
-+ else\
-+ (ret) = 0;\
-+ (prev) = avail;\
- } while (0)
-
- size_t
-@@ -552,8 +572,9 @@
- ruby_stack_check()
- {
- int ret;
-+ static ssize_t prev = 0;
-
-- CHECK_STACK(ret);
-+ CHECK_STACK(ret, prev);
- return ret;
- }
-
-@@ -1607,18 +1628,72 @@
- }
- rb_gc_stack_start = addr;
- #endif
-+ set_stack_limit();
-+}
-+
-+static void set_stack_limit()
-+{
-+ size_t stacksize = 0;
-+
- #ifdef HAVE_GETRLIMIT
- {
- struct rlimit rlim;
-
-- if (getrlimit(RLIMIT_STACK, &rlim) == 0) {
-- unsigned int space = rlim.rlim_cur/5;
-+ if (getrlimit(RLIMIT_STACK, &rlim) == 0)
-+ stacksize = rlim.rlim_cur;
-+ }
-+#elif defined _WIN32
-+ {
-+ MEMORY_BASIC_INFORMATION mi;
-
-- if (space > 1024*1024) space = 1024*1024;
-- STACK_LEVEL_MAX = (rlim.rlim_cur - space) / sizeof(VALUE);
-+ if (VirtualQuery(&mi, &mi, sizeof(mi))) {
-+ stacksize = (char *)mi.BaseAddress - (char *)mi.AllocationBase;
-+ }
-+ }
-+#endif
-+#if defined(_THREAD_SAFE) && defined(HAVE_PTHREAD_NP_H)
-+ {
-+ pthread_attr_t attr;
-+ size_t size;
-+ void *addr;
-+
-+ pthread_attr_init(&attr);
-+ if (pthread_attr_get_np(pthread_self(), &attr) == 0) {
-+ pthread_attr_getstack(&attr, &addr, &size);
-+ if (stacksize == 0 || size < stacksize)
-+ stacksize = size;
-+ stack_bottom_addr = addr;
-+ }
-+ pthread_attr_destroy(&attr);
-+ }
-+#endif
-+ if (stacksize) {
-+ unsigned int space = stacksize / 5;
-+
-+ if (space > 1024*1024)
-+ space = 1024*1024;
-+ STACK_LEVEL_MAX = (stacksize - space) / sizeof(VALUE);
-+#if defined(__FreeBSD__)
-+#include <sys/sysctl.h>
-+ if (stack_bottom_addr == 0) {
-+ size_t len;
-+ void *usrstack;
-+ int mib[2];
-+ int error;
-+
-+ len = sizeof(usrstack);
-+ mib[0] = CTL_KERN;
-+ mib[1] = KERN_USRSTACK;
-+ error = sysctl(mib, 2, &usrstack, &len, NULL, 0);
-+ if (error == 0) {
-+ if (STACK_UPPER(&avail, 1, -1) > 0)
-+ stack_bottom_addr = usrstack + (stacksize - space);
-+ else
-+ stack_bottom_addr = usrstack - (stacksize - space);
- }
- }
- #endif
-+ }
- }
-
- void ruby_init_stack(VALUE *addr
-@@ -1639,31 +1714,7 @@
- rb_gc_register_stack_start = (VALUE*)bsp;
- }
- #endif
--#ifdef HAVE_GETRLIMIT
-- {
-- struct rlimit rlim;
--
-- if (getrlimit(RLIMIT_STACK, &rlim) == 0) {
-- unsigned int space = rlim.rlim_cur/5;
--
-- if (space > 1024*1024) space = 1024*1024;
-- STACK_LEVEL_MAX = (rlim.rlim_cur - space) / sizeof(VALUE);
-- }
-- }
--#elif defined _WIN32
-- {
-- MEMORY_BASIC_INFORMATION mi;
-- DWORD size;
-- DWORD space;
--
-- if (VirtualQuery(&mi, &mi, sizeof(mi))) {
-- size = (char *)mi.BaseAddress - (char *)mi.AllocationBase;
-- space = size / 5;
-- if (space > 1024*1024) space = 1024*1024;
-- STACK_LEVEL_MAX = (size - space) / sizeof(VALUE);
-- }
-- }
--#endif
-+ set_stack_limit();
- }
-
- /*
diff --git a/lang/ruby18/files/patch-io.c b/lang/ruby18/files/patch-io.c
deleted file mode 100644
index 9c663d3027c3..000000000000
--- a/lang/ruby18/files/patch-io.c
+++ /dev/null
@@ -1,22 +0,0 @@
---- io.c.orig 2008-06-08 22:20:37.000000000 +0400
-+++ io.c 2009-02-12 01:10:27.000000000 +0300
-@@ -4970,8 +4970,9 @@
- #if !defined(MSDOS) && !defined(__human68k__)
- static int
- io_cntl(fd, cmd, narg, io_p)
-- int fd, cmd, io_p;
-+ int fd, io_p;
- long narg;
-+ unsigned long cmd;
- {
- int retval;
-
-@@ -5001,7 +5002,7 @@
- int io_p;
- {
- #if !defined(MSDOS) && !defined(__human68k__)
-- int cmd = NUM2ULONG(req);
-+ unsigned long cmd = NUM2ULONG(req);
- rb_io_t *fptr;
- long len = 0;
- long narg = 0;
diff --git a/lang/ruby18/files/patch-lib_uri_generic.rb b/lang/ruby18/files/patch-lib_uri_generic.rb
deleted file mode 100644
index 09efb83d9029..000000000000
--- a/lang/ruby18/files/patch-lib_uri_generic.rb
+++ /dev/null
@@ -1,19 +0,0 @@
---- lib/uri/generic.rb.orig 2009-06-18 16:10:22.000000000 +0400
-+++ lib/uri/generic.rb 2009-06-18 16:10:51.000000000 +0400
-@@ -1027,7 +1027,15 @@
- end
- end
-
-- str << path_query
-+ path = path_query
-+
-+ #
-+ # Add URI delimiter if the path misses it (like as in FTP)
-+ #
-+ if not path.empty? and not str.empty? and path[0, 1] != '/'
-+ path = '/' + path
-+ end
-+ str << path
- end
-
- if @fragment
diff --git a/lang/ruby18/files/patch-main.c b/lang/ruby18/files/patch-main.c
deleted file mode 100644
index 2fe3acb6c778..000000000000
--- a/lang/ruby18/files/patch-main.c
+++ /dev/null
@@ -1,86 +0,0 @@
---- main.c.orig 2007-02-13 02:01:19.000000000 +0300
-+++ main.c 2009-09-28 15:55:36.000000000 +0400
-@@ -29,10 +29,21 @@
- static void objcdummyfunction( void ) { objc_msgSend(); }
- #endif
-
-+#if defined(__FreeBSD__) && defined(_THREAD_SAFE)
-+static int argc;
-+static char **argv;
-+static char **envp;
-+#endif
-+
-+#if defined(__FreeBSD__) && defined(_THREAD_SAFE)
-+void *
-+main_entry(void *arg)
-+#else
- int
- main(argc, argv, envp)
- int argc;
- char **argv, **envp;
-+#endif
- {
- #ifdef _WIN32
- NtInitialize(&argc, &argv);
-@@ -47,5 +58,61 @@
- ruby_options(argc, argv);
- ruby_run();
- }
-+#if defined(__FreeBSD__) && defined(_THREAD_SAFE)
-+ return (NULL);
-+#else
- return 0;
-+#endif
- }
-+
-+#if defined(__FreeBSD__) && defined(_THREAD_SAFE)
-+#include <sys/types.h>
-+#include <sys/time.h>
-+#include <sys/resource.h>
-+int
-+main(main_argc, main_argv, main_envp)
-+ int main_argc;
-+ char **main_argv, **main_envp;
-+{
-+ struct rlimit rl;
-+ pthread_attr_t attr;
-+ pthread_t tid;
-+ size_t stacksize;
-+ int error;
-+
-+ argc = main_argc;
-+ argv = main_argv;
-+ envp = main_envp;
-+ /* Get the system imposed limit. */
-+ error = getrlimit(RLIMIT_STACK, &rl);
-+ if (error != 0) {
-+ fprintf(stderr, "cannot obtain resource limit\n");
-+ exit(1);
-+ }
-+ stacksize = rl.rlim_cur * 3 / 4; /* Set initial size to 3/4 of limit */
-+ error = pthread_attr_init(&attr);
-+ if (error != 0) {
-+ fprintf(stderr, "cannot initialize thread attributes\n");
-+ exit(1);
-+ }
-+ while (stacksize > 0) {
-+ error = pthread_attr_setstacksize(&attr, stacksize);
-+ if (error != 0)
-+ goto next;
-+ error = pthread_create(&tid, &attr, &main_entry, NULL);
-+ if (error == 0)
-+ break;
-+ next:
-+ stacksize = stacksize >> 1;
-+ }
-+ if (stacksize != 0) { /* Success. */
-+ pthread_detach(tid);
-+ pthread_exit(NULL);
-+ return (0);
-+ }
-+ else {
-+ fprintf(stderr, "Cannot create main thread\n");
-+ return (1);
-+ }
-+}
-+#endif
diff --git a/lang/ruby18/files/patch-mkconfig.rb b/lang/ruby18/files/patch-mkconfig.rb
deleted file mode 100644
index 0d43b9999bf8..000000000000
--- a/lang/ruby18/files/patch-mkconfig.rb
+++ /dev/null
@@ -1,11 +0,0 @@
---- mkconfig.rb.orig 2010-09-06 00:14:02.000000000 +0200
-+++ mkconfig.rb 2010-09-06 00:13:56.000000000 +0200
-@@ -88,7 +88,7 @@
- if /^prefix$/ =~ name
- val = "(TOPDIR || DESTDIR + #{val})"
- end
-- v = " CONFIG[\"#{name}\"] #{vars[name] ? '<< "\n"' : '='} #{val}\n"
-+ v = " CONFIG[\"#{name}\"] = #{val}\n"
- vars[name] = true
- if fast[name]
- v_fast << v
diff --git a/lang/ruby18/files/patch-mkmf.rb b/lang/ruby18/files/patch-mkmf.rb
deleted file mode 100644
index abf56b6a71dd..000000000000
--- a/lang/ruby18/files/patch-mkmf.rb
+++ /dev/null
@@ -1,27 +0,0 @@
---- lib/mkmf.rb.orig 2009-02-12 01:18:14.000000000 +0300
-+++ lib/mkmf.rb 2009-02-12 01:19:47.000000000 +0300
-@@ -132,9 +132,13 @@
-
- topdir = File.dirname(libdir = File.dirname(__FILE__))
- extdir = File.expand_path("ext", topdir)
-+setuparchdir = topdir + \
-+ "/#{Config::CONFIG["ruby_version"]}/#{Config::CONFIG["arch"]}"
- $extmk = File.expand_path($0)[0, extdir.size+1] == extdir+"/"
--if not $extmk and File.exist?(($hdrdir = Config::CONFIG["archdir"]) + "/ruby.h")
-- $topdir = $hdrdir
-+if not $extmk and File.exist?(setuparchdir + "/ruby.h")
-+ $hdrdir = $topdir = setuparchdir
-+elsif not $extmk and File.exist?(Config::CONFIG["archdir"] + "/ruby.h")
-+ $topdir = $hdrdir = Config::CONFIG["archdir"]
- elsif File.exist?(($hdrdir = ($top_srcdir ||= topdir)) + "/ruby.h") and
- File.exist?(($topdir ||= Config::CONFIG["topdir"]) + "/config.h")
- else
-@@ -1554,7 +1558,7 @@
-
- mfile.print <<-SITEINSTALL
-
--site-install: site-install-so site-install-rb
-+site-install: site-install-so site-install-rb install
- site-install-so: install-so
- site-install-rb: install-rb
-
diff --git a/lang/ruby18/files/patch-openssl_missing.c b/lang/ruby18/files/patch-openssl_missing.c
deleted file mode 100644
index 5637d7f01c3f..000000000000
--- a/lang/ruby18/files/patch-openssl_missing.c
+++ /dev/null
@@ -1,30 +0,0 @@
---- ./ext/openssl/openssl_missing.c.orig 2008-05-19 03:00:52.000000000 +0000
-+++ ./ext/openssl/openssl_missing.c 2012-01-17 05:09:13.816807984 +0000
-@@ -22,15 +22,16 @@
- #include "openssl_missing.h"
-
- #if !defined(HAVE_HMAC_CTX_COPY)
--void
-+int
- HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
- {
-- if (!out || !in) return;
-+ if (!out || !in) return 0;
- memcpy(out, in, sizeof(HMAC_CTX));
-
- EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx);
- EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx);
- EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx);
-+ return 0;
- }
- #endif /* HAVE_HMAC_CTX_COPY */
- #endif /* NO_HMAC */
-@@ -117,7 +118,7 @@
- * tested on 0.9.7d.
- */
- int
--EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in)
-+EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
- {
- memcpy(out, in, sizeof(EVP_CIPHER_CTX));
-
diff --git a/lang/ruby18/files/patch-openssl_missing.h b/lang/ruby18/files/patch-openssl_missing.h
deleted file mode 100644
index c18cbab16b55..000000000000
--- a/lang/ruby18/files/patch-openssl_missing.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- ext/openssl/openssl_missing.h.orig 2008-08-04 06:44:17.000000000 +0200
-+++ ext/openssl/openssl_missing.h 2010-04-06 14:00:55.000000000 +0200
-@@ -65,7 +65,7 @@
- #endif
-
- #if !defined(HAVE_HMAC_CTX_COPY)
--void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
-+int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
- #endif
-
- #if !defined(HAVE_HMAC_CTX_CLEANUP)
-@@ -89,7 +89,7 @@
- #endif
-
- #if !defined(HAVE_EVP_CIPHER_CTX_COPY)
--int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
-+int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
- #endif
-
- #if !defined(HAVE_EVP_DIGESTINIT_EX)