Blog

Blog

PHODAL

io.js 编译 安装

试了试在Mac OS下安装IO.js,决定编译试试。

IO.js 编译

看了看官网列举的条件

  • gcc and g++ 4.8 or newer, or
  • clang and clang++ 3.3 or newer
  • Python 2.6 or 2.7
  • GNU Make 3.81 or newer
  • libexecinfo (FreeBSD and OpenBSD only)

1.Clone代码

git clone git@github.com:iojs/io.js.git

无奈的是很慢,因为很大

Cloning into 'io.js'...
remote: Counting objects: 141542, done.
remote: Compressing objects: 100% (119/119), done.
Receiving objects:  13% (19198/141542), 15.54 MiB | 118.00 KiB/s
Receiving objects:  13% (19254/141542), 15.69 MiB | 107.00 KiB/s
Receiving objects:  25% (35386/141542), 44.27 MiB | 144.00 KiB/s
Receiving objects:  27% (39541/141542), 52.86 MiB | 88.00 KiB/s    KiB/s

2.编译

$ ./configure

生成了一堆参数

creating  ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'host_arch': 'x64',
                 'icu_small': 'false',
                 'node_install_npm': 'true',
                 'node_prefix': '',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_v8': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_dtrace': 'true',
                 'node_use_etw': 'false',
                 'node_use_mdb': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'false',
                 'openssl_no_asm': 0,
                 'python': '/Users/fdhuang/py27/bin/python',
                 'target_arch': 'x64',
                 'uv_library': 'static_library',
                 'uv_parent_path': '/deps/uv/',
                 'uv_use_dtrace': 'true',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 0,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 'false',
                 'want_separate_host_toolset': 0}}
creating  ./config.gypi
creating  ./config.mk

然后

$ make

直到

ln -fs out/Release/iojs iojs

接着

$ [sudo] make install

发现直接把node给替换掉了。。。

ln -fs out/Release/iojs iojs
/Users/fdhuang/py27/bin/python tools/install.py install '' '/usr/local'
installing /usr/local/bin/iojs
symlinking iojs -> /usr/local/bin/node

3.运行所有的测试

 $ make test

发现io.js的构造系统好强悍

/Applications/Xcode-Beta.app/Contents/Developer/usr/bin/make -C out BUILDTYPE=Release V=1
make[1]: Nothing to be done for `all'.
ln -fs out/Release/iojs iojs
/Users/fdhuang/py27/bin/python tools/test.py --mode=release message parallel sequential -J

或许您还需要下面的文章:

关于我

Github: @phodal     微博:@phodal     知乎:@phodal    

微信公众号(Phodal)

围观我的Github Idea墙, 也许,你会遇到心仪的项目

QQ技术交流群: 321689806
comment

Feeds

RSS / Atom

最近文章

关于作者

Phodal Huang

Engineer, Consultant, Writer, Designer

ThoughtWorks 技术专家

工程师 / 咨询师 / 作家 / 设计学徒

开源深度爱好者

出版有《前端架构:从入门到微前端》、《自己动手设计物联网》、《全栈应用开发:精益实践》

联系我: h@phodal.com

微信公众号: 最新技术分享

标签