toolchain/nasm: force ar and ranlib only on macOSX
[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 ifeq ($(HOST_OS),Darwin)
28 HOST_MAKE_FLAGS = \
29 AR=ar \
30 RANLIB=ranlib
31 endif
32
33 define Host/Prepare
34 $(call Host/Prepare/Default)
35 ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
36 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
37 endef
38
39 define Host/Configure
40 (cd $(HOST_BUILD_DIR); \
41 ./autogen.sh \
42 );
43 $(call Host/Configure/Default)
44 endef
45
46 define Host/Install
47 $(MAKE) -C $(HOST_BUILD_DIR) \
48 $(HOST_MAKE_FLAGS) \
49 prefix=$(TOOLCHAIN_DIR) \
50 install
51 endef
52
53 define Host/Clean
54 rm -rf \
55 $(HOST_BUILD_DIR) \
56 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
57 endef
58
59 $(eval $(call HostBuild))