@@ -35,21 +35,23 @@ import subprocess
3535import shutil
3636import string
3737
38+ # If not run from node/, cd to node/.
39+ os.chdir(os.path.dirname(__file__) or ' .' )
40+
3841# gcc and g++ as defaults matches what GYP's Makefile generator does,
3942# except on OS X.
4043CC = os.environ.get(' CC' , ' cc' if sys.platform == ' darwin' else ' gcc' )
4144CXX = os.environ.get(' CXX' , ' c++' if sys.platform == ' darwin' else ' g++' )
4245
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' ))
4547from gyp.common import GetFlavor
4648
4749# 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' ))
4951import nodedownload
5052
5153# imports in tools/
52- sys.path.insert(0, os.path.join(root_dir, ' tools' ) )
54+ sys.path.insert(0, ' tools' )
5355import getmoduleversion
5456from gyp_node import run_gyp
5557
@@ -403,7 +405,7 @@ intl_optgroup.add_option('--download',
403405intl_optgroup.add_option(' --download-path' ,
404406 action=' store' ,
405407 dest=' download_path' ,
406- default=os.path.join(root_dir, ' deps' ) ,
408+ default=' deps' ,
407409 help=' Download directory [default: %default]' )
408410
409411parser.add_option_group(intl_optgroup)
@@ -991,7 +993,7 @@ def configure_openssl(o):
991993 o[' defines' ] += [' NODE_WITHOUT_NODE_OPTIONS' ]
992994 if options.openssl_fips:
993995 o[' variables' ][' openssl_fips' ] = options.openssl_fips
994- fips_dir = os.path.join(root_dir, ' deps' , ' openssl' , ' fips' )
996+ fips_dir = os.path.join(' deps' , ' openssl' , ' fips' )
995997 fips_ld = os.path.abspath(os.path.join(fips_dir, ' fipsld' ))
996998 # LINK is for Makefiles, LD/LDXX is for ninja
997999 o[' make_fips_settings' ] = [
@@ -1036,7 +1038,7 @@ def configure_static(o):
10361038
10371039
10381040def write(filename, data):
1039- filename = os.path.join(root_dir, filename)
1041+ filename = filename
10401042 print(' creating %s' % filename)
10411043 f = open(filename, ' w+' )
10421044 f.write(data)
@@ -1158,7 +1160,7 @@ def configure_intl(o):
11581160 return
11591161
11601162 # this is just the 'deps' dir. Used for unpacking.
1161- icu_parent_path = os.path.join(root_dir, ' deps' )
1163+ icu_parent_path = ' deps'
11621164
11631165 # The full path to the ICU source directory. Should not include './'.
11641166 icu_full_path = ' deps/icu'
0 commit comments