toolchain: Replace YASM with NASM
authorTed Hess <thess@kitschensync.net>
Thu, 28 Jun 2018 23:28:02 +0000 (19:28 -0400)
committerTed Hess <thess@kitschensync.net>
Thu, 5 Jul 2018 14:17:06 +0000 (10:17 -0400)
Packages libx264 and ffmpeg are built with ASM options on x86 platforms.
The current libx264 version no longer builds with YASM and requires NASM.
ffmpeg 3.x can be built with either YASM or NASM however, furture 4.x versions
will require NASM.

Signed-off-by: Ted Hess <thess@kitschensync.net>
Acked-by: Rosen Penev <rosenp@gmail.com>
toolchain/Config.in
toolchain/Makefile
toolchain/nasm/Makefile [new file with mode: 0644]
toolchain/yasm/Makefile [deleted file]

index 96acf1e5c42e5b46cf04ed17d3456e09232d8fac..47e1c787df0d951418544f1c161c8aac2198cd76 100644 (file)
@@ -224,13 +224,13 @@ comment "Compiler"
 
 source "toolchain/gcc/Config.in"
 
-config YASM
+config NASM
        bool
        depends on ( i386 || x86_64 )
-       prompt "Build yasm" if TOOLCHAINOPTS
+       prompt "Build nasm" if TOOLCHAINOPTS
        default y
        help
-         Enable if you want to build yasm
+         Enable if you want to build nasm
 
 comment "C Library"
        depends on TOOLCHAINOPTS
index 409955c23a9c941387c92499f5270d69a973cdd2..9432990f4f75e70895689796c5815953c7a0853d 100644 (file)
@@ -29,7 +29,7 @@
 curdir:=toolchain
 
 # subdirectories to descend into
-$(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_YASM),yasm)
+$(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_NASM),nasm)
 ifdef CONFIG_USE_UCLIBC
   $(curdir)/builddirs += $(LIBC)/utils
 endif
diff --git a/toolchain/nasm/Makefile b/toolchain/nasm/Makefile
new file mode 100644 (file)
index 0000000..a39c71f
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nasm
+PKG_VERSION:=2.13.03
+
+PKG_SOURCE_URL:=https://www.nasm.us/pub/nasm/releasebuilds/$(PKG_VERSION)/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+
+PKG_HASH:=812ecfb0dcbc5bd409aaa8f61c7de94c5b8752a7b00c632883d15b2ed6452573
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/toolchain-build.mk
+
+HOST_CONFIGURE_ARGS+= \
+               --target=$(REAL_GNU_TARGET_NAME) \
+               --with-sysroot=$(TOOLCHAIN_DIR) \
+               --enable-lto \
+               --disable-werror \
+               --disable-gdb \
+               $(SOFT_FLOAT_CONFIG_OPTION) \
+
+define Host/Prepare
+       $(call Host/Prepare/Default)
+       ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
+       $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
+endef
+
+define Host/Configure
+       (cd $(HOST_BUILD_DIR); \
+               ./autogen.sh \
+       );
+       $(call Host/Configure/Default)
+endef
+
+define Host/Compile
+       +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
+endef
+
+define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) \
+               prefix=$(TOOLCHAIN_DIR) \
+               install
+endef
+
+define Host/Clean
+       rm -rf \
+               $(HOST_BUILD_DIR) \
+               $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
+endef
+
+$(eval $(call HostBuild))
diff --git a/toolchain/yasm/Makefile b/toolchain/yasm/Makefile
deleted file mode 100644 (file)
index e5cdac6..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Copyright (C) 2016 Daniel Golle <daniel@makrotopia.org>
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=yasm
-PKG_VERSION:=1.3.0
-
-PKG_SOURCE_URL:=http://www.tortall.net/projects/yasm/releases/
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-
-PKG_HASH:=3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f
-
-HOST_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/toolchain-build.mk
-
-YASM_CONFIGURE:= \
-       ./configure \
-               --prefix=$(TOOLCHAIN_DIR) \
-               --build=$(GNU_HOST_NAME) \
-               --host=$(GNU_HOST_NAME) \
-               --target=$(REAL_GNU_TARGET_NAME) \
-               --with-sysroot=$(TOOLCHAIN_DIR) \
-               --disable-multilib \
-               --disable-werror \
-               --disable-nls \
-               --disable-sim \
-               --disable-gdb \
-               $(SOFT_FLOAT_CONFIG_OPTION) \
-
-define Host/Prepare
-       $(call Host/Prepare/Default)
-       ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
-       $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
-endef
-
-define Host/Configure
-       (cd $(HOST_BUILD_DIR); \
-               $(YASM_CONFIGURE) \
-       );
-endef
-
-define Host/Compile
-       +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
-endef
-
-define Host/Install
-       $(MAKE) -C $(HOST_BUILD_DIR) \
-               prefix=$(TOOLCHAIN_DIR) \
-               install
-endef
-
-define Host/Clean
-       rm -rf \
-               $(HOST_BUILD_DIR) \
-               $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
-endef
-
-$(eval $(call HostBuild))