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


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