~oif-team/ubuntu/natty/qt4-x11/xi2.1

1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
1
#!/bin/sh
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
2
#############################################################################
3
##
1.1.29 by Alessandro Ghersi
Import upstream version 4.6.2
4
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
5
## All rights reserved.
6
## Contact: Nokia Corporation (qt-info@nokia.com)
7
##
8
## This file is the build configuration utility of the Qt Toolkit.
9
##
10
## $QT_BEGIN_LICENSE:LGPL$
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
11
## No Commercial Usage
12
## This file contains pre-release code and may not be distributed.
13
## You may use this file in accordance with the terms and conditions
14
## contained in the Technology Preview License Agreement accompanying
15
## this package.
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
16
##
17
## GNU Lesser General Public License Usage
18
## Alternatively, this file may be used under the terms of the GNU Lesser
19
## General Public License version 2.1 as published by the Free Software
20
## Foundation and appearing in the file LICENSE.LGPL included in the
21
## packaging of this file.  Please review the following information to
22
## ensure the GNU Lesser General Public License version 2.1 requirements
23
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
##
25
## In addition, as a special exception, Nokia gives you certain additional
26
## rights.  These rights are described in the Nokia Qt LGPL Exception
27
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
##
29
## If you have questions regarding the use of this file, please contact
30
## Nokia at qt-info@nokia.com.
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
31
##
32
##
33
##
34
##
35
##
36
##
37
##
38
##
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
39
## $QT_END_LICENSE$
40
##
41
#############################################################################
1 by Adam Conrad
Import upstream version 4.0.0
42
43
#-------------------------------------------------------------------------------
44
# script initialization
45
#-------------------------------------------------------------------------------
46
47
# the name of this script
48
relconf=`basename $0`
49
# the directory of this script is the "source tree"
50
relpath=`dirname $0`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
51
relpath=`(cd "$relpath"; /bin/pwd)`
1 by Adam Conrad
Import upstream version 4.0.0
52
# the current directory is the "build tree" or "object tree"
53
outpath=`/bin/pwd`
54
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
55
#license file location
56
LICENSE_FILE="$QT_LICENSE_FILE"
57
[ -z "$LICENSE_FILE" ] && LICENSE_FILE="$HOME/.qt-license"
58
if [ -f "$LICENSE_FILE" ]; then
59
    tr -d '\r' <"$LICENSE_FILE" >"${LICENSE_FILE}.tmp"
60
    diff "${LICENSE_FILE}.tmp" "${LICENSE_FILE}" >/dev/null 2>&1 || LICENSE_FILE="${LICENSE_FILE}.tmp"
61
fi
62
1 by Adam Conrad
Import upstream version 4.0.0
63
# later cache the command line in config.status
64
OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"`
65
66
# initialize global variables
67
QMAKE_SWITCHES=
68
QMAKE_VARS=
69
QMAKE_CONFIG=
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
70
QTCONFIG_CONFIG=
1 by Adam Conrad
Import upstream version 4.0.0
71
QT_CONFIG=
72
SUPPORTED=
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
73
QMAKE_VARS_FILE=.qmake.vars
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
74
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
75
:> "$QMAKE_VARS_FILE"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
76
77
#-------------------------------------------------------------------------------
78
# utility functions
79
#-------------------------------------------------------------------------------
80
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
81
shellEscape()
82
{
83
    echo "$@" | sed 's/ /\ /g'
84
}
85
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
86
# Adds a new qmake variable to the cache
87
# Usage: QMakeVar mode varname contents
88
#   where mode is one of: set, add, del
89
QMakeVar()
90
{
91
    case "$1" in
92
	set)
93
	    eq="="
94
	    ;;
95
	add)
96
	    eq="+="
97
	    ;;
98
	del)
99
	    eq="-="
100
	    ;;
101
	*)
102
	    echo >&2 "BUG: wrong command to QMakeVar: $1"
103
	    ;;
104
    esac
105
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
106
    echo "$2" "$eq" "$3" >> "$QMAKE_VARS_FILE"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
107
}
108
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
109
# Helper function for getQMakeConf. It parses include statements in
110
# qmake.conf and prints out the expanded file
111
getQMakeConf1()
112
{
113
    while read line; do case "$line" in
114
        include*)
115
	    inc_file=`echo "$line" | sed -n -e "/^include.*(.*)/s/include.*(\(.*\)).*$/\1/p"`
116
	    current_dir=`dirname "$1"`
117
	    conf_file="$current_dir/$inc_file"
1.1.29 by Alessandro Ghersi
Import upstream version 4.6.2
118
	    if [ ! -f  "$conf_file" ]; then
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
119
                echo "WARNING: Unable to find file $conf_file" >&2
120
                continue
121
            fi
122
            getQMakeConf1 "$conf_file"
123
        ;;
124
        *)
125
            echo "$line"
126
        ;;
127
    esac; done < "$1"
128
}
129
130
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
131
# relies on $QMAKESPEC being set correctly. parses include statements in
132
# qmake.conf and prints out the expanded file
133
getQMakeConf()
134
{
135
    tmpSPEC="$QMAKESPEC"
136
    if [ -n "$1" ]; then
137
        tmpSPEC="$1"
138
    fi
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
139
    getQMakeConf1 "$tmpSPEC/qmake.conf"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
140
}
141
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
142
# relies on $TEST_COMPILER being set correctly
143
compilerSupportsFlag()
144
{
145
    cat >conftest.cpp <<EOF
146
int main() { return 0; }
147
EOF
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
148
    "$TEST_COMPILER" "$@" -o conftest.o conftest.cpp
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
149
    ret=$?
150
    rm -f conftest.cpp conftest.o
151
    return $ret
152
}
153
154
# relies on $TEST_COMPILER being set correctly
155
linkerSupportsFlag()
156
{
157
    lflags=-Wl
158
    for flag
159
    do
160
	safe_flag=`shellEscape "$flag"`
161
	lflags=$lflags,$safe_flag
162
    done
163
    compilerSupportsFlag "$lflags" >/dev/null 2>&1
164
}
165
1 by Adam Conrad
Import upstream version 4.0.0
166
#-------------------------------------------------------------------------------
167
# operating system detection
168
#-------------------------------------------------------------------------------
169
170
# need that throughout the script
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
171
# This is a ugly hack that shouldn't be extended any more. New archs
172
# should just use the default *) UNAME_MACHINE="$DPKG_ARCH" The current mappings
173
# is for backwards compatibility with existing archs already released.
174
DPKG_ARCH=`(dpkg-architecture -qDEB_HOST_ARCH) 2>/dev/null` || UNAME_MACHINE=unknown
175
case $DPKG_ARCH in 
176
	amd64)
177
		UNAME_MACHINE="x86_64"
178
	;;
179
	arm)
180
		UNAME_MACHINE="armv4l"
181
	;;
182
	armel)
183
		UNAME_MACHINE="armv5tel"
184
	;;
185
	hppa)
186
		UNAME_MACHINE="parisc64"
187
	;;
188
	hurd-i386)
189
		UNAME_MACHINE="i686-AT386"
190
	;;
191
	i386)
192
		UNAME_MACHINE="i686"
193
	;;
194
	kfreebsd-amd64)
195
		UNAME_MACHINE="x86_64"
196
	;;
197
	kfreebsd-i386)
198
		UNAME_MACHINE="i586"
199
	;;
200
	lpia)
201
		UNAME_MACHINE="i686"
202
	;;
203
	mipsel)
204
		UNAME_MACHINE="mips"
205
	;;
206
	powerpc)
207
		UNAME_MACHINE="ppc"
208
	;;
209
	*)
210
		UNAME_MACHINE="$DPKG_ARCH"
211
	;;
212
213
214
esac
1 by Adam Conrad
Import upstream version 4.0.0
215
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
216
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
217
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
218
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
219
# detect the "echo without newline" style. usage: echo $ECHO_N "<string>$ECHO_C"
220
if echo '\c' | grep '\c' >/dev/null; then
221
    ECHO_N=-n
222
else
223
    ECHO_C='\c'
224
fi
1 by Adam Conrad
Import upstream version 4.0.0
225
226
#-------------------------------------------------------------------------------
227
# window system detection
228
#-------------------------------------------------------------------------------
229
230
PLATFORM_X11=no
231
PLATFORM_MAC=no
232
PLATFORM_QWS=no
233
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
234
if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ] && [ -d /System/Library/Frameworks/Carbon.framework ]; then
1 by Adam Conrad
Import upstream version 4.0.0
235
    # Qt/Mac
236
    # ~ the Carbon SDK exists
237
    # ~ src/gui/base/qapplication_mac.cpp is present
238
    # ~ this is the internal edition and Qt/Mac sources exist
239
    PLATFORM_MAC=maybe
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
240
elif [ -f "$relpath"/src/gui/kernel/qapplication_qws.cpp ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
241
    # Qt Embedded
1 by Adam Conrad
Import upstream version 4.0.0
242
    # ~ src/gui/base/qapplication_qws.cpp is present
243
    # ~ this is the free or commercial edition
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
244
    # ~ this is the internal edition and Qt Embedded is explicitly enabled
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
245
    if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ]; then
246
        # This is a depot build, or an all-platforms package
247
        PLATFORM_QWS=maybe
248
    else
249
        # This must be the embedded package, since the Qt/Mac source files are not present
250
	PLATFORM_QWS=yes
251
    fi
1 by Adam Conrad
Import upstream version 4.0.0
252
fi
253
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
254
#-----------------------------------------------------------------------------
255
# Qt version detection
256
#-----------------------------------------------------------------------------
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
257
QT_VERSION=`grep '^# *define *QT_VERSION_STR' "$relpath"/src/corelib/global/qglobal.h`
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
258
QT_MAJOR_VERSION=
259
QT_MINOR_VERSION=0
260
QT_PATCH_VERSION=0
261
if [ -n "$QT_VERSION" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
262
   QT_VERSION=`echo $QT_VERSION | sed 's,^# *define *QT_VERSION_STR *"*\([^ ]*\)"$,\1,'`
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
263
   MAJOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
264
   if [ -n "$MAJOR" ]; then
265
     MINOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
266
      PATCH=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
267
      QT_MAJOR_VERSION="$MAJOR"
268
      [ -z "$MINOR" ] || QT_MINOR_VERSION="$MINOR"
269
      [ -z "$PATCH" ] || QT_PATCH_VERSION="$PATCH"
270
   fi
271
fi
272
if [ -z "$QT_MAJOR_VERSION" ]; then
273
   echo "Cannot process version from qglobal.h: $QT_VERSION"
274
   echo "Cannot proceed."
275
   exit 1
276
fi
277
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
278
QT_PACKAGEDATE=`grep '^# *define *QT_PACKAGEDATE_STR' "$relpath"/src/corelib/global/qglobal.h | sed -e 's,^# *define *QT_PACKAGEDATE_STR *"\([^ ]*\)"$,\1,' -e s,-,,g`
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
279
if [ -z "$QT_PACKAGEDATE" ]; then
280
   echo "Unable to determine package date from qglobal.h: '$QT_PACKAGEDATE'"
281
   echo "Cannot proceed"
282
   exit 1
283
fi
284
1 by Adam Conrad
Import upstream version 4.0.0
285
#-------------------------------------------------------------------------------
1.1.1 by Matthias Klose
Import upstream version 4.0.1
286
# check the license
287
#-------------------------------------------------------------------------------
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
288
COMMERCIAL_USER=ask
289
CFG_DEV=no
290
CFG_NOKIA=no
291
CFG_EMBEDDED=no
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
292
CFG_RTOS_ENABLED=yes
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
293
EditionString=Commercial
294
295
earlyArgParse()
296
{
297
    # parse the arguments, setting things to "yes" or "no"
298
    while [ "$#" -gt 0 ]; do
299
        CURRENT_OPT="$1"
300
        UNKNOWN_ARG=no
301
        case "$1" in
302
        #Autoconf style options
303
        --enable-*)
304
            VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
305
            VAL=yes
306
            ;;
307
        --disable-*)
308
            VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
309
            VAL=no
310
            ;;
311
        --*=*)
312
            VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
313
            VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
314
            ;;
315
        --no-*)
316
            VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
317
            VAL=no
318
            ;;
319
        -embedded)
320
            VAR=embedded
321
            # this option may or may not be followed by an argument
322
            if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
323
                VAL=auto
324
            else
325
                shift;
326
                VAL=$1
327
            fi
328
            ;;
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
329
        -h|help|--help|-help)
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
330
            if [ "$VAL" = "yes" ]; then
331
                OPT_HELP="$VAL"
332
                COMMERCIAL_USER="no" #doesn't matter we will display the help
333
            else
334
                UNKNOWN_OPT=yes
335
                COMMERCIAL_USER="no" #doesn't matter we will display the help
336
            fi
337
            ;;
338
        --*)
339
            VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
340
            VAL=yes
341
            ;;
342
        -*)
343
            VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
344
            VAL="unknown"
345
            ;;
346
        *)
347
            UNKNOWN_ARG=yes
348
            ;;
349
        esac
350
        if [ "$UNKNOWN_ARG" = "yes" ]; then
351
            shift
352
            continue
353
        fi
354
        shift
355
356
        UNKNOWN_OPT=no
357
        case "$VAR" in
358
        embedded)
359
            CFG_EMBEDDED="$VAL"
360
            if [ "$PLATFORM_QWS" != "no" ]; then
361
                if [ "$PLATFORM_QWS" = "maybe" ]; then
362
                    PLATFORM_X11=no
363
                    PLATFORM_MAC=no
364
                    PLATFORM_QWS=yes
365
                fi
366
            else
367
                echo "No license exists to enable Qt for Embedded Linux. Disabling."
368
                CFG_EMBEDDED=no
369
            fi
370
            ;;
371
        developer-build)
372
            CFG_DEV="yes"
373
            ;;
374
        nokia-developer)
375
            CFG_DEV="yes"
376
            CFG_NOKIA="yes"
377
            COMMERCIAL_USER="no"
378
            ;;
379
        commercial)
380
            COMMERCIAL_USER="yes"
381
            ;;
382
        opensource)
383
            COMMERCIAL_USER="no"
384
            ;;
385
        *)
386
            UNKNOWN_OPT=yes
387
            ;;
388
        esac
389
    done
390
}
391
392
earlyArgParse "$@"
393
394
if [ "$COMMERCIAL_USER" = "ask" ]; then
395
    while true; do
396
        echo "Which edition of Qt do you want to use ?"
397
        echo
398
        echo "Type 'c' if you want to use the Commercial Edition."
399
        echo "Type 'o' if you want to use the Open Source Edition."
400
        echo
401
        read commercial
402
        echo
403
        if [ "$commercial" = "c" ]; then
404
            COMMERCIAL_USER="yes"
405
            break
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
406
        elif [ "$commercial" = "o" ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
407
            COMMERCIAL_USER="no"
408
            break
409
        fi
410
    done
411
fi
412
413
if [ "$CFG_NOKIA" = "yes" ]; then
414
    Licensee="Nokia"
415
    Edition="NokiaInternalBuild"
416
    EditionString="Nokia Internal Build"
417
    QT_EDITION="QT_EDITION_OPENSOURCE"
418
    [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
419
elif [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
420
    # Commercial preview release
421
    [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
422
    Licensee="Preview"
423
    Edition="Preview"
424
    QT_EDITION="QT_EDITION_DESKTOP"
425
    LicenseType="Technology Preview"
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
426
elif [ $COMMERCIAL_USER = "yes" ]; then
1.1.1 by Matthias Klose
Import upstream version 4.0.1
427
    # one of commercial editions
1 by Adam Conrad
Import upstream version 4.0.0
428
    [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
429
    [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=no
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
430
1.1.1 by Matthias Klose
Import upstream version 4.0.1
431
    # read in the license file
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
432
    if [ -f "$LICENSE_FILE" ]; then
433
        . "$LICENSE_FILE" >/dev/null 2>&1
1 by Adam Conrad
Import upstream version 4.0.0
434
        if [ -z "$LicenseKeyExt" ]; then
435
            echo
436
            echo "You are using an old license file."
437
            echo
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
438
            echo "Please install the license file supplied by Nokia,"
1 by Adam Conrad
Import upstream version 4.0.0
439
            echo "or install the Qt Open Source Edition if you intend to"
440
            echo "develop free software."
441
            exit 1
442
        fi
443
	if [ -z "$Licensee" ]; then
444
	    echo
445
	    echo "Invalid license key. Please check the license key."
446
	    exit 1
447
	fi
448
    else
449
        if [ -z "$LicenseKeyExt" ]; then
450
            echo
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
451
            echo $ECHO_N "Please enter your license key: $ECHO_C"
1 by Adam Conrad
Import upstream version 4.0.0
452
            read LicenseKeyExt
1.1.1 by Matthias Klose
Import upstream version 4.0.1
453
            Licensee="Unknown user"
1 by Adam Conrad
Import upstream version 4.0.0
454
        fi
455
    fi
1.1.1 by Matthias Klose
Import upstream version 4.0.1
456
457
    # Key verification
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
458
    echo "$LicenseKeyExt" | grep ".....*-....*-....*-....*-.....*-.....*-...." >/dev/null 2>&1 \
1.1.1 by Matthias Klose
Import upstream version 4.0.1
459
        && LicenseValid="yes" \
460
        || LicenseValid="no"
461
    if [ "$LicenseValid" != "yes" ]; then
462
        echo
463
        echo "Invalid license key. Please check the license key."
464
        exit 1
465
    fi
466
    ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1`
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
467
    PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d -`
1.1.1 by Matthias Klose
Import upstream version 4.0.1
468
    LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -`
469
    LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1`
470
471
    # determine which edition we are licensed to use
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
472
    case "$LicenseTypeCode" in
1.1.1 by Matthias Klose
Import upstream version 4.0.1
473
    F4M)
474
        LicenseType="Commercial"
475
        case $ProductCode in
476
        F)
477
            Edition="Universal"
478
            QT_EDITION="QT_EDITION_UNIVERSAL"
479
            ;;
480
        B)
1.1.18 by Roderick B. Greening
Import upstream version 4.4.3
481
            Edition="FullFramework"
482
            EditionString="Full Framework"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
483
            QT_EDITION="QT_EDITION_DESKTOP"
484
            ;;
485
        L)
1.1.18 by Roderick B. Greening
Import upstream version 4.4.3
486
            Edition="GUIFramework"
487
            EditionString="GUI Framework"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
488
            QT_EDITION="QT_EDITION_DESKTOPLIGHT"
489
            ;;
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
490
        esac
1.1.1 by Matthias Klose
Import upstream version 4.0.1
491
        ;;
492
    Z4M|R4M|Q4M)
493
        LicenseType="Evaluation"
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
494
        QMakeVar add DEFINES QT_EVAL
1.1.1 by Matthias Klose
Import upstream version 4.0.1
495
        case $ProductCode in
496
         B)
497
            Edition="Evaluation"
498
            QT_EDITION="QT_EDITION_EVALUATION"
499
            ;;
500
        esac
501
        ;;
502
    esac
503
    if [ -z "$LicenseType" -o -z "$Edition" -o -z "$QT_EDITION" ]; then
504
        echo
505
        echo "Invalid license key. Please check the license key."
506
        exit 1
507
    fi
508
509
    # verify that we are licensed to use Qt on this platform
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
510
    LICENSE_EXTENSION=
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
511
    case "$PlatformCode" in
512
	*L)
513
	    CFG_RTOS_ENABLED=yes
514
	    PlatformCode=`echo "$PlatformCode" | sed 'h;y/8NPQRTZ/UCWX9M7/;x;G;s/\(.\)....\(.\)./\1\2/'`
515
	    ;;
516
	*)
517
	    CFG_RTOS_ENABLED=no
518
	    PlatformCode=`echo "$PlatformCode" | sed 's/.$//'`
519
	    ;;
520
    esac
521
    case "$PlatformCode,$PLATFORM_MAC,$PLATFORM_QWS" in
522
        X9,* | XC,* | XU,* | XW,* | XM,*)
523
            # Qt All-OS
524
            LICENSE_EXTENSION="-ALLOS"
525
            ;;
526
        8M,* | KM,* | S9,* | SC,* | SU,* | SW,* | X9,* | XC,* | XU,* | XW,*)
1.1.18 by Roderick B. Greening
Import upstream version 4.4.3
527
            # Qt for Embedded Linux
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
528
            LICENSE_EXTENSION="-EMBEDDED"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
529
            ;;
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
530
        6M,*,no | N7,*,no | N9,*,no | NX,*,no)
531
            # Embedded no-deploy
532
            LICENSE_EXTENSION="-EMBEDDED"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
533
            ;;
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
534
        FM,*,no | LM,yes,* | ZM,no,no)
535
            # Desktop
1.1.18 by Roderick B. Greening
Import upstream version 4.4.3
536
            LICENSE_EXTENSION="-DESKTOP"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
537
            ;;
538
        *)
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
539
            Platform=Linux/X11
540
            [ "$PLATFORM_MAC" = "yes" ] && Platform='Mac OS X'
541
            [ "$PLATFORM_QWS" = "yes" ] && Platform='Embedded Linux'
542
            echo
543
            echo "You are not licensed for the $Platform platform."
544
            echo
545
            echo "Please contact qt-info@nokia.com to upgrade your license to"
546
            echo "include the $Platform platform, or install the Qt Open Source Edition"
547
            echo "if you intend to develop free software."
1.1.1 by Matthias Klose
Import upstream version 4.0.1
548
            exit 1
549
            ;;
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
550
    esac
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
551
552
    if test -r "$relpath/.LICENSE"; then
553
	# Generic, non-final license
554
	LICENSE_EXTENSION=""
555
	line=`sed 'y/a-z/A-Z/;q' "$relpath"/.LICENSE`
556
	case "$line" in
557
	    *BETA*)
558
		Edition=Beta
559
		;;
560
	    *TECHNOLOGY?PREVIEW*)
561
		Edition=Preview
562
		;;
563
	    *EVALUATION*)
564
		Edition=Evaluation
565
		;;
566
	    *)
567
		echo >&2 "Invalid license files; cannot continue"
568
		exit 1
569
		;;
570
	esac
571
	Licensee="$Edition"
572
	EditionString="$Edition"
573
	QT_EDITION="QT_EDITION_DESKTOP"
574
    fi
575
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
576
    case "$LicenseFeatureCode" in
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
577
    B|G|L|Y)
1.1.1 by Matthias Klose
Import upstream version 4.0.1
578
        # US
579
        case "$LicenseType" in
580
        Commercial)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
581
            cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-US" "$outpath/LICENSE"
1 by Adam Conrad
Import upstream version 4.0.0
582
            ;;
1.1.1 by Matthias Klose
Import upstream version 4.0.1
583
        Evaluation)
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
584
            cp -f "$relpath/.LICENSE-EVALUATION-US" "$outpath/LICENSE"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
585
            ;;
586
        esac
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
587
        ;;
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
588
    2|4|5|F)
1.1.1 by Matthias Klose
Import upstream version 4.0.1
589
        # non-US
590
        case "$LicenseType" in
591
        Commercial)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
592
            cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}" "$outpath/LICENSE"
1 by Adam Conrad
Import upstream version 4.0.0
593
            ;;
1.1.1 by Matthias Klose
Import upstream version 4.0.1
594
        Evaluation)
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
595
            cp -f "$relpath/.LICENSE-EVALUATION" "$outpath/LICENSE"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
596
            ;;
1 by Adam Conrad
Import upstream version 4.0.0
597
        esac
1.1.1 by Matthias Klose
Import upstream version 4.0.1
598
        ;;
599
    *)
1 by Adam Conrad
Import upstream version 4.0.0
600
        echo
601
        echo "Invalid license key. Please check the license key."
602
        exit 1
1.1.1 by Matthias Klose
Import upstream version 4.0.1
603
        ;;
604
    esac
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
605
    case "$LicenseFeatureCode" in
606
	4|B|F|Y)
607
	    CFG_RTOS_ENABLED=yes
608
	    ;;
609
	2|5|G|L)
610
	    CFG_RTOS_ENABLED=no
611
	    ;;
612
    esac
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
613
    if [ '!' -f "$outpath/LICENSE" ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
614
        echo "The LICENSE, LICENSE.GPL3 LICENSE.LGPL file shipped with"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
615
        echo "this software has disappeared."
616
        echo
617
        echo "Sorry, you are not licensed to use this software."
618
        echo "Try re-installing."
619
        echo
620
        exit 1
1 by Adam Conrad
Import upstream version 4.0.0
621
    fi
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
622
elif [ $COMMERCIAL_USER = "no" ]; then
623
    # Open Source edition - may only be used under the terms of the GPL or LGPL.
624
    [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
625
    Licensee="Open Source"
626
    Edition="OpenSource"
627
    EditionString="Open Source"
628
    QT_EDITION="QT_EDITION_OPENSOURCE"
629
fi
1 by Adam Conrad
Import upstream version 4.0.0
630
631
#-------------------------------------------------------------------------------
632
# initalize variables
633
#-------------------------------------------------------------------------------
634
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
635
SYSTEM_VARIABLES="CC CXX CFLAGS CXXFLAGS LDFLAGS"
636
for varname in $SYSTEM_VARIABLES; do
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
637
    qmakevarname="${varname}"
638
    # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
639
    if [ "${varname}" = "LDFLAGS" ]; then
640
        qmakevarname="LFLAGS"
641
    fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
642
    cmd=`echo \
643
'if [ -n "\$'${varname}'" ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
644
    QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}'"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
645
fi'`
646
    eval "$cmd"
647
done
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
648
# Use CC/CXX to run config.tests
649
mkdir -p "$outpath/config.tests"
650
rm -f "$outpath/config.tests/.qmake.cache"
651
cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
652
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
653
QMakeVar add QMAKE_LFLAGS -Wl,--as-needed
654
QMakeVar add CONFIG nostrip
655
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
656
QMakeVar add styles "cde mac motif plastique cleanlooks windows"
657
QMakeVar add decorations "default windows styled"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
658
QMakeVar add mouse-drivers "pc"
659
if [ "$UNAME_SYSTEM" = "Linux" ] ; then
660
    QMakeVar add gfx-drivers "linuxfb"
661
    QMakeVar add mouse-drivers "linuxtp"
662
fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
663
QMakeVar add kbd-drivers "tty"
664
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
665
if [ "$CFG_DEV" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
666
    QMakeVar add kbd-drivers "um"
667
fi
1 by Adam Conrad
Import upstream version 4.0.0
668
669
# QTDIR may be set and point to an old or system-wide Qt installation
670
unset QTDIR
671
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
672
# the minimum version of libdbus-1 that we require:
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
673
MIN_DBUS_1_VERSION=0.93
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
674
1 by Adam Conrad
Import upstream version 4.0.0
675
# initalize internal variables
676
CFG_CONFIGURE_EXIT_ON_ERROR=yes
677
CFG_PROFILE=no
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
678
CFG_EXCEPTIONS=unspecified
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
679
CFG_GUI=auto # (yes|no|auto)
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
680
CFG_SCRIPT=auto # (yes|no|auto)
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
681
CFG_SCRIPTTOOLS=auto # (yes|no|auto)
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
682
CFG_XMLPATTERNS=auto # (yes|no|auto)
1 by Adam Conrad
Import upstream version 4.0.0
683
CFG_INCREMENTAL=auto
684
CFG_QCONFIG=full
685
CFG_DEBUG=auto
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
686
CFG_MYSQL_CONFIG=
1 by Adam Conrad
Import upstream version 4.0.0
687
CFG_DEBUG_RELEASE=no
688
CFG_SHARED=yes
689
CFG_SM=auto
690
CFG_XSHAPE=auto
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
691
CFG_XSYNC=auto
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
692
CFG_XVIDEO=auto
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
693
CFG_XINERAMA=runtime
694
CFG_XFIXES=runtime
1 by Adam Conrad
Import upstream version 4.0.0
695
CFG_ZLIB=auto
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
696
CFG_SYMBIAN_DEFFILES=auto
697
CFG_S60=auto
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
698
CFG_SQLITE=qt
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
699
CFG_GIF=auto
700
CFG_TIFF=auto
701
CFG_LIBTIFF=auto
1 by Adam Conrad
Import upstream version 4.0.0
702
CFG_PNG=yes
703
CFG_LIBPNG=auto
704
CFG_JPEG=auto
705
CFG_LIBJPEG=auto
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
706
CFG_MNG=auto
707
CFG_LIBMNG=auto
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
708
CFG_XCURSOR=runtime
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
709
CFG_XRANDR=runtime
1 by Adam Conrad
Import upstream version 4.0.0
710
CFG_XRENDER=auto
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
711
CFG_MITSHM=auto
1 by Adam Conrad
Import upstream version 4.0.0
712
CFG_OPENGL=auto
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
713
CFG_OPENVG=no
714
CFG_OPENVG_LC_INCLUDES=no
715
CFG_OPENVG_SHIVA=no
716
CFG_OPENVG_ON_OPENGL=no
717
CFG_EGL=no
718
CFG_EGL_GLES_INCLUDES=no
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
719
CFG_SSE=auto
1 by Adam Conrad
Import upstream version 4.0.0
720
CFG_FONTCONFIG=auto
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
721
CFG_QWS_FREETYPE=auto
722
CFG_LIBFREETYPE=auto
1 by Adam Conrad
Import upstream version 4.0.0
723
CFG_SQL_AVAILABLE=
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
724
QT_DEFAULT_BUILD_PARTS="libs tools examples demos docs translations"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
725
CFG_BUILD_PARTS=""
726
CFG_NOBUILD_PARTS=""
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
727
CFG_RELEASE_QMAKE=no
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
728
CFG_PHONON=auto
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
729
CFG_PHONON_BACKEND=yes
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
730
CFG_MULTIMEDIA=auto
731
CFG_AUDIO_BACKEND=auto
732
CFG_SVG=auto
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
733
CFG_DECLARATIVE=auto
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
734
CFG_WEBKIT=auto # (yes|no|auto)
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
735
CFG_JAVASCRIPTCORE_JIT=auto
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
736
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
737
CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen directfb"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
738
CFG_GFX_ON="linuxfb multiscreen"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
739
CFG_GFX_PLUGIN_AVAILABLE=
740
CFG_GFX_PLUGIN=
741
CFG_GFX_OFF=
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
742
CFG_KBD_AVAILABLE="tty linuxinput qvfb"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
743
CFG_KBD_ON="tty"    #default, see QMakeVar above
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
744
CFG_MOUSE_AVAILABLE="pc linuxtp linuxinput tslib qvfb"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
745
CFG_MOUSE_ON="pc linuxtp"   #default, see QMakeVar above
746
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
747
if [ -f "$relpath/src/gui/embedded/qscreenqnx_qws.cpp" ]; then
748
    CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} qnx"
749
    CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} qnx"
750
    CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} qnx"
751
fi
752
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
753
CFG_ARCH=
754
CFG_HOST_ARCH=
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
755
CFG_KBD_PLUGIN_AVAILABLE=
756
CFG_KBD_PLUGIN=
1 by Adam Conrad
Import upstream version 4.0.0
757
CFG_KBD_OFF=
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
758
CFG_MOUSE_PLUGIN_AVAILABLE=
759
CFG_MOUSE_PLUGIN=
1 by Adam Conrad
Import upstream version 4.0.0
760
CFG_MOUSE_OFF=
761
CFG_USE_GNUMAKE=no
762
CFG_IM=yes
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
763
CFG_DECORATION_AVAILABLE="styled windows default"
764
CFG_DECORATION_ON="${CFG_DECORATION_AVAILABLE}" # all on by default
765
CFG_DECORATION_PLUGIN_AVAILABLE=
1 by Adam Conrad
Import upstream version 4.0.0
766
CFG_DECORATION_PLUGIN=
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
767
CFG_XINPUT=runtime
1 by Adam Conrad
Import upstream version 4.0.0
768
CFG_XKB=auto
769
CFG_NIS=auto
770
CFG_CUPS=auto
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
771
CFG_ICONV=auto
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
772
CFG_DBUS=auto
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
773
CFG_GLIB=auto
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
774
CFG_GSTREAMER=auto
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
775
CFG_QGTKSTYLE=auto
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
776
CFG_QS60STYLE=auto
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
777
CFG_LARGEFILE=auto
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
778
CFG_OPENSSL=auto
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
779
CFG_PTMALLOC=no
1 by Adam Conrad
Import upstream version 4.0.0
780
CFG_STL=auto
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
781
CFG_PRECOMPILE=auto
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
782
CFG_SEPARATE_DEBUG_INFO=no
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
783
CFG_SEPARATE_DEBUG_INFO_NOCOPY=no
1 by Adam Conrad
Import upstream version 4.0.0
784
CFG_REDUCE_EXPORTS=auto
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
785
CFG_MMX=auto
786
CFG_3DNOW=auto
787
CFG_SSE=auto
788
CFG_SSE2=auto
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
789
CFG_SSE3=auto
790
CFG_SSSE3=auto
791
CFG_SSE4_1=auto
792
CFG_SSE4_2=auto
793
CFG_AVX=auto
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
794
CFG_REDUCE_RELOCATIONS=no
1 by Adam Conrad
Import upstream version 4.0.0
795
CFG_IPV6=auto
796
CFG_NAS=no
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
797
CFG_QWS_DEPTHS=all
1 by Adam Conrad
Import upstream version 4.0.0
798
CFG_USER_BUILD_KEY=
799
CFG_ACCESSIBILITY=auto
800
CFG_QT3SUPPORT=yes
801
CFG_ENDIAN=auto
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
802
CFG_HOST_ENDIAN=auto
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
803
CFG_DOUBLEFORMAT=auto
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
804
CFG_ARMFPA=auto
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
805
CFG_IWMMXT=no
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
806
CFG_NEON=auto
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
807
CFG_CLOCK_GETTIME=auto
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
808
CFG_CLOCK_MONOTONIC=auto
809
CFG_MREMAP=auto
1 by Adam Conrad
Import upstream version 4.0.0
810
CFG_GETADDRINFO=auto
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
811
CFG_IPV6IFNAME=auto
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
812
CFG_GETIFADDRS=auto
813
CFG_INOTIFY=auto
1 by Adam Conrad
Import upstream version 4.0.0
814
CFG_RPATH=yes
1.1.1 by Matthias Klose
Import upstream version 4.0.1
815
CFG_FRAMEWORK=auto
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
816
CFG_MAC_ARCHS=
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
817
MAC_CONFIG_TEST_COMMANDLINE=  # used to make the configure tests run with the correct arch's and SDK settings
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
818
CFG_MAC_DWARF2=auto
819
CFG_MAC_XARCH=auto
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
820
CFG_MAC_CARBON=no
821
CFG_MAC_COCOA=yes
822
COMMANDLINE_MAC_CARBON=no
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
823
CFG_SXE=no
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
824
CFG_PREFIX_INSTALL=yes
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
825
CFG_SDK=
1 by Adam Conrad
Import upstream version 4.0.0
826
D_FLAGS=
827
I_FLAGS=
828
L_FLAGS=
829
RPATH_FLAGS=
830
l_FLAGS=
831
QCONFIG_FLAGS=
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
832
XPLATFORM=              # This seems to be the QMAKESPEC, like "linux-g++" or "symbian/linux-gcce"
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
833
XPLATFORM_MINGW=no      # Whether target platform is MinGW (win32-g++*)
1 by Adam Conrad
Import upstream version 4.0.0
834
PLATFORM=$QMAKESPEC
1.1.11 by Jonathan Riddell
Import upstream version 4.3.1
835
QT_CROSS_COMPILE=no
1 by Adam Conrad
Import upstream version 4.0.0
836
OPT_CONFIRM_LICENSE=no
837
OPT_SHADOW=maybe
838
OPT_FAST=auto
839
OPT_VERBOSE=no
840
OPT_HELP=
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
841
CFG_SILENT=no
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
842
CFG_GRAPHICS_SYSTEM=default
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
843
CFG_RUNTIME_SYSTEM=
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
844
CFG_ALSA=auto
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
845
CFG_PULSEAUDIO=auto
846
CFG_COREWLAN=auto
847
CFG_ICD=auto
1 by Adam Conrad
Import upstream version 4.0.0
848
849
# initalize variables used for installation
850
QT_INSTALL_PREFIX=
851
QT_INSTALL_DOCS=
852
QT_INSTALL_HEADERS=
853
QT_INSTALL_LIBS=
854
QT_INSTALL_BINS=
855
QT_INSTALL_PLUGINS=
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
856
QT_INSTALL_IMPORTS=
1 by Adam Conrad
Import upstream version 4.0.0
857
QT_INSTALL_DATA=
858
QT_INSTALL_TRANSLATIONS=
859
QT_INSTALL_SETTINGS=
860
QT_INSTALL_EXAMPLES=
861
QT_INSTALL_DEMOS=
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
862
QT_HOST_PREFIX=
1 by Adam Conrad
Import upstream version 4.0.0
863
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
864
#flags for SQL drivers
865
QT_CFLAGS_PSQL=
866
QT_LFLAGS_PSQL=
867
QT_CFLAGS_MYSQL=
868
QT_LFLAGS_MYSQL=
869
QT_LFLAGS_MYSQL_R=
870
QT_CFLAGS_SQLITE=
871
QT_LFLAGS_SQLITE=
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
872
QT_LFLAGS_ODBC="-lodbc"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
873
QT_LFLAGS_TDS=
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
874
875
# flags for libdbus-1
876
QT_CFLAGS_DBUS=
877
QT_LIBS_DBUS=
878
879
# flags for Glib (X11 only)
880
QT_CFLAGS_GLIB=
881
QT_LIBS_GLIB=
1 by Adam Conrad
Import upstream version 4.0.0
882
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
883
# flags for GStreamer (X11 only)
884
QT_CFLAGS_GSTREAMER=
885
QT_LIBS_GSTREAMER=
886
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
887
# flags for libconnsettings0 (used for Maemo ICD bearer management plugin)
888
QT_CFLAGS_CONNSETTINGS=
889
QT_LIBS_CONNSETTINGS=
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
890
1 by Adam Conrad
Import upstream version 4.0.0
891
#-------------------------------------------------------------------------------
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
892
# check SQL drivers, mouse drivers and decorations available in this package
1 by Adam Conrad
Import upstream version 4.0.0
893
#-------------------------------------------------------------------------------
894
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
895
# opensource version removes some drivers, so force them to be off
896
CFG_SQL_tds=no
897
CFG_SQL_oci=no
898
CFG_SQL_db2=no
899
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
900
CFG_SQL_AVAILABLE=
901
if [ -d "$relpath/src/plugins/sqldrivers" ]; then
902
  for a in "$relpath/src/plugins/sqldrivers/"*; do
903
     if [ -d "$a" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
904
	 base_a=`basename "$a"`
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
905
  	 CFG_SQL_AVAILABLE="${CFG_SQL_AVAILABLE} ${base_a}"
906
	 eval "CFG_SQL_${base_a}=auto"
907
     fi
908
  done
909
fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
910
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
911
CFG_DECORATION_PLUGIN_AVAILABLE=
1 by Adam Conrad
Import upstream version 4.0.0
912
if [ -d "$relpath/src/plugins/decorations" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
913
  for a in "$relpath/src/plugins/decorations/"*; do
914
     if [ -d "$a" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
915
	 base_a=`basename "$a"`
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
916
  	 CFG_DECORATION_PLUGIN_AVAILABLE="${CFG_DECORATION_PLUGIN_AVAILABLE} ${base_a}"
917
     fi
918
  done
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
919
fi
920
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
921
CFG_KBD_PLUGIN_AVAILABLE=
922
if [ -d "$relpath/src/plugins/kbddrivers" ]; then
923
  for a in "$relpath/src/plugins/kbddrivers/"*; do
924
     if [ -d "$a" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
925
	 base_a=`basename "$a"`
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
926
  	 CFG_KBD_PLUGIN_AVAILABLE="${CFG_KBD_PLUGIN_AVAILABLE} ${base_a}"
927
     fi
928
  done
929
fi
930
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
931
CFG_MOUSE_PLUGIN_AVAILABLE=
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
932
if [ -d "$relpath/src/plugins/mousedrivers" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
933
  for a in "$relpath/src/plugins/mousedrivers/"*; do
934
     if [ -d "$a" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
935
	 base_a=`basename "$a"`
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
936
  	 CFG_MOUSE_PLUGIN_AVAILABLE="${CFG_MOUSE_PLUGIN_AVAILABLE} ${base_a}"
937
     fi
938
  done
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
939
fi
940
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
941
CFG_GFX_PLUGIN_AVAILABLE=
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
942
if [ -d "$relpath/src/plugins/gfxdrivers" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
943
  for a in "$relpath/src/plugins/gfxdrivers/"*; do
944
     if [ -d "$a" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
945
	 base_a=`basename "$a"`
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
946
  	 CFG_GFX_PLUGIN_AVAILABLE="${CFG_GFX_PLUGIN_AVAILABLE} ${base_a}"
947
     fi
948
  done
949
  CFG_GFX_OFF="$CFG_GFX_AVAILABLE" # assume all off
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
950
fi
1 by Adam Conrad
Import upstream version 4.0.0
951
952
#-------------------------------------------------------------------------------
953
# parse command line arguments
954
#-------------------------------------------------------------------------------
955
956
# parse the arguments, setting things to "yes" or "no"
957
while [ "$#" -gt 0 ]; do
958
    CURRENT_OPT="$1"
959
    UNKNOWN_ARG=no
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
960
    case "$1" in
1 by Adam Conrad
Import upstream version 4.0.0
961
    #Autoconf style options
962
    --enable-*)
963
        VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
964
        VAL=yes
965
        ;;
966
    --disable-*)
967
        VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
968
        VAL=no
969
        ;;
970
    --*=*)
971
        VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
972
        VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
973
        ;;
974
    --no-*)
975
        VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
976
        VAL=no
977
        ;;
978
    --*)
979
        VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
980
        VAL=yes
981
        ;;
982
    #Qt plugin options
983
    -no-*-*|-plugin-*-*|-qt-*-*)
984
        VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
985
        VAL=`echo $1 | sed "s,^-\([^-]*\).*,\1,"`
986
        ;;
987
    #Qt style no options
988
    -no-*)
989
        VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"`
990
        VAL=no
991
        ;;
992
    #Qt style yes options
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
993
        -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles)
1 by Adam Conrad
Import upstream version 4.0.0
994
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
995
        VAL=yes
996
        ;;
997
    #Qt style options that pass an argument
998
    -qconfig)
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
999
        if [ "$PLATFORM_QWS" != "yes" ]; then
1000
            echo
1001
            echo "WARNING: -qconfig is only tested and supported on Qt for Embedded Linux."
1002
            echo
1 by Adam Conrad
Import upstream version 4.0.0
1003
        fi
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
1004
        CFG_QCONFIG="$VAL"
1005
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1006
        shift
1007
        VAL=$1
1 by Adam Conrad
Import upstream version 4.0.0
1008
        ;;
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
1009
    -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config)
1 by Adam Conrad
Import upstream version 4.0.0
1010
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1011
        shift
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1012
        VAL="$1"
1 by Adam Conrad
Import upstream version 4.0.0
1013
        ;;
1014
    #Qt style complex options in one command
1015
    -enable-*|-disable-*)
1016
        VAR=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
1017
        VAL=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
1018
        ;;
1019
    #Qt Builtin/System style options
1020
    -no-*|-system-*|-qt-*)
1021
        VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
1022
        VAL=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
1023
        ;;
1024
    #Options that cannot be generalized
1025
    -k|-continue)
1026
        VAR=fatal_error
1027
        VAL=no
1028
        ;;
1029
    -embedded)
1030
        VAR=embedded
1031
        # this option may or may not be followed by an argument
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1032
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1 by Adam Conrad
Import upstream version 4.0.0
1033
            VAL=auto
1034
        else
1035
            shift;
1036
            VAL=$1
1037
        fi
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
1038
	;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1039
    -opengl)
1040
        VAR=opengl
1041
        # this option may or may not be followed by an argument
1042
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1043
            VAL=yes
1044
        else
1045
            shift;
1046
            VAL=$1
1047
        fi
1048
	;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
1049
    -openvg)
1050
        VAR=openvg
1051
        # this option may or may not be followed by an argument
1052
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1053
            VAL=yes
1054
        else
1055
            shift;
1056
            VAL=$1
1057
        fi
1058
	;;
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
1059
    -hostprefix)
1060
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1061
        # this option may or may not be followed by an argument
1062
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1063
            VAL=$outpath
1064
        else
1065
            shift;
1066
            VAL=$1
1067
        fi
1 by Adam Conrad
Import upstream version 4.0.0
1068
        ;;
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
1069
    -host-*-endian)
1070
        VAR=host_endian
1071
        VAL=`echo $1 | sed "s,^-.*-\(.*\)-.*,\1,"`
1072
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1073
    -*-endian)
1074
        VAR=endian
1075
        VAL=`echo $1 | sed "s,^-\(.*\)-.*,\1,"`
1076
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1077
    -qtnamespace)
1078
        VAR="qtnamespace"
1079
        shift
1080
        VAL="$1"
1081
        ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1082
    -graphicssystem)
1083
	VAR="graphicssystem"
1084
	shift
1085
	VAL=$1
1086
	;;
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
1087
    -runtimegraphicssystem)
1088
	VAR="runtimegraphicssystem"
1089
	shift
1090
	VAL=$1
1091
	;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1092
    -qtlibinfix)
1093
        VAR="qtlibinfix"
1094
        shift
1095
        VAL="$1"
1096
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1097
    -D?*|-D)
1098
        VAR="add_define"
1099
        if [ "$1" = "-D" ]; then
1100
            shift
1101
            VAL="$1"
1102
        else
1103
            VAL=`echo $1 | sed 's,-D,,'`
1104
        fi
1105
        ;;
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
1106
    -isystem)
1107
        VAR="add_isystempath"
1108
        shift
1109
        VAL="$1"
1110
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1111
    -I?*|-I)
1112
        VAR="add_ipath"
1113
        if [ "$1" = "-I" ]; then
1114
            shift
1115
            VAL="$1"
1116
        else
1117
            VAL=`echo $1 | sed 's,-I,,'`
1118
        fi
1119
        ;;
1120
    -L?*|-L)
1121
        VAR="add_lpath"
1122
        if [ "$1" = "-L" ]; then
1123
            shift
1124
            VAL="$1"
1125
        else
1126
            VAL=`echo $1 | sed 's,-L,,'`
1127
        fi
1128
        ;;
1129
    -R?*|-R)
1130
        VAR="add_rpath"
1131
        if [ "$1" = "-R" ]; then
1132
            shift
1133
            VAL="$1"
1134
        else
1135
            VAL=`echo $1 | sed 's,-R,,'`
1136
        fi
1137
        ;;
1138
    -l?*)
1139
        VAR="add_link"
1140
        VAL=`echo $1 | sed 's,-l,,'`
1141
        ;;
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
1142
    -F?*|-F)
1143
        VAR="add_fpath"
1144
        if [ "$1" = "-F" ]; then
1145
            shift
1146
            VAL="$1"
1147
        else
1148
            VAL=`echo $1 | sed 's,-F,,'`
1149
        fi
1150
        ;;
1151
    -fw?*|-fw)
1152
        VAR="add_framework"
1153
        if [ "$1" = "-fw" ]; then
1154
            shift
1155
            VAL="$1"
1156
        else
1157
            VAL=`echo $1 | sed 's,-fw,,'`
1158
        fi
1159
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1160
    -*)
1161
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1162
        VAL="unknown"
1163
        ;;
1164
    *)
1165
        UNKNOWN_ARG=yes
1166
        ;;
1167
    esac
1168
    if [ "$UNKNOWN_ARG" = "yes" ]; then
1169
        echo "$1: unknown argument"
1170
        OPT_HELP=yes
1171
        ERROR=yes
1172
        shift
1173
        continue
1174
     fi
1175
    shift
1176
1177
    UNKNOWN_OPT=no
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1178
    case "$VAR" in
1 by Adam Conrad
Import upstream version 4.0.0
1179
    qt3support)
1180
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1181
            CFG_QT3SUPPORT="$VAL"
1182
        else
1183
            UNKNOWN_OPT=yes
1184
        fi
1185
        ;;
1186
    accessibility)
1187
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1188
            CFG_ACCESSIBILITY="$VAL"
1189
        else
1190
            UNKNOWN_OPT=yes
1191
        fi
1192
        ;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1193
    license)
1194
	LICENSE_FILE="$VAL"
1195
	;;
1 by Adam Conrad
Import upstream version 4.0.0
1196
    gnumake)
1197
        CFG_USE_GNUMAKE="$VAL"
1198
        ;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1199
    mysql_config)
1200
	CFG_MYSQL_CONFIG="$VAL"
1201
	;;
1 by Adam Conrad
Import upstream version 4.0.0
1202
    prefix)
1203
        QT_INSTALL_PREFIX="$VAL"
1204
        ;;
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
1205
    hostprefix)
1206
	QT_HOST_PREFIX="$VAL"
1207
	;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1208
    force-pkg-config)
1209
        QT_FORCE_PKGCONFIG=yes
1210
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1211
    docdir)
1212
        QT_INSTALL_DOCS="$VAL"
1213
        ;;
1214
    headerdir)
1215
        QT_INSTALL_HEADERS="$VAL"
1216
        ;;
1217
    plugindir)
1218
        QT_INSTALL_PLUGINS="$VAL"
1219
        ;;
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
1220
    importdir)
1221
        QT_INSTALL_IMPORTS="$VAL"
1222
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1223
    datadir)
1224
        QT_INSTALL_DATA="$VAL"
1225
        ;;
1226
    libdir)
1227
        QT_INSTALL_LIBS="$VAL"
1228
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1229
    qtnamespace)
1230
        QT_NAMESPACE="$VAL"
1231
        ;;
1232
    qtlibinfix)
1233
        QT_LIBINFIX="$VAL"
1234
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1235
    translationdir)
1236
        QT_INSTALL_TRANSLATIONS="$VAL"
1237
        ;;
1238
    sysconfdir|settingsdir)
1239
        QT_INSTALL_SETTINGS="$VAL"
1240
        ;;
1241
    examplesdir)
1242
        QT_INSTALL_EXAMPLES="$VAL"
1243
        ;;
1244
    demosdir)
1245
        QT_INSTALL_DEMOS="$VAL"
1246
        ;;
1247
    qconfig)
1248
        CFG_QCONFIG="$VAL"
1249
        ;;
1250
    bindir)
1251
        QT_INSTALL_BINS="$VAL"
1252
        ;;
1253
    buildkey)
1254
        CFG_USER_BUILD_KEY="$VAL"
1255
        ;;
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
1256
    sxe)
1257
	CFG_SXE="$VAL"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
1258
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1259
    embedded)
1260
        CFG_EMBEDDED="$VAL"
1261
        if [ "$PLATFORM_QWS" != "no" ]; then
1262
            if [ "$PLATFORM_QWS" = "maybe" ]; then
1.1.1 by Matthias Klose
Import upstream version 4.0.1
1263
                PLATFORM_X11=no
1264
                PLATFORM_MAC=no
1 by Adam Conrad
Import upstream version 4.0.0
1265
                PLATFORM_QWS=yes
1266
            fi
1267
        else
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1268
            echo "No license exists to enable Qt for Embedded Linux. Disabling."
1 by Adam Conrad
Import upstream version 4.0.0
1269
            CFG_EMBEDDED=no
1270
        fi
1271
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1272
    sse)
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1273
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1274
            CFG_SSE="$VAL"
1275
        else
1276
            UNKNOWN_OPT=yes
1277
        fi
1278
	;;
1 by Adam Conrad
Import upstream version 4.0.0
1279
    endian)
1280
        if [ "$VAL" = "little" ]; then
1281
            CFG_ENDIAN="Q_LITTLE_ENDIAN"
1282
        elif [ "$VAL" = "big" ]; then
1283
            CFG_ENDIAN="Q_BIG_ENDIAN"
1284
        else
1285
            UNKNOWN_OPT=yes
1286
        fi
1287
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1288
    host_endian)
1289
        if [ "$VAL" = "little" ]; then
1290
            CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
1291
        elif [ "$VAL" = "big" ]; then
1292
            CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
1293
        else
1294
            UNKNOWN_OPT=yes
1295
        fi
1296
        ;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1297
    armfpa)
1298
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1299
            CFG_ARMFPA="$VAL"
1300
        else
1301
            UNKNOWN_OPT=yes
1302
        fi
1303
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1304
    depths)
1305
        CFG_QWS_DEPTHS="$VAL"
1306
        ;;
1307
    opengl)
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1308
        if  [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
1309
            [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
1310
            [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
1311
            CFG_OPENGL="$VAL"
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
1312
            if  [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then
1313
                CFG_EGL="yes"
1314
            fi
1 by Adam Conrad
Import upstream version 4.0.0
1315
        else
1316
            UNKNOWN_OPT=yes
1317
        fi
1318
        ;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
1319
    openvg)
1320
        if [ "$VAL" = "auto" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1321
            CFG_OPENVG="$VAL"
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
1322
            CFG_EGL="auto"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
1323
        else
1324
            UNKNOWN_OPT=yes
1325
        fi
1326
        ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1327
    graphicssystem)
1328
        if [ "$PLATFORM_QWS" = "yes" ]; then
1329
            echo "Error: Graphics System plugins are not supported on QWS."
1330
            echo "   On QWS, the graphics system API is part of the QScreen plugin architecture "
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
1331
            echo "   rather than existing as a separate plugin."
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1332
            echo ""
1333
            UNKNOWN_OPT=yes
1334
        else
1335
            if  [ "$VAL" = "opengl" ]; then
1336
                CFG_GRAPHICS_SYSTEM="opengl"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
1337
            elif [ "$VAL" = "openvg" ]; then
1338
                CFG_GRAPHICS_SYSTEM="openvg"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1339
            elif [ "$VAL" = "raster" ]; then
1340
                CFG_GRAPHICS_SYSTEM="raster"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
1341
            elif [ "$VAL" = "runtime" ]; then
1342
                CFG_GRAPHICS_SYSTEM="runtime"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1343
            else
1344
                UNKNOWN_OPT=yes
1345
            fi
1346
        fi
1347
	;;
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
1348
    runtimegraphicssystem)
1349
        if  [ "$VAL" != "runtime" ]; then
1350
            CFG_RUNTIME_SYSTEM="$VAL"
1351
        fi
1352
	;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
1353
1 by Adam Conrad
Import upstream version 4.0.0
1354
    qvfb) # left for commandline compatibility, not documented
1355
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
1356
            if [ "$VAL" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1357
		QMakeVar add gfx-drivers qvfb
1358
		QMakeVar add kbd-drivers qvfb
1359
		QMakeVar add mouse-drivers qvfb
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
1360
                CFG_GFX_ON="$CFG_GFX_ON qvfb"
1361
                CFG_KBD_ON="$CFG_KBD_ON qvfb"
1362
                CFG_MOUSE_ON="$CFG_MOUSE_ON qvfb"
1363
            fi
1 by Adam Conrad
Import upstream version 4.0.0
1364
        else
1365
            UNKNOWN_OPT=yes
1366
        fi
1367
        ;;
1368
    nomake)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1369
	CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL"
1 by Adam Conrad
Import upstream version 4.0.0
1370
        ;;
1371
    make)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1372
	CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL"
1 by Adam Conrad
Import upstream version 4.0.0
1373
        ;;
1374
    x11)
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1375
        if [ "$PLATFORM_MAC" = "yes" ]; then
1376
            PLATFORM_MAC=no
1377
        elif [ "$PLATFORM_QWS" = "yes" ]; then
1378
            PLATFORM_QWS=no
1379
        fi
1380
        if [ "$CFG_FRAMEWORK" = "auto" ]; then
1381
            CFG_FRAMEWORK=no
1382
        fi
1383
        PLATFORM_X11=yes
1 by Adam Conrad
Import upstream version 4.0.0
1384
        ;;
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
1385
    sdk)
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
1386
        if [ "$PLATFORM_MAC" = "yes" ]; then
1387
            CFG_SDK="$VAL"
1388
        else
1389
            UNKNOWN_OPT=yes
1390
        fi
1391
	;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1392
     dwarf2)
1393
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1394
            CFG_MAC_DWARF2="$VAL"
1395
        else
1396
            UNKNOWN_OPT=yes
1397
        fi
1398
	;;
1399
    arch)
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
1400
        # if this is a Mac then "windows" probably means
1401
        # we are cross-compiling for MinGW
1402
        if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" != "windows" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1403
            CFG_MAC_ARCHS="$CFG_MAC_ARCHS $VAL"
1404
        else
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
1405
            CFG_ARCH=$VAL
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1406
        fi
1407
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1408
    host-arch)
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
1409
        CFG_HOST_ARCH=$VAL
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1410
        ;;
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
1411
    universal)
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1412
        if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1413
            CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86 ppc"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
1414
        else
1415
            UNKNOWN_OPT=yes
1416
        fi
1417
        ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1418
    cocoa)
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
1419
#       do nothing - Cocoa is the default.
1420
        ;;
1421
    carbon)
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1422
        if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
1423
            CFG_MAC_CARBON="$VAL"
1424
            COMMANDLINE_MAC_CARBON="$VAL"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1425
        else
1426
            UNKNOWN_OPT=yes
1427
        fi
1428
        ;;
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
1429
1 by Adam Conrad
Import upstream version 4.0.0
1430
    framework)
1431
        if [ "$PLATFORM_MAC" = "yes" ]; then
1432
            CFG_FRAMEWORK="$VAL"
1433
        else
1434
            UNKNOWN_OPT=yes
1435
        fi
1436
        ;;
1437
    profile)
1438
        if [ "$VAL" = "yes" ]; then
1439
            CFG_PROFILE=yes
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1440
	    QMakeVar add QMAKE_CFLAGS -pg
1441
	    QMakeVar add QMAKE_CXXFLAGS -pg
1442
	    QMakeVar add QMAKE_LFLAGS -pg
1443
            QMAKE_VARS="$QMAKE_VARS CONFIG+=nostrip"
1 by Adam Conrad
Import upstream version 4.0.0
1444
        else
1445
            UNKNOWN_OPT=yes
1446
        fi
1447
        ;;
1448
    exceptions|g++-exceptions)
1449
        if [ "$VAL" = "no" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
1450
            CFG_EXCEPTIONS=no
1 by Adam Conrad
Import upstream version 4.0.0
1451
        elif [ "$VAL" = "yes" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
1452
            CFG_EXCEPTIONS=yes
1 by Adam Conrad
Import upstream version 4.0.0
1453
        else
1454
            UNKNOWN_OPT=yes
1455
        fi
1456
        ;;
1457
    platform)
1458
        PLATFORM="$VAL"
1459
        # keep compatibility with old platform names
1460
        case $PLATFORM in
1461
        aix-64)
1462
            PLATFORM=aix-xlc-64
1463
            ;;
1464
        hpux-o64)
1465
            PLATFORM=hpux-acc-o64
1466
            ;;
1467
        hpux-n64)
1468
            PLATFORM=hpux-acc-64
1469
            ;;
1470
        hpux-acc-n64)
1471
            PLATFORM=hpux-acc-64
1472
            ;;
1473
        irix-n32)
1474
            PLATFORM=irix-cc
1475
            ;;
1476
        irix-64)
1477
            PLATFORM=irix-cc-64
1478
            ;;
1479
        irix-cc-n64)
1480
            PLATFORM=irix-cc-64
1481
            ;;
1482
        reliant-64)
1483
            PLATFORM=reliant-cds-64
1484
            ;;
1485
        solaris-64)
1486
            PLATFORM=solaris-cc-64
1487
            ;;
1488
        openunix-cc)
1489
            PLATFORM=unixware-cc
1490
            ;;
1491
        openunix-g++)
1492
            PLATFORM=unixware-g++
1493
            ;;
1494
        unixware7-cc)
1495
            PLATFORM=unixware-cc
1496
            ;;
1497
        unixware7-g++)
1498
            PLATFORM=unixware-g++
1499
            ;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1500
        macx-g++-64)
1501
            PLATFORM=macx-g++
1502
	    NATIVE_64_ARCH=
1503
            case `uname -p` in
1504
            i386) NATIVE_64_ARCH="x86_64" ;;
1505
            powerpc) NATIVE_64_ARCH="ppc64" ;;
1506
            *)   echo "WARNING: Can't detect CPU architecture for macx-g++-64" ;;
1507
            esac
1508
	    if [ ! -z "$NATIVE_64_ARCH" ]; then
1509
		QTCONFIG_CONFIG="$QTCONFIG_CONFIG $NATIVE_64_ARCH"
1510
		CFG_MAC_ARCHS="$CFG_MAC_ARCHS $NATIVE_64_ARCH"
1511
            fi
1512
            ;;
1 by Adam Conrad
Import upstream version 4.0.0
1513
        esac
1514
        ;;
1515
    xplatform)
1516
        XPLATFORM="$VAL"
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
1517
        case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
1 by Adam Conrad
Import upstream version 4.0.0
1518
        ;;
1519
    debug-and-release)
1.1.1 by Matthias Klose
Import upstream version 4.0.1
1520
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1521
            CFG_DEBUG_RELEASE="$VAL"
1522
        else
1523
            UNKNOWN_OPT=yes
1524
        fi
1 by Adam Conrad
Import upstream version 4.0.0
1525
        ;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1526
    optimized-qmake)
1527
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1528
            CFG_RELEASE_QMAKE="$VAL"
1529
        else
1530
            UNKNOWN_OPT=yes
1531
        fi
1532
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1533
    release)
1534
        if [ "$VAL" = "yes" ]; then
1535
            CFG_DEBUG=no
1536
        elif [ "$VAL" = "no" ]; then
1537
            CFG_DEBUG=yes
1538
        else
1539
            UNKNOWN_OPT=yes
1540
        fi
1541
        ;;
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1542
    prefix-install)
1543
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1544
	    CFG_PREFIX_INSTALL="$VAL"
1545
        else
1546
            UNKNOWN_OPT=yes
1547
        fi
1548
	;;
1 by Adam Conrad
Import upstream version 4.0.0
1549
    debug)
1550
        CFG_DEBUG="$VAL"
1551
        ;;
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
1552
    developer-build|commercial|opensource|nokia-developer)
1553
        # These switches have been dealt with already
1554
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1555
    static)
1556
        if [ "$VAL" = "yes" ]; then
1557
            CFG_SHARED=no
1558
        elif [ "$VAL" = "no" ]; then
1559
            CFG_SHARED=yes
1560
        else
1561
            UNKNOWN_OPT=yes
1562
        fi
1563
        ;;
1564
    incremental)
1565
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1566
            CFG_INCREMENTAL="$VAL"
1567
        else
1568
            UNKNOWN_OPT=yes
1569
        fi
1570
        ;;
1571
    fatal_error)
1572
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1573
            CFG_CONFIGURE_EXIT_ON_ERROR="$VAL"
1574
        else
1575
            UNKNOWN_OPT=yes
1576
        fi
1577
        ;;
1578
    feature-*)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1579
            FEATURE=`echo $VAR | sed "s,^[^-]*-\([^-]*\),\1," | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
1 by Adam Conrad
Import upstream version 4.0.0
1580
            if [ "$VAL" = "no" ]; then
1581
                QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE"
1582
            elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then
1583
                QCONFIG_FLAGS="$QCONFIG_FLAGS QT_$FEATURE"
1584
            else
1585
                UNKNOWN_OPT=yes
1586
            fi
1587
        ;;
1588
    shared)
1589
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1590
            CFG_SHARED="$VAL"
1591
        else
1592
            UNKNOWN_OPT=yes
1593
        fi
1594
        ;;
1595
    gif)
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
1596
        [ "$VAL" = "qt" ] && VAL=auto
1597
        if [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
1598
            CFG_GIF="$VAL"
1599
        else
1600
            UNKNOWN_OPT=yes
1601
        fi
1602
        ;;
1603
    sm)
1604
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1605
            CFG_SM="$VAL"
1606
        else
1607
            UNKNOWN_OPT=yes
1608
        fi
1609
1610
        ;;
1611
    xinerama)
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1612
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
1613
            CFG_XINERAMA="$VAL"
1614
        else
1615
            UNKNOWN_OPT=yes
1616
        fi
1617
        ;;
1618
    xshape)
1619
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1620
            CFG_XSHAPE="$VAL"
1621
        else
1622
            UNKNOWN_OPT=yes
1623
        fi
1624
        ;;
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
1625
    xvideo)
1626
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1627
            CFG_XVIDEO="$VAL"
1628
        else
1629
            UNKNOWN_OPT=yes
1630
        fi
1631
        ;;
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
1632
    xsync)
1633
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1634
            CFG_XSYNC="$VAL"
1635
        else
1636
            UNKNOWN_OPT=yes
1637
        fi
1638
        ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1639
    xinput)
1640
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1641
            CFG_XINPUT="$VAL"
1 by Adam Conrad
Import upstream version 4.0.0
1642
        else
1643
            UNKNOWN_OPT=yes
1644
        fi
1645
        ;;
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
1646
    egl)
1647
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1648
            CFG_EGL="$VAL"
1649
        else
1650
            UNKNOWN_OPT=yes
1651
        fi
1652
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1653
    stl)
1654
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1655
            CFG_STL="$VAL"
1656
        else
1657
            UNKNOWN_OPT=yes
1658
        fi
1659
        ;;
1660
    pch)
1661
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1662
            CFG_PRECOMPILE="$VAL"
1663
        else
1664
            UNKNOWN_OPT=yes
1665
        fi
1666
        ;;
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1667
    separate-debug-info)
1668
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1669
            CFG_SEPARATE_DEBUG_INFO="$VAL"
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
1670
        elif [ "$VAL" = "nocopy" ] ; then
1671
            CFG_SEPARATE_DEBUG_INFO="yes"
1672
            CFG_SEPARATE_DEBUG_INFO_NOCOPY="yes"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1673
        else
1674
            UNKNOWN_OPT=yes
1675
        fi
1676
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1677
    reduce-exports)
1678
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1679
            CFG_REDUCE_EXPORTS="$VAL"
1680
        else
1681
            UNKNOWN_OPT=yes
1682
        fi
1683
        ;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1684
    mmx)
1685
        if [ "$VAL" = "no" ]; then
1686
            CFG_MMX="$VAL"
1687
        else
1688
            UNKNOWN_OPT=yes
1689
        fi
1690
        ;;
1691
    3dnow)
1692
        if [ "$VAL" = "no" ]; then
1693
            CFG_3DNOW="$VAL"
1694
        else
1695
            UNKNOWN_OPT=yes
1696
        fi
1697
        ;;
1698
    sse)
1699
        if [ "$VAL" = "no" ]; then
1700
            CFG_SSE="$VAL"
1701
        else
1702
            UNKNOWN_OPT=yes
1703
        fi
1704
        ;;
1705
    sse2)
1706
        if [ "$VAL" = "no" ]; then
1707
            CFG_SSE2="$VAL"
1708
        else
1709
            UNKNOWN_OPT=yes
1710
        fi
1711
        ;;
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
1712
    sse3)
1713
        if [ "$VAL" = "no" ]; then
1714
            CFG_SSE3="$VAL"
1715
        else
1716
            UNKNOWN_OPT=yes
1717
        fi
1718
        ;;
1719
    ssse3)
1720
        if [ "$VAL" = "no" ]; then
1721
            CFG_SSSE3="$VAL"
1722
        else
1723
            UNKNOWN_OPT=yes
1724
        fi
1725
        ;;
1726
    sse4.1)
1727
        if [ "$VAL" = "no" ]; then
1728
            CFG_SSE4_1="$VAL"
1729
        else
1730
            UNKNOWN_OPT=yes
1731
        fi
1732
        ;;
1733
    sse4.2)
1734
        if [ "$VAL" = "no" ]; then
1735
            CFG_SSE4_2="$VAL"
1736
        else
1737
            UNKNOWN_OPT=yes
1738
        fi
1739
        ;;
1740
    avx)
1741
        if [ "$VAL" = "no" ]; then
1742
            CFG_AVX="$VAL"
1743
        else
1744
            UNKNOWN_OPT=yes
1745
        fi
1746
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1747
    iwmmxt)
1748
	CFG_IWMMXT="yes"
1749
	;;
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
1750
    neon)
1751
        if [ "$VAL" = "no" ]; then
1752
            CFG_NEON="$VAL"
1753
        else
1754
            UNKNOWN_OPT=yes
1755
        fi
1756
        ;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1757
    reduce-relocations)
1758
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1759
            CFG_REDUCE_RELOCATIONS="$VAL"
1760
        else
1761
            UNKNOWN_OPT=yes
1762
        fi
1763
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1764
    freetype)
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
1765
        [ "$VAL" = "qt" ] && VAL=yes
1766
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
1767
            CFG_QWS_FREETYPE="$VAL"
1768
        else
1769
            UNKNOWN_OPT=yes
1770
        fi
1771
        ;;
1772
    zlib)
1773
        [ "$VAL" = "qt" ] && VAL=yes
1774
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1775
            CFG_ZLIB="$VAL"
1776
        else
1777
            UNKNOWN_OPT=yes
1778
        fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1779
        # No longer supported:
1780
        #[ "$VAL" = "no" ] && CFG_LIBPNG=no
1 by Adam Conrad
Import upstream version 4.0.0
1781
        ;;
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
1782
    s60)
1783
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1784
            CFG_S60="$VAL"
1785
        else
1786
            UNKNOWN_OPT=yes
1787
        fi
1788
        ;;
1789
    usedeffiles)
1790
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1791
            CFG_SYMBIAN_DEFFILES="$VAL"
1792
        else
1793
            UNKNOWN_OPT=yes
1794
        fi
1795
        ;;
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1796
    sqlite)
1797
        if [ "$VAL" = "system" ]; then
1798
            CFG_SQLITE=system
1799
        else
1800
            UNKNOWN_OPT=yes
1801
        fi
1802
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1803
    libpng)
1804
        [ "$VAL" = "yes" ] && VAL=qt
1805
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1806
            CFG_LIBPNG="$VAL"
1807
        else
1808
            UNKNOWN_OPT=yes
1809
        fi
1810
        ;;
1811
    libjpeg)
1812
        [ "$VAL" = "yes" ] && VAL=qt
1813
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1814
            CFG_LIBJPEG="$VAL"
1815
        else
1816
            UNKNOWN_OPT=yes
1817
        fi
1818
        ;;
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
1819
    libmng)
1820
        [ "$VAL" = "yes" ] && VAL=qt
1821
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1822
            CFG_LIBMNG="$VAL"
1823
        else
1824
            UNKNOWN_OPT=yes
1825
        fi
1826
        ;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1827
    libtiff)
1828
        [ "$VAL" = "yes" ] && VAL=qt
1829
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1830
            CFG_LIBTIFF="$VAL"
1831
        else
1832
            UNKNOWN_OPT=yes
1833
        fi
1834
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1835
    nas-sound)
1836
        if [ "$VAL" = "system" ] || [ "$VAL" = "no" ]; then
1837
            CFG_NAS="$VAL"
1838
        else
1839
            UNKNOWN_OPT=yes
1840
        fi
1841
        ;;
1842
    xcursor)
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1843
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
1844
            CFG_XCURSOR="$VAL"
1845
        else
1846
            UNKNOWN_OPT=yes
1847
        fi
1848
        ;;
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1849
    xfixes)
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1850
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1851
            CFG_XFIXES="$VAL"
1852
        else
1853
            UNKNOWN_OPT=yes
1854
        fi
1855
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1856
    xrandr)
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1857
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
1858
            CFG_XRANDR="$VAL"
1859
        else
1860
            UNKNOWN_OPT=yes
1861
        fi
1862
        ;;
1863
    xrender)
1864
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1865
            CFG_XRENDER="$VAL"
1866
        else
1867
            UNKNOWN_OPT=yes
1868
        fi
1869
        ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1870
    mitshm)
1871
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1872
            CFG_MITSHM="$VAL"
1873
        else
1874
            UNKNOWN_OPT=yes
1875
        fi
1876
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1877
    fontconfig)
1878
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1879
            CFG_FONTCONFIG="$VAL"
1880
        else
1881
            UNKNOWN_OPT=yes
1882
        fi
1883
        ;;
1884
    xkb)
1885
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1886
            CFG_XKB="$VAL"
1887
        else
1888
            UNKNOWN_OPT=yes
1889
        fi
1890
        ;;
1891
    cups)
1892
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1893
            CFG_CUPS="$VAL"
1894
        else
1895
            UNKNOWN_OPT=yes
1896
        fi
1897
        ;;
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1898
    iconv)
1899
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1900
            CFG_ICONV="$VAL"
1901
        else
1902
            UNKNOWN_OPT=yes
1903
        fi
1904
        ;;
1905
    glib)
1906
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1907
            CFG_GLIB="$VAL"
1908
        else
1909
            UNKNOWN_OPT=yes
1910
        fi
1911
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1912
    gstreamer)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1913
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1914
            CFG_GSTREAMER="$VAL"
1915
        else
1916
            UNKNOWN_OPT=yes
1917
        fi
1918
        ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1919
    gtkstyle)
1920
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1921
            CFG_QGTKSTYLE="$VAL"
1922
        else
1923
            UNKNOWN_OPT=yes
1924
        fi
1925
        ;;
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
1926
    style-s60)
1927
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ]; then
1928
            CFG_QS60STYLE="$VAL"
1929
        else
1930
            UNKNOWN_OPT=yes
1931
        fi
1932
        ;;
1933
    gui)
1934
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1935
            CFG_GUI="yes"
1936
        else
1937
            if [ "$VAL" = "no" ]; then
1938
                CFG_GUI="no"
1939
            else
1940
                UNKNOWN_OPT=yes
1941
            fi
1942
        fi
1943
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1944
    qdbus|dbus)
1945
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ]; then
1946
            CFG_DBUS="$VAL"
1947
	elif [ "$VAL" = "runtime" ]; then
1948
	    CFG_DBUS="yes"
1949
        else
1950
            UNKNOWN_OPT=yes
1951
        fi
1952
        ;;
1953
    dbus-linked)
1954
        if [ "$VAL" = "yes" ]; then
1955
	    CFG_DBUS="linked"
1956
	else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
1957
            UNKNOWN_OPT=yes
1958
        fi
1959
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
1960
    nis)
1961
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1962
            CFG_NIS="$VAL"
1963
        else
1964
            UNKNOWN_OPT=yes
1965
        fi
1966
        ;;
1967
    largefile)
1968
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1969
            CFG_LARGEFILE="$VAL"
1970
        else
1971
            UNKNOWN_OPT=yes
1972
        fi
1973
        ;;
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
1974
    openssl)
1975
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1976
            CFG_OPENSSL="$VAL"
1977
        else
1978
            UNKNOWN_OPT=yes
1979
        fi
1980
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1981
    openssl-linked)
1982
        if [ "$VAL" = "yes" ]; then
1983
            CFG_OPENSSL="linked"
1984
        else
1985
            UNKNOWN_OPT=yes
1986
        fi
1987
        ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
1988
    ptmalloc)
1989
        if [ "$VAL" = "yes" ]; then
1990
            CFG_PTMALLOC="yes"
1991
        else
1992
            UNKNOWN_OPT=yes
1993
        fi
1994
        ;;
1995
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
1996
    xmlpatterns)
1997
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1998
            CFG_XMLPATTERNS="yes"
1999
        else
2000
            if [ "$VAL" = "no" ]; then
2001
                CFG_XMLPATTERNS="no"
2002
            else
2003
                UNKNOWN_OPT=yes
2004
            fi
2005
        fi
2006
        ;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
2007
    script)
2008
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
2009
            CFG_SCRIPT="yes"
2010
        else
2011
            if [ "$VAL" = "no" ]; then
2012
                CFG_SCRIPT="no"
2013
            else
2014
                UNKNOWN_OPT=yes
2015
            fi
2016
        fi
2017
        ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
2018
    scripttools)
2019
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
2020
            CFG_SCRIPTTOOLS="yes"
2021
        else
2022
            if [ "$VAL" = "no" ]; then
2023
                CFG_SCRIPTTOOLS="no"
2024
            else
2025
                UNKNOWN_OPT=yes
2026
            fi
2027
        fi
2028
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2029
    svg)
2030
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
2031
            CFG_SVG="yes"
2032
        else
2033
            if [ "$VAL" = "no" ]; then
2034
                CFG_SVG="no"
2035
            else
2036
                UNKNOWN_OPT=yes
2037
            fi
2038
        fi
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
2039
        ;;
2040
    declarative)
2041
        if [ "$VAL" = "yes" ]; then
2042
            CFG_DECLARATIVE="yes"
2043
        else
2044
            if [ "$VAL" = "no" ]; then
2045
                CFG_DECLARATIVE="no"
2046
            else
2047
                UNKNOWN_OPT=yes
2048
            fi
2049
        fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2050
	;;
2051
    webkit)
2052
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
2053
            CFG_WEBKIT="yes"
2054
        else
2055
            if [ "$VAL" = "no" ]; then
2056
                CFG_WEBKIT="no"
2057
            else
2058
                UNKNOWN_OPT=yes
2059
            fi
2060
        fi
2061
        ;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
2062
    javascript-jit)
2063
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then 
2064
            CFG_JAVASCRIPTCORE_JIT="$VAL"
2065
        else
2066
            UNKNOWN_OPT=yes
2067
        fi
2068
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
2069
    confirm-license)
2070
        if [ "$VAL" = "yes" ]; then
2071
            OPT_CONFIRM_LICENSE="$VAL"
2072
        else
2073
            UNKNOWN_OPT=yes
2074
        fi
2075
        ;;
2076
    h|help)
2077
        if [ "$VAL" = "yes" ]; then
2078
            OPT_HELP="$VAL"
2079
        else
2080
            UNKNOWN_OPT=yes
2081
        fi
2082
        ;;
2083
    sql-*|gfx-*|decoration-*|kbd-*|mouse-*)
2084
        # if Qt style options were used, $VAL can be "no", "qt", or "plugin"
2085
        # if autoconf style options were used, $VAL can be "yes" or "no"
2086
        [ "$VAL" = "yes" ] && VAL=qt
2087
        # now $VAL should be "no", "qt", or "plugin"... double-check
2088
        if [ "$VAL" != "no" ] && [ "$VAL" != "qt" ] && [ "$VAL" != "plugin" ]; then
2089
            UNKNOWN_OPT=yes
2090
        fi
2091
        # now $VAL is "no", "qt", or "plugin"
2092
        OPT="$VAL"
2093
        VAL=`echo $VAR | sed "s,^[^-]*-\([^-]*\).*,\1,"`
2094
        VAR=`echo $VAR | sed "s,^\([^-]*\).*,\1,"`
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
2095
2096
        # Grab the available values
2097
        case "$VAR" in
2098
        sql)
2099
            avail="$CFG_SQL_AVAILABLE"
2100
            ;;
2101
        gfx)
2102
            avail="$CFG_GFX_AVAILABLE"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2103
	    if [ "$OPT" = "plugin" ]; then
2104
		avail="$CFG_GFX_PLUGIN_AVAILABLE"
2105
	    fi
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
2106
            ;;
2107
        decoration)
2108
            avail="$CFG_DECORATION_AVAILABLE"
2109
	    if [ "$OPT" = "plugin" ]; then
2110
		avail="$CFG_DECORATION_PLUGIN_AVAILABLE"
2111
	    fi
2112
            ;;
2113
        kbd)
2114
            avail="$CFG_KBD_AVAILABLE"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2115
	    if [ "$OPT" = "plugin" ]; then
2116
		avail="$CFG_KBD_PLUGIN_AVAILABLE"
2117
	    fi
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
2118
            ;;
2119
        mouse)
2120
            avail="$CFG_MOUSE_AVAILABLE"
2121
	    if [ "$OPT" = "plugin" ]; then
2122
		avail="$CFG_MOUSE_PLUGIN_AVAILABLE"
2123
	    fi
2124
            ;;
2125
        *)
2126
            avail=""
2127
            echo "BUG: Unhandled type $VAR used in $CURRENT_OPT"
2128
            ;;
2129
        esac
2130
2131
        # Check that that user's value is available.
2132
        found=no
2133
        for d in $avail; do
2134
            if [ "$VAL" = "$d" ]; then
2135
                found=yes
2136
                break
2137
            fi
2138
        done
2139
        [ "$found" = yes ] || ERROR=yes
2140
2141
        if [ "$VAR" = "sql" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2142
            # set the CFG_SQL_driver
2143
            eval "CFG_SQL_$VAL=\$OPT"
2144
            continue
1 by Adam Conrad
Import upstream version 4.0.0
2145
        fi
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
2146
1 by Adam Conrad
Import upstream version 4.0.0
2147
        if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then
2148
            if [ "$OPT" = "plugin" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2149
                [ "$VAR" = "decoration" ] && QMakeVar del "${VAR}s" "$VAL"
1 by Adam Conrad
Import upstream version 4.0.0
2150
                [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"` && CFG_DECORATION_PLUGIN="$CFG_DECORATION_PLUGIN ${VAL}"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2151
                [ "$VAR" = "kbd" ] && QMakeVar del "${VAR}s" "$VAL"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
2152
                [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"` && CFG_KBD_PLUGIN="$CFG_KBD_PLUGIN ${VAL}"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2153
                [ "$VAR" = "mouse" ] && QMakeVar del "${VAR}s" "$VAL"
2154
                [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_MOUSE_PLUGIN="$CFG_MOUSE_PLUGIN ${VAL}"
2155
                [ "$VAR" = "gfx" ] && QMakeVar del "${VAR}s" "$VAL"
2156
                [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"` && CFG_GFX_PLUGIN="${CFG_GFX_PLUGIN} ${VAL}"
1 by Adam Conrad
Import upstream version 4.0.0
2157
                VAR="${VAR}-${OPT}"
2158
            else
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
2159
                if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "decoration" ] || [ "$VAR" = "mouse" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
2160
                    [ "$VAR" = "gfx" ] && CFG_GFX_ON="$CFG_GFX_ON $VAL"
2161
                    [ "$VAR" = "kbd" ] && CFG_KBD_ON="$CFG_KBD_ON $VAL"
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
2162
		    [ "$VAR" = "decoration" ] && CFG_DECORATION_ON="$CFG_DECORATION_ON $VAL"
1 by Adam Conrad
Import upstream version 4.0.0
2163
                    [ "$VAR" = "mouse" ] && CFG_MOUSE_ON="$CFG_MOUSE_ON $VAL"
2164
                    VAR="${VAR}-driver"
2165
                fi
2166
            fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2167
	    QMakeVar add "${VAR}s" "${VAL}"
1 by Adam Conrad
Import upstream version 4.0.0
2168
        elif [ "$OPT" = "no" ]; then
2169
            PLUG_VAR="${VAR}-plugin"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2170
            if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "mouse" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
2171
                IN_VAR="${VAR}-driver"
2172
            else
2173
                IN_VAR="${VAR}"
2174
            fi
2175
            [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"`
2176
            [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"`
2177
            [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"`
2178
            [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2179
	    QMakeVar del "${IN_VAR}s" "$VAL"
2180
	    QMakeVar del "${PLUG_VAR}s" "$VAL"
1 by Adam Conrad
Import upstream version 4.0.0
2181
        fi
2182
        if [ "$ERROR" = "yes" ]; then
2183
           echo "$CURRENT_OPT: unknown argument"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2184
           OPT_HELP=yes
1 by Adam Conrad
Import upstream version 4.0.0
2185
        fi
2186
        ;;
2187
    v|verbose)
2188
        if [ "$VAL" = "yes" ]; then
2189
            if [ "$OPT_VERBOSE" = "$VAL" ]; then            # takes two verboses to turn on qmake debugs
2190
                QMAKE_SWITCHES="$QMAKE_SWITCHES -d"
2191
            else
2192
                OPT_VERBOSE=yes
2193
            fi
2194
        elif [ "$VAL" = "no" ]; then
2195
            if [ "$OPT_VERBOSE" = "$VAL" ] && echo "$QMAKE_SWITCHES" | grep ' -d' >/dev/null 2>&1; then
2196
                QMAKE_SWITCHES=`echo $QMAKE_SWITCHES | sed "s, -d,,"`
2197
            else
2198
                OPT_VERBOSE=no
2199
            fi
2200
        else
2201
            UNKNOWN_OPT=yes
2202
        fi
2203
        ;;
2204
    fast)
2205
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2206
            OPT_FAST="$VAL"
2207
        else
2208
            UNKNOWN_OPT=yes
2209
        fi
2210
        ;;
2211
    rpath)
2212
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2213
            CFG_RPATH="$VAL"
2214
        else
2215
            UNKNOWN_OPT=yes
2216
        fi
2217
        ;;
2218
    add_define)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2219
        D_FLAGS="$D_FLAGS \"$VAL\""
1 by Adam Conrad
Import upstream version 4.0.0
2220
        ;;
2221
    add_ipath)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2222
        I_FLAGS="$I_FLAGS -I\"${VAL}\""
1 by Adam Conrad
Import upstream version 4.0.0
2223
        ;;
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
2224
    add_isystempath)
2225
        I_FLAGS="$I_FLAGS -isystem \"${VAL}\""
2226
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
2227
    add_lpath)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2228
        L_FLAGS="$L_FLAGS -L\"${VAL}\""
1 by Adam Conrad
Import upstream version 4.0.0
2229
        ;;
2230
    add_rpath)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2231
        RPATH_FLAGS="$RPATH_FLAGS \"${VAL}\""
1 by Adam Conrad
Import upstream version 4.0.0
2232
        ;;
2233
    add_link)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2234
        l_FLAGS="$l_FLAGS -l\"${VAL}\""
1 by Adam Conrad
Import upstream version 4.0.0
2235
        ;;
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
2236
    add_fpath)
2237
        if [ "$PLATFORM_MAC" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2238
            L_FLAGS="$L_FLAGS -F\"${VAL}\""
2239
            I_FLAGS="$I_FLAGS -F\"${VAL}\""
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
2240
        else
2241
            UNKNOWN_OPT=yes
2242
        fi
2243
        ;;
2244
    add_framework)
2245
        if [ "$PLATFORM_MAC" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2246
            l_FLAGS="$l_FLAGS -framework \"${VAL}\""
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
2247
        else
2248
            UNKNOWN_OPT=yes
2249
        fi
2250
        ;;
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2251
    silent)
2252
        CFG_SILENT="$VAL"
2253
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2254
    phonon)
2255
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2256
            CFG_PHONON="$VAL"
2257
        else
2258
            UNKNOWN_OPT=yes
2259
        fi
2260
        ;;
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
2261
    phonon-backend)
2262
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2263
            CFG_PHONON_BACKEND="$VAL"
2264
        else
2265
            UNKNOWN_OPT=yes
2266
        fi
2267
        ;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
2268
    multimedia)
2269
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2270
            CFG_MULTIMEDIA="$VAL"
2271
        else
2272
            UNKNOWN_OPT=yes
2273
        fi
2274
        ;;
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
2275
    audio-backend)
2276
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2277
            CFG_AUDIO_BACKEND="$VAL"
2278
        else
2279
            UNKNOWN_OPT=yes
2280
        fi
2281
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
2282
    *)
2283
        UNKNOWN_OPT=yes
2284
        ;;
2285
    esac
2286
    if [ "$UNKNOWN_OPT" = "yes" ]; then
2287
        echo "${CURRENT_OPT}: invalid command-line switch"
2288
        OPT_HELP=yes
2289
        ERROR=yes
2290
    fi
2291
done
2292
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2293
if [ "$CFG_QCONFIG" != "full" ] && [ "$CFG_QT3SUPPORT" = "yes" ]; then
2294
    echo "Warning: '-qconfig $CFG_QCONFIG' will disable the qt3support library."
2295
    CFG_QT3SUPPORT="no"
2296
fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
2297
if [ "$CFG_GUI" = "no" ]; then
2298
    echo "Warning: -no-gui will disable the qt3support library."
2299
    CFG_QT3SUPPORT="no"
2300
fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2301
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
2302
# update QT_CONFIG to show our current predefined configuration
2303
case "$CFG_QCONFIG" in
2304
minimal|small|medium|large|full)
2305
    # these are a sequence of increasing functionality
2306
    for c in minimal small medium large full; do
2307
        QT_CONFIG="$QT_CONFIG $c-config"
2308
        [ "$CFG_QCONFIG" = $c ] && break
2309
    done
2310
    ;;
2311
*)
2312
    # not known to be sufficient for anything
1.1.32 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100706
2313
    if [ '!' -f "$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" ] && [ '!' -f `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
2314
        echo >&2 "Error: configuration file not found:"
2315
        echo >&2 "  $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h"
1.1.32 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100706
2316
        echo >&2 "  or"
2317
        echo >&2 "  `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"`"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
2318
        OPT_HELP=yes
2319
    fi
2320
esac
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2321
1 by Adam Conrad
Import upstream version 4.0.0
2322
#-------------------------------------------------------------------------------
2323
# build tree initialization
2324
#-------------------------------------------------------------------------------
2325
1.1.1 by Matthias Klose
Import upstream version 4.0.1
2326
# where to find which..
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2327
unixtests="$relpath/config.tests/unix"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
2328
mactests="$relpath/config.tests/mac"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
2329
symbiantests="$relpath/config.tests/symbian"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2330
WHICH="$unixtests/which.test"
2331
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
2332
PERL=`$WHICH perl 2>/dev/null`
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2333
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2334
# find out which awk we want to use, prefer gawk, then nawk, then regular awk
2335
AWK=
2336
for e in gawk nawk awk; do
2337
    if "$WHICH" $e >/dev/null 2>&1 && ( $e -f /dev/null /dev/null ) >/dev/null 2>&1; then
2338
        AWK=$e
2339
        break
2340
    fi
2341
done
1 by Adam Conrad
Import upstream version 4.0.0
2342
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
2343
# find perl
2344
PERL="/usr/bin/perl"
2345
if "$WHICH" perl >/dev/null 2>&1 && ( perl /dev/null ) >/dev/null 2>&1; then
2346
    PERL=`$WHICH perl`
2347
fi
2348
1 by Adam Conrad
Import upstream version 4.0.0
2349
### skip this if the user just needs help...
2350
if [ "$OPT_HELP" != "yes" ]; then
2351
2352
# is this a shadow build?
2353
if [ "$OPT_SHADOW" = "maybe" ]; then
2354
    OPT_SHADOW=no
2355
    if [ "$relpath" != "$outpath" ] && [ '!' -f "$outpath/configure" ]; then
2356
        if [ -h "$outpath" ]; then
2357
            [ "$relpath" -ef "$outpath" ] || OPT_SHADOW=yes
2358
        else
2359
            OPT_SHADOW=yes
2360
        fi
2361
    fi
2362
fi
1.1.1 by Matthias Klose
Import upstream version 4.0.1
2363
if [ "$OPT_SHADOW" = "yes" ]; then
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
2364
    if [ -f "$relpath/.qmake.cache" -o -f "$relpath/src/corelib/global/qconfig.h" -o -f "$relpath/src/corelib/global/qconfig.cpp" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2365
        echo >&2 "You cannot make a shadow build from a source tree containing a previous build."
2366
        echo >&2 "Cannot proceed."
1.1.1 by Matthias Klose
Import upstream version 4.0.1
2367
        exit 1
2368
    fi
2369
    [ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
1 by Adam Conrad
Import upstream version 4.0.0
2370
fi
2371
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2372
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2373
    echo
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2374
    echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
2375
    echo "Qt can be built in release mode with separate debug information, so"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2376
    echo "-debug-and-release is not necessary anymore"
2377
    echo
2378
fi
2379
1.1.1 by Matthias Klose
Import upstream version 4.0.1
2380
# detect build style
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
2381
if [ "$CFG_DEBUG" = "auto" ]; then
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
2382
    if [ "$PLATFORM_MAC" = "yes" -o "$XPLATFORM_MINGW" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2383
        CFG_DEBUG_RELEASE=yes
2384
        CFG_DEBUG=yes
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
2385
    elif [ "$CFG_DEV" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2386
        CFG_DEBUG_RELEASE=no
2387
        CFG_DEBUG=yes
2388
    else
2389
        CFG_DEBUG_RELEASE=no
2390
        CFG_DEBUG=no
2391
    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
2392
fi
2393
if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
2394
    QMAKE_CONFIG="$QMAKE_CONFIG build_all"
2395
fi
2396
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2397
if [ "$CFG_SILENT" = "yes" ]; then
2398
    QMAKE_CONFIG="$QMAKE_CONFIG silent"
2399
fi
2400
1 by Adam Conrad
Import upstream version 4.0.0
2401
# if the source tree is different from the build tree,
2402
# symlink or copy part of the sources
2403
if [ "$OPT_SHADOW" = "yes" ]; then
2404
    echo "Preparing build tree..."
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
2405
2406
    if [ -z "$PERL" ]; then
2407
        echo
2408
        echo "You need perl in your PATH to make a shadow build."
2409
        echo "Cannot proceed."
2410
        exit 1
2411
    fi
2412
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2413
    [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
1 by Adam Conrad
Import upstream version 4.0.0
2414
2415
    # symlink the qmake directory
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2416
    find "$relpath/qmake" | while read a; do
2417
        my_a=`echo "$a" | sed "s,^${relpath}/,${outpath}/,"`
2418
        if [ '!' -f "$my_a" ]; then
2419
            if [ -d "$a" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
2420
                # directories are created...
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2421
                mkdir -p "$my_a"
1 by Adam Conrad
Import upstream version 4.0.0
2422
            else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2423
                a_dir=`dirname "$my_a"`
2424
                [ -d "$a_dir" ] || mkdir -p "$a_dir"
1 by Adam Conrad
Import upstream version 4.0.0
2425
                # ... and files are symlinked
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2426
                case `basename "$a"` in
1 by Adam Conrad
Import upstream version 4.0.0
2427
                *.o|*.d|GNUmakefile*|qmake)
2428
                    ;;
2429
                *)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2430
                    rm -f "$my_a"
2431
                    ln -s "$a" "$my_a"
1 by Adam Conrad
Import upstream version 4.0.0
2432
                    ;;
2433
                esac
2434
            fi
2435
        fi
2436
    done
2437
2438
    # make a syncqt script that can be used in the shadow
2439
    rm -f "$outpath/bin/syncqt"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
2440
    if [ -x "$relpath/bin/syncqt" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
2441
        mkdir -p "$outpath/bin"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2442
        echo "#!/bin/sh" >"$outpath/bin/syncqt"
2443
        echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/syncqt"
1.1.29 by Alessandro Ghersi
Import upstream version 4.6.2
2444
        echo "perl \"$relpath/bin/syncqt\" -outdir \"$outpath\" \"\$@\"" >>"$outpath/bin/syncqt"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2445
        chmod 755 "$outpath/bin/syncqt"
1 by Adam Conrad
Import upstream version 4.0.0
2446
    fi
2447
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
2448
    for i in elf2e32_qtwrapper createpackage patch_capabilities; do
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
2449
        rm -f "$outpath/bin/$i"
2450
        if [ -x "$relpath/bin/$i" ]; then
2451
            mkdir -p "$outpath/bin"
2452
            echo "#!/bin/sh" >"$outpath/bin/$i"
2453
            echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/$i"
2454
            echo "\"$relpath/bin/$i\" \"\$@\"" >>"$outpath/bin/$i"
2455
            chmod 755 "$outpath/bin/$i"
2456
        fi
2457
    done
2458
1 by Adam Conrad
Import upstream version 4.0.0
2459
    # symlink the mkspecs directory
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2460
    mkdir -p "$outpath/mkspecs"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
2461
    rm -rf "$outpath"/mkspecs/*
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2462
    ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
2463
    rm -f "$outpath/mkspecs/default"
1 by Adam Conrad
Import upstream version 4.0.0
2464
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
2465
    ShadowMkspecs()
2466
    {
2467
        rm -rf "$outpath/mkspecs/$1"
2468
        if [ "$UNAME_SYSTEM" = "Linux" ]; then
2469
            # This works with GNU coreutils, and is needed for ScratchBox
2470
            cp -rs "$relpath/mkspecs/$1" "$outpath/mkspecs/$1"
2471
        else
2472
            # A simple "cp -rs" doesn't work on Mac. :(
2473
            find "$relpath/mkspecs/$1" -type d | sed "s,^$relpath,$outpath," | xargs mkdir -p
2474
            find "$relpath/mkspecs/$1" -type f | sed "s,^$relpath/,," | xargs -n 1 -I % ln -s "$relpath/%" "$outpath/%"
2475
        fi
2476
    }
2477
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
2478
    # Special case for mkspecs/features directory.
2479
    # To be able to place .prf files into a shadow build directory,
2480
    # we're creating links for files only. The directory structure is reproduced.
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
2481
    ShadowMkspecs features
2482
2483
    # The modules dir is special, too.
2484
    ShadowMkspecs modules
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
2485
1 by Adam Conrad
Import upstream version 4.0.0
2486
    # symlink the doc directory
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2487
    rm -rf "$outpath/doc"
2488
    ln -s "$relpath/doc" "$outpath/doc"
1 by Adam Conrad
Import upstream version 4.0.0
2489
2490
    # make sure q3porting.xml can be found
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2491
    mkdir -p "$outpath/tools/porting/src"
2492
    rm -f "$outpath/tools/porting/src/q3porting.xml"
2493
    ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src"
2494
fi
2495
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2496
# symlink fonts to be able to run application from build directory
1.1.29 by Alessandro Ghersi
Import upstream version 4.6.2
2497
if [ "$PLATFORM_QWS" = "yes" ] && [ ! -d "${outpath}/lib/fonts" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2498
    if [ "$PLATFORM" = "$XPLATFORM" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2499
        mkdir -p "${outpath}/lib"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
2500
        ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2501
    fi
2502
fi
2503
1 by Adam Conrad
Import upstream version 4.0.0
2504
if [ "$OPT_FAST" = "auto" ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
2505
   if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
2506
       OPT_FAST=yes
2507
   else
2508
       OPT_FAST=no
2509
   fi
2510
fi
2511
2512
# find a make command
2513
if [ -z "$MAKE" ]; then
2514
    MAKE=
2515
    for mk in gmake make; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2516
        if "$WHICH" $mk >/dev/null 2>&1; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
2517
            MAKE=`"$WHICH" $mk`
1 by Adam Conrad
Import upstream version 4.0.0
2518
            break
2519
        fi
2520
    done
2521
    if [ -z "$MAKE" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2522
        echo >&2 "You don't seem to have 'make' or 'gmake' in your PATH."
2523
        echo >&2 "Cannot proceed."
1 by Adam Conrad
Import upstream version 4.0.0
2524
        exit 1
2525
    fi
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
2526
    # export MAKE, we need it later in the config.tests
2527
    export MAKE
1 by Adam Conrad
Import upstream version 4.0.0
2528
fi
2529
2530
fi ### help
2531
2532
#-------------------------------------------------------------------------------
2533
# auto-detect all that hasn't been specified in the arguments
2534
#-------------------------------------------------------------------------------
2535
2536
[ "$PLATFORM_QWS" = "yes" -a "$CFG_EMBEDDED" = "no" ] && CFG_EMBEDDED=auto
2537
if [ "$CFG_EMBEDDED" != "no" ]; then
2538
    case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2539
    Darwin:*)
2540
        [ -z "$PLATFORM" ] && PLATFORM=qws/macx-generic-g++
2541
        if [ -z "$XPLATFORM" ]; then
2542
            [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2543
            XPLATFORM="qws/macx-$CFG_EMBEDDED-g++"
2544
        fi
2545
        ;;
2546
    FreeBSD:*)
2547
        [ -z "$PLATFORM" ] && PLATFORM=qws/freebsd-generic-g++
2548
        if [ -z "$XPLATFORM" ]; then
2549
            [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2550
            XPLATFORM="qws/freebsd-$CFG_EMBEDDED-g++"
2551
        fi
2552
        ;;
2553
    SunOS:5*)
2554
        [ -z "$PLATFORM" ] && PLATFORM=qws/solaris-generic-g++
2555
        if [ -z "$XPLATFORM" ]; then
2556
            [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2557
            XPLATFORM="qws/solaris-$CFG_EMBEDDED-g++"
2558
        fi
2559
        ;;
2560
    Linux:*)
2561
        if [ -z "$PLATFORM" ]; then
2562
            case "$UNAME_MACHINE" in
2563
            *86)
2564
                PLATFORM=qws/linux-x86-g++
2565
                ;;
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2566
            *86_64)
2567
                PLATFORM=qws/linux-x86_64-g++
2568
                ;;
1 by Adam Conrad
Import upstream version 4.0.0
2569
            *)
2570
                PLATFORM=qws/linux-generic-g++
2571
                ;;
2572
            esac
2573
        fi
2574
        if [ -z "$XPLATFORM" ]; then
2575
            if [ "$CFG_EMBEDDED" = "auto" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2576
                if [ -n "$CFG_ARCH" ]; then
2577
                    CFG_EMBEDDED=$CFG_ARCH
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2578
                else
2579
                    case "$UNAME_MACHINE" in
2580
                    *86)
2581
                        CFG_EMBEDDED=x86
2582
                        ;;
2583
                    *86_64)
2584
                        CFG_EMBEDDED=x86_64
2585
                        ;;
2586
                    *)
2587
                        CFG_EMBEDDED=generic
2588
                        ;;
2589
                    esac
2590
                fi
1 by Adam Conrad
Import upstream version 4.0.0
2591
            fi
2592
            XPLATFORM="qws/linux-$CFG_EMBEDDED-g++"
2593
        fi
2594
        ;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
2595
    QNX:*)
2596
        [ -z "$PLATFORM" ] && PLATFORM=unsupported/qws/qnx-generic-g++
2597
        if [ -z "$XPLATFORM" ]; then
2598
            [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2599
            XPLATFORM="unsupported/qws/qnx-$CFG_EMBEDDED-g++"
2600
        fi
2601
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2602
    CYGWIN*:*)
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
2603
	if [ -z "$XPLATFORM" ]; then
2604
		CFG_EMBEDDED=x86
2605
	fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2606
	;;
1 by Adam Conrad
Import upstream version 4.0.0
2607
    *)
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2608
        echo "Qt for Embedded Linux is not supported on this platform. Disabling."
1 by Adam Conrad
Import upstream version 4.0.0
2609
        CFG_EMBEDDED=no
2610
        PLATFORM_QWS=no
2611
        ;;
2612
    esac
2613
fi
2614
if [ -z "$PLATFORM" ]; then
2615
    PLATFORM_NOTES=
2616
    case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2617
     Darwin:*)
2618
        if [ "$PLATFORM_MAC" = "yes" ]; then
2619
          PLATFORM=macx-g++
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2620
        # PLATFORM=macx-xcode
1 by Adam Conrad
Import upstream version 4.0.0
2621
        else
2622
          PLATFORM=darwin-g++
2623
        fi
2624
        ;;
2625
     AIX:*)
2626
        #PLATFORM=aix-g++
2627
        #PLATFORM=aix-g++-64
2628
        PLATFORM=aix-xlc
2629
        #PLATFORM=aix-xlc-64
2630
        PLATFORM_NOTES="
2631
            - Also available for AIX: aix-g++ aix-g++-64 aix-xlc-64
2632
        "
2633
        ;;
2634
     GNU:*)
2635
        PLATFORM=hurd-g++
2636
        ;;
2637
     dgux:*)
2638
        PLATFORM=dgux-g++
2639
        ;;
2640
#     DYNIX/ptx:4*)
2641
#       PLATFORM=dynix-g++
2642
#       ;;
2643
     ULTRIX:*)
2644
        PLATFORM=ultrix-g++
2645
        ;;
2646
     FreeBSD:*)
2647
        PLATFORM=freebsd-g++
2648
        PLATFORM_NOTES="
2649
            - Also available for FreeBSD: freebsd-icc
2650
        "
2651
        ;;
2652
     OpenBSD:*)
2653
        PLATFORM=openbsd-g++
2654
        ;;
2655
     NetBSD:*)
2656
        PLATFORM=netbsd-g++
2657
        ;;
2658
     BSD/OS:*|BSD/386:*)
2659
        PLATFORM=bsdi-g++
2660
        ;;
2661
     IRIX*:*)
2662
        #PLATFORM=irix-g++
2663
        PLATFORM=irix-cc
2664
        #PLATFORM=irix-cc-64
2665
        PLATFORM_NOTES="
2666
            - Also available for IRIX: irix-g++ irix-cc-64
2667
        "
2668
        ;;
2669
     HP-UX:*)
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
2670
        case "$UNAME_MACHINE" in
2671
            ia64)
2672
                #PLATFORM=hpuxi-acc-32
2673
                PLATFORM=hpuxi-acc-64
2674
                PLATFORM_NOTES="
2675
                    - Also available for HP-UXi: hpuxi-acc-32
2676
                "
2677
            ;;
2678
            *)
2679
                #PLATFORM=hpux-g++
2680
                PLATFORM=hpux-acc
2681
                #PLATFORM=hpux-acc-64
2682
                #PLATFORM=hpux-cc
2683
                #PLATFORM=hpux-acc-o64
2684
                PLATFORM_NOTES="
2685
                    - Also available for HP-UX: hpux-g++ hpux-acc-64 hpux-acc-o64
2686
                "
2687
            ;;
2688
        esac
1 by Adam Conrad
Import upstream version 4.0.0
2689
        ;;
2690
     OSF1:*)
2691
        #PLATFORM=tru64-g++
2692
        PLATFORM=tru64-cxx
2693
        PLATFORM_NOTES="
2694
            - Also available for Tru64: tru64-g++
2695
        "
2696
        ;;
2697
     Linux:*)
2698
        case "$UNAME_MACHINE" in
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
2699
            x86_64|s390x|ppc64)
1 by Adam Conrad
Import upstream version 4.0.0
2700
                PLATFORM=linux-g++-64
2701
                ;;
2702
            *)
2703
                PLATFORM=linux-g++
2704
                ;;
2705
        esac
2706
        PLATFORM_NOTES="
2707
            - Also available for Linux: linux-kcc linux-icc linux-cxx
2708
        "
2709
        ;;
2710
     SunOS:5*)
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
2711
        if [ "$XPLATFORM_MINGW" = "yes" ]; then
2712
            PLATFORM="solaris-g++"
2713
        else
2714
            #PLATFORM=solaris-g++
2715
            PLATFORM=solaris-cc
2716
            #PLATFORM=solaris-cc64
2717
        fi
1 by Adam Conrad
Import upstream version 4.0.0
2718
        PLATFORM_NOTES="
2719
            - Also available for Solaris: solaris-g++ solaris-cc-64
2720
        "
2721
        ;;
2722
     ReliantUNIX-*:*|SINIX-*:*)
2723
        PLATFORM=reliant-cds
2724
        #PLATFORM=reliant-cds-64
2725
        PLATFORM_NOTES="
2726
            - Also available for Reliant UNIX: reliant-cds-64
2727
        "
2728
        ;;
2729
     CYGWIN*:*)
2730
        PLATFORM=cygwin-g++
2731
        ;;
2732
     LynxOS*:*)
2733
        PLATFORM=lynxos-g++
2734
        ;;
2735
     OpenUNIX:*)
2736
        #PLATFORM=unixware-g++
2737
        PLATFORM=unixware-cc
2738
        PLATFORM_NOTES="
2739
            - Also available for OpenUNIX: unixware-g++
2740
        "
2741
        ;;
2742
     UnixWare:*)
2743
        #PLATFORM=unixware-g++
2744
        PLATFORM=unixware-cc
2745
        PLATFORM_NOTES="
2746
            - Also available for UnixWare: unixware-g++
2747
        "
2748
        ;;
2749
     SCO_SV:*)
2750
        #PLATFORM=sco-g++
2751
        PLATFORM=sco-cc
2752
        PLATFORM_NOTES="
2753
            - Also available for SCO OpenServer: sco-g++
2754
        "
2755
        ;;
2756
     UNIX_SV:*)
2757
        PLATFORM=unixware-g++
2758
        ;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
2759
     QNX:*)
2760
        PLATFORM=unsupported/qnx-g++
2761
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
2762
     *)
2763
        if [ "$OPT_HELP" != "yes" ]; then
2764
            echo
2765
            for p in $PLATFORMS; do
2766
                echo "    $relconf $* -platform $p"
2767
            done
2768
            echo >&2
2769
            echo "   The build script does not currently recognize all" >&2
2770
            echo "   platforms supported by Qt." >&2
2771
            echo "   Rerun this script with a -platform option listed to" >&2
2772
            echo "   set the system/compiler combination you use." >&2
2773
            echo >&2
2774
            exit 2
2775
        fi
2776
    esac
2777
fi
2778
2779
if [ "$PLATFORM_QWS" = "yes" ]; then
2780
    CFG_SM=no
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2781
    PLATFORMS=`find "$relpath/mkspecs/qws" | sed "s,$relpath/mkspecs/qws/,,"`
1 by Adam Conrad
Import upstream version 4.0.0
2782
else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2783
    PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mkspecs/qws/,,"`
1 by Adam Conrad
Import upstream version 4.0.0
2784
fi
2785
2786
[ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
2787
2788
case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
2789
1 by Adam Conrad
Import upstream version 4.0.0
2790
if [ -d "$PLATFORM" ]; then
2791
  QMAKESPEC="$PLATFORM"
2792
else
2793
  QMAKESPEC="$relpath/mkspecs/${PLATFORM}"
2794
fi
2795
if [ -d "$XPLATFORM" ]; then
2796
  XQMAKESPEC="$XPLATFORM"
2797
else
2798
  XQMAKESPEC="$relpath/mkspecs/${XPLATFORM}"
2799
fi
2800
if [ "$PLATFORM" != "$XPLATFORM" ]; then
1.1.11 by Jonathan Riddell
Import upstream version 4.3.1
2801
    QT_CROSS_COMPILE=yes
1 by Adam Conrad
Import upstream version 4.0.0
2802
    QMAKE_CONFIG="$QMAKE_CONFIG cross_compile"
2803
fi
2804
2805
if [ "$PLATFORM_MAC" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2806
   if [ `basename $QMAKESPEC` = "macx-xcode" ] || [ `basename $XQMAKESPEC` = "macx-xcode" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
2807
      echo >&2
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2808
      echo "   Platform 'macx-xcode' should not be used when building Qt/Mac." >&2
1 by Adam Conrad
Import upstream version 4.0.0
2809
      echo "   Please build Qt/Mac with 'macx-g++', then if you would like to" >&2
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2810
      echo "   use mac-xcode on your application code it can link to a Qt/Mac" >&2
1 by Adam Conrad
Import upstream version 4.0.0
2811
      echo "   built with 'macx-g++'" >&2
2812
      echo >&2
2813
      exit 2
1.1.1 by Matthias Klose
Import upstream version 4.0.1
2814
    fi
1 by Adam Conrad
Import upstream version 4.0.0
2815
fi
2816
2817
# check specified platforms are supported
2818
if [ '!' -d "$QMAKESPEC" ]; then
2819
    echo
2820
    echo "   The specified system/compiler is not supported:"
2821
    echo
2822
    echo "      $QMAKESPEC"
2823
    echo
2824
    echo "   Please see the README file for a complete list."
2825
    echo
2826
    exit 2
2827
fi
2828
if [ '!' -d "$XQMAKESPEC" ]; then
2829
    echo
2830
    echo "   The specified system/compiler is not supported:"
2831
    echo
2832
    echo "      $XQMAKESPEC"
2833
    echo
2834
    echo "   Please see the README file for a complete list."
2835
    echo
2836
    exit 2
2837
fi
2838
if [ '!' -f "${XQMAKESPEC}/qplatformdefs.h" ]; then
2839
    echo
2840
    echo "   The specified system/compiler port is not complete:"
2841
    echo
2842
    echo "      $XQMAKESPEC/qplatformdefs.h"
2843
    echo
2844
    echo "   Please contact qt-bugs@trolltech.com."
2845
    echo
2846
    exit 2
2847
fi
2848
2849
# now look at the configs and figure out what platform we are config'd for
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2850
[ "$CFG_EMBEDDED" = "no" ] \
2851
  && [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ] \
2852
  && PLATFORM_X11=yes
1 by Adam Conrad
Import upstream version 4.0.0
2853
### echo "$XQMAKESPEC" | grep mkspecs/qws >/dev/null 2>&1 && PLATFORM_QWS=yes
2854
2855
if [ "$UNAME_SYSTEM" = "SunOS" ]; then
2856
    # Solaris 2.5 and 2.6 have libposix4, which was renamed to librt for Solaris 7 and up
2857
    if echo $UNAME_RELEASE | grep "^5\.[5|6]" >/dev/null 2>&1; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2858
        sed -e "s,-lrt,-lposix4," "$XQMAKESPEC/qmake.conf" > "$XQMAKESPEC/qmake.conf.new"
2859
        mv "$XQMAKESPEC/qmake.conf.new" "$XQMAKESPEC/qmake.conf"
1 by Adam Conrad
Import upstream version 4.0.0
2860
    fi
2861
fi
2862
2863
#-------------------------------------------------------------------------------
2864
# determine the system architecture
2865
#-------------------------------------------------------------------------------
2866
if [ "$OPT_VERBOSE" = "yes" ]; then
2867
    echo "Determining system architecture... ($UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE)"
2868
fi
2869
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2870
if [ "$CFG_EMBEDDED" != "no" -a "$CFG_EMBEDDED" != "auto" ] && [ -n "$CFG_ARCH" ]; then
2871
    if [ "$CFG_ARCH" != "$CFG_EMBEDDED" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
2872
        echo ""
2873
        echo "You have specified a target architecture with -embedded and -arch."
2874
        echo "The two architectures you have specified are different, so we can"
2875
        echo "not proceed. Either set both to be the same, or only use -embedded."
2876
        echo ""
2877
        exit 1
2878
    fi
2879
fi
2880
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
2881
if [ "$CFG_RTOS_ENABLED" = "no" ]; then
2882
    case `basename "$XPLATFORM"` in
2883
	qnx-* | vxworks-*)
2884
            echo ""
2885
            echo "You are not licensed for Qt for `basename $XPLATFORM`."
2886
            echo ""
2887
            echo "Please contact qt-info@nokia.com to upgrade your license to"
2888
            echo "include this platform, or install the Qt Open Source Edition"
2889
            echo "if you intend to develop free software."
2890
            exit 1
2891
	    ;;
2892
    esac
2893
fi
2894
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2895
if [ -z "${CFG_HOST_ARCH}" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
2896
    case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
2897
    GNU:*:*)
2898
        CFG_HOST_ARCH=`echo ${UNAME_MACHINE} | sed -e 's,[-/].*$,,'`
2899
        case "$CFG_HOST_ARCH" in
2900
            i?86)
2901
                CFG_HOST_ARCH=i386
2902
                ;;
2903
        esac
2904
        if [ "$OPT_VERBOSE" = "yes" ]; then
2905
            echo "    GNU/Hurd ($CFG_HOST_ARCH)"
2906
        fi
2907
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
2908
    IRIX*:*:*)
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2909
        CFG_HOST_ARCH=`uname -p`
1 by Adam Conrad
Import upstream version 4.0.0
2910
        if [ "$OPT_VERBOSE" = "yes" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2911
            echo "    SGI ($CFG_HOST_ARCH)"
1 by Adam Conrad
Import upstream version 4.0.0
2912
        fi
2913
        ;;
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2914
    SunOS:5*:*)
2915
        case "$UNAME_MACHINE" in
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
2916
	sun4u*|sun4v*)
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2917
            if [ "$OPT_VERBOSE" = "yes" ]; then
2918
                echo "    Sun SPARC (sparc)"
2919
            fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2920
            CFG_HOST_ARCH=sparc
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2921
            ;;
2922
        i86pc)
2923
	    case "$PLATFORM" in
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
2924
	    *-64*)
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2925
                if [ "$OPT_VERBOSE" = "yes" ]; then
2926
	            echo "    64-bit AMD 80x86 (x86_64)"
2927
                fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2928
                CFG_HOST_ARCH=x86_64
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2929
                ;;
2930
	    *)
2931
                if [ "$OPT_VERBOSE" = "yes" ]; then
2932
	            echo "    32-bit Intel 80x86 (i386)"
2933
                fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2934
                CFG_HOST_ARCH=i386
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2935
                ;;
2936
            esac
2937
        esac
2938
        ;;
2939
    Darwin:*:*)
2940
        case "$UNAME_MACHINE" in
2941
            Power?Macintosh)
2942
                if [ "$OPT_VERBOSE" = "yes" ]; then
2943
                    echo "    32-bit Apple PowerPC (powerpc)"
2944
                fi
2945
                ;;
2946
            x86)
2947
                if [ "$OPT_VERBOSE" = "yes" ]; then
2948
                    echo "    32-bit Intel 80x86 (i386)"
2949
                fi
2950
                ;;
2951
        esac
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2952
        CFG_HOST_ARCH=macosx
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
2953
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
2954
    AIX:*:00????????00)
2955
        if [ "$OPT_VERBOSE" = "yes" ]; then
2956
        echo "    64-bit IBM PowerPC (powerpc)"
2957
        fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2958
        CFG_HOST_ARCH=powerpc
1 by Adam Conrad
Import upstream version 4.0.0
2959
        ;;
2960
    HP-UX:*:9000*)
2961
        if [ "$OPT_VERBOSE" = "yes" ]; then
2962
            echo "    HP PA-RISC (parisc)"
2963
        fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2964
        CFG_HOST_ARCH=parisc
1 by Adam Conrad
Import upstream version 4.0.0
2965
        ;;
2966
    *:*:i?86)
2967
        if [ "$OPT_VERBOSE" = "yes" ]; then
2968
            echo "    32-bit Intel 80x86 (i386)"
2969
        fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2970
        CFG_HOST_ARCH=i386
1 by Adam Conrad
Import upstream version 4.0.0
2971
        ;;
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
2972
    *:*:x86_64|*:*:amd64)
1.1.11 by Jonathan Riddell
Import upstream version 4.3.1
2973
        if [ "$PLATFORM" = "linux-g++-32" -o "$PLATFORM" = "linux-icc-32" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
2974
            if [ "$OPT_VERBOSE" = "yes" ]; then
2975
                echo "    32 bit on 64-bit AMD 80x86 (i386)"
2976
            fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2977
            CFG_HOST_ARCH=i386
1 by Adam Conrad
Import upstream version 4.0.0
2978
        else
2979
            if [ "$OPT_VERBOSE" = "yes" ]; then
2980
                echo "    64-bit AMD 80x86 (x86_64)"
2981
            fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2982
            CFG_HOST_ARCH=x86_64
1 by Adam Conrad
Import upstream version 4.0.0
2983
        fi
2984
        ;;
2985
    *:*:ppc)
2986
        if [ "$OPT_VERBOSE" = "yes" ]; then
2987
            echo "    32-bit PowerPC (powerpc)"
2988
        fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2989
        CFG_HOST_ARCH=powerpc
1 by Adam Conrad
Import upstream version 4.0.0
2990
        ;;
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2991
    *:*:ppc64)
2992
        if [ "$OPT_VERBOSE" = "yes" ]; then
2993
            echo "    64-bit PowerPC (powerpc)"
2994
        fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
2995
        CFG_HOST_ARCH=powerpc
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
2996
        ;;
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
2997
    *:*:s390*)
2998
    	if [ "$OPT_VERBOSE" = "yes" ]; then
2999
    	    echo "    IBM S/390 (s390)"
3000
    	fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3001
    	CFG_HOST_ARCH=s390
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
3002
    	;;
1.1.11 by Jonathan Riddell
Import upstream version 4.3.1
3003
    *:*:arm*)
3004
        if [ "$OPT_VERBOSE" = "yes" ]; then
3005
            echo "    ARM (arm)"
3006
        fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3007
        CFG_HOST_ARCH=arm
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3008
        ;;
3009
    Linux:*:sparc*)
3010
        if [ "$OPT_VERBOSE" = "yes" ]; then
3011
            echo "    Linux on SPARC"
3012
        fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3013
        CFG_HOST_ARCH=sparc
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3014
        ;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3015
    QNX:*:*)
3016
        case "$UNAME_MACHINE" in
3017
        x86pc)
3018
            if [ "$OPT_VERBOSE" = "yes" ]; then
3019
                echo "    QNX on Intel 80x86 (i386)"
3020
            fi
3021
            CFG_HOST_ARCH=i386
3022
            ;;
3023
        esac
3024
        ;;
1 by Adam Conrad
Import upstream version 4.0.0
3025
    *:*:*)
3026
        if [ "$OPT_VERBOSE" = "yes" ]; then
3027
            echo "    Trying '$UNAME_MACHINE'..."
3028
        fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3029
        CFG_HOST_ARCH="$UNAME_MACHINE"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3030
        ;;
3031
    esac
3032
fi
3033
3034
if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3035
    if [ -n "$CFG_ARCH" ]; then
3036
        CFG_EMBEDDED=$CFG_ARCH
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3037
    fi
3038
3039
    case "$CFG_EMBEDDED" in
3040
    x86)
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3041
        CFG_ARCH=i386
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3042
        ;;
3043
    x86_64)
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3044
        CFG_ARCH=x86_64
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3045
        ;;
3046
    ipaq|sharp)
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3047
        CFG_ARCH=arm
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3048
        ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3049
    dm7000)
3050
        CFG_ARCH=powerpc
3051
        ;;
3052
    dm800)
3053
        CFG_ARCH=mips
3054
        ;;
3055
    sh4al)
3056
        CFG_ARCH=sh4a
3057
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3058
    *)
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3059
        CFG_ARCH="$CFG_EMBEDDED"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3060
        ;;
3061
    esac
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
3062
elif [ "$XPLATFORM_MINGW" = "yes" ]; then
3063
    [ -z "$CFG_ARCH" ] && CFG_ARCH="windows"
3064
elif echo "$XPLATFORM" | grep symbian > /dev/null; then
3065
    CFG_ARCH=symbian
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3066
elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
3067
    CFG_ARCH=$CFG_HOST_ARCH
1 by Adam Conrad
Import upstream version 4.0.0
3068
fi
3069
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3070
if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
3071
    if [ "$OPT_VERBOSE" = "yes" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3072
        echo "    '$CFG_ARCH' is supported"
1 by Adam Conrad
Import upstream version 4.0.0
3073
    fi
3074
else
3075
    if [ "$OPT_VERBOSE" = "yes" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3076
        echo "    '$CFG_ARCH' is unsupported, using 'generic'"
1 by Adam Conrad
Import upstream version 4.0.0
3077
    fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3078
    CFG_ARCH=generic
1 by Adam Conrad
Import upstream version 4.0.0
3079
fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3080
if [ "$CFG_HOST_ARCH" != "$CFG_ARCH" ]; then
3081
    if [ -d "$relpath/src/corelib/arch/$CFG_HOST_ARCH" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3082
        if [ "$OPT_VERBOSE" = "yes" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3083
            echo "    '$CFG_HOST_ARCH' is supported"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3084
        fi
3085
    else
3086
        if [ "$OPT_VERBOSE" = "yes" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3087
            echo "    '$CFG_HOST_ARCH' is unsupported, using 'generic'"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3088
        fi
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3089
        CFG_HOST_ARCH=generic
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3090
    fi
3091
fi
1 by Adam Conrad
Import upstream version 4.0.0
3092
3093
if [ "$OPT_VERBOSE" = "yes" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3094
    echo "System architecture: '$CFG_ARCH'"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3095
    if [ "$PLATFORM_QWS" = "yes" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
3096
	echo "Host architecture: '$CFG_HOST_ARCH'"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3097
    fi
1 by Adam Conrad
Import upstream version 4.0.0
3098
fi
3099
3100
#-------------------------------------------------------------------------------
3101
# tests that don't need qmake (must be run before displaying help)
3102
#-------------------------------------------------------------------------------
3103
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3104
if [ -z "$PKG_CONFIG" ]; then
3105
    # See if PKG_CONFIG is set in the mkspec:
3106
    PKG_CONFIG=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%PKG_CONFIG[^_].*=%%p' | tr '\n' ' '`
3107
fi
3108
if [ -z "$PKG_CONFIG" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3109
    PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3110
fi
3111
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3112
# Work out if we can use pkg-config
3113
if [ "$QT_CROSS_COMPILE" = "yes" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3114
    if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3115
        echo >&2 ""
3116
        echo >&2 "You have asked to use pkg-config and are cross-compiling."
3117
        echo >&2 "Please make sure you have a correctly set-up pkg-config"
3118
        echo >&2 "environment!"
3119
        echo >&2 ""
3120
        if [ -z "$PKG_CONFIG_PATH" ]; then
3121
            echo >&2 ""
3122
            echo >&2 "Warning: PKG_CONFIG_PATH has not been set.  This could mean"
3123
            echo >&2 "the host compiler's .pc files will be used. This is probably"
3124
            echo >&2 "not what you want."
3125
            echo >&2 ""
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3126
        elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3127
            echo >&2 ""
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3128
            echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not"
3129
            echo >&2 "been set. This means your toolchain's .pc files must contain"
3130
            echo >&2 "the paths to the toolchain's libraries & headers. If configure"
3131
            echo >&2 "tests are failing, please check these files."
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3132
            echo >&2 ""
3133
        fi
3134
    else
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
3135
        echo >&2 ""
3136
        echo >&2 "You have not explicitly asked to use pkg-config and are cross-compiling."
3137
        echo >&2 "pkg-config will not be used to automatically query cflag/lib parameters for"
3138
        echo >&2 "dependencies"
3139
        echo >&2 ""
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3140
        PKG_CONFIG=""
3141
    fi
3142
fi
3143
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
3144
# process CFG_MAC_ARCHS
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3145
if [ "$PLATFORM_MAC" = "yes" ]; then
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
3146
#   check -arch arguments for validity.
3147
    ALLOWED="x86 ppc x86_64 ppc64 i386"
3148
    # Save the list so we can re-write it using only valid values
3149
    CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS"
3150
    CFG_MAC_ARCHS=
3151
    for i in $CFG_MAC_ARCHS_IN
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3152
    do 
3153
        if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
3154
            echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64";
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3155
            exit 2;
3156
        fi
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
3157
        if [ "$i" = "i386" -o "$i" = "x86" ]; then
3158
            # These are synonymous values
3159
            # CFG_MAC_ARCHS requires x86 while GCC requires i386
3160
            CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3161
            MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch i386"
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
3162
        else
3163
            CFG_MAC_ARCHS="$CFG_MAC_ARCHS $i"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3164
            MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch $i"
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
3165
        fi
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3166
    done
3167
fi
3168
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3169
# pass on $CFG_SDK to the configure tests.
3170
if [ '!' -z "$CFG_SDK" ]; then
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
3171
    MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3172
fi
3173
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
3174
# find the default framework value
3175
if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
3176
    if [ "$CFG_FRAMEWORK" = "auto" ]; then
3177
        CFG_FRAMEWORK="$CFG_SHARED"
3178
    elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
3179
	echo
3180
	echo "WARNING: Using static linking will disable the use of Mac frameworks."
3181
	echo
3182
        CFG_FRAMEWORK="no"
3183
    fi
3184
else
3185
    CFG_FRAMEWORK=no
3186
fi
3187
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3188
QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
3189
TEST_COMPILER="$CXX"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
3190
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3191
[ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
3192
if [ "$XPLATFORM" != "symbian-sbsv2" ]; then
3193
    #for Symbian we don't need this checking
3194
    if [ -z "$TEST_COMPILER" ]; then
3195
        echo "ERROR: Cannot set the compiler for the configuration tests"
3196
        exit 1
3197
    fi
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
3198
fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3199
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
3200
1 by Adam Conrad
Import upstream version 4.0.0
3201
# auto-detect precompiled header support
3202
if [ "$CFG_PRECOMPILE" = "auto" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3203
    if [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
3204
       CFG_PRECOMPILE=no
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3205
    elif "$unixtests/precomp.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
1 by Adam Conrad
Import upstream version 4.0.0
3206
       CFG_PRECOMPILE=no
3207
    else
3208
       CFG_PRECOMPILE=yes
3209
    fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3210
elif [ "$CFG_PRECOMPILE" = "yes" ] && [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
3211
    echo
3212
    echo "WARNING: Using universal binaries disables precompiled headers."
3213
    echo
3214
    CFG_PRECOMPILE=no
1 by Adam Conrad
Import upstream version 4.0.0
3215
fi
3216
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3217
#auto-detect DWARF2 on the mac
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3218
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "auto" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3219
    if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3220
        CFG_MAC_DWARF2=no
3221
    else
3222
        CFG_MAC_DWARF2=yes
3223
    fi
3224
fi
3225
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3226
# auto-detect support for -Xarch on the mac
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3227
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" = "auto" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3228
    if "$mactests/xarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
3229
        CFG_MAC_XARCH=no
3230
    else
3231
        CFG_MAC_XARCH=yes
3232
    fi
3233
fi
3234
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3235
# don't autodetect support for separate debug info on objcopy when
3236
# cross-compiling as lots of toolchains seems to have problems with this
3237
if [ "$QT_CROSS_COMPILE" = "yes" ] && [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
3238
    CFG_SEPARATE_DEBUG_INFO="no"
3239
fi
3240
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3241
# auto-detect support for separate debug info in objcopy
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3242
if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
3243
    TEST_COMPILER_CFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CFLAGS[^_=]*[+*]*=%%p' | tr '\n' ' '`
3244
    TEST_COMPILER_CXXFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CXXFLAGS[^_=]*[+*]*=%%p' | tr '\n' ' '`
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3245
    TEST_OBJCOPY=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_OBJCOPY" | sed "s%.* *= *\(.*\)$%\1%" | tail -1`
3246
    COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
3247
    COMPILER_WITH_FLAGS=`echo "$COMPILER_WITH_FLAGS" | sed -e "s%\\$\\$QMAKE_CFLAGS%$TEST_COMPILER_CFLAGS%g"`
3248
    if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$TEST_OBJCOPY" "$OPT_VERBOSE"; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3249
       CFG_SEPARATE_DEBUG_INFO=no
3250
    else
3251
       case "$PLATFORM" in
3252
       hpux-*)
3253
           # binutils on HP-UX is buggy; default to no.
3254
           CFG_SEPARATE_DEBUG_INFO=no
3255
           ;;
3256
       *)
3257
           CFG_SEPARATE_DEBUG_INFO=yes
3258
           ;;
3259
       esac
3260
    fi
3261
fi
3262
1 by Adam Conrad
Import upstream version 4.0.0
3263
# auto-detect -fvisibility support
3264
if [ "$CFG_REDUCE_EXPORTS" = "auto" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3265
    if "$unixtests/fvisibility.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
1 by Adam Conrad
Import upstream version 4.0.0
3266
       CFG_REDUCE_EXPORTS=no
3267
    else
3268
       CFG_REDUCE_EXPORTS=yes
3269
    fi
3270
fi
3271
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3272
# detect the availability of the -Bsymbolic-functions linker optimization
3273
if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then
3274
    if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
3275
        CFG_REDUCE_RELOCATIONS=no
3276
    else
3277
        CFG_REDUCE_RELOCATIONS=yes
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
3278
    fi
3279
fi
3280
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3281
# auto-detect GNU make support
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3282
if [ "$CFG_USE_GNUMAKE" = "auto" ] && "$MAKE" -v | grep "GNU Make" >/dev/null 2>&1; then
1 by Adam Conrad
Import upstream version 4.0.0
3283
   CFG_USE_GNUMAKE=yes
3284
fi
3285
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3286
# If -opengl wasn't specified, don't try to auto-detect
3287
if [ "$PLATFORM_QWS" = "yes" ] && [ "$CFG_OPENGL" = "auto" ]; then
3288
        CFG_OPENGL=no
3289
fi
3290
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3291
# mac
1 by Adam Conrad
Import upstream version 4.0.0
3292
if [ "$PLATFORM_MAC" = "yes" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3293
    if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
3294
        CFG_OPENGL=desktop
1 by Adam Conrad
Import upstream version 4.0.0
3295
    fi
3296
fi
3297
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3298
# find the default framework value
3299
if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
3300
    if [ "$CFG_FRAMEWORK" = "auto" ]; then
3301
        CFG_FRAMEWORK="$CFG_SHARED"
3302
    elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
3303
	echo
3304
	echo "WARNING: Using static linking will disable the use of Mac frameworks."
3305
	echo
3306
        CFG_FRAMEWORK="no"
3307
    fi
3308
else
3309
    CFG_FRAMEWORK=no
3310
fi
3311
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
3312
# Print a warning if configure was called with the 10.4u SDK option on Snow Leopard
3313
# with the default mkspec. The 10.4u SDK does not support gcc 4.2.
3314
if [ "$PLATFORM_MAC" = "yes" ] && [ '!' -z "$CFG_SDK" ]; then
3315
    # get the darwin version. 10.0.0 and up means snow leopard.
3316
    VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'`
3317
    if [ "$VERSION" -gt 9 ] && [ "$CFG_SDK" == "/Developer/SDKs/MacOSX10.4u.sdk/" ] && [ "$PLATFORM" == "macx-g++" ]; then
3318
        echo
3319
        echo "WARNING: The 10.4u SDK does not support gcc 4.2. Configure with -platform macx-g++40. "
3320
        echo
3321
    fi
3322
fi
3323
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3324
# x11 tests are done after qmake is built
1 by Adam Conrad
Import upstream version 4.0.0
3325
3326
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3327
#setup the build parts
3328
if [ -z "$CFG_BUILD_PARTS" ]; then
3329
    CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
3330
3331
    # don't build tools by default when cross-compiling
3332
    if [ "$PLATFORM" != "$XPLATFORM" ]; then
3333
	CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, tools,,g"`
3334
    fi
3335
fi
3336
for nobuild in $CFG_NOBUILD_PARTS; do
3337
    CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, $nobuild,,g"`
3338
done
3339
if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then
3340
#    echo
3341
#    echo "WARNING: libs is a required part of the build."
3342
#    echo
3343
    CFG_BUILD_PARTS="$CFG_BUILD_PARTS libs"
3344
fi
3345
3346
#-------------------------------------------------------------------------------
3347
# post process QT_INSTALL_* variables
3348
#-------------------------------------------------------------------------------
3349
3350
#prefix
3351
if [ -z "$QT_INSTALL_PREFIX" ]; then
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
3352
    if [ "$CFG_DEV" = "yes" ]; then
3353
        QT_INSTALL_PREFIX="$outpath" # In Development, we use sandboxed builds by default
3354
    elif [ "$PLATFORM_QWS" = "yes" ]; then
3355
        QT_INSTALL_PREFIX="/usr/local/Trolltech/QtEmbedded-${QT_VERSION}"
3356
        if [ "$PLATFORM" != "$XPLATFORM" ]; then
3357
            QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}"
3358
        fi
3359
    elif [ -d "$EPOCROOT" ]; then
1.1.32 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100706
3360
        case "$XPLATFORM" in *symbian*)
3361
            QT_INSTALL_PREFIX="$EPOCROOT/epoc32/"
3362
            QT_INSTALL_LIBS="$EPOCROOT/epoc32/release/armv5/lib/"
3363
            ;;
3364
        esac
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
3365
    else
3366
        QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3367
    fi
3368
fi
3369
QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
3370
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
3371
if echo $XPLATFORM | grep symbian > /dev/null; then
3372
    [ -z "$QT_HOST_PREFIX" ] && QT_HOST_PREFIX="$QT_INSTALL_PREFIX"
3373
    [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS=
3374
    [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS=
3375
    [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS=
3376
    [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS=
3377
    [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="\\\\resource\\\\qt$QT_LIBINFIX\\\\plugins"
3378
    [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="\\\\resource\\\\qt$QT_LIBINFIX\\\\imports"
3379
    [ -z "$QT_INSTALL_DATA" ] && QT_INSTALL_DATA=
3380
    [ -z "$QT_INSTALL_TRANSLATIONS" ] && QT_INSTALL_TRANSLATIONS="\\\\resource\\\\qt$QT_LIBINFIX\\\\translations"
3381
    [ -z "$QT_INSTALL_SETTINGS" ] && QT_INSTALL_SETTINGS=
3382
    [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES=
3383
    [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS=
3384
else
3385
    #docs
3386
    if [ -z "$QT_INSTALL_DOCS" ]; then #default
3387
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3388
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3389
	        QT_INSTALL_DOCS="/Developer/Documentation/Qt"
3390
            fi
3391
        fi
3392
        [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
3393
3394
    fi
3395
    QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
3396
3397
    #headers
3398
    if [ -z "$QT_INSTALL_HEADERS" ]; then #default
3399
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3400
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3401
	        if [ "$CFG_FRAMEWORK" = "yes" ]; then
3402
		    QT_INSTALL_HEADERS=
3403
                fi
3404
            fi
3405
        fi
3406
        [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
3407
3408
    fi
3409
    QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"`
3410
3411
    #libs
3412
    if [ -z "$QT_INSTALL_LIBS" ]; then #default
3413
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3414
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3415
	        if [ "$CFG_FRAMEWORK" = "yes" ]; then
3416
		    QT_INSTALL_LIBS="/Libraries/Frameworks"
3417
                fi
3418
            fi
3419
        fi
3420
        [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback
3421
    fi
3422
    QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
3423
3424
    #bins
3425
    if [ -z "$QT_INSTALL_BINS" ]; then #default
3426
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3427
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3428
	        QT_INSTALL_BINS="/Developer/Applications/Qt"
3429
            fi
3430
        fi
3431
        [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
3432
3433
    fi
3434
    QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
3435
3436
    #plugins
3437
    if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
3438
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3439
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3440
	        QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins"
3441
            fi
3442
        fi
3443
        [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
3444
    fi
3445
    QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
3446
3447
    #imports
3448
    if [ -z "$QT_INSTALL_IMPORTS" ]; then #default
3449
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3450
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3451
	        QT_INSTALL_IMPORTS="/Developer/Applications/Qt/imports"
3452
            fi
3453
        fi
3454
        [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="$QT_INSTALL_PREFIX/imports" #fallback
3455
    fi
3456
    QT_INSTALL_IMPORTS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_IMPORTS"`
3457
3458
    #data
3459
    if [ -z "$QT_INSTALL_DATA" ]; then #default
3460
        QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
3461
    fi
3462
    QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
3463
3464
    #translations
3465
    if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
3466
        QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
3467
    fi
3468
    QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
3469
3470
    #settings
3471
    if [ -z "$QT_INSTALL_SETTINGS" ]; then #default
3472
        if [ "$PLATFORM_MAC" = "yes" ]; then
3473
	    QT_INSTALL_SETTINGS=/Library/Preferences/Qt
3474
        else
3475
	    QT_INSTALL_SETTINGS=/etc/xdg
3476
        fi
3477
    fi
3478
    QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"`
3479
3480
    #examples
3481
    if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default
3482
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3483
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3484
	        QT_INSTALL_EXAMPLES="/Developer/Examples/Qt"
3485
            fi
3486
        fi
3487
        [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback
3488
    fi
3489
    QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"`
3490
3491
    #demos
3492
    if [ -z "$QT_INSTALL_DEMOS" ]; then #default
3493
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3494
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3495
	        QT_INSTALL_DEMOS="/Developer/Examples/Qt/Demos"
3496
            fi
3497
        fi
3498
        [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos"
3499
    fi
3500
    QT_INSTALL_DEMOS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DEMOS"`
3501
fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3502
1 by Adam Conrad
Import upstream version 4.0.0
3503
#-------------------------------------------------------------------------------
3504
# help - interactive parts of the script _after_ this section please
3505
#-------------------------------------------------------------------------------
3506
3507
# next, emit a usage message if something failed.
3508
if [ "$OPT_HELP" = "yes" ]; then
3509
    [ "x$ERROR" = "xyes" ] && echo
3510
    if [ "$CFG_NIS" = "no" ]; then
3511
        NSY=" "
3512
        NSN="*"
3513
    else
3514
        NSY="*"
3515
        NSN=" "
3516
    fi
3517
    if [ "$CFG_CUPS" = "no" ]; then
3518
        CUY=" "
3519
        CUN="*"
3520
    else
3521
        CUY="*"
3522
        CUN=" "
3523
    fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3524
    if [ "$CFG_ICONV" = "no" ]; then
3525
        CIY=" "
3526
        CIN="*"
3527
    else
3528
        CIY="*"
3529
        CIN=" "
3530
    fi
1 by Adam Conrad
Import upstream version 4.0.0
3531
    if [ "$CFG_LARGEFILE" = "no" ]; then
3532
        LFSY=" "
3533
        LFSN="*"
3534
    else
3535
        LFSY="*"
3536
        LFSN=" "
3537
    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
3538
    if [ "$CFG_STL" = "auto" ] || [ "$CFG_STL" = "yes" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
3539
        SHY="*"
3540
        SHN=" "
3541
    else
3542
        SHY=" "
3543
        SHN="*"
3544
    fi
3545
    if [ "$CFG_IPV6" = "auto" ]; then
3546
        I6Y="*"
3547
        I6N=" "
3548
    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
3549
    if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
3550
        PHY=" "
3551
        PHN="*"
3552
    else
3553
        PHY="*"
3554
        PHN=" "
3555
    fi
3556
3557
    cat <<EOF
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3558
Usage:  $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
3559
        [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-importdir <dir>] [-datadir <dir>]
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3560
        [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>]
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3561
        [-demosdir <dir>] [-buildkey <key>] [-release] [-debug]
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3562
        [-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3563
        [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]
3564
        [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>]
3565
        [-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support] [-qt3support]
3566
        [-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3567
        [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff]
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3568
        [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng]
3569
        [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>]
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
3570
        [-nomake <part>] [-R <string>]  [-l <string>] [-no-rpath]  [-rpath] [-continue]
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3571
        [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
3572
        [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-gui]
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3573
        [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
3574
        [-no-sse3] [-no-ssse3] [-no-sse4.1] [-no-sse4.2] [-no-avx]
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3575
        [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info] [-armfpa]
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3576
        [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns]
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
3577
        [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend]
3578
        [-no-media-backend] [-media-backend] [-no-audio-backend] [-audio-backend] 
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
3579
        [-no-openssl] [-openssl] [-openssl-linked]
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3580
        [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-javascript-jit] [-javascript-jit]
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
3581
        [-no-script] [-script] [-no-scripttools] [-scripttools] [-no-declarative] [-declarative]
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3582
3583
        [additional platform specific options (see below)]
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3584
1 by Adam Conrad
Import upstream version 4.0.0
3585
3586
Installation options:
3587
3588
 These are optional, but you may specify install directories.
3589
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3590
    -prefix <dir> ...... This will install everything relative to <dir>
1 by Adam Conrad
Import upstream version 4.0.0
3591
                         (default $QT_INSTALL_PREFIX)
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
3592
EOF
3593
if [ "$PLATFORM_QWS" = "yes" ]; then
3594
cat <<EOF
3595
3596
    -hostprefix [dir] .. Tools and libraries needed when developing
3597
                         applications are installed in [dir]. If [dir] is
3598
                         not given, the current build directory will be used.
3599
EOF
3600
fi
3601
cat <<EOF
1 by Adam Conrad
Import upstream version 4.0.0
3602
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3603
  * -prefix-install .... Force a sandboxed "local" installation of
3604
                         Qt. This will install into
3605
                         $QT_INSTALL_PREFIX, if this option is
3606
                         disabled then some platforms will attempt a
3607
                         "system" install by placing default values to
3608
                         be placed in a system location other than
3609
                         PREFIX.
3610
1 by Adam Conrad
Import upstream version 4.0.0
3611
 You may use these to separate different parts of the install:
3612
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3613
    -bindir <dir> ......... Executables will be installed to <dir>
3614
                            (default PREFIX/bin)
3615
    -libdir <dir> ......... Libraries will be installed to <dir>
3616
                            (default PREFIX/lib)
3617
    -docdir <dir> ......... Documentation will be installed to <dir>
3618
                            (default PREFIX/doc)
3619
    -headerdir <dir> ...... Headers will be installed to <dir>
3620
                            (default PREFIX/include)
3621
    -plugindir <dir> ...... Plugins will be installed to <dir>
3622
                            (default PREFIX/plugins)
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
3623
    -importdir <dir> ...... Imports for QML will be installed to <dir>
3624
                            (default PREFIX/imports)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3625
    -datadir <dir> ........ Data used by Qt programs will be installed to <dir>
3626
                            (default PREFIX)
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3627
    -translationdir <dir> . Translations of Qt programs will be installed to <dir>
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3628
                            (default PREFIX/translations)
3629
    -sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>
3630
                            (default PREFIX/etc/settings)
3631
    -examplesdir <dir> .... Examples will be installed to <dir>
3632
                            (default PREFIX/examples)
3633
    -demosdir <dir> ....... Demos will be installed to <dir>
3634
                            (default PREFIX/demos)
1 by Adam Conrad
Import upstream version 4.0.0
3635
3636
 You may use these options to turn on strict plugin loading.
3637
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3638
    -buildkey <key> .... Build the Qt library and plugins using the specified
3639
                         <key>.  When the library loads plugins, it will only
1 by Adam Conrad
Import upstream version 4.0.0
3640
                         load those that have a matching key.
3641
3642
Configure options:
3643
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
3644
 The defaults (*) are usually acceptable. A plus (+) denotes a default value
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3645
 that needs to be evaluated. If the evaluation succeeds, the feature is
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
3646
 included. Here is a short explanation of each option:
1 by Adam Conrad
Import upstream version 4.0.0
3647
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3648
 *  -release ........... Compile and link Qt with debugging turned off.
1 by Adam Conrad
Import upstream version 4.0.0
3649
    -debug ............. Compile and link Qt with debugging turned on.
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3650
    -debug-and-release . Compile and link two versions of Qt, with and without
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3651
                         debugging turned on (Mac only).
1 by Adam Conrad
Import upstream version 4.0.0
3652
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
3653
    -developer-build ... Compile and link Qt with Qt developer options (including auto-tests exporting)
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3654
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
3655
    -opensource ........ Compile and link the Open-Source Edition of Qt.
3656
    -commercial ........ Compile and link the Commercial Edition of Qt.
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
3657
3658
1 by Adam Conrad
Import upstream version 4.0.0
3659
 *  -shared ............ Create and use shared Qt libraries.
3660
    -static ............ Create and use static Qt libraries.
3661
3662
 *  -no-fast ........... Configure Qt normally by generating Makefiles for all
3663
                         project files.
3664
    -fast .............. Configure Qt quickly by generating Makefiles only for
3665
                         library and subdirectory targets.  All other Makefiles
3666
                         are created as wrappers, which will in turn run qmake.
3667
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3668
    -no-largefile ...... Disables large file support.
3669
 +  -largefile ......... Enables Qt to access files larger than 4 GB.
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3670
1 by Adam Conrad
Import upstream version 4.0.0
3671
EOF
3672
if [ "$PLATFORM_QWS" = "yes" ]; then
3673
    EXCN="*"
3674
    EXCY=" "
3675
else
3676
    EXCN=" "
3677
    EXCY="*"
3678
fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3679
if [ "$CFG_DBUS" = "no" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3680
    DBY=" "
3681
    DBN="+"
3682
else
3683
    DBY="+"
3684
    DBN=" "
3685
fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3686
1 by Adam Conrad
Import upstream version 4.0.0
3687
    cat << EOF
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3688
 $EXCN  -no-exceptions ..... Disable exceptions on compilers that support it.
3689
 $EXCY  -exceptions ........ Enable exceptions on compilers that support it.
1 by Adam Conrad
Import upstream version 4.0.0
3690
3691
    -no-accessibility .. Do not compile Accessibility support.
3692
 *  -accessibility ..... Compile Accessibility support.
3693
3694
 $SHN  -no-stl ............ Do not compile STL support.
3695
 $SHY  -stl ............... Compile STL support.
3696
3697
    -no-sql-<driver> ... Disable SQL <driver> entirely.
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3698
    -qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default
1 by Adam Conrad
Import upstream version 4.0.0
3699
                         none are turned on.
3700
    -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to
3701
                         at run time.
3702
3703
                         Possible values for <driver>:
3704
                         [ $CFG_SQL_AVAILABLE ]
3705
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3706
    -system-sqlite ..... Use sqlite from the operating system.
3707
3708
    -no-qt3support ..... Disables the Qt 3 support functionality.
3709
 *  -qt3support ........ Enables the Qt 3 support functionality.
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
3710
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3711
    -no-xmlpatterns .... Do not build the QtXmlPatterns module.
3712
 +  -xmlpatterns ....... Build the QtXmlPatterns module.
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3713
                         QtXmlPatterns is built if a decent C++ compiler
3714
                         is used and exceptions are enabled.
3715
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3716
    -no-multimedia ..... Do not build the QtMultimedia module.
3717
 +  -multimedia ........ Build the QtMultimedia module.
3718
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
3719
    -no-audio-backend .. Do not build the platform audio backend into QtMultimedia.
3720
 +  -audio-backend ..... Build the platform audio backend into QtMultimedia if available.
3721
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3722
    -no-phonon ......... Do not build the Phonon module.
3723
 +  -phonon ............ Build the Phonon module.
3724
                         Phonon is built if a decent C++ compiler is used.
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
3725
    -no-phonon-backend.. Do not build the platform phonon plugin.
3726
 +  -phonon-backend..... Build the platform phonon plugin.
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3727
3728
    -no-svg ............ Do not build the SVG module.
3729
 +  -svg ............... Build the SVG module.
3730
3731
    -no-webkit ......... Do not build the WebKit module.
3732
 +  -webkit ............ Build the WebKit module.
3733
                         WebKit is built if a decent C++ compiler is used.
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3734
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
3735
    -no-javascript-jit . Do not build the JavaScriptCore JIT compiler.
3736
 +  -javascript-jit .... Build the JavaScriptCore JIT compiler.
3737
3738
    -no-script ......... Do not build the QtScript module.
3739
 +  -script ............ Build the QtScript module.
3740
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3741
    -no-scripttools .... Do not build the QtScriptTools module.
3742
 +  -scripttools ....... Build the QtScriptTools module.
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3743
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
3744
    -no-declarative .....Do not build the declarative module.
3745
 +  -declarative ....... Build the declarative module.
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
3746
1 by Adam Conrad
Import upstream version 4.0.0
3747
    -platform target ... The operating system and compiler you are building
3748
                         on ($PLATFORM).
3749
3750
                         See the README file for a list of supported
3751
                         operating systems and compilers.
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3752
EOF
3753
if [ "${PLATFORM_QWS}" != "yes" ]; then
3754
cat << EOF
3755
    -graphicssystem <sys> Sets an alternate graphics system. Available options are:
3756
                           raster - Software rasterizer
3757
                           opengl - Rendering via OpenGL, Experimental!
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
3758
                           openvg - Rendering via OpenVG, Experimental!
3759
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3760
EOF
3761
fi
3762
cat << EOF
1 by Adam Conrad
Import upstream version 4.0.0
3763
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3764
    -no-mmx ............ Do not compile with use of MMX instructions.
3765
    -no-3dnow .......... Do not compile with use of 3DNOW instructions.
3766
    -no-sse ............ Do not compile with use of SSE instructions.
3767
    -no-sse2 ........... Do not compile with use of SSE2 instructions.
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
3768
    -no-sse3 ........... Do not compile with use of SSE3 instructions.
3769
    -no-ssse3 .......... Do not compile with use of SSSE3 instructions.
3770
    -no-sse4.1.......... Do not compile with use of SSE4.1 instructions.
3771
    -no-sse4.2.......... Do not compile with use of SSE4.2 instructions.
3772
    -no-avx ............ Do not compile with use of AVX instructions.
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3773
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3774
    -qtnamespace <name>  Wraps all Qt library code in 'namespace <name> {...}'.
3775
    -qtlibinfix <infix>  Renames all libQt*.so to libQt*<infix>.so.
3776
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3777
    -D <string> ........ Add an explicit define to the preprocessor.
3778
    -I <string> ........ Add an explicit include path.
3779
    -L <string> ........ Add an explicit library path.
1 by Adam Conrad
Import upstream version 4.0.0
3780
3781
    -help, -h .......... Display this information.
3782
3783
Third Party Libraries:
3784
3785
    -qt-zlib ........... Use the zlib bundled with Qt.
3786
 +  -system-zlib ....... Use zlib from the operating system.
3787
                         See http://www.gzip.org/zlib
3788
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
3789
    -no-gif ............ Do not compile GIF reading support.
3790
 *  -qt-gif ............ Compile GIF reading support.
3791
                         See also src/gui/image/qgifhandler_p.h
1 by Adam Conrad
Import upstream version 4.0.0
3792
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
3793
    -no-libtiff ........ Do not compile TIFF support.
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3794
    -qt-libtiff ........ Use the libtiff bundled with Qt.
3795
 +  -system-libtiff .... Use libtiff from the operating system.
3796
                         See http://www.libtiff.org
3797
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
3798
    -no-libpng ......... Do not compile PNG support.
1 by Adam Conrad
Import upstream version 4.0.0
3799
    -qt-libpng ......... Use the libpng bundled with Qt.
3800
 +  -system-libpng ..... Use libpng from the operating system.
3801
                         See http://www.libpng.org/pub/png
3802
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
3803
    -no-libmng ......... Do not compile MNG support.
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
3804
    -qt-libmng ......... Use the libmng bundled with Qt.
3805
 +  -system-libmng ..... Use libmng from the operating system.
3806
                         See http://www.libmng.com
3807
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
3808
    -no-libjpeg ........ Do not compile JPEG support.
1 by Adam Conrad
Import upstream version 4.0.0
3809
    -qt-libjpeg ........ Use the libjpeg bundled with Qt.
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
3810
 +  -system-libjpeg .... Use libjpeg from the operating system.
1 by Adam Conrad
Import upstream version 4.0.0
3811
                         See http://www.ijg.org
3812
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3813
    -no-openssl ........ Do not compile support for OpenSSL.
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3814
 +  -openssl ........... Enable run-time OpenSSL support.
3815
    -openssl-linked .... Enabled linked OpenSSL support.
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3816
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3817
    -ptmalloc .......... Override the system memory allocator with ptmalloc.
3818
                         (Experimental.)
3819
1 by Adam Conrad
Import upstream version 4.0.0
3820
Additional options:
3821
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3822
    -make <part> ....... Add part to the list of parts to be built at make time.
3823
                         ($QT_DEFAULT_BUILD_PARTS)
3824
    -nomake <part> ..... Exclude part from the list of parts to be built.
3825
3826
    -R <string> ........ Add an explicit runtime library path to the Qt
1 by Adam Conrad
Import upstream version 4.0.0
3827
                         libraries.
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3828
    -l <string> ........ Add an explicit library.
1 by Adam Conrad
Import upstream version 4.0.0
3829
3830
    -no-rpath .......... Do not use the library install path as a runtime
3831
                         library path.
3832
 +  -rpath ............. Link Qt libraries and executables using the library
3833
                         install path as a runtime library path. Equivalent
3834
                         to -R install_libpath
3835
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3836
    -continue .......... Continue as far as possible if an error occurs.
1 by Adam Conrad
Import upstream version 4.0.0
3837
3838
    -verbose, -v ....... Print verbose information about each step of the
3839
                         configure process.
3840
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3841
    -silent ............ Reduce the build output so that warnings and errors
3842
                         can be seen more easily.
3843
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
3844
 *  -no-optimized-qmake ... Do not build qmake optimized.
3845
    -optimized-qmake ...... Build qmake optimized.
3846
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
3847
    -no-gui ............ Don't build the Qt GUI library
3848
1 by Adam Conrad
Import upstream version 4.0.0
3849
 $NSN  -no-nis ............ Do not compile NIS support.
3850
 $NSY  -nis ............... Compile NIS support.
3851
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3852
 $CUN  -no-cups ........... Do not compile CUPS support.
1 by Adam Conrad
Import upstream version 4.0.0
3853
 $CUY  -cups .............. Compile CUPS support.
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3854
                         Requires cups/cups.h and libcups.so.2.
1 by Adam Conrad
Import upstream version 4.0.0
3855
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3856
 $CIN  -no-iconv .......... Do not compile support for iconv(3).
3857
 $CIY  -iconv ............. Compile support for iconv(3).
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
3858
1 by Adam Conrad
Import upstream version 4.0.0
3859
 $PHN  -no-pch ............ Do not use precompiled header support.
3860
 $PHY  -pch ............... Use precompiled header support.
3861
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3862
 $DBN  -no-dbus ........... Do not compile the QtDBus module.
3863
 $DBY  -dbus .............. Compile the QtDBus module and dynamically load libdbus-1.
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3864
    -dbus-linked ....... Compile the QtDBus module and link to libdbus-1.
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
3865
3866
    -reduce-relocations ..... Reduce relocations in the libraries through extra
3867
                              linker optimizations (Qt/X11 and Qt for Embedded Linux only;
3868
                              experimental; needs GNU ld >= 2.18).
3869
EOF
3870
3871
if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
3872
    if [ "$QT_CROSS_COMPILE" = "yes" ]; then
3873
        SBY=""
3874
        SBN="*"
3875
    else
3876
        SBY="*"
3877
        SBN=" "
3878
    fi
3879
elif [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
3880
    SBY="*"
3881
    SBN=" "
3882
else
3883
    SBY=" "
3884
    SBN="*"
3885
fi
3886
3887
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
3888
3889
    cat << EOF
3890
3891
 $SBN  -no-separate-debug-info . Do not store debug information in a separate file.
3892
 $SBY  -separate-debug-info .... Strip debug information into a separate .debug file.
3893
3894
EOF
3895
3896
fi # X11/QWS
1 by Adam Conrad
Import upstream version 4.0.0
3897
3898
if [ "$PLATFORM_X11" = "yes" ]; then
3899
    if [ "$CFG_SM" = "no" ]; then
3900
        SMY=" "
3901
        SMN="*"
3902
    else
3903
        SMY="*"
3904
        SMN=" "
3905
    fi
3906
    if [ "$CFG_XSHAPE" = "no" ]; then
3907
        SHY=" "
3908
        SHN="*"
3909
    else
3910
        SHY="*"
3911
        SHN=" "
3912
    fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
3913
    if [ "$CFG_XVIDEO" = "no" ]; then
3914
        XVY=" "
3915
        XVN="*"
3916
    else
3917
        XVY="*"
3918
        XVN=" "
3919
    fi
1 by Adam Conrad
Import upstream version 4.0.0
3920
    if [ "$CFG_XINERAMA" = "no" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3921
        XAY=" "
3922
        XAN="*"
1 by Adam Conrad
Import upstream version 4.0.0
3923
    else
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3924
        XAY="*"
3925
        XAN=" "
1 by Adam Conrad
Import upstream version 4.0.0
3926
    fi
3927
    if [ "$CFG_FONTCONFIG" = "no" ]; then
3928
        FCGY=" "
3929
        FCGN="*"
3930
    else
3931
        FCGY="*"
3932
        FCGN=" "
3933
    fi
3934
    if [ "$CFG_XCURSOR" = "no" ]; then
3935
        XCY=" "
3936
        XCN="*"
3937
    else
3938
        XCY="*"
3939
        XCN=" "
3940
    fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3941
    if [ "$CFG_XFIXES" = "no" ]; then
3942
        XFY=" "
3943
        XFN="*"
3944
    else
3945
        XFY="*"
3946
        XFN=" "
3947
    fi
1 by Adam Conrad
Import upstream version 4.0.0
3948
    if [ "$CFG_XRANDR" = "no" ]; then
3949
        XZY=" "
3950
        XZN="*"
3951
    else
3952
        XZY="*"
3953
        XZN=" "
3954
    fi
3955
    if [ "$CFG_XRENDER" = "no" ]; then
3956
        XRY=" "
3957
        XRN="*"
3958
    else
3959
        XRY="*"
3960
        XRN=" "
3961
    fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3962
    if [ "$CFG_MITSHM" = "no" ]; then
3963
        XMY=" "
3964
        XMN="*"
3965
    else
3966
        XMY="*"
3967
        XMN=" "
3968
    fi
3969
    if [ "$CFG_XINPUT" = "no" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
3970
        XIY=" "
3971
        XIN="*"
3972
    else
3973
        XIY="*"
3974
        XIN=" "
3975
    fi
3976
    if [ "$CFG_XKB" = "no" ]; then
3977
        XKY=" "
3978
        XKN="*"
3979
    else
3980
        XKY="*"
3981
        XKN=" "
3982
    fi
3983
    if [ "$CFG_IM" = "no" ]; then
3984
        IMY=" "
3985
        IMN="*"
3986
    else
3987
        IMY="*"
3988
        IMN=" "
3989
    fi
3990
    cat << EOF
3991
3992
Qt/X11 only:
3993
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
3994
    -no-gtkstyle ....... Do not build the GTK theme integration.
3995
 +  -gtkstyle .......... Build the GTK theme integration.
3996
1 by Adam Conrad
Import upstream version 4.0.0
3997
 *  -no-nas-sound ...... Do not compile in NAS sound support.
3998
    -system-nas-sound .. Use NAS libaudio from the operating system.
3999
                         See http://radscan.com/nas.html
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4000
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
4001
    -egl ............... Use EGL instead of GLX to manage contexts.
4002
                         When building for desktop OpenGL, this option will
4003
                         make Qt use EGL to manage contexts rather than the
4004
                         GLX, which is the default. Note: For OpenGL ES, EGL
4005
                         is always used.
4006
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4007
    -no-opengl ......... Do not support OpenGL.
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4008
 +  -opengl <api> ...... Enable OpenGL support.
4009
                         With no parameter, this will auto-detect the "best"
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
4010
                         OpenGL API to use. If desktop OpenGL is available, it
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4011
                         will be used. Use desktop, es1, or es2 for <api>
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4012
                         to force the use of the Desktop (OpenGL 1.x or 2.x),
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4013
                         OpenGL ES 1.x Common profile, or 2.x APIs instead.
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4014
4015
     -no-openvg ........ Do not support OpenVG.
4016
 +   -openvg ........... Enable OpenVG support.
4017
                         Requires EGL support, typically supplied by an OpenGL
4018
                         or other graphics implementation.
1 by Adam Conrad
Import upstream version 4.0.0
4019
4020
 $SMN  -no-sm ............. Do not support X Session Management.
4021
 $SMY  -sm ................ Support X Session Management, links in -lSM -lICE.
4022
4023
 $SHN  -no-xshape ......... Do not compile XShape support.
4024
 $SHY  -xshape ............ Compile XShape support.
4025
                         Requires X11/extensions/shape.h.
4026
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4027
 $XVN  -no-xvideo ......... Do not compile XVideo support.
4028
 $XVY  -xvideo ............ Compile XVideo support.
4029
                         Requires X11/extensions/Xv.h & Xvlib.h.
4030
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
4031
 $SHN  -no-xsync .......... Do not compile XSync support.
4032
 $SHY  -xsync ............. Compile XSync support.
4033
                         Requires X11/extensions/sync.h.
4034
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4035
 $XAN  -no-xinerama ....... Do not compile Xinerama (multihead) support.
4036
 $XAY  -xinerama .......... Compile Xinerama support.
1 by Adam Conrad
Import upstream version 4.0.0
4037
                         Requires X11/extensions/Xinerama.h and libXinerama.
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4038
			 By default, Xinerama support will be compiled if
4039
                         available and the shared libraries are dynamically
4040
                         loaded at runtime.
1 by Adam Conrad
Import upstream version 4.0.0
4041
4042
 $XCN  -no-xcursor ........ Do not compile Xcursor support.
4043
 $XCY  -xcursor ........... Compile Xcursor support.
4044
                         Requires X11/Xcursor/Xcursor.h and libXcursor.
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4045
			 By default, Xcursor support will be compiled if
4046
                         available and the shared libraries are dynamically
4047
                         loaded at runtime.
1 by Adam Conrad
Import upstream version 4.0.0
4048
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4049
 $XFN  -no-xfixes ......... Do not compile Xfixes support.
4050
 $XFY  -xfixes ............ Compile Xfixes support.
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4051
                         Requires X11/extensions/Xfixes.h and libXfixes.
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4052
			 By default, Xfixes support will be compiled if
4053
                         available and the shared libraries are dynamically
4054
                         loaded at runtime.
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4055
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4056
 $XZN  -no-xrandr ......... Do not compile Xrandr (resize and rotate) support.
4057
 $XZY  -xrandr ............ Compile Xrandr support.
1 by Adam Conrad
Import upstream version 4.0.0
4058
                         Requires X11/extensions/Xrandr.h and libXrandr.
4059
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4060
 $XRN  -no-xrender ........ Do not compile Xrender support.
4061
 $XRY  -xrender ........... Compile Xrender support.
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4062
                         Requires X11/extensions/Xrender.h and libXrender.
4063
4064
 $XMN  -no-mitshm ......... Do not compile MIT-SHM support.
4065
 $XMY  -mitshm ............ Compile MIT-SHM support.
4066
                         Requires sys/ipc.h, sys/shm.h and X11/extensions/XShm.h
1 by Adam Conrad
Import upstream version 4.0.0
4067
4068
 $FCGN  -no-fontconfig ..... Do not compile FontConfig (anti-aliased font) support.
4069
 $FCGY  -fontconfig ........ Compile FontConfig support.
4070
                         Requires fontconfig/fontconfig.h, libfontconfig,
4071
                         freetype.h and libfreetype.
4072
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4073
 $XIN  -no-xinput ......... Do not compile Xinput support.
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4074
 $XIY  -xinput ............ Compile Xinput support. This also enabled tablet support
4075
                         which requires IRIX with wacom.h and libXi or
1 by Adam Conrad
Import upstream version 4.0.0
4076
                         XFree86 with X11/extensions/XInput.h and libXi.
4077
4078
 $XKN  -no-xkb ............ Do not compile XKB (X KeyBoard extension) support.
4079
 $XKY  -xkb ............... Compile XKB support.
4080
4081
EOF
4082
fi
4083
4084
if [ "$PLATFORM_MAC" = "yes" ]; then
4085
    cat << EOF
4086
4087
Qt/Mac only:
4088
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
4089
    -Fstring ........... Add an explicit framework path.
4090
    -fw string ......... Add an explicit framework.
4091
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4092
    -cocoa ............. [Deprecated] Cocoa is now enabled by default.
4093
4094
    -carbon .............Build the Carbon version of Qt. 64-bit archs
4095
                         are not supported by carbon and will be built
4096
                         with cocoa
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4097
1 by Adam Conrad
Import upstream version 4.0.0
4098
 *  -framework ......... Build Qt as a series of frameworks and
4099
                         link tools against those frameworks.
4100
    -no-framework ...... Do not build Qt as a series of frameworks.
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4101
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4102
 *  -dwarf2 ............ Enable dwarf2 debugging symbols.
4103
    -no-dwarf2 ......... Disable dwarf2 debugging symbols.
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4104
4105
    -universal ......... Equivalent to -arch "ppc x86"
4106
4107
    -arch <arch> ....... Build Qt for <arch>
4108
                         Example values for <arch>: x86 ppc x86_64 ppc64
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4109
                         Multiple -arch arguments can be specified.
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4110
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4111
    -sdk <sdk> ......... Build Qt using Apple provided SDK <sdk>. This option requires gcc 4.
4112
                         To use a different SDK with gcc 3.3, set the SDKROOT environment variable.
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4113
1 by Adam Conrad
Import upstream version 4.0.0
4114
EOF
4115
fi
4116
4117
if [ "$PLATFORM_QWS" = "yes" ]; then
4118
    cat << EOF
4119
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4120
Qt for Embedded Linux only:
1 by Adam Conrad
Import upstream version 4.0.0
4121
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4122
    -xplatform target ... The target platform when cross-compiling.
4123
4124
    -no-feature-<feature> Do not compile in <feature>.
4125
    -feature-<feature> .. Compile in <feature>. The available features
4126
                          are described in src/corelib/global/qfeatures.txt
4127
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4128
    -embedded <arch> .... This will enable the embedded build, you must have a
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4129
                          proper license for this switch to work.
1.1.8 by Jonathan Riddell
Import upstream version 4.2.2
4130
                          Example values for <arch>: arm mips x86 generic
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4131
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4132
    -armfpa ............. Target platform uses the ARM-FPA floating point format.
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4133
    -no-armfpa .......... Target platform does not use the ARM-FPA floating point format.
4134
4135
                          The floating point format is usually autodetected by configure. Use this
4136
                          to override the detected value.
4137
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4138
    -little-endian ...... Target platform is little endian (LSB first).
4139
    -big-endian ......... Target platform is big endian (MSB first).
4140
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4141
    -host-little-endian . Host platform is little endian (LSB first).
4142
    -host-big-endian .... Host platform is big endian (MSB first).
4143
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4144
                          You only need to specify the endianness when
4145
                          cross-compiling, otherwise the host
4146
                          endianness will be used.
4147
4148
    -no-freetype ........ Do not compile in Freetype2 support.
4149
    -qt-freetype ........ Use the libfreetype bundled with Qt.
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4150
 *  -system-freetype .... Use libfreetype from the operating system.
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4151
                          See http://www.freetype.org/
4152
4153
    -qconfig local ...... Use src/corelib/global/qconfig-local.h rather than the
4154
                          default ($CFG_QCONFIG).
4155
4156
    -depths <list> ...... Comma-separated list of supported bit-per-pixel
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4157
                          depths, from: 1, 4, 8, 12, 15, 16, 18, 24, 32 and 'all'.
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4158
4159
    -qt-decoration-<style> ....Enable a decoration <style> in the QtGui library,
1 by Adam Conrad
Import upstream version 4.0.0
4160
                               by default all available decorations are on.
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
4161
			       Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
1 by Adam Conrad
Import upstream version 4.0.0
4162
    -plugin-decoration-<style> Enable decoration <style> as a plugin to be
4163
                               linked to at run time.
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
4164
			       Possible values for <style>: [ $CFG_DECORATION_PLUGIN_AVAILABLE ]
1 by Adam Conrad
Import upstream version 4.0.0
4165
    -no-decoration-<style> ....Disable decoration <style> entirely.
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
4166
                               Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
1 by Adam Conrad
Import upstream version 4.0.0
4167
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4168
    -no-opengl .......... Do not support OpenGL.
4169
    -opengl <api> ....... Enable OpenGL ES support
4170
                          With no parameter, this will attempt to auto-detect OpenGL ES 1.x
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4171
                          or 2.x. Use es1 or es2 for <api> to override auto-detection.
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4172
4173
                          NOTE: A QGLScreen driver for the hardware is required to support
4174
                                OpenGL ES on Qt for Embedded Linux.
4175
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4176
    -qt-gfx-<driver> ... Enable a graphics <driver> in the QtGui library.
4177
                         Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
1 by Adam Conrad
Import upstream version 4.0.0
4178
    -plugin-gfx-<driver> Enable graphics <driver> as a plugin to be
4179
                         linked to at run time.
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4180
                         Possible values for <driver>: [ $CFG_GFX_PLUGIN_AVAILABLE ]
1 by Adam Conrad
Import upstream version 4.0.0
4181
    -no-gfx-<driver> ... Disable graphics <driver> entirely.
4182
                         Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
4183
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4184
    -qt-kbd-<driver> ... Enable a keyboard <driver> in the QtGui library.
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4185
                         Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
4186
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4187
    -plugin-kbd-<driver> Enable keyboard <driver> as a plugin to be linked to
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4188
                         at runtime.
4189
                         Possible values for <driver>: [ $CFG_KBD_PLUGIN_AVAILABLE ]
4190
1 by Adam Conrad
Import upstream version 4.0.0
4191
    -no-kbd-<driver> ... Disable keyboard <driver> entirely.
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
4192
                         Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
4193
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4194
    -qt-mouse-<driver> ... Enable a mouse <driver> in the QtGui library.
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
4195
                           Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4196
    -plugin-mouse-<driver> Enable mouse <driver> as a plugin to be linked to
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4197
                           at runtime.
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
4198
                           Possible values for <driver>: [ $CFG_MOUSE_PLUGIN_AVAILABLE ]
4199
    -no-mouse-<driver> ... Disable mouse <driver> entirely.
4200
                           Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
1 by Adam Conrad
Import upstream version 4.0.0
4201
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4202
    -iwmmxt ............ Compile using the iWMMXt instruction set
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
4203
                         (available on some XScale CPUs).
4204
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
4205
    -no-neon ........... Do not compile with use of NEON instructions.
1 by Adam Conrad
Import upstream version 4.0.0
4206
EOF
4207
fi
4208
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4209
4210
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
4211
    if [ "$CFG_GLIB" = "no" ]; then
4212
        GBY=" "
4213
        GBN="+"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4214
    else
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4215
        GBY="+"
4216
        GBN=" "
4217
    fi
4218
    cat << EOF
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4219
 $GBN  -no-glib ........... Do not compile Glib support.
4220
 $GBY  -glib .............. Compile Glib support.
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4221
4222
EOF
4223
fi
4224
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
4225
case "$XPLATFORM" in *symbian*)
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4226
    cat << EOF
4227
4228
Qt for Symbian only:
4229
    -no-s60 ............ Do not compile in S60 support.
4230
 +  -s60 ............... Compile with support for the S60 UI Framework.
4231
    -no-style-s60....... Disable s60 style
4232
 +  -qt-style-s60....... Enable s60 style in the Qt Library
4233
4234
    -no-usedeffiles .... Disable the usage of DEF files.
4235
 *  -usedeffiles ....... Enable the usage of DEF files.
4236
EOF
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
4237
;;
4238
esac
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4239
1 by Adam Conrad
Import upstream version 4.0.0
4240
   [ "x$ERROR" = "xyes" ] && exit 1
4241
   exit 0
4242
fi # Help
4243
4244
4245
# -----------------------------------------------------------------------------
4246
# LICENSING, INTERACTIVE PART
4247
# -----------------------------------------------------------------------------
4248
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4249
if [ "$PLATFORM_QWS" = "yes" ]; then
4250
    Platform="Qt for Embedded Linux"
4251
elif [ "$PLATFORM_MAC" = "yes" ]; then
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
4252
    Platform="Qt for Mac OS X"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4253
elif echo "$XPLATFORM" | grep "symbian" > /dev/null ; then
4254
    Platform="Qt for Symbian"
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
4255
elif [ "$XPLATFORM_MINGW" = "yes" ]; then
4256
    Platform="Qt for Windows"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4257
elif [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4258
    PLATFORM_X11=yes
1.1.27 by Scott Kitterman
Import upstream version 4.6.0
4259
    Platform="Qt for Linux/X11"
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4260
fi
4261
4262
echo
4263
echo "This is the $Platform ${EditionString} Edition."
4264
echo
4265
4266
if [ "$Edition" = "NokiaInternalBuild" ]; then
4267
    echo "Detected -nokia-developer option"
4268
    echo "Nokia employees and agents are allowed to use this software under"
4269
    echo "the authority of Nokia Corporation and/or its subsidiary(-ies)"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4270
elif [ "$Edition" = "OpenSource" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
4271
    while true; do
1.1.20 by Jonathan Riddell
Import upstream version 4.5.0
4272
        echo "You are licensed to use this software under the terms of"
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4273
        echo "the Lesser GNU General Public License (LGPL) versions 2.1."
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
4274
        if [ -f "$relpath/LICENSE.GPL3" ]; then
4275
            echo "You are also licensed to use this software under the terms of"
4276
            echo "the GNU General Public License (GPL) versions 3."
4277
            affix="either"
4278
        else
4279
            affix="the"
4280
        fi
1.1.20 by Jonathan Riddell
Import upstream version 4.5.0
4281
        echo
1 by Adam Conrad
Import upstream version 4.0.0
4282
        if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
4283
            echo "You have already accepted the terms of the $LicenseType license."
1 by Adam Conrad
Import upstream version 4.0.0
4284
            acceptance=yes
4285
        else
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
4286
            if [ -f "$relpath/LICENSE.GPL3" ]; then
4287
                echo "Type '3' to view the GNU General Public License version 3."
4288
            fi
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4289
            echo "Type 'L' to view the Lesser GNU General Public License version 2.1."
1 by Adam Conrad
Import upstream version 4.0.0
4290
            echo "Type 'yes' to accept this license offer."
4291
            echo "Type 'no' to decline this license offer."
4292
            echo
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4293
            echo $ECHO_N "Do you accept the terms of $affix license? $ECHO_C"
1 by Adam Conrad
Import upstream version 4.0.0
4294
            read acceptance
4295
        fi
4296
        echo
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4297
        if [ "$acceptance" = "yes" ] || [ "$acceptance" = "y" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
4298
            break
4299
        elif [ "$acceptance" = "no" ]; then
4300
            echo "You are not licensed to use this software."
4301
            echo
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4302
            exit 1
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4303
        elif [ "$acceptance" = "3" ]; then
4304
            more "$relpath/LICENSE.GPL3"
1.1.20 by Jonathan Riddell
Import upstream version 4.5.0
4305
        elif [ "$acceptance" = "L" ]; then
4306
            more "$relpath/LICENSE.LGPL"
1 by Adam Conrad
Import upstream version 4.0.0
4307
        fi
4308
    done
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4309
elif [ "$Edition" = "Preview" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4310
    TheLicense=`head -n 1 "$relpath/LICENSE.PREVIEW.COMMERCIAL"`
1 by Adam Conrad
Import upstream version 4.0.0
4311
    while true; do
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4312
1 by Adam Conrad
Import upstream version 4.0.0
4313
        if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4314
            echo "You have already accepted the terms of the $LicenseType license."
1 by Adam Conrad
Import upstream version 4.0.0
4315
            acceptance=yes
4316
        else
4317
            echo "You are licensed to use this software under the terms of"
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4318
            echo "the $TheLicense"
1 by Adam Conrad
Import upstream version 4.0.0
4319
            echo
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4320
            echo "Type '?' to read the Preview License."
1 by Adam Conrad
Import upstream version 4.0.0
4321
            echo "Type 'yes' to accept this license offer."
4322
            echo "Type 'no' to decline this license offer."
4323
            echo
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4324
            echo $ECHO_N "Do you accept the terms of the license? $ECHO_C"
1 by Adam Conrad
Import upstream version 4.0.0
4325
            read acceptance
4326
        fi
4327
        echo
4328
        if [ "$acceptance" = "yes" ]; then
4329
            break
4330
        elif [ "$acceptance" = "no" ] ;then
4331
            echo "You are not licensed to use this software."
4332
            echo
4333
            exit 0
4334
        elif [ "$acceptance" = "?" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4335
            more "$relpath/LICENSE.PREVIEW.COMMERCIAL"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4336
        fi
4337
    done
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4338
elif [ "$Edition" != "OpenSource" ]; then
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4339
    if [ -n "$ExpiryDate" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
4340
        ExpiryDate=`echo $ExpiryDate | sed -e "s,-,,g" | tr -d "\n\r"`
4341
        [ -z "$ExpiryDate" ] && ExpiryDate="0"
4342
        Today=`date +%Y%m%d`
4343
        if [ "$Today" -gt "$ExpiryDate" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4344
            case "$LicenseType" in
4345
            Commercial|Academic|Educational)
4346
                if [ "$QT_PACKAGEDATE" -gt "$ExpiryDate" ]; then
4347
                    echo
4348
                    echo "NOTICE  NOTICE  NOTICE  NOTICE"
4349
                    echo
4350
                    echo "  Your support and upgrade period has expired."
4351
                    echo
4352
                    echo "  You are no longer licensed to use this version of Qt."
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
4353
                    echo "  Please contact qt-info@nokia.com to renew your support"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4354
                    echo "  and upgrades for this license."
4355
                    echo
4356
                    echo "NOTICE  NOTICE  NOTICE  NOTICE"
4357
                    echo
4358
                    exit 1
4359
                else
4360
                    echo
4361
                    echo "WARNING  WARNING  WARNING  WARNING"
4362
                    echo
4363
                    echo "  Your support and upgrade period has expired."
4364
                    echo
4365
                    echo "  You may continue to use your last licensed release"
4366
                    echo "  of Qt under the terms of your existing license"
4367
                    echo "  agreement. But you are not entitled to technical"
4368
                    echo "  support, nor are you entitled to use any more recent"
4369
                    echo "  Qt releases."
4370
                    echo
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
4371
                    echo "  Please contact qt-info@nokia.com to renew your"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4372
                    echo "  support and upgrades for this license."
4373
                    echo
4374
                    echo "WARNING  WARNING  WARNING  WARNING"
4375
                    echo
4376
                    sleep 3
4377
                fi
4378
                ;;
4379
            Evaluation|*)
4380
                echo
4381
                echo "NOTICE  NOTICE  NOTICE  NOTICE"
4382
                echo
4383
                echo "  Your Evaluation license has expired."
4384
                echo
4385
                echo "  You are no longer licensed to use this software. Please"
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
4386
                echo "  contact qt-info@nokia.com to purchase license, or install"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4387
                echo "  the Qt Open Source Edition if you intend to develop free"
4388
                echo "  software."
4389
                echo
4390
                echo "NOTICE  NOTICE  NOTICE  NOTICE"
4391
                echo
4392
                exit 1
4393
                ;;
4394
            esac
1 by Adam Conrad
Import upstream version 4.0.0
4395
        fi
4396
    fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4397
    TheLicense=`head -n 1 "$outpath/LICENSE"`
1 by Adam Conrad
Import upstream version 4.0.0
4398
    while true; do
4399
        if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4400
	    echo "You have already accepted the terms of the $TheLicense."
1 by Adam Conrad
Import upstream version 4.0.0
4401
            acceptance=yes
4402
        else
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4403
            echo "You are licensed to use this software under the terms of"
4404
            echo "the $TheLicense."
1 by Adam Conrad
Import upstream version 4.0.0
4405
            echo
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4406
            echo "Type '?' to view the $TheLicense."
1 by Adam Conrad
Import upstream version 4.0.0
4407
            echo "Type 'yes' to accept this license offer."
4408
            echo "Type 'no' to decline this license offer."
4409
            echo
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4410
            echo $ECHO_N "Do you accept the terms of the $TheLicense? $ECHO_C"
1 by Adam Conrad
Import upstream version 4.0.0
4411
            read acceptance
4412
        fi
4413
        echo
4414
        if [ "$acceptance" = "yes" ]; then
4415
            break
4416
        elif [ "$acceptance" = "no" ]; then
4417
            echo "You are not licensed to use this software."
4418
            echo
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4419
            exit 1
1 by Adam Conrad
Import upstream version 4.0.0
4420
        else [ "$acceptance" = "?" ]
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4421
            more "$outpath/LICENSE"
1 by Adam Conrad
Import upstream version 4.0.0
4422
        fi
4423
    done
4424
fi
4425
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4426
# this should be moved somewhere else
1 by Adam Conrad
Import upstream version 4.0.0
4427
case "$PLATFORM" in
4428
aix-*)
4429
    AIX_VERSION=`uname -v`
4430
    if [ "$AIX_VERSION" -lt "5" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4431
	QMakeVar add QMAKE_LIBS_X11 -lbind
1 by Adam Conrad
Import upstream version 4.0.0
4432
    fi
4433
    ;;
4434
*)
4435
    ;;
4436
esac
4437
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4438
#-------------------------------------------------------------------------------
4439
# generate qconfig.cpp
4440
#-------------------------------------------------------------------------------
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4441
[ -d "$outpath/src/corelib/global" ] || mkdir -p "$outpath/src/corelib/global"
4442
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
4443
LICENSE_USER_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_lcnsuser=$Licensee"`
4444
LICENSE_PRODUCTS_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_lcnsprod=$Edition"`
4445
PREFIX_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_prfxpath=$QT_INSTALL_PREFIX"`
4446
DOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_INSTALL_DOCS"`
4447
HEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_INSTALL_HEADERS"`
4448
LIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_INSTALL_LIBS"`
4449
BINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_INSTALL_BINS"`
4450
PLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_INSTALL_PLUGINS"`
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4451
IMPORTS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_impspath=$QT_INSTALL_IMPORTS"`
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
4452
DATA_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_datapath=$QT_INSTALL_DATA"`
4453
TRANSLATIONS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_trnspath=$QT_INSTALL_TRANSLATIONS"`
4454
SETTINGS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_stngpath=$QT_INSTALL_SETTINGS"`
4455
EXAMPLES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_xmplpath=$QT_INSTALL_EXAMPLES"`
4456
DEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INSTALL_DEMOS"`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4457
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
4458
TODAY=`date +%Y-%m-%d`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4459
cat > "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4460
/* License Info */
4461
static const char qt_configure_licensee_str          [256 + 12] = "$LICENSE_USER_STR";
4462
static const char qt_configure_licensed_products_str [256 + 12] = "$LICENSE_PRODUCTS_STR";
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
4463
4464
/* Installation date */
4465
static const char qt_configure_installation          [12+11]    = "qt_instdate=$TODAY";
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4466
EOF
4467
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
4468
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4469
if [ ! -z "$QT_HOST_PREFIX" ]; then
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
4470
    HOSTPREFIX_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_prfxpath=$QT_HOST_PREFIX"`
4471
    HOSTDOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_HOST_PREFIX/doc"`
4472
    HOSTHEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_HOST_PREFIX/include"`
4473
    HOSTLIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_HOST_PREFIX/lib"`
4474
    HOSTBINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_HOST_PREFIX/bin"`
4475
    HOSTPLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_HOST_PREFIX/plugins"`
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4476
    HOSTIMPORTS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_impspath=$QT_HOST_PREFIX/IMPORTS"`
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
4477
    HOSTDATA_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_datapath=$QT_HOST_PREFIX"`
4478
    HOSTTRANSLATIONS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_trnspath=$QT_HOST_PREFIX/translations"`
4479
    HOSTSETTINGS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_stngpath=$QT_INSTALL_SETTINGS"`
4480
    HOSTEXAMPLES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_xmplpath=$QT_INSTALL_EXAMPLES"`
4481
    HOSTDEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INSTALL_DEMOS"`
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4482
4483
    cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
4484
4485
#if defined(QT_BOOTSTRAPPED) || defined(QT_BUILD_QMAKE)
4486
/* Installation Info */
4487
static const char qt_configure_prefix_path_str       [256 + 12] = "$HOSTPREFIX_PATH_STR";
4488
static const char qt_configure_documentation_path_str[256 + 12] = "$HOSTDOCUMENTATION_PATH_STR";
4489
static const char qt_configure_headers_path_str      [256 + 12] = "$HOSTHEADERS_PATH_STR";
4490
static const char qt_configure_libraries_path_str    [256 + 12] = "$HOSTLIBRARIES_PATH_STR";
4491
static const char qt_configure_binaries_path_str     [256 + 12] = "$HOSTBINARIES_PATH_STR";
4492
static const char qt_configure_plugins_path_str      [256 + 12] = "$HOSTPLUGINS_PATH_STR";
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4493
static const char qt_configure_imports_path_str      [256 + 12] = "$HOSTIMPORTS_PATH_STR";
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4494
static const char qt_configure_data_path_str         [256 + 12] = "$HOSTDATA_PATH_STR";
4495
static const char qt_configure_translations_path_str [256 + 12] = "$HOSTTRANSLATIONS_PATH_STR";
4496
static const char qt_configure_settings_path_str     [256 + 12] = "$HOSTSETTINGS_PATH_STR";
4497
static const char qt_configure_examples_path_str     [256 + 12] = "$HOSTEXAMPLES_PATH_STR";
4498
static const char qt_configure_demos_path_str        [256 + 12] = "$HOSTDEMOS_PATH_STR";
4499
#else // QT_BOOTSTRAPPED
4500
EOF
4501
fi
4502
4503
cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4504
/* Installation Info */
4505
static const char qt_configure_prefix_path_str       [256 + 12] = "$PREFIX_PATH_STR";
4506
static const char qt_configure_documentation_path_str[256 + 12] = "$DOCUMENTATION_PATH_STR";
4507
static const char qt_configure_headers_path_str      [256 + 12] = "$HEADERS_PATH_STR";
4508
static const char qt_configure_libraries_path_str    [256 + 12] = "$LIBRARIES_PATH_STR";
4509
static const char qt_configure_binaries_path_str     [256 + 12] = "$BINARIES_PATH_STR";
4510
static const char qt_configure_plugins_path_str      [256 + 12] = "$PLUGINS_PATH_STR";
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4511
static const char qt_configure_imports_path_str      [256 + 12] = "$IMPORTS_PATH_STR";
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4512
static const char qt_configure_data_path_str         [256 + 12] = "$DATA_PATH_STR";
4513
static const char qt_configure_translations_path_str [256 + 12] = "$TRANSLATIONS_PATH_STR";
4514
static const char qt_configure_settings_path_str     [256 + 12] = "$SETTINGS_PATH_STR";
4515
static const char qt_configure_examples_path_str     [256 + 12] = "$EXAMPLES_PATH_STR";
4516
static const char qt_configure_demos_path_str        [256 + 12] = "$DEMOS_PATH_STR";
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
4517
EOF
4518
4519
if [ ! -z "$QT_HOST_PREFIX" ]; then
4520
    cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
4521
#endif // QT_BOOTSTRAPPED
4522
4523
EOF
4524
fi
4525
4526
cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4527
/* strlen( "qt_lcnsxxxx" ) == 12 */
4528
#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;
4529
#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;
4530
#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12;
4531
#define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;
4532
#define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;
4533
#define QT_CONFIGURE_LIBRARIES_PATH qt_configure_libraries_path_str + 12;
4534
#define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12;
4535
#define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4536
#define QT_CONFIGURE_IMPORTS_PATH qt_configure_imports_path_str + 12;
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4537
#define QT_CONFIGURE_DATA_PATH qt_configure_data_path_str + 12;
4538
#define QT_CONFIGURE_TRANSLATIONS_PATH qt_configure_translations_path_str + 12;
4539
#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;
4540
#define QT_CONFIGURE_EXAMPLES_PATH qt_configure_examples_path_str + 12;
4541
#define QT_CONFIGURE_DEMOS_PATH qt_configure_demos_path_str + 12;
4542
EOF
4543
4544
# avoid unecessary rebuilds by copying only if qconfig.cpp has changed
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4545
if cmp -s "$outpath/src/corelib/global/qconfig.cpp" "$outpath/src/corelib/global/qconfig.cpp.new"; then
4546
    rm -f "$outpath/src/corelib/global/qconfig.cpp.new"
4547
else
4548
    [ -f "$outpath/src/corelib/global/qconfig.cpp" ] && chmod +w "$outpath/src/corelib/global/qconfig.cpp"
4549
    mv "$outpath/src/corelib/global/qconfig.cpp.new" "$outpath/src/corelib/global/qconfig.cpp"
4550
    chmod -w "$outpath/src/corelib/global/qconfig.cpp"
4551
fi
1.1.1 by Matthias Klose
Import upstream version 4.0.1
4552
1 by Adam Conrad
Import upstream version 4.0.0
4553
# -----------------------------------------------------------------------------
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
4554
if [ "$LicenseType" = "Evaluation" ]; then
4555
    EVALKEY=`"$relpath/config.tests/unix/padstring" 524 "qt_qevalkey=$LicenseKeyExt"`
4556
elif echo "$D_FLAGS" | grep QT_EVAL >/dev/null 2>&1; then
4557
    EVALKEY=`"$relpath/config.tests/unix/padstring" 524 "qt_qevalkey="`
4558
fi
4559
4560
if [ -n "$EVALKEY" ]; then
4561
    rm -f "$outpath/src/corelib/global/qconfig_eval.cpp"
4562
    cat > "$outpath/src/corelib/global/qconfig_eval.cpp" <<EOF
4563
/* Evaluation license key */
4564
static const char qt_eval_key_data                   [512 + 12] = "$EVALKEY";
4565
EOF
4566
    chmod -w "$outpath/src/corelib/global/qconfig_eval.cpp"
4567
fi
4568
4569
4570
# -----------------------------------------------------------------------------
1 by Adam Conrad
Import upstream version 4.0.0
4571
# build qmake
4572
# -----------------------------------------------------------------------------
4573
4574
# symlink includes
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4575
if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
4576
    SYNCQT_OPTS=
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4577
    [ "$CFG_DEV" = "yes" ] && SYNCQT_OPTS="$SYNCQT_OPTS -check-includes"
1 by Adam Conrad
Import upstream version 4.0.0
4578
    if [ "$OPT_SHADOW" = "yes" ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4579
        "$outpath/bin/syncqt" $SYNCQT_OPTS
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4580
    elif [ "$CFG_DEV" = "yes" ] || [ ! -d $relpath/include ] || [ -d $relpath/.git ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4581
        QTDIR="$relpath" perl "$outpath/bin/syncqt" $SYNCQT_OPTS
1 by Adam Conrad
Import upstream version 4.0.0
4582
    fi
4583
fi
4584
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4585
# $1: variable name
4586
# $2: optional transformation
4587
# relies on $QMAKESPEC, $COMPILER_CONF and $mkfile being set correctly, as the latter
4588
# is where the resulting variable is written to
4589
setBootstrapVariable()
4590
{
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
4591
    getQMakeConf | $AWK '/^('"$1"')[^_A-Z0-9]/ { print $0; }' | ( [ -n "$2" ] && sed "$2" ; [ -z "$2" ] && cat ) | $AWK '
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4592
{
4593
    varLength = index($0, "=") - 1
4594
    valStart = varLength + 2
4595
    if (substr($0, varLength, 1) == "+") {
4596
        varLength = varLength - 1
4597
        valStart = valStart + 1
4598
    }
4599
    var = substr($0, 0, varLength)
4600
    gsub("[ \t]+", "", var)
4601
    val = substr($0, valStart)
4602
    printf "%s_%s = %s\n", var, NR, val
4603
}
4604
END {
4605
    if (length(var) > 0) {
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
4606
        printf "%s =", var
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4607
        for (i = 1; i <= NR; ++i)
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
4608
            printf " $(%s_%s)", var, i
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4609
        printf "\n"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4610
    }
4611
}' >> "$mkfile"
4612
}
4613
1 by Adam Conrad
Import upstream version 4.0.0
4614
# build qmake
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
4615
if true; then ###[ '!' -f "$outpath/bin/qmake-qt4" ];
1 by Adam Conrad
Import upstream version 4.0.0
4616
    echo "Creating qmake. Please wait..."
4617
4618
    OLD_QCONFIG_H=
4619
    QCONFIG_H="$outpath/src/corelib/global/qconfig.h"
4620
    QMAKE_QCONFIG_H="${QCONFIG_H}.qmake"
4621
    if [ -f "$QCONFIG_H" ]; then
4622
         OLD_QCONFIG_H=$QCONFIG_H
4623
         mv -f "$OLD_QCONFIG_H" "${OLD_QCONFIG_H}.old"
4624
    fi
4625
4626
    # create temporary qconfig.h for compiling qmake, if it doesn't exist
4627
    # when building qmake, we use #defines for the install paths,
4628
    # however they are real functions in the library
4629
    if [ '!' -f "$QMAKE_QCONFIG_H" ]; then
4630
        mkdir -p "$outpath/src/corelib/global"
4631
        [ -f "$QCONFIG_H" ] && chmod +w "$QCONFIG_H"
4632
        echo "/* All features enabled while building qmake */" >"$QMAKE_QCONFIG_H"
4633
    fi
4634
4635
    mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
4636
4637
    #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
4638
    rm -rf mkspecs/default
4639
    if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null ; then
4640
#Link is not supported for Symbian build system
4641
        cp -a mkspecs/`echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
4642
    else
4643
        ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
4644
    fi
1 by Adam Conrad
Import upstream version 4.0.0
4645
    # fix makefiles
4646
    for mkfile in GNUmakefile Makefile; do
4647
        EXTRA_LFLAGS=
4648
        EXTRA_CFLAGS=
4649
        in_mkfile="${mkfile}.in"
4650
        if [ "$mkfile" = "Makefile" ]; then
4651
#           if which qmake >/dev/null 2>&1 && [ -f qmake/qmake.pro ]; then
4652
#               (cd qmake && qmake) >/dev/null 2>&1 && continue
4653
#           fi
4654
            in_mkfile="${mkfile}.unix"
4655
        fi
4656
        in_mkfile="$relpath/qmake/$in_mkfile"
4657
        mkfile="$outpath/qmake/$mkfile"
4658
        if [ -f "$mkfile" ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
4659
            [ "$CFG_DEV" = "yes" ] && "$WHICH" chflags >/dev/null 2>&1 && chflags nouchg "$mkfile"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4660
            rm -f "$mkfile"
1 by Adam Conrad
Import upstream version 4.0.0
4661
        fi
4662
        [ -f "$in_mkfile" ] || continue
4663
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4664
        echo "########################################################################" > "$mkfile"
4665
        echo "## This file was autogenerated by configure, all changes will be lost ##" >> "$mkfile"
4666
        echo "########################################################################" >> "$mkfile"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4667
        EXTRA_OBJS=
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4668
        EXTRA_SRCS=
1 by Adam Conrad
Import upstream version 4.0.0
4669
        EXTRA_CFLAGS="\$(QMAKE_CFLAGS)"
4670
        EXTRA_CXXFLAGS="\$(QMAKE_CXXFLAGS)"
4671
        EXTRA_LFLAGS="\$(QMAKE_LFLAGS)"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4672
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4673
        if [ "$PLATFORM" = "irix-cc" ] || [ "$PLATFORM" = "irix-cc-64" ]; then
4674
	    EXTRA_LFLAGS="$EXTRA_LFLAGS -lm"
4675
        fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4676
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4677
	[ -n "$CC" ] && echo "CC = $CC" >> "$mkfile"
4678
	[ -n "$CXX" ] && echo "CXX = $CXX" >> "$mkfile"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4679
        if [ "$CFG_SILENT" = "yes" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4680
            [ -z "$CC" ] && setBootstrapVariable QMAKE_CC 's,QMAKE_CC.*=,CC=\@,'
4681
            [ -z "$CXX" ] && setBootstrapVariable QMAKE_CXX 's,QMAKE_CXX.*=,CXX=\@,'
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4682
        else
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4683
            [ -z "$CC" ] && setBootstrapVariable QMAKE_CC 's,QMAKE_CC,CC,'
4684
            [ -z "$CXX" ] && setBootstrapVariable QMAKE_CXX 's,QMAKE_CXX,CXX,'
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4685
        fi
4686
        setBootstrapVariable QMAKE_CFLAGS
4687
        setBootstrapVariable QMAKE_CXXFLAGS 's,\$\$QMAKE_CFLAGS,\$(QMAKE_CFLAGS),'
4688
        setBootstrapVariable QMAKE_LFLAGS
4689
4690
        if [ $QT_EDITION = "QT_EDITION_OPENSOURCE" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
4691
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DQMAKE_OPENSOURCE_EDITION"
4692
            EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -DQMAKE_OPENSOURCE_EDITION"
4693
        fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4694
        if [ "$CFG_RELEASE_QMAKE" = "yes" ]; then
4695
            setBootstrapVariable QMAKE_CFLAGS_RELEASE
4696
            setBootstrapVariable QMAKE_CXXFLAGS_RELEASE 's,\$\$QMAKE_CFLAGS_RELEASE,\$(QMAKE_CFLAGS_RELEASE),'
4697
            EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
4698
            EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_RELEASE)"
4699
        elif [ "$CFG_DEBUG" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4700
            setBootstrapVariable QMAKE_CFLAGS_DEBUG
4701
            setBootstrapVariable QMAKE_CXXFLAGS_DEBUG 's,\$\$QMAKE_CFLAGS_DEBUG,\$(QMAKE_CFLAGS_DEBUG),'
1 by Adam Conrad
Import upstream version 4.0.0
4702
            EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_DEBUG)"
4703
            EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_DEBUG)"
4704
        fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4705
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
4706
        if [ '!' -z "$RPATH_FLAGS" ] && [ '!' -z "`getQMakeConf \"$QMAKESPEC\" | $AWK '/QMAKE_(LFLAGS_)?RPATH/ {print $3;}'`" ]; then
4707
            setBootstrapVariable "QMAKE_(LFLAGS_)?RPATH" 's,\$\$LITERAL_WHITESPACE, ,;s,QMAKE_RPATH,QMAKE_LFLAGS_RPATH,'
4708
            for rpath in $RPATH_FLAGS; do
4709
                EXTRA_LFLAGS="\$(QMAKE_LFLAGS_RPATH)\"$rpath\" $EXTRA_LFLAGS"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4710
            done
4711
        fi
1 by Adam Conrad
Import upstream version 4.0.0
4712
        if [ "$PLATFORM_MAC" = "yes" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4713
            echo "export MACOSX_DEPLOYMENT_TARGET = 10.4" >> "$mkfile"
1.1.11 by Jonathan Riddell
Import upstream version 4.3.1
4714
            echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
4715
            echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"
1 by Adam Conrad
Import upstream version 4.0.0
4716
            EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
4717
            EXTRA_CFLAGS="$EXTRA_CFLAGS \$(CARBON_CFLAGS)"
1.1.11 by Jonathan Riddell
Import upstream version 4.3.1
4718
            EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4719
            EXTRA_OBJS="qsettings_mac.o qcore_mac.o"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4720
            EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\""
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
4721
	    if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then # matches both x86 and x86_64
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4722
		X86_CFLAGS="-arch i386"
4723
		X86_LFLAGS="-arch i386"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4724
		EXTRA_CFLAGS="$X86_CFLAGS $EXTRA_CFLAGS"
4725
		EXTRA_CXXFLAGS="$X86_CFLAGS $EXTRA_CXXFLAGS"
4726
                EXTRA_LFLAGS="$EXTRA_LFLAGS $X86_LFLAGS"
4727
            fi
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
4728
	    if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then # matches both ppc and ppc64
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
4729
		PPC_CFLAGS="-arch ppc"
4730
		PPC_LFLAGS="-arch ppc"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4731
		EXTRA_CFLAGS="$PPC_CFLAGS $EXTRA_CFLAGS"
4732
		EXTRA_CXXFLAGS="$PPC_CFLAGS $EXTRA_CXXFLAGS"
4733
                EXTRA_LFLAGS="$EXTRA_LFLAGS $PPC_LFLAGS"
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
4734
            fi
4735
	    if [ '!' -z "$CFG_SDK" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4736
		echo "SDK_LFLAGS =-Wl,-syslibroot,$CFG_SDK" >>"$mkfile"
4737
		echo "SDK_CFLAGS =-isysroot $CFG_SDK" >>"$mkfile"
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
4738
		EXTRA_CFLAGS="$EXTRA_CFLAGS \$(SDK_CFLAGS)"
4739
		EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(SDK_CFLAGS)"
4740
		EXTRA_LFLAGS="$EXTRA_LFLAGS \$(SDK_LFLAGS)"
4741
            fi
1 by Adam Conrad
Import upstream version 4.0.0
4742
        fi
4743
        [ "$CFG_EMBEDDED" != "no" ] && EXTRA_CFLAGS="$EXTRA_CFLAGS -DQWS"
4744
        if [ '!' -z "$D_FLAGS" ]; then
4745
            for DEF in $D_FLAGS; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4746
                EXTRA_CFLAGS="$EXTRA_CFLAGS \"-D${DEF}\""
1 by Adam Conrad
Import upstream version 4.0.0
4747
            done
4748
        fi
4749
        QMAKE_BIN_DIR="$QT_INSTALL_BINS"
4750
        [ -z "$QMAKE_BIN_DIR" ] && QMAKE_BIN_DIR="${QT_INSTALL_PREFIX}/bin"
4751
        QMAKE_DATA_DIR="$QT_INSTALL_DATA"
4752
        [ -z "$QMAKE_DATA_DIR" ] && QMAKE_DATA_DIR="${QT_INSTALL_PREFIX}"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4753
        echo >>"$mkfile"
4754
	adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`
4755
	adjoutpath=`echo "$outpath" | sed 's/ /\\\\\\\\ /g'`
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4756
	adjqmakespec=`echo "$QMAKESPEC" | sed 's/ /\\\\\\\\ /g'`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4757
        sed -e "s,@SOURCE_PATH@,$adjrelpath,g" -e "s,@BUILD_PATH@,$adjoutpath,g" \
1 by Adam Conrad
Import upstream version 4.0.0
4758
            -e "s,@QMAKE_CFLAGS@,$EXTRA_CFLAGS,g" -e "s,@QMAKE_LFLAGS@,$EXTRA_LFLAGS,g" \
4759
            -e "s,@QMAKE_CXXFLAGS@,$EXTRA_CXXFLAGS,g" \
4760
            -e "s,@QT_INSTALL_BINS@,\$(INSTALL_ROOT)$QMAKE_BIN_DIR,g" \
4761
            -e "s,@QT_INSTALL_DATA@,\$(INSTALL_ROOT)$QMAKE_DATA_DIR,g" \
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4762
            -e "s,@QMAKE_QTOBJS@,$EXTRA_OBJS,g" -e "s,@QMAKE_QTSRCS@,$EXTRA_SRCS,g" \
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4763
	    -e "s,@QMAKESPEC@,$adjqmakespec,g" "$in_mkfile" >>"$mkfile"
1 by Adam Conrad
Import upstream version 4.0.0
4764
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4765
        if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
4766
            (cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4767
	    sed "s,^.*/\([^/]*.o\):,\1:,g" "$mkfile" >"$mkfile.tmp"
4768
	    sed "s,$outpath,$adjoutpath,g" "$mkfile.tmp" >"$mkfile"
4769
	    rm "$mkfile.tmp"
1 by Adam Conrad
Import upstream version 4.0.0
4770
        fi
4771
    done
4772
4773
    QMAKE_BUILD_ERROR=no
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
4774
    (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes
1 by Adam Conrad
Import upstream version 4.0.0
4775
    [ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake
4776
    [ '!' -z "$OLD_QCONFIG_H" ] && mv -f "${OLD_QCONFIG_H}.old" "$OLD_QCONFIG_H" #put back qconfig.h
4777
    [ "$QMAKE_BUILD_ERROR" = "yes" ] && exit 2
4778
fi # Build qmake
4779
4780
#-------------------------------------------------------------------------------
4781
# tests that need qmake
4782
#-------------------------------------------------------------------------------
4783
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4784
# detect availability of float math.h functions
4785
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/floatmath "floatmath" $L_FLAGS $I_FLAGS $l_FLAGS; then
4786
    CFG_USE_FLOATMATH=yes
4787
else
4788
    CFG_USE_FLOATMATH=no
4789
fi
4790
4791
# detect mmx support
4792
if [ "${CFG_MMX}" = "auto" ]; then
4793
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mmx "mmx" $L_FLAGS $I_FLAGS $l_FLAGS "-mmmx"; then
4794
	CFG_MMX=yes
4795
    else
4796
	CFG_MMX=no
4797
    fi
4798
fi
4799
4800
# detect 3dnow support
4801
if [ "${CFG_3DNOW}" = "auto" ]; then
4802
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/3dnow "3dnow" $L_FLAGS $I_FLAGS $l_FLAGS "-m3dnow"; then
4803
	CFG_3DNOW=yes
4804
    else
4805
	CFG_3DNOW=no
4806
    fi
4807
fi
4808
4809
# detect sse support
4810
if [ "${CFG_SSE}" = "auto" ]; then
4811
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse "sse" $L_FLAGS $I_FLAGS $l_FLAGS "-msse"; then
4812
	CFG_SSE=yes
4813
    else
4814
	CFG_SSE=no
4815
    fi
4816
fi
4817
4818
# detect sse2 support
4819
if [ "${CFG_SSE2}" = "auto" ]; then
4820
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse2 "sse2" $L_FLAGS $I_FLAGS $l_FLAGS "-msse2"; then
4821
       CFG_SSE2=yes
4822
    else
4823
       CFG_SSE2=no
4824
    fi
4825
fi
4826
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
4827
# detect sse3 support
4828
if [ "${CFG_SSE3}" = "auto" ]; then
4829
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse3 "sse3" $L_FLAGS $I_FLAGS $l_FLAGS "-msse3"; then
4830
       CFG_SSE3=yes
4831
    else
4832
       CFG_SSE3=no
4833
    fi
4834
fi
4835
4836
# detect ssse3 support
4837
if [ "${CFG_SSSE3}" = "auto" ]; then
4838
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ssse3 "ssse3" $L_FLAGS $I_FLAGS $l_FLAGS "-mssse3"; then
4839
       CFG_SSSE3=yes
4840
    else
4841
       CFG_SSSE3=no
4842
    fi
4843
fi
4844
4845
# detect sse4.1 support
4846
if [ "${CFG_SSE4_1}" = "auto" ]; then
4847
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse4_1 "sse4_1" $L_FLAGS $I_FLAGS $l_FLAGS "-msse4.1"; then
4848
       CFG_SSE4_1=yes
4849
    else
4850
       CFG_SSE4_1=no
4851
    fi
4852
fi
4853
4854
# detect sse4.2 support
4855
if [ "${CFG_SSE4_2}" = "auto" ]; then
4856
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse4_2 "sse4_2" $L_FLAGS $I_FLAGS $l_FLAGS "-msse4.2"; then
4857
       CFG_SSE4_2=yes
4858
    else
4859
       CFG_SSE4_2=no
4860
    fi
4861
fi
4862
4863
# detect avx support
4864
if [ "${CFG_AVX}" = "auto" ]; then
4865
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/avx "avx" $L_FLAGS $I_FLAGS $l_FLAGS "-mavx"; then
4866
       CFG_AVX=yes
4867
    else
4868
       CFG_AVX=no
4869
    fi
4870
fi
4871
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4872
# check iWMMXt support
4873
if [ "$CFG_IWMMXT" = "yes" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4874
    "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $l_FLAGS "-mcpu=iwmmxt"
4875
    if [ $? != "0" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
4876
        echo "The iWMMXt functionality test failed!"
4877
	echo " Please make sure your compiler supports iWMMXt intrinsics!"
4878
	exit 1
4879
    fi
4880
fi
4881
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
4882
# detect neon support
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
4883
if ( [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ] ) && [ "${CFG_NEON}" = "auto" ]; then
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
4884
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/neon "neon" $L_FLAGS $I_FLAGS $l_FLAGS "-mfpu=neon"; then
4885
	CFG_NEON=yes
4886
    else
4887
	CFG_NEON=no
4888
    fi
4889
fi
4890
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4891
# detect zlib
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
4892
if [ "$CFG_ZLIB" = "no" ]; then
4893
    # Note: Qt no longer support builds without zlib
4894
    # So we force a "no" to be "auto" here.
4895
    # If you REALLY really need no zlib support, you can still disable
4896
    # it by doing the following:
4897
    #   add "no-zlib" to mkspecs/qconfig.pri
4898
    #   #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
4899
    #
4900
    # There's no guarantee that Qt will build under those conditions
4901
4902
    CFG_ZLIB=auto
4903
    ZLIB_FORCED=yes
4904
fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4905
if [ "$CFG_ZLIB" = "auto" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
4906
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/zlib "zlib" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4907
       CFG_ZLIB=system
4908
    else
4909
       CFG_ZLIB=yes
4910
    fi
4911
fi
4912
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
4913
[ "$XPLATFORM_MINGW" = "yes" ] && QMakeVar add styles "windowsxp windowsvista"
4914
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
4915
case "$XPLATFORM" in *symbian*)
4916
    QMakeVar set styles "windows s60"   #overwrite previous default
4917
    CFG_LIBFREETYPE=no
4918
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
4919
    if [ "$CFG_LARGEFILE" = auto ]; then
4920
        CFG_LARGEFILE=no
4921
    fi
4922
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
4923
    if test -z "$EPOCROOT"; then
4924
        echo "Please export EPOCROOT. It should point to the sdk install dir"
4925
        exit 1
4926
    fi
4927
    if test ! -d "$EPOCROOT/epoc32"; then
4928
        echo "Could not find the 'epoc32' dir in your EPOCROOT."
4929
        exit 1
4930
    fi
4931
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
4932
    if ! echo $XPLATFORM | grep symbian-sbsv2 > /dev/null; then
4933
        # Raptor does not support configure tests.
4934
4935
        # the main commands needed to compile;
4936
        (cd config.tests/symbian
4937
            mkdir -p rcomp
4938
            cd rcomp
4939
            rm -f rcomp_test.rsg
4940
            touch rcomp_test.rpp rcomp_test.rsc rcomp_test.rss
4941
            rcomp -u -m045,046,047 -s./rcomp_test.rpp -o./rcomp_test.rsc -h./rcomp_test.rsg -i./rcomp_test.rss 2>&1 > /dev/null
4942
            if test ! -f rcomp_test.rsg; then
4943
                echo "Finding a working rcomp in your PATH failed."
4944
                echo "Fatal error. Make sure you have the epoc tools working and in your PATH";
4945
                exit 1;
4946
            fi
4947
        )
4948
4949
        # compile a simple main that uses printf
4950
        if ! "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/simple "simple" $L_FLAGS $I_FLAGS $l_FLAGS
4951
        then
4952
            echo "Testing your compiler failed. Could not compile a simple application."
4953
            echo "Fatal error; Rerun configure with -verbose to get more details."
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
4954
            exit 1;
4955
        fi
4956
    fi
4957
    ;;
4958
esac
4959
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
4960
if [ "$CFG_LARGEFILE" = "auto" ]; then
4961
    #Large files should be enabled for all Linux systems
4962
    CFG_LARGEFILE=yes
4963
fi
4964
4965
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
4966
if [ "$CFG_S60" = "auto" ]; then
4967
    if echo "$XPLATFORM" | grep symbian > /dev/null; then
4968
        CFG_S60=yes
4969
    else
4970
        CFG_S60=no
4971
    fi
4972
fi
4973
4974
if [ "$CFG_QS60STYLE" = "auto" ]; then
4975
    if echo "$XPLATFORM" | grep symbian > /dev/null; then
4976
        CFG_QS60STYLE=qt
4977
    else
4978
        CFG_QS60STYLE=no
4979
    fi
4980
fi
4981
4982
if [ "$CFG_SYMBIAN_DEFFILES" = "auto" ]; then
4983
    if echo "$XPLATFORM" | grep symbian > /dev/null && [ "$CFG_DEV" = "no" ]; then
4984
        CFG_SYMBIAN_DEFFILES=yes
4985
    else
4986
        CFG_SYMBIAN_DEFFILES=no
4987
    fi
4988
fi
4989
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
4990
# detect how jpeg should be built
4991
if [ "$CFG_JPEG" = "auto" ]; then
4992
    if [ "$CFG_SHARED" = "yes" ]; then
4993
        CFG_JPEG=plugin
4994
    else
4995
        CFG_JPEG=yes
4996
    fi
4997
fi
4998
# detect jpeg
4999
if [ "$CFG_LIBJPEG" = "auto" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5000
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libjpeg "libjpeg" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5001
       CFG_LIBJPEG=system
5002
    else
5003
       CFG_LIBJPEG=qt
5004
    fi
5005
fi
5006
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5007
# detect how gif should be built
5008
if [ "$CFG_GIF" = "auto" ]; then
5009
    if [ "$CFG_SHARED" = "yes" ]; then
5010
        CFG_GIF=plugin
5011
    else
5012
        CFG_GIF=yes
5013
    fi
5014
fi
5015
5016
# detect how tiff should be built
5017
if [ "$CFG_TIFF" = "auto" ]; then
5018
    if [ "$CFG_SHARED" = "yes" ]; then
5019
        CFG_TIFF=plugin
5020
    else
5021
        CFG_TIFF=yes
5022
    fi
5023
fi
5024
5025
# detect tiff
5026
if [ "$CFG_LIBTIFF" = "auto" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5027
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libtiff "libtiff" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5028
        CFG_LIBTIFF=system
5029
    else
5030
        CFG_LIBTIFF=qt
5031
    fi
5032
fi
5033
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5034
# detect how mng should be built
5035
if [ "$CFG_MNG" = "auto" ]; then
5036
    if [ "$CFG_SHARED" = "yes" ]; then
5037
        CFG_MNG=plugin
5038
    else
5039
        CFG_MNG=yes
5040
    fi
5041
fi
5042
# detect mng
5043
if [ "$CFG_LIBMNG" = "auto" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5044
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libmng "libmng" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5045
       CFG_LIBMNG=system
5046
    else
5047
       CFG_LIBMNG=qt
5048
    fi
5049
fi
5050
5051
# detect png
5052
if [ "$CFG_LIBPNG" = "auto" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5053
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libpng "libpng" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5054
       CFG_LIBPNG=system
5055
    else
5056
       CFG_LIBPNG=qt
5057
    fi
5058
fi
5059
5060
# detect accessibility
5061
if [ "$CFG_ACCESSIBILITY" = "auto" ]; then
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5062
    case "$XPLATFORM" in
5063
    symbian*)
5064
        # accessibility is currently unsupported
5065
        CFG_ACCESSIBILITY=no
5066
    ;;
5067
    *)
5068
        CFG_ACCESSIBILITY=yes
5069
    esac
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5070
fi
5071
5072
# auto-detect SQL-modules support
5073
for _SQLDR in $CFG_SQL_AVAILABLE; do
5074
        case $_SQLDR in
5075
        mysql)
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5076
            if [ "$CFG_SQL_mysql" != "no" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5077
		[ -z "$CFG_MYSQL_CONFIG" ] && CFG_MYSQL_CONFIG=`"$WHICH" mysql_config`
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5078
                if [ -x "$CFG_MYSQL_CONFIG" ]; then
5079
                    QT_CFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --include 2>/dev/null`
5080
                    QT_LFLAGS_MYSQL_R=`$CFG_MYSQL_CONFIG --libs_r 2>/dev/null`
5081
                    QT_LFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --libs 2>/dev/null`
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5082
		    QT_MYSQL_VERSION=`$CFG_MYSQL_CONFIG --version 2>/dev/null`
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5083
                    QT_MYSQL_VERSION_MAJOR=`echo $QT_MYSQL_VERSION | cut -d . -f 1`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5084
                fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5085
                if [ -n "$QT_MYSQL_VERSION" ] && [ "$QT_MYSQL_VERSION_MAJOR" -lt 4 ]; then
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5086
                    if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5087
                        echo "This version of MySql is not supported ($QT_MYSQL_VERSION)."
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5088
                        echo " You need MySql 4 or higher."
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5089
                        echo " If you believe this message is in error you may use the continue"
5090
                        echo " switch (-continue) to $0 to continue."
5091
                        exit 101
5092
                    else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5093
                        CFG_SQL_mysql="no"
1.1.8 by Jonathan Riddell
Import upstream version 4.2.2
5094
			QT_LFLAGS_MYSQL=""
5095
			QT_LFLAGS_MYSQL_R=""
5096
			QT_CFLAGS_MYSQL=""
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5097
                    fi
5098
                else
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5099
                    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mysql_r "MySQL (thread-safe)" $QT_LFLAGS_MYSQL_R $L_FLAGS $QT_CFLAGS_MYSQL $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5100
                        QMakeVar add CONFIG use_libmysqlclient_r
5101
                        if [ "$CFG_SQL_mysql" = "auto" ]; then
5102
                            CFG_SQL_mysql=plugin
5103
                        fi
5104
                        QT_LFLAGS_MYSQL="$QT_LFLAGS_MYSQL_R"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5105
                    elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mysql "MySQL (thread-unsafe)" $QT_LFLAGS_MYSQL $L_FLAGS $QT_CFLAGS_MYSQL $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5106
                        if [ "$CFG_SQL_mysql" = "auto" ]; then
5107
                            CFG_SQL_mysql=plugin
5108
                        fi
5109
                    else
5110
                        if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5111
                            echo "MySQL support cannot be enabled due to functionality tests!"
5112
                            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5113
                            echo " If you believe this message is in error you may use the continue"
5114
                            echo " switch (-continue) to $0 to continue."
5115
                            exit 101
5116
                        else
5117
                            CFG_SQL_mysql=no
5118
			    QT_LFLAGS_MYSQL=""
5119
			    QT_LFLAGS_MYSQL_R=""
5120
			    QT_CFLAGS_MYSQL=""
5121
                        fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5122
                    fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5123
                fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5124
            fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5125
            ;;
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5126
        psql)
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5127
            if [ "$CFG_SQL_psql" != "no" ]; then
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5128
                # Be careful not to use native pg_config when cross building.
5129
                if [ "$XPLATFORM_MINGW" != "yes" ] && "$WHICH" pg_config >/dev/null 2>&1; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5130
                    QT_CFLAGS_PSQL=`pg_config --includedir 2>/dev/null`
5131
                    QT_LFLAGS_PSQL=`pg_config --libdir 2>/dev/null`
5132
                fi
5133
                [ -z "$QT_CFLAGS_PSQL" ] || QT_CFLAGS_PSQL="-I$QT_CFLAGS_PSQL"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5134
                [ -z "$QT_LFLAGS_PSQL" ] || QT_LFLAGS_PSQL="-L$QT_LFLAGS_PSQL"
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5135
                # But, respect PSQL_LIBS if set
5136
                [ -z "$PSQL_LIBS" ] || QT_LFLAGS_PSQL="$PSQL_LIBS"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5137
                if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/psql "PostgreSQL" $QT_LFLAGS_PSQL $L_FLAGS $QT_CFLAGS_PSQL $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5138
                    if [ "$CFG_SQL_psql" = "auto" ]; then
5139
                        CFG_SQL_psql=plugin
5140
                    fi
5141
                else
5142
                    if [ "$CFG_SQL_psql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5143
                        echo "PostgreSQL support cannot be enabled due to functionality tests!"
5144
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5145
                        echo " If you believe this message is in error you may use the continue"
5146
                        echo " switch (-continue) to $0 to continue."
5147
                        exit 101
5148
                    else
5149
                        CFG_SQL_psql=no
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5150
                        QT_CFLAGS_PSQL=""
5151
                        QT_LFLAGS_PSQL=""
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5152
                    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5153
                fi
5154
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5155
        ;;
5156
        odbc)
5157
            if [ "$CFG_SQL_odbc" != "no" ]; then
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5158
                if ( [ "$PLATFORM_MAC" != "yes" ] || [ "$XPLATFORM_MINGW" = "yes" ] ) && "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/odbc "ODBC" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5159
                    if [ "$CFG_SQL_odbc" = "auto" ]; then
5160
                        CFG_SQL_odbc=plugin
5161
                    fi
5162
                else
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5163
                    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iodbc "iODBC" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
5164
                        QT_LFLAGS_ODBC="-liodbc"
5165
                        if [ "$CFG_SQL_odbc" = "auto" ]; then
5166
                            CFG_SQL_odbc=plugin
5167
                        fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5168
                    else
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5169
                        if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5170
                            echo "ODBC support cannot be enabled due to functionality tests!"
5171
                            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5172
                            echo " If you believe this message is in error you may use the continue"
5173
                            echo " switch (-continue) to $0 to continue."
5174
                            exit 101
5175
                        else
5176
                            CFG_SQL_odbc=no
5177
                        fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5178
                    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5179
                fi
5180
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5181
            ;;
5182
        oci)
5183
            if [ "$CFG_SQL_oci" != "no" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5184
                if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/oci "OCI" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5185
                    if [ "$CFG_SQL_oci" = "auto" ]; then
5186
                        CFG_SQL_oci=plugin
5187
                    fi
5188
                else
5189
                    if [ "$CFG_SQL_oci" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5190
                        echo "Oracle (OCI) support cannot be enabled due to functionality tests!"
5191
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5192
                        echo " If you believe this message is in error you may use the continue"
5193
                        echo " switch (-continue) to $0 to continue."
5194
                        exit 101
5195
                    else
5196
                        CFG_SQL_oci=no
5197
                    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5198
                fi
5199
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5200
            ;;
5201
        tds)
5202
            if [ "$CFG_SQL_tds" != "no" ]; then
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
5203
                [ -z "$SYBASE" ] || QT_LFLAGS_TDS="-L$SYBASE/lib"
5204
                [ -z "$SYBASE_LIBS" ] || QT_LFLAGS_TDS="$QT_LFLAGS_TDS $SYBASE_LIBS"
5205
                if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tds "TDS" $QT_LFLAGS_TDS $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5206
                    if [ "$CFG_SQL_tds" = "auto" ]; then
5207
                        CFG_SQL_tds=plugin
5208
                    fi
5209
                else
5210
                    if [ "$CFG_SQL_tds" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5211
                        echo "TDS support cannot be enabled due to functionality tests!"
5212
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5213
                        echo " If you believe this message is in error you may use the continue"
5214
                        echo " switch (-continue) to $0 to continue."
5215
                        exit 101
5216
                    else
5217
                        CFG_SQL_tds=no
5218
                    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5219
                fi
5220
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5221
            ;;
5222
        db2)
5223
            if [ "$CFG_SQL_db2" != "no" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5224
                if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/db2 "DB2" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5225
                    if [ "$CFG_SQL_db2" = "auto" ]; then
5226
                        CFG_SQL_db2=plugin
5227
                    fi
5228
                else
5229
                    if [ "$CFG_SQL_db2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5230
                        echo "ODBC support cannot be enabled due to functionality tests!"
5231
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5232
                        echo " If you believe this message is in error you may use the continue"
5233
                        echo " switch (-continue) to $0 to continue."
5234
                        exit 101
5235
                    else
5236
                        CFG_SQL_db2=no
5237
                    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5238
                fi
5239
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5240
            ;;
5241
        ibase)
5242
            if [ "$CFG_SQL_ibase" != "no" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5243
                if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ibase "InterBase" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5244
                    if [ "$CFG_SQL_ibase" = "auto" ]; then
5245
                        CFG_SQL_ibase=plugin
5246
                    fi
5247
                else
5248
                    if [ "$CFG_SQL_ibase" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5249
                        echo "InterBase support cannot be enabled due to functionality tests!"
5250
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5251
                        echo " If you believe this message is in error you may use the continue"
5252
                        echo " switch (-continue) to $0 to continue."
5253
                        exit 101
5254
                    else
5255
                        CFG_SQL_ibase=no
5256
                    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5257
                fi
5258
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5259
            ;;
5260
        sqlite2)
5261
            if [ "$CFG_SQL_sqlite2" != "no" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5262
                if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sqlite2 "SQLite2" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5263
                    if [ "$CFG_SQL_sqlite2" = "auto" ]; then
5264
                        CFG_SQL_sqlite2=plugin
5265
                    fi
5266
                else
5267
                    if [ "$CFG_SQL_sqlite2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5268
                        echo "SQLite2 support cannot be enabled due to functionality tests!"
5269
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5270
                        echo " If you believe this message is in error you may use the continue"
5271
                        echo " switch (-continue) to $0 to continue."
5272
                        exit 101
5273
                    else
5274
                        CFG_SQL_sqlite2=no
5275
                    fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5276
                fi
5277
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5278
            ;;
5279
        sqlite)
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5280
            if [ "$CFG_SQL_sqlite" = "auto" ]; then # the default
5281
                case "$XPLATFORM" in
5282
                    symbian*)
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
5283
                    # sqlite on symbian is typically not build in Qt but deployed as a pre-existing sis file and should be marked as driver.
5284
                    # Configuration parameters should be set
5285
                    CFG_SQL_sqlite=qt
5286
                    QT_LFLAGS_SQLITE=-lsqlite3
5287
                    QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5288
                    ;;
5289
                esac
5290
            fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5291
            if [ "$CFG_SQL_sqlite" != "no" ]; then
5292
                SQLITE_AUTODETECT_FAILED="no"
5293
                if [ "$CFG_SQLITE" = "system" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5294
                    if [ -n "$PKG_CONFIG" ]; then
5295
                        QT_CFLAGS_SQLITE=`$PKG_CONFIG --cflags sqlite3 2>/dev/null`
5296
                        QT_LFLAGS_SQLITE=`$PKG_CONFIG --libs sqlite3 2>/dev/null`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5297
                    fi
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5298
                    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sqlite "SQLite" $QT_LFLAGS_SQLITE $L_FLAGS $QT_CFLAGS_SQLITE $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5299
                        if [ "$CFG_SQL_sqlite" = "auto" ]; then
5300
                            CFG_SQL_sqlite=plugin
5301
                        fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5302
                        QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5303
                    else
5304
                        SQLITE_AUTODETECT_FAILED="yes"
5305
                        CFG_SQL_sqlite=no
5306
                    fi
5307
                elif [ -f "$relpath/src/3rdparty/sqlite/sqlite3.h" ]; then
5308
                    if [ "$CFG_SQL_sqlite" = "auto" ]; then
5309
                            CFG_SQL_sqlite=plugin
5310
                    fi
5311
                else
5312
                    SQLITE_AUTODETECT_FAILED="yes"
5313
                    CFG_SQL_sqlite=no
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5314
                fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5315
5316
                if [ "$SQLITE_AUTODETECT_FAILED" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5317
                    echo "SQLite support cannot be enabled due to functionality tests!"
5318
                    echo " Turn on verbose messaging (-v) to $0 to see the final report."
5319
                    echo " If you believe this message is in error you may use the continue"
5320
                    echo " switch (-continue) to $0 to continue."
5321
                    exit 101
5322
                fi
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5323
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5324
            ;;
5325
        *)
5326
            if [ "$OPT_VERBOSE" = "yes" ]; then
5327
                echo "unknown SQL driver: $_SQLDR"
5328
            fi
5329
            ;;
5330
        esac
5331
done
5332
5333
# auto-detect NIS support
5334
if [ "$CFG_NIS" != "no" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5335
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/nis "NIS" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5336
        CFG_NIS=yes
5337
    else
5338
        if [ "$CFG_NIS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5339
            echo "NIS support cannot be enabled due to functionality tests!"
5340
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5341
            echo " If you believe this message is in error you may use the continue"
5342
            echo " switch (-continue) to $0 to continue."
5343
            exit 101
5344
        else
5345
            CFG_NIS=no
5346
        fi
5347
    fi
5348
fi
5349
5350
# auto-detect CUPS support
5351
if [ "$CFG_CUPS" != "no" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5352
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/cups "Cups" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5353
        CFG_CUPS=yes
5354
    else
5355
        if [ "$CFG_CUPS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5356
            echo "Cups support cannot be enabled due to functionality tests!"
5357
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5358
            echo " If you believe this message is in error you may use the continue"
5359
            echo " switch (-continue) to $0 to continue."
5360
            exit 101
5361
        else
5362
            CFG_CUPS=no
5363
        fi
5364
    fi
5365
fi
5366
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5367
# auto-detect iconv(3) support
5368
if [ "$CFG_ICONV" != "no" ]; then
5369
    if [ "$PLATFORM_QWS" = "yes" ]; then
5370
	CFG_ICONV=no
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5371
    elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/iconv" "POSIX iconv" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5372
        CFG_ICONV=yes
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5373
    elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/sun-libiconv" "SUN libiconv" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
5374
        CFG_ICONV=sun
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5375
    elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/gnu-libiconv" "GNU libiconv" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5376
        CFG_ICONV=gnu
5377
    else
5378
        if [ "$CFG_ICONV" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5379
            echo "Iconv support cannot be enabled due to functionality tests!"
5380
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5381
            echo " If you believe this message is in error you may use the continue"
5382
            echo " switch (-continue) to $0 to continue."
5383
            exit 101
5384
        else
5385
            CFG_ICONV=no
5386
        fi
5387
    fi
5388
fi
5389
5390
# auto-detect libdbus-1 support
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5391
if [ "$CFG_DBUS" != "no" ]; then
5392
    if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then
5393
        QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null`
5394
        QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5395
    fi
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5396
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/dbus "D-Bus" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_DBUS $QT_LIBS_DBUS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5397
        [ "$CFG_DBUS" = "auto" ] && CFG_DBUS=yes
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5398
        QMakeVar set QT_CFLAGS_DBUS "$QT_CFLAGS_DBUS"
5399
        QMakeVar set QT_LIBS_DBUS "$QT_LIBS_DBUS"
5400
    else
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5401
        if [ "$CFG_DBUS" = "auto" ]; then
5402
            CFG_DBUS=no
5403
        elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5404
            # CFG_DBUS is "yes" or "linked" here
5405
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5406
            echo "The QtDBus module cannot be enabled because libdbus-1 version $MIN_DBUS_1_VERSION was not found."
5407
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5408
            echo " If you believe this message is in error you may use the continue"
5409
            echo " switch (-continue) to $0 to continue."
5410
            exit 101
5411
        fi
5412
    fi
5413
fi
5414
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5415
if [ "$CFG_MULTIMEDIA" = "auto" ]; then
5416
    CFG_MULTIMEDIA="$CFG_GUI"
5417
fi
5418
5419
if [ "$CFG_MULTIMEDIA" = "yes" ] && [ "$CFG_GUI" = "no" ]; then
5420
    echo "QtMultimedia requested, but it can't be built without QtGui"
5421
    exit 1
5422
fi
5423
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5424
# Generate a CRC of the namespace for using in constants for the Carbon port.
5425
# This should mean that you really *can* load two Qt's and have our custom
5426
# Carbon events work.
5427
if [ "$PLATFORM_MAC" = "yes" -a ! -z "$QT_NAMESPACE" ]; then
5428
    QT_NAMESPACE_MAC_CRC=`"$mactests/crc.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/crc $QT_NAMESPACE $L_FLAGS $I_FLAGS $l_FLAGS`
5429
fi
5430
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5431
# X11/QWS
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5432
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5433
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5434
    # auto-detect Glib support
5435
    if [ "$CFG_GLIB" != "no" ]; then
5436
        if [ -n "$PKG_CONFIG" ]; then
5437
            QT_CFLAGS_GLIB=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0 2>/dev/null`
5438
            QT_LIBS_GLIB=`$PKG_CONFIG --libs glib-2.0 gthread-2.0 2>/dev/null`
5439
        fi
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
5440
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/glib "Glib" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_GLIB $QT_LIBS_GLIB $X11TESTS_FLAGS ; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5441
            CFG_GLIB=yes
5442
            QMakeVar set QT_CFLAGS_GLIB "$QT_CFLAGS_GLIB"
5443
            QMakeVar set QT_LIBS_GLIB "$QT_LIBS_GLIB"
5444
        else
5445
            if [ "$CFG_GLIB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5446
                echo "Glib support cannot be enabled due to functionality tests!"
5447
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5448
                echo " If you believe this message is in error you may use the continue"
5449
                echo " switch (-continue) to $0 to continue."
5450
                exit 101
5451
            else
5452
                CFG_GLIB=no
5453
            fi
5454
        fi
5455
    fi
5456
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5457
    if [ "$CFG_GUI" = "no" ]; then
5458
        if [ "$CFG_PHONON" = "auto" ]; then
5459
            CFG_PHONON=no
5460
        fi
5461
        if [ "$CFG_PHONON" != "no" ]; then
5462
            echo "Phonon enabled, but GUI disabled."
5463
            echo " You might need to either enable the GUI or disable Phonon"
5464
            exit 1
5465
        fi
5466
    fi
5467
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
5468
    # Auto-detect GStreamer support (needed for Phonon)
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5469
    if [ "$CFG_PHONON" != "no" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5470
        if [ "$CFG_GLIB" = "yes" -a "$CFG_GSTREAMER" != "no" ]; then
5471
            if [ -n "$PKG_CONFIG" ]; then
5472
                QT_CFLAGS_GSTREAMER=`$PKG_CONFIG --cflags gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
5473
                QT_LIBS_GSTREAMER=`$PKG_CONFIG --libs gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
5474
            fi
5475
            if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/gstreamer "GStreamer" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_GSTREAMER $QT_LIBS_GSTREAMER $X11TESTS_FLAGS; then
5476
                CFG_GSTREAMER=yes
5477
                QMakeVar set QT_CFLAGS_GSTREAMER "$QT_CFLAGS_GSTREAMER"
5478
                QMakeVar set QT_LIBS_GSTREAMER "$QT_LIBS_GSTREAMER"
5479
            else
5480
                if [ "$CFG_GSTREAMER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5481
                    echo "Gstreamer support cannot be enabled due to functionality tests!"
5482
                    echo " Turn on verbose messaging (-v) to $0 to see the final report."
5483
                    echo " If you believe this message is in error you may use the continue"
5484
                    echo " switch (-continue) to $0 to continue."
5485
                    exit 101
5486
                else
5487
                    CFG_GSTREAMER=no
5488
                fi
5489
            fi
5490
        elif [ "$CFG_GLIB" = "no" ]; then
5491
            CFG_GSTREAMER=no
5492
        fi
5493
    else
5494
        CFG_GSTREAMER=no
5495
    fi
5496
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5497
    if [ "$CFG_PHONON" != "no" ]; then
5498
        if [ "$CFG_PHONON_BACKEND" != "no" ]; then
5499
            if [ "$CFG_GSTREAMER" = "yes" ]; then
5500
                CFG_PHONON=yes
5501
            else
5502
                if [ "$CFG_PHONON" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5503
                    echo "Phonon support cannot be enabled due to functionality tests!"
5504
                    echo " Turn on verbose messaging (-v) to $0 to see the final report."
5505
                    echo " If you believe this message is in error you may use the continue"
5506
                    echo " switch (-continue) to $0 to continue."
5507
                    exit 101
5508
                else
5509
                    CFG_PHONON=no
5510
                fi
5511
            fi
5512
        else
5513
            CFG_PHONON=yes
5514
        fi
5515
    fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5516
5517
    # auto-detect icd support
5518
    if [ "$CFG_GLIB" = "yes" -a "$CFG_ICD" != "no" ]; then
5519
        if [ -n "$PKG_CONFIG" ]; then
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
5520
            QT_CFLAGS_CONNSETTINGS=`$PKG_CONFIG --cflags connsettings 2>/dev/null`
5521
            QT_LIBS_CONNSETTINGS=`$PKG_CONFIG --libs connsettings 2>/dev/null`
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5522
        fi
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
5523
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/icd "ICD" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_CONNSETTINGS $QT_LIBS_CONNSETTINGS; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5524
            [ "$CFG_ICD" = "auto" ] && CFG_ICD=yes
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
5525
            QMakeVar set QT_CFLAGS_CONNSETTINGS "$QT_CFLAGS_CONNSETTINGS"
5526
            QMakeVar set QT_LIBS_CONNSETTINGS "$QT_LIBS_CONNSETTINGS"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5527
        else
5528
            if [ "$CFG_ICD" = "auto" ]; then
5529
                CFG_ICD=no
5530
            elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5531
                # CFG_ICD is "yes"
5532
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
5533
                echo "The ICD Bearer Management plugin cannot be enabled because connsettings was not found."
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5534
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5535
                echo " If you believe this message is in error you may use the continue"
5536
                echo " switch (-continue) to $0 to continue."
5537
                exit 101
5538
            fi
5539
        fi
5540
    elif [ "$CFG_GLIB" = "no" ]; then
5541
        CFG_ICD=no
5542
    fi
5543
5544
    # Auto-detect PulseAudio support
5545
    if [ "$CFG_PULSEAUDIO" != "no" ]; then
5546
        if [ -n "$PKG_CONFIG" ]; then
5547
            QT_CFLAGS_PULSEAUDIO=`$PKG_CONFIG --cflags libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null`
5548
            QT_LIBS_PULSEAUDIO=`$PKG_CONFIG --libs libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null`
5549
        fi
5550
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/pulseaudio "PulseAudio" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_PULSEAUDIO $QT_LIBS_PULSEAUDIO $X11TESTS_FLAGS; then
5551
            CFG_PULSEAUDIO=yes
5552
            QMakeVar set QT_CFLAGS_PULSEAUDIO "$QT_CFLAGS_PULSEAUDIO"
5553
            QMakeVar set QT_LIBS_PULSEAUDIO "$QT_LIBS_PULSEAUDIO"
5554
        else
5555
            if [ "$CFG_PULSEAUDIO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5556
                echo "PulseAudio support cannot be enabled due to functionality tests!"
5557
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5558
                echo " If you believe this message is in error you may use the continue"
5559
                echo " switch (-continue) to $0 to continue."
5560
                exit 101
5561
            else
5562
		CFG_PULSEAUDIO=no
5563
            fi
5564
        fi
5565
    fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5566
fi # X11/QWS
5567
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5568
# X11
1 by Adam Conrad
Import upstream version 4.0.0
5569
if [ "$PLATFORM_X11" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5570
    x11tests="$relpath/config.tests/x11"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5571
    X11TESTS_FLAGS=
5572
5573
    # work around broken X11 headers when using GCC 2.95 or later
1 by Adam Conrad
Import upstream version 4.0.0
5574
    NOTYPE=no
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5575
    "$x11tests/notype.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath" && NOTYPE=yes
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
5576
    if [ $NOTYPE = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5577
	QMakeVar add QMAKE_CXXFLAGS -fpermissive
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5578
        X11TESTS_FLAGS="$X11TESTS_FLAGS -fpermissive"
5579
    fi
5580
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
5581
    # Check we actually have X11 :-)
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5582
    "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xlib "XLib" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
5583
    if [ $? != "0" ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
5584
        echo "Basic XLib functionality test failed!"
5585
        echo " You might need to modify the include and library search paths by editing"
5586
        echo " QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in ${XQMAKESPEC}."
5587
        exit 1
5588
    fi
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5589
fi
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
5590
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5591
# X11/MINGW OpenGL
5592
if [ "$PLATFORM_X11" = "yes" -o "$XPLATFORM_MINGW" = "yes" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5593
    # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x)
5594
    if [ "$CFG_GUI" = "no" ]; then
5595
        if [ "$CFG_OPENGL" = "auto" ]; then
5596
            CFG_OPENGL=no
5597
        fi
5598
        if [ "$CFG_OPENGL" != "no" ]; then
5599
            echo "OpenGL enabled, but GUI disabled."
5600
            echo " You might need to either enable the GUI or disable OpenGL"
5601
            exit 1
5602
        fi
5603
    fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5604
    if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5605
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5606
            CFG_OPENGL=desktop
5607
        elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
5608
            CFG_OPENGL=es2
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5609
            if [ "$CFG_EGL" = "no" ]; then
5610
                CFG_EGL=auto
5611
            fi
5612
        elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5613
            CFG_OPENGL=es1
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5614
            if [ "$CFG_EGL" = "no" ]; then
5615
                CFG_EGL=auto
5616
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5617
        else
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5618
            if [ "$CFG_OPENGL" = "yes" ]; then
5619
                echo "All the OpenGL functionality tests failed!"
5620
                echo " You might need to modify the include and library search paths by editing"
5621
                echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5622
                echo " ${XQMAKESPEC}."
5623
                exit 1
5624
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5625
            CFG_OPENGL=no
5626
        fi
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5627
        case "$PLATFORM" in
5628
        hpux*)
5629
            # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
5630
            if [ "$CFG_OPENGL" = "desktop" ]; then
5631
                "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
5632
                if [ $? != "0" ]; then
5633
                    QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
5634
                fi
5635
            fi
5636
            ;;
5637
        *)
5638
            ;;
5639
        esac
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5640
    elif [ "$CFG_OPENGL" = "es1" ]; then
5641
        # OpenGL ES 1.x
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5642
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5643
        if [ $? != "0" ]; then
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5644
            echo "The OpenGL ES 1.x functionality test failed!"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5645
            echo " You might need to modify the include and library search paths by editing"
1.1.29 by Alessandro Ghersi
Import upstream version 4.6.2
5646
            echo " QMAKE_INCDIR_OPENGL_ES1, QMAKE_LIBDIR_OPENGL_ES1 and QMAKE_LIBS_OPENGL_ES1 in"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5647
            echo " ${XQMAKESPEC}."
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5648
            exit 1
5649
        fi
5650
    elif [ "$CFG_OPENGL" = "es2" ]; then
5651
        #OpenGL ES 2.x
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5652
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5653
        if [ $? != "0" ]; then
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5654
            echo "The OpenGL ES 2.0 functionality test failed!"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5655
            echo " You might need to modify the include and library search paths by editing"
1.1.29 by Alessandro Ghersi
Import upstream version 4.6.2
5656
            echo " QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5657
            echo " ${XQMAKESPEC}."
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5658
            exit 1
5659
        fi
5660
    elif [ "$CFG_OPENGL" = "desktop" ]; then
5661
        # Desktop OpenGL support
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5662
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
5663
        if [ $? != "0" ]; then
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5664
            echo "The OpenGL functionality test failed!"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5665
            echo " You might need to modify the include and library search paths by editing"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5666
            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5667
            echo " ${XQMAKESPEC}."
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5668
            exit 1
5669
        fi
5670
        case "$PLATFORM" in
5671
        hpux*)
5672
            # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5673
            "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
5674
            if [ $? != "0" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5675
                QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
5676
            fi
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5677
            ;;
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5678
        *)
5679
            ;;
5680
        esac
5681
    fi
5682
5683
    # if opengl is disabled and the user specified graphicssystem gl, disable it...
5684
    if [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && [ "$CFG_OPENGL" = "no" ]; then
5685
	echo "OpenGL Graphics System is disabled due to missing OpenGL support..."
5686
	CFG_GRAPHICS_SYSTEM=default
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5687
    fi
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5688
fi # X11/MINGW OpenGL
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5689
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
5690
# X11
5691
if [ "$PLATFORM_X11" = "yes" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5692
    # auto-detect Xcursor support
5693
    if [ "$CFG_XCURSOR" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5694
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xcursor "Xcursor" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5695
	    if [ "$CFG_XCURSOR" != "runtime" ]; then
5696
		CFG_XCURSOR=yes;
5697
	    fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5698
	else
5699
	    if [ "$CFG_XCURSOR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5700
		echo "Xcursor support cannot be enabled due to functionality tests!"
5701
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5702
		echo " If you believe this message is in error you may use the continue"
5703
		echo " switch (-continue) to $0 to continue."
5704
		exit 101
5705
	    else
5706
		CFG_XCURSOR=no
5707
	    fi
5708
	fi
5709
    fi
5710
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5711
    # auto-detect Xfixes support
5712
    if [ "$CFG_XFIXES" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5713
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xfixes "Xfixes" $L_FLAGS $I_FLAGS $X11TESTS_FLAGS; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5714
	    if [ "$CFG_XFIXES" != "runtime" ]; then
5715
		CFG_XFIXES=yes;
5716
	    fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5717
	else
5718
	    if [ "$CFG_XFIXES" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5719
		echo "Xfixes support cannot be enabled due to functionality tests!"
5720
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5721
		echo " If you believe this message is in error you may use the continue"
5722
		echo " switch (-continue) to $0 to continue."
5723
		exit 101
5724
	    else
5725
		CFG_XFIXES=no
5726
	    fi
5727
	fi
5728
    fi
5729
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5730
    # auto-detect Xrandr support (resize and rotate extension)
5731
    if [ "$CFG_XRANDR" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5732
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xrandr "Xrandr" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5733
            if [ "$CFG_XRANDR" != "runtime" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5734
	    CFG_XRANDR=yes
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5735
            fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5736
	else
5737
	    if [ "$CFG_XRANDR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5738
		echo "Xrandr support cannot be enabled due to functionality tests!"
5739
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5740
		echo " If you believe this message is in error you may use the continue"
5741
		echo " switch (-continue) to $0 to continue."
5742
		exit 101
5743
	    else
5744
		CFG_XRANDR=no
5745
	    fi
5746
	fi
5747
    fi
5748
5749
    # auto-detect Xrender support
5750
    if [ "$CFG_XRENDER" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5751
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xrender "Xrender" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5752
	    CFG_XRENDER=yes
5753
	else
5754
	    if [ "$CFG_XRENDER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5755
		echo "Xrender support cannot be enabled due to functionality tests!"
5756
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5757
		echo " If you believe this message is in error you may use the continue"
5758
		echo " switch (-continue) to $0 to continue."
5759
		exit 101
5760
	    else
5761
		CFG_XRENDER=no
5762
	    fi
5763
	fi
5764
    fi
5765
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5766
    # auto-detect MIT-SHM support
5767
    if [ "$CFG_MITSHM" != "no" ]; then
5768
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/mitshm "mitshm" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
5769
	    CFG_MITSHM=yes
5770
	else
5771
	    if [ "$CFG_MITSHM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5772
		echo "MITSHM support cannot be enabled due to functionality tests!"
5773
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5774
		echo " If you believe this message is in error you may use the continue"
5775
		echo " switch (-continue) to $0 to continue."
5776
		exit 101
5777
	    else
5778
		CFG_MITSHM=no
5779
	    fi
5780
	fi
5781
    fi
5782
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5783
    # auto-detect FontConfig support
5784
    if [ "$CFG_FONTCONFIG" != "no" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
5785
    if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig --exists freetype2 2>/dev/null; then
5786
        QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig --cflags freetype2 2>/dev/null`
5787
        QT_LIBS_FONTCONFIG=`$PKG_CONFIG --libs fontconfig --libs freetype2 2>/dev/null`
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5788
    else
5789
        QT_CFLAGS_FONTCONFIG=
5790
        QT_LIBS_FONTCONFIG="-lfreetype -lfontconfig"
5791
    fi
5792
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/fontconfig "FontConfig" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS $QT_CFLAGS_FONTCONFIG $QT_LIBS_FONTCONFIG; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5793
	    CFG_FONTCONFIG=yes
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5794
        QMakeVar set QMAKE_CFLAGS_X11 "$QT_CFLAGS_FONTCONFIG \$\$QMAKE_CFLAGS_X11"
5795
        QMakeVar set QMAKE_LIBS_X11 "$QT_LIBS_FONTCONFIG \$\$QMAKE_LIBS_X11"
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
5796
	    CFG_LIBFREETYPE=system
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5797
	else
5798
	    if [ "$CFG_FONTCONFIG" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5799
		echo "FontConfig support cannot be enabled due to functionality tests!"
5800
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5801
		echo " If you believe this message is in error you may use the continue"
5802
		echo " switch (-continue) to $0 to continue."
5803
		exit 101
5804
	    else
5805
		CFG_FONTCONFIG=no
5806
	    fi
5807
	fi
5808
    fi
5809
5810
    # auto-detect Session Management support
5811
    if [ "$CFG_SM" = "auto" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5812
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/sm "Session Management" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5813
	    CFG_SM=yes
5814
	else
5815
	    if [ "$CFG_SM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5816
		echo "Session Management support cannot be enabled due to functionality tests!"
5817
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5818
		echo " If you believe this message is in error you may use the continue"
5819
		echo " switch (-continue) to $0 to continue."
5820
		exit 101
5821
	    else
5822
		CFG_SM=no
5823
	    fi
5824
	fi
5825
    fi
5826
5827
    # auto-detect SHAPE support
5828
    if [ "$CFG_XSHAPE" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5829
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xshape "XShape" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5830
	    CFG_XSHAPE=yes
5831
	else
5832
	    if [ "$CFG_XSHAPE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5833
		echo "XShape support cannot be enabled due to functionality tests!"
5834
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5835
		echo " If you believe this message is in error you may use the continue"
5836
		echo " switch (-continue) to $0 to continue."
5837
		exit 101
5838
	    else
5839
		CFG_XSHAPE=no
5840
	    fi
5841
	fi
5842
    fi
5843
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5844
    # auto-detect XVideo support
5845
    if [ "$CFG_XVIDEO" != "no" ]; then
5846
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xvideo "XVideo" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
5847
	    CFG_XVIDEO=yes
5848
	else
5849
	    if [ "$CFG_XVIDEO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5850
		echo "XVideo support cannot be enabled due to functionality tests!"
5851
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5852
		echo " If you believe this message is in error you may use the continue"
5853
		echo " switch (-continue) to $0 to continue."
5854
		exit 101
5855
	    else
5856
		CFG_XVIDEO=no
5857
	    fi
5858
	fi
5859
    fi
5860
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
5861
    # auto-detect XSync support
5862
    if [ "$CFG_XSYNC" != "no" ]; then
5863
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xsync "XSync" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
5864
	    CFG_XSYNC=yes
5865
	else
5866
	    if [ "$CFG_XSYNC" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5867
		echo "XSync support cannot be enabled due to functionality tests!"
5868
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5869
		echo " If you believe this message is in error you may use the continue"
5870
		echo " switch (-continue) to $0 to continue."
5871
		exit 101
5872
	    else
5873
		CFG_XSYNC=no
5874
	    fi
5875
	fi
5876
    fi
5877
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5878
    # auto-detect Xinerama support
5879
    if [ "$CFG_XINERAMA" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5880
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xinerama "Xinerama" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5881
	    if [ "$CFG_XINERAMA" != "runtime" ]; then
5882
		CFG_XINERAMA=yes
5883
	    fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5884
	else
5885
	    if [ "$CFG_XINERAMA" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5886
		echo "Xinerama support cannot be enabled due to functionality tests!"
5887
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5888
		echo " If you believe this message is in error you may use the continue"
5889
		echo " switch (-continue) to $0 to continue."
5890
		exit 101
5891
	    else
5892
		CFG_XINERAMA=no
5893
	    fi
5894
	fi
5895
    fi
5896
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5897
    # auto-detect Xinput support
5898
    if [ "$CFG_XINPUT" != "no" ]; then
5899
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xinput "XInput" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
5900
	    if [ "$CFG_XINPUT" != "runtime" ]; then
5901
		CFG_XINPUT=yes
5902
	    fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5903
        else
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5904
            if [ "$CFG_XINPUT" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5905
                echo "Tablet and Xinput support cannot be enabled due to functionality tests!"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5906
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5907
                echo " If you believe this message is in error you may use the continue"
5908
                echo " switch (-continue) to $0 to continue."
5909
                exit 101
5910
            else
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5911
                CFG_XINPUT=no
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5912
            fi
5913
        fi
5914
    fi
5915
5916
    # auto-detect XKB support
5917
    if [ "$CFG_XKB" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5918
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xkb "XKB" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
5919
            CFG_XKB=yes
5920
        else
5921
            if [ "$CFG_XKB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5922
                echo "XKB support cannot be enabled due to functionality tests!"
5923
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5924
                echo " If you believe this message is in error you may use the continue"
5925
                echo " switch (-continue) to $0 to continue."
5926
                exit 101
5927
            else
5928
                CFG_XKB=no
5929
            fi
5930
        fi
5931
    fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5932
5933
    if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then
5934
        if [ -n "$PKG_CONFIG" ]; then
5935
            QT_CFLAGS_QGTKSTYLE=`$PKG_CONFIG --cflags gtk+-2.0 ">=" 2.10 atk 2>/dev/null`
5936
            QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
5937
        fi
5938
        if [ -n "$QT_CFLAGS_QGTKSTYLE" ] ; then
5939
            CFG_QGTKSTYLE=yes
5940
            QMakeVar set QT_CFLAGS_QGTKSTYLE "$QT_CFLAGS_QGTKSTYLE"
5941
            QMakeVar set QT_LIBS_QGTKSTYLE "$QT_LIBS_QGTKSTYLE"
5942
        else
5943
            if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5944
                echo "Gtk theme support cannot be enabled due to functionality tests!"
5945
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5946
                echo " If you believe this message is in error you may use the continue"
5947
                echo " switch (-continue) to $0 to continue."
5948
                exit 101
5949
            else
5950
                CFG_QGTKSTYLE=no
5951
            fi
5952
        fi
5953
    elif [ "$CFG_GLIB" = "no" ]; then
5954
        CFG_QGTKSTYLE=no
5955
    fi
1.1.12 by Jonathan Riddell
Import upstream version 4.3.2
5956
fi # X11
5957
5958
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5959
if [ "$PLATFORM_MAC" = "yes" ]; then
5960
    if [ "$CFG_PHONON" != "no" ]; then
5961
        # Always enable Phonon (unless it was explicitly disabled)
5962
        CFG_PHONON=yes
5963
    fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5964
5965
    if [ "$CFG_COREWLAN" = "auto" ]; then
5966
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/corewlan "CoreWlan" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
5967
            CFG_COREWLAN=yes
5968
        else
5969
            CFG_COREWLAN=no
5970
        fi
5971
    fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
5972
fi
5973
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
5974
# QWS
5975
if [ "$PLATFORM_QWS" = "yes" ]; then
5976
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
5977
    # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x)
5978
    if [ "$CFG_GUI" = "no" ]; then
5979
        if [ "$CFG_OPENGL" = "auto" ]; then
5980
            CFG_OPENGL=no
5981
        fi
5982
        if [ "$CFG_OPENGL" != "no" ]; then
5983
            echo "OpenGL enabled, but GUI disabled."
5984
            echo " You might need to either enable the GUI or disable OpenGL"
5985
            exit 1
5986
        fi
5987
    fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
5988
    if [ "$CFG_OPENGL" = "yes" ]; then
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5989
        CFG_EGL=auto
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5990
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
5991
            CFG_OPENGL=es2
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
5992
        elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
5993
            CFG_OPENGL=es1
5994
        else
5995
            echo "All the OpenGL ES functionality tests failed!"
5996
            echo " You might need to modify the include and library search paths by editing"
5997
            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5998
            echo " ${XQMAKESPEC}."
5999
            exit 1
6000
        fi
6001
    elif [ "$CFG_OPENGL" = "es1" ]; then
6002
        # OpenGL ES 1.x
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6003
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6004
        if [ $? != "0" ]; then
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6005
            echo "The OpenGL ES 1.x functionality test failed!"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6006
            echo " You might need to modify the include and library search paths by editing"
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6007
            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
6008
            echo " ${XQMAKESPEC}."
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6009
            exit 1
6010
        fi
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6011
        CFG_EGL=yes
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6012
    elif [ "$CFG_OPENGL" = "es2" ]; then
6013
        #OpenGL ES 2.x
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6014
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6015
        if [ $? != "0" ]; then
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6016
            echo "The OpenGL ES 2.0 functionality test failed!"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6017
            echo " You might need to modify the include and library search paths by editing"
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6018
            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
6019
            echo " ${XQMAKESPEC}."
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6020
            exit 1
6021
        fi
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6022
        CFG_EGL=yes
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6023
    elif [ "$CFG_OPENGL" = "desktop" ]; then
6024
        # Desktop OpenGL support
6025
        echo "Desktop OpenGL support is not avaliable on Qt for Embedded Linux"
6026
        exit 1
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6027
    fi
6028
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6029
    # screen drivers
6030
    for screen in ${CFG_GFX_ON} ${CFG_GFX_PLUGIN}; do
6031
       if [ "${screen}" = "ahi" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6032
           "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/ahi "Ahi" $L_FLAGS $I_FLAGS $l_FLAGS
6033
           if [ $? != "0" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6034
               echo "The Ahi screen driver functionality test failed!"
6035
               echo " You might need to modify the include and library search paths by editing"
6036
               echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
6037
               echo " ${XQMAKESPEC}."
6038
               exit 1
6039
           fi
6040
       fi
6041
6042
       if [ "${screen}" = "svgalib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6043
           "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/svgalib "SVGAlib" $L_FLAGS $I_FLAGS $l_FLAGS
6044
           if [ $? != "0" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6045
               echo "The SVGAlib screen driver functionality test failed!"
6046
               echo " You might need to modify the include and library search paths by editing"
6047
               echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
6048
               echo " ${XQMAKESPEC}."
6049
               exit 1
6050
           fi
6051
       fi
6052
6053
       if [ "${screen}" = "directfb" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6054
           if test -n "$PKG_CONFIG" && "$PKG_CONFIG" --exists directfb 2>/dev/null; then
6055
               QT_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
6056
               QT_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
6057
           elif directfb-config --version >/dev/null 2>&1; then
6058
               QT_CFLAGS_DIRECTFB=`directfb-config --cflags 2>/dev/null`
6059
               QT_LIBS_DIRECTFB=`directfb-config --libs 2>/dev/null`
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6060
           fi
6061
6062
           # QMake variables set here override those in the mkspec. Therefore we only set the variables here if they are not zero.
6063
           if [ -n "$QT_CFLAGS_DIRECTFB" ] || [ -n "$QT_LIBS_DIRECTFB" ]; then
6064
               QMakeVar set QT_CFLAGS_DIRECTFB "$QT_CFLAGS_DIRECTFB"
6065
               QMakeVar set QT_LIBS_DIRECTFB "$QT_LIBS_DIRECTFB"
6066
           fi
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
6067
           if [ "$CFG_QT3SUPPORT" = "yes" ]; then
6068
               QMakeVar set QT_DEFINES_DIRECTFB "QT3_SUPPORT"
6069
           fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6070
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6071
           "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/directfb "DirectFB" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_DIRECTFB $QT_LIBS_DIRECTFB
6072
           if [ $? != "0" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6073
               echo "The DirectFB screen driver functionality test failed!"
6074
               echo " You might need to modify the include and library search paths by editing"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6075
               echo " QT_CFLAGS_DIRECTFB and QT_LIBS_DIRECTFB in"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6076
               echo " ${XQMAKESPEC}."
6077
               exit 1
6078
           fi
6079
       fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6080
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6081
    done
6082
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6083
    # mouse drivers
6084
    for mouse in ${CFG_MOUSE_ON} ${CFG_MOUSE_PLUGIN}; do
6085
	if [ "${mouse}" = "tslib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6086
	    "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tslib "tslib" $L_FLAGS $I_FLAGS $l_FLAGS
6087
            if [ $? != "0" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6088
               echo "The tslib functionality test failed!"
6089
               echo " You might need to modify the include and library search paths by editing"
6090
               echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
6091
               echo " ${XQMAKESPEC}."
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6092
		exit 1
6093
	    fi
6094
	fi
6095
    done
6096
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6097
    CFG_QGTKSTYLE=no
6098
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6099
    # sound
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6100
    "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/sound "sound" $L_FLAGS $I_FLAGS $l_FLAGS
6101
    if [ $? != "0" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6102
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SOUND"
6103
    fi
6104
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6105
fi # QWS
6106
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6107
# EGL Support
6108
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
6109
    if [ "$CFG_EGL" != "no" ]; then
6110
        # detect EGL support
6111
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/egl" "EGL (EGL/egl.h)" $L_FLAGS $I_FLAGS $l_FLAGS; then
6112
            # EGL specified by QMAKE_*_EGL, included with <EGL/egl.h>
6113
            CFG_EGL=yes
6114
            CFG_EGL_GLES_INCLUDES=no
6115
        elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/egl4gles1" "EGL (GLES/egl.h)" $L_FLAGS $I_FLAGS $l_FLAGS; then
6116
            # EGL specified by QMAKE_*_EGL, included with <GLES/egl.h>
6117
            CFG_EGL=yes
6118
            CFG_EGL_GLES_INCLUDES=yes
6119
        else
6120
            if [ "$CFG_EGL" = "yes" ]; then
6121
                echo "The EGL functionality test failed!"
6122
                echo " EGL is required for OpenGL ES to manage contexts & surfaces."
6123
                echo " You might need to modify the include and library search paths by editing"
6124
                echo " QMAKE_INCDIR_EGL, QMAKE_LIBDIR_EGL and QMAKE_LIBS_EGL in"
6125
                echo " ${XQMAKESPEC}."
6126
                exit 1
6127
            fi
6128
            CFG_EGL=no
6129
            # If QtOpenGL would be built against OpenGL ES, disable it as we can't to that if EGL is missing
6130
            if [ "$CFG_OPENGL" = "es1" -o "$CFG_OPENGL" = "es2" ]; then
6131
                CFG_OPENGL=no
6132
            fi
6133
        fi
6134
    fi
6135
fi
6136
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6137
[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_PHONON" != "no" ] && CFG_PHONON="yes"
6138
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
6139
# freetype support
6140
[ "x$CFG_EMBEDDED" != "xno" ] && CFG_LIBFREETYPE="$CFG_QWS_FREETYPE"
6141
[ "x$PLATFORM_MAC" = "xyes" ] && CFG_LIBFREETYPE=no
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6142
[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_LIBFREETYPE" = "auto" ] && CFG_LIBFREETYPE=no
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
6143
if [ "$CFG_LIBFREETYPE" = "auto" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6144
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/freetype "FreeType" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
6145
        CFG_LIBFREETYPE=system
6146
    else
6147
        CFG_LIBFREETYPE=yes
6148
    fi
6149
fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6150
1 by Adam Conrad
Import upstream version 4.0.0
6151
if [ "$CFG_ENDIAN" = "auto" ]; then
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6152
    if [ "$XPLATFORM_MINGW" = "yes" ]; then
6153
        CFG_ENDIAN="Q_LITTLE_ENDIAN"
6154
    elif [ "$PLATFORM_MAC" = "yes" ]; then
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
6155
	true #leave as auto
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6156
    elif [ "$XPLATFORM" = "symbian-sbsv2" ]; then
6157
        CFG_ENDIAN="Q_LITTLE_ENDIAN"
1 by Adam Conrad
Import upstream version 4.0.0
6158
    else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6159
        "$unixtests/endian.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6160
	F="$?"
6161
        if [ "$F" -eq 0 ]; then
6162
            CFG_ENDIAN="Q_LITTLE_ENDIAN"
6163
        elif [ "$F" -eq 1 ]; then
6164
            CFG_ENDIAN="Q_BIG_ENDIAN"
6165
        else
6166
            echo
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6167
	    echo "The target system byte order could not be detected!"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6168
	    echo "Turn on verbose messaging (-v) to see the final report."
6169
	    echo "You can use the -little-endian or -big-endian switch to"
6170
	    echo "$0 to continue."
6171
            exit 101
6172
        fi
1 by Adam Conrad
Import upstream version 4.0.0
6173
    fi
6174
fi
6175
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6176
if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
6177
    if [ "$PLATFORM_MAC" = "yes" ]; then
6178
	true #leave as auto
6179
    else
6180
        "$unixtests/endian.test" "$QMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
6181
	F="$?"
6182
        if [ "$F" -eq 0 ]; then
6183
            CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
6184
        elif [ "$F" -eq 1 ]; then
6185
            CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
6186
        else
6187
            echo
6188
	    echo "The host system byte order could not be detected!"
6189
	    echo "Turn on verbose messaging (-v) to see the final report."
6190
	    echo "You can use the -host-little-endian or -host-big-endian switch to"
6191
	    echo "$0 to continue."
6192
            exit 101
6193
        fi
6194
    fi
6195
fi
6196
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6197
if [ "$CFG_ARMFPA" != "auto" ]; then
6198
    if [ "$CFG_ARMFPA" = "yes" ]; then
6199
        if [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
6200
            CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
6201
        else
6202
            CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
6203
        fi
6204
    else
6205
        CFG_DOUBLEFORMAT="normal"
6206
    fi
6207
fi
6208
6209
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
6210
if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then
6211
    if [ "$PLATFORM_QWS" != "yes" ]; then
6212
        CFG_DOUBLEFORMAT=normal
6213
    else
6214
        "$unixtests/doubleformat.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
6215
	F="$?"
6216
        if [ "$F" -eq 10 ] && [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
6217
            CFG_DOUBLEFORMAT=normal
6218
        elif [ "$F" -eq 11 ] && [ "$CFG_ENDIAN" = "Q_BIG_ENDIAN" ]; then
6219
            CFG_DOUBLEFORMAT=normal
6220
        elif [ "$F" -eq 10 ]; then
6221
            CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE"
6222
        elif [ "$F" -eq 11 ]; then
6223
            CFG_DOUBLEFORMAT="Q_DOUBLE_BIG"
6224
        elif [ "$F" -eq 12 ]; then
6225
            CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6226
            CFG_ARMFPA="yes"
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
6227
        elif [ "$F" -eq 13 ]; then
6228
            CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6229
            CFG_ARMFPA="yes"
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
6230
        else
6231
            echo
6232
	    echo "The system floating point format could not be detected."
6233
	    echo "This may cause data to be generated in a wrong format"
6234
	    echo "Turn on verbose messaging (-v) to see the final report."
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6235
	    # we do not fail on this since this is a new test, and if it fails,
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
6236
	    # the old behavior should be correct in most cases
6237
            CFG_DOUBLEFORMAT=normal
6238
        fi
6239
    fi
6240
fi
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
6241
6242
HAVE_STL=no
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6243
if echo "$XPLATFORM" | grep symbian > /dev/null || "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
6244
    HAVE_STL=yes
6245
fi
6246
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6247
if [ "$CFG_STL" != "no" ]; then
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
6248
    if [ "$HAVE_STL" = "yes" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6249
        CFG_STL=yes
6250
    else
1 by Adam Conrad
Import upstream version 4.0.0
6251
        if [ "$CFG_STL" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6252
            echo "STL support cannot be enabled due to functionality tests!"
6253
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6254
            echo " If you believe this message is in error you may use the continue"
6255
            echo " switch (-continue) to $0 to continue."
6256
            exit 101
6257
        else
6258
            CFG_STL=no
6259
        fi
6260
    fi
6261
fi
6262
6263
# find if the platform supports IPv6
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6264
if [ "$CFG_IPV6" != "no" ]; then
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6265
    #
6266
    # We accidently enabled IPv6 for Qt Symbian in 4.6.x. However the underlying OpenC does not fully support IPV6.
6267
    # Therefore for 4.7.1 and following we disable it until OpenC either supports it or we have the native Qt
6268
    # symbian socket engine.
6269
    #
6270
    if echo "$XPLATFORM" | grep symbian > /dev/null; then
6271
        CFG_IPV6=no
6272
    elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6 "IPv6" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6273
        CFG_IPV6=yes
6274
    else
1 by Adam Conrad
Import upstream version 4.0.0
6275
        if [ "$CFG_IPV6" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6276
            echo "IPv6 support cannot be enabled due to functionality tests!"
6277
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6278
            echo " If you believe this message is in error you may use the continue"
6279
            echo " switch (-continue) to $0 to continue."
6280
            exit 101
6281
        else
6282
            CFG_IPV6=no
6283
        fi
6284
    fi
6285
fi
6286
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6287
# detect POSIX clock_gettime()
6288
if [ "$CFG_CLOCK_GETTIME" = "auto" ]; then
6289
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/clock-gettime "POSIX clock_gettime()" $L_FLAGS $I_FLAGS $l_FLAGS; then
6290
	CFG_CLOCK_GETTIME=yes
6291
    else
6292
	CFG_CLOCK_GETTIME=no
6293
    fi
6294
fi
6295
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6296
# detect POSIX monotonic clocks
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6297
if [ "$CFG_CLOCK_GETTIME" = "yes" ] && [ "$CFG_CLOCK_MONOTONIC" = "auto" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6298
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/clock-monotonic "POSIX Monotonic Clock" $L_FLAGS $I_FLAGS $l_FLAGS; then
6299
	CFG_CLOCK_MONOTONIC=yes
6300
    else
6301
	CFG_CLOCK_MONOTONIC=no
6302
    fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6303
elif [ "$CFG_CLOCK_GETTIME" = "no" ]; then
6304
    CFG_CLOCK_MONOTONIC=no
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6305
fi
6306
6307
# detect mremap
6308
if [ "$CFG_MREMAP" = "auto" ]; then
6309
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mremap "mremap" $L_FLAGS $I_FLAGS $l_FLAGS; then
6310
	CFG_MREMAP=yes
6311
    else
6312
	CFG_MREMAP=no
6313
    fi
6314
fi
6315
1 by Adam Conrad
Import upstream version 4.0.0
6316
# find if the platform provides getaddrinfo (ipv6 dns lookups)
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6317
if [ "$CFG_GETADDRINFO" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6318
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getaddrinfo "getaddrinfo" $L_FLAGS $I_FLAGS $l_FLAGS; then
1 by Adam Conrad
Import upstream version 4.0.0
6319
        CFG_GETADDRINFO=yes
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6320
    else
6321
	if [ "$CFG_GETADDRINFO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6322
            echo "getaddrinfo support cannot be enabled due to functionality tests!"
6323
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6324
            echo " If you believe this message is in error you may use the continue"
6325
            echo " switch (-continue) to $0 to continue."
6326
            exit 101
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
6327
	else
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6328
	    CFG_GETADDRINFO=no
6329
	fi
6330
    fi
6331
fi
6332
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6333
# find if the platform provides inotify
6334
if [ "$CFG_INOTIFY" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6335
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/inotify "inotify" $L_FLAGS $I_FLAGS $l_FLAGS; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6336
        CFG_INOTIFY=yes
6337
    else
6338
	if [ "$CFG_INOTIFY" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6339
            echo "inotify support cannot be enabled due to functionality tests!"
6340
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6341
            echo " If you believe this message is in error you may use the continue"
6342
            echo " switch (-continue) to $0 to continue."
6343
            exit 101
6344
	else
6345
	    CFG_INOTIFY=no
6346
	fi
6347
    fi
6348
fi
6349
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6350
# find if the platform provides if_nametoindex (ipv6 interface name support)
6351
if [ "$CFG_IPV6IFNAME" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6352
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6ifname "IPv6 interface name" $L_FLAGS $I_FLAGS $l_FLAGS; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6353
        CFG_IPV6IFNAME=yes
6354
    else
6355
        if [ "$CFG_IPV6IFNAME" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6356
            echo "IPv6 interface name support cannot be enabled due to functionality tests!"
6357
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6358
            echo " If you believe this message is in error you may use the continue"
6359
            echo " switch (-continue) to $0 to continue."
6360
            exit 101
6361
        else
6362
	    CFG_IPV6IFNAME=no
6363
	fi
1 by Adam Conrad
Import upstream version 4.0.0
6364
    fi
6365
fi
6366
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6367
# find if the platform provides getifaddrs (network interface enumeration)
6368
if [ "$CFG_GETIFADDRS" != "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6369
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getifaddrs "getifaddrs" $L_FLAGS $I_FLAGS $l_FLAGS; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6370
        CFG_GETIFADDRS=yes
6371
    else
6372
        if [ "$CFG_GETIFADDRS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6373
            echo "getifaddrs support cannot be enabled due to functionality tests!"
6374
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6375
            echo " If you believe this message is in error you may use the continue"
6376
            echo " switch (-continue) to $0 to continue."
6377
            exit 101
6378
        else
6379
	    CFG_GETIFADDRS=no
6380
	fi
6381
    fi
6382
fi
6383
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6384
# detect OpenSSL
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6385
if [ "$CFG_OPENSSL" != "no" ] && [ "$XPLATFORM" != "symbian-sbsv2" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6386
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/openssl "OpenSSL" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6387
        if [ "$CFG_OPENSSL" = "auto" ]; then
6388
            CFG_OPENSSL=yes
6389
        fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6390
    else
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6391
        if ( [ "$CFG_OPENSSL" = "yes" ] || [ "$CFG_OPENSSL" = "linked" ] ) && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6392
            echo "OpenSSL support cannot be enabled due to functionality tests!"
6393
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6394
            echo " If you believe this message is in error you may use the continue"
6395
            echo " switch (-continue) to $0 to continue."
6396
            exit 101
6397
        else
6398
            CFG_OPENSSL=no
6399
        fi
6400
    fi
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6401
else
6402
    if [ "$CFG_OPENSSL" = "auto" ] && [ "$XPLATFORM" = "symbian-sbsv2" ]; then
6403
        #OpenSSl should be enabled for Symbian release
6404
        CFG_OPENSSL=yes
6405
    fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6406
fi
6407
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6408
# detect OpenVG support
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6409
if [ "$CFG_OPENVG" != "no" ] && [ "$XPLATFORM" != "symbian-sbsv2" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6410
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
6411
        if [ "$CFG_OPENVG" = "auto" ]; then
6412
            CFG_OPENVG=yes
6413
        fi
6414
    elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG openvg_on_opengl" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
6415
        if [ "$CFG_OPENVG" = "auto" ]; then
6416
            CFG_OPENVG=yes
6417
        fi
6418
        CFG_OPENVG_ON_OPENGL=yes
6419
    elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG lower_case_includes" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG (lc includes)" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
6420
        if [ "$CFG_OPENVG" = "auto" ]; then
6421
            CFG_OPENVG=yes
6422
        fi
6423
        CFG_OPENVG_LC_INCLUDES=yes
6424
    elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG openvg_on_opengl lower_case_includes" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG (lc includes)" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
6425
        if [ "$CFG_OPENVG" = "auto" ]; then
6426
            CFG_OPENVG=yes
6427
        fi
6428
        CFG_OPENVG_LC_INCLUDES=yes
6429
        CFG_OPENVG_ON_OPENGL=yes
6430
    else
6431
        if [ "$CFG_OPENVG" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6432
            echo "$CFG_OPENVG was specified for OpenVG but cannot be enabled due to functionality tests!"
6433
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6434
            echo " If you believe this message is in error you may use the continue"
6435
            echo " switch (-continue) to $0 to continue."
6436
            exit 101
6437
        else
6438
            CFG_OPENVG=no
6439
        fi
6440
    fi
6441
    if [ "$CFG_OPENVG" = "yes" ] && "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/shivavg" "ShivaVG" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
6442
        CFG_OPENVG_SHIVA=yes
6443
    fi
6444
fi
6445
6446
# if openvg is disabled and the user specified graphicssystem vg, disable it...
6447
if [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && [ "$CFG_OPENVG" = "no" ]; then
6448
    echo "OpenVG Graphics System is disabled due to missing OpenVG support..."
6449
    CFG_GRAPHICS_SYSTEM=default
6450
fi
6451
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6452
if [ -n "$CFG_RUNTIME_SYSTEM" -a "$CFG_GRAPHICS_SYSTEM" != "runtime" ] || [ "$CFG_RUNTIME_SYSTEM" = "runtime" ]; then
6453
    echo "Argument to -runtimegraphicssystem is invalid so ignoring..."
6454
    CFG_RUNTIME_SYSTEM=
6455
fi
6456
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6457
if [ "$CFG_PTMALLOC" != "no" ]; then
6458
    # build ptmalloc, copy .a file to lib/
6459
    echo "Building ptmalloc. Please wait..."
6460
    (cd "$relpath/src/3rdparty/ptmalloc/"; "$MAKE" "clean" ; "$MAKE" "posix"
6461
     mkdir "$outpath/lib/" ; cp "libptmalloc3.a" "$outpath/lib/")
6462
6463
    QMakeVar add QMAKE_LFLAGS "$outpath/lib/libptmalloc3.a"
6464
fi
6465
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6466
if [ "$CFG_ALSA" = "auto" ] && [ "$XPLATFORM" != "symbian-sbsv2" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6467
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/alsa "alsa" $L_FLAGS $I_FLAGS $l_FLAGS; then
6468
        CFG_ALSA=yes
6469
    else
6470
        CFG_ALSA=no
6471
    fi
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6472
elif [ "$XPLATFORM" = "symbian-sbsv2" ]; then
6473
    # Disabled for Symbian release
6474
    CFG_ALSA=no
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6475
fi
6476
6477
if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then 
6478
    if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then
6479
       "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/javascriptcore-jit "javascriptcore-jit" $L_FLAGS $I_FLAGS $l_FLAGS
6480
        if [ $? != "0" ]; then
6481
           CFG_JAVASCRIPTCORE_JIT=no
6482
        fi
6483
    fi
6484
fi
6485
6486
if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ]; then
6487
    QMakeVar set JAVASCRIPTCORE_JIT yes
6488
elif [ "$CFG_JAVASCRIPTCORE_JIT" = "no" ]; then
6489
    QMakeVar set JAVASCRIPTCORE_JIT no
6490
fi
6491
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6492
if [ "$CFG_AUDIO_BACKEND" = "auto" ]; then
6493
    if echo "$XPLATFORM" | grep symbian > /dev/null 2>&1; then
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6494
         if "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/audio "audio" $L_FLAGS $I_FLAGS $l_FLAGS ; then
6495
            CFG_AUDIO_BACKEND=yes
6496
         fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6497
    else
6498
        CFG_AUDIO_BACKEND=yes
6499
    fi
6500
fi
6501
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6502
if [ "$CFG_LARGEFILE" != "yes" ] && [ "$XPLATFORM_MINGW" = "yes" ]; then
6503
    echo "Warning: largefile support cannot be disabled for win32."
6504
    CFG_LARGEFILE="yes"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6505
elif [ "$CFG_LARGEFILE" != "no" ] && echo "$XPLATFORM" | grep "symbian" > /dev/null; then
6506
    echo "Warning: largefile support cannot be enabled for symbian."
6507
    CFG_LARGEFILE="no"
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6508
fi
6509
1 by Adam Conrad
Import upstream version 4.0.0
6510
#-------------------------------------------------------------------------------
6511
# ask for all that hasn't been auto-detected or specified in the arguments
6512
#-------------------------------------------------------------------------------
6513
6514
### fix this: user input should be validated in a loop
6515
if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PLATFORM_QWS" = "yes" ]; then
6516
    echo
6517
    echo "Choose pixel-depths to support:"
6518
    echo
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6519
    echo "   1. 1bpp, black/white"
6520
    echo "   4. 4bpp, grayscale"
6521
    echo "   8. 8bpp, paletted"
6522
    echo "  12. 12bpp, rgb 4-4-4"
6523
    echo "  15. 15bpp, rgb 5-5-5"
6524
    echo "  16. 16bpp, rgb 5-6-5"
6525
    echo "  18. 18bpp, rgb 6-6-6"
6526
    echo "  24. 24bpp, rgb 8-8-8"
6527
    echo "  32. 32bpp, argb 8-8-8-8 and rgb 8-8-8"
6528
    echo " all. All supported depths"
1 by Adam Conrad
Import upstream version 4.0.0
6529
    echo
6530
    echo "Your choices (default 8,16,32):"
6531
    read CFG_QWS_DEPTHS
6532
    if [ -z "$CFG_QWS_DEPTHS" ] || [ "$CFG_QWS_DEPTHS" = "yes" ]; then
6533
        CFG_QWS_DEPTHS=8,16,32
6534
    fi
6535
fi
6536
if [ -n "$CFG_QWS_DEPTHS" -a "$PLATFORM_QWS" = "yes" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6537
    if [ "$CFG_QWS_DEPTHS" = "all" ]; then
6538
        CFG_QWS_DEPTHS="1 4 8 12 15 16 18 24 32 generic"
6539
    fi
1 by Adam Conrad
Import upstream version 4.0.0
6540
    for D in `echo "$CFG_QWS_DEPTHS" | sed -e 's/,/ /g'`; do
1.1.1 by Matthias Klose
Import upstream version 4.0.1
6541
	case $D in
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6542
	    1|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";;
6543
	    generic) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_GENERIC";;
1.1.1 by Matthias Klose
Import upstream version 4.0.1
6544
	esac
1 by Adam Conrad
Import upstream version 4.0.0
6545
    done
6546
fi
6547
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6548
# enable dwarf2 support on Mac
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6549
if [ "$CFG_MAC_DWARF2" = "yes" ]; then
6550
    QT_CONFIG="$QT_CONFIG dwarf2"
6551
fi
6552
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6553
# Set the default arch if there are no "-arch" arguments on the configure line
6554
# For "-carbon" builds: 32 bit x86/ppc.
6555
# For builds on snow leopard : compiler default (64-bit).
6556
# For builds on leopard : compiler default (32-bit).
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6557
if [ "$PLATFORM_MAC" = "yes" ]  && [ "$CFG_MAC_ARCHS" = "" ]; then
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
6558
    source "$mactests/defaultarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests"
6559
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6560
	if [ "$CFG_MAC_CARBON" = "yes" ]; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6561
		if [ "$QT_MAC_DEFAULT_ARCH" = "x86_64" ]; then
6562
			CFG_MAC_ARCHS=" x86"
6563
		elif [ "$QT_MAC_DEFAULT_ARCH" = "ppc64" ]; then
6564
			CFG_MAC_ARCHS=" ppc"
6565
		else
6566
			CFG_MAC_ARCHS=" $QT_MAC_DEFAULT_ARCH"
6567
		fi
6568
	else
6569
		CFG_MAC_ARCHS=" $QT_MAC_DEFAULT_ARCH"
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
6570
    fi
6571
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6572
    [ "$OPT_VERBOSE" = "yes" ] && echo "Setting Mac architechture to$CFG_MAC_ARCHS."
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
6573
fi
6574
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6575
# enable Cocoa and/or Carbon on Mac
6576
#  -carbon on the command line disables Cocoa, except for 64-bit archs
6577
if [ "$CFG_MAC_CARBON" = "yes" ]; then
6578
    CFG_MAC_CARBON="YES"
6579
    CFG_MAC_COCOA="NO"
6580
6581
#    check which archs are in use, enable cocoa if we find a 64-bit one
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6582
    if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then
6583
        CFG_MAC_COCOA="yes";
6584
        CFG_MAC_CARBON="no";
6585
        if echo "$CFG_MAC_ARCHS" | grep -w ppc > /dev/null 2>&1; then
6586
            CFG_MAC_CARBON="yes";
6587
        fi
6588
        if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then
6589
            CFG_MAC_CARBON="yes";
6590
        fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6591
    fi
6592
fi
6593
6594
# select Carbon on 10.4 Tiger.
6595
if [ "$PLATFORM_MAC" = "yes" ]; then
6596
    VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'`
6597
    if [ "$VERSION" == 8 ]; then
6598
        CFG_MAC_COCOA="no";
6599
        CFG_MAC_CARBON="yes";
6600
    fi
6601
fi
6602
6603
# select Carbon when using the 10.4u SDK
6604
if [ "$PLATFORM_MAC" = "yes" ]; then
6605
    if [ "TEST$CFG_SDK" = "TEST/Developer/SDKs/MacOSX10.4u.sdk/" ]; then
6606
        echo "Carbon on";
6607
        CFG_MAC_COCOA="no";
6608
        CFG_MAC_CARBON="yes";
6609
    fi
6610
fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6611
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6612
# but disable Cocoa if cross-building for mingw
6613
[ "$XPLATFORM_MINGW" = "yes" ] && CFG_MAC_COCOA="no"
6614
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6615
# set the global Mac deployment target. This is overridden on an arch-by-arch basis
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6616
# in some cases, see code further down
6617
case "$PLATFORM,$CFG_MAC_COCOA" in
6618
    macx*,yes)
6619
	# Cocoa
6620
	QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.5
6621
	;;
6622
    macx*,no)
6623
	# gcc, Carbon
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6624
	QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.4
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6625
	;;
6626
esac
6627
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6628
# disable Qt 3 support on VxWorks and Symbian
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6629
case "$XPLATFORM" in
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6630
    unsupported/vxworks*|symbian*)
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6631
	CFG_QT3SUPPORT="no"
6632
    ;;
6633
esac
6634
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6635
# enable Qt 3 support functionality
1 by Adam Conrad
Import upstream version 4.0.0
6636
if [ "$CFG_QT3SUPPORT" = "yes" ]; then
6637
    QT_CONFIG="$QT_CONFIG qt3support"
6638
fi
6639
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6640
# enable Phonon
6641
if [ "$CFG_PHONON" = "yes" ]; then
6642
    QT_CONFIG="$QT_CONFIG phonon"
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
6643
    if [ "$CFG_PHONON_BACKEND" = "yes" ]; then
6644
        QT_CONFIG="$QT_CONFIG phonon-backend"
6645
    fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6646
else
6647
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PHONON"
6648
fi
6649
1 by Adam Conrad
Import upstream version 4.0.0
6650
# disable accessibility
6651
if [ "$CFG_ACCESSIBILITY" = "no" ]; then
6652
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ACCESSIBILITY"
6653
else
6654
    QT_CONFIG="$QT_CONFIG accessibility"
6655
fi
6656
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
6657
# enable egl
6658
if [ "$CFG_EGL" = "no" ]; then
6659
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL"
6660
else
6661
    QT_CONFIG="$QT_CONFIG egl"
6662
    if [ "$CFG_EGL_GLES_INCLUDES" = "yes" ]; then
6663
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GLES_EGL"
6664
    fi
6665
fi
6666
6667
# enable openvg
6668
if [ "$CFG_OPENVG" = "no" ]; then
6669
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENVG"
6670
else
6671
    QT_CONFIG="$QT_CONFIG openvg"
6672
    if [ "$CFG_OPENVG_LC_INCLUDES" = "yes" ]; then
6673
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LOWER_CASE_VG_INCLUDES"
6674
    fi
6675
    if [ "$CFG_OPENVG_ON_OPENGL" = "yes" ]; then
6676
        QT_CONFIG="$QT_CONFIG openvg_on_opengl"
6677
    fi
6678
    if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
6679
        QT_CONFIG="$QT_CONFIG shivavg"
6680
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SHIVAVG"
6681
    fi
6682
fi
6683
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6684
if [ "$CFG_QS60STYLE" = "no" ]; then
6685
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_S60"
6686
else
6687
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_STYLE_S60"
6688
fi
6689
6690
# Disable OpenGL on Symbian.
6691
case "$XPLATFORM" in
6692
    symbian*)
6693
        CFG_OPENGL="no"
6694
        ;;
6695
esac
6696
1 by Adam Conrad
Import upstream version 4.0.0
6697
# enable opengl
6698
if [ "$CFG_OPENGL" = "no" ]; then
6699
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENGL"
6700
else
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6701
    QT_CONFIG="$QT_CONFIG opengl"
6702
fi
6703
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6704
if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6705
    if [ "$PLATFORM_QWS" = "yes" ]; then
6706
	QCONFIG_FLAGS="$QCONFIG_FLAGS Q_BACKINGSTORE_SUBSURFACES"
6707
	QCONFIG_FLAGS="$QCONFIG_FLAGS Q_USE_EGLWINDOWSURFACE"
6708
    fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6709
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES"
6710
fi
6711
6712
if [ "$CFG_OPENGL" = "es1" ]; then
6713
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1"
6714
    QT_CONFIG="$QT_CONFIG opengles1"
6715
fi
6716
6717
if [ "$CFG_OPENGL" = "es2" ]; then
6718
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_2"
6719
    QT_CONFIG="$QT_CONFIG opengles2"
1 by Adam Conrad
Import upstream version 4.0.0
6720
fi
6721
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
6722
# safe execution environment
6723
if [ "$CFG_SXE" != "no" ]; then
6724
    QT_CONFIG="$QT_CONFIG sxe"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6725
fi
6726
1 by Adam Conrad
Import upstream version 4.0.0
6727
# build up the variables for output
6728
if [ "$CFG_DEBUG" = "yes" ]; then
6729
    QMAKE_OUTDIR="${QMAKE_OUTDIR}debug"
6730
    QMAKE_CONFIG="$QMAKE_CONFIG debug"
6731
elif [ "$CFG_DEBUG" = "no" ]; then
6732
    QMAKE_OUTDIR="${QMAKE_OUTDIR}release"
6733
    QMAKE_CONFIG="$QMAKE_CONFIG release"
6734
fi
6735
if [ "$CFG_SHARED" = "yes" ]; then
6736
    QMAKE_OUTDIR="${QMAKE_OUTDIR}-shared"
6737
    QMAKE_CONFIG="$QMAKE_CONFIG shared dll"
6738
elif [ "$CFG_SHARED" = "no" ]; then
6739
    QMAKE_OUTDIR="${QMAKE_OUTDIR}-static"
6740
    QMAKE_CONFIG="$QMAKE_CONFIG static"
6741
fi
6742
if [ "$PLATFORM_QWS" = "yes" ]; then
6743
    QMAKE_OUTDIR="${QMAKE_OUTDIR}-emb-$CFG_EMBEDDED"
6744
    QMAKE_CONFIG="$QMAKE_CONFIG embedded"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
6745
    QT_CONFIG="$QT_CONFIG embedded"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6746
    rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
1 by Adam Conrad
Import upstream version 4.0.0
6747
fi
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6748
if [ "$XPLATFORM_MINGW" != "yes" ]; then
6749
    # Do not set this here for Windows. Let qmake do it so
6750
    # debug and release precompiled headers are kept separate.
6751
    QMakeVar set PRECOMPILED_DIR ".pch/$QMAKE_OUTDIR"
6752
fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6753
QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR"
6754
QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR"
6755
QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR"
6756
QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR"
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6757
if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
6758
    QMAKE_CONFIG="$QMAKE_CONFIG largefile"
6759
fi
6760
if [ "$CFG_STL" = "no" ]; then
6761
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STL"
6762
else
6763
    QMAKE_CONFIG="$QMAKE_CONFIG stl"
6764
fi
6765
if [ "$CFG_USE_GNUMAKE" = "yes" ]; then
6766
    QMAKE_CONFIG="$QMAKE_CONFIG GNUmake"
6767
fi
6768
[ "$CFG_REDUCE_EXPORTS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_exports"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6769
[ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
1 by Adam Conrad
Import upstream version 4.0.0
6770
[ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6771
if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
6772
    QMakeVar add QMAKE_CFLAGS -g
6773
    QMakeVar add QMAKE_CXXFLAGS -g
6774
    QMAKE_CONFIG="$QMAKE_CONFIG separate_debug_info"
6775
fi
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
6776
if [ "$CFG_SEPARATE_DEBUG_INFO_NOCOPY" = "yes" ] ; then
6777
    QMAKE_CONFIG="$QMAKE_CONFIG separate_debug_info_nocopy"
6778
fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6779
[ "$CFG_MMX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mmx"
6780
[ "$CFG_3DNOW" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG 3dnow"
6781
[ "$CFG_SSE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse"
6782
[ "$CFG_SSE2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse2"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6783
[ "$CFG_SSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse3"
6784
[ "$CFG_SSSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG ssse3"
6785
[ "$CFG_SSE4_1" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_1"
6786
[ "$CFG_SSE4_2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_2"
6787
[ "$CFG_AVX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx"
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
6788
[ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
6789
[ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6790
[ "$PLATFORM_MAC" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG $CFG_MAC_ARCHS"
1 by Adam Conrad
Import upstream version 4.0.0
6791
if [ "$CFG_IPV6" = "yes" ]; then
6792
    QT_CONFIG="$QT_CONFIG ipv6"
6793
fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6794
if [ "$CFG_CLOCK_GETTIME" = "yes" ]; then
6795
    QT_CONFIG="$QT_CONFIG clock-gettime"
6796
fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6797
if [ "$CFG_CLOCK_MONOTONIC" = "yes" ]; then
6798
    QT_CONFIG="$QT_CONFIG clock-monotonic"
6799
fi
6800
if [ "$CFG_MREMAP" = "yes" ]; then
6801
    QT_CONFIG="$QT_CONFIG mremap"
6802
fi
1 by Adam Conrad
Import upstream version 4.0.0
6803
if [ "$CFG_GETADDRINFO" = "yes" ]; then
6804
    QT_CONFIG="$QT_CONFIG getaddrinfo"
6805
fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6806
if [ "$CFG_IPV6IFNAME" = "yes" ]; then
6807
    QT_CONFIG="$QT_CONFIG ipv6ifname"
6808
fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6809
if [ "$CFG_GETIFADDRS" = "yes" ]; then
6810
    QT_CONFIG="$QT_CONFIG getifaddrs"
6811
fi
6812
if [ "$CFG_INOTIFY" = "yes" ]; then
6813
    QT_CONFIG="$QT_CONFIG inotify"
6814
fi
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
6815
if [ "$CFG_LIBJPEG" = "no" ]; then
6816
    CFG_JPEG="no"
6817
elif [ "$CFG_LIBJPEG" = "system" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
6818
    QT_CONFIG="$QT_CONFIG system-jpeg"
6819
fi
6820
if [ "$CFG_JPEG" = "no" ]; then
6821
    QT_CONFIG="$QT_CONFIG no-jpeg"
6822
elif [ "$CFG_JPEG" = "yes" ]; then
6823
    QT_CONFIG="$QT_CONFIG jpeg"
6824
fi
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
6825
if [ "$CFG_LIBMNG" = "no" ]; then
6826
    CFG_MNG="no"
6827
elif [ "$CFG_LIBMNG" = "system" ]; then
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
6828
    QT_CONFIG="$QT_CONFIG system-mng"
6829
fi
6830
if [ "$CFG_MNG" = "no" ]; then
6831
    QT_CONFIG="$QT_CONFIG no-mng"
6832
elif [ "$CFG_MNG" = "yes" ]; then
6833
    QT_CONFIG="$QT_CONFIG mng"
6834
fi
1 by Adam Conrad
Import upstream version 4.0.0
6835
if [ "$CFG_LIBPNG" = "no" ]; then
6836
    CFG_PNG="no"
6837
fi
6838
if [ "$CFG_LIBPNG" = "system" ]; then
6839
    QT_CONFIG="$QT_CONFIG system-png"
6840
fi
6841
if [ "$CFG_PNG" = "no" ]; then
6842
    QT_CONFIG="$QT_CONFIG no-png"
6843
elif [ "$CFG_PNG" = "yes" ]; then
6844
    QT_CONFIG="$QT_CONFIG png"
6845
fi
6846
if [ "$CFG_GIF" = "no" ]; then
6847
    QT_CONFIG="$QT_CONFIG no-gif"
6848
elif [ "$CFG_GIF" = "yes" ]; then
6849
    QT_CONFIG="$QT_CONFIG gif"
6850
fi
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
6851
if [ "$CFG_LIBTIFF" = "no" ]; then
6852
    CFG_TIFF="no"
6853
elif [ "$CFG_LIBTIFF" = "system" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6854
    QT_CONFIG="$QT_CONFIG system-tiff"
6855
fi
6856
if [ "$CFG_TIFF" = "no" ]; then
6857
    QT_CONFIG="$QT_CONFIG no-tiff"
6858
elif [ "$CFG_TIFF" = "yes" ]; then
6859
    QT_CONFIG="$QT_CONFIG tiff"
6860
fi
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
6861
if [ "$CFG_LIBFREETYPE" = "no" ]; then
6862
    QT_CONFIG="$QT_CONFIG no-freetype"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6863
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FREETYPE"
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
6864
elif [ "$CFG_LIBFREETYPE" = "system" ]; then
6865
    QT_CONFIG="$QT_CONFIG system-freetype"
6866
else
6867
    QT_CONFIG="$QT_CONFIG freetype"
6868
fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6869
if [ "$CFG_GUI" = "auto" ]; then
6870
    CFG_GUI="yes"
6871
fi
6872
if [ "$CFG_GUI" = "no" ]; then
6873
    QT_CONFIG="$QT_CONFIG no-gui"
6874
else
6875
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GUI"
6876
fi
6877
6878
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6879
if [ "x$PLATFORM_MAC" = "xyes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
6880
    #On Mac we implicitly link against libz, so we
6881
    #never use the 3rdparty stuff.
6882
    [ "$CFG_ZLIB" = "yes" ] && CFG_ZLIB="system"
6883
fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6884
if [ "$CFG_ZLIB" = "yes" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
6885
    QT_CONFIG="$QT_CONFIG zlib"
6886
elif [ "$CFG_ZLIB" = "system" ]; then
6887
    QT_CONFIG="$QT_CONFIG system-zlib"
6888
fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6889
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6890
if [ "$CFG_S60" = "yes" ]; then
6891
    QT_CONFIG="$QT_CONFIG s60"
6892
fi
6893
6894
if [ "$CFG_SYMBIAN_DEFFILES" = "yes" ]; then
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6895
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG def_files"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6896
else
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
6897
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG def_files_disabled"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6898
fi
6899
1 by Adam Conrad
Import upstream version 4.0.0
6900
[ "$CFG_NIS" = "yes" ] && QT_CONFIG="$QT_CONFIG nis"
6901
[ "$CFG_CUPS" = "yes" ] && QT_CONFIG="$QT_CONFIG cups"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6902
[ "$CFG_ICONV" = "yes" ] && QT_CONFIG="$QT_CONFIG iconv"
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
6903
[ "$CFG_ICONV" = "sun" ] && QT_CONFIG="$QT_CONFIG sun-libiconv"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6904
[ "$CFG_ICONV" = "gnu" ] && QT_CONFIG="$QT_CONFIG gnu-libiconv"
6905
[ "$CFG_GLIB" = "yes" ] && QT_CONFIG="$QT_CONFIG glib"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6906
[ "$CFG_GSTREAMER" = "yes" ] && QT_CONFIG="$QT_CONFIG gstreamer"
6907
[ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus"
6908
[ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked"
1 by Adam Conrad
Import upstream version 4.0.0
6909
[ "$CFG_NAS" = "system" ] && QT_CONFIG="$QT_CONFIG nas"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
6910
[ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
6911
[ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked"
1 by Adam Conrad
Import upstream version 4.0.0
6912
6913
if [ "$PLATFORM_X11" = "yes" ]; then
6914
    [ "$CFG_SM" = "yes" ] && QT_CONFIG="$QT_CONFIG x11sm"
6915
6916
    # for some reason, the following libraries are not always built shared,
6917
    # so *every* program/lib (including Qt) has to link against them
6918
    if [ "$CFG_XSHAPE" = "yes" ]; then
6919
        QT_CONFIG="$QT_CONFIG xshape"
6920
    fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
6921
    if [ "$CFG_XVIDEO" = "yes" ]; then
6922
        QT_CONFIG="$QT_CONFIG xvideo"
6923
    fi
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
6924
    if [ "$CFG_XSYNC" = "yes" ]; then
6925
        QT_CONFIG="$QT_CONFIG xsync"
6926
    fi
1 by Adam Conrad
Import upstream version 4.0.0
6927
    if [ "$CFG_XINERAMA" = "yes" ]; then
6928
        QT_CONFIG="$QT_CONFIG xinerama"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6929
	QMakeVar set QMAKE_LIBS_X11 '-lXinerama $$QMAKE_LIBS_X11'
1 by Adam Conrad
Import upstream version 4.0.0
6930
    fi
6931
    if [ "$CFG_XCURSOR" = "yes" ]; then
6932
        QT_CONFIG="$QT_CONFIG xcursor"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6933
	QMakeVar set QMAKE_LIBS_X11 '-lXcursor $$QMAKE_LIBS_X11'
6934
    fi
6935
    if [ "$CFG_XFIXES" = "yes" ]; then
6936
        QT_CONFIG="$QT_CONFIG xfixes"
6937
	QMakeVar set QMAKE_LIBS_X11 '-lXfixes $$QMAKE_LIBS_X11'
1 by Adam Conrad
Import upstream version 4.0.0
6938
    fi
6939
    if [ "$CFG_XRANDR" = "yes" ]; then
6940
        QT_CONFIG="$QT_CONFIG xrandr"
6941
        if [ "$CFG_XRENDER" != "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6942
            # libXrandr uses 1 function from libXrender, so we always have to have it :/
6943
	    QMakeVar set QMAKE_LIBS_X11 '-lXrandr -lXrender $$QMAKE_LIBS_X11'
1 by Adam Conrad
Import upstream version 4.0.0
6944
        else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6945
	    QMakeVar set QMAKE_LIBS_X11 '-lXrandr $$QMAKE_LIBS_X11'
1 by Adam Conrad
Import upstream version 4.0.0
6946
        fi
6947
    fi
6948
    if [ "$CFG_XRENDER" = "yes" ]; then
6949
        QT_CONFIG="$QT_CONFIG xrender"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6950
	QMakeVar set QMAKE_LIBS_X11 '-lXrender $$QMAKE_LIBS_X11'
1 by Adam Conrad
Import upstream version 4.0.0
6951
    fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6952
    if [ "$CFG_MITSHM" = "yes" ]; then
6953
        QT_CONFIG="$QT_CONFIG mitshm"
6954
    fi
1 by Adam Conrad
Import upstream version 4.0.0
6955
    if [ "$CFG_FONTCONFIG" = "yes" ]; then
6956
        QT_CONFIG="$QT_CONFIG fontconfig"
6957
    fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6958
    if [ "$CFG_XINPUT" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6959
	QMakeVar set QMAKE_LIBS_X11 '-lXi $$QMAKE_LIBS_X11'
1 by Adam Conrad
Import upstream version 4.0.0
6960
    fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
6961
    if [ "$CFG_XINPUT" = "yes" ]; then
6962
        QT_CONFIG="$QT_CONFIG xinput tablet"
6963
    fi
1 by Adam Conrad
Import upstream version 4.0.0
6964
    if [ "$CFG_XKB" = "yes" ]; then
6965
        QT_CONFIG="$QT_CONFIG xkb"
6966
    fi
6967
fi
6968
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6969
[ '!' -z "$D_FLAGS" ] && QMakeVar add DEFINES "$D_FLAGS"
6970
[ '!' -z "$L_FLAGS" ] && QMakeVar add QMAKE_LIBDIR_FLAGS "$L_FLAGS"
6971
[ '!' -z "$l_FLAGS" ] && QMakeVar add LIBS "$l_FLAGS"
1 by Adam Conrad
Import upstream version 4.0.0
6972
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
6973
if [ "$PLATFORM_MAC" = "yes" ]; then
6974
    if [ "$CFG_RPATH" = "yes" ]; then
1.1.1 by Matthias Klose
Import upstream version 4.0.1
6975
       QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname"
6976
    fi
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6977
elif [ -z "`getQMakeConf \"$XQMAKESPEC\" | $AWK '/QMAKE_(LFLAGS_)?RPATH/ {print $3;}'`" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
6978
    if [ -n "$RPATH_FLAGS" ]; then
6979
        echo
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
6980
        echo "ERROR: -R cannot be used on this platform as \$QMAKE_LFLAGS_RPATH is"
1 by Adam Conrad
Import upstream version 4.0.0
6981
        echo "       undefined."
6982
        echo
6983
        exit 1
6984
    elif [ "$CFG_RPATH" = "yes" ]; then
6985
        RPATH_MESSAGE="        NOTE: This platform does not support runtime library paths, using -no-rpath."
6986
        CFG_RPATH=no
6987
    fi
6988
else
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
6989
    if [ "$CFG_RPATH" = "yes" ]; then
6990
        # set the default rpath to the library installation directory
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6991
        RPATH_FLAGS="\"$QT_INSTALL_LIBS\" $RPATH_FLAGS"
1 by Adam Conrad
Import upstream version 4.0.0
6992
    fi
6993
    if [ -n "$RPATH_FLAGS" ]; then
6994
        # add the user defined rpaths
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
6995
	QMakeVar add QMAKE_RPATHDIR "$RPATH_FLAGS"
1 by Adam Conrad
Import upstream version 4.0.0
6996
    fi
6997
fi
6998
6999
if [ '!' -z "$I_FLAGS" ]; then
7000
    # add the user define include paths
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7001
    QMakeVar add QMAKE_CFLAGS "$I_FLAGS"
7002
    QMakeVar add QMAKE_CXXFLAGS "$I_FLAGS"
1 by Adam Conrad
Import upstream version 4.0.0
7003
fi
7004
7005
# turn off exceptions for the compilers that support it
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7006
if [ "$PLATFORM_QWS" = "yes" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7007
    COMPILER=`echo $XPLATFORM | cut -f 3- -d-`
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
7008
elif [ "$XPLATFORM" != "$PLATFORM" ]; then
7009
    COMPILER=`echo $XPLATFORM | cut -f 2- -d-`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7010
else
7011
    COMPILER=`echo $PLATFORM | cut -f 2- -d-`
7012
fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7013
if [ "$CFG_EXCEPTIONS" = "unspecified" -a "$PLATFORM_QWS" = "yes" ]; then
7014
    CFG_EXCEPTIONS=no
1 by Adam Conrad
Import upstream version 4.0.0
7015
fi
7016
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7017
if [ "$CFG_EXCEPTIONS" != "no" ]; then
7018
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG exceptions"
7019
fi
7020
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
7021
if [ "$XPLATFORM_MINGW" = "yes" ]; then
7022
    # mkspecs/features/win32/default_pre.prf sets "no-rtti".
7023
    # Follow default behavior of configure.exe by overriding with "rtti".
7024
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG rtti"
7025
fi
7026
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7027
if [ "$CFG_ALSA" = "yes" ]; then
7028
    QT_CONFIG="$QT_CONFIG alsa"
7029
fi
7030
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7031
if [ "$CFG_PULSEAUDIO" = "yes" ]; then
7032
    QT_CONFIG="$QT_CONFIG pulseaudio"
7033
fi
7034
7035
if [ "$CFG_COREWLAN" = "yes" ]; then
7036
    QT_CONFIG="$QT_CONFIG corewlan"
7037
fi
7038
7039
if [ "$CFG_ICD" = "yes" ]; then
7040
    QT_CONFIG="$QT_CONFIG icd"
7041
fi
7042
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7043
#
7044
# Some Qt modules are too advanced in C++ for some old compilers
7045
# Detect here the platforms where they are known to work.
7046
#
7047
# See Qt documentation for more information on which features are
7048
# supported and on which compilers.
7049
#
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7050
canBuildQtXmlPatterns="yes"
1.1.17 by Roderick B. Greening
Import upstream version 4.4.2
7051
canBuildWebKit="$HAVE_STL"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7052
canBuildQtConcurrent="yes"
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
7053
7054
# WebKit requires stdint.h
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7055
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stdint "Stdint" $L_FLAGS $I_FLAGS $l_FLAGS
7056
if [ $? != "0" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
7057
    canBuildWebKit="no"
7058
fi
7059
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7060
case "$XPLATFORM" in
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7061
    hpux-g++*)
7062
	# PA-RISC's assembly is too limited
7063
	# gcc 3.4 on that platform can't build QtXmlPatterns
7064
	# the assembly it generates cannot be compiled
7065
7066
	# Check gcc's version
7067
	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
7068
	    4*)
7069
		;;
7070
	    3.4*)
7071
		canBuildQtXmlPatterns="no"
7072
		;;
7073
	    *)
7074
		canBuildWebKit="no"
7075
		canBuildQtXmlPatterns="no"
7076
		;;
7077
	esac
7078
	;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7079
    unsupported/vxworks-*-g++*)
7080
	canBuildWebKit="no"
7081
	;;
7082
    unsupported/vxworks-*-dcc*)
7083
	canBuildWebKit="no"
7084
	canBuildQtXmlPatterns="no"
7085
	;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7086
    *-g++*)
7087
	# Check gcc's version
7088
	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
7089
	    4*|3.4*)
7090
		;;
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7091
            3.3*)
7092
                canBuildWebKit="no"
7093
                ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7094
	    *)
7095
		canBuildWebKit="no"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7096
		canBuildQtXmlPatterns="no"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7097
		;;
7098
	esac
7099
	;;
7100
    solaris-cc*)
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7101
        # Check the compiler version
7102
        case `${QMAKE_CONF_COMPILER} -V 2>&1 | awk '{print $4}'` in
7103
            5.[012345678])
7104
                canBuildWebKit="no"
7105
                canBuildQtXmlPatterns="no"
7106
                canBuildQtConcurrent="no"
7107
                ;;
7108
            5.9)
7109
                canBuildWebKit="no"
7110
                canBuildQtConcurrent="no"
7111
                ;;
7112
        esac
7113
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7114
    hpux-acc*)
7115
	canBuildWebKit="no"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7116
	canBuildQtXmlPatterns="no"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7117
        canBuildQtConcurrent="no"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7118
	;;
7119
    hpuxi-acc*)
7120
	canBuildWebKit="no"
7121
	;;
7122
    aix-xlc*)
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7123
        # Get the xlC version
7124
        cat > xlcver.c <<EOF
7125
#include <stdio.h>
7126
int main()
7127
{
7128
    printf("%d.%d\n", __xlC__ >> 8, __xlC__ & 0xFF);
7129
    return 0;
7130
}
7131
EOF
7132
        xlcver=
7133
        if ${QMAKE_CONF_COMPILER} -o xlcver xlcver.c >/dev/null 2>/dev/null; then
7134
            xlcver=`./xlcver 2>/dev/null`
7135
            rm -f ./xlcver
7136
        fi
7137
        if [ "$OPT_VERBOSE" = "yes" ]; then
7138
            if [ -n "$xlcver" ]; then
7139
                echo Found IBM xlC version: $xlcver.
7140
            else
7141
                echo Could not determine IBM xlC version, assuming oldest supported.
7142
            fi
7143
        fi
7144
7145
        case "$xlcver" in
7146
            [123456].*)
7147
                canBuildWebKit="no"
7148
                canBuildQtXmlPatterns="no"
7149
                canBuildQtConcurrent="no"
7150
                ;;
7151
            *)
7152
                canBuildWebKit="no"
7153
                canBuildQtConcurrent="no"
7154
                ;;
7155
        esac
7156
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7157
    irix-cc*)
7158
        canBuildWebKit="no"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7159
        canBuildQtConcurrent="no"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7160
	;;
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7161
    symbian/*-gcce)
7162
        canBuildWebKit="no"
7163
        canBuildQtConcurrent="no"
7164
        ;;
7165
    symbian/*-armcc)
7166
        canBuildQtConcurrent="no"
7167
        ;;
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7168
esac
7169
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7170
if [ "$CFG_GUI" = "no" ]; then
7171
    # WebKit requires QtGui
7172
    canBuildWebKit="no"
7173
fi
7174
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
7175
if [ "$CFG_SHARED" = "no" ]; then
7176
    echo
7177
    echo "WARNING: Using static linking will disable the WebKit module."
7178
    echo
7179
    canBuildWebKit="no"
7180
fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7181
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7182
CFG_CONCURRENT="yes"
7183
if [ "$canBuildQtConcurrent" = "no" ]; then
7184
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CONCURRENT"
7185
    CFG_CONCURRENT="no"
7186
fi
7187
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7188
if [ "$CFG_XMLPATTERNS" = "yes" -a "$CFG_EXCEPTIONS" = "no" ]; then
7189
    echo "QtXmlPatterns was requested, but it can't be built due to exceptions being disabled."
7190
    exit 1
7191
fi
7192
if [ "$CFG_XMLPATTERNS" = "auto" -a "$CFG_EXCEPTIONS" != "no" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7193
    CFG_XMLPATTERNS="$canBuildQtXmlPatterns"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7194
elif [ "$CFG_EXCEPTIONS" = "no" ]; then
7195
    CFG_XMLPATTERNS="no"
7196
fi
7197
if [ "$CFG_XMLPATTERNS" = "yes" ]; then
7198
    QT_CONFIG="$QT_CONFIG xmlpatterns"
7199
else
7200
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XMLPATTERNS"
7201
fi
7202
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7203
if [ "$CFG_MULTIMEDIA" = "no" ]; then
7204
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MULTIMEDIA"
7205
else
7206
    QT_CONFIG="$QT_CONFIG multimedia"
7207
fi
7208
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
7209
if [ "$CFG_AUDIO_BACKEND" = "yes" ]; then
7210
    QT_CONFIG="$QT_CONFIG audio-backend"
7211
fi
7212
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7213
if [ "$CFG_SVG" = "auto" ]; then
7214
    CFG_SVG=$CFG_GUI
7215
fi
7216
7217
if [ "$CFG_SVG" = "yes" ] && [ "$CFG_GUI" = "no" ]; then
7218
    echo "QtSvg requested, but it can't be built without QtGui"
7219
    exit 1
7220
fi
7221
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7222
if [ "$CFG_SVG" = "yes" ]; then
7223
    QT_CONFIG="$QT_CONFIG svg"
7224
else
7225
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SVG"
7226
fi
7227
7228
if [ "$CFG_WEBKIT" = "auto" ]; then
7229
    CFG_WEBKIT="$canBuildWebKit"
7230
fi
7231
7232
if [ "$CFG_WEBKIT" = "yes" ]; then
15.2.13 by Fathi Boudra
* New upstream release.
7233
    # This include takes care of adding "webkit" to QT_CONFIG.
7234
    cp -f "$relpath/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri" "$outpath/mkspecs/modules/qt_webkit_version.pri"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7235
    # The reason we set CFG_WEBKIT, is such that the printed overview of what will be enabled, shows correctly.
7236
    CFG_WEBKIT="yes"
7237
else
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7238
    rm -f "$outpath/mkspecs/modules/qt_webkit_version.pri"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7239
    CFG_WEBKIT="no"
7240
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WEBKIT"
7241
fi
7242
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7243
if [ "$CFG_SCRIPT" = "auto" ]; then
7244
    CFG_SCRIPT="yes"
7245
fi
7246
7247
if [ "$CFG_SCRIPT" = "yes" ]; then
7248
    QT_CONFIG="$QT_CONFIG script"
7249
else
7250
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPT"
7251
fi
7252
7253
if [ "$CFG_SCRIPTTOOLS" = "yes" -a "$CFG_SCRIPT" = "no" ]; then
7254
    echo "QtScriptTools was requested, but it can't be built due to QtScript being disabled."
7255
    exit 1
7256
fi
7257
if [ "$CFG_SCRIPTTOOLS" = "auto" -a "$CFG_SCRIPT" != "no" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7258
    CFG_SCRIPTTOOLS="yes"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7259
elif [ "$CFG_SCRIPT" = "no" ]; then
7260
    CFG_SCRIPTTOOLS="no"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7261
fi
7262
7263
if [ "$CFG_SCRIPTTOOLS" = "yes" ]; then
7264
    QT_CONFIG="$QT_CONFIG scripttools"
7265
else
7266
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPTTOOLS"
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
7267
fi
7268
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7269
7270
if [ "$CFG_DECLARATIVE" = "yes" ]; then
7271
    if [ "$CFG_SCRIPT" = "no" -o "$CFG_GUI" = "no" ]; then
7272
        echo "Error: QtDeclarative was requested, but it can't be built due to QtScript or QtGui being disabled."
7273
        exit 1
7274
    fi
7275
fi
7276
if [ "$CFG_DECLARATIVE" = "auto" ]; then
7277
    if [ "$CFG_SCRIPT" = "no" -o "$CFG_GUI" = "no" ]; then
7278
            CFG_DECLARATIVE=no
7279
    else
7280
            CFG_DECLARATIVE=yes
7281
    fi
7282
fi
7283
7284
if [ "$CFG_DECLARATIVE" = "yes" ]; then
7285
    QT_CONFIG="$QT_CONFIG declarative"
7286
else
7287
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DECLARATIVE"
7288
fi
7289
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7290
if [ "$CFG_EXCEPTIONS" = "no" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
7291
    case "$COMPILER" in
7292
    g++*)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7293
	QMakeVar add QMAKE_CFLAGS -fno-exceptions
7294
	QMakeVar add QMAKE_CXXFLAGS -fno-exceptions
7295
	QMakeVar add QMAKE_LFLAGS -fno-exceptions
1 by Adam Conrad
Import upstream version 4.0.0
7296
        ;;
7297
    cc*)
7298
        case "$PLATFORM" in
7299
        irix-cc*)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7300
	    QMakeVar add QMAKE_CFLAGS -LANG:exceptions=off
7301
	    QMakeVar add QMAKE_CXXFLAGS -LANG:exceptions=off
7302
	    QMakeVar add QMAKE_LFLAGS -LANG:exceptions=off
1 by Adam Conrad
Import upstream version 4.0.0
7303
            ;;
7304
        *) ;;
7305
        esac
7306
        ;;
7307
    *) ;;
7308
    esac
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7309
    QMAKE_CONFIG="$QMAKE_CONFIG exceptions_off"
1 by Adam Conrad
Import upstream version 4.0.0
7310
fi
7311
1.1.22 by Alessandro Ghersi
Import upstream version 4.5.2
7312
# On Mac, set the minimum deployment target for the different architechtures 
7313
# using the Xarch compiler option when supported (10.5 and up).  On 10.4 the
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7314
# deployment version is set to 10.4 globally using the QMAKE_MACOSX_DEPLOYMENT_TARGET
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7315
# env. variable. 
7316
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] ; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7317
    if echo "$CFG_MAC_ARCHS" | grep '\<x86\>' > /dev/null 2>&1; then
7318
        QMakeVar add QMAKE_CFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
7319
        QMakeVar add QMAKE_CXXFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
7320
        QMakeVar add QMAKE_LFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
7321
        QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86 "-arch i386 -Xarch_i386 -mmacosx-version-min=10.4"
7322
    fi
7323
    if echo "$CFG_MAC_ARCHS" | grep '\<ppc\>' > /dev/null 2>&1; then
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7324
        QMakeVar add QMAKE_CFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
7325
        QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
7326
        QMakeVar add QMAKE_LFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
7327
        QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=10.4"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7328
    fi
7329
    if echo "$CFG_MAC_ARCHS" | grep '\<x86_64\>' > /dev/null 2>&1; then
7330
        QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
7331
        QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
7332
        QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
7333
        QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5"
7334
    fi
7335
    if echo "$CFG_MAC_ARCHS" | grep '\<ppc64\>' > /dev/null 2>&1; then
7336
        QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
7337
        QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
7338
        QMakeVar add QMAKE_LFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
7339
        QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC_64 "-arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5"
7340
    fi
7341
fi
7342
1 by Adam Conrad
Import upstream version 4.0.0
7343
#-------------------------------------------------------------------------------
7344
# generate QT_BUILD_KEY
7345
#-------------------------------------------------------------------------------
7346
7347
# some compilers generate binary incompatible code between different versions,
7348
# so we need to generate a build key that is different between these compilers
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7349
COMPAT_COMPILER=
1 by Adam Conrad
Import upstream version 4.0.0
7350
case "$COMPILER" in
7351
g++*)
7352
    # GNU C++
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7353
    COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7354
7355
    case "$COMPILER_VERSION" in
7356
    *.*.*)
7357
        QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
7358
        QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
7359
        QT_GCC_PATCH_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
7360
        ;;
7361
    *.*)
7362
        QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\1,'`
7363
        QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\2,'`
7364
        QT_GCC_PATCH_VERSION=0
7365
        ;;
7366
    esac
7367
1 by Adam Conrad
Import upstream version 4.0.0
7368
    case "$COMPILER_VERSION" in
1.1.13 by Jonathan Riddell
Import upstream version 4.3.3
7369
    2.95.*)
1 by Adam Conrad
Import upstream version 4.0.0
7370
        COMPILER_VERSION="2.95.*"
7371
        ;;
1.1.13 by Jonathan Riddell
Import upstream version 4.3.3
7372
    3.*)
1 by Adam Conrad
Import upstream version 4.0.0
7373
        COMPILER_VERSION="3.*"
7374
        ;;
1.1.13 by Jonathan Riddell
Import upstream version 4.3.3
7375
    4.*)
1 by Adam Conrad
Import upstream version 4.0.0
7376
        COMPILER_VERSION="4"
7377
        ;;
7378
    *)
7379
        ;;
7380
    esac
7381
    [ '!' -z "$COMPILER_VERSION" ] && COMPILER="g++-${COMPILER_VERSION}"
7382
    ;;
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7383
icc*)
7384
    # The Intel CC compiler on Unix systems matches the ABI of the g++
7385
    # that is found on PATH
7386
    COMPILER="icc"
7387
    COMPAT_COMPILER="g++-4"
7388
    case "`g++ -dumpversion` 2>/dev/null" in
7389
    2.95.*)
7390
        COMPAT_COMPILER="g++-2.95.*"
7391
        ;;
7392
    3.*)
7393
        COMPAT_COMPILER="g++-3.*"
7394
        ;;
7395
    *)
7396
        ;;
7397
    esac
7398
    ;;
1 by Adam Conrad
Import upstream version 4.0.0
7399
*)
7400
    #
7401
    ;;
7402
esac
7403
7404
# QT_CONFIG can contain the following:
7405
#
7406
# Things that affect the Qt API/ABI:
7407
#
7408
#   Options:
7409
#     minimal-config small-config medium-config large-config full-config
7410
#
1.1.1 by Matthias Klose
Import upstream version 4.0.1
7411
#   Different edition modules:
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7412
#     gui network canvas table xml opengl sql
1 by Adam Conrad
Import upstream version 4.0.0
7413
#
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7414
# Things that do not affect the Qt API/ABI:
1 by Adam Conrad
Import upstream version 4.0.0
7415
#     stl
7416
#     system-jpeg no-jpeg jpeg
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7417
#     system-mng no-mng mng
1 by Adam Conrad
Import upstream version 4.0.0
7418
#     system-png no-png png
7419
#     system-zlib no-zlib zlib
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7420
#     system-libtiff no-libtiff
1 by Adam Conrad
Import upstream version 4.0.0
7421
#     no-gif gif
7422
#     debug release
7423
#     dll staticlib
7424
#
7425
#     nocrosscompiler
7426
#     GNUmake
7427
#     largefile
7428
#     nis
7429
#     nas
7430
#     tablet
7431
#     ipv6
7432
#
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7433
#     X11     : x11sm xinerama xcursor xfixes xrandr xrender mitshm fontconfig xkb
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
7434
#     Embedded: embedded freetype
1 by Adam Conrad
Import upstream version 4.0.0
7435
#
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7436
ALL_OPTIONS=
1 by Adam Conrad
Import upstream version 4.0.0
7437
BUILD_CONFIG=
7438
BUILD_OPTIONS=
7439
7440
# determine the build options
7441
for config_option in $QMAKE_CONFIG $QT_CONFIG; do
7442
    SKIP="yes"
7443
    case "$config_option" in
7444
    *-config)
7445
        # take the last *-config setting.  this is the highest config being used,
7446
        # and is the one that we will use for tagging plugins
7447
        BUILD_CONFIG="$config_option"
7448
        ;;
7449
7450
    *) # skip all other options since they don't affect the Qt API/ABI.
7451
        ;;
7452
    esac
7453
7454
    if [ "$SKIP" = "no" ]; then
7455
        BUILD_OPTIONS="$BUILD_OPTIONS $config_option"
7456
    fi
7457
done
7458
7459
# put the options that we are missing into .options
7460
rm -f .options
7461
for opt in `echo $ALL_OPTIONS`; do
7462
    SKIP="no"
7463
    if echo $BUILD_OPTIONS | grep $opt >/dev/null 2>&1; then
7464
        SKIP="yes"
7465
    fi
7466
    if [ "$SKIP" = "no" ]; then
7467
        echo "$opt" >> .options
7468
    fi
7469
done
7470
7471
# reconstruct BUILD_OPTIONS with a sorted negative feature list
7472
# (ie. only things that are missing are will be put into the build key)
7473
BUILD_OPTIONS=
7474
if [ -f .options ]; then
7475
    for opt in `sort -f .options | uniq`; do
7476
        BUILD_OPTIONS="$BUILD_OPTIONS no-$opt"
7477
    done
7478
fi
7479
rm -f .options
7480
7481
# QT_NO* defines affect the Qt API (and binary compatibility).  they need
7482
# to be included in the build key
7483
for build_option in $D_FLAGS; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7484
    build_option=`echo $build_option | cut -d \" -f 2 -`
1 by Adam Conrad
Import upstream version 4.0.0
7485
    case "$build_option" in
7486
    QT_NO*)
7487
        echo "$build_option" >> .options
7488
        ;;
7489
    *)
7490
        # skip all other compiler defines
7491
        ;;
7492
    esac
7493
done
7494
7495
# sort the compile time defines (helps ensure that changes in this configure
7496
# script don't affect the QT_BUILD_KEY generation)
7497
if [ -f .options ]; then
7498
    for opt in `sort -f .options | uniq`; do
7499
        BUILD_OPTIONS="$BUILD_OPTIONS $opt"
7500
    done
7501
fi
7502
rm -f .options
7503
7504
BUILD_OPTIONS="$BUILD_CONFIG $BUILD_OPTIONS"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7505
# extract the operating system from the XPLATFORM
7506
TARGET_OPERATING_SYSTEM=`echo $XPLATFORM | cut -f 2- -d/ | cut -f -1 -d-`
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
7507
case "$XPLATFORM" in
7508
symbian*)
7509
    QT_BUILD_KEY_SYSTEM_PART="Symbian"
7510
    ;;
7511
*)
7512
    QT_BUILD_KEY_SYSTEM_PART="$CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER"
7513
    ;;
7514
esac
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
7515
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7516
# when cross-compiling, don't include build-host information (build key is target specific)
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
7517
QT_BUILD_KEY="$CFG_USER_BUILD_KEY $QT_BUILD_KEY_SYSTEM_PART $BUILD_OPTIONS"
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
7518
if [ -n "$QT_NAMESPACE" ]; then
7519
    QT_BUILD_KEY="$QT_BUILD_KEY $QT_NAMESPACE"
7520
fi
7521
MAC_NEED_TWO_BUILD_KEYS="no"
7522
if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then
7523
    QT_BUILD_KEY_CARBON=$QT_BUILD_KEY
7524
    TARGET_OPERATING_SYSTEM="$TARGET_OPERATING_SYSTEM-cocoa"
7525
    QT_BUILD_KEY_COCOA="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
7526
    if [ "$CFG_MAC_CARBON" = "no" ]; then
7527
        QT_BUILD_KEY=$QT_BUILD_KEY_COCOA
7528
    else
7529
        MAC_NEED_TWO_BUILD_KEYS="yes"
7530
    fi
7531
fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7532
# don't break loading plugins build with an older version of Qt
7533
QT_BUILD_KEY_COMPAT=
7534
if [ "$QT_CROSS_COMPILE" = "no" ]; then
7535
    # previous versions of Qt used a build key built from the uname
7536
    QT_BUILD_KEY_COMPAT="$CFG_USER_BUILD_KEY $UNAME_MACHINE $UNAME_SYSTEM $COMPILER $BUILD_OPTIONS"
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
7537
    if [ -n "$QT_NAMESPACE" ]; then
7538
        QT_BUILD_KEY_COMPAT="$QT_BUILD_KEY_COMPAT $QT_NAMESPACE"
7539
    fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7540
fi
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7541
7542
# is this compiler compatible with some other "standard" build key
7543
QT_BUILD_KEY_COMPAT_COMPILER=
7544
if [ ! -z "$COMPAT_COMPILER" ]; then
7545
    QT_BUILD_KEY_COMPAT_COMPILER="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPAT_COMPILER $BUILD_OPTIONS"
7546
    if [ -n "$QT_NAMESPACE" ]; then
7547
        QT_BUILD_KEY_COMPAT_COMPILER="$QT_BUILD_KEY_COMPAT_COMPILER $QT_NAMESPACE"
7548
    fi
7549
fi
7550
1 by Adam Conrad
Import upstream version 4.0.0
7551
# strip out leading/trailing/extra whitespace
7552
QT_BUILD_KEY=`echo $QT_BUILD_KEY | sed -e "s,  *, ,g" -e "s,^  *,," -e "s,  *$,,"`
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7553
QT_BUILD_KEY_COMPAT=`echo $QT_BUILD_KEY_COMPAT | sed -e "s,  *, ,g" -e "s,^  *,," -e "s,  *$,,"`
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7554
QT_BUILD_KEY_COMPAT_COMPILER=`echo $QT_BUILD_KEY_COMPAT_COMPILER | sed -e "s,  *, ,g" -e "s,^  *,," -e "s,  *$,,"`
1 by Adam Conrad
Import upstream version 4.0.0
7555
7556
#-------------------------------------------------------------------------------
7557
# part of configuration information goes into qconfig.h
7558
#-------------------------------------------------------------------------------
7559
7560
case "$CFG_QCONFIG" in
7561
full)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7562
    echo "/* Everything */" >"$outpath/src/corelib/global/qconfig.h.new"
1 by Adam Conrad
Import upstream version 4.0.0
7563
    ;;
7564
*)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7565
    tmpconfig="$outpath/src/corelib/global/qconfig.h.new"
7566
    echo "#ifndef QT_BOOTSTRAPPED" >"$tmpconfig"
1.1.32 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100706
7567
    if [ -f "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" ]; then
7568
        cat "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" >>"$tmpconfig"
7569
    elif [ -f `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` ]; then
7570
        cat `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` >>"$tmpconfig"
7571
    fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7572
    echo "#endif" >>"$tmpconfig"
1 by Adam Conrad
Import upstream version 4.0.0
7573
    ;;
7574
esac
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
7575
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7576
cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
1 by Adam Conrad
Import upstream version 4.0.0
7577
1.1.1 by Matthias Klose
Import upstream version 4.0.1
7578
/* Qt Edition */
7579
#ifndef QT_EDITION
7580
#  define QT_EDITION $QT_EDITION
7581
#endif
7582
1 by Adam Conrad
Import upstream version 4.0.0
7583
/* Machine byte-order */
7584
#define Q_BIG_ENDIAN 4321
7585
#define Q_LITTLE_ENDIAN 1234
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
7586
EOF
7587
7588
if [ "$MAC_NEED_TWO_BUILD_KEYS" = "no" ]; then
7589
    echo "#define QT_BUILD_KEY \"$QT_BUILD_KEY\"" \
7590
        >> "$outpath/src/corelib/global/qconfig.h.new"
7591
else
7592
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
7593
7594
#define QT_BUILD_KEY_CARBON "$QT_BUILD_KEY_CARBON"
7595
#define QT_BUILD_KEY_COCOA "$QT_BUILD_KEY_COCOA"
7596
EOF
7597
fi
7598
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7599
if [ -n "$QT_BUILD_KEY_COMPAT" ]; then
7600
    echo "#define QT_BUILD_KEY_COMPAT \"$QT_BUILD_KEY_COMPAT\"" \
7601
        >> "$outpath/src/corelib/global/qconfig.h.new"
7602
fi
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7603
if [ -n "$QT_BUILD_KEY_COMPAT_COMPILER" ]; then
7604
    echo "#define QT_BUILD_KEY_COMPAT2 \"$QT_BUILD_KEY_COMPAT_COMPILER\"" \
7605
        >> "$outpath/src/corelib/global/qconfig.h.new"
7606
fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7607
echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7608
7609
echo "#ifdef QT_BOOTSTRAPPED" >>"$outpath/src/corelib/global/qconfig.h.new"
7610
if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
7611
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
7612
#if defined(__BIG_ENDIAN__)
7613
# define Q_BYTE_ORDER Q_BIG_ENDIAN
7614
#elif defined(__LITTLE_ENDIAN__)
7615
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
7616
#else
7617
# error "Unable to determine byte order!"
7618
#endif
7619
EOF
7620
else
7621
    echo "#define Q_BYTE_ORDER $CFG_HOST_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
7622
fi
7623
echo "#else" >>"$outpath/src/corelib/global/qconfig.h.new"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7624
if [ "$CFG_ENDIAN" = "auto" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7625
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7626
#if defined(__BIG_ENDIAN__)
7627
# define Q_BYTE_ORDER Q_BIG_ENDIAN
7628
#elif defined(__LITTLE_ENDIAN__)
7629
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
7630
#else
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7631
# error "Unable to determine byte order!"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7632
#endif
7633
EOF
7634
else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7635
    echo "#define Q_BYTE_ORDER $CFG_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7636
fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7637
echo "#endif" >>"$outpath/src/corelib/global/qconfig.h.new"
1 by Adam Conrad
Import upstream version 4.0.0
7638
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
7639
if [ "$CFG_DOUBLEFORMAT" != "normal" ]; then
7640
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
7641
/* Non-IEEE double format */
7642
#define Q_DOUBLE_LITTLE "01234567"
7643
#define Q_DOUBLE_BIG "76543210"
7644
#define Q_DOUBLE_LITTLE_SWAPPED "45670123"
7645
#define Q_DOUBLE_BIG_SWAPPED "32107654"
7646
#define Q_DOUBLE_FORMAT $CFG_DOUBLEFORMAT
7647
EOF
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7648
fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7649
if [ "$CFG_ARMFPA" = "yes" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
7650
    if [ "$CFG_ARCH" != "$CFG_HOST_ARCH" ]; then
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7651
	cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
7652
#ifndef QT_BOOTSTRAPPED
7653
# define QT_ARMFPA
7654
#endif
7655
EOF
7656
    else
7657
	echo "#define QT_ARMFPA" >>"$outpath/src/corelib/global/qconfig.h.new"
7658
    fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7659
fi
1.1.9 by Jonathan Riddell
Import upstream version 4.2.3
7660
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
7661
CFG_ARCH_STR=`echo $CFG_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7662
CFG_HOST_ARCH_STR=`echo $CFG_HOST_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7663
cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
7664
/* Machine Architecture */
7665
#ifndef QT_BOOTSTRAPPED
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
7666
# define QT_ARCH_${CFG_ARCH_STR}
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7667
#else
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
7668
# define QT_ARCH_${CFG_HOST_ARCH_STR}
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7669
#endif
7670
EOF
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7671
7672
echo '/* Compile time features */' >>"$outpath/src/corelib/global/qconfig.h.new"
7673
[ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\"" >>"$outpath/src/corelib/global/qconfig.h.new"
1 by Adam Conrad
Import upstream version 4.0.0
7674
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
7675
if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7676
    echo "#define QT_LARGEFILE_SUPPORT 64" >>"$outpath/src/corelib/global/qconfig.h.new"
1 by Adam Conrad
Import upstream version 4.0.0
7677
fi
7678
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7679
# if both carbon and cocoa are specified, enable the autodetection code.
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7680
if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then
7681
    echo "#define QT_AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
7682
elif [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7683
    echo "#define QT_MAC_USE_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
7684
fi
7685
1.1.8 by Jonathan Riddell
Import upstream version 4.2.2
7686
if [ "$CFG_FRAMEWORK" = "yes" ]; then
7687
    echo "#define QT_MAC_FRAMEWORK_BUILD" >>"$outpath/src/corelib/global/qconfig.h.new"
7688
fi
7689
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7690
if [ "$PLATFORM_MAC" = "yes" ]; then
7691
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
7692
#if defined(__LP64__)
7693
# define QT_POINTER_SIZE 8
7694
#else
7695
# define QT_POINTER_SIZE 4
7696
#endif
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7697
EOF
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7698
else
7699
    "$unixtests/ptrsize.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
7700
    echo "#define QT_POINTER_SIZE $?" >>"$outpath/src/corelib/global/qconfig.h.new"
7701
fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7702
7703
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7704
echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
1 by Adam Conrad
Import upstream version 4.0.0
7705
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
7706
if [ "$CFG_DEV" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7707
    echo "#define QT_BUILD_INTERNAL" >>"$outpath/src/corelib/global/qconfig.h.new"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7708
fi
7709
1 by Adam Conrad
Import upstream version 4.0.0
7710
# Embedded compile time options
7711
if [ "$PLATFORM_QWS" = "yes" ]; then
7712
    # Add QWS to config.h
7713
    QCONFIG_FLAGS="$QCONFIG_FLAGS Q_WS_QWS"
7714
7715
    # Add excluded decorations to $QCONFIG_FLAGS
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7716
    decors=`grep '^decorations -= ' "$QMAKE_VARS_FILE" | ${AWK} '{print $3}'`
7717
    for decor in $decors; do
7718
        NODECORATION=`echo $decor | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7719
        QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_NO_QWS_DECORATION_${NODECORATION}"
1 by Adam Conrad
Import upstream version 4.0.0
7720
    done
7721
7722
    # Figure which embedded drivers which are turned off
7723
    CFG_GFX_OFF="$CFG_GFX_AVAILABLE"
7724
    for ADRIVER in $CFG_GFX_ON; do
7725
        CFG_GFX_OFF=`echo "${CFG_GFX_OFF} " | sed "s,${ADRIVER} ,,g"`
7726
    done
7727
7728
    CFG_KBD_OFF="$CFG_KBD_AVAILABLE"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7729
    # the um driver is currently not in the available list for external builds
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
7730
    if [ "$CFG_DEV" = "no" ]; then
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7731
	CFG_KBD_OFF="$CFG_KBD_OFF um"
7732
    fi
1 by Adam Conrad
Import upstream version 4.0.0
7733
    for ADRIVER in $CFG_KBD_ON; do
7734
        CFG_KBD_OFF=`echo "${CFG_KBD_OFF} " | sed "s,${ADRIVER} ,,g"`
7735
    done
7736
7737
    CFG_MOUSE_OFF="$CFG_MOUSE_AVAILABLE"
7738
    for ADRIVER in $CFG_MOUSE_ON; do
7739
        CFG_MOUSE_OFF=`echo "${CFG_MOUSE_OFF} " | sed "s,${ADRIVER} ,,g"`
7740
    done
7741
7742
    for DRIVER in $CFG_GFX_OFF; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7743
        NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1 by Adam Conrad
Import upstream version 4.0.0
7744
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_$NODRIVER"
7745
    done
7746
7747
    for DRIVER in $CFG_KBD_OFF; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7748
        NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1 by Adam Conrad
Import upstream version 4.0.0
7749
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_KBD_$NODRIVER"
7750
    done
7751
7752
    for DRIVER in $CFG_MOUSE_OFF; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7753
        NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1 by Adam Conrad
Import upstream version 4.0.0
7754
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_MOUSE_$NODRIVER"
7755
    done
7756
fi # QWS
7757
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7758
if [ "${CFG_USE_FLOATMATH}" = "yes" ]; then
7759
    QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_USE_MATH_H_FLOATS"
7760
fi
7761
1 by Adam Conrad
Import upstream version 4.0.0
7762
# Add turned on SQL drivers
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7763
for DRIVER in $CFG_SQL_AVAILABLE; do
7764
    eval "VAL=\$CFG_SQL_$DRIVER"
7765
    case "$VAL" in
7766
    qt)
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7767
        ONDRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7768
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SQL_$ONDRIVER"
7769
        SQL_DRIVERS="$SQL_DRIVERS $DRIVER"
7770
    ;;
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
7771
    plugin)
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7772
        SQL_PLUGINS="$SQL_PLUGINS $DRIVER"
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
7773
    ;;
7774
    esac
1 by Adam Conrad
Import upstream version 4.0.0
7775
done
7776
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7777
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7778
QMakeVar set sql-drivers "$SQL_DRIVERS"
7779
QMakeVar set sql-plugins "$SQL_PLUGINS"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7780
1 by Adam Conrad
Import upstream version 4.0.0
7781
# Add other configuration options to the qconfig.h file
7782
[ "$CFG_GIF" = "yes" ]       && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_BUILTIN_GIF_READER=1"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7783
[ "$CFG_TIFF" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_TIFF"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
7784
[ "$CFG_PNG" != "yes" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_PNG"
7785
[ "$CFG_JPEG" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_JPEG"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7786
[ "$CFG_MNG" != "yes" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_MNG"
1 by Adam Conrad
Import upstream version 4.0.0
7787
[ "$CFG_ZLIB" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7788
[ "$CFG_S60" != "yes" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_S60"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7789
[ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS"
1 by Adam Conrad
Import upstream version 4.0.0
7790
[ "$CFG_IPV6" = "no" ]       && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6"
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
7791
[ "$CFG_SXE" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7792
[ "$CFG_DBUS" = "no" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS"
1 by Adam Conrad
Import upstream version 4.0.0
7793
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7794
if [ "$PLATFORM_QWS" != "yes" ]; then
7795
    [ "$CFG_GRAPHICS_SYSTEM" = "raster" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RASTER"
7796
    [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENGL"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7797
    [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENVG"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7798
    [ "$CFG_GRAPHICS_SYSTEM" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RUNTIME"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7799
fi
7800
1 by Adam Conrad
Import upstream version 4.0.0
7801
# X11/Unix/Mac only configs
7802
[ "$CFG_CUPS" = "no" ]       && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CUPS"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7803
[ "$CFG_ICONV" = "no" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICONV"
7804
[ "$CFG_GLIB" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLIB"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7805
[ "$CFG_GSTREAMER" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GSTREAMER"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7806
[ "$CFG_QGTKSTYLE" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_GTK"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7807
[ "$CFG_CLOCK_MONOTONIC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CLOCK_MONOTONIC"
7808
[ "$CFG_MREMAP" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MREMAP"
1 by Adam Conrad
Import upstream version 4.0.0
7809
[ "$CFG_GETADDRINFO" = "no" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETADDRINFO"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7810
[ "$CFG_IPV6IFNAME" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6IFNAME"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7811
[ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS"
7812
[ "$CFG_INOTIFY" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7813
[ "$CFG_NAS" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NAS"
1 by Adam Conrad
Import upstream version 4.0.0
7814
[ "$CFG_NIS" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7815
[ "$CFG_OPENSSL" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7816
[ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7817
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7818
[ "$CFG_SM" = "no" ]         && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SESSIONMANAGER"
1 by Adam Conrad
Import upstream version 4.0.0
7819
[ "$CFG_XCURSOR" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XCURSOR"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7820
[ "$CFG_XFIXES" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XFIXES"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7821
[ "$CFG_FONTCONFIG" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FONTCONFIG"
1 by Adam Conrad
Import upstream version 4.0.0
7822
[ "$CFG_XINERAMA" = "no" ]   && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINERAMA"
7823
[ "$CFG_XKB" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XKB"
7824
[ "$CFG_XRANDR" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRANDR"
7825
[ "$CFG_XRENDER" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRENDER"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7826
[ "$CFG_MITSHM" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MITSHM"
1 by Adam Conrad
Import upstream version 4.0.0
7827
[ "$CFG_XSHAPE" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7828
[ "$CFG_XVIDEO" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XVIDEO"
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
7829
[ "$CFG_XSYNC" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7830
[ "$CFG_XINPUT" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET"
1 by Adam Conrad
Import upstream version 4.0.0
7831
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7832
[ "$CFG_XCURSOR" = "runtime" ]   && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR"
7833
[ "$CFG_XINERAMA" = "runtime" ]  && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINERAMA"
7834
[ "$CFG_XFIXES" = "runtime" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XFIXES"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7835
[ "$CFG_XRANDR" = "runtime" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XRANDR"
7836
[ "$CFG_XINPUT" = "runtime" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINPUT"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7837
[ "$CFG_ALSA" = "no" ]           && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ALSA"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7838
[ "$CFG_PULSEAUDIO" = "no" ]          && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PULSEAUDIO"
7839
[ "$CFG_COREWLAN" = "no" ]       && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_COREWLAN"
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
7840
[ "$CFG_ICD" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICD"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7841
1 by Adam Conrad
Import upstream version 4.0.0
7842
# sort QCONFIG_FLAGS for neatness if we can
1.1.1 by Matthias Klose
Import upstream version 4.0.1
7843
[ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq`
1 by Adam Conrad
Import upstream version 4.0.0
7844
QCONFIG_FLAGS=`echo $QCONFIG_FLAGS`
7845
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7846
if echo $XPLATFORM | grep symbian >/dev/null
7847
then
7848
    # Enable Symbian DLLs and export rules.
7849
    # We cannot use Linux's default export rules since they export everything.
7850
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_DLL"
7851
    # Disable non-working features.
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
7852
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CONCURRENT QT_NO_QFUTURE QT_NO_CRASHHANDLER QT_NO_PRINTER QT_NO_SYSTEMTRAYICON"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
7853
fi
7854
1 by Adam Conrad
Import upstream version 4.0.0
7855
if [ -n "$QCONFIG_FLAGS" ]; then
1.1.32 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100706
7856
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
7857
#ifndef QT_BOOTSTRAPPED
7858
7859
EOF
1 by Adam Conrad
Import upstream version 4.0.0
7860
    for cfg in $QCONFIG_FLAGS; do
7861
        cfgd=`echo $cfg | sed 's/=.*$//'` # trim pushed 'Foo=Bar' defines
7862
        cfg=`echo $cfg | sed 's/=/ /'`    # turn first '=' into a space
7863
        # figure out define logic, so we can output the correct
7864
        # ifdefs to override the global defines in a project
7865
        cfgdNeg=
7866
        if [ true ] && echo "$cfgd" | grep 'QT_NO_' >/dev/null 2>&1; then
7867
            # QT_NO_option can be forcefully turned on by QT_option
7868
            cfgdNeg=`echo $cfgd | sed "s,QT_NO_,QT_,"`
7869
        elif [ true ] && echo "$cfgd" | grep 'QT_' >/dev/null 2>&1; then
7870
            # QT_option can be forcefully turned off by QT_NO_option
7871
            cfgdNeg=`echo $cfgd | sed "s,QT_,QT_NO_,"`
7872
        fi
7873
7874
        if [ -z $cfgdNeg ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7875
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
1 by Adam Conrad
Import upstream version 4.0.0
7876
#ifndef $cfgd
7877
# define $cfg
7878
#endif
7879
7880
EOF
7881
        else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7882
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
1 by Adam Conrad
Import upstream version 4.0.0
7883
#if defined($cfgd) && defined($cfgdNeg)
7884
# undef $cfgd
7885
#elif !defined($cfgd) && !defined($cfgdNeg)
7886
# define $cfg
7887
#endif
7888
7889
EOF
7890
        fi
7891
    done
1.1.32 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100706
7892
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
7893
#endif // QT_BOOTSTRAPPED
7894
7895
EOF
1 by Adam Conrad
Import upstream version 4.0.0
7896
fi
7897
7898
if [ "$CFG_REDUCE_EXPORTS" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7899
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
1 by Adam Conrad
Import upstream version 4.0.0
7900
#define QT_VISIBILITY_AVAILABLE
7901
7902
EOF
7903
fi
7904
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
7905
if [ -n "$QT_LIBINFIX" ]; then
7906
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
7907
#define QT_LIBINFIX "$QT_LIBINFIX"
7908
7909
EOF
7910
fi
7911
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7912
if [ -n "$CFG_RUNTIME_SYSTEM" ]; then
7913
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
7914
#define QT_DEFAULT_RUNTIME_SYSTEM "$CFG_RUNTIME_SYSTEM"
7915
7916
EOF
7917
fi
7918
1 by Adam Conrad
Import upstream version 4.0.0
7919
# avoid unecessary rebuilds by copying only if qconfig.h has changed
7920
if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
7921
    rm -f "$outpath/src/corelib/global/qconfig.h.new"
7922
else
7923
    [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h"
7924
    mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
7925
    chmod -w "$outpath/src/corelib/global/qconfig.h"
7926
    for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
7927
        if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null 2>&1 ; then
7928
            [ -e "$conf" ] && rm -rf "$conf"
7929
            cp -a "$outpath/src/corelib/global/qconfig.h" "$conf"
7930
        elif [ '!' -f "$conf" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
7931
            ln -s "$outpath/src/corelib/global/qconfig.h" "$conf"
7932
        fi
7933
    done
7934
fi
7935
#-------------------------------------------------------------------------------
7936
# save configuration into qconfig.pri
7937
#-------------------------------------------------------------------------------
7938
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7939
QTCONFIG="$outpath/mkspecs/qconfig.pri"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7940
QTCONFIG_CONFIG="$QTCONFIG_CONFIG no_mocdepend"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7941
[ -f "$QTCONFIG.tmp" ] && rm -f "$QTCONFIG.tmp"
1 by Adam Conrad
Import upstream version 4.0.0
7942
if [ "$CFG_DEBUG" = "yes" ]; then
7943
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG debug"
7944
    if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
7945
        QT_CONFIG="$QT_CONFIG release"
7946
    fi
7947
    QT_CONFIG="$QT_CONFIG debug"
7948
elif [ "$CFG_DEBUG" = "no" ]; then
7949
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG release"
1.1.1 by Matthias Klose
Import upstream version 4.0.1
7950
    if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
7951
        QT_CONFIG="$QT_CONFIG debug"
7952
    fi
1 by Adam Conrad
Import upstream version 4.0.0
7953
    QT_CONFIG="$QT_CONFIG release"
7954
fi
7955
if [ "$CFG_STL" = "yes" ]; then
7956
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG stl"
7957
fi
7958
if [ "$CFG_FRAMEWORK" = "no" ]; then
7959
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_no_framework"
7960
else
7961
    QT_CONFIG="$QT_CONFIG qt_framework"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7962
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_framework"
1 by Adam Conrad
Import upstream version 4.0.0
7963
fi
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
7964
if [ "$PLATFORM_MAC" = "yes" ]; then
7965
    QT_CONFIG="$QT_CONFIG $CFG_MAC_ARCHS"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7966
fi
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
7967
if [ "$CFG_DEV" = "yes" ]; then
7968
    QT_CONFIG="$QT_CONFIG private_tests"
7969
fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7970
7971
# Make the application arch follow the Qt arch for single arch builds.
7972
# (for multiple-arch builds, set CONFIG manually in the application .pro file)
7973
if [ `echo "$CFG_MAC_ARCHS" | wc -w` -eq 1 ]; then
7974
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG $CFG_MAC_ARCHS"
7975
fi
7976
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7977
cat >>"$QTCONFIG.tmp" <<EOF
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7978
#configuration
1 by Adam Conrad
Import upstream version 4.0.0
7979
CONFIG += $QTCONFIG_CONFIG
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
7980
QT_ARCH = $CFG_ARCH
1.1.1 by Matthias Klose
Import upstream version 4.0.1
7981
QT_EDITION = $Edition
1 by Adam Conrad
Import upstream version 4.0.0
7982
QT_CONFIG += $QT_CONFIG
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
7983
7984
#versioning
7985
QT_VERSION = $QT_VERSION
7986
QT_MAJOR_VERSION = $QT_MAJOR_VERSION
7987
QT_MINOR_VERSION = $QT_MINOR_VERSION
7988
QT_PATCH_VERSION = $QT_PATCH_VERSION
7989
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7990
#namespaces
7991
QT_LIBINFIX = $QT_LIBINFIX
7992
QT_NAMESPACE = $QT_NAMESPACE
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7993
QT_NAMESPACE_MAC_CRC = $QT_NAMESPACE_MAC_CRC
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
7994
1 by Adam Conrad
Import upstream version 4.0.0
7995
EOF
7996
if [ "$CFG_RPATH" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
7997
    echo "QMAKE_RPATHDIR += \"$QT_INSTALL_LIBS\"" >> "$QTCONFIG.tmp"
1 by Adam Conrad
Import upstream version 4.0.0
7998
fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
7999
if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
8000
    echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION" >> "$QTCONFIG.tmp"
8001
    echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION" >> "$QTCONFIG.tmp"
8002
    echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION" >> "$QTCONFIG.tmp"
8003
fi
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
8004
if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null 2>&1; then
8005
    echo "#Qt for symbian FPU settings" >> "$QTCONFIG.tmp"
8006
    echo "MMP_RULES += \"ARMFPU softvfp\"" >> "$QTCONFIG.tmp"
8007
fi
1 by Adam Conrad
Import upstream version 4.0.0
8008
# replace qconfig.pri if it differs from the newly created temp file
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8009
if cmp -s "$QTCONFIG.tmp" "$QTCONFIG"; then
8010
    rm -f "$QTCONFIG.tmp"
1 by Adam Conrad
Import upstream version 4.0.0
8011
else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8012
    mv -f "$QTCONFIG.tmp" "$QTCONFIG"
1 by Adam Conrad
Import upstream version 4.0.0
8013
fi
8014
8015
#-------------------------------------------------------------------------------
8016
# save configuration into .qmake.cache
8017
#-------------------------------------------------------------------------------
8018
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8019
CACHEFILE="$outpath/.qmake.cache"
8020
[ -f "$CACHEFILE.tmp" ] && rm -f "$CACHEFILE.tmp"
8021
cat >>"$CACHEFILE.tmp" <<EOF
1 by Adam Conrad
Import upstream version 4.0.0
8022
CONFIG += $QMAKE_CONFIG dylib create_prl link_prl depend_includepath fix_output_dirs QTDIR_build
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8023
QT_SOURCE_TREE = \$\$quote($relpath)
8024
QT_BUILD_TREE = \$\$quote($outpath)
8025
QT_BUILD_PARTS = $CFG_BUILD_PARTS
1 by Adam Conrad
Import upstream version 4.0.0
8026
QMAKE_ABSOLUTE_SOURCE_ROOT = \$\$QT_SOURCE_TREE
8027
QMAKE_MOC_SRC    = \$\$QT_BUILD_TREE/src/moc
8028
8029
#local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
8030
QMAKE_MOC        = \$\$QT_BUILD_TREE/bin/moc-qt4
8031
QMAKE_UIC        = \$\$QT_BUILD_TREE/bin/uic-qt4
1 by Adam Conrad
Import upstream version 4.0.0
8032
QMAKE_UIC3       = \$\$QT_BUILD_TREE/bin/uic3
8033
QMAKE_RCC        = \$\$QT_BUILD_TREE/bin/rcc
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8034
QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp
1 by Adam Conrad
Import upstream version 4.0.0
8035
QMAKE_INCDIR_QT  = \$\$QT_BUILD_TREE/include
8036
QMAKE_LIBDIR_QT  = \$\$QT_BUILD_TREE/lib
8037
8038
EOF
8039
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8040
# Ensure we can link to uninistalled libraries
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
8041
if [ "$XPLATFORM_MINGW" != "yes" ] && linkerSupportsFlag -rpath-link "$outpath/lib"; then
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
8042
    echo "QMAKE_LFLAGS    = -Wl,-rpath-link,\$\$QT_BUILD_TREE/lib \$\$QMAKE_LFLAGS" >> "$CACHEFILE.tmp"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8043
fi
8044
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8045
if [ -n "$QT_CFLAGS_PSQL" ]; then
8046
    echo "QT_CFLAGS_PSQL   = $QT_CFLAGS_PSQL" >> "$CACHEFILE.tmp"
8047
fi
8048
if [ -n "$QT_LFLAGS_PSQL" ]; then
8049
    echo "QT_LFLAGS_PSQL   = $QT_LFLAGS_PSQL" >> "$CACHEFILE.tmp"
8050
fi
8051
if [ -n "$QT_CFLAGS_MYSQL" ]; then
8052
    echo "QT_CFLAGS_MYSQL   = $QT_CFLAGS_MYSQL" >> "$CACHEFILE.tmp"
8053
fi
8054
if [ -n "$QT_LFLAGS_MYSQL" ]; then
8055
    echo "QT_LFLAGS_MYSQL   = $QT_LFLAGS_MYSQL" >> "$CACHEFILE.tmp"
8056
fi
8057
if [ -n "$QT_CFLAGS_SQLITE" ]; then
8058
    echo "QT_CFLAGS_SQLITE   = $QT_CFLAGS_SQLITE" >> "$CACHEFILE.tmp"
8059
fi
8060
if [ -n "$QT_LFLAGS_SQLITE" ]; then
8061
    echo "QT_LFLAGS_SQLITE   = $QT_LFLAGS_SQLITE" >> "$CACHEFILE.tmp"
8062
fi
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8063
if [ -n "$QT_LFLAGS_ODBC" ]; then
8064
    echo "QT_LFLAGS_ODBC   = $QT_LFLAGS_ODBC" >> "$CACHEFILE.tmp"
8065
fi
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
8066
if [ -n "$QT_LFLAGS_TDS" ]; then
8067
    echo "QT_LFLAGS_TDS   = $QT_LFLAGS_TDS" >> "$CACHEFILE.tmp"
8068
fi
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8069
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8070
if [ "$QT_EDITION" != "QT_EDITION_OPENSOURCE" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8071
    echo "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" >> "$CACHEFILE.tmp"
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8072
fi
8073
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
8074
#dump in the OPENSSL_LIBS info
8075
if [ '!' -z "$OPENSSL_LIBS" ]; then
8076
    echo "OPENSSL_LIBS = $OPENSSL_LIBS" >> "$CACHEFILE.tmp"
8077
elif [ "$CFG_OPENSSL" = "linked" ]; then
8078
    echo "OPENSSL_LIBS = -lssl -lcrypto" >> "$CACHEFILE.tmp"
8079
fi
8080
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
8081
#dump in the SDK info
8082
if [ '!' -z "$CFG_SDK" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8083
   echo "QMAKE_MAC_SDK = $CFG_SDK" >> "$CACHEFILE.tmp"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
8084
fi
8085
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8086
# mac gcc -Xarch support
8087
if [ "$CFG_MAC_XARCH" = "no" ]; then
8088
   echo "QMAKE_MAC_XARCH = no" >> "$CACHEFILE.tmp"
8089
fi
8090
1 by Adam Conrad
Import upstream version 4.0.0
8091
#dump the qmake spec
8092
if [ -d "$outpath/mkspecs/$XPLATFORM" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8093
   echo "QMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$XPLATFORM" >> "$CACHEFILE.tmp"
1 by Adam Conrad
Import upstream version 4.0.0
8094
else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8095
   echo "QMAKESPEC = $XPLATFORM" >> "$CACHEFILE.tmp"
1 by Adam Conrad
Import upstream version 4.0.0
8096
fi
8097
8098
# cmdline args
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8099
cat "$QMAKE_VARS_FILE" >> "$CACHEFILE.tmp"
8100
rm -f "$QMAKE_VARS_FILE" 2>/dev/null
8101
1 by Adam Conrad
Import upstream version 4.0.0
8102
# incrementals
8103
INCREMENTAL=""
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
8104
[ "$CFG_INCREMENTAL" = "auto" ] && "$WHICH" p4 >/dev/null 2>&1 && [ "$CFG_DEV" = "yes" ] && CFG_INCREMENTAL="yes"
1 by Adam Conrad
Import upstream version 4.0.0
8105
if [ "$CFG_INCREMENTAL" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8106
    find "$relpath" -perm u+w -mtime -3 | grep 'cpp$' | while read f; do
1 by Adam Conrad
Import upstream version 4.0.0
8107
        # don't need to worry about generated files
8108
        [ -r `echo $f | sed "s,cpp$,ui,"` ] && continue
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8109
        basename "$f" | grep '^moc_' >/dev/null 2>&1 && continue
1 by Adam Conrad
Import upstream version 4.0.0
8110
        # done
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8111
        INCREMENTAL="$INCREMENTAL `basename \"$f\" | sed 's,.cpp,.o,'`"
1 by Adam Conrad
Import upstream version 4.0.0
8112
    done
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8113
    [ '!' -z "$INCREMENTAL" ] && echo "QMAKE_INCREMENTAL += $INCREMENTAL" >> "$CACHEFILE.tmp"
8114
    [ -r "$outpath/.qmake.incremental" ] && echo "include($outpath/.qmake.incremental)" >> "$CACHEFILE.tmp"
1 by Adam Conrad
Import upstream version 4.0.0
8115
fi
8116
8117
# replace .qmake.cache if it differs from the newly created temp file
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8118
if cmp -s "$CACHEFILE.tmp" "$CACHEFILE"; then
8119
    rm -f "$CACHEFILE.tmp"
1 by Adam Conrad
Import upstream version 4.0.0
8120
else
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8121
    mv -f "$CACHEFILE.tmp" "$CACHEFILE"
1 by Adam Conrad
Import upstream version 4.0.0
8122
fi
8123
8124
#-------------------------------------------------------------------------------
8125
# give feedback on configuration
8126
#-------------------------------------------------------------------------------
8127
8128
case "$COMPILER" in
8129
g++*)
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
8130
    if [ "$CFG_EXCEPTIONS" != "no" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
8131
        cat <<EOF
8132
8133
        This target is using the GNU C++ compiler ($PLATFORM).
8134
8135
        Recent versions of this compiler automatically include code for
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8136
        exceptions, which increase both the size of the Qt libraries and
8137
        the amount of memory taken by your applications.
1 by Adam Conrad
Import upstream version 4.0.0
8138
8139
        You may choose to re-run `basename $0` with the -no-exceptions
8140
        option to compile Qt without exceptions. This is completely binary
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8141
        compatible, and existing applications will continue to work.
1 by Adam Conrad
Import upstream version 4.0.0
8142
8143
EOF
8144
    fi
8145
    ;;
8146
cc*)
8147
    case "$PLATFORM" in
8148
    irix-cc*)
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
8149
        if [ "$CFG_EXCEPTIONS" != "no" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
8150
            cat <<EOF
8151
8152
        This target is using the MIPSpro C++ compiler ($PLATFORM).
8153
8154
        You may choose to re-run `basename $0` with the -no-exceptions
8155
        option to compile Qt without exceptions. This will make the
8156
        size of the Qt library smaller and reduce the amount of memory
8157
        taken by your applications.
8158
8159
EOF
8160
        fi
8161
        ;;
8162
    *) ;;
8163
    esac
8164
    ;;
8165
*) ;;
8166
esac
8167
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8168
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "no" ]  && [ "$CFG_WEBKIT" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8169
    cat <<EOF
8170
        WARNING: DWARF2 debug symbols are not enabled. Linking webkit
8171
        in debug mode will run out of memory on systems with 2GB or less.
8172
        Install Xcode 2.4.1 or higher to enable DWARF2, or configure with
8173
         -no-webkit or -release to skip webkit debug.
8174
EOF
8175
fi
8176
1 by Adam Conrad
Import upstream version 4.0.0
8177
echo
8178
if [ "$XPLATFORM" = "$PLATFORM" ]; then
8179
    echo "Build type:    $PLATFORM"
8180
else
8181
    echo "Building on:   $PLATFORM"
8182
    echo "Building for:  $XPLATFORM"
8183
fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8184
8185
if [ "$PLATFORM_MAC" = "yes" ]; then
8186
    echo "Architecture:  $CFG_ARCH ($CFG_MAC_ARCHS )"
8187
else
8188
    echo "Architecture:  $CFG_ARCH"
8189
fi
8190
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
8191
if [ "$PLATFORM_QWS" = "yes" ]; then
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
8192
    echo "Host architecture: $CFG_HOST_ARCH"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
8193
fi
1 by Adam Conrad
Import upstream version 4.0.0
8194
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8195
if [ "$PLATFORM_MAC" = "yes" ]; then
8196
    if [ "$CFG_MAC_COCOA" = "yes" ]; then
8197
        if [ "$CFG_MAC_CARBON" = "yes" ]; then
8198
            echo "Using framework: Carbon for 32-bit, Cocoa for 64-bit"
8199
        else
8200
            echo "Using framework: Cocoa"
8201
        fi
8202
    else
8203
        echo "Using framework: Carbon"
8204
    fi
8205
fi
8206
1 by Adam Conrad
Import upstream version 4.0.0
8207
if [ -n "$PLATFORM_NOTES" ]; then
8208
    echo "Platform notes:"
8209
    echo "$PLATFORM_NOTES"
8210
else
8211
    echo
8212
fi
8213
8214
if [ "$OPT_VERBOSE" = "yes" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8215
    echo $ECHO_N "qmake vars .......... $ECHO_C"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8216
    cat "$QMAKE_VARS_FILE" | tr '\n' ' '
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8217
    echo "qmake switches ......... $QMAKE_SWITCHES"
1 by Adam Conrad
Import upstream version 4.0.0
8218
fi
8219
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8220
[ "$CFG_INCREMENTAL" = "yes" ] && [ '!' -z "$INCREMENTAL" ] && echo "Incremental ............ $INCREMENTAL"
8221
echo "Build .................. $CFG_BUILD_PARTS"
8222
echo "Configuration .......... $QMAKE_CONFIG $QT_CONFIG"
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8223
if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8224
   echo "Debug .................. yes (combined)"
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8225
   if [ "$CFG_DEBUG" = "yes" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8226
       echo "Default Link ........... debug"
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8227
   else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8228
       echo "Default Link ........... release"
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8229
   fi
8230
else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8231
   echo "Debug .................. $CFG_DEBUG"
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8232
fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8233
echo "Qt 3 compatibility ..... $CFG_QT3SUPPORT"
8234
[ "$CFG_DBUS" = "no" ]     && echo "QtDBus module .......... no"
8235
[ "$CFG_DBUS" = "yes" ]    && echo "QtDBus module .......... yes (run-time)"
8236
[ "$CFG_DBUS" = "linked" ] && echo "QtDBus module .......... yes (linked)"
8237
echo "QtConcurrent code ...... $CFG_CONCURRENT"
8238
echo "QtGui module ........... $CFG_GUI"
8239
echo "QtScript module ........ $CFG_SCRIPT"
8240
echo "QtScriptTools module ... $CFG_SCRIPTTOOLS"
8241
echo "QtXmlPatterns module ... $CFG_XMLPATTERNS"
8242
echo "Phonon module .......... $CFG_PHONON"
8243
echo "Multimedia module ...... $CFG_MULTIMEDIA"
8244
echo "SVG module ............. $CFG_SVG"
8245
echo "WebKit module .......... $CFG_WEBKIT"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8246
if [ "$CFG_WEBKIT" = "yes" ]; then 
8247
    if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8248
        echo "JavaScriptCore JIT ..... To be decided by JavaScriptCore"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8249
    else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8250
        echo "JavaScriptCore JIT ..... $CFG_JAVASCRIPTCORE_JIT"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8251
    fi
8252
fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8253
echo "Declarative module ..... $CFG_DECLARATIVE"
8254
echo "Support for S60 ........ $CFG_S60"
8255
echo "Symbian DEF files ...... $CFG_SYMBIAN_DEFFILES"
8256
echo "STL support ............ $CFG_STL"
8257
echo "PCH support ............ $CFG_PRECOMPILE"
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
8258
echo "MMX/3DNOW/SSE/SSE2/SSE3. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}/${CFG_SSE3}"
8259
echo "SSSE3/SSE4.1/SSE4.2..... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}"
8260
echo "AVX..................... ${CFG_AVX}"
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
8261
if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8262
    echo "iWMMXt support ......... ${CFG_IWMMXT}"
8263
    echo "NEON support ........... ${CFG_NEON}"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
8264
fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8265
[ "${PLATFORM_QWS}" != "yes" ] && echo "Graphics System ........ $CFG_GRAPHICS_SYSTEM"
8266
echo "IPv6 support ........... $CFG_IPV6"
8267
echo "IPv6 ifname support .... $CFG_IPV6IFNAME"
8268
echo "getaddrinfo support .... $CFG_GETADDRINFO"
8269
echo "getifaddrs support ..... $CFG_GETIFADDRS"
8270
echo "Accessibility .......... $CFG_ACCESSIBILITY"
8271
echo "NIS support ............ $CFG_NIS"
8272
echo "CUPS support ........... $CFG_CUPS"
8273
echo "Iconv support .......... $CFG_ICONV"
8274
echo "Glib support ........... $CFG_GLIB"
8275
echo "GStreamer support ...... $CFG_GSTREAMER"
8276
echo "PulseAudio support ..... $CFG_PULSEAUDIO"
8277
echo "Large File support ..... $CFG_LARGEFILE"
8278
echo "GIF support ............ $CFG_GIF"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
8279
if [ "$CFG_TIFF" = "no" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8280
    echo "TIFF support ........... $CFG_TIFF"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
8281
else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8282
    echo "TIFF support ........... $CFG_TIFF ($CFG_LIBTIFF)"
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
8283
fi
1 by Adam Conrad
Import upstream version 4.0.0
8284
if [ "$CFG_JPEG" = "no" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8285
    echo "JPEG support ........... $CFG_JPEG"
1 by Adam Conrad
Import upstream version 4.0.0
8286
else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8287
    echo "JPEG support ........... $CFG_JPEG ($CFG_LIBJPEG)"
1 by Adam Conrad
Import upstream version 4.0.0
8288
fi
8289
if [ "$CFG_PNG" = "no" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8290
    echo "PNG support ............ $CFG_PNG"
1 by Adam Conrad
Import upstream version 4.0.0
8291
else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8292
    echo "PNG support ............ $CFG_PNG ($CFG_LIBPNG)"
1 by Adam Conrad
Import upstream version 4.0.0
8293
fi
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
8294
if [ "$CFG_MNG" = "no" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8295
    echo "MNG support ............ $CFG_MNG"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
8296
else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8297
    echo "MNG support ............ $CFG_MNG ($CFG_LIBMNG)"
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
8298
fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8299
echo "zlib support ........... $CFG_ZLIB"
8300
echo "Session management ..... $CFG_SM"
1 by Adam Conrad
Import upstream version 4.0.0
8301
if [ "$PLATFORM_QWS" = "yes" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8302
    echo "Embedded support ....... $CFG_EMBEDDED"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8303
    if [ "$CFG_QWS_FREETYPE" = "auto" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8304
	echo "Freetype2 support ...... $CFG_QWS_FREETYPE ($CFG_LIBFREETYPE)"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8305
    else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8306
	echo "Freetype2 support ...... $CFG_QWS_FREETYPE"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8307
    fi
1 by Adam Conrad
Import upstream version 4.0.0
8308
    # Normalize the decoration output first
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8309
    CFG_GFX_ON=`echo ${CFG_GFX_ON}`
8310
    CFG_GFX_PLUGIN=`echo ${CFG_GFX_PLUGIN}`
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8311
    echo "Graphics (qt) .......... ${CFG_GFX_ON}"
8312
    echo "Graphics (plugin) ...... ${CFG_GFX_PLUGIN}"
1 by Adam Conrad
Import upstream version 4.0.0
8313
    CFG_DECORATION_ON=`echo ${CFG_DECORATION_ON}`
8314
    CFG_DECORATION_PLUGIN=`echo ${CFG_DECORATION_PLUGIN}`
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8315
    echo "Decorations (qt) ....... $CFG_DECORATION_ON"
8316
    echo "Decorations (plugin) ... $CFG_DECORATION_PLUGIN"
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
8317
    CFG_KBD_ON=`echo ${CFG_KBD_ON}`
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
8318
    CFG_KBD_PLUGIN=`echo ${CFG_KBD_PLUGIN}`
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8319
    echo "Keyboard driver (qt) ... ${CFG_KBD_ON}"
8320
    echo "Keyboard driver (plugin) .. ${CFG_KBD_PLUGIN}"
1.1.4 by Jonathan Riddell
Import upstream version 4.1.3
8321
    CFG_MOUSE_ON=`echo ${CFG_MOUSE_ON}`
8322
    CFG_MOUSE_PLUGIN=`echo ${CFG_MOUSE_PLUGIN}`
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8323
    echo "Mouse driver (qt) ...... $CFG_MOUSE_ON"
8324
    echo "Mouse driver (plugin) .. $CFG_MOUSE_PLUGIN"
1.1.8 by Jonathan Riddell
Import upstream version 4.2.2
8325
fi
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8326
if [ "$CFG_OPENGL" = "desktop" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8327
    echo "OpenGL support ......... yes (Desktop OpenGL)"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8328
elif [ "$CFG_OPENGL" = "es1" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8329
    echo "OpenGL support ......... yes (OpenGL ES 1.x Common profile)"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8330
elif [ "$CFG_OPENGL" = "es2" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8331
    echo "OpenGL support ......... yes (OpenGL ES 2.x)"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8332
else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8333
    echo "OpenGL support ......... no"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8334
fi
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8335
if [ "$CFG_EGL" != "no" ]; then
8336
    if [ "$CFG_EGL_GLES_INCLUDES" != "no" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8337
        echo "EGL support ............ yes <GLES/egl.h>"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8338
    else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8339
        echo "EGL support ............ yes <EGL/egl.h>"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8340
    fi
8341
fi
8342
if [ "$CFG_OPENVG" ]; then
8343
    if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8344
        echo "OpenVG support ......... ShivaVG"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8345
    else
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8346
        echo "OpenVG support ......... $CFG_OPENVG"
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8347
    fi
8348
fi
1 by Adam Conrad
Import upstream version 4.0.0
8349
if [ "$PLATFORM_X11" = "yes" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8350
    echo "NAS sound support ...... $CFG_NAS"
8351
    echo "XShape support ......... $CFG_XSHAPE"
8352
    echo "XVideo support ......... $CFG_XVIDEO"
8353
    echo "XSync support .......... $CFG_XSYNC"
8354
    echo "Xinerama support ....... $CFG_XINERAMA"
8355
    echo "Xcursor support ........ $CFG_XCURSOR"
8356
    echo "Xfixes support ......... $CFG_XFIXES"
8357
    echo "Xrandr support ......... $CFG_XRANDR"
8358
    echo "Xrender support ........ $CFG_XRENDER"
8359
    echo "Xi support ............. $CFG_XINPUT"
8360
    echo "MIT-SHM support ........ $CFG_MITSHM"
8361
    echo "FontConfig support ..... $CFG_FONTCONFIG"
8362
    echo "XKB Support ............ $CFG_XKB"
8363
    echo "immodule support ....... $CFG_IM"
8364
    echo "GTK theme support ...... $CFG_QGTKSTYLE"
1 by Adam Conrad
Import upstream version 4.0.0
8365
fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8366
[ "$CFG_SQL_mysql" != "no" ] && echo "MySQL support .......... $CFG_SQL_mysql"
8367
[ "$CFG_SQL_psql" != "no" ] && echo "PostgreSQL support ..... $CFG_SQL_psql"
8368
[ "$CFG_SQL_odbc" != "no" ] && echo "ODBC support ........... $CFG_SQL_odbc"
8369
[ "$CFG_SQL_oci" != "no" ] && echo "OCI support ............ $CFG_SQL_oci"
8370
[ "$CFG_SQL_tds" != "no" ] && echo "TDS support ............ $CFG_SQL_tds"
8371
[ "$CFG_SQL_db2" != "no" ] && echo "DB2 support ............ $CFG_SQL_db2"
8372
[ "$CFG_SQL_ibase" != "no" ] && echo "InterBase support ...... $CFG_SQL_ibase"
8373
[ "$CFG_SQL_sqlite2" != "no" ] && echo "SQLite 2 support ....... $CFG_SQL_sqlite2"
8374
[ "$CFG_SQL_sqlite" != "no" ] && echo "SQLite support ......... $CFG_SQL_sqlite ($CFG_SQLITE)"
1 by Adam Conrad
Import upstream version 4.0.0
8375
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
8376
OPENSSL_LINKAGE=""
8377
if [ "$CFG_OPENSSL" = "yes" ]; then
8378
    OPENSSL_LINKAGE="(run-time)"
8379
elif [ "$CFG_OPENSSL" = "linked" ]; then
8380
    OPENSSL_LINKAGE="(linked)"
8381
fi
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8382
echo "OpenSSL support ........ $CFG_OPENSSL $OPENSSL_LINKAGE"
8383
echo "Alsa support ........... $CFG_ALSA"
8384
if [ "$PLATFORM_MAC" = "yes" ]; then
8385
    echo "CoreWlan support ....... $CFG_COREWLAN"
8386
fi
8387
echo "ICD support ............ $CFG_ICD"
8388
echo
1.1.10 by Jonathan Riddell
Import upstream version 4.3.0
8389
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8390
[ "$CFG_PTMALLOC" != "no" ] && echo "Use ptmalloc ........... $CFG_PTMALLOC"
1.1.19 by Roderick B. Greening
Import upstream version 4.5.0~+rc1
8391
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
8392
# complain about not being able to use dynamic plugins if we are using a static build
1 by Adam Conrad
Import upstream version 4.0.0
8393
if [ "$CFG_SHARED" = "no" ]; then
8394
    echo
1.1.2 by Daniel T Chen
Import upstream version 4.1.0
8395
    echo "WARNING: Using static linking will disable the use of dynamically"
8396
    echo "loaded plugins. Make sure to import all needed static plugins,"
8397
    echo "or compile needed modules into the library."
1 by Adam Conrad
Import upstream version 4.0.0
8398
    echo
8399
fi
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
8400
if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
8401
    echo
8402
    echo "NOTE: When linking against OpenSSL, you can override the default"
8403
    echo "library names through OPENSSL_LIBS."
8404
    echo "For example:"
1.1.32 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100706
8405
    echo "    OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
8406
    echo
8407
fi
1 by Adam Conrad
Import upstream version 4.0.0
8408
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "no" ]; then
8409
    echo
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
8410
    echo "Error: debug-only framework builds are not supported. Configure with -no-framework"
8411
    echo "if you want a pure debug build."
1 by Adam Conrad
Import upstream version 4.0.0
8412
    echo
1.1.31 by Alessandro Ghersi
Import upstream version 4.7.0~beta1+git20100522
8413
    exit 1
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8414
fi
1 by Adam Conrad
Import upstream version 4.0.0
8415
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8416
sepath=`echo "$relpath" | sed -e 's/\\./\\\\./g'`
1 by Adam Conrad
Import upstream version 4.0.0
8417
PROCS=1
8418
EXEC=""
8419
8420
8421
#-------------------------------------------------------------------------------
8422
# build makefiles based on the configuration
8423
#-------------------------------------------------------------------------------
8424
8425
echo "Finding project files. Please wait..."
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
8426
"$outpath/bin/qmake-qt4" -prl -r "${relpath}/projects.pro"
1 by Adam Conrad
Import upstream version 4.0.0
8427
if [ -f "${relpath}/projects.pro" ]; then
8428
    mkfile="${outpath}/Makefile"
8429
    [ -f "$mkfile" ] && chmod +w "$mkfile"
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
8430
    QTDIR="$outpath" "$outpath/bin/qmake-qt4" -spec "$XQMAKESPEC" "${relpath}/projects.pro" -o "$mkfile"
1 by Adam Conrad
Import upstream version 4.0.0
8431
fi
8432
8433
# .projects      -> projects to process
8434
# .projects.1    -> qt and moc
8435
# .projects.2    -> subdirs and libs
8436
# .projects.3    -> the rest
8437
rm -f .projects .projects.1 .projects.2 .projects.3
8438
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
8439
QMAKE_PROJECTS=`find "$relpath/." -name '.pc' -prune -o -name '*.pro' -print | sed 's-/\./-/-'`
1 by Adam Conrad
Import upstream version 4.0.0
8440
if [ -z "$AWK" ]; then
8441
    for p in `echo $QMAKE_PROJECTS`; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8442
        echo "$p" >> .projects
1 by Adam Conrad
Import upstream version 4.0.0
8443
    done
8444
else
8445
    cat >projects.awk <<EOF
8446
BEGIN {
8447
    files = 0
8448
    target_file = ""
8449
    input_file = ""
8450
8451
    first = "./.projects.1.tmp"
8452
    second = "./.projects.2.tmp"
8453
    third = "./.projects.3.tmp"
8454
}
8455
8456
FNR == 1 {
8457
    if ( input_file ) {
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
8458
        if ( ! target_file )
8459
            target_file = third
8460
        print input_file >target_file
1 by Adam Conrad
Import upstream version 4.0.0
8461
    }
8462
8463
    matched_target = 0
8464
    template_lib = 0
8465
    input_file = FILENAME
8466
    target_file = ""
8467
}
8468
8469
/^(TARGET.*=)/ {
8470
    if ( \$3 == "moc" || \$3 ~ /^Qt/ ) {
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
8471
        target_file = first
1 by Adam Conrad
Import upstream version 4.0.0
8472
        matched_target = 1
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
8473
    } else if ( \$3 == "lrelease" || \$3 == "qm_phony_target" ) {
8474
        target_file = second
8475
        matched_target = 1
1 by Adam Conrad
Import upstream version 4.0.0
8476
    }
8477
}
8478
8479
matched_target == 0 && /^(TEMPLATE.*=)/ {
8480
    if ( \$3 == "subdirs" )
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
8481
        target_file = second
1 by Adam Conrad
Import upstream version 4.0.0
8482
    else if ( \$3 == "lib" )
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
8483
        template_lib = 1
1 by Adam Conrad
Import upstream version 4.0.0
8484
    else
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
8485
        target_file = third
1 by Adam Conrad
Import upstream version 4.0.0
8486
}
8487
8488
matched_target == 0 && template_lib == 1 && /^(CONFIG.*=)/ {
8489
    if ( \$0 ~ /plugin/ )
8490
        target_file = third
8491
    else
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
8492
        target_file = second
1 by Adam Conrad
Import upstream version 4.0.0
8493
}
8494
8495
END {
8496
    if ( input_file ) {
1.1.23 by Alessandro Ghersi
Import upstream version 4.5.3
8497
        if ( ! target_file )
8498
            target_file = third
8499
        print input_file >>target_file
1 by Adam Conrad
Import upstream version 4.0.0
8500
    }
8501
}
8502
8503
EOF
8504
8505
    rm -f .projects.all
8506
    for p in `echo $QMAKE_PROJECTS`; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8507
       echo "$p" >> .projects.all
1 by Adam Conrad
Import upstream version 4.0.0
8508
    done
8509
8510
    # if you get errors about the length of the command line to awk, change the -l arg
8511
    # to split below
8512
    split -l 100 .projects.all .projects.all.
8513
    for p in .projects.all.*; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8514
       "$AWK" -f projects.awk `cat $p`
1 by Adam Conrad
Import upstream version 4.0.0
8515
       [ -f .projects.1.tmp ] && cat .projects.1.tmp >> .projects.1
8516
       [ -f .projects.2.tmp ] && cat .projects.2.tmp >> .projects.2
8517
       [ -f .projects.3.tmp ] && cat .projects.3.tmp >> .projects.3
8518
       rm -f .projects.1.tmp .projects.2.tmp .projects.3.tmp $p
8519
    done
8520
    rm -f .projects.all* projects.awk
8521
8522
    [ -f .projects.1 ] && cat .projects.1 >>.projects
8523
    [ -f .projects.2 ] && cat .projects.2 >>.projects
8524
    rm -f .projects.1 .projects.2
8525
    if [ -f .projects.3 ] && [ "$OPT_FAST" = "no" ]; then
8526
       cat .projects.3 >>.projects
8527
       rm -f .projects.3
8528
    fi
8529
fi
8530
# don't sort Qt and MOC in with the other project files
8531
# also work around a segfaulting uniq(1)
8532
if [ -f .sorted.projects.2 ]; then
8533
    sort .sorted.projects.2 > .sorted.projects.2.new
8534
    mv -f .sorted.projects.2.new .sorted.projects.2
8535
    cat .sorted.projects.2 >> .sorted.projects.1
8536
fi
8537
[ -f .sorted.projects.1 ] && sort .sorted.projects.1 >> .sorted.projects
8538
rm -f .sorted.projects.2 .sorted.projects.1
8539
8540
NORM_PROJECTS=0
8541
FAST_PROJECTS=0
8542
if [ -f .projects ]; then
8543
   uniq .projects >.tmp
8544
   mv -f .tmp .projects
8545
   NORM_PROJECTS=`cat .projects | wc -l | sed -e "s, ,,g"`
8546
fi
8547
if [ -f .projects.3 ]; then
8548
   uniq .projects.3 >.tmp
8549
   mv -f .tmp .projects.3
8550
   FAST_PROJECTS=`cat .projects.3 | wc -l | sed -e "s, ,,g"`
8551
fi
8552
echo "  `expr $NORM_PROJECTS + $FAST_PROJECTS` projects found."
8553
echo
8554
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8555
PART_ROOTS=
8556
for part in $CFG_BUILD_PARTS; do
8557
    case "$part" in
8558
    tools) PART_ROOTS="$PART_ROOTS tools" ;;
8559
    libs) PART_ROOTS="$PART_ROOTS src" ;;
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
8560
    translations) PART_ROOTS="$PART_ROOTS tools/linguist/lrelease translations" ;;
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8561
    examples) PART_ROOTS="$PART_ROOTS examples demos" ;;
8562
    *) ;;
8563
    esac
8564
done
8565
1.3.1 by Fathi Boudra
Import upstream version 4.5.1
8566
if [ "$CFG_DEV" = "yes" ]; then
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8567
    PART_ROOTS="$PART_ROOTS tests"
8568
fi
8569
1 by Adam Conrad
Import upstream version 4.0.0
8570
echo "Creating makefiles. Please wait..."
8571
for file in .projects .projects.3; do
8572
    [ '!' -f "$file" ] && continue
8573
    for a in `cat $file`; do
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8574
        IN_ROOT=no
8575
	for r in $PART_ROOTS; do
8576
	    if echo "$a" | grep "^$r" >/dev/null 2>&1 || echo "$a" | grep "^$relpath/$r" >/dev/null 2>&1; then
8577
		IN_ROOT=yes
8578
		break
8579
            fi
8580
	done
8581
        [ "$IN_ROOT" = "no" ] && continue
8582
1 by Adam Conrad
Import upstream version 4.0.0
8583
        case $a in
1.1.34 by Fathi Boudra
Import upstream version 4.7.0~rc1
8584
        *winmain/winmain.pro)
8585
            [ "$XPLATFORM_MINGW" = "yes" ] || continue
8586
            SPEC=$XQMAKESPEC ;;
1.1.35 by Alessandro Ghersi
Import upstream version 4.7.0~rc1+git20100916
8587
        *s60main/s60main.pro) if [ -z "`echo "$XPLATFORM" | grep "symbian" >/dev/null`" ]; then
8588
                continue
8589
            fi;;
1.2.3 by Fathi Boudra
Import upstream version 4.6.0~rc1
8590
        *examples/activeqt/*) continue ;;
1 by Adam Conrad
Import upstream version 4.0.0
8591
        */qmake/qmake.pro) continue ;;
1.1.28 by Alessandro Ghersi
Import upstream version 4.6.1
8592
        *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*linguist/lrelease*) SPEC=$QMAKESPEC ;;
1 by Adam Conrad
Import upstream version 4.0.0
8593
        *) SPEC=$XQMAKESPEC ;;
8594
        esac
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8595
        dir=`dirname "$a" | sed -e "s;$sepath;.;g"`
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8596
        test -d "$dir" || mkdir -p "$dir"
8597
        OUTDIR="$outpath/$dir"
1 by Adam Conrad
Import upstream version 4.0.0
8598
        if [ -f "${OUTDIR}/Makefile" ] && [ "$OPT_FAST" = "yes" ]; then
8599
            # fast configure - the makefile exists, skip it
8600
            # since the makefile exists, it was generated by qmake, which means we
8601
            # can skip it, since qmake has a rule to regenerate the makefile if the .pro
8602
            # file changes...
8603
            [ "$OPT_VERBOSE" = "yes" ] && echo "  skipping $a"
8604
            continue;
8605
        fi
8606
        QMAKE_SPEC_ARGS="-spec $SPEC"
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8607
        echo $ECHO_N "  for $a$ECHO_C"
1 by Adam Conrad
Import upstream version 4.0.0
8608
15.2.7 by Debian Qt/KDE Maintainers, Fathi Boudra, Pino Toscano
[ Fathi Boudra ]
8609
        QMAKE="$outpath/bin/qmake-qt4"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8610
	QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS"
1 by Adam Conrad
Import upstream version 4.0.0
8611
        if [ "$file" = ".projects.3" ]; then
1.1.30 by Jonathan Riddell
Import upstream version 4.7.0~beta1
8612
            echo " (fast)"
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8613
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8614
            cat >"${OUTDIR}/Makefile" <<EOF
1 by Adam Conrad
Import upstream version 4.0.0
8615
# ${OUTDIR}/Makefile: generated by configure
8616
#
8617
# WARNING: This makefile will be replaced with a real makefile.
8618
# All changes made to this file will be lost.
1.1.1 by Matthias Klose
Import upstream version 4.0.1
8619
EOF
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8620
            [ "$CFG_DEBUG_RELEASE" = "no" ] && echo "first_target: first" >>${OUTDIR}/Makefile
8621
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8622
            cat >>"${OUTDIR}/Makefile" <<EOF
8623
QMAKE = "$QMAKE"
1 by Adam Conrad
Import upstream version 4.0.0
8624
all clean install qmake first Makefile: FORCE
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8625
	\$(QMAKE) $QMAKE_ARGS -o "$OUTDIR" "$a"
8626
	cd "$OUTDIR"
1 by Adam Conrad
Import upstream version 4.0.0
8627
	\$(MAKE) \$@
8628
8629
FORCE:
8630
8631
EOF
8632
        else
8633
            if [ "$OPT_VERBOSE" = "yes" ]; then
8634
                echo " (`basename $SPEC`)"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8635
                echo "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
8636
	    else
8637
		echo
1 by Adam Conrad
Import upstream version 4.0.0
8638
            fi
8639
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8640
            [ -f "${OUTDIR}/Makefile" ] && chmod +w "${OUTDIR}/Makefile"
8641
            QTDIR="$outpath" "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
1 by Adam Conrad
Import upstream version 4.0.0
8642
       fi
8643
    done
8644
done
8645
rm -f .projects .projects.3
8646
8647
#-------------------------------------------------------------------------------
8648
# check for platforms that we don't yet know about
8649
#-------------------------------------------------------------------------------
1.1.16 by Jonathan Riddell
Import upstream version 4.4.1
8650
if [ "$CFG_ARCH" = "generic" ]; then
1 by Adam Conrad
Import upstream version 4.0.0
8651
cat <<EOF
8652
8653
        NOTICE: Atomic operations are not yet supported for this
8654
        architecture.
8655
1.1.15 by Jonathan Riddell
Import upstream version 4.4.0
8656
        Qt will use the 'generic' architecture instead, which uses a
8657
        single pthread_mutex_t to protect all atomic operations. This
8658
        implementation is the slow (but safe) fallback implementation
8659
        for architectures Qt does not yet support.
8660
EOF
8661
fi
8662
8663
#-------------------------------------------------------------------------------
8664
# check if the user passed the -no-zlib option, which is no longer supported
8665
#-------------------------------------------------------------------------------
8666
if [ -n "$ZLIB_FORCED" ]; then
8667
    which_zlib="supplied"
8668
    if [ "$CFG_ZLIB" = "system" ]; then
8669
	which_zlib="system"
8670
    fi
8671
8672
cat <<EOF
8673
8674
        NOTICE: The -no-zlib option was supplied but is no longer
8675
        supported.
8676
8677
        Qt now requires zlib support in all builds, so the -no-zlib
8678
        option was ignored. Qt will be built using the $which_zlib
8679
        zlib.
1 by Adam Conrad
Import upstream version 4.0.0
8680
EOF
8681
fi
8682
8683
#-------------------------------------------------------------------------------
8684
# finally save the executed command to another script
8685
#-------------------------------------------------------------------------------
8686
if [ `basename $0` != "config.status" ]; then
8687
    CONFIG_STATUS="$relpath/$relconf $OPT_CMDLINE"
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8688
8689
    # add the system variables
8690
    for varname in $SYSTEM_VARIABLES; do
8691
        cmd=`echo \
8692
'if [ -n "\$'${varname}'" ]; then
8693
    CONFIG_STATUS="'${varname}'='"'\\\$${varname}'"' \$CONFIG_STATUS"
8694
fi'`
8695
	eval "$cmd"
8696
    done
8697
1 by Adam Conrad
Import upstream version 4.0.0
8698
    echo "$CONFIG_STATUS" | grep '\-confirm\-license' >/dev/null 2>&1 || CONFIG_STATUS="$CONFIG_STATUS -confirm-license"
8699
1.1.6 by Jonathan Riddell
Import upstream version 4.2.0
8700
    [ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
8701
    echo "#!/bin/sh" > "$outpath/config.status"
8702
    echo "if [ \"\$#\" -gt 0 ]; then" >> "$outpath/config.status"
8703
    echo "  $CONFIG_STATUS \"\$@\"" >> "$outpath/config.status"
8704
    echo "else" >> "$outpath/config.status"
8705
    echo "  $CONFIG_STATUS" >> "$outpath/config.status"
8706
    echo "fi" >> "$outpath/config.status"
8707
    chmod +x "$outpath/config.status"
1 by Adam Conrad
Import upstream version 4.0.0
8708
fi
8709
8710
if [ -n "$RPATH_MESSAGE" ]; then
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8711
    echo
1 by Adam Conrad
Import upstream version 4.0.0
8712
    echo "$RPATH_MESSAGE"
8713
fi
8714
1.2.2 by Fathi Boudra
Import upstream version 4.6.0~beta1
8715
MAKE=`basename "$MAKE"`
1 by Adam Conrad
Import upstream version 4.0.0
8716
echo
8717
echo Qt is now configured for building. Just run \'$MAKE\'.
8718
if [ "$relpath" = "$QT_INSTALL_PREFIX" ]; then
1.1.3 by Jonathan Riddell
Import upstream version 4.1.2
8719
    echo Once everything is built, Qt is installed.
1 by Adam Conrad
Import upstream version 4.0.0
8720
    echo You should not run \'$MAKE install\'.
8721
else
8722
    echo Once everything is built, you must run \'$MAKE install\'.
8723
    echo Qt will be installed into $QT_INSTALL_PREFIX
8724
fi
8725
echo
8726
echo To reconfigure, run \'$MAKE confclean\' and \'configure\'.
8727
echo