mirror of https://github.com/vitalif/phantomjs
Ask for a confirmation before initiating the build.
Although it is mentioned in http://phantomjs.org/build.html, many people are not aware this, they compile from source (even if a binary package is available) and get shocked to realize the build takes ages. The build script is thus modified to give the initial warning. Unattended build is still possible, just use --confirm flag. http://code.google.com/p/phantomjs/issues/detail?id=8621.7
parent
8cdd708812
commit
f6abcfe676
29
build.sh
29
build.sh
|
@ -4,6 +4,7 @@ set -e
|
|||
|
||||
QT_CFG=''
|
||||
|
||||
BUILD_CONFIRM=0
|
||||
COMPILE_JOBS=1
|
||||
MAKEFLAGS_JOBS=''
|
||||
|
||||
|
@ -43,9 +44,13 @@ until [ -z "$1" ]; do
|
|||
shift
|
||||
COMPILE_JOBS=$1
|
||||
shift;;
|
||||
"--confirm")
|
||||
BUILD_CONFIRM=1
|
||||
shift;;
|
||||
"--help")
|
||||
echo "Usage: $0 [--qt-config CONFIG] [--jobs NUM]"
|
||||
echo
|
||||
echo " --confirm Silently confirm the build."
|
||||
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
|
||||
|
@ -57,6 +62,30 @@ until [ -z "$1" ]; do
|
|||
esac
|
||||
done
|
||||
|
||||
|
||||
if [[ "$BUILD_CONFIRM" -eq 0 ]]; then
|
||||
cat << EOF
|
||||
----------------------------------------
|
||||
WARNING
|
||||
----------------------------------------
|
||||
|
||||
Building PhantomJS from source takes a very long time, anywhere from 30 minutes
|
||||
to several hours (depending on the machine configuration). It is recommended to
|
||||
use the premade binary packages on supported operating systems.
|
||||
|
||||
For details, please go the the web site: http://phantomjs.org/download.html.
|
||||
|
||||
EOF
|
||||
|
||||
echo "Do you want to continue (y/n)?"
|
||||
read continue
|
||||
if [[ "$continue" != "y" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
echo
|
||||
echo
|
||||
fi
|
||||
|
||||
cd src/qt && ./preconfig.sh --jobs $COMPILE_JOBS --qt-config "$QT_CFG" && cd ../..
|
||||
src/qt/bin/qmake $QMAKE_ARGS
|
||||
make -j$COMPILE_JOBS
|
||||
|
|
|
@ -11,7 +11,7 @@ echo
|
|||
# This incantation will cause Qt and WebKit and PhantomJS to all build in "release"
|
||||
# mode, with compiler optimisations, but also with debug symbols. (We will strip the
|
||||
# symbols in package.sh.)
|
||||
CFLAGS=-g CXXFLAGS=-g ./build.sh --qt-config '-webkit-debug' --qmake-args "QMAKE_CFLAGS=-g QMAKE_CXXFLAGS=-g" || exit 1
|
||||
CFLAGS=-g CXXFLAGS=-g ./build.sh --confirm --qt-config '-webkit-debug' --qmake-args "QMAKE_CFLAGS=-g QMAKE_CXXFLAGS=-g" || exit 1
|
||||
|
||||
# Package the release tarball
|
||||
rm deploy/*.tar.bz2 2>/dev/null
|
||||
|
|
Loading…
Reference in New Issue