Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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:=3
  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. 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. define Host/Install
  67. $(call Host/Install/Default)
  68. # Adjust host libffi headers ; the default rule does
  69. # not seem to install them to the proper include folder
  70. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include
  71. $(CP) \
  72. $(STAGING_DIR_HOSTPKG)/lib/libffi-$(PKG_VERSION)/include/*.h \
  73. $(STAGING_DIR_HOSTPKG)/include
  74. endef
  75. $(eval $(call HostBuild))
  76. $(eval $(call BuildPackage,libffi))