mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
create rootf's & SDK from 2018.02.9 buildroot (#10)
--------- Co-authored-by: tiopex <tiopxyz@gmail.com> Co-authored-by: tiopex <67048640+tiopex@users.noreply.github.com>
This commit is contained in:
+46
-137
@@ -4,65 +4,26 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
NODEJS_VERSION = 14.20.1
|
||||
NODEJS_VERSION = 8.14.0
|
||||
NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
|
||||
NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
|
||||
NODEJS_DEPENDENCIES = \
|
||||
host-nodejs \
|
||||
host-pkgconf \
|
||||
host-python3 \
|
||||
host-qemu \
|
||||
c-ares \
|
||||
libuv \
|
||||
nghttp2 \
|
||||
zlib \
|
||||
NODEJS_DEPENDENCIES = host-python host-nodejs c-ares \
|
||||
libhttpparser libuv zlib \
|
||||
$(call qstrip,$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL_DEPS))
|
||||
HOST_NODEJS_DEPENDENCIES = \
|
||||
host-icu \
|
||||
host-libopenssl \
|
||||
host-pkgconf \
|
||||
host-python3 \
|
||||
host-zlib
|
||||
NODEJS_INSTALL_STAGING = YES
|
||||
HOST_NODEJS_DEPENDENCIES = host-python host-zlib
|
||||
NODEJS_LICENSE = MIT (core code); MIT, Apache and BSD family licenses (Bundled components)
|
||||
NODEJS_LICENSE_FILES = LICENSE
|
||||
NODEJS_CPE_ID_VENDOR = nodejs
|
||||
NODEJS_CPE_ID_PRODUCT = node.js
|
||||
|
||||
NODEJS_CONF_OPTS = \
|
||||
--without-snapshot \
|
||||
--shared-zlib \
|
||||
--shared-cares \
|
||||
--shared-http-parser \
|
||||
--shared-libuv \
|
||||
--shared-nghttp2 \
|
||||
--without-dtrace \
|
||||
--without-etw \
|
||||
--cross-compiling \
|
||||
--dest-os=linux
|
||||
|
||||
HOST_NODEJS_MAKE_OPTS = \
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
CXXFLAGS="$(HOST_NODEJS_CXXFLAGS)" \
|
||||
LDFLAGS.host="$(HOST_LDFLAGS)" \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH)
|
||||
|
||||
NODEJS_MAKE_OPTS = \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
LDFLAGS="$(NODEJS_LDFLAGS)" \
|
||||
LD="$(TARGET_CXX)"
|
||||
|
||||
# nodejs's build system uses python which can be a symlink to an unsupported
|
||||
# python version (e.g. python 3.10 with nodejs 14.18.1). We work around this by
|
||||
# forcing host-python3 early in the PATH, via a python->python3 symlink.
|
||||
define NODEJS_PYTHON3_SYMLINK
|
||||
mkdir -p $(@D)/bin
|
||||
ln -sf $(HOST_DIR)/bin/python3 $(@D)/bin/python
|
||||
endef
|
||||
HOST_NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_PYTHON3_SYMLINK
|
||||
NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_PYTHON3_SYMLINK
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
||||
NODEJS_DEPENDENCIES += openssl
|
||||
NODEJS_CONF_OPTS += --shared-openssl
|
||||
@@ -81,47 +42,46 @@ ifneq ($(BR2_PACKAGE_NODEJS_NPM),y)
|
||||
NODEJS_CONF_OPTS += --without-npm
|
||||
endif
|
||||
|
||||
# nodejs build system is based on python, but only support python-2.6 or
|
||||
# python-2.7. So, we have to enforce PYTHON interpreter to be python2.
|
||||
define HOST_NODEJS_CONFIGURE_CMDS
|
||||
# The build system directly calls python. Work around this by forcing python2
|
||||
# into PATH. See https://github.com/nodejs/node/issues/2735
|
||||
mkdir -p $(@D)/bin
|
||||
ln -sf $(HOST_DIR)/bin/python2 $(@D)/bin/python
|
||||
|
||||
# Build with the static, built-in OpenSSL which is supplied as part of
|
||||
# the nodejs source distribution. This is needed on the host because
|
||||
# NPM is non-functional without it, and host-openssl isn't part of
|
||||
# buildroot.
|
||||
(cd $(@D); \
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(HOST_DIR)/bin/python3 configure.py \
|
||||
PYTHON=$(HOST_DIR)/bin/python2 \
|
||||
$(HOST_DIR)/bin/python2 ./configure \
|
||||
--prefix=$(HOST_DIR) \
|
||||
--without-snapshot \
|
||||
--without-dtrace \
|
||||
--without-etw \
|
||||
--shared-openssl \
|
||||
--shared-openssl-includes=$(HOST_DIR)/include \
|
||||
--shared-openssl-libpath=$(HOST_DIR)/lib \
|
||||
--shared-zlib \
|
||||
--no-cross-compiling \
|
||||
--with-intl=system-icu \
|
||||
--with-intl=none \
|
||||
)
|
||||
endef
|
||||
|
||||
NODEJS_HOST_TOOLS_V8 = \
|
||||
torque \
|
||||
gen-regexp-special-case \
|
||||
bytecode_builtins_list_generator
|
||||
NODEJS_HOST_TOOLS_NODE = mkcodecache
|
||||
NODEJS_HOST_TOOLS = $(NODEJS_HOST_TOOLS_V8) $(NODEJS_HOST_TOOLS_NODE)
|
||||
|
||||
HOST_NODEJS_CXXFLAGS = $(HOST_CXXFLAGS)
|
||||
|
||||
define HOST_NODEJS_BUILD_CMDS
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python2 \
|
||||
$(MAKE) -C $(@D) \
|
||||
$(HOST_NODEJS_MAKE_OPTS)
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH)
|
||||
endef
|
||||
|
||||
define HOST_NODEJS_INSTALL_CMDS
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python2 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
$(HOST_NODEJS_MAKE_OPTS)
|
||||
|
||||
$(foreach f,$(NODEJS_HOST_TOOLS), \
|
||||
$(INSTALL) -m755 -D $(@D)/out/Release/$(f) $(HOST_DIR)/bin/$(f)
|
||||
)
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_i386),y)
|
||||
@@ -134,23 +94,10 @@ else ifeq ($(BR2_mipsel),y)
|
||||
NODEJS_CPU = mipsel
|
||||
else ifeq ($(BR2_arm),y)
|
||||
NODEJS_CPU = arm
|
||||
# V8 needs to know what floating point ABI the target is using.
|
||||
NODEJS_ARM_FP = $(GCC_TARGET_FLOAT_ABI)
|
||||
# it also wants to know which FPU to use, but only has support for
|
||||
# vfp, vfpv3, vfpv3-d16 and neon.
|
||||
ifeq ($(BR2_ARM_FPU_VFPV2),y)
|
||||
NODEJS_ARM_FPU = vfp
|
||||
# vfpv4 is a superset of vfpv3
|
||||
else ifeq ($(BR2_ARM_FPU_VFPV3)$(BR2_ARM_FPU_VFPV4),y)
|
||||
NODEJS_ARM_FPU = vfpv3
|
||||
# vfpv4-d16 is a superset of vfpv3-d16
|
||||
else ifeq ($(BR2_ARM_FPU_VFPV3D16)$(BR2_ARM_FPU_VFPV4D16),y)
|
||||
NODEJS_ARM_FPU = vfpv3-d16
|
||||
else ifeq ($(BR2_ARM_FPU_NEON),y)
|
||||
NODEJS_ARM_FPU = neon
|
||||
endif
|
||||
else ifeq ($(BR2_aarch64),y)
|
||||
NODEJS_CPU = arm64
|
||||
# V8 needs to know what floating point ABI the target is using.
|
||||
NODEJS_ARM_FP = $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
|
||||
endif
|
||||
|
||||
# MIPS architecture specific options
|
||||
@@ -165,55 +112,19 @@ NODEJS_MIPS_ARCH_VARIANT = r1
|
||||
endif
|
||||
endif
|
||||
|
||||
NODEJS_LDFLAGS = $(TARGET_LDFLAGS)
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
NODEJS_LDFLAGS += -latomic
|
||||
endif
|
||||
|
||||
# V8's JIT infrastructure requires binaries such as mksnapshot and
|
||||
# mkpeephole to be run in the host during the build. However, these
|
||||
# binaries must have the same bit-width as the target (e.g. a x86_64
|
||||
# host targeting ARMv6 needs to produce a 32-bit binary). To work around this
|
||||
# issue, cross-compile the binaries for the target and run them on the
|
||||
# host with QEMU, much like gobject-introspection.
|
||||
define NODEJS_INSTALL_V8_QEMU_WRAPPER
|
||||
$(INSTALL) -D -m 755 $(NODEJS_PKGDIR)/v8-qemu-wrapper.in \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
$(SED) "s%@QEMU_USER@%$(QEMU_USER)%g" \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
$(SED) "s%@TOOLCHAIN_HEADERS_VERSION@%$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)%g" \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
$(SED) "s%@QEMU_USERMODE_ARGS@%$(call qstrip,$(BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS))%g" \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
endef
|
||||
NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_INSTALL_V8_QEMU_WRAPPER
|
||||
|
||||
define NODEJS_WRAPPER_FIXUP
|
||||
$(SED) "s%@MAYBE_WRAPPER@%'<(PRODUCT_DIR)/v8-qemu-wrapper',%g" $(@D)/node.gyp
|
||||
$(SED) "s%@MAYBE_WRAPPER@%'<(PRODUCT_DIR)/v8-qemu-wrapper',%g" $(@D)/tools/v8_gypfiles/v8.gyp
|
||||
endef
|
||||
NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_WRAPPER_FIXUP
|
||||
|
||||
# Do not run the qemu-wrapper for the host build.
|
||||
define HOST_NODEJS_WRAPPER_FIXUP
|
||||
$(SED) "s%@MAYBE_WRAPPER@%%g" $(@D)/node.gyp
|
||||
$(SED) "s%@MAYBE_WRAPPER@%%g" $(@D)/tools/v8_gypfiles/v8.gyp
|
||||
endef
|
||||
HOST_NODEJS_PRE_CONFIGURE_HOOKS += HOST_NODEJS_WRAPPER_FIXUP
|
||||
|
||||
define NODEJS_CONFIGURE_CMDS
|
||||
mkdir -p $(@D)/bin
|
||||
ln -sf $(HOST_DIR)/bin/python2 $(@D)/bin/python
|
||||
|
||||
(cd $(@D); \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
LDFLAGS="$(NODEJS_LDFLAGS)" \
|
||||
LD="$(TARGET_CXX)" \
|
||||
PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(HOST_DIR)/bin/python3 configure.py \
|
||||
PYTHON=$(HOST_DIR)/bin/python2 \
|
||||
$(HOST_DIR)/bin/python2 ./configure \
|
||||
--prefix=/usr \
|
||||
--dest-cpu=$(NODEJS_CPU) \
|
||||
$(if $(NODEJS_ARM_FP),--with-arm-float-abi=$(NODEJS_ARM_FP)) \
|
||||
$(if $(NODEJS_ARM_FPU),--with-arm-fpu=$(NODEJS_ARM_FPU)) \
|
||||
$(if $(NODEJS_MIPS_ARCH_VARIANT),--with-mips-arch-variant=$(NODEJS_MIPS_ARCH_VARIANT)) \
|
||||
$(if $(NODEJS_MIPS_FPU_MODE),--with-mips-fpu-mode=$(NODEJS_MIPS_FPU_MODE)) \
|
||||
$(NODEJS_CONF_OPTS) \
|
||||
@@ -221,9 +132,12 @@ define NODEJS_CONFIGURE_CMDS
|
||||
endef
|
||||
|
||||
define NODEJS_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python2 \
|
||||
$(MAKE) -C $(@D) \
|
||||
$(NODEJS_MAKE_OPTS)
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
LD="$(TARGET_CXX)"
|
||||
endef
|
||||
|
||||
#
|
||||
@@ -234,7 +148,6 @@ NODEJS_MODULES_LIST= $(call qstrip,\
|
||||
|
||||
# Define NPM for other packages to use
|
||||
NPM = $(TARGET_CONFIGURE_OPTS) \
|
||||
LDFLAGS="$(NODEJS_LDFLAGS)" \
|
||||
LD="$(TARGET_CXX)" \
|
||||
npm_config_arch=$(NODEJS_CPU) \
|
||||
npm_config_target_arch=$(NODEJS_CPU) \
|
||||
@@ -256,18 +169,14 @@ define NODEJS_INSTALL_MODULES
|
||||
endef
|
||||
endif
|
||||
|
||||
define NODEJS_INSTALL_STAGING_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
DESTDIR=$(STAGING_DIR) \
|
||||
$(NODEJS_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
define NODEJS_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python2 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
DESTDIR=$(TARGET_DIR) \
|
||||
$(NODEJS_MAKE_OPTS)
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
LD="$(TARGET_CXX)"
|
||||
$(NODEJS_INSTALL_MODULES)
|
||||
endef
|
||||
|
||||
|
||||
Reference in New Issue
Block a user