Skip to content

Instantly share code, notes, and snippets.

Created January 23, 2010 18:10
Show Gist options
  • Save anonymous/284711 to your computer and use it in GitHub Desktop.
Save anonymous/284711 to your computer and use it in GitHub Desktop.
#!/bin/bash
function help()
{
echo
echo "Usage: $0 [options] [qmake_options]"
echo
echo " options:"
echo " --help | -h - show this screen"
echo " --release | -r - build in release mode (default)"
echo " --debug | -d - build in debug mode"
echo " --no-jit - disable JIT (default is on)"
echo " --no-jobs | -n | -c - do not clean the previous build and execute ony one job"
echo " --O0 - build with -O0"
echo " --O1 - build with -O1"
echo " --O2 - build with -O2"
echo " --Os - build with -Os"
echo
}
JIT=""
QMAKEARGS="CONFIG+=standalone_package"
MODE="Release"
CLEAN=""
JOBS="-j4"
while ! test "x$1" == "x"
do
case "$1" in
--help|--h|-help|-h)
help
exit 0
;;
--no-jit)
JIT="disabled"
QMAKEARGS="$QMAKEARGS DEFINES+=ENABLE_JIT=0 DEFINES+=ENABLE_YARR=0 DEFINES+=ENABLE_YARR_JIT=0"
;;
--release|-release|-r)
MODE="Release"
;;
--debug|-debug|-d)
MODE="Debug"
;;
--no-jobs|-n|-c)
CLEAN="disabled"
JOBS=""
;;
--O0|-O0)
QMAKEARGS="$QMAKEARGS QMAKE_CXXFLAGS_RELEASE-=-O2 QMAKE_CXXFLAGS_RELEASE+=-O0"
;;
--O1|-O1)
QMAKEARGS="$QMAKEARGS QMAKE_CXXFLAGS_RELEASE-=-O2 QMAKE_CXXFLAGS_RELEASE+=-O1"
;;
--O2|-O2)
QMAKEARGS="$QMAKEARGS QMAKE_CXXFLAGS_RELEASE-=-O2 QMAKE_CXXFLAGS_RELEASE+=-O2"
;;
--O3|-O3)
QMAKEARGS="$QMAKEARGS QMAKE_CXXFLAGS_RELEASE-=-O2 QMAKE_CXXFLAGS_RELEASE+=-O3"
;;
--Os|-Os)
QMAKEARGS="$QMAKEARGS QMAKE_CXXFLAGS_RELEASE-=-O2 QMAKE_CXXFLAGS_RELEASE+=-Os"
;;
*)
QMAKEARGS="$QMAKEARGS $1"
;;
esac
shift
done
if test "x$MODE" == "xDebug"
then
QMAKEARGS="$QMAKEARGS CONFIG-=release CONFIG+=debug"
else
QMAKEARGS="$QMAKEARGS CONFIG+=release CONFIG-=debug"
fi
if test "x$JIT" == "x"
then
QMAKEARGS="$QMAKEARGS DEFINES+=ENABLE_JIT=1 DEFINES+=ENABLE_YARR=1 DEFINES+=ENABLE_YARR_JIT=1"
fi
BDIR=WebKitBuild/$MODE/JavaScriptCore
if test "x$CLEAN" == "x"
then
rm -rf $BDIR
fi
mkdir -p $BDIR
cd $BDIR
if !(qmake -r ../../../JavaScriptCore/DerivedSources.pro -o Makefile.generated \
$QMAKEARGS)
then
exit 1
fi
if !(make -f Makefile.generated $JOBS)
then
exit 1
fi
if !(qmake -r ../../../JavaScriptCore/jsc.pro \
$QMAKEARGS)
then
exit 1
fi
if !(make $JOBS)
then
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment