mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
ninja: bump version, switch to python3
This commit is contained in:
@@ -11,7 +11,7 @@ COPYRIGHT="2012-2019 Google Inc."
|
||||
LICENSE="Apache v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/ninja-build/ninja/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="3810318b08489435f8efc19c05525e80a993af5a55baa0dfeae0465a9d45f99f"
|
||||
CHECKSUM_SHA256="ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed"
|
||||
PATCHES="ninja-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
@@ -33,12 +33,12 @@ BUILD_PREREQUIRES="
|
||||
cmd:as$secondaryArchSuffix
|
||||
cmd:g++$secondaryArchSuffix
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:python2
|
||||
cmd:python3
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
python2 ./configure.py --bootstrap
|
||||
python3 ./configure.py --bootstrap
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
@@ -49,6 +49,6 @@ INSTALL()
|
||||
|
||||
TEST()
|
||||
{
|
||||
python2 ./configure.py
|
||||
python3 ./configure.py
|
||||
./ninja ninja_test
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
SUMMARY="A small build system similar to make"
|
||||
DESCRIPTION="Ninja is a small build system with a focus on speed. It differs \
|
||||
from other build systems in two major respects: it is designed to have its \
|
||||
input files generated by a higher-level build system, and it is designed to \
|
||||
run builds as fast as possible.
|
||||
Ninja's low-level approach makes it perfect for embedding into more featureful \
|
||||
build systems. Via gyp it can build Chrome and v8 and node.js etc.; via CMake \
|
||||
it can build LLVM, KDE, Blender, etc."
|
||||
HOMEPAGE="https://ninja-build.org/"
|
||||
COPYRIGHT="2014 Google Inc."
|
||||
LICENSE="Apache v2"
|
||||
REVISION="4"
|
||||
SOURCE_URI="https://github.com/ninja-build/ninja/archive/v1.5.1.tar.gz"
|
||||
CHECKSUM_SHA256="fba77b9ed4b4dd0e86c4513776938dc64bd4508dc2055b04c0c6df68bcfa397d"
|
||||
PATCHES="ninja-1.5.1.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
ninja$secondaryArchSuffix = $portVersion
|
||||
cmd:ninja = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_PREREQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
haiku_devel
|
||||
cmd:as$secondaryArchSuffix
|
||||
cmd:g++$secondaryArchSuffix
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:python
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
python ./bootstrap.py
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $prefix/bin
|
||||
cp ninja $prefix/bin
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
SUMMARY="A small build system similar to make"
|
||||
DESCRIPTION="Ninja is a small build system with a focus on speed. It differs \
|
||||
from other build systems in two major respects: it is designed to have its \
|
||||
input files generated by a higher-level build system, and it is designed to \
|
||||
run builds as fast as possible.
|
||||
Ninja's low-level approach makes it perfect for embedding into more featureful \
|
||||
build systems. Via gyp it can build Chrome and v8 and node.js etc.; via CMake \
|
||||
it can build LLVM, KDE, Blender, etc."
|
||||
HOMEPAGE="https://ninja-build.org/"
|
||||
COPYRIGHT="2014 Google Inc."
|
||||
LICENSE="Apache v2"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://github.com/ninja-build/ninja/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="b43e88fb068fe4d92a3dfd9eb4d19755dae5c33415db2e9b7b61b4659009cde7"
|
||||
PATCHES="ninja-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
|
||||
PROVIDES="
|
||||
ninja$secondaryArchSuffix = $portVersion
|
||||
cmd:ninja = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_PREREQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
haiku_devel
|
||||
cmd:as$secondaryArchSuffix
|
||||
cmd:g++$secondaryArchSuffix
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:python2
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
python2 ./configure.py --bootstrap
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $prefix/bin
|
||||
cp ninja $prefix/bin
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
SUMMARY="A small build system similar to make"
|
||||
DESCRIPTION="Ninja is a small build system with a focus on speed. It differs \
|
||||
from other build systems in two major respects: it is designed to have its \
|
||||
input files generated by a higher-level build system, and it is designed to \
|
||||
run builds as fast as possible.
|
||||
Ninja's low-level approach makes it perfect for embedding into more featureful \
|
||||
build systems. Via gyp it can build Chrome and v8 and node.js etc.; via CMake \
|
||||
it can build LLVM, KDE, Blender, etc."
|
||||
HOMEPAGE="https://ninja-build.org/"
|
||||
COPYRIGHT="2012-2017 Google Inc."
|
||||
LICENSE="Apache v2"
|
||||
REVISION="3"
|
||||
SOURCE_URI="https://github.com/ninja-build/ninja/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="86b8700c3d0880c2b44c2ff67ce42774aaf8c28cbf57725cb881569288c1c6f4"
|
||||
PATCHES="ninja-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
ninja$secondaryArchSuffix = $portVersion
|
||||
cmd:ninja = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel >= r1~alpha4_pm_hrev51418-1
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
haiku_devel
|
||||
cmd:as$secondaryArchSuffix
|
||||
cmd:g++$secondaryArchSuffix
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:python2
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
python2 ./configure.py --bootstrap
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $prefix/bin
|
||||
cp ninja $prefix/bin
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
From c7705cf4c57cfde854547a12ad380ef6b02a81ef Mon Sep 17 00:00:00 2001
|
||||
From: Augustin Cavalier <waddlesplash@gmail.com>
|
||||
Date: Tue, 15 Jul 2014 10:39:30 -0400
|
||||
Subject: [PATCH] Add minimal Haiku support; based on Adrien's patch.
|
||||
|
||||
---
|
||||
configure.py | 7 +------
|
||||
platform_helper.py | 7 ++++++-
|
||||
src/util.cc | 2 +-
|
||||
3 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 64123a0..d49a77d 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -247,12 +247,7 @@ if not platform.is_windows() and not platform.is_solaris():
|
||||
|
||||
n.comment('the depfile parser and ninja lexers are generated using re2c.')
|
||||
def has_re2c():
|
||||
- import subprocess
|
||||
- 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/platform_helper.py b/platform_helper.py
|
||||
index bc3a125..efc0887 100644
|
||||
--- a/platform_helper.py
|
||||
+++ b/platform_helper.py
|
||||
@@ -19,7 +19,7 @@ import sys
|
||||
|
||||
def platforms():
|
||||
return ['linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5',
|
||||
- 'mingw', 'msvc', 'gnukfreebsd', 'bitrig']
|
||||
+ 'mingw', 'msvc', 'gnukfreebsd8', 'bitrig', 'haiku']
|
||||
|
||||
class Platform(object):
|
||||
def __init__(self, platform):
|
||||
@@ -43,6 +43,8 @@ class Platform(object):
|
||||
self._platform = 'msvc'
|
||||
elif self._platform.startswith('bitrig'):
|
||||
self._platform = 'bitrig'
|
||||
+ elif self._platform.startswith('haiku'):
|
||||
+ self._platform = 'haiku'
|
||||
|
||||
def platform(self):
|
||||
return self._platform
|
||||
@@ -81,3 +83,6 @@ class Platform(object):
|
||||
|
||||
def is_bitrig(self):
|
||||
return self._platform == 'bitrig'
|
||||
+
|
||||
+ def is_haiku(self):
|
||||
+ return self._platform == 'haiku'
|
||||
diff --git a/src/util.cc b/src/util.cc
|
||||
index 484b0c1..dae7e3f 100644
|
||||
--- a/src/util.cc
|
||||
+++ b/src/util.cc
|
||||
@@ -414,7 +414,7 @@ int GetProcessorCount() {
|
||||
#endif
|
||||
}
|
||||
|
||||
-#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(__HAIKU__)
|
||||
double GetLoadAverage() {
|
||||
// TODO(nicolas.despres@gmail.com): Find a way to implement it on Windows.
|
||||
// Remember to also update Usage() when this is fixed.
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
From e0d5d39bcd89d6f8346a0242931cff1c363d8392 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Lotz <mmlr@mlotz.ch>
|
||||
Date: Sat, 19 Dec 2015 23:30:47 +0000
|
||||
Subject: [PATCH] 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.
|
||||
---
|
||||
src/subprocess-posix.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
|
||||
index 743e406..5c17d75 100644
|
||||
--- a/src/subprocess-posix.cc
|
||||
+++ b/src/subprocess-posix.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
+#include <sys/select.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include "util.h"
|
||||
--
|
||||
2.2.2
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
From d7d59de2f79e0ce06043f56c29d0202569b88e62 Mon Sep 17 00:00:00 2001
|
||||
From: Augustin Cavalier <waddlesplash@gmail.com>
|
||||
Date: Tue, 15 Jul 2014 10:39:30 -0400
|
||||
Subject: Add minimal Haiku support; based on Adrien's patch.
|
||||
|
||||
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 2eacbfe..97919db 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -55,13 +55,15 @@ 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'
|
||||
|
||||
@staticmethod
|
||||
def known_platforms():
|
||||
return ['linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5',
|
||||
- 'mingw', 'msvc', 'gnukfreebsd', 'bitrig', 'netbsd']
|
||||
+ 'mingw', 'msvc', 'gnukfreebsd', 'bitrig', 'netbsd', 'haiku']
|
||||
|
||||
def platform(self):
|
||||
return self._platform
|
||||
@@ -88,6 +90,9 @@ class Platform(object):
|
||||
def is_solaris(self):
|
||||
return self._platform == 'solaris'
|
||||
|
||||
+ def is_haiku(self):
|
||||
+ return self._platform == 'is_haiku'
|
||||
+
|
||||
def uses_usr_local(self):
|
||||
return self._platform in ('freebsd', 'openbsd', 'bitrig')
|
||||
|
||||
@@ -427,11 +432,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 aa47f2f..3308025 100644
|
||||
--- a/src/util.cc
|
||||
+++ b/src/util.cc
|
||||
@@ -507,7 +507,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.11.0
|
||||
|
||||
|
||||
From 364a8621f81fdab928ea41791463ed66787b7e4f Mon Sep 17 00:00:00 2001
|
||||
From: Michael Lotz <mmlr@mlotz.ch>
|
||||
Date: Sat, 19 Dec 2015 23:30:47 +0000
|
||||
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 f3baec2..6b27d7e 100644
|
||||
--- a/src/subprocess-posix.cc
|
||||
+++ b/src/subprocess-posix.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
+#include <sys/select.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include "util.h"
|
||||
--
|
||||
2.11.0
|
||||
|
||||
|
||||
From 5ec9e60993a9c93634371aa06fcae454fa364ce6 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Sun, 16 Apr 2017 13:39:04 +0200
|
||||
Subject: GetLoadAvg to be implemented for Haiku
|
||||
|
||||
|
||||
diff --git a/src/util.cc b/src/util.cc
|
||||
index 3308025..bc9739c 100644
|
||||
--- a/src/util.cc
|
||||
+++ b/src/util.cc
|
||||
@@ -507,7 +507,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;
|
||||
@@ -573,6 +573,10 @@ double GetLoadAverage() {
|
||||
|
||||
return posix_compatible_load;
|
||||
}
|
||||
+#elif defined(__HAIKU__)
|
||||
+double GetLoadAverage() {
|
||||
+ return -0.0f;
|
||||
+}
|
||||
#else
|
||||
double GetLoadAverage() {
|
||||
double loadavg[3] = { 0.0f, 0.0f, 0.0f };
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
From be68eec712437089c9147ba485cadf5c2daec250 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 a443748..42489e7 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'):
|
||||
@@ -67,7 +69,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
|
||||
@@ -94,6 +96,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'
|
||||
|
||||
@@ -458,11 +463,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 ae94d34..8af4b86 100644
|
||||
--- a/src/util.cc
|
||||
+++ b/src/util.cc
|
||||
@@ -480,7 +480,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.14.2
|
||||
|
||||
|
||||
From f8d8e1ca23dd5162f3b1cda42a574fc4b8ac0712 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 1de22c3..f77c559 100644
|
||||
--- a/src/subprocess-posix.cc
|
||||
+++ b/src/subprocess-posix.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
+#include <sys/select.h>
|
||||
#include <sys/wait.h>
|
||||
#include <spawn.h>
|
||||
|
||||
--
|
||||
2.14.2
|
||||
|
||||
|
||||
From 28928297b7ee4e90ef9addb596149a0f9c2211c1 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 8af4b86..1de47b8 100644
|
||||
--- a/src/util.cc
|
||||
+++ b/src/util.cc
|
||||
@@ -480,7 +480,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;
|
||||
@@ -563,6 +563,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.14.2
|
||||
|
||||
|
||||
From b19f7582445dd8f5ab550844bcbbace751776589 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Tue, 31 Oct 2017 21:37:20 +0100
|
||||
Subject: posix_spawn_* calls don't set errno.
|
||||
|
||||
|
||||
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
|
||||
index f77c559..5b34a36 100644
|
||||
--- a/src/subprocess-posix.cc
|
||||
+++ b/src/subprocess-posix.cc
|
||||
@@ -55,21 +55,25 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
|
||||
SetCloseOnExec(fd_);
|
||||
|
||||
posix_spawn_file_actions_t action;
|
||||
- if (posix_spawn_file_actions_init(&action) != 0)
|
||||
- Fatal("posix_spawn_file_actions_init: %s", strerror(errno));
|
||||
+ int err = posix_spawn_file_actions_init(&action);
|
||||
+ if (err != 0)
|
||||
+ Fatal("posix_spawn_file_actions_init: %s", strerror(err));
|
||||
|
||||
- if (posix_spawn_file_actions_addclose(&action, output_pipe[0]) != 0)
|
||||
- Fatal("posix_spawn_file_actions_addclose: %s", strerror(errno));
|
||||
+ err = posix_spawn_file_actions_addclose(&action, output_pipe[0]);
|
||||
+ if (err != 0)
|
||||
+ Fatal("posix_spawn_file_actions_addclose: %s", strerror(err));
|
||||
|
||||
posix_spawnattr_t attr;
|
||||
- if (posix_spawnattr_init(&attr) != 0)
|
||||
- Fatal("posix_spawnattr_init: %s", strerror(errno));
|
||||
+ err = posix_spawnattr_init(&attr);
|
||||
+ if (err != 0)
|
||||
+ Fatal("posix_spawnattr_init: %s", strerror(err));
|
||||
|
||||
short flags = 0;
|
||||
|
||||
flags |= POSIX_SPAWN_SETSIGMASK;
|
||||
- if (posix_spawnattr_setsigmask(&attr, &set->old_mask_) != 0)
|
||||
- Fatal("posix_spawnattr_setsigmask: %s", strerror(errno));
|
||||
+ err = posix_spawnattr_setsigmask(&attr, &set->old_mask_);
|
||||
+ if (err != 0)
|
||||
+ Fatal("posix_spawnattr_setsigmask: %s", strerror(err));
|
||||
// Signals which are set to be caught in the calling process image are set to
|
||||
// default action in the new process image, so no explicit
|
||||
// POSIX_SPAWN_SETSIGDEF parameter is needed.
|
||||
@@ -80,17 +84,21 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
|
||||
// No need to posix_spawnattr_setpgroup(&attr, 0), it's the default.
|
||||
|
||||
// Open /dev/null over stdin.
|
||||
- if (posix_spawn_file_actions_addopen(&action, 0, "/dev/null", O_RDONLY,
|
||||
- 0) != 0) {
|
||||
- Fatal("posix_spawn_file_actions_addopen: %s", strerror(errno));
|
||||
+ err = posix_spawn_file_actions_addopen(&action, 0, "/dev/null", O_RDONLY,
|
||||
+ 0);
|
||||
+ if (err != 0) {
|
||||
+ Fatal("posix_spawn_file_actions_addopen: %s", strerror(err));
|
||||
}
|
||||
|
||||
- if (posix_spawn_file_actions_adddup2(&action, output_pipe[1], 1) != 0)
|
||||
- Fatal("posix_spawn_file_actions_adddup2: %s", strerror(errno));
|
||||
- if (posix_spawn_file_actions_adddup2(&action, output_pipe[1], 2) != 0)
|
||||
- Fatal("posix_spawn_file_actions_adddup2: %s", strerror(errno));
|
||||
- if (posix_spawn_file_actions_addclose(&action, output_pipe[1]) != 0)
|
||||
- Fatal("posix_spawn_file_actions_addclose: %s", strerror(errno));
|
||||
+ err = posix_spawn_file_actions_adddup2(&action, output_pipe[1], 1);
|
||||
+ if (err != 0)
|
||||
+ Fatal("posix_spawn_file_actions_adddup2: %s", strerror(err));
|
||||
+ err = posix_spawn_file_actions_adddup2(&action, output_pipe[1], 2);
|
||||
+ if (err != 0)
|
||||
+ Fatal("posix_spawn_file_actions_adddup2: %s", strerror(err));
|
||||
+ err = posix_spawn_file_actions_addclose(&action, output_pipe[1]);
|
||||
+ if (err != 0)
|
||||
+ Fatal("posix_spawn_file_actions_addclose: %s", strerror(err));
|
||||
// In the console case, output_pipe is still inherited by the child and
|
||||
// closed when the subprocess finishes, which then notifies ninja.
|
||||
}
|
||||
@@ -98,8 +106,9 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
|
||||
flags |= POSIX_SPAWN_USEVFORK;
|
||||
#endif
|
||||
|
||||
- if (posix_spawnattr_setflags(&attr, flags) != 0)
|
||||
- Fatal("posix_spawnattr_setflags: %s", strerror(errno));
|
||||
+ err = posix_spawnattr_setflags(&attr, flags);
|
||||
+ if (err != 0)
|
||||
+ Fatal("posix_spawnattr_setflags: %s", strerror(err));
|
||||
|
||||
const char* spawned_args[] = { "/bin/sh", "-c", command.c_str(), NULL };
|
||||
if (posix_spawn(&pid_, "/bin/sh", &action, &attr,
|
||||
--
|
||||
2.14.2
|
||||
|
||||
Reference in New Issue
Block a user