hi,
i had, this was fun.
it's barely over the "it just compiles" stage, there are a whole loads
of problems with terminal, possibly network, and whatnot.
anyway, if someone wants to chew this, it's a start. the downloadable
haiku r1alpha1 iso contains everything one needs to get started ;)
2009.09.14 20:54:52 Haiku 1 BePC
Harbour 2.0.0beta3 (Rev. 12490) GNU C 2.95 (32-bit) x86
THREADS: 0
N_LOOPS: 1000000
[ T000: empty loop overhead ]...................................0.89
====================================================================
[ T001: x := L_C ]..............................................0.00
[ T002: x := L_N ]..............................................0.00
[ T003: x := L_D ]..............................................0.00
[ T004: x := S_C ]..............................................0.00
[ T005: x := S_N ]..............................................0.00
[ T006: x := S_D ]..............................................0.00
[ T007: x := M->M_C ]...........................................0.00
[ T008: x := M->M_N ]...........................................0.00
[ T009: x := M->M_D ]...........................................0.00
[ T010: x := M->P_C ]...........................................0.00
[ T011: x := M->P_N ]...........................................0.00
[ T012: x := M->P_D ]...........................................0.00
[ T013: x := F_C ]..............................................4.17
[ T014: x := F_N ]..............................................0.10
[ T015: x := F_D ]..............................................0.00
[ T016: x := o:Args ]...........................................0.13
[ T017: x := o[2] ].............................................0.00
[ T018: round( i / 1000, 2 ) ]..................................0.31
[ T019: str( i / 1000 ) ].......................................4.34
[ T020: val( s ) ]..............................................0.21
[ T021: val( a [ i % 16 + 1 ] ) ]...............................0.90
[ T022: dtos( d - i % 10000 ) ].................................1.88
[ T023: eval( { || i % 16 } ) ].................................2.01
[ T024: eval( bc := { || i % 16 } ) ]...........................0.00
[ T025: eval( { |x| x % 16 }, i ) ].............................0.97
[ T026: eval( bc := { |x| x % 16 }, i ) ].......................0.00
[ T027: eval( { |x| f1( x ) }, i ) ]............................1.25
[ T028: eval( bc := { |x| f1( x ) }, i ) ]......................0.20
[ T029: eval( bc := &("{ |x| f1( x ) }"), i ) ].................0.33
[ T030: x := &( "f1(" + str(i) + ")" ) ].......................22.08
[ T031: bc := &( "{|x|f1(x)}" ), eval( bc, i ) ]...............25.36
[ T032: x := valtype( x ) + valtype( i ) ].....................1.93
[ T033: x := strzero( i % 100, 2 ) $ a[ i % 16 + 1 ] ]..........5.00
[ T034: x := a[ i % 16 + 1 ] == s ].............................0.17
[ T035: x := a[ i % 16 + 1 ] = s ]..............................0.24
[ T036: x := a[ i % 16 + 1 ] >= s ].............................0.25
[ T037: x := a[ i % 16 + 1 ] <= s ].............................0.48
[ T038: x := a[ i % 16 + 1 ] < s ]..............................0.23
[ T039: x := a[ i % 16 + 1 ] > s ]..............................0.22
[ T040: ascan( a, i % 16 ) ]....................................0.08
[ T041: ascan( a, { |x| x == i % 16 } ) ].......................7.77
[ T042: iif( i%1000==0, a:={}, ) , aadd(a,{i,1,.T.,s,s2,a2 ]....3.73
[ T043: x := a ]................................................0.00
[ T044: x := {} ]...............................................0.45
[ T045: f0() ]..................................................0.00
[ T046: f1( i ) ]...............................................0.00
[ T047: f2( c[1...8] ) ]........................................0.00
[ T048: f2( c[1...40000] ) ]....................................0.00
[ T049: f2( @c[1...40000] ) ]...................................0.00
[ T050: f2( @c[1...40000] ), c2 := c ]..........................0.00
[ T051: f3( a, a2, s, i, s2, bc, i, n, x ) ]....................0.38
[ T052: f2( a ) ]...............................................0.00
[ T053: x := f4() ].............................................2.80
[ T054: x := f5() ].............................................1.35
[ T055: x := space(16) ]........................................0.99
[ T056: f_prv( c ) ]............................................1.32
====================================================================
[ total application time: ]...................................134.25
[ total real time: ]..........................................139.30
--
[-]
mkdir /nonexistentIndex: include/hbthread.h
===================================================================
--- include/hbthread.h (revision 12490)
+++ include/hbthread.h (working copy)
@@ -62,7 +62,8 @@
defined( HB_OS_DOS )
# define HB_TASK_THREAD
#elif defined( HB_OS_LINUX ) || defined( HB_OS_DARWIN ) || \
- defined( HB_OS_SUNOS ) || defined( HB_OS_HPUX )
+ defined( HB_OS_SUNOS ) || defined( HB_OS_HPUX ) || \
+ defined( HB_OS_HAIKU )
# include <pthread.h>
# define HB_PTHREAD_API
#elif defined( HB_OS_WIN )
Index: include/hbdefs.h
===================================================================
--- include/hbdefs.h (revision 12490)
+++ include/hbdefs.h (working copy)
@@ -78,7 +78,7 @@
( defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || \
( defined( __DJGPP__ ) && \
( __DJGPP__ > 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ >= 4 ) ) ) ||
\
- defined( HB_OS_LINUX ) || defined( HB_OS_DARWIN ) || defined(
HB_OS_SUNOS ) ) )
+ defined( HB_OS_LINUX ) || defined( HB_OS_DARWIN ) || defined(
HB_OS_SUNOS ) || defined( HB_OS_HAIKU ) ) )
#include <stdint.h>
/* workaround for BCC 5.8 bug */
#if ( defined( __BORLANDC__ ) && __BORLANDC__ >= 1410 )
Index: include/hbsetup.h
===================================================================
--- include/hbsetup.h (revision 12490)
+++ include/hbsetup.h (working copy)
@@ -279,12 +279,19 @@
#endif
#endif
+#ifndef HB_OS_HAIKU
+ #if defined( __HAIKU__ )
+ #define HB_OS_HAIKU
+ #endif
+#endif
+
#ifndef HB_OS_UNIX
#if defined( HB_OS_LINUX ) || \
defined( HB_OS_DARWIN ) || \
defined( HB_OS_BSD ) || \
defined( HB_OS_SUNOS ) || \
- defined( HB_OS_HPUX )
+ defined( HB_OS_HPUX ) || \
+ defined( HB_OS_HAIKU )
#define HB_OS_UNIX
/* Compatibility. Do not use this. */
#ifdef HB_LEGACY_LEVEL2
Index: include/hbinit.h
===================================================================
--- include/hbinit.h (revision 12490)
+++ include/hbinit.h (working copy)
@@ -112,7 +112,8 @@
#define HB_CALL_ON_STARTUP_END( func ) \
}
-#elif defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC )
+#elif defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC )
|| \
+ defined( __HAIKU__ )
#if defined( HB_PRAGMA_STARTUP ) || defined( HB_MSC_STARTUP )
#error Wrong macros set for startup code - clean your make/env settings.
Index: source/common/hbprintf.c
===================================================================
--- source/common/hbprintf.c (revision 12490)
+++ source/common/hbprintf.c (working copy)
@@ -160,7 +160,8 @@
( defined( __DJGPP__ ) && \
( __DJGPP__ < 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ <= 3 ) ) ) || \
( defined( _MSC_VER ) && \
- !( defined( __LCC__ ) || defined( __POCC__ ) || defined( __XCC__ ) ) )
+ !( defined( __LCC__ ) || defined( __POCC__ ) || defined( __XCC__ ) ) )
|| \
+ ( defined( __GNUC__ ) && __GNUC__ < 3 )
/* TODO: add other C compilers which does not support [u]intmax_t
* definitions (check C compiler version number).
* If compiler supports stdint.h then it should be added
@@ -283,7 +284,7 @@
# else
# define _x_long_dbl long double
# if defined( __WATCOMC__ ) || defined( __MINGW32CE__ ) || defined(
__CYGWIN__ ) || \
- ( defined( HB_OS_WIN_CE ) && defined( __POCC__ ) )
+ ( defined( HB_OS_WIN_CE ) && defined( __POCC__ ) ) || defined(
__HAIKU__ )
# define _HB_WRAP_MODFL_
# define _MODFD( x, p ) _hb_modfl( x, p )
# else
Index: source/rtl/hbsocket.c
===================================================================
--- source/rtl/hbsocket.c (revision 12490)
+++ source/rtl/hbsocket.c (working copy)
@@ -113,7 +113,7 @@
#if defined( HB_OS_UNIX ) && ! defined( __CYGWIN__ )
# define HB_HAS_UNIX
-# if !defined( __WATCOMC__ )
+# if !defined( __WATCOMC__ ) && !defined( __HAIKU__ )
# define HB_HAS_INET_ATON
# define HB_HAS_INET_PTON
# define HB_HAS_INET_NTOP
@@ -1044,7 +1044,9 @@
uiErr = HB_SOCKET_ERR_PROTOTYPE;
break;
case EOPNOTSUPP:
+#if defined( SOCKTNOSUPPORT )
case ESOCKTNOSUPPORT:
+#endif
uiErr = HB_SOCKET_ERR_NOSUPPORT;
break;
case EMFILE:
@@ -1094,9 +1096,11 @@
case ESHUTDOWN:
uiErr = HB_SOCKET_ERR_SHUTDOWN;
break;
+#if defined( ETOOMANYREFS )
case ETOOMANYREFS:
uiErr = HB_SOCKET_ERR_TOOMANYREFS;
break;
+#endif
case EHOSTDOWN:
uiErr = HB_SOCKET_ERR_HOSTDOWN;
break;
Index: config/haiku/libs.mk
===================================================================
--- config/haiku/libs.mk (revision 0)
+++ config/haiku/libs.mk (revision 0)
@@ -0,0 +1,36 @@
+#
+# $Id: libs.mk 12466 2009-09-10 14:08:51Z vszakats $
+#
+
+SYSLIBS :=
+SYSLIBPATHS := /system/lib /boot/develop/abi/x86/gcc2/lib
+
+ifneq ($(HB_LINKING_RTL),)
+ ifeq ($(HB_CRS_LIB),)
+ HB_CRS_LIB := ncurses
+ endif
+ ifneq ($(HB_HAS_CURSES),)
+ SYSLIBS += $(HB_CRS_LIB)
+ endif
+ ifneq ($(HB_HAS_SLANG),)
+ SYSLIBS += slang
+ endif
+ ifneq ($(HB_HAS_X11),)
+ SYSLIBS += X11
+ # add 64-bit lib dir needed for some distros (red hat)
+ #ifneq ($(findstring 64,$(shell uname -m)),)
+ # SYSLIBPATHS += /usr/X11R6/lib64
+ #endif
+ #SYSLIBPATHS += /usr/X11R6/lib
+ endif
+ ifneq ($(HB_HAS_PCRE),)
+ ifeq ($(HB_HAS_PCRE_LOCAL),)
+ SYSLIBS += pcre
+ endif
+ endif
+ ifeq ($(HB_HAS_ZLIB_LOCAL),)
+ SYSLIBS += z
+ endif
+ SYSLIBS += root socket
+endif
+
Index: config/haiku/gcc.mk
===================================================================
--- config/haiku/gcc.mk (revision 0)
+++ config/haiku/gcc.mk (revision 0)
@@ -0,0 +1,56 @@
+#
+# $Id: gcc.mk 12483 2009-09-12 09:01:27Z vszakats $
+#
+
+ifeq ($(HB_BUILD_MODE),cpp)
+ HB_CMP := g++
+else
+ HB_CMP := gcc
+endif
+
+OBJ_EXT := .o
+LIB_PREF := lib
+LIB_EXT := .a
+
+HB_DYN_COPT := -DHB_DYNLIB -fpic
+
+CC := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX)
+CC_IN := -c
+CC_OUT := -o
+
+CPPFLAGS := -I. -I$(HB_INC_COMPILE)
+CFLAGS :=
+LDFLAGS :=
+
+ifneq ($(HB_BUILD_WARN),no)
+ CFLAGS += -Wall -W
+endif
+
+ifneq ($(HB_BUILD_OPTIM),no)
+ CFLAGS += -O3
+endif
+
+ifeq ($(HB_BUILD_DEBUG),yes)
+ CFLAGS += -g
+endif
+
+LD := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX)
+LD_OUT := -o
+
+LIBPATHS := $(foreach dir,$(LIB_DIR) $(SYSLIBPATHS),-L$(dir))
+LDLIBS := $(foreach lib,$(LIBS) $(SYSLIBS),-l$(lib))
+
+LDFLAGS += $(LIBPATHS)
+
+AR := $(HB_CCPREFIX)ar
+ARFLAGS :=
+AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) rcs $(LIB_DIR)/$@ $(^F) || (
$(RM) $(LIB_DIR)/$@ && false )
+
+DY := $(CC)
+DFLAGS := -shared $(LIBPATHS)
+DY_OUT := -o$(subst x,x, )
+DLIBS := $(foreach lib,$(SYSLIBS),-l$(lib))
+
+DY_RULE = $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS)
+
+include $(TOP)$(ROOT)config/rules.mk
Index: config/haiku/global.mk
===================================================================
--- config/haiku/global.mk (revision 0)
+++ config/haiku/global.mk (revision 0)
@@ -0,0 +1,11 @@
+#
+# $Id: global.mk 12483 2009-09-12 09:01:27Z vszakats $
+#
+
+all : first
+
+BIN_EXT :=
+DYN_EXT := .so
+DYN_PREF := lib
+
+HB_GT_LIBS += gttrm
Index: config/global.mk
===================================================================
--- config/global.mk (revision 12490)
+++ config/global.mk (working copy)
@@ -108,6 +108,8 @@
HB_HOST_PLAT := dos
else ifneq ($(findstring msdos,$(1)),)
HB_HOST_PLAT := dos
+ else ifneq ($(findstring Haiku,$(1)),)
+ HB_HOST_PLAT := haiku
endif
endef
@@ -816,6 +818,12 @@
endif
endif
else
+ ifeq ($(HB_PLATFORM),haiku)
+ HB_COMP_PATH := $(call find_in_path,gcc)
+ ifneq ($(HB_COMP_PATH),)
+ HB_COMPILER := gcc
+ endif
+ endif
# add other platforms here
endif
endif
Index: config/detect.mk
===================================================================
--- config/detect.mk (revision 12490)
+++ config/detect.mk (working copy)
@@ -47,7 +47,7 @@
_DET_VAR_HAS_ := HB_HAS_ZLIB
_DET_FLT_PLAT :=
_DET_FLT_COMP :=
-_DET_INC_DEFP := /usr/include
+_DET_INC_DEFP := /usr/include /boot/develop/headers/3rdparty
_DET_INC_LOCL := $(realpath $(TOP)$(ROOT)external/zlib)
_DET_INC_HEAD := /zlib.h
@@ -118,7 +118,7 @@
_DET_VAR_HAS_ := HB_HAS_CURSES
_DET_FLT_PLAT := !os2
_DET_FLT_COMP :=
-_DET_INC_DEFP :=
+_DET_INC_DEFP := /boot/develop/headers/3rdparty
_DET_INC_HEAD := /curses.h
ifeq ($(HB_NCURSES_194),yes)
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour