diff options
Diffstat (limited to 'recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch')
-rw-r--r-- | recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch | 314 |
1 files changed, 53 insertions, 261 deletions
diff --git a/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch b/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch index b28ca8b6..df2016e1 100644 --- a/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch +++ b/recipes-qt/qt5/qtbase/0001-Add-linux-oe-g-platform.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From d6c75f788e15fb552eacb08359698a1342a97f20 Mon Sep 17 00:00:00 2001 | 1 | From 2784921c40d0b523c75e613e48b7fd1e90ba3ef1 Mon Sep 17 00:00:00 2001 |
2 | From: Martin Jansa <Martin.Jansa@gmail.com> | 2 | From: Martin Jansa <Martin.Jansa@gmail.com> |
3 | Date: Mon, 15 Apr 2013 04:29:32 +0200 | 3 | Date: Mon, 15 Apr 2013 04:29:32 +0200 |
4 | Subject: [PATCH] Add linux-oe-g++ platform | 4 | Subject: [PATCH] Add linux-oe-g++ platform |
@@ -7,176 +7,53 @@ Subject: [PATCH] Add linux-oe-g++ platform | |||
7 | shell environment, because it's easier for qt recipes to export | 7 | shell environment, because it's easier for qt recipes to export |
8 | *FLAGS or CC specific for given recipe | 8 | *FLAGS or CC specific for given recipe |
9 | 9 | ||
10 | * configure: add getQEvalMakeConf and getXQEvalMakeConf | 10 | * configure: extend setBootstrapVariable to convert $$(...) operator |
11 | Allow expansion of $(...) references from qmake.conf to generate | 11 | to $(...) operator to work in qmake's Makefiles |
12 | qmake environment from shell environment as exported by qmake5_base | ||
13 | |||
14 | * configure: don't export SYSTEM_VARIABLES to .qmake.vars | ||
15 | linux-oe-g++ should handle this correctly and exporting LD as QMAKE_LINK is | ||
16 | causing issues as we need g++ to be used as linker | ||
17 | 12 | ||
18 | * configure.prf: Allow to add extra arguments to make | 13 | * configure.prf: Allow to add extra arguments to make |
19 | sometimes we would like to add -e or define some variable and respect it from both | 14 | sometimes we would like to add -e or define some variable and respect it from both |
20 | Makefiles used in configure tests and also Makefiles to build the application | 15 | Makefiles used in configure tests and also Makefiles to build the application |
21 | 16 | ||
22 | * OE_QMAKE_CXX in order to allow compiler version check to succeed | ||
23 | which allows WebKit to be enabled. | ||
24 | |||
25 | * Other variables in order to let config.tests to use our -platform | ||
26 | settings | ||
27 | |||
28 | * Add setBootstrapEvalVariable to bootstrap qmake with our environment | ||
29 | too, this allows us to use -platform linux-oe-g++ also for native | ||
30 | recipe | ||
31 | |||
32 | * disable gdb_dwarf_index | ||
33 | * qmake is trying to call native gdb and we don't depend on gdb-native | ||
34 | (or even provide gdb-native) | ||
35 | * fixes errors like this: | ||
36 | /bin/sh: gdb: command not found | ||
37 | /bin/sh: line 0: test: -gt: unary operator expected | ||
38 | which are not fatal, but still misleading in do_configure output | ||
39 | |||
40 | * add -target suffix to qmake built in qtbase configure, this way we can | ||
41 | use qmake from qtbase-native, but then include qmake built for target | ||
42 | in qtbase-tools package (smilarly for nativesdk-qtbase). | ||
43 | |||
44 | Upstream-Status: Inappropriate [embedded specific] | 17 | Upstream-Status: Inappropriate [embedded specific] |
45 | too OE specific, probably cannot be upstreamed | 18 | too OE specific, probably cannot be upstreamed |
46 | 19 | ||
47 | Change-Id: I0591ed5da0d61d7cf1509d420e6b293582f1863c | 20 | Change-Id: I0591ed5da0d61d7cf1509d420e6b293582f1863c |
48 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | 21 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> |
49 | --- | 22 | --- |
50 | configure | 55 ++++++++++++------- | 23 | configure | 2 +- |
51 | mkspecs/features/configure.prf | 4 +- | 24 | mkspecs/features/configure.prf | 4 ++-- |
52 | mkspecs/linux-oe-g++/qmake.conf | 42 +++++++++++++++ | 25 | mkspecs/features/qt_functions.prf | 2 +- |
53 | mkspecs/linux-oe-g++/qplatformdefs.h | 100 +++++++++++++++++++++++++++++++++++ | 26 | mkspecs/linux-oe-g++/qmake.conf | 43 ++++++++++++++++++++++++++++++++++++ |
54 | 4 files changed, 181 insertions(+), 20 deletions(-) | 27 | mkspecs/linux-oe-g++/qplatformdefs.h | 1 + |
28 | 5 files changed, 48 insertions(+), 4 deletions(-) | ||
55 | create mode 100644 mkspecs/linux-oe-g++/qmake.conf | 29 | create mode 100644 mkspecs/linux-oe-g++/qmake.conf |
56 | create mode 100644 mkspecs/linux-oe-g++/qplatformdefs.h | 30 | create mode 100644 mkspecs/linux-oe-g++/qplatformdefs.h |
57 | 31 | ||
58 | diff --git a/configure b/configure | 32 | diff --git a/configure b/configure |
59 | index 0ba0c31..052872e 100755 | 33 | index 789ba4c..59cce01 100755 |
60 | --- a/configure | 34 | --- a/configure |
61 | +++ b/configure | 35 | +++ b/configure |
62 | @@ -333,6 +333,16 @@ getQMakeConf() | 36 | @@ -1624,7 +1624,7 @@ fi |
63 | getSingleQMakeVariable "$1" "$specvals" | 37 | # is where the resulting variable is written to |
64 | } | 38 | setBootstrapVariable() |
65 | |||
66 | +# OE qmake.conf is reading some variables from shell env | ||
67 | +# read them from qmake.conf, replace qmake () syntax with shell and eval | ||
68 | +getQEvalMakeConf() | ||
69 | +{ | ||
70 | + VAL=`getQMakeConf "$1" | sed -n 's/$[(]\([0-9a-zA-Z_]*\)[)]/$\1/pg'` | ||
71 | + EVAL=`eval "echo ${VAL}"` | ||
72 | +# echo "Running getQEvalMakeConf: var='$1', val='`getQMakeConf \"$1\"`, val-sed='$VAL', eval='$EVAL'" >&2 | ||
73 | + eval "echo ${VAL}" | ||
74 | +} | ||
75 | + | ||
76 | getXQMakeConf() | ||
77 | { | 39 | { |
78 | if [ -z "$xspecvals" ]; then | 40 | - getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile" |
79 | @@ -357,6 +367,16 @@ testXConfig() | 41 | + getQMakeConf "$1" | sed 's:\$\$(:\$(:' | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile" |
80 | esac | ||
81 | } | ||
82 | |||
83 | +# OE qmake.conf is reading some variables from shell env | ||
84 | +# read them from qmake.conf, replace qmake () syntax with shell and eval | ||
85 | +getXQEvalMakeConf() | ||
86 | +{ | ||
87 | + VAL=`getXQMakeConf "$1" | sed -n 's/$[(]\([0-9a-zA-Z_]*\)[)]/$\1/pg'` | ||
88 | + EVAL=`eval "echo ${VAL}"` | ||
89 | +# echo "Running getXQEvalMakeConf: var='$1', val='`getXQMakeConf \"$1\"`, val-sed='$VAL', eval='$EVAL'" >&2 | ||
90 | + eval "echo ${VAL}" | ||
91 | +} | ||
92 | + | ||
93 | compilerSupportsFlag() | ||
94 | { | ||
95 | cat >conftest.cpp <<EOF | ||
96 | @@ -578,24 +598,14 @@ fi | ||
97 | # initalize variables | ||
98 | #------------------------------------------------------------------------------- | ||
99 | |||
100 | -SYSTEM_VARIABLES="AR RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS" | ||
101 | -for varname in $SYSTEM_VARIABLES; do | ||
102 | +# Export all OE variables for qmake.conf from shell env to QMakeVars | ||
103 | +OE_VARIABLES="AR CC CFLAGS COMPILER CXX CXXFLAGS LDFLAGS LINK QT_CONFIG STRIP" | ||
104 | +for varname in $OE_VARIABLES; do | ||
105 | qmakevarname="${varname}" | ||
106 | - qmakecmdargs="" | ||
107 | - # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS | ||
108 | - if [ "${varname}" = "LDFLAGS" ]; then | ||
109 | - qmakevarname="LFLAGS" | ||
110 | - elif [ "${varname}" = "LD" ]; then | ||
111 | - qmakevarname="LINK" | ||
112 | - elif [ "${varname}" = "AR" ]; then | ||
113 | - # QMAKE_AR needs to be set to "/path/to/ar cqs" but the | ||
114 | - # environment variable will be set to the command only so we | ||
115 | - # need to append " cqs" for autoconf compatibility | ||
116 | - qmakecmdargs=" cqs" | ||
117 | - fi | ||
118 | cmd=`echo \ | ||
119 | -'if [ -n "\$'${varname}'" ]; then | ||
120 | - QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}${qmakecmdargs}'" | ||
121 | +'if [ -n "\$OE_QMAKE_'${varname}'" ]; then | ||
122 | + QMakeVar set OE_QMAKE_'${qmakevarname}' "\$OE_QMAKE_'${varname}'" | ||
123 | +# echo "Exporting OE_QMAKE_'${qmakevarname}' value=\"\$OE_QMAKE_'${varname}'\"" >&2 | ||
124 | fi'` | ||
125 | eval "$cmd" | ||
126 | done | ||
127 | @@ -3443,7 +3453,7 @@ if [ "$XPLATFORM_MAC" = "yes" ]; then | ||
128 | [ "$CFG_GTK" = "auto" ] && CFG_GTK=no | ||
129 | fi | ||
130 | |||
131 | -QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX` | ||
132 | +QMAKE_CONF_COMPILER=`getXQEvalMakeConf QMAKE_CXX` | ||
133 | |||
134 | TEST_COMPILER=$QMAKE_CONF_COMPILER | ||
135 | |||
136 | @@ -3494,7 +3504,7 @@ if [ "$XPLATFORM_ANDROID" = "yes" ] ; then | ||
137 | fi | ||
138 | fi | ||
139 | |||
140 | -TEST_COMPILER_CXXFLAGS=`getXQMakeConf QMAKE_CXXFLAGS` | ||
141 | +TEST_COMPILER_CXXFLAGS=`getXQEvalMakeConf QMAKE_CXXFLAGS` | ||
142 | |||
143 | GCC_MACHINE_DUMP= | ||
144 | case "$TEST_COMPILER" in *g++) GCC_MACHINE_DUMP=$($TEST_COMPILER -dumpmachine);; esac | ||
145 | @@ -3893,6 +3903,14 @@ setBootstrapVariable() | ||
146 | getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile" | ||
147 | } | 42 | } |
148 | 43 | ||
149 | +# OE qmake.conf is reading some variables from shell env | ||
150 | +# read them from qmake.conf, replace qmake () syntax with shell and eval | ||
151 | +setBootstrapEvalVariable() | ||
152 | +{ | ||
153 | + getQEvalMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile" | ||
154 | +} | ||
155 | + | ||
156 | + | ||
157 | # build qmake | 44 | # build qmake |
158 | if true; then ###[ '!' -f "$outpath/bin/qmake" ]; | ||
159 | echo "Creating qmake..." | ||
160 | @@ -3986,6 +4004,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; | ||
161 | EXEEXT= | ||
162 | ;; | ||
163 | esac | ||
164 | + [ "$QT_CROSS_COMPILE" = "yes" ] && EXEEXT=-target | ||
165 | if [ "$BUILD_ON_MAC" = "yes" ]; then | ||
166 | echo "COCOA_LFLAGS =-framework Foundation -framework CoreServices" >>"$mkfile" | ||
167 | echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile" | ||
168 | diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf | 45 | diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf |
169 | index a890c7f..151630c 100644 | 46 | index f275e3a..5aa15f5 100644 |
170 | --- a/mkspecs/features/configure.prf | 47 | --- a/mkspecs/features/configure.prf |
171 | +++ b/mkspecs/features/configure.prf | 48 | +++ b/mkspecs/features/configure.prf |
172 | @@ -71,14 +71,14 @@ defineTest(qtCompileTest) { | 49 | @@ -37,14 +37,14 @@ defineTest(qtCompileTest) { |
173 | } | 50 | } |
174 | 51 | ||
175 | # Clean up after previous run | 52 | # Clean up after previous run |
176 | - exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean") | 53 | - exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean") |
177 | + exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS) distclean") | 54 | + exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE $$(QMAKE_MAKE_ARGS) distclean") |
178 | 55 | ||
179 | mkpath($$test_out_dir)|error("Aborting.") | 56 | mkpath($$test_out_dir)|error() |
180 | 57 | ||
181 | !isEmpty (QMAKE_QTCONF): qtconfarg = -qtconf $$QMAKE_QTCONF | 58 | !isEmpty (QMAKE_QTCONF): qtconfarg = -qtconf $$QMAKE_QTCONF |
182 | 59 | ||
@@ -186,157 +63,72 @@ index a890c7f..151630c 100644 | |||
186 | log("yes$$escape_expand(\\n)") | 63 | log("yes$$escape_expand(\\n)") |
187 | msg = "test $$1 succeeded" | 64 | msg = "test $$1 succeeded" |
188 | write_file($$QMAKE_CONFIG_LOG, msg, append) | 65 | write_file($$QMAKE_CONFIG_LOG, msg, append) |
66 | diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf | ||
67 | index 708815d..097ac49 100644 | ||
68 | --- a/mkspecs/features/qt_functions.prf | ||
69 | +++ b/mkspecs/features/qt_functions.prf | ||
70 | @@ -67,7 +67,7 @@ defineTest(qtHaveModule) { | ||
71 | defineTest(qtPrepareTool) { | ||
72 | cmd = $$eval(QT_TOOL.$${2}.binary) | ||
73 | isEmpty(cmd) { | ||
74 | - cmd = $$[QT_HOST_BINS]/$$2 | ||
75 | + cmd = $$[QT_HOST_BINS/get]/$$2 | ||
76 | exists($${cmd}.pl) { | ||
77 | $${1}_EXE = $${cmd}.pl | ||
78 | cmd = perl -w $$system_path($${cmd}.pl) | ||
189 | diff --git a/mkspecs/linux-oe-g++/qmake.conf b/mkspecs/linux-oe-g++/qmake.conf | 79 | diff --git a/mkspecs/linux-oe-g++/qmake.conf b/mkspecs/linux-oe-g++/qmake.conf |
190 | new file mode 100644 | 80 | new file mode 100644 |
191 | index 0000000..311ba04 | 81 | index 0000000..c1837e6 |
192 | --- /dev/null | 82 | --- /dev/null |
193 | +++ b/mkspecs/linux-oe-g++/qmake.conf | 83 | +++ b/mkspecs/linux-oe-g++/qmake.conf |
194 | @@ -0,0 +1,42 @@ | 84 | @@ -0,0 +1,43 @@ |
195 | +# | 85 | +# |
196 | +# qmake configuration for linux-g++ with modifications for building with OpenEmbedded | 86 | +# qmake configuration for linux-g++ with modifications for building with OpenEmbedded |
197 | +# | 87 | +# |
198 | + | 88 | + |
199 | +MAKEFILE_GENERATOR = UNIX | 89 | +MAKEFILE_GENERATOR = UNIX |
200 | +CONFIG += incremental | 90 | +CONFIG += incremental |
201 | +QMAKE_INCREMENTAL_STYLE = sublib | 91 | +QMAKE_INCREMENTAL_STYLE = sublib |
202 | + | 92 | + |
203 | +include(../common/linux.conf) | 93 | +include(../common/linux.conf) |
204 | + | 94 | + |
205 | +# QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar and strip | 95 | +# QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar and strip |
206 | +QMAKE_AR = $(OE_QMAKE_AR) cqs | 96 | +QMAKE_AR = $$(OE_QMAKE_AR) cqs |
207 | +QMAKE_STRIP = $(OE_QMAKE_STRIP) | 97 | +QMAKE_STRIP = $$(OE_QMAKE_STRIP) |
208 | +QMAKE_WAYLAND_SCANNER = $(OE_QMAKE_WAYLAND_SCANNER) | 98 | +QMAKE_WAYLAND_SCANNER = $$(OE_QMAKE_WAYLAND_SCANNER) |
209 | + | 99 | + |
210 | +include(../common/gcc-base-unix.conf) | 100 | +include(../common/gcc-base-unix.conf) |
211 | + | 101 | + |
212 | +# *FLAGS from gcc-base.conf | 102 | +# *FLAGS from gcc-base.conf |
213 | +QMAKE_CFLAGS += $(OE_QMAKE_CFLAGS) | 103 | +QMAKE_CFLAGS += $$(OE_QMAKE_CFLAGS) |
214 | +QMAKE_CXXFLAGS += $(OE_QMAKE_CXXFLAGS) | 104 | +QMAKE_CXXFLAGS += $$(OE_QMAKE_CXXFLAGS) |
215 | +QMAKE_LFLAGS += $(OE_QMAKE_LDFLAGS) | 105 | +QMAKE_LFLAGS += $$(OE_QMAKE_LDFLAGS) |
216 | + | 106 | + |
217 | +include(../common/g++-unix.conf) | 107 | +include(../common/g++-unix.conf) |
218 | + | 108 | + |
219 | +# tc settings from g++-base.conf | 109 | +# tc settings from g++-base.conf |
220 | +QMAKE_COMPILER = $(OE_QMAKE_COMPILER) gcc | 110 | +QMAKE_COMPILER = $$(OE_QMAKE_COMPILER) gcc |
221 | +QMAKE_CC = $(OE_QMAKE_CC) | 111 | +QMAKE_CC = $$(OE_QMAKE_CC) |
222 | +QMAKE_CXX = $(OE_QMAKE_CXX) | 112 | +QMAKE_CXX = $$(OE_QMAKE_CXX) |
223 | + | 113 | + |
224 | +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $(OE_QMAKE_CFLAGS) | 114 | +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$(OE_QMAKE_CFLAGS) |
225 | + | 115 | + |
226 | +QMAKE_LINK = $(OE_QMAKE_LINK) | 116 | +QMAKE_LINK = $$(OE_QMAKE_LINK) |
227 | +QMAKE_LINK_SHLIB = $(OE_QMAKE_LINK) | 117 | +QMAKE_LINK_SHLIB = $$(OE_QMAKE_LINK) |
228 | +QMAKE_LINK_C = $(OE_QMAKE_LINK) | 118 | +QMAKE_LINK_C = $$(OE_QMAKE_LINK) |
229 | +QMAKE_LINK_C_SHLIB = $(OE_QMAKE_LINK) | 119 | +QMAKE_LINK_C_SHLIB = $$(OE_QMAKE_LINK) |
230 | + | 120 | + |
231 | +# for the SDK | 121 | +# for the SDK |
232 | +isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $(OE_QMAKE_QT_CONFIG) | 122 | +isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$(OE_QMAKE_QT_CONFIG) |
233 | + | 123 | + |
234 | +include(../oe-device-extra.pri) | 124 | +include(../oe-device-extra.pri) |
235 | + | 125 | + |
126 | +load(device_config) | ||
236 | +load(qt_config) | 127 | +load(qt_config) |
237 | diff --git a/mkspecs/linux-oe-g++/qplatformdefs.h b/mkspecs/linux-oe-g++/qplatformdefs.h | 128 | diff --git a/mkspecs/linux-oe-g++/qplatformdefs.h b/mkspecs/linux-oe-g++/qplatformdefs.h |
238 | new file mode 100644 | 129 | new file mode 100644 |
239 | index 0000000..dd12003 | 130 | index 0000000..5d22fb4 |
240 | --- /dev/null | 131 | --- /dev/null |
241 | +++ b/mkspecs/linux-oe-g++/qplatformdefs.h | 132 | +++ b/mkspecs/linux-oe-g++/qplatformdefs.h |
242 | @@ -0,0 +1,100 @@ | 133 | @@ -0,0 +1 @@ |
243 | +/**************************************************************************** | 134 | +#include "../linux-g++/qplatformdefs.h" |
244 | +** | ||
245 | +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). | ||
246 | +** Contact: http://www.qt-project.org/legal | ||
247 | +** | ||
248 | +** This file is part of the qmake spec of the Qt Toolkit. | ||
249 | +** | ||
250 | +** $QT_BEGIN_LICENSE:LGPL$ | ||
251 | +** Commercial License Usage | ||
252 | +** Licensees holding valid commercial Qt licenses may use this file in | ||
253 | +** accordance with the commercial license agreement provided with the | ||
254 | +** Software or, alternatively, in accordance with the terms contained in | ||
255 | +** a written agreement between you and Digia. For licensing terms and | ||
256 | +** conditions see http://qt.digia.com/licensing. For further information | ||
257 | +** use the contact form at http://qt.digia.com/contact-us. | ||
258 | +** | ||
259 | +** GNU Lesser General Public License Usage | ||
260 | +** Alternatively, this file may be used under the terms of the GNU Lesser | ||
261 | +** General Public License version 2.1 as published by the Free Software | ||
262 | +** Foundation and appearing in the file LICENSE.LGPL included in the | ||
263 | +** packaging of this file. Please review the following information to | ||
264 | +** ensure the GNU Lesser General Public License version 2.1 requirements | ||
265 | +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
266 | +** | ||
267 | +** In addition, as a special exception, Digia gives you certain additional | ||
268 | +** rights. These rights are described in the Digia Qt LGPL Exception | ||
269 | +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
270 | +** | ||
271 | +** GNU General Public License Usage | ||
272 | +** Alternatively, this file may be used under the terms of the GNU | ||
273 | +** General Public License version 3.0 as published by the Free Software | ||
274 | +** Foundation and appearing in the file LICENSE.GPL included in the | ||
275 | +** packaging of this file. Please review the following information to | ||
276 | +** ensure the GNU General Public License version 3.0 requirements will be | ||
277 | +** met: http://www.gnu.org/copyleft/gpl.html. | ||
278 | +** | ||
279 | +** | ||
280 | +** $QT_END_LICENSE$ | ||
281 | +** | ||
282 | +****************************************************************************/ | ||
283 | + | ||
284 | +#ifndef QPLATFORMDEFS_H | ||
285 | +#define QPLATFORMDEFS_H | ||
286 | + | ||
287 | +// Get Qt defines/settings | ||
288 | + | ||
289 | +#include "qglobal.h" | ||
290 | + | ||
291 | +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs | ||
292 | + | ||
293 | +// 1) need to reset default environment if _BSD_SOURCE is defined | ||
294 | +// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 | ||
295 | +// 3) it seems older glibc need this to include the X/Open stuff | ||
296 | +#ifndef _GNU_SOURCE | ||
297 | +# define _GNU_SOURCE | ||
298 | +#endif | ||
299 | + | ||
300 | +#include <unistd.h> | ||
301 | + | ||
302 | + | ||
303 | +// We are hot - unistd.h should have turned on the specific APIs we requested | ||
304 | + | ||
305 | +#include <features.h> | ||
306 | +#include <pthread.h> | ||
307 | +#include <dirent.h> | ||
308 | +#include <fcntl.h> | ||
309 | +#include <grp.h> | ||
310 | +#include <pwd.h> | ||
311 | +#include <signal.h> | ||
312 | + | ||
313 | +#include <sys/types.h> | ||
314 | +#include <sys/ioctl.h> | ||
315 | +#include <sys/ipc.h> | ||
316 | +#include <sys/time.h> | ||
317 | +#include <sys/shm.h> | ||
318 | +#include <sys/socket.h> | ||
319 | +#include <sys/stat.h> | ||
320 | +#include <sys/wait.h> | ||
321 | +#include <netinet/in.h> | ||
322 | +#ifndef QT_NO_IPV6IFNAME | ||
323 | +#include <net/if.h> | ||
324 | +#endif | ||
325 | + | ||
326 | +#define QT_USE_XOPEN_LFS_EXTENSIONS | ||
327 | +#include "../common/posix/qplatformdefs.h" | ||
328 | + | ||
329 | +#undef QT_SOCKLEN_T | ||
330 | + | ||
331 | +#if defined(__GLIBC__) && (__GLIBC__ >= 2) | ||
332 | +#define QT_SOCKLEN_T socklen_t | ||
333 | +#else | ||
334 | +#define QT_SOCKLEN_T int | ||
335 | +#endif | ||
336 | + | ||
337 | +#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) | ||
338 | +#define QT_SNPRINTF ::snprintf | ||
339 | +#define QT_VSNPRINTF ::vsnprintf | ||
340 | +#endif | ||
341 | + | ||
342 | +#endif // QPLATFORMDEFS_H | ||