moz.build 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
  2. # This Source Code Form is subject to the terms of the Mozilla Public
  3. # License, v. 2.0. If a copy of the MPL was not distributed with this
  4. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. with Files('*'):
  6. BUG_COMPONENT = ('Core', 'Video/Audio')
  7. EXPORTS.theora += [
  8. 'include/theora/codec.h',
  9. 'include/theora/theoradec.h',
  10. 'include/theora/theoraenc.h',
  11. ]
  12. # We allow warnings for third-party code that can be updated from upstream.
  13. ALLOW_COMPILER_WARNINGS = True
  14. FINAL_LIBRARY = 'gkmedias'
  15. if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
  16. NO_VISIBILITY_FLAGS = True
  17. # The encoder is currently not included.
  18. DEFINES['THEORA_DISABLE_ENCODE'] = True
  19. # Suppress warnings in third-party code.
  20. if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
  21. CFLAGS += ['-Wno-type-limits']
  22. if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']:
  23. CFLAGS += ['-Wno-tautological-compare']
  24. if CONFIG['CLANG_CL']:
  25. CFLAGS += [
  26. '-Wno-pointer-sign',
  27. '-Wno-shift-op-parentheses',
  28. ]
  29. UNIFIED_SOURCES += [
  30. 'lib/apiwrapper.c',
  31. 'lib/bitpack.c',
  32. 'lib/decapiwrapper.c',
  33. 'lib/decinfo.c',
  34. 'lib/decode.c',
  35. 'lib/dequant.c',
  36. 'lib/fragment.c',
  37. 'lib/huffdec.c',
  38. 'lib/idct.c',
  39. 'lib/info.c',
  40. 'lib/internal.c',
  41. 'lib/quant.c',
  42. 'lib/state.c',
  43. ]
  44. LOCAL_INCLUDES += ['include']
  45. if '86' in CONFIG['OS_TEST']:
  46. if CONFIG['OS_ARCH'] != 'SunOS':
  47. if CONFIG['CLANG_CL']:
  48. # clang-cl can't handle libtheora's inline asm.
  49. pass
  50. elif CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['OS_TEST'] != 'x86_64':
  51. DEFINES['OC_X86_ASM'] = True
  52. if '64' in CONFIG['OS_TEST']:
  53. DEFINES['OC_X86_64_ASM'] = True
  54. if CONFIG['_MSC_VER']:
  55. if CONFIG['CLANG_CL']:
  56. # clang-cl can't handle libtheora's inline asm.
  57. pass
  58. elif '64' not in CONFIG['OS_TEST']:
  59. SOURCES += [
  60. 'lib/x86_vc/mmxfrag.c',
  61. 'lib/x86_vc/mmxidct.c',
  62. 'lib/x86_vc/mmxstate.c',
  63. 'lib/x86_vc/x86cpu.c',
  64. 'lib/x86_vc/x86state.c',
  65. ]
  66. else:
  67. SOURCES += [
  68. 'lib/x86/mmxfrag.c',
  69. 'lib/x86/mmxidct.c',
  70. 'lib/x86/mmxstate.c',
  71. 'lib/x86/sse2idct.c',
  72. 'lib/x86/x86cpu.c',
  73. 'lib/x86/x86state.c',
  74. ]
  75. if CONFIG['GNU_AS']:
  76. if 'arm' in CONFIG['OS_TEST']:
  77. SOURCES += [
  78. 'lib/arm/armcpu.c',
  79. 'lib/arm/armstate.c',
  80. ]
  81. for var in ('OC_ARM_ASM',
  82. 'OC_ARM_ASM_EDSP',
  83. 'OC_ARM_ASM_MEDIA',
  84. 'OC_ARM_ASM_NEON'):
  85. DEFINES[var] = True
  86. # The Android NDK doesn't pre-define anything to indicate the OS it's
  87. # on, so do it for them.
  88. if CONFIG['OS_TARGET'] == 'Android':
  89. DEFINES['__linux__'] = True
  90. SOURCES += [ '!%s.s' % f for f in [
  91. 'armbits-gnu',
  92. 'armfrag-gnu',
  93. 'armidct-gnu',
  94. 'armloop-gnu',
  95. ]]
  96. # These flags are a lie; they're just used to enable the requisite
  97. # opcodes; actual arch detection is done at runtime.
  98. ASFLAGS += [
  99. '-march=armv7-a',
  100. ]
  101. ASFLAGS += CONFIG['NEON_FLAGS']
  102. if CONFIG['CLANG_CXX']:
  103. ASFLAGS += [
  104. '-no-integrated-as',
  105. ]