Re: [AD] Patch to allow Allegro 4.3.10plus to build on Haiku

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


On Sat, Oct 18, 2008 at 12:59 AM, Milan Mimica <milan.mimica@xxxxxxxxxx> wrote:
> scott mc wrote:
>>
>> I'm not sure how/where to add the "make obj/beos/asmdef.inc into"
>> command into the makefile.be.
>
> I think makefile.def should trigger this.

I'm new to Allegro, and have limited experience with makefiles, so I'm
not quite sure how to handle this, I know it works from a command line
if executed right after fix.sh haiku is run and before the 'make' is
run for building the rest.  If someone who knows more about makefiles
and such can direct me on where the "make obj/beos/asmdef.inc" can be
inserted to make for a cleaner patch I'll gladly add it and try it
out, and post a patch to fix it as well.

>
>> How do you add an empty dir into a patch file?  Or would you just do that
>> in svn?
>
> We'll add it to SVN.
>
>

Ok, I just ran svn up and this attached patch is against r11118,
should be ready to checkin to svn, along with making that extra
directory in svn.  We'll continue to work on the obj/beos/asmdef.inc,
and also getting the tests and demos to work right.  Let me know
if/when it gets committed so I can update my build notes.
-scottmc
Index: src/beos/bmousdrv.c
===================================================================
--- src/beos/bmousdrv.c	(revision 11118)
+++ src/beos/bmousdrv.c	(working copy)
@@ -18,9 +18,9 @@
 #include "allegro.h"
 #include "allegro/internal/aintern.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif              
 
 
 
Index: src/beos/bkeydrv.c
===================================================================
--- src/beos/bkeydrv.c	(revision 11118)
+++ src/beos/bkeydrv.c	(working copy)
@@ -18,9 +18,9 @@
 #include "allegro.h"
 #include "allegro/internal/aintern.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif             
 
 _DRIVER_INFO _keyboard_driver_list[] =
 {
Index: src/beos/bwscreen.cpp
===================================================================
--- src/beos/bwscreen.cpp	(revision 11118)
+++ src/beos/bwscreen.cpp	(working copy)
@@ -19,7 +19,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
@@ -474,7 +474,7 @@
 /* be_gfx_bwindowscreen_read_write_bank:
  *  Returns new line and synchronizes framebuffer if needed.
  */
-extern "C" unsigned long be_gfx_bwindowscreen_read_write_bank(BITMAP *bmp, int line)
+extern "C" uintptr_t be_gfx_bwindowscreen_read_write_bank(BITMAP *bmp, int line)
 {
    if (!(bmp->id & BMP_ID_LOCKED)) {
       _be_sync_func();
@@ -490,7 +490,7 @@
  */
 extern "C" void be_gfx_bwindowscreen_unwrite_bank(BITMAP *bmp)
 {
-   if (bmp->id & BMP_AUTOLOCK) {
+   if (bmp->id & BMP_ID_AUTOLOCK) {
       bmp->id &= ~(BMP_ID_LOCKED | BMP_ID_AUTOLOCK);
    }
 }
Index: src/beos/baccel.cpp
===================================================================
--- src/beos/baccel.cpp	(revision 11118)
+++ src/beos/baccel.cpp	(working copy)
@@ -20,7 +20,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
Index: src/beos/bdwindow.cpp
===================================================================
--- src/beos/bdwindow.cpp	(revision 11118)
+++ src/beos/bdwindow.cpp	(working copy)
@@ -21,7 +21,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
@@ -260,8 +260,10 @@
 	             cmap[i] = BScreen().IndexForColor(((i >> 4) & 0xF0) | (i >> 8),  (i & 0xF0) | ((i >> 4) & 0xF),  (i & 0xF) | ((i & 0xF) << 4));
 	       }
 	    }
+#if 0
 	    TRACE(PREFIX_I "Color conversion mode set: %d->%d\n",
 		  (int)screen_depth, (int)display_depth);
+#endif
 	 }
 	 			       
 	 if (rects) {
Index: src/beos/bmousapi.cpp
===================================================================
--- src/beos/bmousapi.cpp	(revision 11118)
+++ src/beos/bmousapi.cpp	(working copy)
@@ -23,9 +23,9 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif              
 
 #define MOUSE_THREAD_NAME     "mouse driver"
 #define MOUSE_THREAD_PRIORITY 60
@@ -78,7 +78,9 @@
 
       if (mouse_thread_running == false) {
          release_sem(_be_mouse_view_attached);
+#if 0
          TRACE(PREFIX_I "mouse thread exited\n");
+#endif
 
          return 0;
       }
Index: src/beos/btimer.c
===================================================================
--- src/beos/btimer.c	(revision 11118)
+++ src/beos/btimer.c	(working copy)
@@ -19,7 +19,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
Index: src/beos/bkeyapi.cpp
===================================================================
--- src/beos/bkeyapi.cpp	(revision 11118)
+++ src/beos/bkeyapi.cpp	(working copy)
@@ -22,9 +22,9 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif           
 
 #define KEY_ID_PC101 0 // the docs say it should be 0x83ab, but they lie
 
@@ -260,7 +260,9 @@
       key_info_old = key_info_new;
    }
 
+#if 0
  TRACE(PREFIX_I "keyboard thread exited\n");
+#endif
 
  return 0;
 }
Index: src/beos/bmouse.c
===================================================================
--- src/beos/bmouse.c	(revision 11118)
+++ src/beos/bmouse.c	(working copy)
@@ -19,9 +19,9 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif           
 
 
 
Index: src/beos/bkey.c
===================================================================
--- src/beos/bkey.c	(revision 11118)
+++ src/beos/bkey.c	(working copy)
@@ -19,9 +19,9 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif 
+#endif
 
 
 
Index: src/beos/bsysdrv.c
===================================================================
--- src/beos/bsysdrv.c	(revision 11118)
+++ src/beos/bsysdrv.c	(working copy)
@@ -18,9 +18,9 @@
 #include "allegro.h"
 #include "allegro/internal/aintern.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif 
+#endif
 
 _DRIVER_INFO _system_driver_list[] =
 {
Index: src/beos/bmididrv.c
===================================================================
--- src/beos/bmididrv.c	(revision 11118)
+++ src/beos/bmididrv.c	(working copy)
@@ -18,9 +18,9 @@
 #include "allegro.h"
 #include "allegro/internal/aintern.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif             
 
 BEGIN_MIDI_DRIVER_LIST
 MIDI_DRIVER_BEOS
Index: src/beos/bsnddrv.c
===================================================================
--- src/beos/bsnddrv.c	(revision 11118)
+++ src/beos/bsnddrv.c	(working copy)
@@ -19,9 +19,9 @@
 #include "allegro/internal/aintern.h"
 
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif           
 
 BEGIN_DIGI_DRIVER_LIST
 DIGI_DRIVER_BEOS
Index: src/beos/bgfxdrv.c
===================================================================
--- src/beos/bgfxdrv.c	(revision 11118)
+++ src/beos/bgfxdrv.c	(working copy)
@@ -18,9 +18,9 @@
 #include "allegro.h"
 #include "allegro/internal/aintern.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif           
 
 BEGIN_GFX_DRIVER_LIST
 GFX_DRIVER_BEOS 
Index: src/beos/bjoy.c
===================================================================
--- src/beos/bjoy.c	(revision 11118)
+++ src/beos/bjoy.c	(working copy)
@@ -19,7 +19,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
Index: src/beos/bwindow.cpp
===================================================================
--- src/beos/bwindow.cpp	(revision 11118)
+++ src/beos/bwindow.cpp	(working copy)
@@ -19,7 +19,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
@@ -117,7 +117,7 @@
 /* _be_gfx_bwindow_read_write_bank:
  *  Returns new line and marks it as dirty.
  */
-extern "C" unsigned long _be_gfx_bwindow_read_write_bank(BITMAP *bmp, int line)
+extern "C" uintptr_t _be_gfx_bwindow_read_write_bank(BITMAP *bmp, int line)
 {
    if (!bmp->id & BMP_ID_LOCKED) {
       bmp->id |= (BMP_ID_LOCKED | BMP_ID_AUTOLOCK);
Index: src/beos/bsysapi.cpp
===================================================================
--- src/beos/bsysapi.cpp	(revision 11118)
+++ src/beos/bsysapi.cpp	(working copy)
@@ -27,9 +27,9 @@
 #include <sys/utsname.h>
 #endif
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif              
+#endif            
 
 #define SYS_THREAD_PRIORITY B_NORMAL_PRIORITY
 #define SYS_THREAD_NAME     "system driver"
@@ -144,7 +144,9 @@
 
    _be_allegro_app->Run();
 
+#if 0
    TRACE(PREFIX_I "system thread exited\n");
+#endif
 
    return 0;
 }
@@ -201,8 +203,6 @@
    uname(&os_name);
    os_type = OSTYPE_BEOS;
    os_multitasking = TRUE;
-   os_version = atoi(strtok(os_name.release, "."));
-   os_revision = atoi(strtok(NULL, "."));
 
    chdir(app_path);
 
Index: src/beos/bdispsw.cpp
===================================================================
--- src/beos/bdispsw.cpp	(revision 11118)
+++ src/beos/bdispsw.cpp	(working copy)
@@ -19,7 +19,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
Index: src/beos/btimedrv.c
===================================================================
--- src/beos/btimedrv.c	(revision 11118)
+++ src/beos/btimedrv.c	(working copy)
@@ -18,9 +18,9 @@
 #include "allegro.h"
 #include "allegro/internal/aintern.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif         
 
 _DRIVER_INFO _timer_driver_list[] = {
    {TIMER_BEOS, &timer_beos, TRUE},
Index: src/beos/bmidiapi.cpp
===================================================================
--- src/beos/bmidiapi.cpp	(revision 11118)
+++ src/beos/bmidiapi.cpp	(working copy)
@@ -19,9 +19,9 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif           
 
 
 BMidiSynth *_be_midisynth = NULL;
Index: src/beos/bjoydrv.c
===================================================================
--- src/beos/bjoydrv.c	(revision 11118)
+++ src/beos/bjoydrv.c	(working copy)
@@ -18,9 +18,9 @@
 #include "allegro.h"
 #include "allegro/internal/aintern.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif              
 
 BEGIN_JOYSTICK_DRIVER_LIST
 JOYSTICK_DRIVER_BEOS
Index: src/beos/bsndapi.cpp
===================================================================
--- src/beos/bsndapi.cpp	(revision 11118)
+++ src/beos/bsndapi.cpp	(working copy)
@@ -20,7 +20,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
Index: src/beos/bgfxapi.cpp
===================================================================
--- src/beos/bgfxapi.cpp	(revision 11118)
+++ src/beos/bgfxapi.cpp	(working copy)
@@ -19,7 +19,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
Index: src/beos/boverlay.cpp
===================================================================
--- src/beos/boverlay.cpp	(revision 11118)
+++ src/beos/boverlay.cpp	(working copy)
@@ -19,7 +19,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
Index: src/beos/bmidi.c
===================================================================
--- src/beos/bmidi.c	(revision 11118)
+++ src/beos/bmidi.c	(working copy)
@@ -19,9 +19,9 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif     
 
 MIDI_DRIVER midi_beos =
 {
Index: src/beos/bsystem.c
===================================================================
--- src/beos/bsystem.c	(revision 11118)
+++ src/beos/bsystem.c	(working copy)
@@ -19,12 +19,10 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif 
+#endif
 
-
-
 SYSTEM_DRIVER system_beos = {
    SYSTEM_BEOS,
    empty_string,
Index: src/beos/bsnd.c
===================================================================
--- src/beos/bsnd.c	(revision 11118)
+++ src/beos/bsnd.c	(working copy)
@@ -19,9 +19,9 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif             
 
 DIGI_DRIVER digi_beos =
 {
Index: src/beos/bgfx.c
===================================================================
--- src/beos/bgfx.c	(revision 11118)
+++ src/beos/bgfx.c	(working copy)
@@ -19,9 +19,9 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif 
+#endif
 
 
 
Index: src/beos/btimeapi.cpp
===================================================================
--- src/beos/btimeapi.cpp	(revision 11118)
+++ src/beos/btimeapi.cpp	(working copy)
@@ -19,7 +19,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
 #endif
 
Index: src/beos/bjoyapi.cpp
===================================================================
--- src/beos/bjoyapi.cpp	(revision 11118)
+++ src/beos/bjoyapi.cpp	(working copy)
@@ -19,9 +19,9 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintbeos.h"
 
-#ifndef ALLEGRO_BEOS
+#if !defined ALLEGRO_BEOS && !defined ALLEGRO_HAIKU
 #error something is wrong with the makefile
-#endif                
+#endif            
 
 static BJoystick *be_joy = NULL;
 static int32 num_devices, num_axes, num_hats, num_buttons;
@@ -64,12 +64,12 @@
    device_config = get_config_string("joystick", "joystick_device", "");
    
    /* Let's try to open selected device */
-   if ((device_config[0] == '\0') || (be_joy->Open(device_config) < 0)) {
+   if ((device_config[0] == '\0') || (be_joy->Open(device_config, true) < 0)) {
       /* ok, let's try to open first available device */
       if (be_joy->GetDeviceName(0, device_name) != B_OK) {
          goto cleanup;
       }
-      if (be_joy->Open(device_name) == B_ERROR) {
+      if (be_joy->Open(device_name, true) == B_ERROR) {
          goto cleanup;
       }
    }
Index: src/i386/asmdefs.inc
===================================================================
--- src/i386/asmdefs.inc	(revision 11118)
+++ src/i386/asmdefs.inc	(working copy)
@@ -31,6 +31,8 @@
    #include "obj/msvc/asmdef.inc"
 #elif defined ALLEGRO_WATCOM
    #include "obj/watcom/asmdef.inc"
+#elif defined ALLEGRO_HAIKU
+   #include "obj/beos/asmdef.inc"
 #elif defined ALLEGRO_BEOS
    #include "obj/beos/asmdef.inc"
 #elif defined ALLEGRO_QNX
Index: src/midi.c
===================================================================
--- src/midi.c	(revision 11118)
+++ src/midi.c	(working copy)
@@ -1122,7 +1122,7 @@
       running_status = 0;
 
       while (p < end) {                         /* work through data stream */
-#ifdef ALLEGRO_BEOS
+#if defined ALLEGRO_BEOS || defined ALLEGRO_HAIKU
          /* Is there a bug in this routine, or in gcc under BeOS/x86? --PW */
          { int i; for (i=1; i; i--); }
 #endif
Index: tools/grabber.c
===================================================================
--- tools/grabber.c	(revision 11118)
+++ tools/grabber.c	(working copy)
@@ -3132,6 +3132,7 @@
       case OSTYPE_QNX:        s = "QNX";                        break;
       case OSTYPE_UNIX:       s = "Unix";                       break;
       case OSTYPE_BEOS:       s = "BeOS";                       break;
+      case OSTYPE_HAIKU:      s = "Haiku";                      break;
       case OSTYPE_MACOS:      s = "MacOS";                      break;
       case OSTYPE_MACOSX:     s = "MacOS X";                    break;
       default:                s = "Unknown";                    break;
Index: tools/datedit.c
===================================================================
--- tools/datedit.c	(revision 11118)
+++ tools/datedit.c	(working copy)
@@ -121,6 +121,8 @@
       #include "obj/dmc/plugins.h"
    #elif defined ALLEGRO_BEOS
       #include "obj/beos/plugins.h"
+   #elif defined ALLEGRO_HAIKU
+ //     #include "obj/beos/plugins.h"
    #elif defined ALLEGRO_BCC32
       #include "obj/bcc32/plugins.h"
    #elif defined ALLEGRO_MPW
Index: tools/dat2c.c
===================================================================
--- tools/dat2c.c	(revision 11118)
+++ tools/dat2c.c	(working copy)
@@ -342,7 +342,7 @@
    }
 
    if (dat2c->lformat == lineformat_default)
-#if (defined ALLEGRO_UNIX || defined ALLEGRO_QNX || defined ALLEGRO_BEOS || defined ALLEGRO_MACOSX)
+#if (defined ALLEGRO_UNIX || defined ALLEGRO_QNX || defined ALLEGRO_BEOS || defined ALLEGRO_HAIKU || defined ALLEGRO_MACOSX)
       dat2c->lformat = lineformat_unix;
 #elif (defined ALLEGRO_WINDOWS || defined ALLEGRO_DOS)
       dat2c->lformat = lineformat_dos;
Index: addons/loadpng/fix.sh
===================================================================
--- addons/loadpng/fix.sh	(revision 11118)
+++ addons/loadpng/fix.sh	(working copy)
@@ -8,7 +8,7 @@
    echo
    echo "Usage: $0 <platform> [--quick|--dtou|--utod]"
    echo
-   echo "Where platform is one of: djgpp, mingw32, unix, macosx, macosx-universal"
+   echo "Where platform is one of: djgpp, mingw32, unix, macosx, macosx-universal, beos, haiku"
    echo "The --quick parameter turns off text file conversion, --dtou converts from"
    echo "DOS/Win32 format to Unix, --utod converts from Unix to DOS/Win32 format."
    echo "If no parameter is specified --quick is assumed."
@@ -88,7 +88,9 @@
 fi
 
 case "$1" in
+   "beos"    ) proc_fix "BeOS"              "Makefile.be";;
    "djgpp"   ) proc_fix "DOS (djgpp)"       "Makefile.dj";;
+   "haiku"   ) proc_fix "Haiku"             "Makefile.be";;
    "mingw"   ) proc_fix "Windows (MinGW)"   "Makefile.mgw";;
    "mingw32" ) proc_fix "Windows (MinGW)"   "Makefile.mgw";;
    "unix"    ) proc_fix "Unix"              "Makefile.unx";;
Index: addons/jpgalleg/fix.sh
===================================================================
--- addons/jpgalleg/fix.sh	(revision 11118)
+++ addons/jpgalleg/fix.sh	(working copy)
@@ -85,6 +85,7 @@
    "mingw"   ) proc_fix "MinGW32" "makefile.mgw";;
    "msvc"    ) proc_fix "MSVC" "makefile.vc";;
    "beos"    ) proc_fix "BeOS" "makefile.be";;
