libffi: split build and source directory to work around some makefile bugs
[openwrt/svn-archive/archive.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.10
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:=79390673f5d07a8fb342bc09b5055b6f
17
18 PKG_FIXUP:=autoreconf
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/libffi
24 SECTION:=libs
25 CATEGORY:=Libraries
26 TITLE:=Foreign Function Interface (FFI) library
27 URL:=http://sourceware.org/libffi/
28 endef
29
30 define Package/libffi/description
31 The libffi library provides a portable, high level programming interface to
32 various calling conventions. This allows a programmer to call any function
33 specified by a call interface description at run-time.
34
35 FFI stands for Foreign Function Interface. A foreign function interface is the
36 popular name for the interface that allows code written in one language to call
37 code written in another language. The libffi library really only provides the
38 lowest, machine dependent layer of a fully featured foreign function interface.
39 A layer must exist above libffi that handles type conversions for values passed
40 between the two languages.
41 endef
42
43 CONFIGURE_PATH = build
44 CONFIGURE_CMD = ../configure
45 MAKE_PATH = build
46
47 define Build/Configure
48 mkdir -p $(PKG_BUILD_DIR)/build
49 $(Build/Configure/Default)
50 endef
51
52 define Build/InstallDev
53 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
54 $(CP) \
55 $(PKG_INSTALL_DIR)/usr/lib/libffi.{so*,a,la} \
56 $(1)/usr/lib/
57 $(CP) \
58 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
59 $(1)/usr/lib/pkgconfig/
60
61 $(INSTALL_DIR) $(1)/usr/include
62 $(CP) \
63 $(PKG_INSTALL_DIR)/usr/lib/libffi-$(PKG_VERSION)/include/*.h \
64 $(1)/usr/include/
65 endef
66
67 define Package/libffi/install
68 $(INSTALL_DIR) $(1)/usr/lib
69 $(CP) \
70 $(PKG_INSTALL_DIR)/usr/lib/libffi.so.* \
71 $(1)/usr/lib/
72 endef
73
74 $(eval $(call BuildPackage,libffi))