Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dcb53c1

Browse filesBrowse files
gibfahnMylesBorins
authored andcommitted
build: allow running configure from any directory
PR-URL: #17321 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 510116e commit dcb53c1
Copy full SHA for dcb53c1

File tree

Expand file treeCollapse file tree

1 file changed

+10
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-8
lines changed
Open diff view settings
Collapse file

‎configure‎

Copy file name to clipboardExpand all lines: configure
+10-8Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,23 @@ import subprocess
3535
import shutil
3636
import 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.
4043
CC = os.environ.get('CC', 'cc' if sys.platform == 'darwin' else 'gcc')
4144
CXX = 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'))
4547
from 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'))
4951
import nodedownload
5052

5153
# imports in tools/
52-
sys.path.insert(0, os.path.join(root_dir, 'tools'))
54+
sys.path.insert(0, 'tools')
5355
import getmoduleversion
5456
from gyp_node import run_gyp
5557

@@ -432,7 +434,7 @@ intl_optgroup.add_option('--download',
432434
intl_optgroup.add_option('--download-path',
433435
action='store',
434436
dest='download_path',
435-
default=os.path.join(root_dir, 'deps'),
437+
default='deps',
436438
help='Download directory [default: %default]')
437439

438440
parser.add_option_group(intl_optgroup)
@@ -1046,7 +1048,7 @@ def configure_openssl(o):
10461048
o['defines'] += ['NODE_WITHOUT_NODE_OPTIONS']
10471049
if options.openssl_fips:
10481050
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')
10501052
fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld'))
10511053
# LINK is for Makefiles, LD/LDXX is for ninja
10521054
o['make_fips_settings'] = [
@@ -1091,7 +1093,7 @@ def configure_static(o):
10911093

10921094

10931095
def write(filename, data):
1094-
filename = os.path.join(root_dir, filename)
1096+
filename = filename
10951097
print('creating %s' % filename)
10961098
f = open(filename, 'w+')
10971099
f.write(data)
@@ -1213,7 +1215,7 @@ def configure_intl(o):
12131215
return
12141216

12151217
# this is just the 'deps' dir. Used for unpacking.
1216-
icu_parent_path = os.path.join(root_dir, 'deps')
1218+
icu_parent_path = 'deps'
12171219

12181220
# The full path to the ICU source directory. Should not include './'.
12191221
icu_full_path = 'deps/icu'

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.