logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

gen.lua (2984B)


  1. cflags{
  2. '-Wall', '-Wno-maybe-uninitialized',
  3. '-D _XOPEN_SOURCE=700',
  4. '-I $srcdir',
  5. '-I $srcdir/include',
  6. '-I $srcdir/tools',
  7. '-I $outdir',
  8. '-I $outdir/include/dav1d',
  9. '-I $dir',
  10. }
  11. nasmflags{
  12. '-i $srcdir/src/',
  13. '-i $outdir/',
  14. '-f elf64',
  15. }
  16. pkg.hdrs = {
  17. copy('$outdir/include/dav1d', '$srcdir/include/dav1d', {
  18. 'common.h',
  19. 'data.h',
  20. 'dav1d.h',
  21. 'headers.h',
  22. 'picture.h',
  23. }),
  24. '$outdir/include/dav1d/version.h',
  25. }
  26. pkg.deps = {
  27. '$gendir/headers',
  28. '$outdir/cli_config.h',
  29. '$outdir/vcs_version.h',
  30. '$outdir/config.asm',
  31. }
  32. build('sed', '$outdir/include/dav1d/version.h', '$srcdir/include/dav1d/version.h.in', {
  33. expr={
  34. '-e s,@DAV1D_API_VERSION_MAJOR@,5,',
  35. '-e s,@DAV1D_API_VERSION_MINOR@,0,',
  36. '-e s,@DAV1D_API_VERSION_PATCH@,0,',
  37. },
  38. })
  39. build('awk', '$outdir/vcs_version.h', '$dir/ver', {
  40. expr=[['{printf "#define DAV1D_VERSION \"%s\"\n", $$1}']],
  41. })
  42. build('awk', '$outdir/config.asm', '$dir/config.h', {
  43. expr=[['$$1 == "#define" {print "%define " substr($$0, length("#define ") + 1)} END {print "%define private_prefix dav1d"}']],
  44. })
  45. build('touch', '$outdir/cli_config.h')
  46. local srcs = paths[[
  47. src/(
  48. cdf.c
  49. cpu.c
  50. data.c
  51. decode.c
  52. dequant_tables.c
  53. getbits.c
  54. intra_edge.c
  55. itx_1d.c
  56. lf_mask.c
  57. log.c
  58. mem.c
  59. msac.c
  60. obu.c
  61. picture.c
  62. qm.c
  63. ref.c
  64. refmvs.c
  65. scan.c
  66. tables.c
  67. warpmv.c
  68. wedge.c
  69. lib.c
  70. thread_task.c
  71. @x86_64 x86/(
  72. cpu.c msac_init.c refmvs_init.c
  73. cpuid.asm msac.asm refmvs.asm cdef_avx2.asm itx_avx2.asm
  74. looprestoration_avx2.asm cdef_sse.asm itx_sse.asm
  75. cdef_avx512.asm
  76. mc_avx512.asm
  77. mc_avx2.asm
  78. film_grain_avx2.asm
  79. ipred_avx2.asm
  80. loopfilter_avx2.asm
  81. film_grain_sse.asm
  82. ipred_sse.asm
  83. loopfilter_sse.asm
  84. looprestoration_sse.asm
  85. mc_sse.asm
  86. cdef16_avx2.asm
  87. film_grain16_avx2.asm
  88. ipred16_avx2.asm
  89. itx16_avx2.asm
  90. loopfilter16_avx2.asm
  91. looprestoration16_avx2.asm
  92. mc16_avx2.asm
  93. cdef16_sse.asm
  94. film_grain16_sse.asm
  95. ipred16_sse.asm
  96. itx16_sse.asm
  97. loopfilter16_sse.asm
  98. looprestoration16_sse.asm
  99. mc16_sse.asm
  100. )
  101. )
  102. ]]
  103. local tmpl = paths[[
  104. cdef_apply_tmpl.c
  105. cdef_tmpl.c
  106. fg_apply_tmpl.c
  107. film_grain_tmpl.c
  108. ipred_prepare_tmpl.c
  109. ipred_tmpl.c
  110. itx_tmpl.c
  111. lf_apply_tmpl.c
  112. loopfilter_tmpl.c
  113. looprestoration_tmpl.c
  114. lr_apply_tmpl.c
  115. mc_tmpl.c
  116. recon_tmpl.c
  117. @x86_64 x86/(
  118. cdef_init_tmpl.c
  119. film_grain_init_tmpl.c
  120. ipred_init_tmpl.c
  121. itx_init_tmpl.c
  122. loopfilter_init_tmpl.c
  123. looprestoration_init_tmpl.c
  124. mc_init_tmpl.c
  125. )
  126. ]]
  127. for _, bit in ipairs{'8', '16'} do
  128. for _, src in ipairs(tmpl) do
  129. local obj = ('$outdir/%s/%s.o'):format(bit, src)
  130. build('cc', obj, {'$srcdir/src/'..src, '||', '$gendir/deps'}, {cflags='$cflags -D BITDEPTH='..bit})
  131. table.insert(srcs, obj)
  132. end
  133. end
  134. lib('libdav1d.a', srcs)
  135. exe('dav1d', [[
  136. tools/(
  137. dav1d.c
  138. dav1d_cli_parse.c
  139. input/(input.c annexb.c ivf.c section5.c)
  140. output/(md5.c null.c output.c y4m2.c yuv.c)
  141. )
  142. libdav1d.a
  143. ]])
  144. file('bin/dav1d', '755', '$outdir/dav1d')
  145. fetch 'git'