dnsmasq: add option to expose additional paths to jail
[openwrt/openwrt.git] / package / devel / binutils / Makefile
1 #
2 # Copyright (C) 2006-2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=binutils
11 PKG_VERSION:=2.38
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_URL:=@GNU/binutils
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_VERSION:=$(PKG_VERSION)
17 PKG_HASH:=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
18
19 PKG_FIXUP:=patch-libtool
20 PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
21 PKG_REMOVE_FILES:=libtool.m4
22 PKG_INSTALL:=1
23
24 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
25 PKG_LICENSE:=GPL-3.0+
26 PKG_CPE_ID:=cpe:/a:gnu:binutils
27 PKG_BUILD_PARALLEL:=1
28 PKG_USE_MIPS16:=0
29
30 include $(INCLUDE_DIR)/nls.mk
31 include $(INCLUDE_DIR)/package.mk
32
33 define Package/libbfd
34 SECTION:=libs
35 CATEGORY:=Libraries
36 TITLE:=libbfd
37 DEPENDS:=+zlib $(INTL_DEPENDS)
38 endef
39
40 define Package/libctf
41 SECTION:=libs
42 CATEGORY:=Libraries
43 TITLE:=libctf
44 DEPENDS:=+libbfd
45 endef
46
47 define Package/libopcodes
48 SECTION:=libs
49 CATEGORY:=Libraries
50 TITLE:=libopcodes
51 DEPENDS:=+libbfd
52 endef
53
54 define Package/binutils
55 SECTION:=devel
56 CATEGORY:=Development
57 TITLE:=binutils
58 DEPENDS:=+objdump +ar
59 ALTERNATIVES:=200:/usr/bin/strings:/usr/bin/binutils-strings
60 endef
61
62 define Package/objdump
63 SECTION:=devel
64 CATEGORY:=Development
65 TITLE:=objdump
66 DEPENDS:=+libopcodes +libctf
67 endef
68
69 define Package/ar
70 SECTION:=devel
71 CATEGORY:=Development
72 TITLE:=ar
73 DEPENDS:=+zlib +libbfd
74 endef
75
76 define Package/binutils/description
77 The Binutils package contains a linker, an assembler, and other tools for handling object files
78 endef
79
80 TARGET_CFLAGS += $(FPIC) -Wno-unused-value
81
82 TARGET_LDFLAGS += $(if $(INTL_FULL),-lintl)
83
84 CONFIGURE_ARGS += \
85 --host=$(REAL_GNU_TARGET_NAME) \
86 --target=$(REAL_GNU_TARGET_NAME) \
87 --enable-shared \
88 --enable-install-libiberty \
89 --enable-install-libbfd \
90 --enable-install-libctf
91
92 define Build/Install
93 $(call Build/Install/Default)
94 $(MAKE) -C $(PKG_BUILD_DIR)/libiberty \
95 target_header_dir=libiberty \
96 DESTDIR="$(PKG_INSTALL_DIR)" \
97 MULTIOSDIR="" \
98 install
99 endef
100
101 define Build/InstallDev
102 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
103 endef
104
105 define Package/libbfd/install
106 $(INSTALL_DIR) $(1)/usr/lib
107 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so* $(1)/usr/lib/
108 endef
109
110 define Package/libctf/install
111 $(INSTALL_DIR) $(1)/usr/lib
112 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libctf*.so* $(1)/usr/lib/
113 endef
114
115 define Package/libopcodes/install
116 $(INSTALL_DIR) $(1)/usr/lib
117 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
118 endef
119
120 define Package/objdump/install
121 $(INSTALL_DIR) $(1)/usr/bin
122 $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
123 endef
124
125 define Package/ar/install
126 $(INSTALL_DIR) $(1)/usr/bin
127 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ar $(1)/usr/bin/
128 endef
129
130 define Package/binutils/install
131 $(INSTALL_DIR) $(1)/usr $(1)/bin
132 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
133 mv $(1)/usr/bin/strings $(1)/usr/bin/binutils-strings
134 rm -f $(1)/usr/bin/objdump
135 rm -f $(1)/usr/bin/ar
136 endef
137
138 $(eval $(call BuildPackage,libbfd))
139 $(eval $(call BuildPackage,libctf))
140 $(eval $(call BuildPackage,libopcodes))
141 $(eval $(call BuildPackage,binutils))
142 $(eval $(call BuildPackage,objdump))
143 $(eval $(call BuildPackage,ar))