Skip to content

Commit

Permalink
Support x86_gcc2 environment
Browse files Browse the repository at this point in the history
  • Loading branch information
hanya committed Apr 10, 2018
1 parent 44be864 commit 66c938d
Show file tree
Hide file tree
Showing 12 changed files with 670 additions and 126 deletions.
2 changes: 1 addition & 1 deletion src/build_mozc.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def GetGypFileNames(options):
gyp_file_names.remove('%s/unix/ibus/ibus.gyp' % SRC_DIR)
if options.variant == 'Haiku':
gyp_file_names.extend(glob.glob('%s/haiku/*/*.gyp' % SRC_DIR))
if options.noqt:
if hasattr(options, 'noqt') and options.noqt:
gyp_file_names.remove('%s/gui/gui.gyp' % SRC_DIR)
elif options.target_platform == 'NaCl':
# Add chrome NaCl Mozc gyp scripts.
Expand Down
3 changes: 3 additions & 0 deletions src/gyp/defines.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
# use_libibus represents if ibus library is used or not.
# This option is only for Linux.
'use_libibus%': '0',

# primary architecture is x86_gcc2 and build by gcc5 on Haiku OS
'target_x86_gcc2%': '0',
},
'target_defaults': {
'defines': [
Expand Down
4 changes: 3 additions & 1 deletion src/haiku/input_method/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#ifndef COMMON_H_
#define COMMON_H_

#define MOZC_BACKEND_SIG "application/x-vnd.Mozc-Task"

namespace immozc {

// Special keys defined by custom keymap.
Expand Down Expand Up @@ -74,7 +76,7 @@ enum {
IM_KANA_MAPPING_MSG = 'IMkm',
};


#define DESKBAR "deskbar"
#define IM_ACTIVE "active"
#define IM_MODE_MODE "mode"

Expand Down
145 changes: 129 additions & 16 deletions src/haiku/input_method/input_method.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,61 @@
'../../protocol/protocol.gyp:commands_proto',
'../../protocol/protocol.gyp:config_proto',
],
'conditions': [
['target_x86_gcc2=="x86_gcc2"', {
'defines': [
'X86_GCC2',
],
}]
],
},
{
'target_name': 'mozc_no_resource',
#'type': 'shared_library',
'type': 'executable',
'sources': [
'method.cc',
],
'dependencies': [
'input_method_lib',
'conditions': [
['target_x86_gcc2!="x86_gcc2"', {
'type': 'executable',
'sources': [
'method.cc',
],
'dependencies': [
'input_method_lib',
],
'link_settings': {
'libraries': [
'-lbe',
'-ltranslation',
'-llocalestub',
'/boot/system/servers/input_server',
],
},
}, {
'type': 'executable',
'dependencies': [
'mozc_task',
],
'actions': [
{
'action_name': 'mozc_no_resource_x86_gcc2',
'inputs': [
'method.cc',
],
'outputs': [
'<(out_dir)/mozc_no_resource',
],
'action': [
'python', 'tools/compile.py',
'--compiler', '/bin/g++',
'--inputpath', '<@(_inputs)',
'--outpath', '<@(_outputs)',
'--defs', 'X86_GCC2',
'--includes', './', '../..',
'--libs', 'be', 'localestub', '/system/servers/input_server'
],
'message': 'Generating <@(_outputs)',
}
],
}],
],
'link_settings': {
'libraries': [
'-lbe',
'-ltranslation',
'-llocalestub',
'/boot/system/servers/input_server',
],
},
},
{
'target_name': 'mozc',
Expand All @@ -96,6 +132,7 @@
'--inputpath', '<@(_inputs)',
'--rsrc', '<(gen_out_dir)/input_method.rsrc',
],
'message': 'Generating <@(_outputs)',
},
],
},
Expand Down Expand Up @@ -129,6 +166,7 @@
'./bar.cc',
'./looper.cc',
'./settings_window.cc',
'./method.cc',
],
'outputs': [
'<(gen_out_dir)/input_method.pre',
Expand Down Expand Up @@ -197,5 +235,80 @@
],
},
],

'conditions': [
['target_x86_gcc2=="x86_gcc2"', {
'targets': [
{
'target_name': 'mozc_task',
'type': 'none',
'dependencies': [
'mozc_task_no_resource',
'mozc_task_rsrc',
'catalogs',
],
'actions': [
{
'action_name': 'task_merge_rsrc',
'inputs': [
'<(out_dir)/mozc_task_no_resource',
],
'outputs': [
'<(out_dir)/mozc_task',
],
'action': [
'python', 'tools/xres.py',
'--outpath', '<@(_outputs)',
'--inputpath', '<@(_inputs)',
'--rsrc', '<(gen_out_dir)/mozc_task.rsrc',
'--exe',
]
}
],
},
{
'target_name': 'mozc_task_no_resource',
'type': 'executable',
'sources': [
'task.cc',
],
'dependencies': [
'input_method_lib',
],
'link_settings': {
'libraries': [
'-lbe',
'-ltranslation',
'-llocalestub',
]
},
'defines': [
'X86_GCC2',
],
},
{
'target_name': 'mozc_task_rsrc',
'type': 'none',
'actions': [
{
'variables': {
'rdef': 'mozc_task',
},
'action_name': 'mozc_task_rdef_torsrc',
'inputs': [
'./<@(rdef).rdef',
],
'outputs': [
'<(gen_out_dir)/<@(rdef).rsrc',
],
'action': [
'python', 'tools/rc.py',
'--outpath', '<@(_outputs)',
'<@(_inputs)',
],
},
],
}
],
}],
],
}
Loading

0 comments on commit 66c938d

Please sign in to comment.