elfutils: Pass -Wno-unused-result to silence warnings as errors
[openwrt/openwrt.git] / package / libs / elfutils / Makefile
1 #
2 # Copyright (C) 2010-2014 OpenWrt.org
3 # Copyright (C) 2016-2017 Luiz Angelo Daros de Luca <luizluca@gmail.com>
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=elfutils
11 PKG_VERSION:=0.169
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
16 PKG_HASH:=9412fac7b30872b738bc1ed1ebcaed54493c26ef9a67887913498c17b10f3bc2
17 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
18 PKG_LICENSE:=GPL-3.0+
19 PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
20
21 PKG_INSTALL:=1
22 PKG_USE_MIPS16:=0
23
24 PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
25
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/nls.mk
28
29 define Package/elfutils/Default
30 SECTION:=libs
31 CATEGORY:=Libraries
32 TITLE:=ELF manipulation libraries
33 URL:=https://fedorahosted.org/elfutils/
34 endef
35
36 define Package/libasm
37 $(call Package/elfutils/Default)
38 TITLE+= (libasm)
39 DEPENDS:=libelf1 +libdw
40 endef
41
42 define Package/libdw
43 $(call Package/elfutils/Default)
44 DEPENDS:=libelf1 +libbz2
45 TITLE+= (libdw)
46 endef
47
48 define Package/libelf1
49 $(call Package/elfutils/Default)
50 DEPENDS:=$(INTL_DEPENDS) +zlib
51 TITLE+= (libelf)
52 endef
53
54 ifeq ($(CONFIG_BUILD_NLS),y)
55 TARGET_LDFLAGS += "-lintl"
56 endif
57
58 ifdef CONFIG_USE_UCLIBC
59 CONFIGURE_VARS += \
60 LIBS="-largp"
61 endif
62
63 ifdef CONFIG_USE_MUSL
64 CONFIGURE_VARS += \
65 LIBS="-largp"
66 endif
67
68 CONFIGURE_ARGS += \
69 --without-lzma
70
71 TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result
72
73 define Build/InstallDev
74 $(INSTALL_DIR) $(1)/usr/include
75 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
76 $(INSTALL_DIR) $(1)/usr/lib
77 $(CP) $(PKG_BUILD_DIR)/libasm/libasm.{a,so*} $(1)/usr/lib/
78 $(CP) $(PKG_BUILD_DIR)/libdw/libdw.{a,so*} $(1)/usr/lib/
79 $(CP) $(PKG_BUILD_DIR)/libelf/libelf.{a,so*} $(1)/usr/lib/
80 endef
81
82 define Package/libasm/install
83 $(INSTALL_DIR) $(1)/usr/lib
84 $(CP) $(PKG_BUILD_DIR)/libasm/libasm.so* $(1)/usr/lib/
85 endef
86
87 define Package/libdw/install
88 $(INSTALL_DIR) $(1)/usr/lib
89 $(CP) $(PKG_BUILD_DIR)/libdw/libdw.so* $(1)/usr/lib/
90 endef
91
92 define Package/libelf1/install
93 $(INSTALL_DIR) $(1)/usr/lib
94 $(CP) $(PKG_BUILD_DIR)/libelf/libelf.so* $(1)/usr/lib/
95 endef
96
97 $(eval $(call BuildPackage,libasm))
98 $(eval $(call BuildPackage,libdw))
99 $(eval $(call BuildPackage,libelf1))