mirror of https://github.com/vitalif/phantomjs
Add capability to build PhantomJS against system Qt/Webkit.
Invoking build.sh with --system-qtwebkit will skip the build of Qt and QtWebkit and use the qmake in $PATH to build PhantomJS proper. This doesn't actually *work* at the moment because the bundled copy of Webkit has patches not yet merged upstream, but it's still useful to have for testing purposes. Part of issue #12467.2.0
parent
5b5e63af23
commit
615f33c9c4
35
build.sh
35
build.sh
|
@ -34,6 +34,7 @@ if [[ "$COMPILE_JOBS" -gt 8 ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SILENT=''
|
SILENT=''
|
||||||
|
QTWEBKIT=bundled
|
||||||
|
|
||||||
until [ -z "$1" ]; do
|
until [ -z "$1" ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
@ -56,6 +57,9 @@ until [ -z "$1" ]; do
|
||||||
SILENT='--silent'
|
SILENT='--silent'
|
||||||
QT_CFG+=" -silent"
|
QT_CFG+=" -silent"
|
||||||
shift;;
|
shift;;
|
||||||
|
"--system-qtwebkit")
|
||||||
|
QTWEBKIT=system
|
||||||
|
shift;;
|
||||||
"--help")
|
"--help")
|
||||||
echo "Usage: $0 [--qt-config CONFIG] [--jobs NUM]"
|
echo "Usage: $0 [--qt-config CONFIG] [--jobs NUM]"
|
||||||
echo
|
echo
|
||||||
|
@ -63,6 +67,7 @@ until [ -z "$1" ]; do
|
||||||
echo " --qt-config CONFIG Specify extra config options to be used when configuring Qt"
|
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 " --jobs NUM How many parallel compile jobs to use. Defaults to 4."
|
||||||
echo " --silent Produce less verbose output."
|
echo " --silent Produce less verbose output."
|
||||||
|
echo " --system-qtwebkit Use system-provided QtWebkit. EXPERIMENTAL, build may not succeed."
|
||||||
echo
|
echo
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
@ -72,6 +77,10 @@ until [ -z "$1" ]; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ "$QTWEBKIT" = system ]] && [[ -n "$QT_CFG" ]] && [[ "$QT_CFG" != " -silent" ]]; then
|
||||||
|
echo "$0: options --qt-config and --system-qtwebkit are mutually exclusive" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$BUILD_CONFIRM" -eq 0 ]]; then
|
if [[ "$BUILD_CONFIRM" -eq 0 ]]; then
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
@ -107,15 +116,23 @@ UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
|
||||||
echo "System architecture... ($UNAME_SYSTEM $UNAME_RELEASE $UNAME_MACHINE)"
|
echo "System architecture... ($UNAME_SYSTEM $UNAME_RELEASE $UNAME_MACHINE)"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "Building QtBase library. Please wait..."
|
if [[ "$QTWEBKIT" == "bundled" ]]; then
|
||||||
echo
|
export QMAKE=$PWD/src/qt/qtbase/bin/qmake
|
||||||
(cd src/qt && ./preconfig.sh --jobs $COMPILE_JOBS --qt-config "$QT_CFG" $SILENT) || (echo "Failed to compile QtBase"; exit 1)
|
export SQLITE3SRCDIR=$PWD/src/qt/qtbase/3rdparty/sqlite/
|
||||||
|
( cd src/qt &&
|
||||||
echo "Building QtWebKit library. Please wait..."
|
./preconfig.sh --jobs $COMPILE_JOBS --qt-config "$QT_CFG" $SILENT )
|
||||||
echo
|
( cd src/qt/qtwebkit &&
|
||||||
export SQLITE3SRCDIR=$PWD/qtbase/3rdparty/sqlite/
|
$QMAKE $QMAKE_ARGS &&
|
||||||
(cd src/qt/qtwebkit && ../qtbase/bin/qmake $QMAKE_ARGS && make -j$COMPILE_JOBS) || (echo "Failed to compile QtWebKit"; exit 1)
|
make -j$COMPILE_JOBS )
|
||||||
|
else
|
||||||
|
export QMAKE=qmake
|
||||||
|
# some Linux distros (e.g. Debian) allow you to parallel-install
|
||||||
|
# Qt4 and Qt5, using this environment variable to declare which
|
||||||
|
# one you want
|
||||||
|
export QT_SELECT=qt5
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Building main PhantomJS application. Please wait..."
|
echo "Building main PhantomJS application. Please wait..."
|
||||||
echo
|
echo
|
||||||
(src/qt/qtbase/bin/qmake $QMAKE_ARGS && make -j$COMPILE_JOBS) || (echo "Failed to compile PhantomJS"; exit 1)
|
$QMAKE $QMAKE_ARGS
|
||||||
|
make -j$COMPILE_JOBS
|
||||||
|
|
Loading…
Reference in New Issue