@@ -35,21 +35,23 @@ import subprocess
35
35
import shutil
36
36
import string
37
37
38
+ # If not run from node/, cd to node/.
39
+ os.chdir(os.path.dirname(__file__) or ' .' )
40
+
38
41
# gcc and g++ as defaults matches what GYP's Makefile generator does,
39
42
# except on OS X.
40
43
CC = os.environ.get(' CC' , ' cc' if sys.platform == ' darwin' else ' gcc' )
41
44
CXX = os.environ.get(' CXX' , ' c++' if sys.platform == ' darwin' else ' g++' )
42
45
43
- root_dir = os.path.dirname(__file__)
44
- sys.path.insert(0, os.path.join(root_dir, ' tools' , ' gyp' , ' pylib' ))
46
+ sys.path.insert(0, os.path.join(' tools' , ' gyp' , ' pylib' ))
45
47
from gyp.common import GetFlavor
46
48
47
49
# imports in tools/configure.d
48
- sys.path.insert(0, os.path.join(root_dir, ' tools' , ' configure.d' ))
50
+ sys.path.insert(0, os.path.join(' tools' , ' configure.d' ))
49
51
import nodedownload
50
52
51
53
# imports in tools/
52
- sys.path.insert(0, os.path.join(root_dir, ' tools' ) )
54
+ sys.path.insert(0, ' tools' )
53
55
import getmoduleversion
54
56
from gyp_node import run_gyp
55
57
@@ -432,7 +434,7 @@ intl_optgroup.add_option('--download',
432
434
intl_optgroup.add_option(' --download-path' ,
433
435
action=' store' ,
434
436
dest=' download_path' ,
435
- default=os.path.join(root_dir, ' deps' ) ,
437
+ default=' deps' ,
436
438
help=' Download directory [default: %default]' )
437
439
438
440
parser.add_option_group(intl_optgroup)
@@ -1050,7 +1052,7 @@ def configure_openssl(o):
1050
1052
o[' defines' ] += [' NODE_WITHOUT_NODE_OPTIONS' ]
1051
1053
if options.openssl_fips:
1052
1054
o[' variables' ][' openssl_fips' ] = options.openssl_fips
1053
- fips_dir = os.path.join(root_dir, ' deps' , ' openssl' , ' fips' )
1055
+ fips_dir = os.path.join(' deps' , ' openssl' , ' fips' )
1054
1056
fips_ld = os.path.abspath(os.path.join(fips_dir, ' fipsld' ))
1055
1057
# LINK is for Makefiles, LD/LDXX is for ninja
1056
1058
o[' make_fips_settings' ] = [
@@ -1095,7 +1097,7 @@ def configure_static(o):
1095
1097
1096
1098
1097
1099
def write(filename, data):
1098
- filename = os.path.join(root_dir, filename)
1100
+ filename = filename
1099
1101
print(' creating %s' % filename)
1100
1102
f = open(filename, ' w+' )
1101
1103
f.write(data)
@@ -1217,7 +1219,7 @@ def configure_intl(o):
1217
1219
return
1218
1220
1219
1221
# this is just the 'deps' dir. Used for unpacking.
1220
- icu_parent_path = os.path.join(root_dir, ' deps' )
1222
+ icu_parent_path = ' deps'
1221
1223
1222
1224
# The full path to the ICU source directory. Should not include './'.
1223
1225
icu_full_path = ' deps/icu'
0 commit comments