5cf5a9385cde38611438bb91726b2f4c92ef37f1
[openwrt/svn-archive/archive.git] / libs / libelf / Makefile
1 #
2 # Copyright (C) 2006 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:=libelf
11 PKG_VERSION:=0.8.11
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.mr511.de/software/
16 PKG_MD5SUM:=e931910b6d100f6caa32239849947fbf
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/libelf
21 SECTION:=libs
22 CATEGORY:=Libraries
23 TITLE:=ELF object file access library
24 URL:=http://www.mr511.de/software/
25 endef
26
27 TARGET_CFLAGS += $(FPIC)
28
29 CONFIGURE_ARGS += \
30 --enable-shared \
31 --enable-static \
32 --enable-elf64=yes \
33
34 CONFIGURE_VARS += \
35 mr_cv_target_elf=yes \
36 libelf_64bit=yes \
37 libelf_cv_struct_elf64_ehdr=yes \
38 libelf_cv_type_elf64_addr=no \
39 libelf_cv_struct_elf64_rel=yes \
40
41 define Build/Compile
42 $(MAKE) -C $(PKG_BUILD_DIR) \
43 instroot="$(PKG_INSTALL_DIR)" \
44 all install
45 endef
46
47 define Build/InstallDev
48 mkdir -p $(1)/usr/include
49 $(CP) $(PKG_INSTALL_DIR)/usr/include/libelf* $(1)/usr/include/
50 mkdir -p $(1)/usr/lib
51 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.{a,so*} $(1)/usr/lib/
52 mkdir -p $(1)/usr/lib/pkgconfig
53 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libelf.pc $(1)/usr/lib/pkgconfig/
54 endef
55
56 define Package/libelf/install
57 $(INSTALL_DIR) $(1)/usr/lib
58 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.so.* $(1)/usr/lib/
59 endef
60
61 $(eval $(call BuildPackage,libelf))