Created
February 26, 2012 16:43
-
-
Save nodokodo/1917555 to your computer and use it in GitHub Desktop.
Node.JS Update from Source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ $# -eq 0 ] && { echo "Usage: ${0} version-string" ; exit 1; } | |
VERSION=$1 | |
BUILD_DIR=/usr/local/src/node | |
ARC="node-v${VERSION}.tar.gz" | |
mkdir -p $BUILD_DIR | |
cd $BUILD_DIR | |
find ./* -prune -type d | xargs rm -rf | |
wget -c "http://nodejs.org/dist/v${VERSION}/${ARC}" | |
tar xzvf "${ARC}" | |
cd "node-v${VERSION}" | |
./configure --prefix=/usr/local | |
export JOBS=$( cat /proc/cpuinfo | grep processor | wc -l ) | |
export CFLAGS="-mtune=native -march=native" | |
export CXXFLAGS="-mtune=native -march=native" | |
make | |
make install | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment