You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.5 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=luajit
  3. PKG_VERSION:=2017-01-17-71ff7ef
  4. PKG_RELEASE:=1
  5. PKG_MAINTAINER:=Morteza Milani <milani@pichak.co>
  6. PKG_LICENSE:=MIT
  7. PKG_LICENSE_FILES:=COPYRIGHT
  8. PKG_SOURCE_PROTO:=git
  9. PKG_SOURCE_URL:=https://github.com/LuaJIT/LuaJIT.git
  10. PKG_SOURCE_VERSION:=71ff7ef8a7e0592dedb3527d4aacc68bf04af0bd
  11. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_USE_MIPS16:=0
  15. include $(INCLUDE_DIR)/package.mk
  16. include $(INCLUDE_DIR)/host-build.mk
  17. define Package/luajit
  18. SUBMENU:=Lua
  19. SECTION:=lang
  20. CATEGORY:=Languages
  21. TITLE:=LuaJIT
  22. URL:=http://www.luajit.org
  23. DEPENDS:=@(i386||x86_64||arm||armeb||powerpc||mips||mipsel)
  24. endef
  25. define Package/luajit/description
  26. LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. *** Requires GCC Multilib on host system to build! ***
  27. endef
  28. TARGET_CFLAGS += $(FPIC) -std=gnu99
  29. HOST_CFLAGS += $(FPIC) -std=gnu99
  30. ifeq ($(HOST_ARCH),x86_64)
  31. ifeq ($(CONFIG_x86_64),)
  32. HOST_BITS := -m32
  33. endif
  34. endif
  35. define Build/Compile
  36. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  37. HOST_CC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_BITS)" \
  38. CROSS="$(TARGET_CROSS)" \
  39. DPREFIX=$(PKG_INSTALL_DIR)/usr \
  40. PREFIX=/usr \
  41. TARGET_CFLAGS="$(TARGET_CFLAGS)"
  42. rm -rf $(PKG_INSTALL_DIR)
  43. mkdir -p $(PKG_INSTALL_DIR)
  44. $(MAKE) -C $(PKG_BUILD_DIR) \
  45. DPREFIX=$(PKG_INSTALL_DIR)/usr \
  46. PREFIX=/usr \
  47. install
  48. endef
  49. define Build/InstallDev
  50. $(INSTALL_DIR) $(1)/usr/include/luajit-2.1
  51. $(CP) $(PKG_INSTALL_DIR)/usr/include/luajit-2.1/*.h $(1)/usr/include/luajit-2.1
  52. $(INSTALL_DIR) $(1)/usr/lib
  53. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
  54. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  55. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
  56. $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-2.1.0-beta2 $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)
  57. endef
  58. define Package/luajit/install
  59. $(INSTALL_DIR) $(1)/usr/lib/
  60. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/
  61. $(INSTALL_DIR) $(1)/usr/bin
  62. $(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-2.1.0-beta2 $(1)/usr/bin/$(PKG_NAME)
  63. endef
  64. define Host/Compile
  65. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
  66. DPREFIX=$(STAGING_DIR_HOSTPKG) \
  67. TARGET_CFLAGS="$(HOST_CFLAGS)" \
  68. TARGET_LDFLAGS="$(HOST_LDFLAGS)"
  69. endef
  70. define Host/Install
  71. $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
  72. DPREFIX=$(STAGING_DIR_HOSTPKG) \
  73. install
  74. $(CP) $(STAGING_DIR_HOSTPKG)/bin/luajit-2.1.0-beta2 $(STAGING_DIR_HOSTPKG)/bin/$(PKG_NAME)
  75. endef
  76. $(eval $(call HostBuild,luajit))
  77. $(eval $(call BuildPackage,luajit))