luajit-riscv_git.bb 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. SUMMARY = "Just-In-Time Compiler for Lua"
  2. LICENSE = "MIT"
  3. LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=23d6278200de9b48fd1439f80507cba8"
  4. HOMEPAGE = "http://luajit.org"
  5. SRC_URI = "git://github.com/infiWang/LuaJIT.git;protocol=https;branch=riscv \
  6. file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \
  7. file://riscv-cross-compile-support.patch \
  8. "
  9. # Set PV to a version tag and date (YYMMDD) associated with SRCREV if it is later.
  10. PV = "2.1.0~beta3-210112"
  11. SRCREV = "e65b5fe899d88d898ab1176c93a89d313cc6fcfd"
  12. S = "${WORKDIR}/git"
  13. inherit pkgconfig binconfig siteinfo
  14. BBCLASSEXTEND = "native"
  15. # http://luajit.org/install.html#cross
  16. # Host luajit needs to be compiled with the same pointer size
  17. # If you want to cross-compile to any 32 bit target on an x64 OS,
  18. # you need to install the multilib development package (e.g.
  19. # libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
  20. # (HOST_CC="gcc -m32").
  21. BUILD_CC_ARCH:append = " ${@['-m32',''][d.getVar('SITEINFO_BITS') != '32']}"
  22. # The lua makefiles expect the TARGET_SYS to be from uname -s
  23. # Values: Windows, Linux, Darwin, iOS, SunOS, PS3, GNU/kFreeBSD
  24. LUA_TARGET_OS = "Unknown"
  25. LUA_TARGET_OS:darwin = "Darwin"
  26. LUA_TARGET_OS:linux = "Linux"
  27. LUA_TARGET_OS:linux-gnueabi = "Linux"
  28. LUA_TARGET_OS:mingw32 = "Windows"
  29. # We don't want the lua buildsystem's compiler optimizations, or its
  30. # stripping, and we don't want it to pick up CFLAGS or LDFLAGS, as those apply
  31. # to both host and target compiles
  32. EXTRA_OEMAKE = "\
  33. Q= E='@:' \
  34. \
  35. CCOPT= CCOPT_x86= CFLAGS= LDFLAGS= TARGET_STRIP='@:' \
  36. \
  37. 'TARGET_SYS=${LUA_TARGET_OS}' \
  38. \
  39. 'CC=${CC}' \
  40. 'TARGET_AR=${AR} rcus' \
  41. 'TARGET_CFLAGS=${CFLAGS}' \
  42. 'TARGET_LDFLAGS=${LDFLAGS}' \
  43. 'TARGET_SHLDFLAGS=${LDFLAGS}' \
  44. 'HOST_CC=${BUILD_CC}' \
  45. 'HOST_CFLAGS=${BUILD_CFLAGS}' \
  46. \
  47. 'PREFIX=${prefix}' \
  48. 'MULTILIB=${baselib}' \
  49. 'LDCONFIG=:' \
  50. "
  51. do_compile () {
  52. oe_runmake
  53. }
  54. # There's INSTALL_LIB and INSTALL_SHARE also, but the lua binary hardcodes the
  55. # '/share' and '/' + LUA_MULTILIB paths, so we don't want to break those
  56. # expectations.
  57. EXTRA_OEMAKEINST = "\
  58. 'DESTDIR=${D}' \
  59. 'INSTALL_BIN=${D}${bindir}' \
  60. 'INSTALL_INC=${D}${includedir}/luajit-$(MAJVER).$(MINVER)' \
  61. 'INSTALL_MAN=${D}${mandir}/man1' \
  62. "
  63. do_install () {
  64. oe_runmake ${EXTRA_OEMAKEINST} install
  65. rmdir ${D}${datadir}/lua/5.* \
  66. ${D}${datadir}/lua \
  67. ${D}${libdir}/lua/5.* \
  68. ${D}${libdir}/lua
  69. cd ${D}/usr/bin
  70. ln -sf ./luajit-2.1.0-beta3 luajit
  71. }
  72. PACKAGES += 'luajit-common'
  73. # See the comment for EXTRA_OEMAKEINST. This is needed to ensure the hardcoded
  74. # paths are packaged regardless of what the libdir and datadir paths are.
  75. FILES:${PN} += "${prefix}/${baselib} ${prefix}/share"
  76. FILES:${PN} += "${libdir}/libluajit-5.1.so.2 \
  77. ${libdir}/libluajit-5.1.so.${PV} \
  78. "
  79. FILES:${PN}-dev += "${libdir}/libluajit-5.1.a \
  80. ${libdir}/libluajit-5.1.so \
  81. ${libdir}/pkgconfig/luajit.pc \
  82. "
  83. FILES:luajit-common = "${datadir}/${BPN}-${PV}"
  84. # mips64/ppc/ppc64/riscv64/riscv32 is not supported in this release
  85. COMPATIBLE_HOST:mipsarchn32 = "null"
  86. COMPATIBLE_HOST:mipsarchn64 = "null"
  87. COMPATIBLE_HOST:powerpc = "null"
  88. COMPATIBLE_HOST:powerpc64 = "null"
  89. COMPATIBLE_HOST:powerpc64le = "null"
  90. COMPATIBLE_HOST:riscv64 = "riscv.*"
  91. COMPATIBLE_HOST:riscv32 = "null"