diff -Naur boost_1_42_0/boost/config/platform/haiku.hpp boost_1_42_0-haiku/boost/config/platform/haiku.hpp --- boost_1_42_0/boost/config/platform/haiku.hpp 1970-01-01 00:00:00.000000000 +0000 +++ boost_1_42_0-haiku/boost/config/platform/haiku.hpp 2010-04-23 02:22:35.100925440 +0000 @@ -0,0 +1,27 @@ +//  (C) Copyright John Maddock 2001. +//  Use, modification and distribution are subject to the +//  Boost Software License, Version 1.0. (See accompanying file +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +//  See http://www.boost.org for most recent version. + +//  Haiku specific config options: + +#define BOOST_PLATFORM "Haiku" + +#define BOOST_NO_INTRINSIC_WCHAR_T +#define BOOST_HAS_UNISTD_H + +#define BOOST_HAS_BETHREADS + +#ifndef BOOST_DISABLE_THREADS +# define BOOST_HAS_THREADS +#endif + +// +// thread API's not auto detected: +// +#define BOOST_HAS_GETTIMEOFDAY + +// boilerplate code: +#include diff -Naur boost_1_42_0/boost/config/select_platform_config.hpp boost_1_42_0-haiku/boost/config/select_platform_config.hpp --- boost_1_42_0/boost/config/select_platform_config.hpp 2009-05-30 11:16:25.057409536 +0000 +++ boost_1_42_0-haiku/boost/config/select_platform_config.hpp 2010-04-23 02:22:24.092798976 +0000 @@ -41,6 +41,10 @@ // win32: # define BOOST_PLATFORM_CONFIG "boost/config/platform/win32.hpp" +#elif defined(__HAIKU__) +// Haiku +# define BOOST_PLATFORM_CONFIG "boost/config/platform/haiku.hpp"  + #elif defined(__BEOS__) // BeOS # define BOOST_PLATFORM_CONFIG "boost/config/platform/beos.hpp" diff -Naur boost_1_42_0/boost/config/stdlib/libstdcpp3.hpp boost_1_42_0-haiku/boost/config/stdlib/libstdcpp3.hpp --- boost_1_42_0/boost/config/stdlib/libstdcpp3.hpp 2009-05-30 11:16:25.057671680 +0000 +++ boost_1_42_0-haiku/boost/config/stdlib/libstdcpp3.hpp 2010-04-23 02:23:34.217841664 +0000 @@ -31,7 +31,7 @@ #ifdef __GLIBCXX__ // gcc 3.4 and greater: # if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \ - || defined(_GLIBCXX__PTHREADS) + || defined(_GLIBCXX__PTHREADS) || defined(__HAIKU__) // // If the std lib has thread support turned on, then turn it on in Boost // as well. We do this because some gcc-3.4 std lib headers define _REENTANT diff -Naur boost_1_42_0/boost/thread/thread_time.hpp boost_1_42_0-haiku/boost/thread/thread_time.hpp --- boost_1_42_0/boost/thread/thread_time.hpp 2008-06-18 13:01:08.030408704 +0000 +++ boost_1_42_0-haiku/boost/thread/thread_time.hpp 2010-04-23 02:24:59.809500672 +0000 @@ -17,6 +17,9 @@ inline system_time get_system_time() { +#ifndef BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK +# error "High precision clock not supported on this platform" +#endif return boost::date_time::microsec_clock::universal_time(); } diff -Naur boost_1_42_0/tools/build/v2/tools/builtin.jam boost_1_42_0-haiku/tools/build/v2/tools/builtin.jam --- boost_1_42_0/tools/build/v2/tools/builtin.jam 2009-10-28 07:47:51.000786432 +0000 +++ boost_1_42_0-haiku/tools/build/v2/tools/builtin.jam 2010-04-23 02:26:20.131596288 +0000 @@ -39,7 +39,7 @@ .os-names = aix bsd cygwin darwin freebsd hpux iphone linux netbsd - openbsd osf qnx qnxnto sgi solaris unix unixware windows + openbsd osf qnx qnxnto sgi solaris unix unixware windows haiku elf # Not actually an OS -- used for targeting bare metal where # object format is ELF. This catches both -elf and -eabi gcc # targets and well as other compilers targeting ELF. It is not @@ -77,6 +77,7 @@ case MACOSX : host-os = darwin ; case KFREEBSD : host-os = freebsd ; case LINUX : host-os = linux ; + case HAIKU : host-os = haiku ; case SUNOS : ECHO "SunOS is not a supported operating system." ; ECHO "We believe last version of SunOS was released in 1992, " ; diff -Naur boost_1_42_0/tools/build/v2/tools/gcc.jam boost_1_42_0-haiku/tools/build/v2/tools/gcc.jam --- boost_1_42_0/tools/build/v2/tools/gcc.jam 2009-10-28 07:47:51.003145728 +0000 +++ boost_1_42_0-haiku/tools/build/v2/tools/gcc.jam 2010-04-23 02:28:40.680001536 +0000 @@ -858,7 +858,7 @@ # Differs from 'link' above only by -shared. actions link.dll bind LIBRARIES { - "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) + "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,"$(RPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -nostart -Wl,-shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS) } rule setup-threading ( targets * : sources * : properties * ) @@ -889,6 +889,10 @@ { # BeOS has no threading options, so do not set anything here. } + case haiku : + { + # pthread. + } case *bsd : { option = -pthread ; diff -Naur boost_1_42_0/tools/jam/src/Jambase boost_1_42_0-haiku/tools/jam/src/Jambase --- boost_1_42_0/tools/jam/src/Jambase 2009-01-10 19:42:28.047185920 +0000 +++ boost_1_42_0-haiku/tools/jam/src/Jambase 2010-04-23 02:31:10.925106176 +0000 @@ -849,6 +849,18 @@ NOARSCAN ?= true ; STDHDRS ?= /boot/develop/headers/posix ; } +else if $(OS) = HAIKU +{ + BINDIR ?= /boot/common/bin ; + CC ?= gcc ; + C++ ?= $(CC) ; + FORTRAN ?= "" ; + LIBDIR ?= /boot/common/lib ; + LINK ?= gcc ; + LINKLIBS ?= -lnetwork ; + NOARSCAN ?= true ; + STDHDRS ?= /boot/develop/headers/posix ; +} else if $(UNIX) { switch $(OS) diff -Naur boost_1_42_0/tools/jam/src/boehm_gc/config.guess boost_1_42_0-haiku/tools/jam/src/boehm_gc/config.guess --- boost_1_42_0/tools/jam/src/boehm_gc/config.guess 2007-08-11 05:53:37.019922944 +0000 +++ boost_1_42_0-haiku/tools/jam/src/boehm_gc/config.guess 2010-04-23 02:33:06.863502336 +0000 @@ -1199,6 +1199,9 @@ BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; diff -Naur boost_1_42_0/tools/jam/src/boehm_gc/include/private/gcconfig.h boost_1_42_0-haiku/tools/jam/src/boehm_gc/include/private/gcconfig.h --- boost_1_42_0/tools/jam/src/boehm_gc/include/private/gcconfig.h 2007-08-11 05:53:37.032243712 +0000 +++ boost_1_42_0-haiku/tools/jam/src/boehm_gc/include/private/gcconfig.h 2010-04-23 02:34:09.906231808 +0000 @@ -215,6 +215,11 @@ # define BEOS # define mach_type_known # endif +# if defined(__HAIKU__) && defined(_X86_) +# define I386 +# define HAIKU +# define mach_type_known +# endif # if defined(LINUX) && (defined(i386) || defined(__i386__)) # define I386 # define mach_type_known @@ -1014,6 +1019,13 @@ extern int etext[]; # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) # endif +# ifdef HAIKU +# define OS_TYPE "HAIKU" +# include +# define GETPAGESIZE() B_PAGE_SIZE + extern int etext[]; +# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) +# endif # ifdef SOLARIS # define OS_TYPE "SOLARIS" extern int _etext[], _end[]; diff -Naur boost_1_42_0/tools/jam/src/fileunix.c boost_1_42_0-haiku/tools/jam/src/fileunix.c --- boost_1_42_0/tools/jam/src/fileunix.c 2009-01-10 19:42:28.045613056 +0000 +++ boost_1_42_0-haiku/tools/jam/src/fileunix.c 2010-04-23 02:34:44.754712576 +0000 @@ -80,6 +80,7 @@ # if defined( OS_QNX ) || \ defined( OS_BEOS ) || \ + defined( OS_HAIKU ) || \ defined( OS_MPEIX ) # define NO_AR # define HAVE_AR diff -Naur boost_1_42_0/tools/jam/src/jam.h boost_1_42_0-haiku/tools/jam/src/jam.h --- boost_1_42_0/tools/jam/src/jam.h 2009-01-10 19:42:28.046923776 +0000 +++ boost_1_42_0-haiku/tools/jam/src/jam.h 2010-04-23 02:35:27.411828224 +0000 @@ -234,6 +234,11 @@ #define OS_BEOS #define NO_VFORK #endif +#ifdef __HAIKU__ + #define unix + #define OSMINOR "OS=HAIKU" + #define OS_HAIKU +#endif #ifdef __bsdi__ #define OSMINOR "OS=BSDI" #define OS_BSDI diff -Naur boost_1_42_0/tools/jam/src/jambase.c boost_1_42_0-haiku/tools/jam/src/jambase.c --- boost_1_42_0/tools/jam/src/jambase.c 2009-01-10 19:42:28.047448064 +0000 +++ boost_1_42_0-haiku/tools/jam/src/jambase.c 2010-04-23 02:36:46.935329792 +0000 @@ -554,6 +554,18 @@ "NOARSCAN ?= true ;\n", "STDHDRS ?= /boot/develop/headers/posix ;\n", "}\n", +"else if $(OS) = HAIKU\n", +"{\n", +"BINDIR ?= /boot/common/bin ;\n", +"CC ?= gcc ;\n", +"C++ ?= $(CC) ;\n", +"FORTRAN ?= \"\" ;\n", +"LIBDIR ?= /boot/common/lib ;\n", +"LINK ?= gcc ;\n", +"LINKLIBS ?= -lnetwork ;\n", +"NOARSCAN ?= true ;\n", +"STDHDRS ?= /boot/develop/headers/posix ;\n", +"}\n", "else if $(UNIX)\n", "{\n", "switch $(OS)\n",