+   "haiku"   ) proc_fix "Haiku" "makefile.be";;
    "unix"    ) proc_fix "Unix" "makefile.uni";;
    "macosx"  ) proc_fix "MacOS X" "makefile.osx";;
    "macosx-universal" ) proc_fix_osx_ub ;;
Index: addons/allegrogl/fix.sh
===================================================================
--- addons/allegrogl/fix.sh	(revision 11118)
+++ addons/allegrogl/fix.sh	(working copy)
@@ -27,7 +27,7 @@
       echo "  Usage: fix <platform> [--dtou|--utod|--quick]"
       echo ""
       echo "  <platform> is one of: djgpp, mingw32, unix, macosx,"
-	  echo "  macosx-universal"
+	  echo "  macosx-universal, beos, haiku"
       echo ""
       echo "  --dtou converts from DOS/Win32 format to Unix"
       echo "  --utod converts from Unix format to DOS/Win32"
@@ -81,6 +81,7 @@
 
 case "$1" in
 	djgpp	) proc_fix "DJGPP" "makefile.dj";;
+	haiku	) proc_fix "Haiku" "makefile.gen";;
 	mingw	) proc_fix "Mingw32" "makefile.mgw";;
 	mingw32	) proc_fix "Mingw32" "makefile.mgw";;
 	# used only by allegro's zipup.sh in packaging process
