b22145debeb672bb82b6343f2951fa75b444835a
[packages.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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libelf
12 PKG_VERSION:=0.8.8
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.mr511.de/software/
17 PKG_MD5SUM:=be84e553686dd50c8b6d520f86f46521
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/libelf
22   SECTION:=libs
23   CATEGORY:=Libraries
24   TITLE:=ELF object file access library
25   URL:=http://www.stud.uni-hannover.de/~michael/software/
26 endef
27
28 CONFIGURE_ARGS += \
29         --enable-shared \
30         --enable-static \
31         --enable-elf64=yes \
32
33 CONFIGURE_VARS += \
34         mr_cv_target_elf=yes \
35         libelf_64bit=yes \
36         libelf_cv_struct_elf64_ehdr=yes \
37         libelf_cv_type_elf64_addr=no \
38         libelf_cv_struct_elf64_rel=yes \
39
40 define Build/Compile
41         $(MAKE) -C $(PKG_BUILD_DIR) \
42                 instroot="$(PKG_INSTALL_DIR)" \
43                 all install
44 endef
45
46 define Build/InstallDev
47         mkdir -p $(STAGING_DIR)/usr/include
48         $(CP) $(PKG_INSTALL_DIR)/usr/include/libelf* $(STAGING_DIR)/usr/include/
49         mkdir -p $(STAGING_DIR)/usr/lib
50         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.{a,so*} $(STAGING_DIR)/usr/lib/
51         mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
52         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libelf.pc $(STAGING_DIR)/usr/lib/pkgconfig/
53         $(SED) 's,-I$$$${includedir}/libelf,-I$(STAGING_DIR)/usr/include/libelf,g' $(STAGING_DIR)/usr/lib/pkgconfig/libelf.pc
54         $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libelf.pc
55 endef
56
57 define Build/UninstallDev
58         rm -rf \
59                 $(STAGING_DIR)/usr/include/libelf* \
60                 $(STAGING_DIR)/usr/lib/libelf.{a,so*}
61 endef
62
63 define Package/libelf/install
64         $(INSTALL_DIR) $(1)/usr/lib
65         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf.so.* $(1)/usr/lib/
66 endef
67
68 $(eval $(call BuildPackage,libelf))