Index: build/gyp_v8 |
diff --git a/build/gyp_v8 b/build/gyp_v8 |
index 40c377de61581239d6f0d208171553c54fe6b54d..7874d1444eb639bf7f2ff417ef1e76cfee7ca95c 100755 |
--- a/build/gyp_v8 |
+++ b/build/gyp_v8 |
@@ -36,13 +36,8 @@ import platform |
import shlex |
import sys |
-script_dir = os.path.dirname(__file__) |
-v8_root = os.path.normpath(os.path.join(script_dir, os.pardir)) |
- |
-if __name__ == '__main__': |
- os.chdir(v8_root) |
- script_dir = os.path.dirname(__file__) |
- v8_root = '.' |
+script_dir = os.path.dirname(os.path.realpath(__file__)) |
+v8_root = os.path.abspath(os.path.join(script_dir, os.pardir)) |
sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib')) |
import gyp |
@@ -142,10 +137,7 @@ if __name__ == '__main__': |
# path separators even on Windows due to the use of shlex.split(). |
args.extend(shlex.split(gyp_file)) |
else: |
- # Note that this must not start with "./" or things break. |
- # So we rely on having done os.chdir(v8_root) above and use the |
- # relative path. |
- args.append(os.path.join('build', 'all.gyp')) |
+ args.append(os.path.join(script_dir, 'all.gyp')) |
args.extend(['-I' + i for i in additional_include_files(args)]) |