File: preconfig.sh

package info (click to toggle)
phantomjs 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 9,268 kB
  • ctags: 7,827
  • sloc: cpp: 6,363; ansic: 4,601; java: 2,041; python: 1,244; sh: 395; ruby: 48; cs: 27; xml: 14; makefile: 12
file content (114 lines) | stat: -rwxr-xr-x 3,587 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env bash

COMPILE_JOBS=4

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

if [[ $OSTYPE = darwin* ]]; then
    QT_CFG+=' -static'          # Static build on Mac OS X only
    QT_CFG+=' -arch x86'
    QT_CFG+=' -cocoa'           # Cocoa only, ignore Carbon
    QT_CFG+=' -no-dwarf2'
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)
fi

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
QT_CFG+=' -nomake docs'         # Don't generate the documentation
QT_CFG+=' -nomake examples'     # Don't build any examples
QT_CFG+=' -nomake translations' # Ignore the translations
QT_CFG+=' -nomake tools'        # Don't build the tools

QT_CFG+=' -no-exceptions'       # Don't use C++ exception
QT_CFG+=' -no-stl'              # No need for STL compatibility

# Irrelevant Qt features
QT_CFG+=' -no-libmng'
QT_CFG+=' -no-libtiff'
QT_CFG+=' -no-icu'

# Unnecessary Qt modules
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'

# Unnecessary Qt features
QT_CFG+=' -D QT_NO_GRAPHICSVIEW'
QT_CFG+=' -D QT_NO_GRAPHICSEFFECT'

# Sets the default graphics system to the raster engine
QT_CFG+=' -graphicssystem raster'

# Unix
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'

# Use the bundled libraries, vs system-installed
QT_CFG+=' -qt-libjpeg'
QT_CFG+=' -qt-libpng'
QT_CFG+=' -qt-zlib'

# Explicitly compile with SSL support, so build will fail if headers are missing
QT_CFG+=' -openssl'

# Useless styles
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

./configure -prefix $PWD $QT_CFG
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/