Stop supporting custom pkg-config command
This is a preparation to make Qt5 migration process easier.
This additional abstraction layer to be able to replace pkg-config
command widh PKG_CONFIG environment variable was introduced only for
Chromium OS build, which was already replaced with NaCl-based build that
does not require such a mechanism.
With this CL we do not check PKG_CONFIG environment variable anymore.
BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113462419
REF_TIME=2016-01-31T00:11:19-08:00
REF_TIME_RAW=1454227879 -0800
Yohei Yukawa
8 years ago
150 | 150 |
return 'ninja'
|
151 | 151 |
|
152 | 152 |
|
153 | |
def GetPkgConfigCommand():
|
154 | |
"""Get the pkg-config command name.
|
155 | |
|
156 | |
Returns:
|
157 | |
pkg-config config command name.
|
158 | |
"""
|
159 | |
return os.environ.get('PKG_CONFIG', 'pkg-config')
|
160 | |
|
161 | |
|
162 | 153 |
# TODO(team): Move this to build_tools/util.py
|
163 | 154 |
def PkgExists(*packages):
|
164 | 155 |
"""Return if the specified package exists or not.
|
|
170 | 161 |
True if the specified package exists.
|
171 | 162 |
"""
|
172 | 163 |
try:
|
173 | |
command_line = [GetPkgConfigCommand(), '--exists']
|
|
164 |
command_line = ['pkg-config', '--exists']
|
174 | 165 |
command_line.extend(packages)
|
175 | 166 |
RunOrDie(command_line)
|
176 | 167 |
return True
|
|
844 | 835 |
gyp_options.extend(['-D', 'use_separate_dictionary=0'])
|
845 | 836 |
gyp_options.extend(['-D', 'use_1byte_cost_for_connection_data=0'])
|
846 | 837 |
gyp_options.extend(['-D', 'use_packed_dictionary=0'])
|
847 | |
|
848 | |
# Specifying pkg-config command. Some environment (such like
|
849 | |
# cross-platform ChromeOS build) requires us to call a different
|
850 | |
# command for pkg-config. Here we catch the environment variable
|
851 | |
# and use the specified command instead of actual pkg-config
|
852 | |
# command.
|
853 | |
if IsLinux():
|
854 | |
gyp_options.extend(['-D', 'pkg_config_command=%s' % GetPkgConfigCommand()])
|
855 | |
else:
|
856 | |
gyp_options.extend(['-D', 'pkg_config_command='])
|
857 | 838 |
|
858 | 839 |
if target_platform == 'NaCl':
|
859 | 840 |
if options.nacl_sdk_root:
|
38 | 38 |
['qt_dir', {
|
39 | 39 |
'qt_cflags': [],
|
40 | 40 |
'qt_include_dirs': ['<(qt_dir)/include'],
|
41 | |
}, 'pkg_config_command', {
|
42 | |
'qt_cflags': ['<!@(<(pkg_config_command) --cflags QtGui QtCore)'],
|
|
41 |
}, 'target_platform=="Linux"', {
|
|
42 |
'qt_cflags': ['<!@(pkg-config --cflags QtGui QtCore)'],
|
43 | 43 |
'qt_include_dirs': [],
|
44 | 44 |
}, {
|
45 | 45 |
'qt_cflags': [],
|
|
90 | 90 |
# dependencies of QtGui.
|
91 | 91 |
# See http://doc.qt.nokia.com/4.7/requirements-x11.html
|
92 | 92 |
# pthread library is removed because it must not be specific to Qt.
|
93 | |
'<!@(<(pkg_config_command) --libs-only-L --libs-only-l'
|
|
93 |
'<!@(pkg-config --libs-only-L --libs-only-l'
|
94 | 94 |
' xrender xrandr xcursor xfixes xinerama fontconfig freetype2'
|
95 | 95 |
' xi xt xext x11'
|
96 | 96 |
' sm ice'
|
|
98 | 98 |
],
|
99 | 99 |
}, {
|
100 | 100 |
'libraries': [
|
101 | |
'<!@(<(pkg_config_command) --libs QtGui QtCore)',
|
|
101 |
'<!@(pkg-config --libs QtGui QtCore)',
|
102 | 102 |
],
|
103 | 103 |
}],
|
104 | 104 |
],
|
34 | 34 |
'conditions': [
|
35 | 35 |
['qt_dir', {
|
36 | 36 |
'moc_path': '<(qt_dir)/bin/moc<(EXECUTABLE_SUFFIX)',
|
37 | |
}, 'pkg_config_command', {
|
38 | |
'moc_path': '<!(<(pkg_config_command) --variable=moc_location QtGui)',
|
|
37 |
}, 'target_platform=="Linux"', {
|
|
38 |
'moc_path': '<!(pkg-config --variable=moc_location QtGui)',
|
39 | 39 |
}, {
|
40 | 40 |
'moc_path': 'moc<(EXECUTABLE_SUFFIX)',
|
41 | 41 |
}],
|
34 | 34 |
'conditions': [
|
35 | 35 |
['qt_dir', {
|
36 | 36 |
'rcc_path': '<(qt_dir)/bin/rcc<(EXECUTABLE_SUFFIX)',
|
37 | |
}, 'pkg_config_command', {
|
|
37 |
}, 'target_platform=="Linux"', {
|
38 | 38 |
# seems that --variable=rcc_location is not supported
|
39 | |
'rcc_path': '<!(<(pkg_config_command) --variable=exec_prefix QtGui)/bin/rcc',
|
|
39 |
'rcc_path': '<!(pkg-config --variable=exec_prefix QtGui)/bin/rcc',
|
40 | 40 |
}, {
|
41 | 41 |
'rcc_path': 'rcc<(EXECUTABLE_SUFFIX)',
|
42 | 42 |
}],
|
34 | 34 |
'conditions': [
|
35 | 35 |
['qt_dir', {
|
36 | 36 |
'uic_path': '<(qt_dir)/bin/uic<(EXECUTABLE_SUFFIX)',
|
37 | |
}, 'pkg_config_command', {
|
38 | |
'uic_path': '<!(<(pkg_config_command) --variable=uic_location QtGui)',
|
|
37 |
}, 'target_platform=="Linux"', {
|
|
38 |
'uic_path': '<!(pkg-config --variable=uic_location QtGui)',
|
39 | 39 |
}, {
|
40 | 40 |
'uic_path': 'uic<(EXECUTABLE_SUFFIX)',
|
41 | 41 |
}],
|
250 | 250 |
'enable_ambiguous_search%': 0,
|
251 | 251 |
# enable typing correction.
|
252 | 252 |
'enable_typing_correction%': 0,
|
253 | |
|
254 | |
# The pkg-config command to get the cflags/ldflags for Linux
|
255 | |
# builds. We make it customizable to allow building in a special
|
256 | |
# environment such like cross-platform build.
|
257 | |
'pkg_config_command%': 'pkg-config',
|
258 | 253 |
|
259 | 254 |
'mozc_data_dir': '<(SHARED_INTERMEDIATE_DIR)/',
|
260 | 255 |
},
|
35 | 35 |
'type': 'none',
|
36 | 36 |
'link_settings': {
|
37 | 37 |
'libraries': [
|
38 | |
'<!@(<(pkg_config_command) --libs zinnia)',
|
|
38 |
'<!@(pkg-config --libs zinnia)',
|
39 | 39 |
],
|
40 | 40 |
},
|
41 | 41 |
}, { # use_libzinnia==0
|
0 | 0 |
MAJOR=2
|
1 | 1 |
MINOR=17
|
2 | |
BUILD=2427
|
|
2 |
BUILD=2428
|
3 | 3 |
REVISION=102
|
4 | 4 |
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
|
5 | 5 |
# downloaded by NaCl Mozc.
|
63 | 63 |
['target_platform=="Linux"', {
|
64 | 64 |
# Enable libcurl
|
65 | 65 |
'cflags': [
|
66 | |
'<!@(<(pkg_config_command) --cflags libcurl)',
|
|
66 |
'<!@(pkg-config --cflags libcurl)',
|
67 | 67 |
],
|
68 | 68 |
'defines': [
|
69 | 69 |
'HAVE_CURL=1',
|
70 | 70 |
],
|
71 | 71 |
'link_settings': {
|
72 | 72 |
'ldflags': [
|
73 | |
'<!@(<(pkg_config_command) --libs-only-L libcurl)',
|
|
73 |
'<!@(pkg-config --libs-only-L libcurl)',
|
74 | 74 |
],
|
75 | 75 |
'libraries': [
|
76 | |
'<!@(<(pkg_config_command) --libs-only-l libcurl)',
|
|
76 |
'<!@(pkg-config --libs-only-l libcurl)',
|
77 | 77 |
],
|
78 | 78 |
},
|
79 | 79 |
}],
|
532 | 532 |
},
|
533 | 533 |
'all_dependent_settings': {
|
534 | 534 |
'cflags': [
|
535 | |
'<!@(<(pkg_config_command) --cflags <@(target_pkgs))',
|
|
535 |
'<!@(pkg-config --cflags <@(target_pkgs))',
|
536 | 536 |
],
|
537 | 537 |
'link_settings': {
|
538 | 538 |
'libraries': [
|
539 | |
'<!@(<(pkg_config_command) --libs-only-l <@(target_pkgs))',
|
|
539 |
'<!@(pkg-config --libs-only-l <@(target_pkgs))',
|
540 | 540 |
],
|
541 | 541 |
'ldflags': [
|
542 | |
'<!@(<(pkg_config_command) --libs-only-L <@(target_pkgs))',
|
|
542 |
'<!@(pkg-config --libs-only-L <@(target_pkgs))',
|
543 | 543 |
],
|
544 | 544 |
},
|
545 | 545 |
},
|
137 | 137 |
|
138 | 138 |
def CheckIBusVersion(options, minimum_version):
|
139 | 139 |
"""Tests if ibus version is equal to or greater than the given value."""
|
140 | |
command_line = [options.pkg_config_command, '--exists',
|
141 | |
'ibus-1.0 >= %s' % minimum_version]
|
|
140 |
command_line = ['pkg-config', '--exists', 'ibus-1.0 >= %s' % minimum_version]
|
142 | 141 |
return_code = subprocess.call(command_line)
|
143 | 142 |
if return_code == 0:
|
144 | 143 |
return True
|
|
163 | 162 |
parser.add_option('--server_dir', dest='server_dir', default='',
|
164 | 163 |
help='The absolute directory path to be installed the '
|
165 | 164 |
'server executable.')
|
166 | |
parser.add_option('--pkg_config_command', dest='pkg_config_command',
|
167 | |
default='pkg-config',
|
168 | |
help='The path to pkg-config command.')
|
169 | 165 |
(options, unused_args) = parser.parse_args()
|
170 | 166 |
|
171 | 167 |
setup_arg = []
|
52 | 52 |
},
|
53 | 53 |
'all_dependent_settings': {
|
54 | 54 |
'cflags': [
|
55 | |
'<!@(<(pkg_config_command) --cflags <@(target_libs))',
|
|
55 |
'<!@(pkg-config --cflags <@(target_libs))',
|
56 | 56 |
],
|
57 | 57 |
'link_settings': {
|
58 | 58 |
'libraries': [
|
59 | |
'<!@(<(pkg_config_command) --libs-only-l <@(target_libs))',
|
|
59 |
'<!@(pkg-config --libs-only-l <@(target_libs))',
|
60 | 60 |
],
|
61 | 61 |
'ldflags': [
|
62 | |
'<!@(<(pkg_config_command) --libs-only-L <@(target_libs))',
|
|
62 |
'<!@(pkg-config --libs-only-L <@(target_libs))',
|
63 | 63 |
],
|
64 | 64 |
},
|
65 | 65 |
},
|
|
82 | 82 |
'./gen_mozc_xml.py',
|
83 | 83 |
'--branding=Mozc',
|
84 | 84 |
'--server_dir=<(server_dir)',
|
85 | |
'--pkg_config_command=<(pkg_config_command)',
|
86 | 85 |
'--ibus_mozc_path=<(ibus_mozc_path)',
|
87 | 86 |
'--ibus_mozc_icon_path=<(ibus_mozc_icon_path)',
|
88 | 87 |
],
|
|
286 | 285 |
},
|
287 | 286 |
'all_dependent_settings': {
|
288 | 287 |
'cflags': [
|
289 | |
'<!@(<(pkg_config_command) --cflags <@(target_libs))',
|
|
288 |
'<!@(pkg-config --cflags <@(target_libs))',
|
290 | 289 |
],
|
291 | 290 |
'link_settings': {
|
292 | 291 |
'libraries': [
|
293 | |
'<!@(<(pkg_config_command) --libs-only-l <@(target_libs))',
|
|
292 |
'<!@(pkg-config --libs-only-l <@(target_libs))',
|
294 | 293 |
],
|
295 | 294 |
'ldflags': [
|
296 | |
'<!@(<(pkg_config_command) --libs-only-L <@(target_libs))',
|
|
295 |
'<!@(pkg-config --libs-only-L <@(target_libs))',
|
297 | 296 |
],
|
298 | 297 |
},
|
299 | 298 |
'defines': [
|