Build node.js with clang.

来源:互联网 发布:爱知日语培训 编辑:程序博客网 时间:2024/05/17 05:08

Since I chose clang as my favorite compiler,

The default compiler of node.js is g++, so it needs a little trick to force node.js to use clang. Here is it:

1. Run configure with clang support.

CC=clang ./configure --prefix=/usr

2. Specify complier.

Be sure you didn't install g++, then you can do so:

sudo ln -n /usr/bin/clang /usr/bin/g++CC=clang make

3. Finally, make && make install.

(Don't forget to remove the fake g++ link).

make && sudo make installsudo rm /usr/bin/g++

Good luck!

0 0
原创粉丝点击