~ubuntu-branches/ubuntu/oneiric/mozc/oneiric

« back to all changes in this revision

Viewing changes to .pc/protobuf.patch/gyp/common.gypi

  • Committer: Bazaar Package Importer
  • Author(s): Nobuhiro Iwamatsu
  • Date: 2010-07-14 03:26:47 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100714032647-13qjisj6m8cm8jdx
Tags: 0.12.410.102-1
* New upstream release (Closes: #588971).
  - Add mozc-server, mozc-utils-gui and scim-mozc packages.
* Update debian/rules.
  Add --gypdir option to build_mozc.py.
* Update debian/control.
  - Bumped standards-version to 3.9.0.
  - Update description.
* Add mozc icon (Closes: #588972).
* Add patch which revises issue 18.
  ibus_mozc_issue18.patch
* kFreeBSD build support.
  support_kfreebsd.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2010, Google Inc.
2
 
# All rights reserved.
3
 
#
4
 
# Redistribution and use in source and binary forms, with or without
5
 
# modification, are permitted provided that the following conditions are
6
 
# met:
7
 
#
8
 
#     * Redistributions of source code must retain the above copyright
9
 
# notice, this list of conditions and the following disclaimer.
10
 
#     * Redistributions in binary form must reproduce the above
11
 
# copyright notice, this list of conditions and the following disclaimer
12
 
# in the documentation and/or other materials provided with the
13
 
# distribution.
14
 
#     * Neither the name of Google Inc. nor the names of its
15
 
# contributors may be used to endorse or promote products derived from
16
 
# this software without specific prior written permission.
17
 
#
18
 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 
 
30
 
# IMPORTANT:
31
 
# Please don't directly include this file since the gypi files is
32
 
# automatically included.
33
 
# You may find cool techniques in the following *.gypi file.
34
 
# http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi
35
 
{
36
 
  'variables': {
37
 
    # Define default values in the inner 'variables' dict. This looks
38
 
    # weird but necessary.
39
 
    'variables': {
40
 
      # By default, we build mozc in two passes to avoid unnecessary code
41
 
      # generation. For instance, it takes quite some time to generate
42
 
      # embedded_dictionary_data.h. If we build mozc in one pass, we end up
43
 
      # invoking the code generation every time code used in the code
44
 
      # generation tool is changed. In fact, a comment fix in 'base/util.h'
45
 
      # causes the code generation. We want to avoid that.
46
 
      'two_pass_build%': 1,
47
 
    },
48
 
    'two_pass_build%': '<(two_pass_build)',
49
 
 
50
 
    # warning_cflags_cflags will be shared with Mac and Linux.
51
 
    'warning_cflags': [
52
 
      '-Wall',
53
 
      '-Werror',
54
 
      '-Wno-char-subscripts',
55
 
      '-Wno-sign-compare',
56
 
      '-Wwrite-strings',
57
 
    ],
58
 
    # gcc_cflags_cflags will be shared with Mac and Linux.
59
 
    'gcc_cflags': [
60
 
      '-fmessage-length=0',
61
 
      '-fno-omit-frame-pointer',
62
 
      '-fno-strict-aliasing',
63
 
      '-funsigned-char',
64
 
      '-include base/namespace.h',
65
 
      '-pipe',
66
 
    ],
67
 
    'msvc_libs_x86': [
68
 
      '<(DEPTH)/../third_party/platformsdk/v6_1/files/Lib',
69
 
      '<(DEPTH)/../third_party/atlmfc_vc80/files/lib',
70
 
      '<(DEPTH)/../third_party/vc_80/files/vc/lib',
71
 
    ],
72
 
    'msvc_libs_x64': [
73
 
      '<(DEPTH)/../third_party/platformsdk/v6_1/files/lib/x64',
74
 
      '<(DEPTH)/../third_party/atlmfc_vc80/files/lib/amd64',
75
 
      '<(DEPTH)/../third_party/vc_80/files/vc/lib/amd64',
76
 
    ],
77
 
    # We wanted to have this directory under the build output directory
78
 
    # (ex. 'out' for Linux), but there is no variable defined for the top
79
 
    # level source directory, hence we create the directory in the top
80
 
    # level source directory.
81
 
    'mozc_build_tools_dir': '<(DEPTH)/mozc_build_tools/<(OS)',
82
 
    'proto_out_dir': '<(SHARED_INTERMEDIATE_DIR)/proto_out',
83
 
    'branding%': 'Mozc',
84
 
  },
85
 
  'target_defaults': {
86
 
    'variables': {
87
 
      # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
88
 
      'mac_release_optimization%': '2', # Use -O2 unless overridden
89
 
      'mac_debug_optimization%': '0',   # Use -O0 unless overridden
90
 
      # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
91
 
      'win_release_optimization%': '2', # 2 = /Os
92
 
      'win_debug_optimization%': '0',   # 0 = /Od
93
 
      # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
94
 
      'win_release_static_crt%': '0',  # 0 = /MT (nondebug static)
95
 
      'win_debug_static_crt%': '1',    # 1 = /MTd (debug static)
96
 
      'win_release_dynamic_crt%': '2', # 2 = /MD (nondebug dynamic)
97
 
      'win_debug_dynamic_crt%': '3',   # 3 = /MDd (debug dynamic)
98
 
      # See http://msdn.microsoft.com/en-us/library/aa652352(VS.71).aspx
99
 
      'win_target_machine_x86%': '1',
100
 
      'win_target_machine_x64%': '17',
101
 
      # See http://msdn.microsoft.com/en-us/library/aa652256(VS.71).aspx
102
 
      'win_char_set_not_set%': '0',
103
 
      'win_char_set_unicode%': '1',
104
 
      'win_char_set_mbcs%': '2',
105
 
      # Extra cflags for gcc
106
 
      'release_extra_cflags%': ['-O2'],
107
 
      'debug_extra_cflags%': ['-O0', '-g'],
108
 
    },
109
 
    'configurations': {
110
 
      'Common_Base': {
111
 
        'abstract': 1,
112
 
        'msvs_configuration_attributes': {
113
 
          'CharacterSet': '<(win_char_set_unicode)',
114
 
        },
115
 
        'conditions': [
116
 
          ['branding=="GoogleJapaneseInput"', {
117
 
           'defines': ['GOOGLE_JAPANESE_INPUT_BUILD'],
118
 
          }, {  # else
119
 
           'defines': ['MOZC_BUILD'],
120
 
          },],
121
 
        ],
122
 
      },
123
 
      'x86_Base': {
124
 
        'abstract': 1,
125
 
        'msvs_settings': {
126
 
          'VCLibrarianTool': {
127
 
            'AdditionalLibraryDirectories': [
128
 
              '<@(msvc_libs_x86)',
129
 
            ],
130
 
            'AdditionalLibraryDirectories!': [
131
 
              '<@(msvc_libs_x64)',
132
 
            ],
133
 
          },
134
 
          'VCLinkerTool': {
135
 
            'TargetMachine': '<(win_target_machine_x86)',
136
 
            'AdditionalOptions': [
137
 
              '/SAFESEH',
138
 
            ],
139
 
            'AdditionalLibraryDirectories': [
140
 
              '<@(msvc_libs_x86)',
141
 
            ],
142
 
            'AdditionalLibraryDirectories!': [
143
 
              '<@(msvc_libs_x64)',
144
 
            ],
145
 
          },
146
 
        },
147
 
        'msvs_configuration_attributes': {
148
 
          'OutputDirectory': '<(DEPTH)/out_win/$(ConfigurationName)',
149
 
          'IntermediateDirectory': '<(DEPTH)/out_win/$(ConfigurationName)/obj/$(ProjectName)',
150
 
        },
151
 
        'msvs_configuration_platform': 'Win32',
152
 
      },
153
 
      'x64_Base': {
154
 
        'abstract': 1,
155
 
        'msvs_configuration_attributes': {
156
 
          'OutputDirectory': '<(DEPTH)/out_win/$(ConfigurationName)64',
157
 
          'IntermediateDirectory': '<(DEPTH)/out_win/$(ConfigurationName)64/obj/$(ProjectName)',
158
 
        },
159
 
        'msvs_configuration_platform': 'x64',
160
 
        'msvs_settings': {
161
 
          'VCLibrarianTool': {
162
 
            'AdditionalLibraryDirectories': [
163
 
              '<@(msvc_libs_x64)',
164
 
            ],
165
 
            'AdditionalLibraryDirectories!': [
166
 
              '<@(msvc_libs_x86)',
167
 
            ],
168
 
          },
169
 
          'VCLinkerTool': {
170
 
            'TargetMachine': '<(win_target_machine_x64)',
171
 
            'AdditionalLibraryDirectories': [
172
 
              '<@(msvc_libs_x64)',
173
 
            ],
174
 
            'AdditionalLibraryDirectories!': [
175
 
              '<@(msvc_libs_x86)',
176
 
            ],
177
 
          },
178
 
        },
179
 
      },
180
 
      'Debug_Base': {
181
 
        'abstract': 1,
182
 
        'xcode_settings': {
183
 
          'COPY_PHASE_STRIP': 'NO',
184
 
          'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
185
 
          'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
186
 
        },
187
 
        'msvs_settings': {
188
 
          'VCCLCompilerTool': {
189
 
            'Optimization': '<(win_debug_optimization)',
190
 
            'PreprocessorDefinitions': ['_DEBUG'],
191
 
            'BasicRuntimeChecks': '3',
192
 
            'RuntimeLibrary': '<(win_debug_static_crt)',
193
 
          },
194
 
          'VCResourceCompilerTool': {
195
 
            'PreprocessorDefinitions': ['_DEBUG'],
196
 
          },
197
 
        },
198
 
        'conditions': [
199
 
          ['OS=="linux"', {
200
 
            'cflags': [
201
 
              '<@(debug_extra_cflags)',
202
 
            ],
203
 
          }],
204
 
        ],
205
 
      },
206
 
      'Optimize_Base': {
207
 
        'abstract': 1,
208
 
        'defines': [
209
 
          'NDEBUG',
210
 
          'QT_NO_DEBUG',
211
 
        ],
212
 
        'xcode_settings': {
213
 
          'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
214
 
          'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
215
 
          'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
216
 
        },
217
 
        'msvs_settings': {
218
 
          'VCCLCompilerTool': {
219
 
            'Optimization': '<(win_release_optimization)',
220
 
            'RuntimeLibrary': '<(win_release_static_crt)',
221
 
          },
222
 
        },
223
 
        'conditions': [
224
 
          ['OS=="linux"', {
225
 
            'cflags': [
226
 
             '<@(release_extra_cflags)',
227
 
            ],
228
 
          }],
229
 
        ],
230
 
      },
231
 
      'Release_Base': {
232
 
        'abstract': 1,
233
 
        'defines': [
234
 
          'NO_LOGGING',
235
 
          'IGNORE_HELP_FLAG',
236
 
          'IGNORE_INVALID_FLAG'
237
 
        ],
238
 
        'msvs_configuration_attributes': {
239
 
          'WholeProgramOptimization': '1',
240
 
        },
241
 
        'msvs_settings': {
242
 
          'VCLinkerTool': {
243
 
            # /PDBALTPATH is documented in Visual C++ 2010
244
 
            # http://msdn.microsoft.com/en-us/library/dd998269(VS.100).aspx
245
 
            'AdditionalOptions': ['/PDBALTPATH:%_PDB%'],
246
 
          },
247
 
        },
248
 
      },
249
 
      #
250
 
      # Concrete configurations
251
 
      #
252
 
      'Debug': {
253
 
        'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
254
 
      },
255
 
      'Optimize': {
256
 
        'inherit_from': ['Common_Base', 'x86_Base', 'Optimize_Base'],
257
 
      },
258
 
      'Release': {
259
 
        'inherit_from': ['Optimize', 'Release_Base'],
260
 
      },
261
 
      'conditions': [
262
 
        ['OS=="win"', {
263
 
          'Debug_x64': {
264
 
            'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
265
 
          },
266
 
          'Optimize_x64': {
267
 
            'inherit_from': ['Common_Base', 'x64_Base', 'Optimize_Base'],
268
 
          },
269
 
          'Release_x64': {
270
 
            'inherit_from': ['Optimize_x64', 'Release_Base'],
271
 
          },
272
 
        }],
273
 
      ],
274
 
    },
275
 
    'default_configuration': 'Debug',
276
 
    'defines': [
277
 
      # For gtest
278
 
      'GTEST_HAS_TR1_TUPLE=0',
279
 
      # For gtest
280
 
      # For gtest
281
 
      'MOZC_DATA_DIR="<(SHARED_INTERMEDIATE_DIR)"',
282
 
    ],
283
 
    'include_dirs': [
284
 
      '<(DEPTH)',
285
 
      '<(DEPTH)/..',
286
 
      '<(DEPTH)/third_party/gtest',
287
 
      '<(DEPTH)/third_party/gtest/include',
288
 
      '<(DEPTH)/third_party/breakpad/src',
289
 
      '<(SHARED_INTERMEDIATE_DIR)',
290
 
      '<(SHARED_INTERMEDIATE_DIR)/proto_out',
291
 
      '../protobuf/files/src',
292
 
    ],
293
 
    'conditions': [
294
 
      ['OS=="win"', {
295
 
        'defines': [
296
 
          'COMPILER_MSVC',
297
 
          'ID_TRACE_LEVEL=1',
298
 
          'OS_WINDOWS',
299
 
          'UNICODE',
300
 
          'WIN32',
301
 
          'WIN32_IE=0x0600',
302
 
          'WINVER=0x0501',
303
 
          '_ATL_ALL_WARNINGS',
304
 
          '_ATL_APARTMENT_THREADED',
305
 
          '_ATL_CSTRING_EXPLICIT_CONSTRUCTORS',
306
 
          '_CONSOLE',
307
 
          '_CRT_SECURE_NO_DEPRECATE',
308
 
          '_MIDL_USE_GUIDDEF_',
309
 
          '_STL_MSVC',
310
 
          '_UNICODE',
311
 
          '_USRDLL',
312
 
          '_WIN32',
313
 
          '_WIN32_WINDOWS=0x0410',
314
 
          '_WIN32_WINNT=0x0501',
315
 
          '_WINDLL',
316
 
          '_WINDOWS',
317
 
        ],
318
 
        'include_dirs': [
319
 
          '<(DEPTH)/../third_party/platformsdk/v6_1/files/include',
320
 
          '<(DEPTH)/../third_party/wtl_80/files/include',
321
 
          '<(DEPTH)/../third_party/atlmfc_vc80/files/include',
322
 
          '<(DEPTH)/../third_party/vc_80/files/vc/include'
323
 
        ],
324
 
        # We don't have cygwin in our tree, but we need to have
325
 
        # setup_env.bat in the directory specified in 'msvs_cygwin_dirs'
326
 
        # for GYP to be happy.
327
 
        'msvs_cygwin_dirs': [
328
 
          '<(DEPTH)/gyp',
329
 
        ],
330
 
        'msvs_settings': {
331
 
          'VCCLCompilerTool': {
332
 
            'BufferSecurityCheck': 'True',         # /GS
333
 
            'CompileAs': '2',                      # /TP
334
 
            'CompileOnly': 'True',                 # /c
335
 
            'DebugInformationFormat': '3',         # /Zi
336
 
            'DefaultCharIsUnsigned': 'True',       # /J
337
 
            'DisableSpecificWarnings': ['4018', '4150', '4722'],
338
 
                                                   # /wdXXXX
339
 
            'EnableFunctionLevelLinking': 'True',  # /Gy
340
 
            'EnableIntrinsicFunctions': 'True',    # /Oi
341
 
            'ExceptionHandling': '2',              # /EHs
342
 
            'ForcedIncludeFiles': ['base/namespace.h'],
343
 
                                                   # /FI<header_file.h>
344
 
            'OptimizeForWindows98': '1',           # /OPT:NOWIN98
345
 
            'OmitFramePointers': 'False',          # /Oy-
346
 
            'SuppressStartupBanner': 'True',       # /nologo
347
 
            'TreatWChar_tAsBuiltInType': 'False',  # /Zc:wchar_t-
348
 
            'WarningLevel': '3',                   # /W3
349
 
          },
350
 
          'VCLinkerTool': {
351
 
            # TODO(satorux): Reduce the number of libraries. We should
352
 
            # only have common libraries here.
353
 
            'AdditionalDependencies': [
354
 
              'Advapi32.lib',
355
 
              'comdlg32.lib',
356
 
              'crypt32.lib',
357
 
              'dbghelp.lib',
358
 
              'delayimp.lib',
359
 
              'gdi32.lib',
360
 
              'imm32.lib',
361
 
              'kernel32.lib',
362
 
              'msi.lib',
363
 
              'odbc32.lib',
364
 
              'odbccp32.lib',
365
 
              'ole32.lib',
366
 
              'oleaut32.lib',
367
 
              'psapi.lib',
368
 
              'shell32.lib',
369
 
              'shlwapi.lib',
370
 
              'user32.lib',
371
 
              'uuid.lib',
372
 
              'version.lib',
373
 
              'wininet.lib',
374
 
              'winmm.lib',
375
 
              'winspool.lib',
376
 
            ],
377
 
            'AdditionalOptions': [
378
 
              '/DYNAMICBASE',  # 'RandomizedBaseAddress': 'True'
379
 
              '/NXCOMPAT',
380
 
            ],
381
 
            'EnableCOMDATFolding': '2',            # /OPT:ICF
382
 
            'GenerateDebugInformation': 'True',    # /DEBUG
383
 
            'LinkIncremental': '1',                # /INCREMENTAL:NO
384
 
            'OptimizeReferences': '2',             # /OPT:REF
385
 
            'TerminalServerAware': '2',            # /TSAWARE
386
 
          },
387
 
          'VCResourceCompilerTool': {
388
 
            # TODO(yukawa): embed version info via command line parameters.
389
 
            'PreprocessorDefinitions': [
390
 
              'MOZC_RES_USE_TEMPLATE=1',
391
 
              'MOZC_RES_FILE_VERSION_NUMBER="0,0,1,9999"',
392
 
              'MOZC_RES_PRODUCT_VERSION_NUMBER="0,0,1,9999"',
393
 
              'MOZC_RES_FILE_VERSION_STRING="""0.0.1.9999"""',
394
 
              'MOZC_RES_PRODUCT_VERSION_STRING="""0.0.1.9999"""',
395
 
              'MOZC_RES_COMPANY_NAME="""Google Inc."""',
396
 
              'MOZC_RES_LEGAL_COPYRIGHT="""Copyright (C) 2010 Google Inc. All Rights Reserved."""',
397
 
            ],
398
 
            'AdditionalIncludeDirectories': ['<(DEPTH)'],
399
 
          },
400
 
        },
401
 
      }],
402
 
      ['OS=="linux"', {
403
 
        'defines': [
404
 
          'OS_LINUX',
405
 
        ],
406
 
        'cflags': [
407
 
          '<@(gcc_cflags)',
408
 
          '-fPIC',
409
 
          '-fno-exceptions',
410
 
        ],
411
 
        'libraries': [
412
 
          '-lcurl',
413
 
          '-lcrypto',
414
 
          '-lpthread',
415
 
          '-lrt',
416
 
          '-lssl',
417
 
          '-lz',
418
 
        ],
419
 
      }],
420
 
      ['OS=="mac"', {
421
 
        'defines': [
422
 
          'OS_MACOSX',
423
 
        ],
424
 
        'mac_framework_dirs': [
425
 
          '<(DEPTH)/../mac/Releases/GoogleBreakpad',
426
 
        ],
427
 
        'xcode_settings': {
428
 
          'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',  # -fno-exceptions
429
 
          'OTHER_CFLAGS': [
430
 
            '<@(gcc_cflags)',
431
 
          ],
432
 
          'WARNING_CFLAGS': ['<@(warning_cflags)'],
433
 
        },
434
 
        'link_settings': {
435
 
          'libraries': [
436
 
            '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
437
 
            '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
438
 
            '$(SDKROOT)/System/Library/Frameworks/Security.framework',
439
 
            '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
440
 
            '/usr/lib/libcrypto.dylib',
441
 
            '/usr/lib/libcurl.dylib',
442
 
            '/usr/lib/libiconv.dylib',
443
 
            '/usr/lib/libssl.dylib',
444
 
            '/usr/lib/libz.dylib',
445
 
          ],
446
 
        }
447
 
      }],
448
 
    ],
449
 
  },
450
 
}