build: remove requirement to re-run ./configure

Instead of requiring `./configure` to be run again after
the file changed, first try to re-run the configure script
with the arguments with which it was originally run.

Usually, those arguments will either contain no flags,
or all flags that were passed are still supported.

PR-URL: https://github.com/nodejs/node/pull/21371
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
This commit is contained in:
Anna Henningsen authored and James M Snell committed 2018-06-29 13:09:25 -07:00
1 parent bf360d2e15
commit 074e7f88af
3 files changed
+14 -1

No files matched your search

+1
View File
@@ -69,6 +69,7 @@ ipch/
/config.mk
/config.gypi
/config.status
/config_fips.gypi
*-nodegyp*
/gyp-mac-tool
+6 -1
View File
@@ -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).
Vendored
+7
View File
@@ -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,