aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--tools/shared.py9
2 files changed, 9 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index 4e425b53..7b60799b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -11,3 +11,4 @@ under the licensing terms detailed in LICENSE.
* Ben Schwartz <bens@alum.mit.edu>
* David Claughton <dave@eclecticdave.com>
* David Yip <yipdw@member.fsf.org>
+* Julien Hamaide <julien.hamaide@gmail.com>
diff --git a/tools/shared.py b/tools/shared.py
index 970edc67..294f15ee 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -666,5 +666,12 @@ class Building:
return False
# look for magic signature
b = open(filename, 'r').read(4)
- return b[0] == 'B' and b[1] == 'C'
+ if b[0] == 'B' and b[1] == 'C':
+ return True
+ # on OS X, there is a 20-byte prefix
+ elif ord(b[0]) == 222 and ord(b[1]) == 192 and ord(b[2]) == 23 and ord(b[3]) == 11:
+ b = open(filename, 'r').read(24)
+ return b[20] == 'B' and b[21] == 'C'
+
+ return False