OpenWrt Cross-compiling node. JS (hg255d)

Source: Internet
Author: User
Tags install node

Operating system: Deepin Linux 2013 or Ubuntu 13.04

1, install the package before cross-compilation, need to install

sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk Flex Quilt Xsltproc
2, download the source code of OPENWRT

git clone git://git.openwrt.org/openwrt.gitcd openwrt./scripts/feeds update-a./scripts/feeds Install-amake Defconfigmake Prereqmake Menuconfig
Follow the selection of the corresponding project



3. A critical step

cd Packagemkdir Nodesudo gedit Makefile 
# # Copyright (C) 2006-2011 openwrt.org## This was free software, licensed under the GNU general public License v2.# see/li Cense for more information. #include $ (topdir)/rules.mkpkg_name:=node# current version Pkg_version:=v0.10.28pkg_release:=2pkg_ source:=node-$ (pkg_version). tar.gzpkg_source_url:=http://nodejs.org/dist/${pkg_version} #更改版本时也要修改PKG_MD5SUM: = 87768be7065d2120e71619948ab4bb2dgyp_defines:=v8_use_mips_abi_hardfloat=false v8_can_use_fpu_instructions= falselibs:=-i$ (Toolchain_dir)/mipsel-openwrt-linux-uclibc/include/c++/4.8.3/-i$ (TOOLCHAIN_DIR)/ Mipsel-openwrt-linux-uclibc/include/c++/4.8.3/mipsel-openwrt-linux-uclibc/include $ (INCLUDE_DIR)/ Package.mkdefine package/node depends:=+libpthread +librt +uclibcxx section:=lang CATEGORY:=Languages TITLE:=Node.js I  s a platform built on Chrome's JavaScript runtime Url:=http://nodejs.org/endefdefine Package/node/descriptionnode.js is a Platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. node. js USes an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time Applications that run across distributed devices.endefdefine build/prepare$ (call Build/prepare/default) $ (CP) Node.patch $ (PKG_BUILD_DIR)/(CD $ (pkg_build_dir); patch-p1 < node.patch;); Endefdefine build/configure (CD $ (pkg_build_dir); export libs= "$ (LIBS)"; Export cflags= "$ (target_cflags) $ (LIBS)";     Export cxxflags= "$ (target_cxxflags) $ (LIBS)"; Export gypflags= "$ (gypflags)";./configure--dest-cpu=mipsel--dest-os=linux--without-ssl--without-snapshot-- With-arm-float-abi=soft; ); Endefdefine build/compile$ (Make) $ (pkg_jobs)-C $ (Pkg_build_dir) gyp_defines= "$ (gyp_defines)" cc= "$ (target_cc)" CXX = "$ (target_cxx)" cflags= "$ (target_cflags) $ (LIBS)" cxxflags= "$ (target_cxxflags) $ (LIBS)-nostdinc++" ldflags= "$ ( target_ldflags)-nodefaultlibs-luclibc++-lc-lgcc-lgcc_s-lpthread "| | Touch $ (Pkg_build_dir)/deps/v8/build/common.gypi$ (make) $ (pkg_jobs)-C $ (pkg_build_dir) gyp_defines= "$ (gyp_defines)" cc= "$ (TARGET_CC)" cxx= "$ (target_cxx)" cflags= "$ (target_cflags) $ (LIBS)" cxxflags= "$ ( Target_cxxflags) $ (LIBS)-nostdinc++ "ldflags=" $ (target_ldflags)-nodefaultlibs-luclibc++-lc-lgcc-lgcc_s-lpthread " Endefdefine Package/node/installmkdir-p $ (1)/usr/bin$ (CP) $ (pkg_build_dir)/out/release/node $ (1)/usr/bin/ln-s/usr/ Bin/node $ (1)/usr/bin/nodejsendef$ (eval $ (call Buildpackage,node))

4. Compile after saving config file: Make v=99 (parameter is output debugging information)

5. Put the openwrt/bin/ramips/packages under the

Node_v0.10.28-2_ramips_24kec.ipk

Uclibcxx_0.2.4-1_ramips_24kec.ipk

Lazy to compile their classmates, can be downloaded to my network disk

Http://pan.baidu.com/s/1eQ1Pkdk

Copy to the router, install the UCLIBCXX_0.2.4-1_RAMIPS_24KEC.IPK library first, and then install the Node_v0.10.28-2_ramips_ 24KEC.IPK, I have to wait patiently when I install node, I waited for the first time to wait for a while without responding, thought the compilation failed, terminated the installation process, so it took a lot of time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.