2013-01-05 15:15:15 +04:00
|
|
|
#!/usr/bin/env bash
|
2012-02-18 07:13:14 +04:00
|
|
|
|
|
|
|
COMPILE_JOBS=4
|
|
|
|
|
2012-03-07 06:02:07 +04:00
|
|
|
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
|
2012-02-18 07:13:14 +04:00
|
|
|
|
2012-03-07 06:49:04 +04:00
|
|
|
if [[ $OSTYPE = darwin* ]]; then
|
2012-03-14 09:06:37 +04:00
|
|
|
QT_CFG+=' -static' # Static build on Mac OS X only
|
2012-03-09 09:56:02 +04:00
|
|
|
QT_CFG+=' -arch x86'
|
|
|
|
QT_CFG+=' -cocoa' # Cocoa only, ignore Carbon
|
|
|
|
QT_CFG+=' -no-dwarf2'
|
2012-03-14 09:06:37 +04:00
|
|
|
else
|
|
|
|
QT_CFG+=' -system-freetype' # Freetype for text rendering
|
|
|
|
QT_CFG+=' -fontconfig' # Fontconfig for better font matching
|
|
|
|
QT_CFG+=' -qpa' # X11-less with QPA (aka Lighthouse)
|
2012-03-07 06:49:04 +04:00
|
|
|
fi
|
2012-02-18 07:13:14 +04:00
|
|
|
|
2012-03-07 06:02:07 +04:00
|
|
|
QT_CFG+=' -release' # Build only for release (no debugging support)
|
|
|
|
QT_CFG+=' -fast' # Accelerate Makefiles generation
|
|
|
|
QT_CFG+=' -nomake demos' # Don't build with the demos
|
2013-06-06 02:58:08 +04:00
|
|
|
QT_CFG+=' -nomake docs' # Don't generate the documentation
|
2012-03-07 06:02:07 +04:00
|
|
|
QT_CFG+=' -nomake examples' # Don't build any examples
|
|
|
|
QT_CFG+=' -nomake translations' # Ignore the translations
|
2013-06-06 02:58:08 +04:00
|
|
|
QT_CFG+=' -nomake tools' # Don't build the tools
|
2012-02-18 07:13:14 +04:00
|
|
|
|
2012-03-07 06:02:07 +04:00
|
|
|
QT_CFG+=' -no-exceptions' # Don't use C++ exception
|
|
|
|
QT_CFG+=' -no-stl' # No need for STL compatibility
|
2012-02-18 07:13:14 +04:00
|
|
|
|
2012-03-07 06:02:07 +04:00
|
|
|
# Irrelevant Qt features
|
|
|
|
QT_CFG+=' -no-libmng'
|
|
|
|
QT_CFG+=' -no-libtiff'
|
2012-03-13 10:55:33 +04:00
|
|
|
QT_CFG+=' -no-icu'
|
2012-02-18 07:13:14 +04:00
|
|
|
|
|
|
|
# Unnecessary Qt modules
|
2012-03-07 06:02:07 +04:00
|
|
|
QT_CFG+=' -no-declarative'
|
|
|
|
QT_CFG+=' -no-multimedia'
|
|
|
|
QT_CFG+=' -no-opengl'
|
|
|
|
QT_CFG+=' -no-openvg'
|
|
|
|
QT_CFG+=' -no-phonon'
|
|
|
|
QT_CFG+=' -no-qt3support'
|
|
|
|
QT_CFG+=' -no-script'
|
|
|
|
QT_CFG+=' -no-scripttools'
|
|
|
|
QT_CFG+=' -no-svg'
|
|
|
|
QT_CFG+=' -no-xmlpatterns'
|
|
|
|
|
2012-03-09 09:56:02 +04:00
|
|
|
# Unnecessary Qt features
|
|
|
|
QT_CFG+=' -D QT_NO_GRAPHICSVIEW'
|
|
|
|
QT_CFG+=' -D QT_NO_GRAPHICSEFFECT'
|
|
|
|
|
2012-03-07 06:02:07 +04:00
|
|
|
# Sets the default graphics system to the raster engine
|
|
|
|
QT_CFG+=' -graphicssystem raster'
|
2012-02-18 07:13:14 +04:00
|
|
|
|
|
|
|
# Unix
|
2012-03-07 06:02:07 +04:00
|
|
|
QT_CFG+=' -no-dbus' # Disable D-Bus feature
|
|
|
|
QT_CFG+=' -no-glib' # No need for Glib integration
|
|
|
|
QT_CFG+=' -no-gstreamer' # Turn off GStreamer support
|
|
|
|
QT_CFG+=' -no-gtkstyle' # Disable theming integration with Gtk+
|
|
|
|
QT_CFG+=' -no-cups' # Disable CUPs support
|
|
|
|
QT_CFG+=' -no-sm'
|
|
|
|
QT_CFG+=' -no-xinerama'
|
|
|
|
QT_CFG+=' -no-xkb'
|
2012-02-18 07:13:14 +04:00
|
|
|
|
|
|
|
# Use the bundled libraries, vs system-installed
|
2012-03-07 06:02:07 +04:00
|
|
|
QT_CFG+=' -qt-libjpeg'
|
|
|
|
QT_CFG+=' -qt-libpng'
|
2012-03-13 10:55:33 +04:00
|
|
|
QT_CFG+=' -qt-zlib'
|
2012-03-07 06:02:07 +04:00
|
|
|
|
|
|
|
# Explicitly compile with SSL support, so build will fail if headers are missing
|
|
|
|
QT_CFG+=' -openssl'
|
2012-02-18 07:13:14 +04:00
|
|
|
|
|
|
|
# Useless styles
|
2012-03-07 06:02:07 +04:00
|
|
|
QT_CFG+=' -D QT_NO_STYLESHEET'
|
|
|
|
QT_CFG+=' -D QT_NO_STYLE_CDE'
|
|
|
|
QT_CFG+=' -D QT_NO_STYLE_CLEANLOOKS'
|
|
|
|
QT_CFG+=' -D QT_NO_STYLE_MOTIF'
|
|
|
|
QT_CFG+=' -D QT_NO_STYLE_PLASTIQUE'
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
# For parallelizing the bootstrapping process, e.g. qmake and friends.
|
|
|
|
export MAKEFLAGS=-j$COMPILE_JOBS
|
2012-02-18 07:13:14 +04:00
|
|
|
|
2012-03-07 06:02:07 +04:00
|
|
|
./configure -prefix $PWD $QT_CFG
|
2012-02-18 07:13:14 +04:00
|
|
|
make -j$COMPILE_JOBS
|
|
|
|
|
|
|
|
# Extra step to ensure the static libraries are found
|
|
|
|
cp -rp src/3rdparty/webkit/Source/JavaScriptCore/release/* lib/
|
|
|
|
cp -rp src/3rdparty/webkit/Source/WebCore/release/* lib/
|