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.

83 lines
2.4 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:=4
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=ftp://sourceware.org/pub/libffi/
  13. PKG_HASH:=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37
  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. define Build/InstallDev
  40. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  41. $(CP) \
  42. $(PKG_INSTALL_DIR)/usr/lib/libffi.{so*,a,la} \
  43. $(1)/usr/lib/
  44. $(CP) \
  45. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
  46. $(1)/usr/lib/pkgconfig/
  47. sed -i -e 's,includedir=.*,includedir=$$$${prefix}/include,' $(1)/usr/lib/pkgconfig/libffi.pc
  48. $(INSTALL_DIR) $(1)/usr/include
  49. $(CP) \
  50. $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)-$(PKG_VERSION)/include/*.h \
  51. $(1)/usr/include/
  52. endef
  53. define Package/libffi/install
  54. $(INSTALL_DIR) $(1)/usr/lib
  55. $(CP) \
  56. $(PKG_INSTALL_DIR)/usr/lib/libffi.so.* \
  57. $(1)/usr/lib/
  58. endef
  59. define Host/Install
  60. $(call Host/Install/Default)
  61. # Adjust host libffi headers ; the default rule does
  62. # not seem to install them to the proper include folder
  63. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include
  64. $(CP) \
  65. $(STAGING_DIR_HOSTPKG)/lib/libffi-$(PKG_VERSION)/include/*.h \
  66. $(STAGING_DIR_HOSTPKG)/include
  67. endef
  68. $(eval $(call HostBuild))
  69. $(eval $(call BuildPackage,libffi))