Index: addons/logg/fix.sh
===================================================================
--- addons/logg/fix.sh	(revision 11118)
+++ addons/logg/fix.sh	(working copy)
@@ -8,7 +8,8 @@
    echo
    echo "Usage: $0 <platform> [--quick|--dtou|--utod]"
    echo
-   echo "Where platform is one of: mingw32, unix, macosx, macosx-universal"
+   echo "Where platform is one of: mingw32, unix, macosx, macosx-universal,"
+	  echo "  beos, haiku"
    echo "The --quick parameter turns off text file conversion, --dtou converts from"
    echo "DOS/Win32 format to Unix, --utod converts from Unix to DOS/Win32 format."
    echo "If no parameter is specified --quick is assumed."
@@ -80,6 +81,8 @@
 fi
 
 case "$1" in
+   "beos"    ) proc_fix "BeOS"              "Makefile.be";;
+   "haiku"   ) proc_fix "Haiku"             "Makefile.be";;
    "mingw"   ) proc_fix "Windows (MinGW)"   "Makefile.migw";;
    "mingw32" ) proc_fix "Windows (MinGW)"   "Makefile.migw";;
    "unix"    ) proc_fix "Unix"              "Makefile.unix";;
Index: include/allegro/platform/albeos.h
===================================================================
--- include/allegro/platform/albeos.h	(revision 11118)
+++ include/allegro/platform/albeos.h	(working copy)
@@ -74,3 +74,7 @@
 #define JOYSTICK_DRIVER_BEOS                                            \
    {  JOYSTICK_BEOS,   &joystick_beos,  TRUE  },
 
+#if defined __HAIKU__
+#define TIMERDRV_UNIX_PTHREADS        AL_ID('P','T','H','R')
+#endif
+
Index: include/allegro/platform/alunixac.hin
===================================================================
--- include/allegro/platform/alunixac.hin	(revision 11118)
+++ include/allegro/platform/alunixac.hin	(working copy)
@@ -68,7 +68,7 @@
 #undef ALLEGRO_DARWIN
 
 /* Define if you have the pthread library. */
-#undef ALLEGRO_HAVE_LIBPTHREAD
+/* #undef ALLEGRO_HAVE_LIBPTHREAD */
 
 /* Define if constructor attribute is supported. */
 #undef ALLEGRO_USE_CONSTRUCTOR
@@ -159,7 +159,7 @@
 
 /* Define as the return type of signal handlers (`int' or `void'). */
 /* TODO: rename this */
-#undef RETSIGTYPE
+/* #undef RETSIGTYPE */
 
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
Index: include/allegro/platform/albecfg.h
===================================================================
--- include/allegro/platform/albecfg.h	(revision 11118)
+++ include/allegro/platform/albecfg.h	(working copy)
@@ -31,7 +31,13 @@
 #define ALLEGRO_HAVE_SYS_TIME_H 1
 
 /* describe this platform */
-#define ALLEGRO_PLATFORM_STR  "BeOS"
+#if defined __BEOS__ && !defined __HAIKU__
+  #define ALLEGRO_PLATFORM_STR  "BeOS"
+#endif
+#if defined __HAIKU__
+  #define ALLEGRO_PLATFORM_STR  "Haiku"
+  #define ALLEGRO_HAVE_LIBPTHREAD 1
+#endif
 #define ALLEGRO_LITTLE_ENDIAN
 #define ALLEGRO_CONSOLE_OK
 #define ALLEGRO_USE_CONSTRUCTOR
Index: include/allegro/system.h
===================================================================
--- include/allegro/system.h	(revision 11118)
+++ include/allegro/system.h	(working copy)
@@ -61,6 +61,7 @@
 #define OSTYPE_QNX         AL_ID('Q','N','X',' ')
 #define OSTYPE_UNIX        AL_ID('U','N','I','X')
 #define OSTYPE_BEOS        AL_ID('B','E','O','S')
+#define OSTYPE_HAIKU       AL_ID('H','A','I','K')
 #define OSTYPE_MACOS       AL_ID('M','A','C',' ')
 #define OSTYPE_MACOSX      AL_ID('M','A','C','X')
 
Index: include/allegro/internal/aintern.h
===================================================================
--- include/allegro/internal/aintern.h	(revision 11118)
+++ include/allegro/internal/aintern.h	(working copy)
@@ -190,7 +190,7 @@
 
 
 #if (defined ALLEGRO_DOS) || (defined ALLEGRO_DJGPP) || (defined ALLEGRO_WATCOM) || \
-    (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS)
+    (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS)  || (defined ALLEGRO_HAIKU)
 
 AL_ARRAY(char *, _pckeys_names);
 
Index: include/allegro/internal/alconfig.h
===================================================================
--- include/allegro/internal/alconfig.h	(revision 11118)
+++ include/allegro/internal/alconfig.h	(working copy)
@@ -48,6 +48,8 @@
       #include "allegro/platform/albcc32.h"
    #elif defined ALLEGRO_MSVC
       #include "allegro/platform/almsvc.h"
+   #elif defined ALLEGRO_HAIKU
+      #include "allegro/platform/albecfg.h"
    #elif defined ALLEGRO_BEOS
       #include "allegro/platform/albecfg.h"
    #elif defined ALLEGRO_MPW
Index: makefile.all
===================================================================
--- makefile.all	(revision 11118)
+++ makefile.all	(working copy)
@@ -8,7 +8,7 @@
 #        DEBUGMODE=2        selects a build intended to debug Allegro itself.
 #        PROFILEMODE=1      selects a profiling build.
 #        WARNMODE=1         selects strict compiler warnings.
-#        STATICLINK=1       use static linking (MinGW32, MSVC, BeOS).
+#        STATICLINK=1       use static linking (MinGW32, MSVC, BeOS, Haiku).
 #        STATICRUNTIME=1    link to a static C runtime library (/MT) (MSVC)
 #        TARGET_ARCH_COMPAT optimize for the given processor while preserving backwards
 #                           compatibility with older processors (GCC-based platforms).
@@ -132,7 +132,7 @@
 # XXX this is duplicated in makefile.in
 DOCBASEFILES = ahack changes faq mistakes help thanks allegro const abi api packfile \
                readme makedoc datafile grabber dat dat2c dat2s license addons targets
-DOCBUILDFILES = bcc32 beos darwin djgpp dmc linux macosx mingw32 msvc qnx unix watcom
+DOCBUILDFILES = bcc32 beos darwin djgpp dmc haiku linux macosx mingw32 msvc qnx unix watcom
 DOCTXTBUILDFILES = $(addprefix docs/build/,$(addsuffix .txt,$(DOCBUILDFILES)))
 
 DOCS  = $(addprefix docs/txt/,$(addsuffix .txt,$(filter-out changes thanks readme, $(DOCBASEFILES))))
Index: misc/mkunixdists.sh
===================================================================
--- misc/mkunixdists.sh	(revision 11118)
+++ misc/mkunixdists.sh	(working copy)
@@ -73,9 +73,9 @@
 # Hack'n'slash
 echo "Stripping to form end-user distribution"
 (cd $dir/$basename && {
-	(cd src && rm -rf beos qnx dos mac ppc win)
-	(cd obj && rm -rf bcc32 beos qnx djgpp mingw32 msvc watcom)
-	(cd lib && rm -rf bcc32 beos qnx djgpp mingw32 msvc watcom)
+	(cd src && rm -rf beos haiku qnx dos mac ppc win)
+	(cd obj && rm -rf bcc32 beos haiku qnx djgpp mingw32 msvc watcom)
+	(cd lib && rm -rf bcc32 beos haiku qnx djgpp mingw32 msvc watcom)
 	(cd include && rm -f bealleg.h qnxalleg.h macalleg.h winalleg.h)
 	(cd misc && rm -f cmplog.pl dllsyms.lst findtext.sh fixpatch.sh fixver.sh)
 	(cd misc && rm -f allegro-config-qnx.sh zipup.sh zipwin.sh *.bat *.c)
@@ -94,8 +94,8 @@
 	(cd addons/jpgalleg && rm -f makefile.be makefile.mgw makefile.dj)
 	(cd addons/jpgalleg && rm -f makefile.osx makefile.vc fix.bat readme.txt)
 	(cd addons/jpgalleg/misc && rm -f fixver.sh runner.c)
-	(cd addons/jpgalleg/lib && rm -rf beos djgpp macosx mingw32 msvc)
-	(cd addons/jpgalleg/obj && rm -rf beos djgpp macosx mingw32 msvc)
+	(cd addons/jpgalleg/lib && rm -rf beos djgpp haiku macosx mingw32 msvc)
+	(cd addons/jpgalleg/obj && rm -rf beos djgpp haiku macosx mingw32 msvc)
 
 	# logg addon
 	(cd addons/logg && rm -f Makefile.mingw play_ogg.c stream_ogg.c fix.bat)
Index: misc/zipup.sh
===================================================================
--- misc/zipup.sh	(revision 11118)
+++ misc/zipup.sh	(working copy)
@@ -125,7 +125,13 @@
 
 make depend UNIX_TOOLS=1 CC=gcc
 
+# generate dependencies for Haiku
+echo "Generating Haiku dependencies..."
 
+./fix.sh haiku --quick
+
+make depend UNIX_TOOLS=1 CC=gcc
+
 # generate dependencies for QNX
 echo "Generating QNX dependencies..."
 
@@ -164,7 +170,7 @@
 for base in abi ahack allegro const faq help mistakes; do
    ./_makedoc.exe -ascii docs/txt/$base.txt docs/src/$base._tx
 done
-for base in bcc32 beos darwin djgpp linux macosx mingw32 msvc qnx unix watcom; do
+for base in bcc32 beos darwin djgpp haiku linux macosx mingw32 msvc qnx unix watcom; do
    ./_makedoc.exe -ascii docs/build/$base.txt docs/src/build/$base._tx
 done
 
Index: fix.sh
===================================================================
--- fix.sh	(revision 11118)
+++ fix.sh	(working copy)
@@ -9,7 +9,7 @@
    echo
    echo "Usage: $0 <platform> [--quick|--dtou|--utod]"
    echo
-   echo "Where platform is one of: bcc32, beos, djgpp, mingw, qnx, unix"
+   echo "Where platform is one of: bcc32, beos, djgpp, haiku, mingw, qnx, unix"
    echo "mac, macosx, macosx-universal and watcom."
    echo "The --quick parameter turns off text file conversion, --dtou converts from"
    echo "DOS/Win32 format to Unix, --utod converts from Unix to DOS/Win32 format."
@@ -90,6 +90,7 @@
    "bcc32"   ) proc_fix "Windows (BCC32)"   "makefile.bcc" "ALLEGRO_BCC32";;
    "beos"    ) proc_fix "BeOS"              "makefile.be"  "ALLEGRO_BEOS";;
    "djgpp"   ) proc_fix "DOS (djgpp)"       "makefile.dj"  "ALLEGRO_DJGPP";;
