Skip to content

Instantly share code, notes, and snippets.

@nodokodo
Created February 26, 2012 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nodokodo/1917555 to your computer and use it in GitHub Desktop.
Save nodokodo/1917555 to your computer and use it in GitHub Desktop.
Node.JS Update from Source
#!/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