mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-04 22:18:55 +02:00
Initial patch for allegro setting up basic support for Haiku, still won't build, but this get's it further.
This commit is contained in:
736
media-libs/allegro/allegro-4.3.10-haiku-1.diff
Normal file
736
media-libs/allegro/allegro-4.3.10-haiku-1.diff
Normal file
@@ -0,0 +1,736 @@
|
||||
diff -urN allegro-4.3.10/fix.sh allegro-4.3.10-haiku/fix.sh
|
||||
--- allegro-4.3.10/fix.sh 2008-01-01 13:59:18.000000000 -0800
|
||||
+++ allegro-4.3.10-haiku/fix.sh 2008-08-23 17:29:03.000000000 -0700
|
||||
@@ -9,7 +9,7 @@
|
||||
echo
|
||||
echo "Usage: $0 <platform> [--quick|--dtou|--utod|--utom|--mtou]"
|
||||
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,"
|
||||
@@ -140,6 +140,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.haiku" "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
|
||||
diff -urN allegro-4.3.10/include/allegro/internal/alconfig.h allegro-4.3.10-haiku/include/allegro/internal/alconfig.h
|
||||
--- allegro-4.3.10/include/allegro/internal/alconfig.h 2007-06-24 01:13:22.000000000 -0700
|
||||
+++ allegro-4.3.10-haiku/include/allegro/internal/alconfig.h 2008-08-25 22:04:47.000000000 -0700
|
||||
@@ -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/alhakcfg.h"
|
||||
#elif defined ALLEGRO_BEOS
|
||||
#include "allegro/platform/albecfg.h"
|
||||
#elif defined ALLEGRO_MPW
|
||||
diff -urN allegro-4.3.10/include/allegro/platform/ainthaiku.h allegro-4.3.10-haiku/include/allegro/platform/ainthaiku.h
|
||||
--- allegro-4.3.10/include/allegro/platform/ainthaiku.h 1969-12-31 16:00:00.000000000 -0800
|
||||
+++ allegro-4.3.10-haiku/include/allegro/platform/ainthaiku.h 2006-03-18 07:05:34.000000000 -0800
|
||||
@@ -0,0 +1,151 @@
|
||||
+/* ______ ___ ___
|
||||
+ * /\ _ \ /\_ \ /\_ \
|
||||
+ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
|
||||
+ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
|
||||
+ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
|
||||
+ * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
|
||||
+ * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
|
||||
+ * /\____/
|
||||
+ * \_/__/
|
||||
+ *
|
||||
+ * Definitions for internal use by the BeOS configuration.
|
||||
+ *
|
||||
+ * By Jason Wilkins.
|
||||
+ *
|
||||
+ * See readme.txt for copyright information.
|
||||
+ */
|
||||
+
|
||||
+
|
||||
+#include "bealleg.h"
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+extern status_t ignore_result;
|
||||
+
|
||||
+extern volatile int32 focus_count;
|
||||
+#endif
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+extern "C" {
|
||||
+#endif
|
||||
+
|
||||
+#define WND_TITLE_SIZE 128
|
||||
+
|
||||
+AL_ARRAY(char, wnd_title);
|
||||
+
|
||||
+int be_key_init(void);
|
||||
+void be_key_exit(void);
|
||||
+void be_key_set_leds(int leds);
|
||||
+void be_key_set_rate(int delay, int repeat);
|
||||
+void be_key_wait_for_input(void);
|
||||
+void be_key_stop_waiting_for_input(void);
|
||||
+void be_key_suspend(void);
|
||||
+void be_key_resume(void);
|
||||
+
|
||||
+int be_sys_init(void);
|
||||
+void be_sys_exit(void);
|
||||
+void _be_sys_get_executable_name(char *output, int size);
|
||||
+void be_sys_get_executable_name(char *output, int size);
|
||||
+int be_sys_find_resource(char *dest, AL_CONST char *resource, int size);
|
||||
+void be_sys_set_window_title(AL_CONST char *name);
|
||||
+int be_sys_set_close_button_callback(void (*proc)(void));
|
||||
+void be_sys_message(AL_CONST char *msg);
|
||||
+int be_sys_set_display_switch_mode(int mode);
|
||||
+int be_sys_desktop_color_depth(void);
|
||||
+int be_sys_get_desktop_resolution(int *width, int *height);
|
||||
+void be_sys_get_gfx_safe_mode(int *driver, struct GFX_MODE *mode);
|
||||
+void be_sys_yield_timeslice(void);
|
||||
+void *be_sys_create_mutex(void);
|
||||
+void be_sys_destroy_mutex(void *handle);
|
||||
+void be_sys_lock_mutex(void *handle);
|
||||
+void be_sys_unlock_mutex(void *handle);
|
||||
+void be_sys_suspend(void);
|
||||
+void be_sys_resume(void);
|
||||
+void be_main_suspend(void);
|
||||
+void be_main_resume(void);
|
||||
+
|
||||
+struct BITMAP *be_gfx_bwindowscreen_accel_init(int w, int h, int v_w, int v_h, int color_depth);
|
||||
+struct BITMAP *be_gfx_bwindowscreen_init(int w, int h, int v_w, int v_h, int color_depth);
|
||||
+void be_gfx_bwindowscreen_exit(struct BITMAP *b);
|
||||
+void be_gfx_bwindowscreen_acquire(struct BITMAP *b);
|
||||
+void be_gfx_bwindowscreen_release(struct BITMAP *b);
|
||||
+void be_gfx_bwindowscreen_set_palette(AL_CONST struct RGB *p, int from, int to, int vsync);
|
||||
+int be_gfx_bwindowscreen_scroll(int x, int y);
|
||||
+int be_gfx_bwindowscreen_request_scroll(int x, int y);
|
||||
+int be_gfx_bwindowscreen_poll_scroll(void);
|
||||
+int be_gfx_bwindowscreen_request_video_bitmap(struct BITMAP *bitmap);
|
||||
+void be_gfx_vsync(void);
|
||||
+struct GFX_MODE_LIST *be_gfx_bwindowscreen_fetch_mode_list(void);
|
||||
+void be_gfx_bwindowscreen_accelerate(int color_depth);
|
||||
+#ifdef ALLEGRO_NO_ASM
|
||||
+uintptr_t be_gfx_bwindowscreen_read_write_bank(BITMAP *bmp, int lyne);
|
||||
+void be_gfx_bwindowscreen_unwrite_bank(BITMAP *bmp);
|
||||
+#else
|
||||
+uintptr_t _be_gfx_bwindowscreen_read_write_bank_asm(BITMAP *bmp, int lyne);
|
||||
+void _be_gfx_bwindowscreen_unwrite_bank_asm(BITMAP *bmp);
|
||||
+#endif
|
||||
+
|
||||
+struct BITMAP *be_gfx_bdirectwindow_init(int w, int h, int v_w, int v_h, int color_depth);
|
||||
+void be_gfx_bdirectwindow_exit(struct BITMAP *b);
|
||||
+void be_gfx_bdirectwindow_acquire(struct BITMAP *bmp);
|
||||
+void be_gfx_bdirectwindow_release(struct BITMAP *bmp);
|
||||
+void be_gfx_bdirectwindow_set_palette(AL_CONST struct RGB *p, int from, int to, int vsync);
|
||||
+
|
||||
+struct BITMAP *be_gfx_bwindow_init(int w, int h, int v_w, int v_h, int color_depth);
|
||||
+void be_gfx_bwindow_exit(struct BITMAP *b);
|
||||
+void be_gfx_bwindow_acquire(struct BITMAP *bmp);
|
||||
+void be_gfx_bwindow_release(struct BITMAP *bmp);
|
||||
+void be_gfx_bwindow_set_palette(AL_CONST struct RGB *p, int from, int to, int vsync);
|
||||
+
|
||||
+#ifdef ALLEGRO_NO_ASM
|
||||
+void _be_gfx_bwindow_unwrite_bank(BITMAP *bmp);
|
||||
+uintptr_t _be_gfx_bwindow_read_write_bank(BITMAP *bmp, int lyne);
|
||||
+#else
|
||||
+void _be_gfx_bwindow_unwrite_bank_asm(BITMAP *bmp);
|
||||
+uintptr_t _be_gfx_bwindow_read_write_bank_asm(BITMAP *bmp, int lyne);
|
||||
+#endif
|
||||
+
|
||||
+struct BITMAP *be_gfx_overlay_init(int w, int h, int v_w, int v_h, int color_depth);
|
||||
+void be_gfx_overlay_exit(struct BITMAP *b);
|
||||
+
|
||||
+int be_time_init(void);
|
||||
+void be_time_exit(void);
|
||||
+void be_time_rest(unsigned int tyme, AL_METHOD(void, callback, (void)));
|
||||
+void be_time_suspend(void);
|
||||
+void be_time_resume(void);
|
||||
+
|
||||
+int be_mouse_init(void);
|
||||
+void be_mouse_exit(void);
|
||||
+void be_mouse_position(int x, int y);
|
||||
+void be_mouse_set_range(int x1, int y_1, int x2, int y2);
|
||||
+void be_mouse_set_speed(int xspeed, int yspeed);
|
||||
+void be_mouse_get_mickeys(int *mickeyx, int *mickeyy);
|
||||
+
|
||||
+int be_joy_init(void);
|
||||
+void be_joy_exit(void);
|
||||
+int be_joy_poll(void);
|
||||
+
|
||||
+int be_sound_detect(int input);
|
||||
+int be_sound_init(int input, int voices);
|
||||
+void be_sound_exit(int input);
|
||||
+void *be_sound_lock_voice(int voice, int start, int end);
|
||||
+void be_sound_unlock_voice(int voice);
|
||||
+int be_sound_buffer_size(void);
|
||||
+int be_sound_set_mixer_volume(int volume);
|
||||
+int be_sound_get_mixer_volume(void);
|
||||
+void be_sound_suspend(void);
|
||||
+void be_sound_resume(void);
|
||||
+
|
||||
+int be_midi_detect(int input);
|
||||
+int be_midi_init(int input, int voices);
|
||||
+void be_midi_exit(int input);
|
||||
+int be_midi_set_mixer_volume(int volume);
|
||||
+int be_midi_get_mixer_volume(void);
|
||||
+void be_midi_key_on(int inst, int note, int bend, int vol, int pan);
|
||||
+void be_midi_key_off(int voice);
|
||||
+void be_midi_set_volume(int voice, int vol);
|
||||
+void be_midi_set_pitch(int voice, int note, int bend);
|
||||
+void be_midi_set_pan(int voice, int pan);
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+}
|
||||
+#endif
|
||||
diff -urN allegro-4.3.10/include/allegro/platform/alhaiku.h allegro-4.3.10-haiku/include/allegro/platform/alhaiku.h
|
||||
--- allegro-4.3.10/include/allegro/platform/alhaiku.h 1969-12-31 16:00:00.000000000 -0800
|
||||
+++ allegro-4.3.10-haiku/include/allegro/platform/alhaiku.h 2002-10-01 11:05:12.000000000 -0700
|
||||
@@ -0,0 +1,76 @@
|
||||
+/* ______ ___ ___
|
||||
+ * /\ _ \ /\_ \ /\_ \
|
||||
+ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
|
||||
+ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
|
||||
+ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
|
||||
+ * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
|
||||
+ * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
|
||||
+ * /\____/
|
||||
+ * \_/__/
|
||||
+ *
|
||||
+ * BeOS specific definitions header file.
|
||||
+ *
|
||||
+ * By Jason Wilkins.
|
||||
+ *
|
||||
+ * See readme.txt for copyright information.
|
||||
+ */
|
||||
+
|
||||
+
|
||||
+/* system driver */
|
||||
+#define SYSTEM_BEOS AL_ID('B','S','Y','S')
|
||||
+AL_VAR(SYSTEM_DRIVER, system_beos);
|
||||
+
|
||||
+/* timer driver */
|
||||
+#define TIMER_BEOS AL_ID('B','T','I','M')
|
||||
+AL_VAR(TIMER_DRIVER, timer_beos);
|
||||
+
|
||||
+/* keyboard driver */
|
||||
+#define KEYBOARD_BEOS AL_ID('B','K','E','Y')
|
||||
+AL_VAR(KEYBOARD_DRIVER, keyboard_beos);
|
||||
+
|
||||
+/* mouse driver */
|
||||
+#define MOUSE_BEOS AL_ID('B','M','O','U')
|
||||
+AL_VAR(MOUSE_DRIVER, mouse_beos);
|
||||
+
|
||||
+/* joystick driver */
|
||||
+#define JOYSTICK_BEOS AL_ID('B','J','O','Y')
|
||||
+AL_VAR(JOYSTICK_DRIVER, joystick_beos);
|
||||
+
|
||||
+/* graphics drivers */
|
||||
+#define GFX_BWINDOWSCREEN_ACCEL AL_ID('B','W','S','A')
|
||||
+#define GFX_BWINDOWSCREEN AL_ID('B','W','S',' ')
|
||||
+AL_VAR(GFX_DRIVER, gfx_beos_bwindowscreen_accel);
|
||||
+AL_VAR(GFX_DRIVER, gfx_beos_bwindowscreen);
|
||||
+
|
||||
+#define GFX_BDIRECTWINDOW AL_ID('B','D','W','N')
|
||||
+#define GFX_BWINDOW AL_ID('B','W','N',' ')
|
||||
+AL_VAR(GFX_DRIVER, gfx_beos_bdirectwindow);
|
||||
+AL_VAR(GFX_DRIVER, gfx_beos_bwindow);
|
||||
+
|
||||
+#define GFX_BWINDOW_OVERLAY AL_ID('B','O','V','L')
|
||||
+AL_VAR(GFX_DRIVER, gfx_beos_overlay);
|
||||
+
|
||||
+/* digi drivers */
|
||||
+#define DIGI_BEOS AL_ID('B','D','I','G')
|
||||
+AL_VAR(DIGI_DRIVER, digi_beos);
|
||||
+
|
||||
+/* midi drivers */
|
||||
+#define MIDI_BEOS AL_ID('B','M','I','D')
|
||||
+AL_VAR(MIDI_DRIVER, midi_beos);
|
||||
+
|
||||
+#define GFX_DRIVER_BEOS \
|
||||
+ { GFX_BWINDOWSCREEN_ACCEL, &gfx_beos_bwindowscreen_accel, TRUE }, \
|
||||
+ { GFX_BWINDOWSCREEN, &gfx_beos_bwindowscreen, TRUE }, \
|
||||
+ { GFX_BDIRECTWINDOW, &gfx_beos_bdirectwindow, TRUE }, \
|
||||
+ { GFX_BWINDOW, &gfx_beos_bwindow, TRUE }, \
|
||||
+ { GFX_BWINDOW_OVERLAY, &gfx_beos_overlay, TRUE },
|
||||
+
|
||||
+#define DIGI_DRIVER_BEOS \
|
||||
+ { DIGI_BEOS, &digi_beos, TRUE },
|
||||
+
|
||||
+#define MIDI_DRIVER_BEOS \
|
||||
+ { MIDI_BEOS, &midi_beos, TRUE },
|
||||
+
|
||||
+#define JOYSTICK_DRIVER_BEOS \
|
||||
+ { JOYSTICK_BEOS, &joystick_beos, TRUE },
|
||||
+
|
||||
diff -urN allegro-4.3.10/include/allegro/platform/alhakcfg.h allegro-4.3.10-haiku/include/allegro/platform/alhakcfg.h
|
||||
--- allegro-4.3.10/include/allegro/platform/alhakcfg.h 1969-12-31 16:00:00.000000000 -0800
|
||||
+++ allegro-4.3.10-haiku/include/allegro/platform/alhakcfg.h 2008-08-25 22:07:11.000000000 -0700
|
||||
@@ -0,0 +1,43 @@
|
||||
+/* ______ ___ ___
|
||||
+ * /\ _ \ /\_ \ /\_ \
|
||||
+ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
|
||||
+ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
|
||||
+ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
|
||||
+ * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
|
||||
+ * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
|
||||
+ * /\____/
|
||||
+ * \_/__/
|
||||
+ *
|
||||
+ * Configuration defines for use with BeOS.
|
||||
+ *
|
||||
+ * By Jason Wilkins.
|
||||
+ *
|
||||
+ * See readme.txt for copyright information.
|
||||
+ */
|
||||
+
|
||||
+
|
||||
+#include <fcntl.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+/* provide implementations of missing functions */
|
||||
+#define ALLEGRO_NO_STRICMP
|
||||
+#define ALLEGRO_NO_STRLWR
|
||||
+#define ALLEGRO_NO_STRUPR
|
||||
+
|
||||
+/* a static auto config */
|
||||
+#define ALLEGRO_HAVE_DIRENT_H 1
|
||||
+#define ALLEGRO_HAVE_INTTYPES_H 1 /* TODO: check this */
|
||||
+#define ALLEGRO_HAVE_STDINT_H 1 /* TODO: check this */
|
||||
+#define ALLEGRO_HAVE_SYS_TIME_H 1
|
||||
+
|
||||
+/* describe this platform */
|
||||
+#define ALLEGRO_PLATFORM_STR "Haiku"
|
||||
+#define ALLEGRO_LITTLE_ENDIAN
|
||||
+#define ALLEGRO_CONSOLE_OK
|
||||
+#define ALLEGRO_USE_CONSTRUCTOR
|
||||
+#define ALLEGRO_MULTITHREADED
|
||||
+
|
||||
+/* arrange for other headers to be included later on */
|
||||
+#define ALLEGRO_EXTRA_HEADER "allegro/platform/alhaiku.h"
|
||||
+#define ALLEGRO_INTERNAL_HEADER "allegro/platform/ainthaiku.h"
|
||||
+#define ALLEGRO_ASMCAPA_HEADER "obj/beos/asmcapa.h"
|
||||
diff -urN allegro-4.3.10/makefile.all allegro-4.3.10-haiku/makefile.all
|
||||
--- allegro-4.3.10/makefile.all 2008-01-14 03:55:28.000000000 -0800
|
||||
+++ allegro-4.3.10-haiku/makefile.all 2008-08-23 17:44:44.000000000 -0700
|
||||
@@ -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))))
|
||||
diff -urN allegro-4.3.10/makefile.haiku allegro-4.3.10-haiku/makefile.haiku
|
||||
--- allegro-4.3.10/makefile.haiku 1969-12-31 16:00:00.000000000 -0800
|
||||
+++ allegro-4.3.10-haiku/makefile.haiku 2008-08-25 21:19:47.000000000 -0700
|
||||
@@ -0,0 +1,315 @@
|
||||
+#
|
||||
+# Rules for building the Allegro library with Haiku. This file is included
|
||||
+# by the primary makefile, and should not be used directly.
|
||||
+#
|
||||
+# The "depend" target uses sed.
|
||||
+#
|
||||
+# See makefile.all for a list of the available targets.
|
||||
+
|
||||
+
|
||||
+
|
||||
+# -------- define some variables that the primary makefile will use --------
|
||||
+
|
||||
+PLATFORM = Haiku
|
||||
+CC = gcc
|
||||
+EXE =
|
||||
+OBJ = .o
|
||||
+HTML = html
|
||||
+
|
||||
+PLATFORM_DIR = obj/beos
|
||||
+
|
||||
+UNIX_TOOLS = 1
|
||||
+
|
||||
+ifdef STATICLINK
|
||||
+
|
||||
+# -------- link as a static library --------
|
||||
+OBJ_DIR = obj/beos/$(VERSION)
|
||||
+LIB_NAME = lib/beos/lib$(VERSION).a
|
||||
+
|
||||
+else
|
||||
+
|
||||
+# -------- link as a DLL --------
|
||||
+OBJ_DIR = obj/beos/$(VERSION)
|
||||
+LIB_NAME = lib/beos/lib$(VERSION)-$(shared_version).so
|
||||
+
|
||||
+endif # STATICLINK
|
||||
+
|
||||
+# -------- give a sensible default target for make without any args --------
|
||||
+
|
||||
+.PHONY: _default
|
||||
+
|
||||
+_default: default
|
||||
+
|
||||
+
|
||||
+# -------- decide what compiler options to use --------
|
||||
+
|
||||
+ifdef WARNMODE
|
||||
+WFLAGS = -Wall -W -Wstrict-prototypes -Wno-unused -Wno-multichar -Wno-ctor-dtor-privacy -Werror
|
||||
+else
|
||||
+WFLAGS = -Wall -Wno-unused -Wno-multichar -Wno-ctor-dtor-privacy
|
||||
+endif
|
||||
+
|
||||
+ifdef TARGET_ARCH_COMPAT
|
||||
+ TARGET_ARCH = $(GCC_MTUNE)=$(TARGET_ARCH_COMPAT)
|
||||
+else
|
||||
+ ifdef TARGET_ARCH_EXCL
|
||||
+ TARGET_ARCH = -march=$(TARGET_ARCH_EXCL)
|
||||
+ else
|
||||
+ TARGET_ARCH = $(GCC_MTUNE)=i586
|
||||
+ endif
|
||||
+endif
|
||||
+
|
||||
+ifndef TARGET_OPTS
|
||||
+ TARGET_OPTS = -O6 -funroll-loops -ffast-math
|
||||
+endif
|
||||
+
|
||||
+OFLAGS = $(TARGET_ARCH) $(TARGET_OPTS)
|
||||
+
|
||||
+CFLAGS = -DALLEGRO_LIB_BUILD
|
||||
+
|
||||
+
|
||||
+
|
||||
+ifdef DEBUGMODE
|
||||
+
|
||||
+# -------- debugging build --------
|
||||
+CFLAGS += -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) -g -O0
|
||||
+SFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS)
|
||||
+LFLAGS = -g
|
||||
+
|
||||
+else
|
||||
+ifdef PROFILEMODE
|
||||
+
|
||||
+# -------- profiling build --------
|
||||
+CFLAGS += $(WFLAGS) $(OFLAGS) -pg
|
||||
+SFLAGS = $(WFLAGS)
|
||||
+LFLAGS = -pg
|
||||
+
|
||||
+else
|
||||
+
|
||||
+# -------- optimised build --------
|
||||
+CFLAGS += $(WFLAGS) $(OFLAGS) -fomit-frame-pointer
|
||||
+SFLAGS = $(WFLAGS)
|
||||
+
|
||||
+ifndef SYMBOLMODE
|
||||
+LFLAGS = -s
|
||||
+else
|
||||
+LFLAGS =
|
||||
+endif
|
||||
+
|
||||
+endif
|
||||
+endif
|
||||
+
|
||||
+
|
||||
+# -------- list which platform specific objects to include --------
|
||||
+
|
||||
+VPATH = src/haiku src/misc src/unix tools/haiku
|
||||
+
|
||||
+ifdef ALLEGRO_USE_C
|
||||
+
|
||||
+# ------ build a C-only version ------
|
||||
+
|
||||
+VPATH += src/c
|
||||
+MY_OBJECTS = $(C_OBJECTS) cmiscs
|
||||
+CFLAGS +=
|
||||
+
|
||||
+else
|
||||
+
|
||||
+# ------ build the normal asm version ------
|
||||
+
|
||||
+VPATH += src/i386
|
||||
+MY_OBJECTS = $(I386_OBJECTS)
|
||||
+
|
||||
+endif # ALLEGRO_USE_C
|
||||
+
|
||||
+OBJECT_LIST = $(COMMON_OBJECTS) $(MY_OBJECTS) $(basename $(notdir $(ALLEGRO_SRC_HAIKU_FILES)))
|
||||
+
|
||||
+LIBRARIES = -lbe -lgame -ldevice -lmidi -lmedia -lnetwork
|
||||
+
|
||||
+PROGRAMS = bfixicon
|
||||
+
|
||||
+bfixicon: tools/haiku/bfixicon
|
||||
+
|
||||
+DISTCLEAN_FILES += tools/haiku/bfixicon
|
||||
+
|
||||
+
|
||||
+
|
||||
+# -------- rules for installing and removing the library files --------
|
||||
+
|
||||
+INSTALLDIR = /boot/develop
|
||||
+LIBDIR = lib/x86
|
||||
+INCDIR = headers
|
||||
+
|
||||
+SHARED_LIBDIR = /boot/common/lib
|
||||
+
|
||||
+
|
||||
+ifdef STATICLINK
|
||||
+
|
||||
+$(INSTALLDIR)/$(LIBDIR)/lib$(VERSION).a: $(LIB_NAME)
|
||||
+ cp $< $@
|
||||
+
|
||||
+else
|
||||
+
|
||||
+$(SHARED_LIBDIR)/lib$(VERSION)-$(shared_version).so: $(LIB_NAME)
|
||||
+ cp $< $@
|
||||
+
|
||||
+endif
|
||||
+
|
||||
+
|
||||
+/bin/allegro-config:
|
||||
+ifdef STATICLINK
|
||||
+ sed -e "s/@LINK_WITH_STATIC_LIBS@/yes/" misc/allegro-config.in >temp
|
||||
+else
|
||||
+ sed -e "s/@LINK_WITH_STATIC_LIBS@/no/" misc/allegro-config.in >temp
|
||||
+endif
|
||||
+ sed -e "s/@prefix@/\/boot\/develop/" temp > temp2
|
||||
+ sed -e "s/@LIB_TO_LINK@/$(VERSION)/" temp2 > temp
|
||||
+ sed -e "s/@LDFLAGS@//" temp > temp2
|
||||
+ sed -e "s/@LIBS@/$(LIBRARIES)/" temp2 > temp
|
||||
+ sed -e "s/include/headers/" temp >temp2
|
||||
+ sed -e "s/ -l\$${lib_type}_unsharable//" temp2 >temp
|
||||
+ sed -e "s/libdirs=-L\$${exec_prefix}\/lib/libdirs=\"-L\$${exec_prefix}\/lib\/x86 -L\/boot\/common\/lib\"/" temp >/bin/allegro-config
|
||||
+ rm -f temp temp2
|
||||
+ chmod a+x /bin/allegro-config
|
||||
+
|
||||
+
|
||||
+HEADERS = $(INSTALLDIR)/$(INCDIR)/bealleg.h \
|
||||
+ $(INSTALLDIR)/$(INCDIR)/allegro/platform/aintbeos.h \
|
||||
+ $(INSTALLDIR)/$(INCDIR)/allegro/platform/al386gcc.h \
|
||||
+ $(INSTALLDIR)/$(INCDIR)/allegro/platform/albecfg.h \
|
||||
+ $(INSTALLDIR)/$(INCDIR)/allegro/platform/alplatf.h \
|
||||
+ $(INSTALLDIR)/$(INCDIR)/allegro/platform/astdint.h \
|
||||
+ $(INSTALLDIR)/$(INCDIR)/allegro/platform/albeos.h
|
||||
+
|
||||
+ifdef STATICLINK
|
||||
+ INSTALL_FILES = $(INSTALLDIR)/$(LIBDIR)/lib$(VERSION).a
|
||||
+else
|
||||
+ INSTALL_FILES = $(SHARED_LIBDIR)/lib$(VERSION)-$(shared_version).so
|
||||
+endif
|
||||
+
|
||||
+INSTALL_FILES += $(HEADERS) /bin/allegro-config
|
||||
+
|
||||
+
|
||||
+install: generic-install
|
||||
+ @echo The $(DESCRIPTION) $(PLATFORM) library has been installed.
|
||||
+
|
||||
+UNINSTALL_FILES = $(INSTALLDIR)/$(LIBDIR)/liballeg.a \
|
||||
+ $(INSTALLDIR)/$(LIBDIR)/liballd.a \
|
||||
+ $(INSTALLDIR)/$(LIBDIR)/liballp.a \
|
||||
+ $(SHARED_LIBDIR)/liballeg-$(shared_version).so \
|
||||
+ $(SHARED_LIBDIR)/liballd-$(shared_version).so \
|
||||
+ $(SHARED_LIBDIR)/liballp-$(shared_version).so \
|
||||
+ $(HEADERS) \
|
||||
+ /bin/allegro-config
|
||||
+
|
||||
+uninstall: generic-uninstall
|
||||
+ @echo All gone!
|
||||
+
|
||||
+
|
||||
+
|
||||
+# -------- test capabilities --------
|
||||
+
|
||||
+TEST_CPP = @echo ...system compiler
|
||||
+
|
||||
+include makefile.tst
|
||||
+
|
||||
+
|
||||
+
|
||||
+# -------- finally, we get to the fun part... --------
|
||||
+
|
||||
+ifdef PROFILEMODE
|
||||
+OTHER_OBJECTS = /boot/develop/lib/x86/i386-mcount.o
|
||||
+endif
|
||||
+
|
||||
+ifdef STATICLINK
|
||||
+
|
||||
+# -------- link as a static library --------
|
||||
+define MAKE_LIB
|
||||
+ar rs $(LIB_NAME) $(OBJECTS) $(OTHER_OBJECTS)
|
||||
+endef
|
||||
+
|
||||
+else
|
||||
+
|
||||
+# -------- link as a shared library --------
|
||||
+
|
||||
+define MAKE_LIB
|
||||
+$(CC) -nostart $(PFLAGS) -o $(LIB_NAME) $(OBJECTS) $(OTHER_OBJECTS) $(LIBRARIES)
|
||||
+endef
|
||||
+
|
||||
+endif # STATICLINK
|
||||
+
|
||||
+COMPILE_FLAGS = $(subst src/,-DALLEGRO_SRC ,$(findstring src/, $<))$(CFLAGS)
|
||||
+
|
||||
+$(OBJ_DIR)/%.o: %.c
|
||||
+ $(CC) $(COMPILE_FLAGS) -I. -I./include -o $@ -c $<
|
||||
+
|
||||
+$(OBJ_DIR)/%.o: %.cpp
|
||||
+ $(CC) $(COMPILE_FLAGS) -I. -I./include -o $@ -c $<
|
||||
+
|
||||
+$(OBJ_DIR)/%.o: %.s
|
||||
+ $(CC) $(SFLAGS) -I. -I./include -x assembler-with-cpp -o $@ -c $<
|
||||
+
|
||||
+demos/shooter/shooter: $(OBJECTS_SHOOTER) $(LIB_NAME)
|
||||
+ $(CC) $(LFLAGS) -o $@ $(OBJECTS_SHOOTER) $(LIB_NAME) $(LIBRARIES)
|
||||
+
|
||||
+demos/skater/skater: $(OBJECTS_SKATER) $(LIB_NAME)
|
||||
+ $(CC) $(LFLAGS) -o $@ $(OBJECTS_SKATER) $(LIB_NAME) $(LIBRARIES)
|
||||
+
|
||||
+*/%: $(OBJ_DIR)/%.o $(LIB_NAME)
|
||||
+ $(CC) $(LFLAGS) -o $@ $< $(LIB_NAME) $(LIBRARIES)
|
||||
+
|
||||
+obj/haiku/asmdef.inc: obj/haiku/asmdef
|
||||
+ obj/haiku/asmdef obj/haiku/asmdef.inc
|
||||
+
|
||||
+obj/haiku/asmdef: src/i386/asmdef.c include/*.h include/allegro/*.h obj/haiku/asmcapa.h
|
||||
+ $(CC) -O $(WFLAGS) -I. -I./include -o obj/haiku/asmdef src/i386/asmdef.c
|
||||
+
|
||||
+define LINK_WITHOUT_LIB
|
||||
+ $(CC) $(LFLAGS) -o $@ $^ $(OTHER_OBJECTS)
|
||||
+endef
|
||||
+
|
||||
+PLUGIN_LIB = lib/haiku/lib$(VERY_SHORT_VERSION)dat.a
|
||||
+PLUGINS_H = obj/haiku/plugins.h
|
||||
+PLUGIN_DEPS = $(LIB_NAME) $(PLUGIN_LIB)
|
||||
+PLUGIN_SCR = scr
|
||||
+
|
||||
+define GENERATE_PLUGINS_H
|
||||
+cat tools/plugins/*.inc > obj/haiku/plugins.h
|
||||
+endef
|
||||
+
|
||||
+define MAKE_PLUGIN_LIB
|
||||
+ar rs $(PLUGIN_LIB) $(PLUGIN_OBJS)
|
||||
+endef
|
||||
+
|
||||
+define LINK_WITH_PLUGINS
|
||||
+$(CC) $(LFLAGS) -o $@ $< $(strip $(PLUGIN_LIB) $(addprefix @,$(PLUGIN_SCRIPTS)) $(LIB_NAME))
|
||||
+endef
|
||||
+
|
||||
+tools/haiku/%: $(OBJ_DIR)/%.o $(LIB_NAME)
|
||||
+ $(CC) $(LFLAGS) -o $@ $< $(LIB_NAME) $(LIBRARIES)
|
||||
+
|
||||
+
|
||||
+
|
||||
+# -------- demo program iconification --------
|
||||
+
|
||||
+.PHONY: fixdemo
|
||||
+
|
||||
+fixdemo: demos/shooter/shooter demo/demo.dat tools/haiku/bfixicon
|
||||
+ tools/haiku/bfixicon demos/shooter/shooter -d demos/shooter/demo.dat SHIP3 GAME_PAL
|
||||
+
|
||||
+
|
||||
+
|
||||
+# -------- generate automatic dependencies --------
|
||||
+
|
||||
+DEPEND_PARAMS = -MM -MG -I. -I./include -DSCAN_DEPEND -DALLEGRO_HAIKU
|
||||
+
|
||||
+depend:
|
||||
+ $(CC) $(DEPEND_PARAMS) src/*.c src/haiku/*.c src/i386/*.c src/misc/*.c src/unix/*.c demos/shooter/*.c > _depend.tmp
|
||||
+ $(CC) $(DEPEND_PARAMS) docs/src/makedoc/*.c examples/*.c setup/*.c tests/*.c tools/*.c tools/plugins/*.c >> _depend.tmp
|
||||
+ $(CC) $(DEPEND_PARAMS) demos/skater/source/*.c >> _depend.tmp
|
||||
+ $(CC) $(DEPEND_PARAMS) -x c src/haiku/*.cpp tests/*.cpp tools/haiku/*.cpp >> _depend.tmp
|
||||
+ $(CC) $(DEPEND_PARAMS) -x assembler-with-cpp src/i386/*.s src/misc/*.s >> _depend.tmp
|
||||
+ sed -e "s/^[a-zA-Z0-9_\/]*\///" _depend.tmp > _depend2.tmp
|
||||
+ sed -e "s/^\([a-zA-Z0-9_]*\.o *:\)/obj\/haiku\/alleg\/\1/" _depend2.tmp > obj/haiku/alleg/makefile.dep
|
||||
+ sed -e "s/^\([a-zA-Z0-9_]*\.o *:\)/obj\/haiku\/alld\/\1/" _depend2.tmp > obj/haiku/alld/makefile.dep
|
||||
+ sed -e "s/^\([a-zA-Z0-9_]*\.o *:\)/obj\/haiku\/allp\/\1/" _depend2.tmp > obj/haiku/allp/makefile.dep
|
||||
+ rm _depend.tmp _depend2.tmp
|
||||
diff -urN allegro-4.3.10/misc/mkunixdists.sh allegro-4.3.10-haiku/misc/mkunixdists.sh
|
||||
--- allegro-4.3.10/misc/mkunixdists.sh 2008-01-10 13:45:48.000000000 -0800
|
||||
+++ allegro-4.3.10-haiku/misc/mkunixdists.sh 2008-08-23 20:56:44.000000000 -0700
|
||||
@@ -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)
|
||||
@@ -91,11 +91,11 @@
|
||||
|
||||
# jpgalleg addon
|
||||
(cd addons/jpgalleg && rm -rf examples)
|
||||
- (cd addons/jpgalleg && rm -f makefile.be makefile.mgw makefile.dj)
|
||||
+ (cd addons/jpgalleg && rm -f makefile.be makefile.haiku 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)
|
||||
diff -urN allegro-4.3.10/misc/zipup.sh allegro-4.3.10-haiku/misc/zipup.sh
|
||||
--- allegro-4.3.10/misc/zipup.sh 2008-01-19 04:16:56.000000000 -0800
|
||||
+++ allegro-4.3.10-haiku/misc/zipup.sh 2008-08-23 20:53:10.000000000 -0700
|
||||
@@ -126,6 +126,14 @@
|
||||
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 +172,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
|
||||
|
||||
diff -urN allegro-4.3.10/tools/dat2c.c allegro-4.3.10-haiku/tools/dat2c.c
|
||||
--- allegro-4.3.10/tools/dat2c.c 2005-04-28 02:53:38.000000000 -0700
|
||||
+++ allegro-4.3.10-haiku/tools/dat2c.c 2008-08-23 20:44:06.000000000 -0700
|
||||
@@ -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;
|
||||
diff -urN allegro-4.3.10/tools/datedit.c allegro-4.3.10-haiku/tools/datedit.c
|
||||
--- allegro-4.3.10/tools/datedit.c 2007-10-08 09:23:36.000000000 -0700
|
||||
+++ allegro-4.3.10-haiku/tools/datedit.c 2008-08-23 20:42:07.000000000 -0700
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user