+   "haiku"   ) proc_fix "Haiku"             "makefile.be"  "ALLEGRO_HAIKU";;
    "mingw"   ) proc_fix "Windows (MinGW)"   "makefile.mgw" "ALLEGRO_MINGW32";;
    "mingw32" ) proc_fix "Windows (MinGW)"   "makefile.mgw" "ALLEGRO_MINGW32";;
    # The 'msvc' target is undocumented in the help message, but is used
Index: setup/keyconf.c
===================================================================
--- setup/keyconf.c	(revision 11118)
+++ setup/keyconf.c	(working copy)
@@ -25,8 +25,8 @@
 
 
 /* The code can't link on platforms that don't use src/misc/pckeys.c (everything
- * but DOS, QNX, BEOS). */
-#if (defined ALLEGRO_DOS) || (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS)
+ * but DOS, QNX, BEOS, HAIKU). */
+#if (defined ALLEGRO_DOS) || (defined ALLEGRO_QNX) || (defined ALLEGRO_BEOS) || (defined ALLEGRO_HAIKU)
 
 
 char *ascii_name[32] = 
Index: makefile.be
===================================================================
--- makefile.be	(revision 11118)
+++ makefile.be	(working copy)
@@ -10,11 +10,20 @@
 
 # -------- define some variables that the primary makefile will use --------
 
+OS=$(shell uname -s)
+
+ifeq ($(OS),BeOS)
 PLATFORM = BeOS
+endif
+
+ifeq ($(OS),Haiku)
+PLATFORM = Haiku
+endif
+
 CC = gcc
 EXE = 
 OBJ = .o
-HTML = html
+#HTML = html
 
 PLATFORM_DIR = obj/beos
 
@@ -109,7 +118,7 @@
 # ------ build a C-only version ------
 
 VPATH += src/c
-MY_OBJECTS = $(C_OBJECTS) cmiscs
+MY_OBJECTS = $(C_OBJECTS) 
 CFLAGS += -DALLEGRO_NO_ASM
 
 else
@@ -123,8 +132,14 @@
 
 OBJECT_LIST = $(COMMON_OBJECTS) $(MY_OBJECTS) $(basename $(notdir $(ALLEGRO_SRC_BEOS_FILES)))
 
+ifeq ($(OS),BeOS)
 LIBRARIES = -lbe -lgame -ldevice -lmidi -lmedia -lnet
+endif
 
+ifeq ($(OS),Haiku)
+LIBRARIES = -lbe -lgame -ldevice -lmidi -lmedia -lnetwork
+endif
+
 PROGRAMS = bfixicon
 
 bfixicon: tools/beos/bfixicon
@@ -135,13 +150,23 @@
 
 # -------- rules for installing and removing the library files --------
 
+ifeq ($(OS),BeOS)
 INSTALLDIR = /boot/develop
 LIBDIR = lib/x86
 INCDIR = headers
 
 SHARED_LIBDIR = /boot/home/config/lib
+endif
 
+ifeq ($(OS),Haiku)
+INSTALLDIR = /boot/common
+LIBDIR = lib
+INCDIR = include
 
+SHARED_LIBDIR = /boot/common/lib
+endif
+
+
 ifdef STATICLINK
 
 $(INSTALLDIR)/$(LIBDIR)/lib$(VERSION).a: $(LIB_NAME)
@@ -167,7 +192,14 @@
 	sed -e "s/@LIBS@/$(LIBRARIES)/" temp2 > temp
 	sed -e "s/include/headers/" temp >temp2
 	sed -e "s/ -l\$${lib_type}_unsharable//" temp2 >temp
+
+ifeq ($(OS),BeOS)
 	sed -e "s/libdirs=-L\$${exec_prefix}\/lib/libdirs=\"-L\$${exec_prefix}\/lib\/x86 -L\/boot\/home\/config\/lib\"/" temp >/bin/allegro-config
+endif
+ifeq ($(OS),Haiku)
+	sed -e "s/libdirs=-L\$${exec_prefix}\/lib/libdirs=\"-L\$${exec_prefix}\/lib\/x86 -L\/boot\/common\/lib\"/" temp >/bin/allegro-config
+endif
+
 	rm -f temp temp2
 	chmod a+x /bin/allegro-config
 


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