Fixed bug #615
authorSam Lantinga <slouken@libsdl.org>
Mon, 21 Sep 2009 09:21:00 +0000
changeset 3292245a7d79577c
parent 3291 b273b2a8a1ea
child 3293 0d60bdebed39
Fixed bug #615

Scott McCreary 2008-08-21 10:48:14 PDT

This patch adds support for Haiku.
http://ports.haiku-files.org/browser/haikuports/trunk/media-libs/libsdl/SDL-1.2.13-haiku.diff
Haiku is an open-source recreation of BeOS. It has better POSIX compliance
than beOS did, and other improved features, which in some cases causes us to
have to "undo" previous BeOS workarounds.
Here's our port log entry for it, showing the steps to force the changes into
configure and Makefile:
http://ports.haiku-files.org/wiki/media-libs/libsdl/1.2.13/1
Note that this was only tried on 1.2.13 stable so far.
Haiku is using a newer config.guess / config.sub that doesn't yet seem to be in
the released libtool, so we are having to copy it in for now.
http://haiku-files.org/files/optional-packages/
configure.in
include/SDL_platform.h
include/begin_code.h
test/automated/platform/platform.c
test/configure.in
test/testplatform.c
     1.1 --- a/configure.in	Mon Sep 21 09:16:35 2009 +0000
     1.2 +++ b/configure.in	Mon Sep 21 09:21:00 2009 +0000
     1.3 @@ -2542,7 +2542,7 @@
     1.4          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
     1.5          SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
     1.6          ;;
     1.7 -    *-*-beos*)
     1.8 +    *-*-beos* | *-*-haiku*)
     1.9          ARCH=beos
    1.10          ac_default_prefix=/boot/develop/tools/gnupro
    1.11          CheckDummyVideo
     2.1 --- a/include/SDL_platform.h	Mon Sep 21 09:16:35 2009 +0000
     2.2 +++ b/include/SDL_platform.h	Mon Sep 21 09:21:00 2009 +0000
     2.3 @@ -33,6 +33,10 @@
     2.4  #undef __BEOS__
     2.5  #define __BEOS__	1
     2.6  #endif
     2.7 +#if defined(__HAIKU__)
     2.8 +#undef __HAIKU__
     2.9 +#define __HAIKU__	1
    2.10 +#endif
    2.11  #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
    2.12  #undef __BSDI__
    2.13  #define __BSDI__	1
     3.1 --- a/include/begin_code.h	Mon Sep 21 09:16:35 2009 +0000
     3.2 +++ b/include/begin_code.h	Mon Sep 21 09:21:00 2009 +0000
     3.3 @@ -33,7 +33,7 @@
     3.4  
     3.5  /* Some compilers use a special export keyword */
     3.6  #ifndef DECLSPEC
     3.7 -# if defined(__BEOS__)
     3.8 +# if defined(__BEOS__) || defined(__HAIKU__)
     3.9  #  if defined(__GNUC__)
    3.10  #   define DECLSPEC	__declspec(dllexport)
    3.11  #  else
     4.1 --- a/test/automated/platform/platform.c	Mon Sep 21 09:16:35 2009 +0000
     4.2 +++ b/test/automated/platform/platform.c	Mon Sep 21 09:21:00 2009 +0000
     4.3 @@ -139,6 +139,9 @@
     4.4     return
     4.5  #if __AIX__   
     4.6        "AIX"
     4.7 +#elif __HAIKU__
     4.8 +/* Haiku must appear here before BeOS, since it also defines __BEOS__ */
     4.9 +      "Haiku"
    4.10  #elif __BEOS__
    4.11        "BeOS"
    4.12  #elif __BSDI__
    4.13 @@ -146,7 +149,6 @@
    4.14  #elif __DREAMCAST__
    4.15        "Dreamcast"
    4.16  #elif __FREEBSD__
    4.17 -
    4.18        "FreeBSD"
    4.19  #elif __HPUX__ 
    4.20        "HP-UX"
     5.1 --- a/test/configure.in	Mon Sep 21 09:16:35 2009 +0000
     5.2 +++ b/test/configure.in	Mon Sep 21 09:21:00 2009 +0000
     5.3 @@ -20,7 +20,7 @@
     5.4          MATHLIB=""
     5.5          SYS_GL_LIBS="-lopengl32"
     5.6          ;;
     5.7 -    *-*-beos*)
     5.8 +    *-*-beos* | *-*-haiku*)
     5.9          EXE=""
    5.10          MATHLIB=""
    5.11          SYS_GL_LIBS="-lGL"
     6.1 --- a/test/testplatform.c	Mon Sep 21 09:16:35 2009 +0000
     6.2 +++ b/test/testplatform.c	Mon Sep 21 09:21:00 2009 +0000
     6.3 @@ -160,6 +160,9 @@
     6.4          printf("This system is running %s\n",
     6.5  #if __AIX__
     6.6                 "AIX"
     6.7 +#elif __HAIKU__
     6.8 +/* Haiku must appear here before BeOS, since it also defines __BEOS__ */
     6.9 +               "Haiku"
    6.10  #elif __BEOS__
    6.11                 "BeOS"
    6.12  #elif __BSDI__