summaryrefslogtreecommitdiffstats
path: root/Tools/qmake/mkspecs/features/default_pre.prf
blob: 7cdeb1259515194313d2496ed5bcdf9210e2401a (plain)
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
115
# -------------------------------------------------------------------
# QtWebKit defaults for qmake. These rules are parsed before the
# actual project file.
#
# See 'Tools/qmake/README' for an overview of the build system
# -------------------------------------------------------------------

load(functions)

# Derived sources often need QMAKE_MOC
load(qt_functions)
load(moc)

# FIXME: In this case we probably want to exit early so that we
# don't load all of the custom build tweaks needlessly.
pro_file = $$_PRO_FILE_ # Checking the variable directly does not work
isEmpty(pro_file): CONFIG += recursive_include

# Resolve root directories for source and build
ROOT_WEBKIT_DIR = $$replace(PWD, /Tools/qmake/mkspecs/features$,)
WEBKIT_SUBDIR = $$replace(_PRO_FILE_PWD_, $${ROOT_WEBKIT_DIR},)
ROOT_BUILD_DIR = $$toSystemPath($$replace(OUT_PWD, $${WEBKIT_SUBDIR}$,))

# We want the QtWebKit API forwarding includes to live in the root build dir.
MODULE_BASE_DIR = $$ROOT_WEBKIT_DIR
MODULE_BASE_OUTDIR = $$ROOT_BUILD_DIR

# The qmake files on the other hand live in a subdirectory.
MODULE_QMAKE_OUTDIR = $$ROOT_BUILD_DIR/Tools/qmake

# Now we're ready to load default_pre from Qt
load(default_pre)

unix:config_gccdepends {
    # We have a compiler that supports the -MD option (and neither
    # teambuilder nor icecream is messing up the .d file output).
    CONFIG += GNUmake gcc_MD_depends
}

equals(OUT_PWD, $${ROOT_BUILD_DIR}) {
    !recursive_include:CONFIG += root_project_file
    BUILD_ROOT_RELATIVE_TO_OUT_PWD = .
} else {
    subdir_parts = $$replace(OUT_PWD, ^$${ROOT_BUILD_DIR}$${QMAKE_DIR_SEP},)
    subdir_parts = $$split(subdir_parts, $${QMAKE_DIR_SEP})
    for(subdir, subdir_parts) {
        BUILD_ROOT_RELATIVE_TO_OUT_PWD += ..
    }
    BUILD_ROOT_RELATIVE_TO_OUT_PWD = $$join(BUILD_ROOT_RELATIVE_TO_OUT_PWD, $${QMAKE_DIR_SEP})
}

# Try to detect if we're running under Windows cmd.exe or not
win32* {
    pwd = $$(PWD) # Normally empty for cmd.exe
    pwd_starts_with_slash = $$find(pwd, ^/)
    isEmpty(pwd_starts_with_slash): CONFIG += win_cmd_shell
}

# Default location of generated sources
GENERATED_SOURCES_DESTDIR = generated

QUOTE = ""
DOUBLE_ESCAPED_QUOTE = ""
ESCAPE = ""
win_cmd_shell {
    ESCAPE = "^"
} else {
    QUOTE = "\'"
    DOUBLE_ESCAPED_QUOTE = "\\\'"
}

MAKEFILE_NOOP_COMMAND = @echo -n
win32-msvc*: MAKEFILE_NOOP_COMMAND = @echo >NUL

# Set up a default python version
scratchbox: PYTHON = python2.6
else: PYTHON = python

!haveQt(5):!recursive_include: error("Building WebKit with Qt versions older than 5.0 is not supported.")

!haveQtModule(widgets) {
    root_project_file: message("WebKit1 requires the QtWidgets module. Disabling WebKit1.")
    CONFIG += no_webkit1
}

# We use private_tests to detect developer build, since the destdir will
# always be our webkit build dir. This might change as configure changes.
contains(QT_CONFIG, private_tests): CONFIG += qt_developer_build

# Set some defaults for specific platforms
CONFIG += include_webinspector

# Try to locate sqlite3 source (for WebCore)
SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
isEmpty(SQLITE3SRCDIR) {
    SQLITE3SRCDIR = $$QT.core.sources/../3rdparty/sqlite/
}

# --------- Make features available to JSC ------------

## Forward enabled feature macros to JavaScript enabled features macros
FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1

for(define, DEFINES) {
    enabled_feature_define = $$find(define, ^ENABLE_.+=1$)
    isEmpty(enabled_feature_define): next()

    FEATURE_DEFINES_JAVASCRIPT += $$enabled_feature_define
}

# Save the base config and defines so we can compute the delta between
# what features.prf introduced and what was already there.
BASE_CONFIG = $$CONFIG
BASE_DEFINES = $$DEFINES