summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorGibson Fahnestock <gibfahn@gmail.com>2017-11-26 13:30:08 +0000
committerGibson Fahnestock <gibfahn@gmail.com>2017-12-10 15:50:16 +0000
commitb7ff3c0e0417e7f5a9f9b358fbe311459392e988 (patch)
tree8c1ed1bd7e41fe794b951a7db649f33870e97d44 /configure
parentd2626ef6b71d6ecf115a9dee9f3c929fa1acedad (diff)
downloadandroid-node-v8-b7ff3c0e0417e7f5a9f9b358fbe311459392e988.tar.gz
android-node-v8-b7ff3c0e0417e7f5a9f9b358fbe311459392e988.tar.bz2
android-node-v8-b7ff3c0e0417e7f5a9f9b358fbe311459392e988.zip
build: allow running configure from any directory
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 10 insertions, 8 deletions
diff --git a/configure b/configure
index ddcc37df54..a27af226dc 100755
--- a/configure
+++ b/configure
@@ -35,21 +35,23 @@ import subprocess
import shutil
import string
+# If not run from node/, cd to node/.
+os.chdir(os.path.dirname(__file__) or '.')
+
# gcc and g++ as defaults matches what GYP's Makefile generator does,
# except on OS X.
CC = os.environ.get('CC', 'cc' if sys.platform == 'darwin' else 'gcc')
CXX = os.environ.get('CXX', 'c++' if sys.platform == 'darwin' else 'g++')
-root_dir = os.path.dirname(__file__)
-sys.path.insert(0, os.path.join(root_dir, 'tools', 'gyp', 'pylib'))
+sys.path.insert(0, os.path.join('tools', 'gyp', 'pylib'))
from gyp.common import GetFlavor
# imports in tools/configure.d
-sys.path.insert(0, os.path.join(root_dir, 'tools', 'configure.d'))
+sys.path.insert(0, os.path.join('tools', 'configure.d'))
import nodedownload
# imports in tools/
-sys.path.insert(0, os.path.join(root_dir, 'tools'))
+sys.path.insert(0, 'tools')
import getmoduleversion
from gyp_node import run_gyp
@@ -432,7 +434,7 @@ intl_optgroup.add_option('--download',
intl_optgroup.add_option('--download-path',
action='store',
dest='download_path',
- default=os.path.join(root_dir, 'deps'),
+ default='deps',
help='Download directory [default: %default]')
parser.add_option_group(intl_optgroup)
@@ -1050,7 +1052,7 @@ def configure_openssl(o):
o['defines'] += ['NODE_WITHOUT_NODE_OPTIONS']
if options.openssl_fips:
o['variables']['openssl_fips'] = options.openssl_fips
- fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips')
+ fips_dir = os.path.join('deps', 'openssl', 'fips')
fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld'))
# LINK is for Makefiles, LD/LDXX is for ninja
o['make_fips_settings'] = [
@@ -1095,7 +1097,7 @@ def configure_static(o):
def write(filename, data):
- filename = os.path.join(root_dir, filename)
+ filename = filename
print('creating %s' % filename)
f = open(filename, 'w+')
f.write(data)
@@ -1217,7 +1219,7 @@ def configure_intl(o):
return
# this is just the 'deps' dir. Used for unpacking.
- icu_parent_path = os.path.join(root_dir, 'deps')
+ icu_parent_path = 'deps'
# The full path to the ICU source directory. Should not include './'.
icu_full_path = 'deps/icu'