Last active
August 29, 2015 14:04
-
-
Save nodekid/e33106629b28b4ae1a17 to your computer and use it in GitHub Desktop.
This file contains hidden or 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} | |
PREFIX="/usr/local" | |
SRC_CWD="${PREFIX}/src" | |
SRC_DIR="${SRC_CWD}/node" | |
SRC_GIT="git://github.com/joyent/node.git" | |
CPUS=$( grep processor /proc/cpuinfo | wc -l ) # non-portable :/ | |
JOBS=$(( $CPUS + 1 )) | |
cd "${SRC_CWD}" | |
if [ ! -d "${SRC_DIR}" ] ; then | |
git clone "${SRC_GIT}" | |
fi | |
cd "${SRC_DIR}" | |
echo "[Checking for updates...]" | |
git checkout master && git pull | |
git checkout "v${VERSION}" | |
./configure --prefix="${PREFIX}" | |
echo "[Compiling using ${JOBS} jobs...]" | |
make install \ | |
V=1 \ | |
-j $JOBS #\ | |
#CFLAGS+="-mtune=native -march=native" \ | |
#CXXFLAGS+="-mtune=native -march=native" | |
echo "[Cleaning up...]" | |
make distclean > /dev/null 2>&1 | |
echo "[Build complete]" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment