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 (1056B)


  1. local targets = {
  2. aarch64={name='AARCH64', dir='aarch64'},
  3. riscv64={name='RISCV', dir='riscv64'},
  4. x86_64={name='X86_64', dir='x86'},
  5. }
  6. local arch = config.target.platform:match('[^-]*')
  7. local targ = targets[arch]
  8. if not targ then return end
  9. cflags{
  10. '-Wall', '-Wno-deprecated-declarations',
  11. '-I $dir',
  12. '-I $outdir/include',
  13. '-I $srcdir/include',
  14. }
  15. build('sed', '$outdir/include/ffi.h', '$srcdir/include/ffi.h.in', {
  16. expr={
  17. '-e s,@VERSION@,3.3,',
  18. string.format('-e s,@TARGET@,%s,', targ.name),
  19. '-e s,@HAVE_LONG_DOUBLE@,1,',
  20. '-e s,@HAVE_LONG_DOUBLE_VARIANT@,0,',
  21. '-e s,@FFI_EXEC_TRAMPOLINE_TABLE@,0,',
  22. },
  23. })
  24. pkg.hdrs = {
  25. copy('$outdir/include', '$srcdir/src/'..targ.dir, {'ffitarget.h'}),
  26. '$outdir/include/ffi.h',
  27. install=true,
  28. }
  29. pkg.deps = {
  30. '$gendir/headers',
  31. }
  32. lib('libffi.a', [[
  33. src/(
  34. prep_cif.c types.c raw_api.c java_raw_api.c closures.c
  35. @aarch64 aarch64/(ffi.c sysv.S)
  36. @x86_64 x86/(ffi64.c unix64.S ffiw64.c win64.S)
  37. @riscv64 riscv/(ffi.c sysv.S)
  38. )
  39. ]])
  40. file('lib/libffi.a', '644', '$outdir/libffi.a')
  41. fetch 'git'