OSDN Git Service

elfutils: move host build to tools
[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 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-lzma \
69         --without-zstd
70
71 CONFIGURE_ARGS += \
72         --program-prefix=eu- \
73         --disable-debuginfod \
74         --disable-libdebuginfod \
75         --without-lzma \
76         --without-zstd
77
78 HOST_CONFIGURE_VARS += \
79         ac_cv_search__obstack_free=yes
80
81 CONFIGURE_VARS += \
82         ac_cv_search__obstack_free=yes
83
84 TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral
85
86 define Build/InstallDev
87         $(INSTALL_DIR) $(1)/usr/include
88         $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
89         $(INSTALL_DIR) $(1)/usr/lib
90         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm*.{a,so*} $(1)/usr/lib/
91         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw*.{a,so*} $(1)/usr/lib/
92         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf*.{a,so*} $(1)/usr/lib/
93         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
94         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libelf.pc $(1)/usr/lib/pkgconfig/
95         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libdw.pc $(1)/usr/lib/pkgconfig/
96 endef
97
98 define Package/libasm/install
99         $(INSTALL_DIR) $(1)/usr/lib
100         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasm{-*.so,*.so.*} $(1)/usr/lib/
101 endef
102
103 define Package/libdw/install
104         $(INSTALL_DIR) $(1)/usr/lib
105         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdw{-*.so,*.so.*} $(1)/usr/lib/
106 endef
107
108 define Package/libelf/install
109         $(INSTALL_DIR) $(1)/usr/lib
110         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelf{-*.so,*.so.*} $(1)/usr/lib/
111 endef
112
113 # these lines need to be ordered by dependency because of ABI versioning
114 $(eval $(call BuildPackage,libelf))
115 $(eval $(call BuildPackage,libdw))
116 $(eval $(call BuildPackage,libasm))