summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile7
-rwxr-xr-xconfigure7
3 files changed, 14 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 60f084d2c1..e12e4eab6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -69,6 +69,7 @@ ipch/
/config.mk
/config.gypi
+/config.status
/config_fips.gypi
*-nodegyp*
/gyp-mac-tool
diff --git a/Makefile b/Makefile
index 99e8969221..38bb840674 100644
--- a/Makefile
+++ b/Makefile
@@ -114,7 +114,12 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \
$(PYTHON) tools/gyp_node.py -f make
config.gypi: configure
- $(error Missing or stale $@, please run ./$<)
+ @if [ -x config.status ]; then \
+ ./config.status; \
+ else \
+ echo Missing or stale $@, please run ./$<; \
+ exit 1; \
+ fi
.PHONY: install
install: all ## Installs node into $PREFIX (default=/usr/local).
diff --git a/configure b/configure
index efb92701e2..3a9ab42414 100755
--- a/configure
+++ b/configure
@@ -28,6 +28,7 @@ if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7):
import errno
import optparse
import os
+import pipes
import pprint
import re
import shlex
@@ -38,6 +39,8 @@ import string
# If not run from node/, cd to node/.
os.chdir(os.path.dirname(__file__) or '.')
+original_argv = sys.argv[1:]
+
# 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')
@@ -1530,6 +1533,10 @@ pprint.pprint(output, indent=2)
write('config.gypi', do_not_edit +
pprint.pformat(output, indent=2) + '\n')
+write('config.status', '#!/bin/sh\nset -x\nexec ./configure ' +
+ ' '.join([pipes.quote(arg) for arg in original_argv]) + '\n')
+os.chmod('config.status', 0775)
+
config = {
'BUILDTYPE': 'Debug' if options.debug else 'Release',
'PYTHON': sys.executable,