toolchain/nasm: Backport GCC8 compatibility fix from upstream repo
[openwrt/openwrt.git] / toolchain / nasm / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=nasm
8 PKG_VERSION:=2.13.03
9
10 PKG_SOURCE_URL:=https://www.nasm.us/pub/nasm/releasebuilds/$(PKG_VERSION)/
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
12
13 PKG_HASH:=812ecfb0dcbc5bd409aaa8f61c7de94c5b8752a7b00c632883d15b2ed6452573
14
15 HOST_BUILD_PARALLEL:=1
16
17 include $(INCLUDE_DIR)/toolchain-build.mk
18
19 HOST_CONFIGURE_ARGS+= \
20 --target=$(REAL_GNU_TARGET_NAME) \
21 --with-sysroot=$(TOOLCHAIN_DIR) \
22 --enable-lto \
23 --disable-werror \
24 --disable-gdb \
25 $(SOFT_FLOAT_CONFIG_OPTION) \
26
27 HOST_MAKE_FLAGS = \
28 AR=ar \
29 RANLIB=ranlib
30
31 define Host/Prepare
32 $(call Host/Prepare/Default)
33 ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
34 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
35 endef
36
37 define Host/Configure
38 (cd $(HOST_BUILD_DIR); \
39 ./autogen.sh \
40 );
41 $(call Host/Configure/Default)
42 endef
43
44 define Host/Install
45 $(MAKE) -C $(HOST_BUILD_DIR) \
46 $(HOST_MAKE_FLAGS) \
47 prefix=$(TOOLCHAIN_DIR) \
48 install
49 endef
50
51 define Host/Clean
52 rm -rf \
53 $(HOST_BUILD_DIR) \
54 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
55 endef
56
57 $(eval $(call HostBuild))