Unsupport static Qt libraries on Linux
To make Qt 5 migration process easier, we decided to drop the
configuration to statically link to Qt libraries on Linux.
BUG=#327
TEST=
REF_BUG=26887740
REF_CL=113928643
REF_TIME=2016-02-05T18:21:55+09:00
REF_TIME_RAW=1454664115 +0900
Hiroyuki Komatsu
8 years ago
338 | 338 | parser.add_option('--gypdir', dest='gypdir', |
339 | 339 | help='Specifies the location of GYP to be used.') |
340 | 340 | parser.add_option('--noqt', action='store_true', dest='noqt', default=False) |
341 | parser.add_option('--qtdir', dest='qtdir', | |
342 | default=os.getenv('QTDIR', None), | |
343 | help='Qt base directory to be used.') | |
344 | 341 | parser.add_option('--version_file', dest='version_file', |
345 | 342 | help='use the specified version template file', |
346 | 343 | default='mozc_version_template.txt') |
450 | 447 | # as follows. |
451 | 448 | parser.add_option('--msvs_version', dest='msvs_version', default='2013', |
452 | 449 | help='Specifies the target MSVS version.') |
450 | ||
451 | if IsWindows() or IsMac(): | |
452 | parser.add_option('--qtdir', dest='qtdir', | |
453 | default=os.getenv('QTDIR', None), | |
454 | help='Qt base directory to be used.') | |
453 | 455 | |
454 | 456 | return parser.parse_args(args, values) |
455 | 457 | |
672 | 674 | |
673 | 675 | if options.noqt or target_platform in ['Android', 'NaCl']: |
674 | 676 | gyp_options.extend(['-D', 'use_qt=NO']) |
677 | gyp_options.extend(['-D', 'qt_dir=']) | |
678 | elif options.target_platform == 'Linux': | |
679 | gyp_options.extend(['-D', 'use_qt=YES']) | |
680 | gyp_options.extend(['-D', 'qt_dir=']) | |
681 | ||
682 | # Check if Qt libraries are installed. | |
683 | system_qt_found = PkgExists('QtCore >= 4.0', 'QtCore < 5.0', | |
684 | 'QtGui >= 4.0', 'QtGui < 5.0') | |
685 | if not system_qt_found: | |
686 | PrintErrorAndExit('Qt4 is required to build GUI Tool. ' | |
687 | 'Specify --noqt to skip building GUI Tool.') | |
675 | 688 | else: |
676 | if options.target_platform == 'Linux' and not options.qtdir: | |
677 | # Check if Qt libraries are installed. | |
678 | system_qt_found = PkgExists('QtCore >= 4.0', 'QtCore < 5.0', | |
679 | 'QtGui >= 4.0', 'QtGui < 5.0') | |
680 | if not system_qt_found: | |
681 | PrintErrorAndExit('Qt4 is required to build GUI Tool. ' | |
682 | 'Specify --noqt to skip building GUI Tool.') | |
683 | 689 | gyp_options.extend(['-D', 'use_qt=YES']) |
684 | if options.qtdir: | |
685 | gyp_options.extend(['-D', 'qt_dir=%s' % os.path.abspath(options.qtdir)]) | |
686 | else: | |
687 | gyp_options.extend(['-D', 'qt_dir=']) | |
690 | if options.qtdir: | |
691 | gyp_options.extend(['-D', 'qt_dir=%s' % os.path.abspath(options.qtdir)]) | |
692 | else: | |
693 | gyp_options.extend(['-D', 'qt_dir=']) | |
688 | 694 | |
689 | 695 | if options.target_platform == 'Windows' and options.wix_dir: |
690 | 696 | gyp_options.extend(['-D', 'use_wix=YES']) |
35 | 35 | |
36 | 36 | 'variables': { |
37 | 37 | 'conditions': [ |
38 | ['qt_dir', { | |
38 | ['target_platform=="Linux"', { | |
39 | 'qt_cflags': ['<!@(pkg-config --cflags QtGui QtCore)'], | |
40 | 'qt_include_dirs': [], | |
41 | }, 'qt_dir', { | |
39 | 42 | 'qt_cflags': [], |
40 | 43 | 'qt_include_dirs': ['<(qt_dir)/include'], |
41 | }, 'target_platform=="Linux"', { | |
42 | 'qt_cflags': ['<!@(pkg-config --cflags QtGui QtCore)'], | |
43 | 'qt_include_dirs': [], | |
44 | 44 | }, { |
45 | 45 | 'qt_cflags': [], |
46 | 46 | 'qt_include_dirs': [], |
109 | 109 | ] |
110 | 110 | }], |
111 | 111 | ['target_platform=="Linux"', { |
112 | 'conditions': [ | |
113 | ['qt_dir', { | |
114 | 'libraries': [ | |
115 | '-L<(qt_dir)/lib', | |
116 | '-lQtGui', | |
117 | '-lQtCore', | |
118 | # Supposing Qt libraries in qt_dir will be built as static libraries | |
119 | # without support of pkg-config, we need to list all the | |
120 | # dependencies of QtGui. | |
121 | # See http://doc.qt.nokia.com/4.7/requirements-x11.html | |
122 | # pthread library is removed because it must not be specific to Qt. | |
123 | '<!@(pkg-config --libs-only-L --libs-only-l' | |
124 | ' xrender xrandr xcursor xfixes xinerama fontconfig freetype2' | |
125 | ' xi xt xext x11' | |
126 | ' sm ice' | |
127 | ' gobject-2.0)', | |
128 | ], | |
129 | }, { | |
130 | 'libraries': [ | |
131 | '<!@(pkg-config --libs QtGui QtCore)', | |
132 | ], | |
133 | }], | |
112 | 'libraries': [ | |
113 | '<!@(pkg-config --libs QtGui QtCore)', | |
134 | 114 | ], |
135 | 115 | }], |
136 | 116 | # Workarounds related with clang. |
32 | 32 | |
33 | 33 | 'variables': { |
34 | 34 | 'conditions': [ |
35 | ['qt_dir', { | |
35 | ['target_platform=="Linux"', { | |
36 | 'moc_path': '<!(pkg-config --variable=moc_location QtGui)', | |
37 | }, 'qt_dir', { | |
36 | 38 | 'moc_path': '<(qt_dir)/bin/moc<(EXECUTABLE_SUFFIX)', |
37 | }, 'target_platform=="Linux"', { | |
38 | 'moc_path': '<!(pkg-config --variable=moc_location QtGui)', | |
39 | 39 | }, { |
40 | 40 | 'moc_path': 'moc<(EXECUTABLE_SUFFIX)', |
41 | 41 | }], |
32 | 32 | |
33 | 33 | 'variables': { |
34 | 34 | 'conditions': [ |
35 | ['qt_dir', { | |
36 | 'rcc_path': '<(qt_dir)/bin/rcc<(EXECUTABLE_SUFFIX)', | |
37 | }, 'target_platform=="Linux"', { | |
35 | ['target_platform=="Linux"', { | |
38 | 36 | # seems that --variable=rcc_location is not supported |
39 | 37 | 'rcc_path': '<!(pkg-config --variable=exec_prefix QtGui)/bin/rcc', |
38 | }, 'qt_dir', { | |
39 | 'rcc_path': '<(qt_dir)/bin/rcc<(EXECUTABLE_SUFFIX)', | |
40 | 40 | }, { |
41 | 41 | 'rcc_path': 'rcc<(EXECUTABLE_SUFFIX)', |
42 | 42 | }], |
32 | 32 | |
33 | 33 | 'variables': { |
34 | 34 | 'conditions': [ |
35 | ['qt_dir', { | |
35 | ['target_platform=="Linux"', { | |
36 | 'uic_path': '<!(pkg-config --variable=uic_location QtGui)', | |
37 | }, 'qt_dir', { | |
36 | 38 | 'uic_path': '<(qt_dir)/bin/uic<(EXECUTABLE_SUFFIX)', |
37 | }, 'target_platform=="Linux"', { | |
38 | 'uic_path': '<!(pkg-config --variable=uic_location QtGui)', | |
39 | 39 | }, { |
40 | 40 | 'uic_path': 'uic<(EXECUTABLE_SUFFIX)', |
41 | 41 | }], |