From 25ff81a340074252eaf14b2c4aaa0ca1370559a7 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Fri, 24 Apr 2015 22:27:01 +0200
Subject: Build fixes for Haiku.


diff --git a/src/BeOS/Makefile b/src/BeOS/Makefile
index 7dff629..d33e0ba 100644
--- a/src/BeOS/Makefile
+++ b/src/BeOS/Makefile
@@ -33,7 +33,7 @@ TYPE= APP
 MACHINE=$(shell uname -m)
 ifeq ($(MACHINE), BePC)
 	CPUSRCS = ../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp \
-	    ../uae_cpu/readcpu.cpp ../uae_cpu/fpu/fpu_x86.cpp cpustbl.cpp cpudefs.cpp cpufast.s
+	    ../uae_cpu/readcpu.cpp ../uae_cpu/fpu/fpu_uae.cpp cpustbl.cpp cpudefs.cpp cpufast.s
 else
 #	CPUSRCS = ../powerrom_cpu/powerrom_cpu.cpp
 	CPUSRCS = ../uae_cpu/basilisk_glue.cpp ../uae_cpu/newcpu.cpp \
@@ -123,7 +123,7 @@ LINKER_FLAGS =
 
 
 ## include the makefile-engine
-include /boot/develop/etc/makefile-engine
+include /boot/system/develop/etc/makefile-engine
 
 
 #	special handling of UAE CPU engine
diff --git a/src/BeOS/prefs_editor_beos.cpp b/src/BeOS/prefs_editor_beos.cpp
index 5c8c808..87c3d0c 100644
--- a/src/BeOS/prefs_editor_beos.cpp
+++ b/src/BeOS/prefs_editor_beos.cpp
@@ -604,17 +604,15 @@ void PrefsWindow::add_serial_names(BPopUpMenu *menu, uint32 msg)
 		port->GetDeviceName(i, name);
 		menu->AddItem(new BMenuItem(name, new BMessage(msg)));
 	}
-	if (sys_info.platform_type == B_BEBOX_PLATFORM) {
-		BDirectory dir;
-		BEntry entry;
-		dir.SetTo("/dev/parallel");
-		if (dir.InitCheck() == B_NO_ERROR) {
-			dir.Rewind();
-			while (dir.GetNextEntry(&entry) >= 0) {
-				if (!entry.IsDirectory()) {
-					entry.GetName(name);
-					menu->AddItem(new BMenuItem(name, new BMessage(msg)));
-				}
+	BDirectory dir;
+	BEntry entry;
+	dir.SetTo("/dev/parallel");
+	if (dir.InitCheck() == B_NO_ERROR) {
+		dir.Rewind();
+		while (dir.GetNextEntry(&entry) >= 0) {
+			if (!entry.IsDirectory()) {
+				entry.GetName(name);
+				menu->AddItem(new BMenuItem(name, new BMessage(msg)));
 			}
 		}
 	}
diff --git a/src/BeOS/scsi_beos.cpp b/src/BeOS/scsi_beos.cpp
index 326621f..c1812b4 100644
--- a/src/BeOS/scsi_beos.cpp
+++ b/src/BeOS/scsi_beos.cpp
@@ -23,7 +23,11 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <device/scsi.h>
+#ifdef __HAIKU__
+#include <CAM.h>
+#else
 #include <drivers/CAM.h>
+#endif
 
 #include "sysdeps.h"
 #include "main.h"
diff --git a/src/BeOS/sys_beos.cpp b/src/BeOS/sys_beos.cpp
index 5c675a7..86c4405 100644
--- a/src/BeOS/sys_beos.cpp
+++ b/src/BeOS/sys_beos.cpp
@@ -40,6 +40,11 @@
 #define DEBUG 0
 #include "debug.h"
 
+#ifdef __HAIKU__
+#include <fs_volume.h>
+#define unmount(x) fs_unmount_volume(x, 0)
+#endif
+
 
 // File handles are pointers to these structures
 struct file_handle {
@@ -284,6 +289,10 @@ void SysAddCDROMPrefs(void)
 
 void SysAddSerialPrefs(void)
 {
+#ifdef __HAIKU__
+	PrefsAddString("seriala", "serial1");
+	PrefsAddString("serialb", "serial2");
+#else
 	system_info info;
 	get_system_info(&info);
 	switch (info.platform_type) {
@@ -301,6 +310,7 @@ void SysAddSerialPrefs(void)
 			PrefsAddString("serialb", "none");
 			break;
 	}
+#endif
 }
 
 
-- 
2.2.2

