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