From f2f840dae93844a5edfed4830ebf41511e1e05bf Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 30 Sep 2017 13:03:23 +0000
Subject: Hack in Haiku support


diff --git a/src/engine/Jambase b/src/engine/Jambase
index a736e26..7b0ab8b 100644
--- a/src/engine/Jambase
+++ b/src/engine/Jambase
@@ -51,7 +51,7 @@ BOOST_BUILD_PATH.user-value = $(BOOST_BUILD_PATH) ;
 # Policy.
 if ! $(BOOST_BUILD_PATH) && $(UNIX)
 {
-    BOOST_BUILD_PATH = /usr/share/boost-build ;
+    BOOST_BUILD_PATH = /system/data/boost-build ;
 }
 
 
diff --git a/src/engine/build.jam b/src/engine/build.jam
index 842296a..96c30cf 100644
--- a/src/engine/build.jam
+++ b/src/engine/build.jam
@@ -220,7 +220,7 @@ toolset gcc gcc : "-o " : -D
     [ opt --debug : -g -O0 -fno-inline ]
     [ opt --profile : -O3 -g -pg ]
     -I$(--python-include) -I$(--extra-include) -Wno-long-long
-    : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
+    : -L$(--python-lib[1]) -l$(--python-lib[2]) -lbsd ;
 ## GCC 2.x, 3.x on CYGWIN but without cygwin1.dll
 toolset gcc-nocygwin gcc : "-o " : -D
     : -s -O3 -mno-cygwin
diff --git a/src/engine/build.sh b/src/engine/build.sh
index 1d0dcc8..cb74e62 100755
--- a/src/engine/build.sh
+++ b/src/engine/build.sh
@@ -148,6 +148,13 @@ case $BOOST_JAM_TOOLSET in
         BOOST_JAM_OS="NT"
         ;;
 
+	*haiku*)
+        BOOST_JAM_CC=gcc
+    	BOOST_JAM_OPT_JAM="$BOOST_JAM_OPT_JAM $CFLAGS -lbsd"
+	BOOST_JAM_OPT_MKJAMBASE="$BOOST_JAM_OPT_MKJAMBASE $CFLAGS -lbsd"
+	BOOST_JAM_OPT_YYACC="$BOOST_JAM_OPT_YYACC $CFLAGS -lbsd"
+	;;
+
         *)
         BOOST_JAM_CC=gcc
         esac
diff --git a/src/engine/jambase.c b/src/engine/jambase.c
index 80a7e12..e7da28f 100644
--- a/src/engine/jambase.c
+++ b/src/engine/jambase.c
@@ -21,7 +21,7 @@ char *jambase[] = {
 "BOOST_BUILD_PATH.user-value = $(BOOST_BUILD_PATH) ;\n",
 "if ! $(BOOST_BUILD_PATH) && $(UNIX)\n",
 "{\n",
-"BOOST_BUILD_PATH = /usr/share/boost-build ;\n",
+"BOOST_BUILD_PATH = /system/data/boost-build ;\n",
 "}\n",
 "rule _poke ( module-name ? : variables + : value * )\n",
 "{\n",
-- 
2.7.0

