From 2cbdbcd2cc09488045fb25e10cf6ad9fe640db1b Mon Sep 17 00:00:00 2001
From: Kacper Kasper <kacperkasper@gmail.com>
Date: Sun, 21 Apr 2019 00:05:13 +0200
Subject: Haiku support

Original patchset by Calvin Hill <calvin@hakobaito.co.uk>

diff --git a/build/gen.py b/build/gen.py
index 922bf46..8a42fd3 100755
--- a/build/gen.py
+++ b/build/gen.py
@@ -151,15 +151,6 @@ def main(argv):
 
 
 def GenerateLastCommitPosition(host, header):
-  ROOT_TAG = 'initial-commit'
-  describe_output = subprocess.check_output(
-      ['git', 'describe', 'HEAD', '--match', ROOT_TAG], shell=host.is_windows(),
-      cwd=REPO_ROOT)
-  mo = re.match(ROOT_TAG + '-(\d+)-g([0-9a-f]+)', describe_output.decode())
-  if not mo:
-    raise ValueError(
-        'Unexpected output from git describe when generating version header')
-
   contents = '''// Generated by build/gen.py.
 
 #ifndef OUT_LAST_COMMIT_POSITION_H_
@@ -169,7 +160,7 @@ def GenerateLastCommitPosition(host, header):
 #define LAST_COMMIT_POSITION "%s (%s)"
 
 #endif  // OUT_LAST_COMMIT_POSITION_H_
-''' % (mo.group(1), mo.group(1), mo.group(2))
+''' % (999999, 999999, "091169b")
 
   # Only write/touch this file if the commit position has changed.
   old_contents = ''
@@ -363,7 +354,7 @@ def WriteGNNinja(path, platform, host, options):
     cflags.extend([
         '-D_FILE_OFFSET_BITS=64',
         '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS',
-        '-pthread',
+        '-pthread' if not platform.is_haiku() else '',
         '-pipe',
         '-fno-exceptions',
         '-fno-rtti',
-- 
2.30.0

