-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: remove requirement to re-run ./configure #21371
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ ipch/ | |
|
||
/config.mk | ||
/config.gypi | ||
/config.status | ||
/config_fips.gypi | ||
*-nodegyp* | ||
/gyp-mac-tool | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,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; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather have: $(PYTHON) configure $(something that reads .configure_args as args) So it will be easier to implement for Windows There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. btw shouldn't this be dependant on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We could follow the same approach pretty easily, I think
I don’t know, somebody else would have to answer that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now I understand why your pattern makes perfect sense for autotools, since it only assumes a POSIX compatible shell... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah … I heard escaping parameters for cmd is fun :) Otherwise we should be able to follow the same format here if we like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ideally, yes, but can be done in a separate PR. |
||
else \ | ||
echo Missing or stale $@, please run ./$<; \ | ||
exit 1; \ | ||
fi | ||
|
||
.PHONY: install | ||
install: all ## Installs node into $PREFIX (default=/usr/local). | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,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') | ||
|
@@ -1447,6 +1449,9 @@ def make_bin_override(): | |
|
||
return bin_override | ||
|
||
def shell_quote(arg): | ||
return "'" + arg.replace("'", "'\\''") + "'" | ||
|
||
output = { | ||
'variables': {}, | ||
'include_dirs': [], | ||
|
@@ -1513,6 +1518,10 @@ pprint.pprint(output, indent=2) | |
write('config.gypi', do_not_edit + | ||
pprint.pformat(output, indent=2) + '\n') | ||
|
||
write('config.status', '#!/bin/sh\nset -ex\n./configure ' + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: How about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
' '.join([shell_quote(arg) for arg in original_argv]) + '\n') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
os.chmod('config.status', 0775) | ||
|
||
config = { | ||
'BUILDTYPE': 'Debug' if options.debug else 'Release', | ||
'PYTHON': sys.executable, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggesting a
.configure_args
approach, and.*
files are ignored by default.