From cc7af7efa8877e09fd1be35d4a922da67c58c810 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 3 Nov 2008 23:46:36 +0000 Subject: [PATCH] Added patch for M4 1.4.12. --- sys-devel/m4/m4-1.4.12.diff | 109 ++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sys-devel/m4/m4-1.4.12.diff diff --git a/sys-devel/m4/m4-1.4.12.diff b/sys-devel/m4/m4-1.4.12.diff new file mode 100644 index 000000000..256a980df --- /dev/null +++ b/sys-devel/m4/m4-1.4.12.diff @@ -0,0 +1,109 @@ +diff -ur m4-1.4.12.orig/lib/binary-io.h m4-1.4.12/lib/binary-io.h +--- m4-1.4.12.orig/lib/binary-io.h 2008-10-30 22:05:21.000000000 +0000 ++++ m4-1.4.12/lib/binary-io.h 2008-11-03 15:17:10.000000000 +0000 +@@ -30,8 +30,9 @@ + # define O_BINARY _O_BINARY + # define O_TEXT _O_TEXT + #endif +-#ifdef __BEOS__ +- /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ ++#if defined __BEOS__ || defined __HAIKU__ ++ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. ++ Same for Haiku R1. */ + # undef O_BINARY + # undef O_TEXT + #endif +diff -ur m4-1.4.12.orig/lib/c-stack.c m4-1.4.12/lib/c-stack.c +--- m4-1.4.12.orig/lib/c-stack.c 2008-10-30 22:05:21.000000000 +0000 ++++ m4-1.4.12/lib/c-stack.c 2008-11-03 15:17:10.000000000 +0000 +@@ -317,7 +317,11 @@ + act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO; + act.sa_sigaction = segv_handler; + # else +- act.sa_flags = SA_NODEFER | SA_RESETHAND; ++# ifdef SA_ONSTACK ++ act.sa_flags = SA_NODEFER | SA_RESETHAND | SA_ONSTACK; ++# else ++ act.sa_flags = SA_NODEFER | SA_RESETHAND; ++# endif + act.sa_handler = die; + # endif + +diff -ur m4-1.4.12.orig/lib/config.charset m4-1.4.12/lib/config.charset +--- m4-1.4.12.orig/lib/config.charset 2008-10-30 22:05:21.000000000 +0000 ++++ m4-1.4.12/lib/config.charset 2008-11-03 15:17:10.000000000 +0000 +@@ -478,8 +478,8 @@ + # space nevertheless. + echo "* UTF-8" + ;; +- beos*) +- # BeOS has a single locale, and it has UTF-8 encoding. ++ beos*|haiku*) ++ # BeOS has a single locale, and it has UTF-8 encoding. Same for Haiku. + echo "* UTF-8" + ;; + msdosdjgpp*) +diff -ur m4-1.4.12.orig/lib/fcntl.in.h m4-1.4.12/lib/fcntl.in.h +--- m4-1.4.12.orig/lib/fcntl.in.h 2008-10-30 22:05:21.000000000 +0000 ++++ m4-1.4.12/lib/fcntl.in.h 2008-11-03 15:17:10.000000000 +0000 +@@ -125,8 +125,8 @@ + # define O_TEXT _O_TEXT + #endif + +-#ifdef __BEOS__ +- /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ ++#if defined __BEOS__ || defined __HAIKU__ ++ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. Same for Haiku. */ + # undef O_BINARY + # undef O_TEXT + #endif +diff -ur m4-1.4.12.orig/lib/freadahead.c m4-1.4.12/lib/freadahead.c +--- m4-1.4.12.orig/lib/freadahead.c 2008-10-30 22:05:22.000000000 +0000 ++++ m4-1.4.12/lib/freadahead.c 2008-11-03 15:17:10.000000000 +0000 +@@ -25,7 +25,8 @@ + size_t + freadahead (FILE *fp) + { +-#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */ ++#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 || defined __HAIKU__ ++ /* GNU libc, BeOS, Linux libc5, Haiku */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) +diff -ur m4-1.4.12.orig/lib/regex_internal.h m4-1.4.12/lib/regex_internal.h +--- m4-1.4.12.orig/lib/regex_internal.h 2008-10-30 22:05:23.000000000 +0000 ++++ m4-1.4.12/lib/regex_internal.h 2008-11-03 15:17:58.000000000 +0000 +@@ -84,9 +84,11 @@ + # define SIZE_MAX ((size_t) -1) + #endif + ++#ifndef __HAIKU__ + #if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC + # define RE_ENABLE_I18N + #endif ++#endif + + #if __GNUC__ >= 3 + # define BE(expr, val) __builtin_expect (expr, val) +diff -ur m4-1.4.12.orig/src/m4.c m4-1.4.12/src/m4.c +--- m4-1.4.12.orig/src/m4.c 2008-10-30 22:05:27.000000000 +0000 ++++ m4-1.4.12/src/m4.c 2008-11-03 15:17:10.000000000 +0000 +@@ -391,7 +391,7 @@ + signal_message[SIGABRT] = xstrdup (strsignal (SIGABRT)); + signal_message[SIGILL] = xstrdup (strsignal (SIGILL)); + signal_message[SIGFPE] = xstrdup (strsignal (SIGFPE)); +- if (SIGBUS != SIGILL) ++ if (SIGBUS != SIGILL && SIGBUS != SIGSEGV) + signal_message[SIGBUS] = xstrdup (strsignal (SIGBUS)); + sigemptyset (&act.sa_mask); + /* One-shot - if we fault while handling a fault, we want to revert +@@ -401,7 +401,8 @@ + sigaction (SIGABRT, &act, NULL); + sigaction (SIGILL, &act, NULL); + sigaction (SIGFPE, &act, NULL); +- sigaction (SIGBUS, &act, NULL); ++ if (SIGBUS != SIGSEGV) ++ sigaction (SIGBUS, &act, NULL); + + #ifdef DEBUG_STKOVF + /* Make it easier to test our fault handlers. Exporting M4_CRASH=0