"Don't use parallel make by default," he says after accidentally turning it off and discovering that his builds are about 4 times faster.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4627 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/build-xorg b/unix/build-xorg
index f7abcc2..95e7134 100755
--- a/unix/build-xorg
+++ b/unix/build-xorg
@@ -8,6 +8,7 @@
 
 PREFIX=
 MAKE="make"
+PARALLEL_MAKE=0
 XORG_VERSION=7.4
 XONLY=0
 CFGHOST=
@@ -226,7 +227,7 @@
     exit 1
 }
 
-if [ -x '/usr/bin/getconf' ]; then
+if [ -x '/usr/bin/getconf' -a "$PARALLEL_MAKE" = "1" ]; then
     MAKE_PARALLEL=`/usr/bin/getconf _NPROCESSORS_ONLN 2>&1`
     [ "$MAKE_PARALLEL" -gt 1 ] && MAKE="$MAKE -j$MAKE_PARALLEL"
 fi
@@ -240,6 +241,7 @@
 	rebuild)    MODE=rebuild             ;;
 	update)     MODE=update              ;;
 	-version)   XORG_VERSION=$2;  shift  ;;
+	-parallel)  PARALLEL_MAKE=1;         ;;
 	-srcdir)    SRCDIR=$2;        shift  ;;
 	*)          break                    ;;
     esac