Codebase list mozc / debian/1.2.809.102-1
Update kfreebsd patch Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org> Nobuhiro Iwamatsu 12 years ago
1 changed file(s) with 111 addition(s) and 45 deletion(s). Raw diff Collapse all Expand all
214214 struct timespec timestamp;
215215 if (-1 == clock_gettime(CLOCK_REALTIME, &timestamp)) {
216216 return 0;
217 diff --git a/base/thread.h b/base/thread.h
218 index 681c3f6..e1d9ecf 100755
219 --- a/base/thread.h
220 +++ b/base/thread.h
221 @@ -58,10 +58,10 @@
222 #endif // OS_WINDOWS
223
224 // Use GCC's keyword on Linux.
225 -#ifdef OS_LINUX
226 +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD)
227 #define TLS_KEYWORD __thread
228 #define HAVE_TLS 1
229 -#endif // OS_LINUX
230 +#endif // OS_LINUX || OS_GNU_KFREEBSD || OS_FREEBSD
231
232
233 // OSX doesn't support Thread Local Storage.
217234 diff --git a/base/util.cc b/base/util.cc
218235 index 41f30e7..ecaaba5 100755
219236 --- a/base/util.cc
288305 const size_t page_size = sysconf(_SC_PAGESIZE);
289306 #else
290307 diff --git a/build_mozc.py b/build_mozc.py
291 index d9afab8..57542c7 100755
308 index d9afab8..f3a856d 100755
292309 --- a/build_mozc.py
293310 +++ b/build_mozc.py
294311 @@ -72,6 +72,14 @@ def IsLinux():
369386 command_line.extend(['-D', 'pkg_config_command=%s' % GetPkgConfigCommand()])
370387 else:
371388 command_line.extend(['-D', 'pkg_config_command='])
372 @@ -661,6 +675,41 @@ def BuildOnLinux(options, targets, unused_original_directory_name):
389 @@ -661,6 +675,42 @@ def BuildOnLinux(options, targets, unused_original_directory_name):
373390
374391 RunOrDie([make_command] + build_args + target_names)
375392
377394 + """Build the targets on *BSD."""
378395 + target_names = []
379396 + for target in targets:
380 + (unused_gyp_file_name, target_name) = ParseTarget(target)
397 + (unused_gyp_file_name, target_name) = (
398 + CanonicalTargetToGypFileAndTargetName(target))
381399 + target_names.append(target_name)
382400 +
383401 + if os.uname()[0] == 'FreeBSD' :
411429
412430 def CheckFileOrDie(file_name):
413431 """Check the file exists or dies if not."""
414 @@ -776,6 +825,8 @@ def BuildMain(options, targets, original_directory_name):
432 @@ -776,6 +826,8 @@ def BuildMain(options, targets, original_directory_name):
415433 BuildOnMac(options, targets, original_directory_name)
416434 elif IsLinux():
417435 BuildOnLinux(options, targets, original_directory_name)
420438 elif IsWindows():
421439 BuildOnWindows(options, targets, original_directory_name)
422440 else:
423 @@ -899,7 +950,7 @@ def CleanBuildFilesAndDirectories(options, unused_args):
441 @@ -899,7 +951,7 @@ def CleanBuildFilesAndDirectories(options, unused_args):
424442 elif IsMac():
425443 directory_names.extend(glob.glob(os.path.join(gyp_directory_name,
426444 '*.xcodeproj')))
429447 file_names.extend(glob.glob(os.path.join(gyp_directory_name,
430448 '*.target.mk')))
431449 file_names.extend(glob.glob(os.path.join(gyp_directory_name,
432 @@ -918,6 +969,10 @@ def CleanBuildFilesAndDirectories(options, unused_args):
450 @@ -918,6 +970,10 @@ def CleanBuildFilesAndDirectories(options, unused_args):
433451 file_names.append('Makefile')
434452 elif IsWindows():
435453 file_names.append('third_party/breakpad/breakpad.gyp')
440458 # Remove files.
441459 for file_name in file_names:
442460 RemoveFile(file_name)
443 @@ -944,6 +999,42 @@ def ShowHelpAndExit():
461 @@ -944,7 +1000,6 @@ def ShowHelpAndExit():
444462 print 'See also the comment in the script for typical usage.'
445463 sys.exit(1)
446464
447 +def BuildOnBSD(options, targets):
448 + """Build the targets on *BSD."""
449 + target_names = []
450 + for target in targets:
451 + (unused_gyp_file_name, target_name) = ParseTarget(target)
452 + target_names.append(target_name)
453 +
454 + if os.uname()[0] == 'FreeBSD' :
455 + make_command = os.getenv('BUILD_COMMAND', 'gmake')
456 + else:
457 + make_command = os.getenv('BUILD_COMMAND', 'make')
458 +
459 + # flags for building in Chrome OS chroot environment
460 + envvars = [
461 + 'CFLAGS',
462 + 'CXXFLAGS',
463 + 'CXX',
464 + 'CC',
465 + 'AR',
466 + 'AS',
467 + 'RANLIB',
468 + 'LD',
469 + ]
470 + for envvar in envvars:
471 + if envvar in os.environ:
472 + os.environ[envvar] = os.getenv(envvar)
473 +
474 + # set output directory
475 + os.environ['builddir_name'] = 'out_bsd'
476 +
477 + build_args = ['-j%s' % options.jobs, 'BUILDTYPE=%s' % options.configuration]
478 + if options.build_base:
479 + build_args.append('builddir_name=%s' % options.build_base)
480 +
481 + RunOrDie([make_command] + build_args + target_names)
482 +
483
465 -
484466 def main():
485467 if len(sys.argv) < 2:
468 ShowHelpAndExit()
486469 diff --git a/build_tools/mozc_version.py b/build_tools/mozc_version.py
487470 index 04d644b..b3ed870 100755
488471 --- a/build_tools/mozc_version.py
512495 if last_digit:
513496 return revision[0:-1] + last_digit
514497
498 diff --git a/config/stats_config_util.cc b/config/stats_config_util.cc
499 index f6f8be6..a424fa9 100755
500 --- a/config/stats_config_util.cc
501 +++ b/config/stats_config_util.cc
502 @@ -218,7 +218,7 @@ bool MacStatsConfigUtilImpl::SetEnabled(bool val) {
503 #endif // MACOSX
504
505
506 -#ifdef OS_LINUX
507 +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD)
508 class LinuxStatsConfigUtilImpl : public StatsConfigUtilInterface {
509 // TODO(toshiyuki): implement this
510 public:
511 diff --git a/config/stats_config_util_test.cc b/config/stats_config_util_test.cc
512 index 8babb47..30e68bc 100755
513 --- a/config/stats_config_util_test.cc
514 +++ b/config/stats_config_util_test.cc
515 @@ -756,7 +756,7 @@ TEST_F(StatsConfigUtilTestWin, IsEnabledForRunLevelLow) {
516 #else // CHANNEL_DEV
517 #endif // CHANNEL_DEV
518
519 -#ifdef OS_LINUX
520 +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD)
521 TEST(StatsConfigUtilTestLinux, DefaultValueTest) {
522 EXPECT_FALSE(mozc::StatsConfigUtil::IsEnabled());
523 }
515524 diff --git a/gui/base/locale_util.cc b/gui/base/locale_util.cc
516525 index 827fd28..52c881b 100755
517526 --- a/gui/base/locale_util.cc
762771 if ((server_path + " (deleted)") == server_path_) {
763772 LOG(WARNING) << server_path << " on disk is modified";
764773 // If a user updates the server binary on disk during the server is running,
774 diff --git a/ipc/ipc_path_manager_test.cc b/ipc/ipc_path_manager_test.cc
775 index a645563..0f79c70 100755
776 --- a/ipc/ipc_path_manager_test.cc
777 +++ b/ipc/ipc_path_manager_test.cc
778 @@ -92,7 +92,7 @@ TEST(IPCPathManagerTest, IPCPathManagerTest) {
779 EXPECT_FALSE(manager->GetServerProductVersion().empty());
780 EXPECT_GT(manager->GetServerProcessId(), 0);
781 EXPECT_EQ(t.path(), path);
782 -#ifdef OS_LINUX
783 +#if defined(OS_LINUX)
784 // On Linux, |path| should be abstract (see man unix(7) for details.)
785 ASSERT_FALSE(path.empty());
786 EXPECT_EQ('\0', path[0]);
765787 diff --git a/ipc/unix_ipc.cc b/ipc/unix_ipc.cc
766 index 3085320..3f94332 100755
788 index 3085320..37ff133 100755
767789 --- a/ipc/unix_ipc.cc
768790 +++ b/ipc/unix_ipc.cc
769791 @@ -28,7 +28,8 @@
794816 // If the OS is MAC, we should validate the peer by using LOCAL_PEERCRED.
795817 struct xucred peer_cred;
796818 socklen_t peer_cred_len = sizeof(struct xucred);
819 @@ -146,7 +147,7 @@ bool IsPeerValid(int socket, pid_t *pid) {
820 *pid = 0;
821 #endif
822
823 -#ifdef OS_LINUX
824 +#if defined(OS_LINUX)
825 // On ARM Linux, we do nothing and just return true since the platform
826 // sometimes doesn't support the getsockopt(sock, SOL_SOCKET, SO_PEERCRED)
827 // system call.
797828 @@ -185,7 +186,7 @@ bool SendMessage(int socket,
798829 return false;
799830 }
845876 'includes' : [
846877 '../gyp/install_build_tool.gypi',
847878 ],
879 diff --git a/session/session_converter_interface.h b/session/session_converter_interface.h
880 index 7f27398..da6c9cf 100755
881 --- a/session/session_converter_interface.h
882 +++ b/session/session_converter_interface.h
883 @@ -56,7 +56,7 @@ struct OperationPreferences {
884 bool use_cascading_window;
885 string candidate_shortcuts;
886 OperationPreferences() {
887 -#ifdef OS_LINUX
888 +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD)
889 // TODO(komatsu): Move this logic to the client code.
890 use_cascading_window = false;
891 #else
892 diff --git a/session/session_test.cc b/session/session_test.cc
893 index 4433081..4cdf7e9 100755
894 --- a/session/session_test.cc
895 +++ b/session/session_test.cc
896 @@ -2081,7 +2081,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) {
897
898 EXPECT_EQ(0, output.all_candidate_words().focused_index());
899 EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
900 -#ifdef OS_LINUX
901 +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD)
902 // Cascading window is not supported on Linux, so the size of
903 // candidate words is different from other platform.
904 // TODO(komatsu): Modify the client for Linux to explicitly change
905 @@ -2109,7 +2109,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) {
906
907 EXPECT_EQ(1, output.all_candidate_words().focused_index());
908 EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
909 -#ifdef OS_LINUX
910 +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD)
911 // Cascading window is not supported on Linux, so the size of
912 // candidate words is different from other platform.
913 // TODO(komatsu): Modify the client for Linux to explicitly change
848914 diff --git a/testing/testing.gyp b/testing/testing.gyp
849915 index 58d1cf3..34a59d6 100755
850916 --- a/testing/testing.gyp