Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / libvpx.gyp
index 3e93783..4f8cb2b 100644 (file)
@@ -5,6 +5,9 @@
   'variables': {
     'libvpx_build_vp9%': 1,
     'libvpx_source%': 'source/libvpx',
+    # Disable LTO for neon targets
+    # crbug.com/408997
+    'use_lto%': 0,
     'conditions': [
       ['os_posix==1', {
         'asm_obj_extension': 'o',
@@ -29,7 +32,7 @@
             ],
           }],
           ['target_arch=="arm64"', {
-            'target_arch_full': 'generic',
+            'target_arch_full': 'arm64',
           }],
         ],
       }],
@@ -53,7 +56,7 @@
     'variables': {
       'conditions': [
         ['OS=="win" and buildtype=="Official"', {
-          # Do not set to 'size', as it results in an error on win64. 
+          # Do not set to 'size', as it results in an error on win64.
           'optimize' :'speed',
         }],
       ],
@@ -71,7 +74,8 @@
       # support for neon and hide it behind Android cpu-features.
       'includes': ['libvpx_srcs_arm_neon_cpu_detect_intrinsics.gypi', ],
     }],
-    [ '(target_arch != "arm" and target_arch != "armv7") and target_arch != "mipsel"', {
+    [ '(target_arch != "arm" and target_arch != "armv7") and \
+       (target_arch != "mipsel" and target_arch != "mips64el")', {
       'targets': [
         {
           # This libvpx target contains both encoder and decoder.
               '-I', '<(libvpx_source)',
               '-I', '<(shared_generated_dir)', # Generated assembly offsets
             ],
+            # yasm only gets the flags we define. It doesn't inherit any of the
+            # really useful defines that come with a gcc invocation. In this
+            # case, we rely on __ANDROID__ to set 'rand' to 'lrand48'.
+            # Previously we used the builtin _rand but that's gone away.
+            'conditions': [
+              ['OS=="android"', {
+                'yasm_flags': [
+                  '-D', '__ANDROID__',
+                ],
+              }],
+            ],
+            'clang_warning_flags': [
+              # libvpx heavily relies on implicit enum casting.
+              '-Wno-conversion',
+              # libvpx does `if ((a == b))` in some places.
+              '-Wno-parentheses-equality',
+            ],
           },
           'dependencies': [
             'gen_asm_offsets_vp8',
                 # Currently no sse3 intrinsic functions
                 #'libvpx_intrinsics_sse3',
                 'libvpx_intrinsics_ssse3',
-                # Currently no sse4_1 intrinsic functions
-                #'libvpx_intrinsics_sse4_1',
+                'libvpx_intrinsics_sse4_1',
                 # Currently no avx intrinsic functions
                 #'libvpx_intrinsics_avx',
                 #'libvpx_intrinsics_avx2',
               ],
             }],
             ['target_arch=="arm64"', {
-              'includes': [ 'libvpx_srcs_generic.gypi', ],
+              'includes': [ 'libvpx_srcs_arm64.gypi', ],
             }],
             ['target_arch=="x64"', {
               'conditions': [
                 }, {
                   'includes': [
                     'libvpx_srcs_x86_64.gypi',
-                    'libvpx_srcs_nacl.gypi',
                   ],
                   'dependencies': [
                     'libvpx_intrinsics_mmx',
                     # Currently no sse3 intrinsic functions
                     #'libvpx_intrinsics_sse3',
                     'libvpx_intrinsics_ssse3',
-                    # Currently no sse4_1 intrinsic functions
-                    #'libvpx_intrinsics_sse4_1',
+                    'libvpx_intrinsics_sse4_1',
                     # Currently no avx intrinsic functions
                     #'libvpx_intrinsics_avx',
                     #'libvpx_intrinsics_avx2',
                 }],
               ],
             }],
-            ['clang == 1', {
-              'xcode_settings': {
-                'WARNING_CFLAGS': [
-                  # libvpx heavily relies on implicit enum casting.
-                  '-Wno-conversion',
-                  # libvpx does `if ((a == b))` in some places.
-                  '-Wno-parentheses-equality',
-                ],
-              },
-              'cflags': [
-                '-Wno-conversion',
-                '-Wno-parentheses-equality',
-              ],
-            }],
-            ['chromeos == 1', {
-              # ChromeOS needs these files for animated WebM avatars.
-              'sources': [
-                '<(libvpx_source)/third_party/libmkv/EbmlIDs.h',
-                '<(libvpx_source)/third_party/libmkv/EbmlWriter.c',
-                '<(libvpx_source)/third_party/libmkv/EbmlWriter.h',
-              ],
-            }],
           ],
         },
       ],
     },
     ],
-    # 'libvpx' target for mips builds.
-    [ 'target_arch=="mipsel" ', {
+    # 'libvpx' target for mipsel and mips64el builds.
+    [ 'target_arch=="mipsel" or target_arch=="mips64el"', {
       'targets': [
         {
           # This libvpx target contains both encoder and decoder.
             'ads2gas_script_path': '<(libvpx_source)/build/make/<(ads2gas_script)',
             'ads2gas_script_include': '<(libvpx_source)/build/make/thumb.pm',
           },
-          # We need to explicitly tell the assembler to look for
-          # .include directive files from the place where they're
-          # generated to.
-          'cflags': [
-             '-Wa,-I,<!(pwd)/source/config/<(OS_CATEGORY)/<(target_arch_full)',
-             '-Wa,-I,<!(pwd)/source/config',
-             '-Wa,-I,<(shared_generated_dir)',
-          ],
           'xcode_settings': {
             'OTHER_CFLAGS': [
               '-I<!(pwd)/source/config/<(OS_CATEGORY)/<(target_arch_full)',
               '<(libvpx_source)',
             ],
           },
+          # We need to explicitly tell the assembler to look for
+          # .include directive files from the place where they're
+          # generated to.
+          'cflags': [
+             '-Wa,-I,<(shared_generated_dir)',
+          ],
           'conditions': [
+            # For Android WebView, the following pathc are not required and not
+            # allowed, because they generate the absolute path.
+            ['android_webview_build!=1', {
+              'cflags': [
+                '-Wa,-I,<!(pwd)/source/config/<(OS_CATEGORY)/<(target_arch_full)',
+                '-Wa,-I,<!(pwd)/source/config',
+              ],
+            }],
             # Libvpx optimizations for ARMv6 or ARMv7 without NEON.
             ['arm_neon==0', {
               'conditions': [
                 '../../build/android/cpufeatures.gypi',
               ],
             }],
-            ['chromeos == 1', {
-              # ChromeOS needs these files for animated WebM avatars.
-              'sources': [
-                '<(libvpx_source)/third_party/libmkv/EbmlIDs.h',
-                '<(libvpx_source)/third_party/libmkv/EbmlWriter.c',
-                '<(libvpx_source)/third_party/libmkv/EbmlWriter.h',
-              ],
-            }],
             ['OS == "ios"', {
               'xcode_settings': {
                 'OTHER_CFLAGS!': [
           ['android_webview_build==1', {
             # pass the empty string for 3rd and 4th arguments of
             # intermediates-dir-for macro.
-            'lib_intermediate_name' : '$(realpath $(call intermediates-dir-for, STATIC_LIBRARIES, libvpx_asm_offsets_vp8,,, $(GYP_VAR_PREFIX)))/libvpx_asm_offsets_vp8.a',
+            'lib_intermediate_name' : '$(abspath $(call intermediates-dir-for,STATIC_LIBRARIES,libvpx_asm_offsets_vp8,,,$(gyp_var_prefix)))/libvpx_asm_offsets_vp8.a',
           }],
           ['(target_arch=="arm" or target_arch=="armv7")', {
             'output_format': 'gas',
                 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets_vp8.vp8_asm_enc_offsets.obj',
                 '-s', '<(PRODUCT_DIR)/obj/Source/WebKit/chromium/third_party/libvpx/<(libvpx_source)/vp8/encoder/libvpx_asm_offsets_vp8.vp8_asm_enc_offsets.obj',
               ],
-              'process_output_as_sources': 1,
+              'process_outputs_as_sources': 1,
             },
           ],
           'sources': [
             'unpack_lib_search_path_list': [
               '-a', '<(PRODUCT_DIR)/libvpx_asm_offsets_vp8.a',
               '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets_vp8.a',
+              '-a', '<(LIB_DIR)/chromium/src/third_party/libvpx/libvpx_asm_offsets_vp8.a',
               '-a', '<(LIB_DIR)/Source/WebKit/chromium/third_party/libvpx/libvpx_asm_offsets_vp8.a',
               '-a', '<(lib_intermediate_name)',
             ],
           ['android_webview_build==1', {
             # pass the empty string for 3rd and 4th arguments of
             # intermediates-dir-for macro.
-            'lib_intermediate_name' : '<(android_src)/$(call intermediates-dir-for, STATIC_LIBRARIES, libvpx_asm_offsets_vpx_scale,,, $(GYP_VAR_PREFIX))/libvpx_asm_offsets_vpx_scale.a',
+            'lib_intermediate_name' : '$(abspath $(call intermediates-dir-for,STATIC_LIBRARIES,libvpx_asm_offsets_vpx_scale,,,$(gyp_var_prefix)))/libvpx_asm_offsets_vpx_scale.a',
           }],
           ['(target_arch=="arm" or target_arch=="armv7")', {
             'output_format': 'gas',
                 '-s', '<(ninja_obj_dir)/encoder/libvpx_asm_offsets_vpx_scale.vpx_scale_asm_offsets.obj',
                 '-s', '<(PRODUCT_DIR)/obj/Source/WebKit/chromium/third_party/libvpx/<(libvpx_source)/vpx_scale/libvpx_asm_offsets_vpx_scale.vpx_scale_asm_offsets.obj',
               ],
-              'process_output_as_sources': 1,
+              'process_outputs_as_sources': 1,
             },
           ],
           'sources': [
             'unpack_lib_search_path_list': [
               '-a', '<(PRODUCT_DIR)/libvpx_asm_offsets_vpx_scale.a',
               '-a', '<(LIB_DIR)/third_party/libvpx/libvpx_asm_offsets_vpx_scale.a',
+              '-a', '<(LIB_DIR)/chromium/src/third_party/libvpx/libvpx_asm_offsets_vpx_scale.a',
               '-a', '<(LIB_DIR)/Source/WebKit/chromium/third_party/libvpx/libvpx_asm_offsets_vpx_scale.a',
               '-a', '<(lib_intermediate_name)',
             ],