2c68a94ba03c3e5ec3004023be526caae0c10539
[openwrt/openwrt.git] / package / libs / elfutils / Makefile
1 #
2 # Copyright (C) 2010-2019 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=elfutils
10 PKG_VERSION:=0.189
11 PKG_RELEASE:=1
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
14 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
15 PKG_HASH:=39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8
16
17 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
18 PKG_LICENSE:=GPL-3.0-or-later
19 PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
20 PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils
21
22 PKG_FIXUP:=autoreconf
23 PKG_INSTALL:=1
24 PKG_USE_MIPS16:=1
25 PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/nls.mk
29
30 define Package/elfutils/Default
31 SECTION:=libs
32 CATEGORY:=Libraries
33 TITLE:=ELF manipulation libraries
34 URL:=https://fedorahosted.org/elfutils/
35 ABI_VERSION:=1
36 endef
37
38 define Package/libasm
39 $(call Package/elfutils/Default)
40 TITLE+= (libasm)
41 DEPENDS:=+libelf +libdw
42 endef
43
44 define Package/libdw
45 $(call Package/elfutils/Default)
46 DEPENDS:=+libelf +libbz2 +USE_MUSL:musl-fts
47 TITLE+= (libdw)
48 endef
49
50 define Package/libelf
51 $(call Package/elfutils/Default)
52 DEPENDS:=$(INTL_DEPENDS) +zlib
53 TITLE+= (libelf)
54 PROVIDES:=libelf1
55 endef
56
57 ifeq ($(CONFIG_BUILD_NLS),y)
58 TARGET_LDFLAGS += -lintl
59 else
60 CONFIGURE_ARGS += --disable-nls
61 endif
62
63 HOST_CONFIGURE_ARGS += \
64 --disable-shared \
65 --disable-nls \
66 --disable-debuginfod \
67 --disable-libdebuginfod \
68 --without-bzlib \
69 --without-lzma \
70 --without-zstd
71
72 CONFIGURE_ARGS += \
73 --program-prefix=eu- \
74 --disable-debuginfod \
75 --disable-libdebuginfod \
76 --without-bzlib \
77 --without-lzma \
78 --without-zstd
79
80 HOST_CONFIGURE_VARS += \
81 ac_cv_search__obstack_free=yes
82
83 CONFIGURE_VARS += \
84 ac_cv_search__obstack_free=yes
85
86 TARGET_CFLAGS += \
87 -D_GNU_SOURCE \
88 -Wno-unused-result \
89 -Wno-format-nonliteral
90
91 ifneq ($(CONFIG_GCC_USE_VERSION_11),y)
92 TARGET_CFLAGS += \
93 -Wno-error=use-after-free
94 endif
95
96 define Build/InstallDev
97 $(INSTALL_DIR) $(1)/usr/include
98 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
99 $(INSTALL_DIR) $(1)/usr/lib
100 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm*.{a,so*} $(1)/usr/lib/
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw*.{a,so*} $(1)/usr/lib/
102 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf*.{a,so*} $(1)/usr/lib/
103 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libelf.pc $(1)/usr/lib/pkgconfig/
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdw.pc $(1)/usr/lib/pkgconfig/
106 endef
107
108 define Package/libasm/install
109 $(INSTALL_DIR) $(1)/usr/lib
110 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm{-*.so,*.so.*} $(1)/usr/lib/
111 endef
112
113 define Package/libdw/install
114 $(INSTALL_DIR) $(1)/usr/lib
115 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw{-*.so,*.so.*} $(1)/usr/lib/
116 endef
117
118 define Package/libelf/install
119 $(INSTALL_DIR) $(1)/usr/lib
120 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf{-*.so,*.so.*} $(1)/usr/lib/
121 endef
122
123 # these lines need to be ordered by dependency because of ABI versioning
124 $(eval $(call BuildPackage,libelf))
125 $(eval $(call BuildPackage,libdw))
126 $(eval $(call BuildPackage,libasm))