| OLD | NEW |
| 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # TODO(ajwong): Determine if we want to statically link libz. | 5 # TODO(ajwong): Determine if we want to statically link libz. |
| 6 | 6 |
| 7 { | 7 { |
| 8 'target_defaults': { | 8 'target_defaults': { |
| 9 'conditions': [ | 9 'conditions': [ |
| 10 ['OS!="linux" and OS!="freebsd"', {'sources/': [['exclude', '/linux/']]}], | 10 ['OS!="linux" and OS!="freebsd"', {'sources/': [['exclude', '/linux/']]}], |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 # determine if in-tree build in Windows is tractable. | 42 # determine if in-tree build in Windows is tractable. |
| 43 ['(OS!="linux" and OS!="freebsd" and OS!="mac") or use_system_ffmpeg!=0', { | 43 ['(OS!="linux" and OS!="freebsd" and OS!="mac") or use_system_ffmpeg!=0', { |
| 44 'variables': { | 44 'variables': { |
| 45 'target_for_binaries': 'ffmpeg_binaries', | 45 'target_for_binaries': 'ffmpeg_binaries', |
| 46 'ffmpeg_include_root': 'include', | 46 'ffmpeg_include_root': 'include', |
| 47 }, | 47 }, |
| 48 },{ # else OS=="linux" | 48 },{ # else OS=="linux" |
| 49 'variables': { | 49 'variables': { |
| 50 'target_for_binaries': 'ffmpegsumo_nolink', | 50 'target_for_binaries': 'ffmpegsumo_nolink', |
| 51 'ffmpeg_include_root': 'source/patched-ffmpeg-mt', | 51 'ffmpeg_include_root': 'source/patched-ffmpeg-mt', |
| 52 'conditions': [ |
| 53 ['target_arch=="x64" or target_arch=="ia32"', { |
| 54 'ffmpeg_asm_lib': 1, |
| 55 }], |
| 56 ['target_arch=="arm"', { |
| 57 'ffmpeg_asm_lib': 0, |
| 58 }], |
| 59 ], |
| 52 }, | 60 }, |
| 53 'targets': [ | 61 'targets': [ |
| 54 { | 62 { |
| 55 'target_name': 'ffmpegsumo', | 63 'target_name': 'ffmpegsumo', |
| 56 'product_name': 'libffmpegsumo', | 64 'product_name': 'libffmpegsumo', |
| 57 'type': 'shared_library', | 65 'type': 'shared_library', |
| 58 'dependencies': [ | |
| 59 'make_ffmpeg_asm_lib', | |
| 60 ], | |
| 61 'sources': [ | 66 'sources': [ |
| 62 'source/patched-ffmpeg-mt/libavcodec/aac.c', | 67 'source/patched-ffmpeg-mt/libavcodec/aac.c', |
| 63 'source/patched-ffmpeg-mt/libavcodec/aac_ac3_parser.c', | 68 'source/patched-ffmpeg-mt/libavcodec/aac_ac3_parser.c', |
| 64 'source/patched-ffmpeg-mt/libavcodec/aac_parser.c', | 69 'source/patched-ffmpeg-mt/libavcodec/aac_parser.c', |
| 65 'source/patched-ffmpeg-mt/libavcodec/aactab.c', | 70 'source/patched-ffmpeg-mt/libavcodec/aactab.c', |
| 66 'source/patched-ffmpeg-mt/libavcodec/allcodecs.c', | 71 'source/patched-ffmpeg-mt/libavcodec/allcodecs.c', |
| 67 'source/patched-ffmpeg-mt/libavcodec/audioconvert.c', | 72 'source/patched-ffmpeg-mt/libavcodec/audioconvert.c', |
| 68 'source/patched-ffmpeg-mt/libavcodec/avpacket.c', | 73 'source/patched-ffmpeg-mt/libavcodec/avpacket.c', |
| 69 'source/patched-ffmpeg-mt/libavcodec/bitstream.c', | 74 'source/patched-ffmpeg-mt/libavcodec/bitstream.c', |
| 70 'source/patched-ffmpeg-mt/libavcodec/bitstream_filter.c', | 75 'source/patched-ffmpeg-mt/libavcodec/bitstream_filter.c', |
| (...skipping 25 matching lines...) Expand all Loading... |
| 96 'source/patched-ffmpeg-mt/libavcodec/raw.c', | 101 'source/patched-ffmpeg-mt/libavcodec/raw.c', |
| 97 'source/patched-ffmpeg-mt/libavcodec/resample.c', | 102 'source/patched-ffmpeg-mt/libavcodec/resample.c', |
| 98 'source/patched-ffmpeg-mt/libavcodec/resample2.c', | 103 'source/patched-ffmpeg-mt/libavcodec/resample2.c', |
| 99 'source/patched-ffmpeg-mt/libavcodec/simple_idct.c', | 104 'source/patched-ffmpeg-mt/libavcodec/simple_idct.c', |
| 100 'source/patched-ffmpeg-mt/libavcodec/utils.c', | 105 'source/patched-ffmpeg-mt/libavcodec/utils.c', |
| 101 'source/patched-ffmpeg-mt/libavcodec/vorbis.c', | 106 'source/patched-ffmpeg-mt/libavcodec/vorbis.c', |
| 102 'source/patched-ffmpeg-mt/libavcodec/vorbis_data.c', | 107 'source/patched-ffmpeg-mt/libavcodec/vorbis_data.c', |
| 103 'source/patched-ffmpeg-mt/libavcodec/vorbis_dec.c', | 108 'source/patched-ffmpeg-mt/libavcodec/vorbis_dec.c', |
| 104 'source/patched-ffmpeg-mt/libavcodec/vp3.c', | 109 'source/patched-ffmpeg-mt/libavcodec/vp3.c', |
| 105 'source/patched-ffmpeg-mt/libavcodec/vp3dsp.c', | 110 'source/patched-ffmpeg-mt/libavcodec/vp3dsp.c', |
| 106 'source/patched-ffmpeg-mt/libavcodec/x86/cpuid.c', | |
| 107 'source/patched-ffmpeg-mt/libavcodec/x86/dnxhd_mmx.c', | |
| 108 'source/patched-ffmpeg-mt/libavcodec/x86/dsputil_mmx.c', | |
| 109 'source/patched-ffmpeg-mt/libavcodec/x86/fdct_mmx.c', | |
| 110 'source/patched-ffmpeg-mt/libavcodec/x86/fft_3dn.c', | |
| 111 'source/patched-ffmpeg-mt/libavcodec/x86/fft_3dn2.c', | |
| 112 'source/patched-ffmpeg-mt/libavcodec/x86/fft_sse.c', | |
| 113 'source/patched-ffmpeg-mt/libavcodec/x86/idct_mmx_xvid.c', | |
| 114 'source/patched-ffmpeg-mt/libavcodec/x86/idct_sse2_xvid.c', | |
| 115 'source/patched-ffmpeg-mt/libavcodec/x86/motion_est_mmx.c', | |
| 116 'source/patched-ffmpeg-mt/libavcodec/x86/mpegvideo_mmx.c', | |
| 117 'source/patched-ffmpeg-mt/libavcodec/x86/simple_idct_mmx.c', | |
| 118 'source/patched-ffmpeg-mt/libavcodec/x86/vp3dsp_mmx.c', | |
| 119 'source/patched-ffmpeg-mt/libavcodec/x86/vp3dsp_sse2.c', | |
| 120 'source/patched-ffmpeg-mt/libavcodec/xiph.c', | 111 'source/patched-ffmpeg-mt/libavcodec/xiph.c', |
| 121 'source/patched-ffmpeg-mt/libavformat/allformats.c', | 112 'source/patched-ffmpeg-mt/libavformat/allformats.c', |
| 122 'source/patched-ffmpeg-mt/libavformat/avio.c', | 113 'source/patched-ffmpeg-mt/libavformat/avio.c', |
| 123 'source/patched-ffmpeg-mt/libavformat/aviobuf.c', | 114 'source/patched-ffmpeg-mt/libavformat/aviobuf.c', |
| 124 'source/patched-ffmpeg-mt/libavformat/cutils.c', | 115 'source/patched-ffmpeg-mt/libavformat/cutils.c', |
| 125 'source/patched-ffmpeg-mt/libavformat/id3v2.c', | 116 'source/patched-ffmpeg-mt/libavformat/id3v2.c', |
| 126 'source/patched-ffmpeg-mt/libavformat/isom.c', | 117 'source/patched-ffmpeg-mt/libavformat/isom.c', |
| 127 'source/patched-ffmpeg-mt/libavformat/metadata.c', | 118 'source/patched-ffmpeg-mt/libavformat/metadata.c', |
| 128 'source/patched-ffmpeg-mt/libavformat/metadata_compat.c', | 119 'source/patched-ffmpeg-mt/libavformat/metadata_compat.c', |
| 129 'source/patched-ffmpeg-mt/libavformat/mov.c', | 120 'source/patched-ffmpeg-mt/libavformat/mov.c', |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 'source/patched-ffmpeg-mt/libavcodec/mpegaudiodata.c', | 172 'source/patched-ffmpeg-mt/libavcodec/mpegaudiodata.c', |
| 182 'source/patched-ffmpeg-mt/libavcodec/mpegaudiodec.c', | 173 'source/patched-ffmpeg-mt/libavcodec/mpegaudiodec.c', |
| 183 'source/patched-ffmpeg-mt/libavcodec/mpegaudiodecheader.c', | 174 'source/patched-ffmpeg-mt/libavcodec/mpegaudiodecheader.c', |
| 184 'source/patched-ffmpeg-mt/libavcodec/mpegvideo.c', | 175 'source/patched-ffmpeg-mt/libavcodec/mpegvideo.c', |
| 185 'source/patched-ffmpeg-mt/libavformat/id3v2.c', | 176 'source/patched-ffmpeg-mt/libavformat/id3v2.c', |
| 186 'source/patched-ffmpeg-mt/libavformat/isom.c', | 177 'source/patched-ffmpeg-mt/libavformat/isom.c', |
| 187 'source/patched-ffmpeg-mt/libavformat/mov.c', | 178 'source/patched-ffmpeg-mt/libavformat/mov.c', |
| 188 'source/patched-ffmpeg-mt/libavformat/mp3.c', | 179 'source/patched-ffmpeg-mt/libavformat/mp3.c', |
| 189 ], | 180 ], |
| 190 }], # ffmpeg_branding | 181 }], # ffmpeg_branding |
| 182 ['target_arch=="ia32" or target_arch=="x64"', { |
| 183 'dependencies': [ |
| 184 'make_ffmpeg_asm_lib', |
| 185 ], |
| 186 'sources': [ |
| 187 'source/patched-ffmpeg-mt/libavcodec/x86/cpuid.c', |
| 188 'source/patched-ffmpeg-mt/libavcodec/x86/dnxhd_mmx.c', |
| 189 'source/patched-ffmpeg-mt/libavcodec/x86/dsputil_mmx.c', |
| 190 'source/patched-ffmpeg-mt/libavcodec/x86/fdct_mmx.c', |
| 191 'source/patched-ffmpeg-mt/libavcodec/x86/fft_3dn.c', |
| 192 'source/patched-ffmpeg-mt/libavcodec/x86/fft_3dn2.c', |
| 193 'source/patched-ffmpeg-mt/libavcodec/x86/fft_sse.c', |
| 194 'source/patched-ffmpeg-mt/libavcodec/x86/idct_mmx_xvid.c', |
| 195 'source/patched-ffmpeg-mt/libavcodec/x86/idct_sse2_xvid.c', |
| 196 'source/patched-ffmpeg-mt/libavcodec/x86/motion_est_mmx.c', |
| 197 'source/patched-ffmpeg-mt/libavcodec/x86/mpegvideo_mmx.c', |
| 198 'source/patched-ffmpeg-mt/libavcodec/x86/simple_idct_mmx.c', |
| 199 'source/patched-ffmpeg-mt/libavcodec/x86/vp3dsp_mmx.c', |
| 200 'source/patched-ffmpeg-mt/libavcodec/x86/vp3dsp_sse2.c', |
| 201 ], |
| 202 }], |
| 191 ['target_arch=="x64"', { | 203 ['target_arch=="x64"', { |
| 192 # x64 requires PIC for shared libraries. This is opposite | 204 # x64 requires PIC for shared libraries. This is opposite |
| 193 # of ia32 where due to a slew of inline assembly using ebx, | 205 # of ia32 where due to a slew of inline assembly using ebx, |
| 194 # FFmpeg CANNOT be built with PIC. | 206 # FFmpeg CANNOT be built with PIC. |
| 195 'defines': [ | 207 'defines': [ |
| 196 'PIC', | 208 'PIC', |
| 197 ], | 209 ], |
| 198 'cflags': [ | 210 'cflags': [ |
| 199 '-fPIC', | 211 '-fPIC', |
| 200 ], | 212 ], |
| 201 }], # target_arch | 213 }], # target_arch=="x64" |
| 214 ['target_arch=="arm"', { |
| 215 'defines': [ |
| 216 'PIC', |
| 217 ], |
| 218 'cflags': [ |
| 219 '-fPIC', |
| 220 '-march=armv7-a', |
| 221 '-mtune=cortex-a8', |
| 222 '-mfpu=neon', |
| 223 '-mfloat-abi=softfp', |
| 224 ], |
| 225 'sources': [ |
| 226 'source/patched-ffmpeg-mt/libavcodec/arm/dsputil_arm.c', |
| 227 'source/patched-ffmpeg-mt/libavcodec/arm/dsputil_arm_s.S', |
| 228 'source/patched-ffmpeg-mt/libavcodec/arm/dsputil_vfp.S', |
| 229 'source/patched-ffmpeg-mt/libavcodec/arm/float_arm_vfp.c', |
| 230 'source/patched-ffmpeg-mt/libavcodec/arm/jrevdct_arm.S', |
| 231 'source/patched-ffmpeg-mt/libavcodec/arm/simple_idct_arm.S', |
| 232 'source/patched-ffmpeg-mt/libavcodec/arm/simple_idct_armv5te.S', |
| 233 'source/patched-ffmpeg-mt/libavcodec/arm/simple_idct_armv6.S', |
| 234 'source/patched-ffmpeg-mt/libavcodec/arm/simple_idct_neon.S', |
| 235 ], |
| 236 }], # target_arch=="arm" |
| 202 ['OS=="linux" or OS=="freebsd"', { | 237 ['OS=="linux" or OS=="freebsd"', { |
| 203 'defines': [ | 238 'defines': [ |
| 204 '_ISOC99_SOURCE', | 239 '_ISOC99_SOURCE', |
| 205 '_LARGEFILE_SOURCE', | 240 '_LARGEFILE_SOURCE', |
| 206 ], | 241 ], |
| 207 'cflags': [ | 242 'cflags': [ |
| 208 '-std=c99', | 243 '-std=c99', |
| 209 '-pthread', | 244 '-pthread', |
| 210 '-fno-math-errno', | 245 '-fno-math-errno', |
| 211 ], | 246 ], |
| 212 'cflags!': [ | 247 'cflags!': [ |
| 213 # Ensure the symbols are exported. | 248 # Ensure the symbols are exported. |
| 214 # | 249 # |
| 215 # TODO(ajwong): Fix common.gypi to only add this flag for | 250 # TODO(ajwong): Fix common.gypi to only add this flag for |
| 216 # _type != shared_library. | 251 # _type != shared_library. |
| 217 '-fvisibility=hidden', | 252 '-fvisibility=hidden', |
| 218 ], | 253 ], |
| 219 'link_settings': { | 254 'link_settings': { |
| 220 'ldflags': [ | 255 'ldflags': [ |
| 221 '-Wl,-Bsymbolic', | 256 '-Wl,-Bsymbolic', |
| 222 '-L<(shared_generated_dir)', | 257 '-L<(shared_generated_dir)', |
| 223 ], | 258 ], |
| 224 'libraries': [ | 259 'libraries': [ |
| 225 # TODO(ajwong): When scons is dead, collapse this with the | |
| 226 # absolute path entry inside the OS="mac" conditional, and | |
| 227 # move it out of the conditionals block altogether. | |
| 228 '-l<(asm_library)', | |
| 229 | |
| 230 '-lz', | 260 '-lz', |
| 231 ], | 261 ], |
| 262 'conditions': [ |
| 263 ['ffmpeg_asm_lib==1', { |
| 264 'libraries': [ |
| 265 # TODO(ajwong): When scons is dead, collapse this with the |
| 266 # absolute path entry inside the OS="mac" conditional, and |
| 267 # move it out of the conditionals block altogether. |
| 268 '-l<(asm_library)', |
| 269 ], |
| 270 }], |
| 271 ], |
| 232 }, | 272 }, |
| 233 }], # OS=="linux" or OS=="freebsd" | 273 }], # OS=="linux" or OS=="freebsd" |
| 234 ['OS=="mac"', { | 274 ['OS=="mac"', { |
| 235 'libraries': [ | 275 'libraries': [ |
| 236 # TODO(ajwong): Move into link_settings when this is fixed: | 276 # TODO(ajwong): Move into link_settings when this is fixed: |
| 237 # | 277 # |
| 238 # http://code.google.com/p/gyp/issues/detail?id=108 | 278 # http://code.google.com/p/gyp/issues/detail?id=108 |
| 239 '<(shared_generated_dir)/<(STATIC_LIB_PREFIX)<(asm_library)<(STA
TIC_LIB_SUFFIX)', | 279 '<(shared_generated_dir)/<(STATIC_LIB_PREFIX)<(asm_library)<(STA
TIC_LIB_SUFFIX)', |
| 240 ], | 280 ], |
| 241 'link_settings': { | 281 'link_settings': { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 ], | 326 ], |
| 287 'process_outputs_as_sources': 0, | 327 'process_outputs_as_sources': 0, |
| 288 'message': 'Serializing build of <(asm_library).', | 328 'message': 'Serializing build of <(asm_library).', |
| 289 }, | 329 }, |
| 290 ], | 330 ], |
| 291 }, | 331 }, |
| 292 { | 332 { |
| 293 'target_name': 'assemble_ffmpeg_asm', | 333 'target_name': 'assemble_ffmpeg_asm', |
| 294 'type': 'none', | 334 'type': 'none', |
| 295 'dependencies': [ | 335 'dependencies': [ |
| 296 '../yasm/yasm.gyp:yasm', | 336 '../yasm/yasm.gyp:yasm#host', |
| 297 ], | 337 ], |
| 298 'sources': [ | 338 'sources': [ |
| 299 # The FFmpeg yasm files. | 339 # The FFmpeg yasm files. |
| 300 'source/patched-ffmpeg-mt/libavcodec/x86/dsputil_yasm.asm', | 340 'source/patched-ffmpeg-mt/libavcodec/x86/dsputil_yasm.asm', |
| 301 'source/patched-ffmpeg-mt/libavcodec/x86/fft_mmx.asm', | 341 'source/patched-ffmpeg-mt/libavcodec/x86/fft_mmx.asm', |
| 302 ], | 342 ], |
| 303 'rules': [ | 343 'rules': [ |
| 304 { | 344 { |
| 305 'conditions': [ | 345 'conditions': [ |
| 306 ['OS=="linux" or OS=="freebsd"', { | 346 ['OS=="linux" or OS=="freebsd"', { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 318 }], | 358 }], |
| 319 ['target_arch=="x64"', { | 359 ['target_arch=="x64"', { |
| 320 'variables': { | 360 'variables': { |
| 321 'yasm_flags': [ | 361 'yasm_flags': [ |
| 322 '-DARCH_X86_64', | 362 '-DARCH_X86_64', |
| 323 '-m', 'amd64', | 363 '-m', 'amd64', |
| 324 '-DPIC', | 364 '-DPIC', |
| 325 ], | 365 ], |
| 326 }, | 366 }, |
| 327 }], | 367 }], |
| 368 ['target_arch=="arm"', { |
| 369 'variables': { |
| 370 'yasm_flags': [], |
| 371 }, |
| 372 }], |
| 328 ], | 373 ], |
| 329 }], ['OS=="mac"', { | 374 }], ['OS=="mac"', { |
| 330 'variables': { | 375 'variables': { |
| 331 'obj_format': 'macho', | 376 'obj_format': 'macho', |
| 332 'yasm_flags': [ '-DPREFIX', ], | 377 'yasm_flags': [ '-DPREFIX', ], |
| 333 }, | 378 }, |
| 334 'conditions': [ | 379 'conditions': [ |
| 335 ['target_arch=="ia32"', { | 380 ['target_arch=="ia32"', { |
| 336 'variables': { | 381 'variables': { |
| 337 'yasm_flags': [ | 382 'yasm_flags': [ |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 ], | 694 ], |
| 650 }, | 695 }, |
| 651 ], | 696 ], |
| 652 } | 697 } |
| 653 | 698 |
| 654 # Local Variables: | 699 # Local Variables: |
| 655 # tab-width:2 | 700 # tab-width:2 |
| 656 # indent-tabs-mode:nil | 701 # indent-tabs-mode:nil |
| 657 # End: | 702 # End: |
| 658 # vim: set expandtab tabstop=2 shiftwidth=2: | 703 # vim: set expandtab tabstop=2 shiftwidth=2: |
| OLD | NEW |