Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 54 lines (47 sloc) 1.421 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#!/bin/bash

QT_CFG=''

COMPILE_JOBS=1

MAKEFLAGS_JOBS=$(echo $MAKEFLAGS | egrep -o '\-j[0-9]+' | egrep -o '[0-9]+')
if [[ "$MAKEFLAGS_JOBS" != "" ]]; then
  # user defined number of jobs in MAKEFLAGS, re-use that number
  COMPILE_JOBS=$MAKEFLAGS_JOBS
elif [[ $OSTYPE = darwin* ]]; then
   # We only support modern Mac machines, they are at least using
   # hyperthreaded dual-core CPU.
   COMPILE_JOBS=4
else
CPU_CORES=`grep -c ^processor /proc/cpuinfo`
   if [[ "$CPU_CORES" -gt 1 ]]; then
COMPILE_JOBS=$CPU_CORES
       if [[ "$COMPILE_JOBS" -gt 8 ]]; then
           # Safety net.
           COMPILE_JOBS=8
       fi
fi
fi


until [ -z "$1" ]; do
case $1 in
        "--qt-config")
            shift
QT_CFG=" $1"
            shift;;
        "--jobs")
            shift
COMPILE_JOBS=$1
            shift;;
        "--help")
            echo "Usage: $0 [--qt-config CONFIG] [--jobs NUM]"
            echo
echo " --qt-config CONFIG Specify extra config options to be used when configuring Qt"
            echo " --jobs NUM How many parallel compile jobs to use. Defaults to 4."
            echo
exit 0
            ;;
        *)
            echo "Unrecognised option: $1"
            exit 1;;
    esac
done

cd src/qt && ./preconfig.sh --jobs $COMPILE_JOBS --qt-config "$QT_CFG" && cd ../..
src/qt/bin/qmake
make -j$COMPILE_JOBS
Something went wrong with that request. Please try again.