mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-03 05:28:53 +02:00
127 lines
3.7 KiB
Plaintext
127 lines
3.7 KiB
Plaintext
From 5563d3429087517d2e47d672bdb5c50d005946dc Mon Sep 17 00:00:00 2001
|
|
From: Augustin Cavalier <waddlesplash@gmail.com>
|
|
Date: Sat, 16 Sep 2017 12:25:48 +0200
|
|
Subject: Add minimal Haiku support; based on Adrien's patch.
|
|
|
|
|
|
diff --git a/configure.py b/configure.py
|
|
index 7d8ce90..45d0134 100755
|
|
--- a/configure.py
|
|
+++ b/configure.py
|
|
@@ -56,6 +56,8 @@ class Platform(object):
|
|
self._platform = 'msvc'
|
|
elif self._platform.startswith('bitrig'):
|
|
self._platform = 'bitrig'
|
|
+ elif self._platform.startswith('haiku'):
|
|
+ self._platform = 'haiku'
|
|
elif self._platform.startswith('netbsd'):
|
|
self._platform = 'netbsd'
|
|
elif self._platform.startswith('aix'):
|
|
@@ -69,7 +71,7 @@ class Platform(object):
|
|
def known_platforms():
|
|
return ['linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5',
|
|
'mingw', 'msvc', 'gnukfreebsd', 'bitrig', 'netbsd', 'aix',
|
|
- 'dragonfly']
|
|
+ 'dragonfly', 'haiku']
|
|
|
|
def platform(self):
|
|
return self._platform
|
|
@@ -96,6 +98,9 @@ class Platform(object):
|
|
def is_solaris(self):
|
|
return self._platform == 'solaris'
|
|
|
|
+ def is_haiku(self):
|
|
+ return self._platform == 'is_haiku'
|
|
+
|
|
def is_aix(self):
|
|
return self._platform == 'aix'
|
|
|
|
@@ -472,11 +477,7 @@ if platform.supports_ninja_browse():
|
|
|
|
n.comment('the depfile parser and ninja lexers are generated using re2c.')
|
|
def has_re2c():
|
|
- try:
|
|
- proc = subprocess.Popen(['re2c', '-V'], stdout=subprocess.PIPE)
|
|
- return int(proc.communicate()[0], 10) >= 1103
|
|
- except OSError:
|
|
- return False
|
|
+ return False
|
|
if has_re2c():
|
|
n.rule('re2c',
|
|
command='re2c -b -i --no-generation-date -o $out $in',
|
|
diff --git a/src/util.cc b/src/util.cc
|
|
index 4df2bb2..0f9ef18 100644
|
|
--- a/src/util.cc
|
|
+++ b/src/util.cc
|
|
@@ -496,7 +496,7 @@ int GetProcessorCount() {
|
|
#endif
|
|
}
|
|
|
|
-#if defined(_WIN32) || defined(__CYGWIN__)
|
|
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(__HAIKU__)
|
|
static double CalculateProcessorLoad(uint64_t idle_ticks, uint64_t total_ticks)
|
|
{
|
|
static uint64_t previous_idle_ticks = 0;
|
|
--
|
|
2.24.0
|
|
|
|
|
|
From a8a897283f2cd96772714274947ede90e1100ae5 Mon Sep 17 00:00:00 2001
|
|
From: Michael Lotz <mmlr@mlotz.ch>
|
|
Date: Sat, 16 Sep 2017 12:27:48 +0200
|
|
Subject: Add include of sys/select.h to get FD_* definitions.
|
|
|
|
Apparently these are pulled in by one of the already present headers
|
|
on other platforms. A cursory look at the POSIX specs did not reveal
|
|
a requirement to expose these types with the given headers though.
|
|
|
|
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
|
|
index fc5543e..6fc9944 100644
|
|
--- a/src/subprocess-posix.cc
|
|
+++ b/src/subprocess-posix.cc
|
|
@@ -22,6 +22,7 @@
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
+#include <sys/select.h>
|
|
#include <sys/wait.h>
|
|
#include <spawn.h>
|
|
|
|
--
|
|
2.24.0
|
|
|
|
|
|
From a39e384e883055f1e8157ca7abfe993e8c06d7e2 Mon Sep 17 00:00:00 2001
|
|
From: Jerome Duval <jerome.duval@gmail.com>
|
|
Date: Sat, 16 Sep 2017 12:48:42 +0200
|
|
Subject: GetLoadAvg to be implemented for Haiku
|
|
|
|
|
|
diff --git a/src/util.cc b/src/util.cc
|
|
index 0f9ef18..0309516 100644
|
|
--- a/src/util.cc
|
|
+++ b/src/util.cc
|
|
@@ -496,7 +496,7 @@ int GetProcessorCount() {
|
|
#endif
|
|
}
|
|
|
|
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(__HAIKU__)
|
|
+#if defined(_WIN32) || defined(__CYGWIN__)
|
|
static double CalculateProcessorLoad(uint64_t idle_ticks, uint64_t total_ticks)
|
|
{
|
|
static uint64_t previous_idle_ticks = 0;
|
|
@@ -583,6 +583,10 @@ double GetLoadAverage() {
|
|
return -0.0f;
|
|
return 1.0 / (1 << SI_LOAD_SHIFT) * si.loads[0];
|
|
}
|
|
+#elif defined(__HAIKU__)
|
|
+double GetLoadAverage() {
|
|
+ return -0.0f;
|
|
+}
|
|
#else
|
|
double GetLoadAverage() {
|
|
double loadavg[3] = { 0.0f, 0.0f, 0.0f };
|
|
--
|
|
2.24.0
|
|
|