build: add --verbose
to ./configure
PR-URL: https://github.com/nodejs/node/pull/22450 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
parent
cc9dd0f365
commit
62a3f9b029
40
configure.py
40
configure.py
@ -559,6 +559,12 @@ parser.add_option('--build-v8-with-gn',
|
|||||||
default=False,
|
default=False,
|
||||||
help='build V8 using GN instead of gyp')
|
help='build V8 using GN instead of gyp')
|
||||||
|
|
||||||
|
parser.add_option('--verbose',
|
||||||
|
action='store_true',
|
||||||
|
dest='verbose',
|
||||||
|
default=False,
|
||||||
|
help='get more output from this script')
|
||||||
|
|
||||||
# Create compile_commands.json in out/Debug and out/Release.
|
# Create compile_commands.json in out/Debug and out/Release.
|
||||||
parser.add_option('-C',
|
parser.add_option('-C',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
@ -587,6 +593,14 @@ def warn(msg):
|
|||||||
# track if warnings occurred
|
# track if warnings occurred
|
||||||
warn.warned = False
|
warn.warned = False
|
||||||
|
|
||||||
|
def print_verbose(x):
|
||||||
|
if not options.verbose:
|
||||||
|
return
|
||||||
|
if type(x) is str:
|
||||||
|
print x
|
||||||
|
else:
|
||||||
|
pprint.pprint(x, indent=2)
|
||||||
|
|
||||||
def b(value):
|
def b(value):
|
||||||
"""Returns the string 'true' if value is truthy, 'false' otherwise."""
|
"""Returns the string 'true' if value is truthy, 'false' otherwise."""
|
||||||
if value:
|
if value:
|
||||||
@ -1199,7 +1213,7 @@ def configure_openssl(o):
|
|||||||
def configure_static(o):
|
def configure_static(o):
|
||||||
if options.fully_static or options.partly_static:
|
if options.fully_static or options.partly_static:
|
||||||
if flavor == 'mac':
|
if flavor == 'mac':
|
||||||
print("Generation of static executable will not work on OSX "
|
warn("Generation of static executable will not work on OSX "
|
||||||
"when using the default compilation environment")
|
"when using the default compilation environment")
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -1213,9 +1227,9 @@ def configure_static(o):
|
|||||||
|
|
||||||
def write(filename, data):
|
def write(filename, data):
|
||||||
filename = filename
|
filename = filename
|
||||||
print('creating %s' % filename)
|
print_verbose('creating %s' % filename)
|
||||||
f = open(filename, 'w+')
|
with open(filename, 'w+') as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
|
|
||||||
do_not_edit = '# Do not edit. Generated by the configure script.\n'
|
do_not_edit = '# Do not edit. Generated by the configure script.\n'
|
||||||
|
|
||||||
@ -1233,7 +1247,7 @@ def glob_to_var(dir_base, dir_sub, patch_dir):
|
|||||||
patchfile = '%s/%s/%s' % (dir_base, patch_dir, file)
|
patchfile = '%s/%s/%s' % (dir_base, patch_dir, file)
|
||||||
if os.path.isfile(patchfile):
|
if os.path.isfile(patchfile):
|
||||||
srcfile = '%s/%s' % (patch_dir, file)
|
srcfile = '%s/%s' % (patch_dir, file)
|
||||||
print('Using version-specific floating patch %s' % patchfile)
|
warn('Using floating patch "%s" from "%s"' % (patchfile, dir_base))
|
||||||
list.append(srcfile)
|
list.append(srcfile)
|
||||||
break
|
break
|
||||||
return list
|
return list
|
||||||
@ -1267,8 +1281,8 @@ def configure_intl(o):
|
|||||||
if (md5 == gotmd5):
|
if (md5 == gotmd5):
|
||||||
return targetfile
|
return targetfile
|
||||||
else:
|
else:
|
||||||
print('Expected: %s *MISMATCH*' % md5)
|
error('Expected: %s *MISMATCH*' % md5)
|
||||||
print('\n ** Corrupted ZIP? Delete %s to retry download.\n' % targetfile)
|
error('\n ** Corrupted ZIP? Delete %s to retry download.\n' % targetfile)
|
||||||
return None
|
return None
|
||||||
icu_config = {
|
icu_config = {
|
||||||
'variables': {}
|
'variables': {}
|
||||||
@ -1369,7 +1383,7 @@ def configure_intl(o):
|
|||||||
# --with-icu-source processing
|
# --with-icu-source processing
|
||||||
# now, check that they didn't pass --with-icu-source=deps/icu
|
# now, check that they didn't pass --with-icu-source=deps/icu
|
||||||
elif with_icu_source and os.path.abspath(icu_full_path) == os.path.abspath(with_icu_source):
|
elif with_icu_source and os.path.abspath(icu_full_path) == os.path.abspath(with_icu_source):
|
||||||
print('Ignoring redundant --with-icu-source=%s' % with_icu_source)
|
warn('Ignoring redundant --with-icu-source=%s' % with_icu_source)
|
||||||
with_icu_source = None
|
with_icu_source = None
|
||||||
# if with_icu_source is still set, try to use it.
|
# if with_icu_source is still set, try to use it.
|
||||||
if with_icu_source:
|
if with_icu_source:
|
||||||
@ -1412,7 +1426,7 @@ def configure_intl(o):
|
|||||||
# ICU source dir relative to tools/icu (for .gyp file)
|
# ICU source dir relative to tools/icu (for .gyp file)
|
||||||
o['variables']['icu_path'] = icu_full_path
|
o['variables']['icu_path'] = icu_full_path
|
||||||
if not os.path.isdir(icu_full_path):
|
if not os.path.isdir(icu_full_path):
|
||||||
print('* ECMA-402 (Intl) support didn\'t find ICU in %s..' % icu_full_path)
|
warn('* ECMA-402 (Intl) support didn\'t find ICU in %s..' % icu_full_path)
|
||||||
# can we download (or find) a zipfile?
|
# can we download (or find) a zipfile?
|
||||||
localzip = icu_download(icu_full_path)
|
localzip = icu_download(icu_full_path)
|
||||||
if localzip:
|
if localzip:
|
||||||
@ -1421,7 +1435,7 @@ def configure_intl(o):
|
|||||||
error('''Cannot build Intl without ICU in %s.
|
error('''Cannot build Intl without ICU in %s.
|
||||||
Fix, or disable with "--with-intl=none"''' % icu_full_path)
|
Fix, or disable with "--with-intl=none"''' % icu_full_path)
|
||||||
else:
|
else:
|
||||||
print('* Using ICU in %s' % icu_full_path)
|
print_verbose('* Using ICU in %s' % icu_full_path)
|
||||||
# Now, what version of ICU is it? We just need the "major", such as 54.
|
# Now, what version of ICU is it? We just need the "major", such as 54.
|
||||||
# uvernum.h contains it as a #define.
|
# uvernum.h contains it as a #define.
|
||||||
uvernum_h = os.path.join(icu_full_path, 'source/common/unicode/uvernum.h')
|
uvernum_h = os.path.join(icu_full_path, 'source/common/unicode/uvernum.h')
|
||||||
@ -1584,7 +1598,7 @@ output = {
|
|||||||
if make_global_settings:
|
if make_global_settings:
|
||||||
output['make_global_settings'] = make_global_settings
|
output['make_global_settings'] = make_global_settings
|
||||||
|
|
||||||
pprint.pprint(output, indent=2)
|
print_verbose(output)
|
||||||
|
|
||||||
write('config.gypi', do_not_edit +
|
write('config.gypi', do_not_edit +
|
||||||
pprint.pformat(output, indent=2) + '\n')
|
pprint.pformat(output, indent=2) + '\n')
|
||||||
@ -1623,9 +1637,11 @@ else:
|
|||||||
if options.compile_commands_json:
|
if options.compile_commands_json:
|
||||||
gyp_args += ['-f', 'compile_commands_json']
|
gyp_args += ['-f', 'compile_commands_json']
|
||||||
|
|
||||||
|
# pass the leftover positional arguments to GYP
|
||||||
gyp_args += args
|
gyp_args += args
|
||||||
|
|
||||||
if warn.warned:
|
if warn.warned and not options.verbose:
|
||||||
warn('warnings were emitted in the configure phase')
|
warn('warnings were emitted in the configure phase')
|
||||||
|
|
||||||
|
print_verbose("running: \n " + " ".join(['python', 'tools/gyp_node.py'] + gyp_args))
|
||||||
run_gyp(gyp_args)
|
run_gyp(gyp_args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user