Update kfreebsd support patch.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Nobuhiro Iwamatsu
12 years ago
0 | 0 | diff --git a/base/cpu_stats.cc b/base/cpu_stats.cc |
1 | index e915b35..1dcd91c 100755 | |
1 | index e915b35..a53141d 100755 | |
2 | 2 | --- a/base/cpu_stats.cc |
3 | 3 | +++ b/base/cpu_stats.cc |
4 | 4 | @@ -122,7 +122,7 @@ float CPUStats::GetSystemCPULoad() { |
6 | 6 | #endif // OS_MACOSX |
7 | 7 | |
8 | 8 | -#ifdef OS_LINUX |
9 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
9 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
10 | 10 | // NOT IMPLEMENTED |
11 | 11 | // TODO(taku): implement Linux version |
12 | 12 | // can take the info from /proc/stats |
15 | 15 | #endif // OS_MACOSX |
16 | 16 | |
17 | 17 | -#ifdef OS_LINUX |
18 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
18 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
19 | 19 | // not implemented |
20 | 20 | const uint64 total_times = 0; |
21 | 21 | const uint64 cpu_times = 0; |
24 | 24 | #endif // OS_MACOSX |
25 | 25 | |
26 | 26 | -#ifdef OS_LINUX |
27 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
27 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
28 | 28 | // Not implemented |
29 | 29 | return 1; |
30 | 30 | #endif // OS_LINUX |
42 | 42 | CrashReportHandler::Initialize(false); |
43 | 43 | } |
44 | 44 | diff --git a/base/iconv.cc b/base/iconv.cc |
45 | index ee05938..da0f058 100755 | |
45 | index 84c6380..6785171 100755 | |
46 | 46 | --- a/base/iconv.cc |
47 | 47 | +++ b/base/iconv.cc |
48 | @@ -52,7 +52,11 @@ void IconvHelper(iconv_t ic, const string &input, string *output) { | |
48 | @@ -52,7 +52,11 @@ bool IconvHelper(iconv_t ic, const string &input, string *output) { | |
49 | 49 | size_t olen_org = olen; |
50 | 50 | iconv(ic, 0, &ilen, 0, &olen); // reset iconv state |
51 | 51 | while (ilen != 0) { |
55 | 55 | if (iconv(ic, reinterpret_cast<char **>(&ibuf), &ilen, &obuf, &olen) |
56 | 56 | +#endif |
57 | 57 | == static_cast<size_t>(-1)) { |
58 | return; | |
58 | return false; | |
59 | 59 | } |
60 | 60 | diff --git a/base/logging.cc b/base/logging.cc |
61 | 61 | index ffeb703..5d0d104 100755 |
71 | 71 | #else |
72 | 72 | "%lu", |
73 | 73 | diff --git a/base/mutex.cc b/base/mutex.cc |
74 | index 14c110f..55045bd 100755 | |
74 | index 14c110f..fbdc00e 100755 | |
75 | 75 | --- a/base/mutex.cc |
76 | 76 | +++ b/base/mutex.cc |
77 | 77 | @@ -44,7 +44,8 @@ namespace mozc { |
79 | 79 | // Wrapper for Windows InterlockedCompareExchange |
80 | 80 | namespace { |
81 | 81 | -#ifdef OS_LINUX |
82 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
82 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
83 | 83 | +// TODO(taku): |
84 | 84 | // Linux doesn't provide InterlockedCompareExchange-like function. |
85 | 85 | inline int InterlockedCompareExchange(volatile int *target, |
105 | 105 | pthread_mutexattr_init(&attr); |
106 | 106 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_VALUE); |
107 | 107 | diff --git a/base/password_manager.cc b/base/password_manager.cc |
108 | index aa8b6b4..d508c5d 100755 | |
108 | index aa8b6b4..42718af 100755 | |
109 | 109 | --- a/base/password_manager.cc |
110 | 110 | +++ b/base/password_manager.cc |
111 | 111 | @@ -363,7 +363,7 @@ class DeprecatedMacPasswordManager : public PasswordManagerInterface { |
113 | 113 | // a new password manager which adopts some secure mechanism such |
114 | 114 | // like gnome-keyring. |
115 | 115 | -#if defined OS_LINUX |
116 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
116 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
117 | 117 | typedef PlainPasswordManager DefaultPasswordManager; |
118 | 118 | #endif |
119 | 119 | |
120 | 120 | diff --git a/base/process.cc b/base/process.cc |
121 | index 51eae95..aca659c 100755 | |
121 | index 51eae95..7f2d89b 100755 | |
122 | 122 | --- a/base/process.cc |
123 | 123 | +++ b/base/process.cc |
124 | 124 | @@ -51,7 +51,7 @@ |
126 | 126 | #endif // OS_MACOSX |
127 | 127 | |
128 | 128 | -#ifdef OS_LINUX |
129 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
129 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
130 | 130 | #include <fcntl.h> |
131 | 131 | #include <signal.h> |
132 | 132 | #include <spawn.h> // for posix_spawn(). |
135 | 135 | #endif |
136 | 136 | |
137 | 137 | -#ifdef OS_LINUX |
138 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
138 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
139 | 139 | static const char kBrowserCommand[] = "/usr/bin/xdg-open"; |
140 | 140 | // xdg-open which uses kfmclient or gnome-open internally works both on KDE |
141 | 141 | // and GNOME environments. |
144 | 144 | #endif |
145 | 145 | |
146 | 146 | -#ifdef OS_LINUX |
147 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
147 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
148 | 148 | // Do not call posix_spawn() for obviously bad path. |
149 | 149 | if (!S_ISREG(statbuf.st_mode)) { |
150 | 150 | LOG(ERROR) << "Not a regular file: " << path; |
153 | 153 | #endif // OS_WINDOWS |
154 | 154 | |
155 | 155 | -#ifdef OS_LINUX |
156 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
156 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
157 | 157 | const char kMozcTool[] = "mozc_tool"; |
158 | 158 | const string arg = "--mode=error_message_dialog --error_type=" + error_type; |
159 | 159 | size_t pid = 0; |
160 | 160 | diff --git a/base/run_level.cc b/base/run_level.cc |
161 | index 3523b04..777dcad 100755 | |
161 | index 8b1fe47..cc4c58a 100755 | |
162 | 162 | --- a/base/run_level.cc |
163 | 163 | +++ b/base/run_level.cc |
164 | 164 | @@ -38,7 +38,7 @@ |
166 | 166 | #endif |
167 | 167 | |
168 | 168 | -#ifdef OS_LINUX |
169 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
169 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
170 | 170 | #include <unistd.h> |
171 | 171 | #include <sys/types.h> |
172 | 172 | #endif |
173 | 173 | diff --git a/base/stopwatch.cc b/base/stopwatch.cc |
174 | index 04edac3..d9ed9a8 100755 | |
174 | index 04edac3..dd5020f 100755 | |
175 | 175 | --- a/base/stopwatch.cc |
176 | 176 | +++ b/base/stopwatch.cc |
177 | 177 | @@ -39,7 +39,7 @@ |
179 | 179 | #endif // OS_MACOSX |
180 | 180 | |
181 | 181 | -#if defined(OS_LINUX) |
182 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
182 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
183 | 183 | #include <sys/time.h> |
184 | 184 | #endif // OS_LINUX |
185 | 185 | |
188 | 188 | #endif // OS_MACOSX |
189 | 189 | |
190 | 190 | -#if defined(OS_LINUX) |
191 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
191 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
192 | 192 | return 1000000000LL; |
193 | 193 | #endif // OS_LINUX |
194 | 194 | } |
197 | 197 | #endif // OS_MACOSX |
198 | 198 | |
199 | 199 | -#if defined(OS_LINUX) |
200 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
200 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
201 | 201 | struct timespec timestamp; |
202 | 202 | if (-1 == clock_gettime(CLOCK_REALTIME, ×tamp)) { |
203 | 203 | return 0; |
204 | 204 | diff --git a/base/thread.h b/base/thread.h |
205 | index 25417e1..98e2e60 100755 | |
205 | index 422e63b..a5f5008 100755 | |
206 | 206 | --- a/base/thread.h |
207 | 207 | +++ b/base/thread.h |
208 | @@ -58,10 +58,10 @@ | |
209 | #endif // OS_WINDOWS | |
210 | ||
211 | // Use GCC's keyword on Linux. | |
212 | -#ifdef OS_LINUX | |
213 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
208 | @@ -59,7 +59,8 @@ | |
209 | ||
210 | // Andorid NDK doesn't support TLS. | |
211 | #if defined(OS_LINUX) && !defined(OS_ANDROID) && \ | |
212 | - (defined(__GNUC__) || defined(__clang__)) | |
213 | + (defined(__GNUC__) || defined(__clang__)) || \ | |
214 | + defined(OS_GNU_KFREEBSD) | |
215 | // GCC and Clang support TLS. | |
214 | 216 | #define TLS_KEYWORD __thread |
215 | 217 | #define HAVE_TLS 1 |
216 | -#endif // OS_LINUX | |
217 | +#endif // OS_LINUX || OS_GNU_KFREEBSD || OS_FREEBSD | |
218 | ||
219 | ||
220 | // OSX doesn't support Thread Local Storage. | |
221 | 218 | diff --git a/base/util.cc b/base/util.cc |
222 | index 24a7258..0ddf669 100755 | |
219 | index b0ac451..d5dfedf 100755 | |
223 | 220 | --- a/base/util.cc |
224 | 221 | +++ b/base/util.cc |
225 | @@ -2636,7 +2636,7 @@ string Util::GetServerDirectory() { | |
222 | @@ -2685,7 +2685,7 @@ string Util::GetServerDirectory() { | |
226 | 223 | return MacUtil::GetServerDirectory(); |
227 | 224 | #endif // OS_MACOSX |
228 | 225 | |
229 | 226 | -#ifdef OS_LINUX |
230 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
231 | return "/usr/lib/mozc"; | |
227 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
228 | return kMozcServerDirectory; | |
232 | 229 | #endif // OS_LINUX |
233 | 230 | } |
234 | @@ -2715,7 +2715,7 @@ string GetObjectNameAsString(HANDLE handle) { | |
231 | @@ -2764,7 +2764,7 @@ string GetObjectNameAsString(HANDLE handle) { | |
235 | 232 | #endif |
236 | 233 | |
237 | 234 | string Util::GetDesktopNameAsString() { |
238 | 235 | -#ifdef OS_LINUX |
239 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
236 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
240 | 237 | const char *display = getenv("DISPLAY"); |
241 | 238 | if (display == NULL) { |
242 | 239 | return ""; |
243 | @@ -3211,7 +3211,7 @@ bool Util::IsPlatformSupported() { | |
240 | @@ -3266,7 +3266,7 @@ bool Util::IsPlatformSupported() { | |
244 | 241 | #if defined(OS_MACOSX) |
245 | 242 | // TODO(yukawa): support Mac. |
246 | 243 | return true; |
247 | 244 | -#elif defined(OS_LINUX) |
248 | +#elif defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
245 | +#elif defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
249 | 246 | // TODO(yukawa): support Linux. |
250 | 247 | return true; |
251 | 248 | #elif defined(OS_WINDOWS) |
252 | @@ -3631,18 +3631,19 @@ string Util::GetOSVersionString() { | |
253 | } else { | |
254 | LOG(WARNING) << "GetVersionEx failed"; | |
255 | } | |
256 | - return ret; | |
257 | #elif defined(OS_MACOSX) | |
258 | const string ret = "MacOSX " + MacUtil::GetOSVersionString(); | |
259 | // TODO(toshiyuki): get more specific info | |
260 | - return ret; | |
249 | @@ -3694,6 +3694,9 @@ string Util::GetOSVersionString() { | |
261 | 250 | #elif defined(OS_LINUX) |
262 | 251 | const string ret = "Linux"; |
263 | - return ret; | |
252 | return ret; | |
264 | 253 | +#elif defined(OS_GNU_KFREEBSD) |
265 | 254 | + const string ret = "GNU/kFreeBSD"; |
266 | +#elif defined(OS_FREEBSD) | |
267 | + const string ret = "FreeBSD"; | |
255 | + return ret; | |
268 | 256 | #else |
269 | 257 | const string ret = "Unknown"; |
270 | - return ret; | |
271 | #endif | |
272 | + return ret; | |
273 | } | |
274 | ||
275 | void Util::DisableIME() { | |
276 | @@ -3676,7 +3677,7 @@ uint64 Util::GetTotalPhysicalMemory() { | |
258 | return ret; | |
259 | @@ -3731,7 +3734,7 @@ uint64 Util::GetTotalPhysicalMemory() { | |
277 | 260 | return 0; |
278 | 261 | } |
279 | 262 | return total_memory; |
280 | 263 | -#elif defined(OS_LINUX) |
281 | +#elif defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
264 | +#elif defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
282 | 265 | #if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES) |
283 | 266 | const long page_size = sysconf(_SC_PAGESIZE); |
284 | 267 | const long number_of_phyisical_pages = sysconf(_SC_PHYS_PAGES); |
285 | @@ -3702,7 +3703,7 @@ void Util::PreloadMappedRegion(const void *begin, | |
268 | @@ -3757,7 +3760,7 @@ void Util::PreloadMappedRegion(const void *begin, | |
286 | 269 | ::ZeroMemory(&system_info, sizeof(system_info)); |
287 | 270 | ::GetSystemInfo(&system_info); |
288 | 271 | const size_t page_size = system_info.dwPageSize; |
289 | 272 | -#elif defined(OS_MACOSX) || defined(OS_LINUX) |
290 | +#elif defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
273 | +#elif defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
291 | 274 | #if defined(_SC_PAGESIZE) |
292 | 275 | const size_t page_size = sysconf(_SC_PAGESIZE); |
293 | 276 | #else |
294 | 277 | diff --git a/build_mozc.py b/build_mozc.py |
295 | index 63c75e7..bc0f0f3 100755 | |
278 | index f8cd143..4471f88 100755 | |
296 | 279 | --- a/build_mozc.py |
297 | 280 | +++ b/build_mozc.py |
298 | 281 | @@ -72,6 +72,14 @@ def IsLinux(): |
328 | 311 | else: |
329 | 312 | logging.error('Unsupported platform: %s', os.name) |
330 | 313 | |
331 | @@ -205,7 +215,7 @@ def GetGypFileNames(options): | |
314 | @@ -204,7 +214,7 @@ def GetGypFileNames(options): | |
332 | 315 | if IsWindows(): |
333 | 316 | gyp_file_names.extend(glob.glob('%s/win32/*/*.gyp' % SRC_DIR)) |
334 | 317 | gyp_file_names.extend(glob.glob('third_party/breakpad/*.gyp')) |
337 | 320 | gyp_file_names.extend(glob.glob('%s/unix/*/*.gyp' % SRC_DIR)) |
338 | 321 | # Add ibus.gyp if ibus is installed. |
339 | 322 | # Ubuntu 8.04 (Hardy) does not contain ibus package. |
340 | @@ -366,6 +376,7 @@ def AddCommonOptions(parser): | |
341 | help='If you want ChromeOS build, specify "ChromeOS"') | |
323 | @@ -375,6 +385,7 @@ def AddCommonOptions(parser): | |
324 | 'If you want ChromeOS build, specify "ChromeOS".')) | |
342 | 325 | parser.add_option('--language', dest='language', default='japanese', |
343 | 326 | help='Specify the target language to build.') |
344 | 327 | + parser.add_option('--os', dest='os', default='linux') |
345 | 328 | return parser |
346 | 329 | |
347 | 330 | |
348 | @@ -485,7 +496,7 @@ def ExpandMetaTarget(meta_target_name, target_platform): | |
331 | @@ -549,7 +560,7 @@ def ExpandMetaTarget(meta_target_name, target_platform): | |
349 | 332 | targets = ['%s/unix/ibus/ibus.gyp:ibus_mozc', |
350 | 333 | '%s/server/server.gyp:mozc_server', |
351 | 334 | '%s/gui/gui.gyp:mozc_tool'] |
354 | 337 | targets = ['%s/unix/ibus/ibus.gyp:ibus_mozc', |
355 | 338 | '%s/server/server.gyp:mozc_server', |
356 | 339 | '%s/gui/gui.gyp:mozc_tool'] |
357 | @@ -600,6 +611,9 @@ def GypMain(options, unused_args): | |
340 | @@ -662,6 +673,9 @@ def GypMain(options, unused_args): | |
358 | 341 | else: |
359 | 342 | command_line.extend(['-D', 'use_wix=NO']) |
360 | 343 | |
364 | 347 | command_line.extend(['-D', 'build_base=%s' % GetBuildBaseName(options)]) |
365 | 348 | |
366 | 349 | |
367 | @@ -658,7 +672,7 @@ def GypMain(options, unused_args): | |
350 | @@ -777,7 +791,7 @@ def GypMain(options, unused_args): | |
368 | 351 | # command for pkg-config. Here we catch the environment variable |
369 | 352 | # and use the specified command instead of actual pkg-config |
370 | 353 | # command. |
373 | 356 | command_line.extend(['-D', 'pkg_config_command=%s' % GetPkgConfigCommand()]) |
374 | 357 | else: |
375 | 358 | command_line.extend(['-D', 'pkg_config_command=']) |
376 | @@ -763,6 +777,42 @@ def BuildOnLinux(options, targets, unused_original_directory_name): | |
359 | @@ -885,6 +899,42 @@ def BuildOnLinux(options, targets, unused_original_directory_name): | |
377 | 360 | |
378 | 361 | RunOrDie([make_command] + build_args + target_names) |
379 | 362 | |
416 | 399 | |
417 | 400 | def CheckFileOrDie(file_name): |
418 | 401 | """Check the file exists or dies if not.""" |
419 | @@ -928,6 +978,8 @@ def BuildMain(options, targets, original_directory_name): | |
402 | @@ -1049,6 +1099,8 @@ def BuildMain(options, targets, original_directory_name): | |
420 | 403 | BuildOnMac(options, targets, original_directory_name) |
421 | 404 | elif IsLinux(): |
422 | 405 | BuildOnLinux(options, targets, original_directory_name) |
425 | 408 | elif IsWindows(): |
426 | 409 | BuildOnWindows(options, targets, original_directory_name) |
427 | 410 | else: |
428 | @@ -1052,7 +1104,7 @@ def CleanBuildFilesAndDirectories(options, unused_args): | |
411 | @@ -1173,7 +1225,7 @@ def CleanBuildFilesAndDirectories(options, unused_args): | |
429 | 412 | elif IsMac(): |
430 | 413 | directory_names.extend(glob.glob(os.path.join(gyp_directory_name, |
431 | 414 | '*.xcodeproj'))) |
434 | 417 | file_names.extend(glob.glob(os.path.join(gyp_directory_name, |
435 | 418 | '*.target.mk'))) |
436 | 419 | file_names.extend(glob.glob(os.path.join(gyp_directory_name, |
437 | @@ -1072,6 +1124,10 @@ def CleanBuildFilesAndDirectories(options, unused_args): | |
420 | @@ -1193,6 +1245,10 @@ def CleanBuildFilesAndDirectories(options, unused_args): | |
438 | 421 | file_names.append('Makefile') |
439 | 422 | elif IsWindows(): |
440 | 423 | file_names.append('third_party/breakpad/breakpad.gyp') |
445 | 428 | # Remove files. |
446 | 429 | for file_name in file_names: |
447 | 430 | RemoveFile(file_name) |
448 | @@ -1098,7 +1154,6 @@ def ShowHelpAndExit(): | |
431 | @@ -1219,7 +1275,6 @@ def ShowHelpAndExit(): | |
449 | 432 | print 'See also the comment in the script for typical usage.' |
450 | 433 | sys.exit(1) |
451 | 434 | |
496 | 479 | # directory across configurations. The following variables must be |
497 | 480 | # the same as <(PRODUCT_DIR) for each configuration. |
498 | 481 | diff --git a/config/stats_config_util_test.cc b/config/stats_config_util_test.cc |
499 | index c13fdeb..de22cee 100755 | |
482 | index c13fdeb..11e2d0d 100755 | |
500 | 483 | --- a/config/stats_config_util_test.cc |
501 | 484 | +++ b/config/stats_config_util_test.cc |
502 | 485 | @@ -690,7 +690,7 @@ TEST_F(StatsConfigUtilTestWin, IsEnabled) { |
504 | 487 | #endif // CHANNEL_DEV |
505 | 488 | |
506 | 489 | -#ifdef OS_LINUX |
507 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
490 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
508 | 491 | TEST(StatsConfigUtilTestLinux, DefaultValueTest) { |
509 | 492 | EXPECT_FALSE(mozc::StatsConfigUtil::IsEnabled()); |
510 | 493 | } |
511 | 494 | diff --git a/gui/base/locale_util.cc b/gui/base/locale_util.cc |
512 | index 8089f8e..4f411a7 100755 | |
495 | index 8089f8e..ff9365f 100755 | |
513 | 496 | --- a/gui/base/locale_util.cc |
514 | 497 | +++ b/gui/base/locale_util.cc |
515 | 498 | @@ -198,7 +198,7 @@ TranslationDataImpl::TranslationDataImpl() |
517 | 500 | #endif |
518 | 501 | |
519 | 502 | -#ifdef OS_LINUX |
520 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
503 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
521 | 504 | // Use system default messages. |
522 | 505 | // Even if the locale is not English nor Japanese, load translation |
523 | 506 | // file to translate common messages like "OK" and "Cancel". |
524 | 507 | diff --git a/gui/config_dialog/config_dialog.cc b/gui/config_dialog/config_dialog.cc |
525 | index c3dff57..460c94f 100755 | |
508 | index 589c0a7..0ae7dc8 100755 | |
526 | 509 | --- a/gui/config_dialog/config_dialog.cc |
527 | 510 | +++ b/gui/config_dialog/config_dialog.cc |
528 | @@ -73,11 +73,11 @@ ConfigDialog::ConfigDialog() | |
511 | @@ -76,11 +76,11 @@ ConfigDialog::ConfigDialog() | |
529 | 512 | verboseLevelLabel->setVisible(false); |
530 | 513 | verboseLevelComboBox->setVisible(false); |
531 | 514 | |
532 | 515 | -#if defined(OS_MACOSX) || defined(OS_LINUX) |
533 | +#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
516 | +#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
534 | 517 | // The last "misc" tab has no valid configs on Mac and Linux |
535 | 518 | const int kMiscTabIndex = 6; |
536 | 519 | configDialogTabWidget->removeTab(kMiscTabIndex); |
537 | 520 | -#endif // OS_MACOSX || OS_LINUX |
538 | +#endif // OS_MACOSX || OS_LINUX || OS_GNU_KFREEBSD || OS_FREEBSD | |
521 | +#endif // OS_MACOSX || OS_LINUX || OS_GNU_KFREEBSD | |
539 | 522 | #endif // NO_LOGGING |
540 | 523 | |
541 | #if !defined(GOOGLE_JAPANESE_INPUT_BUILD) | |
542 | @@ -273,7 +273,7 @@ ConfigDialog::ConfigDialog() | |
524 | #ifndef ENABLE_CLOUD_SYNC | |
525 | @@ -305,7 +305,7 @@ ConfigDialog::ConfigDialog() | |
543 | 526 | dictionaryPreloadingAndUACLabel->setVisible(false); |
544 | 527 | #endif // OS_WINDOWS |
545 | 528 | |
546 | 529 | -#ifdef OS_LINUX |
547 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
530 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
548 | 531 | // On Linux, disable all fields for UsageStats |
549 | 532 | usageStatsLabel->setEnabled(false); |
550 | 533 | usageStatsLabel->setVisible(false); |
551 | @@ -362,7 +362,7 @@ bool ConfigDialog::Update() { | |
534 | @@ -421,7 +421,7 @@ bool ConfigDialog::Update() { | |
552 | 535 | } |
553 | 536 | |
554 | 537 | |
555 | 538 | -#if defined(OS_WINDOWS) || defined(OS_LINUX) |
556 | +#if defined(OS_WINDOWS) || defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
539 | +#if defined(OS_WINDOWS) || defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
557 | 540 | if (initial_preedit_method_ != |
558 | 541 | static_cast<int>(config.preedit_method()) || |
559 | 542 | initial_use_keyboard_to_change_preedit_method_ != |
560 | 543 | diff --git a/gui/config_dialog/keybinding_editor.cc b/gui/config_dialog/keybinding_editor.cc |
561 | index a28310a..fd3f01e 100755 | |
544 | index a28310a..6433a86 100755 | |
562 | 545 | --- a/gui/config_dialog/keybinding_editor.cc |
563 | 546 | +++ b/gui/config_dialog/keybinding_editor.cc |
547 | @@ -33,7 +33,7 @@ | |
548 | #include <windows.h> | |
549 | #include <imm.h> | |
550 | #include <ime.h> | |
551 | -#elif OS_LINUX | |
552 | +#elif defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
553 | #define XK_MISCELLANY | |
554 | #include <X11/keysymdef.h> | |
555 | #endif | |
556 | @@ -121,7 +121,7 @@ const WinVirtualKeyEntry kWinVirtualKeyModifierNonRequiredTable[] = { | |
557 | { VK_DBE_DBCSCHAR, "Hankaku/Zenkaku" }, // Zenkaku/hankaku | |
558 | // { VK_KANJI, "Kanji" }, // Do not support Kanji | |
559 | }; | |
560 | -#elif OS_LINUX | |
561 | +#elif defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
562 | struct LinuxVirtualKeyEntry { | |
563 | uint16 virtual_key; | |
564 | const char *mozc_key_name; | |
565 | @@ -387,7 +387,7 @@ KeyBindingFilter::KeyState KeyBindingFilter::AddKey( | |
566 | return Encode(result); | |
567 | } | |
568 | } | |
569 | -#elif OS_LINUX | |
570 | +#elif defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
571 | // Handle JP109's Muhenkan/Henkan/katakana-hiragana and Zenkaku/Hankaku | |
572 | const uint16 virtual_key = key_event.nativeVirtualKey(); | |
573 | for (size_t i = 0; i < arraysize(kLinuxVirtualKeyModifierNonRequiredTable); | |
564 | 574 | @@ -472,7 +472,7 @@ bool KeyBindingFilter::eventFilter(QObject *obj, QEvent *event) { |
565 | 575 | KeyBindingEditor::KeyBindingEditor(QWidget *parent, QWidget *trigger_parent) |
566 | 576 | : QDialog(parent), trigger_parent_(trigger_parent) { |
567 | 577 | setupUi(this); |
568 | 578 | -#ifdef OS_LINUX |
569 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
579 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
570 | 580 | // Workaround for the issue http://code.google.com/p/mozc/issues/detail?id=9 |
571 | 581 | // Seems that even after clicking the button for the keybinding dialog, |
572 | 582 | // the edit is not raised. This might be a bug of setFocusProxy. |
573 | 583 | diff --git a/gui/config_dialog/keymap_editor.cc b/gui/config_dialog/keymap_editor.cc |
574 | index 33ab590..4f8e217 100755 | |
584 | index 853aca7..41cec81 100755 | |
575 | 585 | --- a/gui/config_dialog/keymap_editor.cc |
576 | 586 | +++ b/gui/config_dialog/keymap_editor.cc |
577 | 587 | @@ -447,7 +447,7 @@ bool KeyMapEditorDialog::Update() { |
579 | 589 | |
580 | 590 | if (new_ime_switch_keymap != ime_switch_keymap_) { |
581 | 591 | -#if defined(OS_WINDOWS) || defined(OS_LINUX) |
582 | +#if defined(OS_WINDOWS) || defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
592 | +#if defined(OS_WINDOWS) || defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
583 | 593 | QMessageBox::information( |
584 | 594 | this, |
585 | 595 | tr("Mozc settings"), |
586 | 596 | diff --git a/gui/dictionary_tool/dictionary_tool.cc b/gui/dictionary_tool/dictionary_tool.cc |
587 | index 2f60969..ac3bee8 100755 | |
597 | index 0b0cce2..87b8e4e 100755 | |
588 | 598 | --- a/gui/dictionary_tool/dictionary_tool.cc |
589 | 599 | +++ b/gui/dictionary_tool/dictionary_tool.cc |
590 | @@ -317,7 +317,7 @@ DictionaryTool::DictionaryTool(QWidget *parent) | |
600 | @@ -325,7 +325,7 @@ DictionaryTool::DictionaryTool(QWidget *parent) | |
591 | 601 | } |
592 | 602 | |
593 | 603 | // main window |
597 | 607 | // TODO(taku): investigate the cause of the crashes |
598 | 608 | setCentralWidget(splitter_); |
599 | 609 | diff --git a/gui/gui.gyp b/gui/gui.gyp |
600 | index 038d204..e5efe44 100755 | |
610 | index d69c07a..b649475 100755 | |
601 | 611 | --- a/gui/gui.gyp |
602 | 612 | +++ b/gui/gui.gyp |
603 | @@ -378,7 +378,7 @@ | |
604 | 'includes': [ | |
605 | 'qt_libraries.gypi', | |
606 | ], | |
607 | - 'conditions': [['use_libzinnia==1 and OS=="linux"', { | |
608 | + 'conditions': [['use_libzinnia==1 and (OS=="linux" or OS=="gnu-kfreebsd")', { | |
609 | 'defines': [ | |
610 | 'USE_LIBZINNIA', | |
611 | ], | |
613 | @@ -384,7 +384,7 @@ | |
614 | '../languages/japanese/japanese.gyp:language_dependent_spec_japanese', | |
615 | ], | |
616 | }], | |
617 | - ['use_libzinnia==1 and OS=="linux"', { | |
618 | + ['use_libzinnia==1 and (OS=="linux" or OS=="gnu-kfreebsd"', { | |
619 | 'defines': [ | |
620 | 'USE_LIBZINNIA', | |
621 | ], | |
612 | 622 | diff --git a/gui/qt_libraries.gypi b/gui/qt_libraries.gypi |
613 | 623 | index ba5bf3e..4f90f7d 100755 |
614 | 624 | --- a/gui/qt_libraries.gypi |
636 | 646 | ['use_libzinnia==1', { |
637 | 647 | 'link_settings': { |
638 | 648 | diff --git a/gyp/common.gypi b/gyp/common.gypi |
639 | index 3d70455..8e37814 100755 | |
649 | index 48cb042..c8c9fd3 100755 | |
640 | 650 | --- a/gyp/common.gypi |
641 | 651 | +++ b/gyp/common.gypi |
642 | @@ -261,7 +261,7 @@ | |
652 | @@ -282,7 +282,7 @@ | |
643 | 653 | }, |
644 | 654 | }, |
645 | 655 | 'conditions': [ |
648 | 658 | 'cflags': [ |
649 | 659 | '<@(debug_extra_cflags)', |
650 | 660 | ], |
651 | @@ -317,7 +317,7 @@ | |
661 | @@ -338,7 +338,7 @@ | |
652 | 662 | }, |
653 | 663 | }, |
654 | 664 | 'conditions': [ |
657 | 667 | 'cflags': [ |
658 | 668 | '<@(release_extra_cflags)', |
659 | 669 | ], |
660 | @@ -588,6 +588,51 @@ | |
670 | @@ -613,6 +613,51 @@ | |
661 | 671 | }], |
662 | 672 | ], |
663 | 673 | }], |
709 | 719 | ['OS=="mac"', { |
710 | 720 | 'defines': [ |
711 | 721 | 'OS_MACOSX', |
712 | @@ -642,7 +687,7 @@ | |
722 | @@ -667,7 +712,7 @@ | |
713 | 723 | # Linux gyp (into scons) doesn't like target_conditions? |
714 | 724 | # TODO(team): track down why 'target_conditions' doesn't work |
715 | 725 | # on Linux gyp into scons like it does on Mac gyp into xcodeproj. |
719 | 729 | '-fprofile-arcs' ], |
720 | 730 | 'link_settings': { 'libraries': [ '-lgcov' ] }, |
721 | 731 | diff --git a/handwriting/handwriting.gyp b/handwriting/handwriting.gyp |
722 | index 1009837..422cdf8 100755 | |
732 | index a077b99..d72ec7b 100755 | |
723 | 733 | --- a/handwriting/handwriting.gyp |
724 | 734 | +++ b/handwriting/handwriting.gyp |
725 | 735 | @@ -39,7 +39,7 @@ |
732 | 742 | 'USE_LIBZINNIA', |
733 | 743 | ], |
734 | 744 | diff --git a/ipc/ipc_path_manager.cc b/ipc/ipc_path_manager.cc |
735 | index a5a62fb..bcdaf81 100755 | |
745 | index 8efa613..6df3ed5 100755 | |
736 | 746 | --- a/ipc/ipc_path_manager.cc |
737 | 747 | +++ b/ipc/ipc_path_manager.cc |
748 | @@ -79,7 +79,7 @@ string GetIPCKeyFileName(const string &name) { | |
749 | #endif | |
750 | ||
751 | basename.append(name); | |
752 | -#ifdef OS_LINUX | |
753 | +#ifdef OS_LINUX || defined(OS_GNU_KFREEBSD) | |
754 | // TODO(nona): Support multi platform | |
755 | const language::LanguageDependentSpecInterface *lang_spec = | |
756 | language::GlobalLanguageSpec::GetLanguageDependentSpec(); | |
738 | 757 | @@ -274,7 +274,7 @@ bool IPCPathManager::GetPathName(string *ipc_name) { |
739 | 758 | *ipc_name = kIPCPrefix; |
740 | 759 | #endif // OS_WINDOWS |
741 | 760 | |
742 | 761 | -#ifdef OS_LINUX |
743 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
762 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
744 | 763 | // On Linux, use abstract namespace which is independent of the file system. |
745 | 764 | (*ipc_name)[0] = '\0'; |
746 | 765 | #endif |
749 | 768 | #endif |
750 | 769 | |
751 | 770 | -#ifdef OS_LINUX |
752 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
771 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
753 | 772 | // load from /proc/<pid>/exe |
754 | 773 | char proc[128]; |
755 | 774 | char filename[512]; |
758 | 777 | } |
759 | 778 | |
760 | 779 | -#ifdef OS_LINUX |
761 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
780 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
762 | 781 | if ((server_path + " (deleted)") == server_path_) { |
763 | 782 | LOG(WARNING) << server_path << " on disk is modified"; |
764 | 783 | // If a user updates the server binary on disk during the server is running, |
765 | 784 | diff --git a/ipc/ipc_path_manager_test.cc b/ipc/ipc_path_manager_test.cc |
766 | index f0b5fcc..4abb655 100755 | |
785 | index f0b5fcc..604cd33 100755 | |
767 | 786 | --- a/ipc/ipc_path_manager_test.cc |
768 | 787 | +++ b/ipc/ipc_path_manager_test.cc |
769 | 788 | @@ -108,7 +108,7 @@ TEST_F(IPCPathManagerTest, IPCPathManagerTest) { |
771 | 790 | EXPECT_GT(manager->GetServerProcessId(), 0); |
772 | 791 | EXPECT_EQ(t.path(), path); |
773 | 792 | -#ifdef OS_LINUX |
774 | +#if defined(OS_LINUX) | |
793 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
775 | 794 | // On Linux, |path| should be abstract (see man unix(7) for details.) |
776 | 795 | ASSERT_FALSE(path.empty()); |
777 | 796 | EXPECT_EQ('\0', path[0]); |
778 | 797 | diff --git a/ipc/unix_ipc.cc b/ipc/unix_ipc.cc |
779 | index acdc334..213e762 100755 | |
798 | index acdc334..e39cf33 100755 | |
780 | 799 | --- a/ipc/unix_ipc.cc |
781 | 800 | +++ b/ipc/unix_ipc.cc |
782 | 801 | @@ -28,7 +28,8 @@ |
812 | 831 | #endif |
813 | 832 | |
814 | 833 | -#ifdef OS_LINUX |
815 | +#if defined(OS_LINUX) | |
834 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
816 | 835 | // On ARM Linux, we do nothing and just return true since the platform |
817 | 836 | // sometimes doesn't support the getsockopt(sock, SOL_SOCKET, SO_PEERCRED) |
818 | 837 | // system call. |
833 | 852 | +#endif // defined(OS_LINUX) || defined(OS_MACOSX) || |
834 | 853 | + // defined(OS_FREEBSD) || defined(OS_GNU_KFREEBSD) |
835 | 854 | diff --git a/languages/chewing/chewing.gyp b/languages/chewing/chewing.gyp |
836 | index 18fa842..0160ad6 100755 | |
855 | index 094478a..d099c6e 100755 | |
837 | 856 | --- a/languages/chewing/chewing.gyp |
838 | 857 | +++ b/languages/chewing/chewing.gyp |
839 | 858 | @@ -61,7 +61,7 @@ |
846 | 865 | { |
847 | 866 | 'target_name': 'ibus_mozc_chewing_metadata', |
848 | 867 | diff --git a/languages/hangul/hangul.gyp b/languages/hangul/hangul.gyp |
849 | index 6a7a9e4..084cc4c 100755 | |
868 | index 7fd29c9..593bd5f 100755 | |
850 | 869 | --- a/languages/hangul/hangul.gyp |
851 | 870 | +++ b/languages/hangul/hangul.gyp |
852 | @@ -59,7 +59,7 @@ | |
871 | @@ -58,7 +58,7 @@ | |
853 | 872 | }, |
854 | 873 | ], |
855 | 874 | 'conditions': [ |
872 | 891 | #else |
873 | 892 | #error "Unsupported platform. Windows, Mac OS X, and GNU/Linux are supported." |
874 | 893 | diff --git a/protobuf/genproto.gypi b/protobuf/genproto.gypi |
875 | index d197312..e26f517 100755 | |
894 | index a0db8b8..d67f511 100755 | |
876 | 895 | --- a/protobuf/genproto.gypi |
877 | 896 | +++ b/protobuf/genproto.gypi |
878 | @@ -39,7 +39,7 @@ | |
879 | '<(protobuf_dir)/protobuf.gyp:install_protoc', | |
880 | ], | |
881 | }], | |
897 | @@ -34,7 +34,7 @@ | |
898 | 'build_tools_dir%': '../build_tools', | |
899 | }, | |
900 | 'conditions': [ | |
882 | 901 | - ['OS!="linux"', { |
883 | 902 | + ['OS!="linux" and OS!="gnu-kfreebsd"', { |
884 | 903 | 'variables': { |
885 | 904 | 'protoc_command%': '<(relative_dir)/<(mozc_build_tools_dir)/protoc<(EXECUTABLE_SUFFIX)', |
886 | 905 | }, |
887 | 906 | diff --git a/protobuf/protobuf.gyp b/protobuf/protobuf.gyp |
888 | index 17de9f5..31a4fcf 100755 | |
907 | index bc936db..93f19dd 100755 | |
889 | 908 | --- a/protobuf/protobuf.gyp |
890 | 909 | +++ b/protobuf/protobuf.gyp |
891 | 910 | @@ -116,7 +116,7 @@ |
907 | 926 | '../gyp/install_build_tool.gypi', |
908 | 927 | ], |
909 | 928 | diff --git a/session/session_converter_interface.h b/session/session_converter_interface.h |
910 | index f410edd..0b63f47 100755 | |
929 | index a52347e..e831186 100755 | |
911 | 930 | --- a/session/session_converter_interface.h |
912 | 931 | +++ b/session/session_converter_interface.h |
913 | 932 | @@ -56,7 +56,7 @@ struct OperationPreferences { |
915 | 934 | string candidate_shortcuts; |
916 | 935 | OperationPreferences() { |
917 | 936 | -#ifdef OS_LINUX |
918 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) || defined(OS_FREEBSD) | |
937 | +#if defined(OS_LINUX) || defined(OS_GNU_KFREEBSD) | |
919 | 938 | // TODO(komatsu): Move this logic to the client code. |
920 | 939 | use_cascading_window = false; |
921 | 940 | #else |
922 | 941 | diff --git a/session/session_test.cc b/session/session_test.cc |
923 | index 195e4ba..e5da4fd 100755 | |
942 | index 1a53d4a..ab581cd 100755 | |
924 | 943 | --- a/session/session_test.cc |
925 | 944 | +++ b/session/session_test.cc |
926 | @@ -2089,7 +2089,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) { | |
945 | @@ -2253,7 +2253,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) { | |
927 | 946 | |
928 | 947 | EXPECT_EQ(0, output.all_candidate_words().focused_index()); |
929 | 948 | EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category()); |
932 | 951 | // Cascading window is not supported on Linux, so the size of |
933 | 952 | // candidate words is different from other platform. |
934 | 953 | // TODO(komatsu): Modify the client for Linux to explicitly change |
935 | @@ -2117,7 +2117,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) { | |
954 | @@ -2281,7 +2281,7 @@ TEST_F(SessionTest, OutputAllCandidateWords) { | |
936 | 955 | |
937 | 956 | EXPECT_EQ(1, output.all_candidate_words().focused_index()); |
938 | 957 | EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category()); |
941 | 960 | // Cascading window is not supported on Linux, so the size of |
942 | 961 | // candidate words is different from other platform. |
943 | 962 | // TODO(komatsu): Modify the client for Linux to explicitly change |
944 | diff --git a/testing/testing.gyp b/testing/testing.gyp | |
945 | index f43dd30..9593e5e 100755 | |
946 | --- a/testing/testing.gyp | |
947 | +++ b/testing/testing.gyp | |
948 | @@ -53,7 +53,7 @@ | |
949 | '../base/base.gyp:base', | |
950 | ], | |
951 | 'conditions': [ | |
952 | - ['OS!="linux"', { | |
953 | + ['OS!="linux" and OS!="gnu-kfreebsd"', { | |
954 | 'dependencies': [ | |
955 | 'testing', | |
956 | ], |