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.

82 lines
2.2 KiB

  1. #
  2. # Copyright (C) 2009-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=libffi
  9. PKG_VERSION:=3.2.1
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=ftp://sourceware.org/pub/libffi/
  13. PKG_MD5SUM:=83b89587607e3eb65c70d361f13bab43
  14. PKG_LICENSE:=MIT
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_FIXUP:=autoreconf
  17. PKG_INSTALL:=1
  18. PKG_USE_MIPS16:=0
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/host-build.mk
  21. define Package/libffi
  22. SECTION:=libs
  23. CATEGORY:=Libraries
  24. TITLE:=Foreign Function Interface (FFI) library
  25. URL:=http://sourceware.org/libffi/
  26. MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  27. endef
  28. define Package/libffi/description
  29. The libffi library provides a portable, high level programming interface to
  30. various calling conventions. This allows a programmer to call any function
  31. specified by a call interface description at run-time.
  32. FFI stands for Foreign Function Interface. A foreign function interface is the
  33. popular name for the interface that allows code written in one language to call
  34. code written in another language. The libffi library really only provides the
  35. lowest, machine dependent layer of a fully featured foreign function interface.
  36. A layer must exist above libffi that handles type conversions for values passed
  37. between the two languages.
  38. endef
  39. CONFIGURE_PATH = build
  40. CONFIGURE_CMD = ../configure
  41. MAKE_PATH = build
  42. define Build/Configure
  43. mkdir -p $(PKG_BUILD_DIR)/build
  44. $(Build/Configure/Default)
  45. endef
  46. define Build/InstallDev
  47. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  48. $(CP) \
  49. $(PKG_INSTALL_DIR)/usr/lib/libffi.{so*,a,la} \
  50. $(1)/usr/lib/
  51. $(CP) \
  52. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
  53. $(1)/usr/lib/pkgconfig/
  54. sed -i -e 's,includedir=.*,includedir=$$$${prefix}/include,' $(1)/usr/lib/pkgconfig/libffi.pc
  55. $(INSTALL_DIR) $(1)/usr/include
  56. $(CP) \
  57. $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)-$(PKG_VERSION)/include/*.h \
  58. $(1)/usr/include/
  59. endef
  60. define Package/libffi/install
  61. $(INSTALL_DIR) $(1)/usr/lib
  62. $(CP) \
  63. $(PKG_INSTALL_DIR)/usr/lib/libffi.so.* \
  64. $(1)/usr/lib/
  65. endef
  66. $(eval $(call HostBuild))
  67. $(eval $(call BuildPackage,libffi))