@@ -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
@@ -426,7 +428,7 @@ intl_optgroup.add_option('--download',
426
428
intl_optgroup.add_option(' --download-path' ,
427
429
action=' store' ,
428
430
dest=' download_path' ,
429
- default=os.path.join(root_dir, ' deps' ) ,
431
+ default=' deps' ,
430
432
help=' Download directory [default: %default]' )
431
433
432
434
parser.add_option_group(intl_optgroup)
@@ -1038,7 +1040,7 @@ def configure_openssl(o):
1038
1040
o[' defines' ] += [' NODE_WITHOUT_NODE_OPTIONS' ]
1039
1041
if options.openssl_fips:
1040
1042
o[' variables' ][' openssl_fips' ] = options.openssl_fips
1041
- fips_dir = os.path.join(root_dir, ' deps' , ' openssl' , ' fips' )
1043
+ fips_dir = os.path.join(' deps' , ' openssl' , ' fips' )
1042
1044
fips_ld = os.path.abspath(os.path.join(fips_dir, ' fipsld' ))
1043
1045
# LINK is for Makefiles, LD/LDXX is for ninja
1044
1046
o[' make_fips_settings' ] = [
@@ -1083,7 +1085,7 @@ def configure_static(o):
1083
1085
1084
1086
1085
1087
def write(filename, data):
1086
- filename = os.path.join(root_dir, filename)
1088
+ filename = filename
1087
1089
print(' creating %s' % filename)
1088
1090
f = open(filename, ' w+' )
1089
1091
f.write(data)
@@ -1205,7 +1207,7 @@ def configure_intl(o):
1205
1207
return
1206
1208
1207
1209
# this is just the 'deps' dir. Used for unpacking.
1208
- icu_parent_path = os.path.join(root_dir, ' deps' )
1210
+ icu_parent_path = ' deps'
1209
1211
1210
1212
# The full path to the ICU source directory. Should not include './'.
1211
1213
icu_full_path = ' deps/icu'
0 commit comments