Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Add --system-qtdeps build mode.
Browse files Browse the repository at this point in the history
In this mode, system-provided libraries will be used for all of
Qt's dependencies, but Qt and QtWebkit themselves are still the
bundled copies.  This mode actually works.

Now that this mode exists, disable fontconfig in the "everything
bundled" mode, because it drags in the system freetype and several
other system libraries.  (There is no bundled fontconfig.)

Part of issue #12467.
  • Loading branch information
zackw authored and ariya committed Aug 19, 2014
1 parent 4246ed0 commit 8d23afb
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 19 deletions.
15 changes: 12 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if [[ "$COMPILE_JOBS" -gt 8 ]]; then
fi

SILENT=''
QTDEPLIBS=bundled
QTCORE=bundled
QTWEBKIT=bundled

Expand All @@ -57,10 +58,15 @@ until [ -z "$1" ]; do
"--silent")
SILENT=silent
shift;;
"--system-qtdeps")
QTDEPLIBS=system
shift;;
"--system-qt")
QTDEPLIBS=system
QTCORE=system
shift;;
"--system-qtwebkit")
QTDEPLIBS=system
QTCORE=system
QTWEBKIT=system
shift;;
Expand All @@ -71,7 +77,8 @@ until [ -z "$1" ]; do
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 " --silent Produce less verbose output."
echo " --system-qt Use system-provided Qt core libraries. EXPERIMENTAL, build may not succeed."
echo " --system-qtdeps Use system-provided libraries for all of Qt's dependencies (e.g. freetype, libpng). EXPERIMENTAL."
echo " --system-qt Use system-provided Qt core libraries. EXPERIMENTAL, build may not succeed. Implies --system-qtdeps."
echo " --system-qtwebkit Use system-provided QtWebkit. EXPERIMENTAL, build may not succeed. Implies --system-qt."
echo
exit 0
Expand Down Expand Up @@ -125,8 +132,7 @@ echo

if [[ "$QTCORE" == "bundled" ]]; then
export QMAKE=$PWD/src/qt/qtbase/bin/qmake
export SQLITE3SRCDIR=$PWD/src/qt/qtbase/src/3rdparty/sqlite/
( cd src/qt && ./preconfig.sh $QT_CFG )
( cd src/qt && ./preconfig.sh $QTDEPLIBS $QT_CFG )

echo
echo "Building Qt..."
Expand All @@ -144,6 +150,9 @@ if [[ "$QTWEBKIT" == "bundled" ]]; then
echo
echo "Building QtWebkit..."
echo
if [[ "$QTDEPLIBS" == "bundled" ]]; then
export SQLITE3SRCDIR=$PWD/src/qt/qtbase/src/3rdparty/sqlite/
fi
( cd src/qt/qtwebkit &&
$QMAKE $QMAKE_ARGS &&
make -j$COMPILE_JOBS $MAKE_S )
Expand Down
69 changes: 53 additions & 16 deletions src/qt/preconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@

set -e

if [[ $1 == "system" ]] || [[ $1 == "bundled" ]]; then
QTDEPLIBS=$1
shift
else
QTDEPLIBS=bundled
fi

QT_CFG=''
QT_CFG+=' -opensource' # Use the open-source license
QT_CFG+=' -confirm-license' # Silently acknowledge the license confirmation
QT_CFG+=' -v' # Makes it easier to see what header dependencies are missing
QT_CFG+=' -v' # Reveal what header dependencies are missing
QT_CFG+=' -static' # No shared libraries
QT_CFG+=' -qpa phantom' # Default to our custom QPA platform
QT_CFG+=' -release' # Build only for release (no debugging support)
QT_CFG+=' -nomake examples' # Don't build any examples
QT_CFG+=' -no-compile-examples' # Seriously, don't build any examples
QT_CFG+=' -nomake tools' # Don't build the tools

if [[ $OSTYPE == darwin* ]]; then
Expand Down Expand Up @@ -40,32 +48,61 @@ QT_CFG+=' -no-libudev'
QT_CFG+=' -no-linuxfb'
QT_CFG+=' -no-mtdev'
QT_CFG+=' -no-nis'
QT_CFG+=' -no-pkg-config'
QT_CFG+=' -no-sm'
QT_CFG+=' -no-xcb'
QT_CFG+=' -no-xcb-xlib'
QT_CFG+=' -no-xinerama'
QT_CFG+=' -no-xinput2'
QT_CFG+=' -no-xkb'
QT_CFG+=' -no-xrender'

# Use the bundled libraries, vs system-installed
# Note: pcre cannot be disabled, even though webkit has its own regex engine
# Note: as best I can tell, webkitcore has a hard dependency on sqlite
QT_CFG+=' -qt-harfbuzz'
QT_CFG+=' -qt-libjpeg'
QT_CFG+=' -qt-libpng'
QT_CFG+=' -qt-pcre'
QT_CFG+=' -qt-sql-sqlite'
QT_CFG+=' -qt-zlib'
# These are also unnecessary, but it's not possible to turn them off.
#QT_CFG+=' -no-pulseaudio'
#QT_CFG+=' -no-xlib'

# Explicitly compile with support for certain optional features enabled,
# so the build will fail if headers are missing.
# Explicitly compile with support for OpenSSL enabled, so the build
# will fail if headers are missing.
QT_CFG+=' -openssl'

# ICU support in QtBase is reported to be unnecessary for Darwin.
if [[ $OSTYPE != darwin* ]]; then
# These are reported to be unnecessary and/or not work correctly
# on Darwin.
QT_CFG+=' -icu'
QT_CFG+=' -fontconfig'
fi

# PCRE cannot be disabled, even though WebKit has its own regex
# engine. The Qt probe for system PCRE is hardwired to look for
# -lpcre16, which is ancient and not present on current Linux
# installs.
QT_CFG+=' -qt-pcre'

if [[ $QTDEPLIBS == bundled ]]; then
# Use the bundled libraries.
# Note: as best I can tell, webkitcore has a hard dependency on sqlite.
QT_CFG+=' -no-pkg-config'
QT_CFG+=' -qt-freetype'
QT_CFG+=' -qt-harfbuzz'
QT_CFG+=' -qt-libjpeg'
QT_CFG+=' -qt-libpng'
QT_CFG+=' -qt-sql-sqlite'
QT_CFG+=' -qt-zlib'

# There is no bundled copy of fontconfig, and if activated it will
# pull in the system copies of several of the above libraries.
QT_CFG+=' -no-fontconfig'

else
# Use system-provided libraries.
QT_CFG+=' -system-freetype'
QT_CFG+=' -system-harfbuzz'
QT_CFG+=' -system-libjpeg'
QT_CFG+=' -system-libpng'
QT_CFG+=' -system-sqlite -sql-sqlite'
QT_CFG+=' -system-zlib'

# Fontconfig is reported to not work correctly on Darwin.
if [[ $OSTYPE != darwin* ]]; then
QT_CFG+=' -fontconfig'
fi
fi

# Useless styles
Expand Down

0 comments on commit 8d23afb

Please sign in to comment.