118 | 118 |
pthread_mutexattr_init(&attr);
|
119 | 119 |
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_VALUE);
|
120 | 120 |
diff --git a/base/password_manager.cc b/base/password_manager.cc
|
121 | |
index 2a25e28..6b3b37e 100755
|
|
121 |
index cf0b422..61a381f 100755
|
122 | 122 |
--- a/base/password_manager.cc
|
123 | 123 |
+++ b/base/password_manager.cc
|
124 | |
@@ -358,7 +358,7 @@ class MacPasswordManager : public PasswordManagerInterface {
|
|
124 |
@@ -363,7 +363,7 @@ class DeprecatedMacPasswordManager : public PasswordManagerInterface {
|
125 | 125 |
// this module to other Linux distro, you might want to implement
|
126 | 126 |
// a new password manager which adopts some secure mechanism such
|
127 | 127 |
// like gnome-keyring.
|
|
184 | 184 |
#include <sys/types.h>
|
185 | 185 |
#endif
|
186 | 186 |
diff --git a/base/stats_config_util.cc b/base/stats_config_util.cc
|
187 | |
index 9c53383..057280a 100755
|
|
187 |
index 8bd3f9e..aed4d37 100755
|
188 | 188 |
--- a/base/stats_config_util.cc
|
189 | 189 |
+++ b/base/stats_config_util.cc
|
190 | |
@@ -336,7 +336,7 @@ bool MacStatsConfigUtilImpl::SetEnabled(bool val) {
|
191 | |
}
|
|
190 |
@@ -337,7 +337,7 @@ bool MacStatsConfigUtilImpl::SetEnabled(bool val) {
|
192 | 191 |
#endif // MACOSX
|
|
192 |
|
193 | 193 |
|
194 | 194 |
-#ifdef OS_LINUX
|
195 | 195 |
+#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD)
|
|
197 | 197 |
// TODO(toshiyuki): implement this
|
198 | 198 |
public:
|
199 | 199 |
diff --git a/base/stats_config_util_test.cc b/base/stats_config_util_test.cc
|
200 | |
index 9e15918..461e9ef 100755
|
|
200 |
index b780a5a..59d3fb7 100755
|
201 | 201 |
--- a/base/stats_config_util_test.cc
|
202 | 202 |
+++ b/base/stats_config_util_test.cc
|
203 | |
@@ -840,7 +840,7 @@ TEST_F(StatsConfigUtilTestWin,
|
204 | |
} // namespace mozc
|
|
203 |
@@ -841,7 +841,7 @@ TEST_F(StatsConfigUtilTestWin,
|
205 | 204 |
#endif // OS_WINDOWS
|
|
205 |
|
206 | 206 |
|
207 | 207 |
-#ifdef OS_LINUX
|
208 | 208 |
+#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD)
|
|
241 | 241 |
if (-1 == clock_gettime(CLOCK_REALTIME, ×tamp)) {
|
242 | 242 |
return 0;
|
243 | 243 |
diff --git a/base/util.cc b/base/util.cc
|
244 | |
index acc7d6a..5110892 100755
|
|
244 |
index 4260471..e12b98f 100755
|
245 | 245 |
--- a/base/util.cc
|
246 | 246 |
+++ b/base/util.cc
|
247 | |
@@ -2319,7 +2319,7 @@ string Util::GetServerDirectory() {
|
|
247 |
@@ -2352,7 +2352,7 @@ string Util::GetServerDirectory() {
|
248 | 248 |
return MacUtil::GetServerDirectory();
|
249 | 249 |
#endif // OS_MACOSX
|
250 | 250 |
|
|
253 | 253 |
return "/usr/lib/mozc";
|
254 | 254 |
#endif // OS_LINUX
|
255 | 255 |
}
|
256 | |
@@ -2399,7 +2399,7 @@ string GetObjectNameAsString(HANDLE handle) {
|
|
256 |
@@ -2440,7 +2440,7 @@ string GetObjectNameAsString(HANDLE handle) {
|
257 | 257 |
#endif
|
258 | 258 |
|
259 | 259 |
string Util::GetDesktopNameAsString() {
|
|
262 | 262 |
const char *display = getenv("DISPLAY");
|
263 | 263 |
if (display == NULL) {
|
264 | 264 |
return "";
|
265 | |
@@ -2867,7 +2867,7 @@ bool Util::IsPlatformSupported() {
|
|
265 |
@@ -2917,7 +2917,7 @@ bool Util::IsPlatformSupported() {
|
266 | 266 |
#if defined(OS_MACOSX)
|
267 | 267 |
// TODO(yukawa): support Mac.
|
268 | 268 |
return true;
|
|
271 | 271 |
// TODO(yukawa): support Linux.
|
272 | 272 |
return true;
|
273 | 273 |
#elif defined(OS_WINDOWS)
|
274 | |
@@ -3238,18 +3238,19 @@ string Util::GetOSVersionString() {
|
|
274 |
@@ -3288,18 +3288,19 @@ string Util::GetOSVersionString() {
|
275 | 275 |
} else {
|
276 | 276 |
LOG(WARNING) << "GetVersionEx failed";
|
277 | 277 |
}
|
|
295 | 295 |
}
|
296 | 296 |
|
297 | 297 |
void Util::DisableIME() {
|
298 | |
@@ -3283,7 +3284,7 @@ uint64 Util::GetTotalPhysicalMemory() {
|
|
298 |
@@ -3333,7 +3334,7 @@ uint64 Util::GetTotalPhysicalMemory() {
|
299 | 299 |
return 0;
|
300 | 300 |
}
|
301 | 301 |
return total_memory;
|
|
304 | 304 |
#if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
|
305 | 305 |
const long page_size = sysconf(_SC_PAGESIZE);
|
306 | 306 |
const long number_of_phyisical_pages = sysconf(_SC_PHYS_PAGES);
|
307 | |
@@ -3309,7 +3310,7 @@ void Util::PreloadMappedRegion(const void *begin,
|
|
307 |
@@ -3359,7 +3360,7 @@ void Util::PreloadMappedRegion(const void *begin,
|
308 | 308 |
::ZeroMemory(&system_info, sizeof(system_info));
|
309 | 309 |
::GetSystemInfo(&system_info);
|
310 | 310 |
const size_t page_size = system_info.dwPageSize;
|
|
314 | 314 |
const size_t page_size = sysconf(_SC_PAGESIZE);
|
315 | 315 |
#else
|
316 | 316 |
diff --git a/build_mozc.py b/build_mozc.py
|
317 | |
index 54ca8f5..8ea9644 100755
|
|
317 |
index 680c539..a3adfae 100755
|
318 | 318 |
--- a/build_mozc.py
|
319 | 319 |
+++ b/build_mozc.py
|
320 | 320 |
@@ -72,6 +72,14 @@ def IsLinux():
|
|
341 | 341 |
# Count the number of 'vendor_id' in /proc/cpuinfo, assuming that
|
342 | 342 |
# each line corresponds to one logical CPU.
|
343 | 343 |
cpuinfo = open('/proc/cpuinfo', 'r')
|
344 | |
@@ -184,7 +192,7 @@ def GetGypFileNames():
|
|
344 |
@@ -114,6 +122,8 @@ def GetBuildBaseName(options):
|
|
345 |
# On Linux, seems there is no way to specify the build_base directory
|
|
346 |
# inside common.gypi
|
|
347 |
build_base = 'out_linux'
|
|
348 |
+ elif IsFreeBSD() or IsGNUkFreeBSD():
|
|
349 |
+ build_base = 'out_bsd'
|
|
350 |
else:
|
|
351 |
logging.error('Unsupported platform: %s', os.name)
|
|
352 |
|
|
353 |
@@ -188,7 +198,7 @@ def GetGypFileNames():
|
345 | 354 |
gyp_file_names.extend(glob.glob('%s/win32/*/*.gyp' % SRC_DIR))
|
346 | 355 |
gyp_file_names.extend(glob.glob('third_party/breakpad/*.gyp'))
|
347 | 356 |
gyp_file_names.append('third_party/mozc/sandbox/sandbox.gyp')
|
|
350 | 359 |
gyp_file_names.extend(glob.glob('%s/unix/*/*.gyp' % SRC_DIR))
|
351 | 360 |
# Add ibus.gyp if ibus is installed.
|
352 | 361 |
# Ubuntu 8.04 (Hardy) does not contain ibus package.
|
353 | |
@@ -259,7 +267,7 @@ def CleanBuildFilesAndDirectories():
|
|
362 |
@@ -263,7 +273,7 @@ def CleanBuildFilesAndDirectories():
|
354 | 363 |
elif IsMac():
|
355 | 364 |
directory_names.extend(glob.glob(os.path.join(gyp_directory_name,
|
356 | 365 |
'*.xcodeproj')))
|
|
359 | 368 |
file_names.extend(glob.glob(os.path.join(gyp_directory_name,
|
360 | 369 |
'*.target.mk')))
|
361 | 370 |
file_names.extend(glob.glob(os.path.join(gyp_directory_name,
|
362 | |
@@ -274,6 +282,10 @@ def CleanBuildFilesAndDirectories():
|
|
371 |
@@ -282,6 +292,10 @@ def CleanBuildFilesAndDirectories():
|
363 | 372 |
file_names.append('Makefile')
|
364 | 373 |
elif IsWindows():
|
365 | 374 |
file_names.append('third_party/breakpad/breakpad.gyp')
|
|
370 | 379 |
# Remove files.
|
371 | 380 |
for file_name in file_names:
|
372 | 381 |
RemoveFile(file_name)
|
373 | |
@@ -359,6 +371,8 @@ def GypMain(deps_file_name):
|
|
382 |
@@ -378,6 +392,8 @@ def GypMain(deps_file_name):
|
374 | 383 |
command_line.extend(['-D', 'use_qt=NO'])
|
375 | 384 |
if options.coverage:
|
376 | 385 |
command_line.extend(['-D', 'coverage=1'])
|
|
379 | 388 |
|
380 | 389 |
command_line.extend(['-D', 'build_base=%s' % GetBuildBaseName(options)])
|
381 | 390 |
|
382 | |
@@ -408,6 +422,8 @@ def RunTests(configuration, unused_calculate_coverage):
|
|
391 |
@@ -425,6 +441,8 @@ def RunTests(configuration, unused_calculate_coverage):
|
383 | 392 |
base_path = os.path.join('out_linux', configuration)
|
384 | 393 |
elif IsWindows():
|
385 | 394 |
base_path = os.path.join('out_win', configuration)
|
|
388 | 397 |
else:
|
389 | 398 |
logging.error('Unsupported platform: %s', os.name)
|
390 | 399 |
return
|
391 | |
@@ -556,13 +572,14 @@ def ParseGypOptions():
|
|
400 |
@@ -578,13 +596,14 @@ def ParseGypOptions():
|
392 | 401 |
'This flag is false by default because it may require you '
|
393 | |
'to install libchewing in your environment.')
|
|
402 |
'to install libhangul in your environment.')
|
394 | 403 |
|
395 | 404 |
-
|
396 | 405 |
# Linux environment can build both for Linux and ChromeOS.
|
|
404 | 413 |
(options, unused_args) = parser.parse_args()
|
405 | 414 |
return options
|
406 | 415 |
|
407 | |
@@ -680,6 +697,7 @@ def BuildOnLinux(options, targets):
|
|
416 |
@@ -611,7 +630,7 @@ def ParseMetaTarget(meta_target_name, target_platform):
|
|
417 |
targets = ['%s/unix/ibus/ibus.gyp:ibus_mozc',
|
|
418 |
'%s/server/server.gyp:mozc_server',
|
|
419 |
'%s/gui/gui.gyp:mozc_tool']
|
|
420 |
- elif IsLinux():
|
|
421 |
+ elif IsLinux() or IsFreeBSD() or IsGNUkFreeBSD():
|
|
422 |
targets = ['%s/unix/ibus/ibus.gyp:ibus_mozc',
|
|
423 |
'%s/server/server.gyp:mozc_server',
|
|
424 |
'%s/gui/gui.gyp:mozc_tool']
|
|
425 |
@@ -639,7 +658,7 @@ def ParseBuildOptions():
|
|
426 |
help='specify target platform.')
|
|
427 |
|
|
428 |
# On Linux, seems there is no way to set build_base in the ParseGyp section
|
|
429 |
- if IsLinux():
|
|
430 |
+ if IsLinux() or IsFreeBSD() or IsGNUkFreeBSD():
|
|
431 |
parser.add_option('--build_base', dest='build_base',
|
|
432 |
help='specify the base directory of the built binaries.')
|
|
433 |
|
|
434 |
@@ -709,6 +728,7 @@ def BuildOnLinux(options, targets):
|
408 | 435 |
target_names.append(target_name)
|
409 | 436 |
|
410 | 437 |
make_command = os.getenv('BUILD_COMMAND', 'make')
|
|
412 | 439 |
# flags for building in Chrome OS chroot environment
|
413 | 440 |
envvars = [
|
414 | 441 |
'CFLAGS',
|
415 | |
@@ -694,7 +712,7 @@ def BuildOnLinux(options, targets):
|
|
442 |
@@ -723,7 +743,7 @@ def BuildOnLinux(options, targets):
|
416 | 443 |
for envvar in envvars:
|
417 | 444 |
if envvar in os.environ:
|
418 | 445 |
os.environ[envvar] = os.getenv(envvar)
|
|
421 | 448 |
# set output directory
|
422 | 449 |
os.environ['builddir_name'] = 'out_linux'
|
423 | 450 |
|
424 | |
@@ -704,6 +722,42 @@ def BuildOnLinux(options, targets):
|
|
451 |
@@ -735,6 +755,42 @@ def BuildOnLinux(options, targets):
|
425 | 452 |
|
426 | 453 |
RunOrDie([make_command] + build_args + target_names)
|
427 | 454 |
|
|
464 | 491 |
|
465 | 492 |
def CheckFileOrDie(file_name):
|
466 | 493 |
"""Check the file exists or dies if not."""
|
467 | |
@@ -796,6 +850,8 @@ def BuildMain(original_directory_name):
|
|
494 |
@@ -827,6 +883,8 @@ def BuildMain(original_directory_name):
|
468 | 495 |
BuildOnMac(options, targets, original_directory_name)
|
469 | 496 |
elif IsLinux():
|
470 | 497 |
BuildOnLinux(options, targets)
|
|
474 | 501 |
BuildOnWindows(options, targets, original_directory_name)
|
475 | 502 |
else:
|
476 | 503 |
diff --git a/build_tools/mozc_version.py b/build_tools/mozc_version.py
|
477 | |
index 0717592..52d8477 100755
|
|
504 |
index 4fbb7c6..91d099f 100755
|
478 | 505 |
--- a/build_tools/mozc_version.py
|
479 | 506 |
+++ b/build_tools/mozc_version.py
|
480 | |
@@ -57,6 +57,13 @@ def IsLinux():
|
|
507 |
@@ -58,6 +58,13 @@ def IsLinux():
|
481 | 508 |
"""Returns true if the platform is Linux."""
|
482 | 509 |
return os.name == 'posix' and os.uname()[0] == 'Linux'
|
483 | 510 |
|
|
489 | 516 |
+ """Returns true if the platform is GNU/kFreeBSD."""
|
490 | 517 |
+ return os.name == 'posix' and os.uname()[0] == 'GNU/kFreeBSD'
|
491 | 518 |
|
492 | |
def CalculateRevisionForPlatform(revision):
|
|
519 |
def CalculateRevisionForPlatform(revision, target_platform):
|
493 | 520 |
"""Returns the revision for the current platform."""
|
494 | |
@@ -68,6 +75,10 @@ def CalculateRevisionForPlatform(revision):
|
|
521 |
@@ -71,6 +78,10 @@ def CalculateRevisionForPlatform(revision, target_platform):
|
495 | 522 |
last_digit = '1'
|
496 | 523 |
elif IsLinux():
|
497 | 524 |
last_digit = '2'
|
|
503 | 530 |
return revision[0:-1] + last_digit
|
504 | 531 |
|
505 | 532 |
diff --git a/client/session.cc b/client/session.cc
|
506 | |
index 9b113d1..8d36ef5 100755
|
|
533 |
index 5704872..6e16334 100755
|
507 | 534 |
--- a/client/session.cc
|
508 | 535 |
+++ b/client/session.cc
|
509 | |
@@ -848,7 +848,7 @@ bool Session::LaunchTool(const string &mode, const string &extra_arg) {
|
|
536 |
@@ -885,7 +885,7 @@ bool Session::LaunchTool(const string &mode, const string &extra_arg) {
|
510 | 537 |
return false;
|
511 | 538 |
}
|
512 | 539 |
|
|
551 | 578 |
// Even if the locale is not English nor Japanese, load translation
|
552 | 579 |
// file to translate common messages like "OK" and "Cancel".
|
553 | 580 |
diff --git a/gui/config_dialog/config_dialog.cc b/gui/config_dialog/config_dialog.cc
|
554 | |
index 9ca0af8..02b13ed 100755
|
|
581 |
index 515f702..5639f96 100755
|
555 | 582 |
--- a/gui/config_dialog/config_dialog.cc
|
556 | 583 |
+++ b/gui/config_dialog/config_dialog.cc
|
557 | 584 |
@@ -74,11 +74,11 @@ ConfigDialog::ConfigDialog()
|
|
622 | 649 |
this,
|
623 | 650 |
tr("Mozc settings"),
|
624 | 651 |
diff --git a/gui/dictionary_tool/dictionary_tool.cc b/gui/dictionary_tool/dictionary_tool.cc
|
625 | |
index 3bfc372..525b4ff 100755
|
|
652 |
index b9dd49d..b01ec09 100755
|
626 | 653 |
--- a/gui/dictionary_tool/dictionary_tool.cc
|
627 | 654 |
+++ b/gui/dictionary_tool/dictionary_tool.cc
|
628 | 655 |
@@ -305,7 +305,7 @@ DictionaryTool::DictionaryTool(QWidget *parent)
|
|
661 | 688 |
'libraries': [
|
662 | 689 |
' <!@(pkg-config --libs QtCore QtGui)',
|
663 | 690 |
diff --git a/gui/qt_moc.gypi b/gui/qt_moc.gypi
|
664 | |
index 81e6015..d768b10 100755
|
|
691 |
index db47221..f5a006e 100755
|
665 | 692 |
--- a/gui/qt_moc.gypi
|
666 | 693 |
+++ b/gui/qt_moc.gypi
|
667 | 694 |
@@ -31,7 +31,7 @@
|
|
713 | 740 |
},{ # OS!="linux"
|
714 | 741 |
'uic_path': '<(qt_basepath)/bin/uic<(EXECUTABLE_SUFFIX)',
|
715 | 742 |
diff --git a/gyp/common.gypi b/gyp/common.gypi
|
716 | |
index b80245f..4fb428b 100755
|
|
743 |
index 0f7fade..839fecb 100755
|
717 | 744 |
--- a/gyp/common.gypi
|
718 | 745 |
+++ b/gyp/common.gypi
|
719 | |
@@ -211,7 +211,7 @@
|
|
746 |
@@ -226,7 +226,7 @@
|
720 | 747 |
},
|
721 | 748 |
},
|
722 | 749 |
'conditions': [
|
|
725 | 752 |
'cflags': [
|
726 | 753 |
'<@(debug_extra_cflags)',
|
727 | 754 |
],
|
728 | |
@@ -250,7 +250,7 @@
|
|
755 |
@@ -265,7 +265,7 @@
|
729 | 756 |
},
|
730 | 757 |
},
|
731 | 758 |
'conditions': [
|
|
734 | 761 |
'cflags': [
|
735 | 762 |
'<@(release_extra_cflags)',
|
736 | 763 |
],
|
737 | |
@@ -459,6 +459,51 @@
|
|
764 |
@@ -470,6 +470,51 @@
|
738 | 765 |
}],
|
739 | 766 |
],
|
740 | 767 |
}],
|
|
786 | 813 |
['OS=="mac"', {
|
787 | 814 |
'defines': [
|
788 | 815 |
'OS_MACOSX',
|
789 | |
@@ -514,7 +559,7 @@
|
|
816 |
@@ -524,7 +569,7 @@
|
790 | 817 |
# Linux gyp (into scons) doesn't like target_conditions?
|
791 | 818 |
# TODO(team): track down why 'target_conditions' doesn't work
|
792 | 819 |
# on Linux gyp into scons like it does on Mac gyp into xcodeproj.
|
|
827 | 854 |
LOG(WARNING) << server_path << " on disk is modified";
|
828 | 855 |
// If a user updates the server binary on disk during the server is running,
|
829 | 856 |
diff --git a/ipc/unix_ipc.cc b/ipc/unix_ipc.cc
|
830 | |
index 3085320..5e8c080 100755
|
|
857 |
index 3085320..3f94332 100755
|
831 | 858 |
--- a/ipc/unix_ipc.cc
|
832 | 859 |
+++ b/ipc/unix_ipc.cc
|
833 | 860 |
@@ -28,7 +28,8 @@
|
|
888 | 915 |
'protoc_command%': '<(relative_dir)/<(mozc_build_tools_dir)/protoc<(EXECUTABLE_SUFFIX)',
|
889 | 916 |
},
|
890 | 917 |
diff --git a/protobuf/protobuf.gyp b/protobuf/protobuf.gyp
|
891 | |
index e36b373..a22f11b 100755
|
|
918 |
index 6072864..a619ddc 100755
|
892 | 919 |
--- a/protobuf/protobuf.gyp
|
893 | 920 |
+++ b/protobuf/protobuf.gyp
|
894 | 921 |
@@ -116,7 +116,7 @@
|
|
910 | 937 |
'../gyp/install_build_tool.gypi',
|
911 | 938 |
],
|
912 | 939 |
diff --git a/testing/testing.gyp b/testing/testing.gyp
|
913 | |
index dd7b8af..2177daf 100755
|
|
940 |
index 58d1cf3..34a59d6 100755
|
914 | 941 |
--- a/testing/testing.gyp
|
915 | 942 |
+++ b/testing/testing.gyp
|
916 | |
@@ -52,7 +52,7 @@
|
|
943 |
@@ -53,7 +53,7 @@
|
917 | 944 |
'../base/base.gyp:base',
|
918 | 945 |
],
|
919 | 946 |
'conditions': [
|
|
922 | 949 |
'dependencies': [
|
923 | 950 |
'testing',
|
924 | 951 |
],
|
|
952 |
diff --git a/gui/gui.gyp b/gui/gui.gyp
|
|
953 |
index 63db153..f558643 100755
|
|
954 |
--- a/gui/gui.gyp
|
|
955 |
+++ b/gui/gui.gyp
|
|
956 |
@@ -360,7 +360,7 @@
|
|
957 |
'gen_character_pad_data',
|
|
958 |
'gen_dictionary_tool_files',
|
|
959 |
],
|
|
960 |
- 'conditions': [['use_libzinnia==1 and OS=="linux"', {
|
|
961 |
+ 'conditions': [['use_libzinnia==1 and (OS=="linux" or OS=="gnu-kfreebsd")', {
|
|
962 |
'defines': [
|
|
963 |
'USE_LIBZINNIA',
|
|
964 |
],
|
|
965 |
diff --git a/gui/zinnia.gyp b/gui/zinnia.gyp
|
|
966 |
index e06e67c..a3ca5ae 100755
|
|
967 |
--- a/gui/zinnia.gyp
|
|
968 |
+++ b/gui/zinnia.gyp
|
|
969 |
@@ -45,7 +45,7 @@
|
|
970 |
'target_name': 'zinnia',
|
|
971 |
'type': 'static_library',
|
|
972 |
'conditions': [
|
|
973 |
- ['OS=="linux"', {
|
|
974 |
+ ['OS=="linux" or OS=="gnu-kfreebsd"', {
|
|
975 |
'conditions': [
|
|
976 |
['use_libzinnia==1', {
|
|
977 |
'link_settings': {
|