OSDN Git Service

07b3ea66c66a1d247ed81f3c6f731c6bbfac3b17
[immortalwrt/immortalwrt.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.186
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:=7f6fb9149b1673d38d9178a0d3e0fb8a1ec4f53a9f4c2ff89469609879641177
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 HOST_BUILD_DEPENDS:=argp-standalone/host musl-fts/host
28
29 include $(INCLUDE_DIR)/package.mk
30 include $(INCLUDE_DIR)/nls.mk
31 include $(INCLUDE_DIR)/host-build.mk
32
33 define Package/elfutils/Default
34   SECTION:=libs
35   CATEGORY:=Libraries
36   TITLE:=ELF manipulation libraries
37   URL:=https://fedorahosted.org/elfutils/
38   ABI_VERSION:=1
39 endef
40
41 define Package/libasm
42   $(call Package/elfutils/Default)
43   TITLE+= (libasm)
44   DEPENDS:=+libelf +libdw
45 endef
46
47 define Package/libdw
48   $(call Package/elfutils/Default)
49   DEPENDS:=+libelf +libbz2 +USE_MUSL:musl-fts
50   TITLE+= (libdw)
51 endef
52
53 define Package/libelf
54   $(call Package/elfutils/Default)
55   DEPENDS:=$(INTL_DEPENDS) +zlib
56   TITLE+= (libelf)
57   PROVIDES:=libelf1
58 endef
59
60 ifeq ($(CONFIG_BUILD_NLS),y)
61 TARGET_LDFLAGS += -lintl
62 else
63 CONFIGURE_ARGS += --disable-nls
64 endif
65
66 HOST_CONFIGURE_ARGS += \
67         --disable-shared \
68         --disable-nls \
69         --disable-debuginfod \
70         --disable-libdebuginfod \
71         --without-lzma \
72         --without-zstd
73
74 CONFIGURE_ARGS += \
75         --program-prefix=eu- \
76         --disable-debuginfod \
77         --disable-libdebuginfod \
78         --without-lzma \
79         --without-zstd
80
81 HOST_CONFIGURE_VARS += \
82         ac_cv_search__obstack_free=yes
83
84 CONFIGURE_VARS += \
85         ac_cv_search__obstack_free=yes
86
87 TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral
88
89 define Build/InstallDev
90         $(INSTALL_DIR) $(1)/usr/include
91         $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
92         $(INSTALL_DIR) $(1)/usr/lib
93         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm*.{a,so*} $(1)/usr/lib/
94         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw*.{a,so*} $(1)/usr/lib/
95         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf*.{a,so*} $(1)/usr/lib/
96         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
97         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libelf.pc $(1)/usr/lib/pkgconfig/
98         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdw.pc $(1)/usr/lib/pkgconfig/
99 endef
100
101 define Package/libasm/install
102         $(INSTALL_DIR) $(1)/usr/lib
103         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm{-*.so,*.so.*} $(1)/usr/lib/
104 endef
105
106 define Package/libdw/install
107         $(INSTALL_DIR) $(1)/usr/lib
108         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw{-*.so,*.so.*} $(1)/usr/lib/
109 endef
110
111 define Package/libelf/install
112         $(INSTALL_DIR) $(1)/usr/lib
113         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf{-*.so,*.so.*} $(1)/usr/lib/
114 endef
115
116 # these lines need to be ordered by dependency because of ABI versioning
117 $(eval $(call HostBuild))
118 $(eval $(call BuildPackage,libelf))
119 $(eval $(call BuildPackage,libdw))
120 $(eval $(call BuildPackage,libasm))