Codebase list mozc / 6eeb487
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
12 changed file(s) with 26 addition(s) and 55 deletion(s). Raw diff Collapse all Expand all
150150 return 'ninja'
151151
152152
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
162153 # TODO(team): Move this to build_tools/util.py
163154 def PkgExists(*packages):
164155 """Return if the specified package exists or not.
170161 True if the specified package exists.
171162 """
172163 try:
173 command_line = [GetPkgConfigCommand(), '--exists']
164 command_line = ['pkg-config', '--exists']
174165 command_line.extend(packages)
175166 RunOrDie(command_line)
176167 return True
844835 gyp_options.extend(['-D', 'use_separate_dictionary=0'])
845836 gyp_options.extend(['-D', 'use_1byte_cost_for_connection_data=0'])
846837 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='])
857838
858839 if target_platform == 'NaCl':
859840 if options.nacl_sdk_root:
3838 ['qt_dir', {
3939 'qt_cflags': [],
4040 '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)'],
4343 'qt_include_dirs': [],
4444 }, {
4545 'qt_cflags': [],
9090 # dependencies of QtGui.
9191 # See http://doc.qt.nokia.com/4.7/requirements-x11.html
9292 # 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'
9494 ' xrender xrandr xcursor xfixes xinerama fontconfig freetype2'
9595 ' xi xt xext x11'
9696 ' sm ice'
9898 ],
9999 }, {
100100 'libraries': [
101 '<!@(<(pkg_config_command) --libs QtGui QtCore)',
101 '<!@(pkg-config --libs QtGui QtCore)',
102102 ],
103103 }],
104104 ],
3434 'conditions': [
3535 ['qt_dir', {
3636 '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)',
3939 }, {
4040 'moc_path': 'moc<(EXECUTABLE_SUFFIX)',
4141 }],
3434 'conditions': [
3535 ['qt_dir', {
3636 'rcc_path': '<(qt_dir)/bin/rcc<(EXECUTABLE_SUFFIX)',
37 }, 'pkg_config_command', {
37 }, 'target_platform=="Linux"', {
3838 # 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',
4040 }, {
4141 'rcc_path': 'rcc<(EXECUTABLE_SUFFIX)',
4242 }],
3434 'conditions': [
3535 ['qt_dir', {
3636 '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)',
3939 }, {
4040 'uic_path': 'uic<(EXECUTABLE_SUFFIX)',
4141 }],
250250 'enable_ambiguous_search%': 0,
251251 # enable typing correction.
252252 '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',
258253
259254 'mozc_data_dir': '<(SHARED_INTERMEDIATE_DIR)/',
260255 },
3535 'type': 'none',
3636 'link_settings': {
3737 'libraries': [
38 '<!@(<(pkg_config_command) --libs zinnia)',
38 '<!@(pkg-config --libs zinnia)',
3939 ],
4040 },
4141 }, { # use_libzinnia==0
00 MAJOR=2
11 MINOR=17
2 BUILD=2427
2 BUILD=2428
33 REVISION=102
44 # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
55 # downloaded by NaCl Mozc.
6363 ['target_platform=="Linux"', {
6464 # Enable libcurl
6565 'cflags': [
66 '<!@(<(pkg_config_command) --cflags libcurl)',
66 '<!@(pkg-config --cflags libcurl)',
6767 ],
6868 'defines': [
6969 'HAVE_CURL=1',
7070 ],
7171 'link_settings': {
7272 'ldflags': [
73 '<!@(<(pkg_config_command) --libs-only-L libcurl)',
73 '<!@(pkg-config --libs-only-L libcurl)',
7474 ],
7575 'libraries': [
76 '<!@(<(pkg_config_command) --libs-only-l libcurl)',
76 '<!@(pkg-config --libs-only-l libcurl)',
7777 ],
7878 },
7979 }],
532532 },
533533 'all_dependent_settings': {
534534 'cflags': [
535 '<!@(<(pkg_config_command) --cflags <@(target_pkgs))',
535 '<!@(pkg-config --cflags <@(target_pkgs))',
536536 ],
537537 'link_settings': {
538538 'libraries': [
539 '<!@(<(pkg_config_command) --libs-only-l <@(target_pkgs))',
539 '<!@(pkg-config --libs-only-l <@(target_pkgs))',
540540 ],
541541 'ldflags': [
542 '<!@(<(pkg_config_command) --libs-only-L <@(target_pkgs))',
542 '<!@(pkg-config --libs-only-L <@(target_pkgs))',
543543 ],
544544 },
545545 },
137137
138138 def CheckIBusVersion(options, minimum_version):
139139 """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]
142141 return_code = subprocess.call(command_line)
143142 if return_code == 0:
144143 return True
163162 parser.add_option('--server_dir', dest='server_dir', default='',
164163 help='The absolute directory path to be installed the '
165164 '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.')
169165 (options, unused_args) = parser.parse_args()
170166
171167 setup_arg = []
5252 },
5353 'all_dependent_settings': {
5454 'cflags': [
55 '<!@(<(pkg_config_command) --cflags <@(target_libs))',
55 '<!@(pkg-config --cflags <@(target_libs))',
5656 ],
5757 'link_settings': {
5858 'libraries': [
59 '<!@(<(pkg_config_command) --libs-only-l <@(target_libs))',
59 '<!@(pkg-config --libs-only-l <@(target_libs))',
6060 ],
6161 'ldflags': [
62 '<!@(<(pkg_config_command) --libs-only-L <@(target_libs))',
62 '<!@(pkg-config --libs-only-L <@(target_libs))',
6363 ],
6464 },
6565 },
8282 './gen_mozc_xml.py',
8383 '--branding=Mozc',
8484 '--server_dir=<(server_dir)',
85 '--pkg_config_command=<(pkg_config_command)',
8685 '--ibus_mozc_path=<(ibus_mozc_path)',
8786 '--ibus_mozc_icon_path=<(ibus_mozc_icon_path)',
8887 ],
286285 },
287286 'all_dependent_settings': {
288287 'cflags': [
289 '<!@(<(pkg_config_command) --cflags <@(target_libs))',
288 '<!@(pkg-config --cflags <@(target_libs))',
290289 ],
291290 'link_settings': {
292291 'libraries': [
293 '<!@(<(pkg_config_command) --libs-only-l <@(target_libs))',
292 '<!@(pkg-config --libs-only-l <@(target_libs))',
294293 ],
295294 'ldflags': [
296 '<!@(<(pkg_config_command) --libs-only-L <@(target_libs))',
295 '<!@(pkg-config --libs-only-L <@(target_libs))',
297296 ],
298297 },
299298 'defines': [