@@ -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)
@@ -1046,7 +1048,7 @@ def configure_openssl(o):
1046
1048
o[' defines' ] += [' NODE_WITHOUT_NODE_OPTIONS' ]
1047
1049
if options.openssl_fips:
1048
1050
o[' variables' ][' openssl_fips' ] = options.openssl_fips
1049
- fips_dir = os.path.join(root_dir, ' deps' , ' openssl' , ' fips' )
1051
+ fips_dir = os.path.join(' deps' , ' openssl' , ' fips' )
1050
1052
fips_ld = os.path.abspath(os.path.join(fips_dir, ' fipsld' ))
1051
1053
# LINK is for Makefiles, LD/LDXX is for ninja
1052
1054
o[' make_fips_settings' ] = [
@@ -1091,7 +1093,7 @@ def configure_static(o):
1091
1093
1092
1094
1093
1095
def write(filename, data):
1094
- filename = os.path.join(root_dir, filename)
1096
+ filename = filename
1095
1097
print(' creating %s' % filename)
1096
1098
f = open(filename, ' w+' )
1097
1099
f.write(data)
@@ -1213,7 +1215,7 @@ def configure_intl(o):
1213
1215
return
1214
1216
1215
1217
# this is just the 'deps' dir. Used for unpacking.
1216
- icu_parent_path = os.path.join(root_dir, ' deps' )
1218
+ icu_parent_path = ' deps'
1217
1219
1218
1220
# The full path to the ICU source directory. Should not include './'.
1219
1221
icu_full_path = ' deps/icu'
0 commit comments