Re: [AD] Improvements for OpenBSD

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Here is a fixed version against a clean 4.2.0

Regards,

Hans


Evert Glebbeek wrote:
On Wednesday 08 March 2006 20:39, Catatonic Porpoise wrote:
Ping. I notice this is still not in the allegro-4.2 svn branch...

Cheers, looks like I marked it done before doing it. Thanks for catching that.
However, the patch doesn't apply for me:

eglebbk@xxxxxxxxxx>patch -p1 < ../openbsd_fixes.diff patching file configure patch: **** malformed patch at line 13: diff -ru allegro-4.2.0/configure.in allegro-4.2.0-modified/configure.in
eglebbk@xxxxxxxxxx>

If I remove the diff -ru ... lines I get eglebbk@xxxxxxxxxx>patch -p1 < ../openbsd_fixes.diff patching file configure patch: **** malformed patch at line 12: --- allegro-4.2.0/configure.in Mon Feb 6 16:12:40 2006
eglebbk@xxxxxxxxxx>

Can you try to regenerate the patch and send it again? Otherwise, I can apply the patch manually, but it'll be saturday before I can hope to do that.

Evert


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
--- allegro-4.2.0/tools/grabber.c.mprotect	2005-09-04 18:00:18.000000000 +0200
+++ allegro-4.2.0/tools/grabber.c	2006-03-08 23:13:39.000000000 +0100
@@ -3121,6 +3121,7 @@
       case OSTYPE_SUNOS:      s = "SunOS/Solaris";              break;
       case OSTYPE_FREEBSD:    s = "FreeBSD";                    break;
       case OSTYPE_NETBSD:     s = "NetBSD";                     break;
+      case OSTYPE_OPENBSD:    s = "OpenBSD";                    break;
       case OSTYPE_IRIX:       s = "IRIX";                       break;
       case OSTYPE_DARWIN:     s = "Darwin";                     break;
       case OSTYPE_QNX:        s = "QNX";                        break;
--- allegro-4.2.0/include/allegro/platform/alunixac.hin.mprotect	2005-10-30 21:23:33.000000000 +0100
+++ allegro-4.2.0/include/allegro/platform/alunixac.hin	2006-03-08 23:13:39.000000000 +0100
@@ -169,6 +169,9 @@
 /* Define to 1 if you have the `mmap' function. */
 #undef HAVE_MMAP
 
+/* Define to 1 if you have the `mprotect' function. */
+#undef HAVE_MPROTECT
+
 /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
 #undef HAVE_NDIR_H
 
--- allegro-4.2.0/include/allegro/system.h.mprotect	2005-03-15 21:32:43.000000000 +0100
+++ allegro-4.2.0/include/allegro/system.h	2006-03-08 23:13:39.000000000 +0100
@@ -53,6 +53,7 @@
 #define OSTYPE_SUNOS       AL_ID('S','U','N',' ')
 #define OSTYPE_FREEBSD     AL_ID('F','B','S','D')
 #define OSTYPE_NETBSD      AL_ID('N','B','S','D')
+#define OSTYPE_OPENBSD     AL_ID('O','B','S','D')
 #define OSTYPE_IRIX        AL_ID('I','R','I','X')
 #define OSTYPE_DARWIN      AL_ID('D','A','R','W')
 #define OSTYPE_QNX         AL_ID('Q','N','X',' ')
--- allegro-4.2.0/configure.mprotect	2005-11-06 10:54:00.000000000 +0100
+++ allegro-4.2.0/configure	2006-03-08 23:13:39.000000000 +0100
@@ -11225,7 +11225,7 @@
 
 
 
-for ac_func in mmap memcmp mkstemp stricmp strlwr strupr vprintf
+for ac_func in mmap mprotect memcmp mkstemp stricmp strlwr strupr vprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
--- allegro-4.2.0/configure.in.mprotect	2005-08-07 23:50:49.000000000 +0200
+++ allegro-4.2.0/configure.in	2006-03-08 23:13:39.000000000 +0100
@@ -713,7 +713,7 @@
 AC_STRUCT_TM
 AC_TYPE_SIGNAL
 
-AC_CHECK_FUNCS(mmap memcmp mkstemp stricmp strlwr strupr vprintf)
+AC_CHECK_FUNCS(mmap mprotect memcmp mkstemp stricmp strlwr strupr vprintf)
 
 dnl Tweak header files for library build
 CFLAGS="$CFLAGS -DALLEGRO_LIB_BUILD"
--- allegro-4.2.0/src/unix/usystem.c.mprotect	2005-09-04 18:00:17.000000000 +0200
+++ allegro-4.2.0/src/unix/usystem.c	2006-03-08 23:13:39.000000000 +0100
@@ -196,6 +196,9 @@
       else if (!strcmp(utsn.sysname, "NetBSD")) {
 	 os_type = OSTYPE_NETBSD;
       }
+      else if (!strcmp(utsn.sysname, "OpenBSD")) {
+	 os_type = OSTYPE_OPENBSD;
+      }
       else if ((!strcmp(utsn.sysname, "IRIX"))
 	       || (!strcmp(utsn.sysname, "IRIX64"))) {
 	 os_type = OSTYPE_IRIX;
--- allegro-4.2.0/src/unix/uesd.c.mprotect	2005-03-12 08:54:27.000000000 +0100
+++ allegro-4.2.0/src/unix/uesd.c	2006-03-08 23:13:39.000000000 +0100
@@ -27,6 +27,7 @@
 
 #include <sys/time.h>
 #include <sys/types.h>
+#include <string.h> /* FD_ZERO() needs this */
 #include <unistd.h>
 #include <esd.h>
 
--- allegro-4.2.0/src/i386/istretch.c.mprotect	2005-03-15 19:02:22.000000000 +0100
+++ allegro-4.2.0/src/i386/istretch.c	2006-03-08 23:14:52.000000000 +0100
@@ -30,6 +30,10 @@
    #include "winalleg.h"   /* For VirtualProtect */
 #endif     /* ifdef ALLEGRO_WINDOWS */
 
+#ifdef HAVE_MPROTECT
+   #include <sys/types.h>
+   #include <sys/mman.h>
+#endif
 
 
 /* helper macro for generating stretchers in each color depth */
@@ -435,7 +439,9 @@
  #ifdef ALLEGRO_WINDOWS
    /* Play nice with Windows executable memory protection */
    VirtualProtect(_scratch_mem, _scratch_mem_size, PAGE_EXECUTE_READWRITE, &old_protect);
- #endif     /* ifdef ALLEGRO_WINDOWS */
+ #elif defined(HAVE_MPROTECT)
+   mprotect(_scratch_mem, _scratch_mem_size, PROT_EXEC|PROT_READ|PROT_WRITE);
+ #endif
 
    /* call the stretcher */
    _do_stretch(source, dest, _scratch_mem, sx>>16, sy, syd, 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/