1
#!/bin/sh
2
#############################################################################
3
##
4
## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
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$
11
## GNU Lesser General Public License Usage
12
## This file may be used under the terms of the GNU Lesser General Public
13
## License version 2.1 as published by the Free Software Foundation and
14
## appearing in the file LICENSE.LGPL included in the packaging of this
15
## file. Please review the following information to ensure the GNU Lesser
16
## General Public License version 2.1 requirements will be met:
17
## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18
##
19
## In addition, as a special exception, Nokia gives you certain additional
20
## rights. These rights are described in the Nokia Qt LGPL Exception
21
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22
##
23
## GNU General Public License Usage
24
## Alternatively, this file may be used under the terms of the GNU General
25
## Public License version 3.0 as published by the Free Software Foundation
26
## and appearing in the file LICENSE.GPL included in the packaging of this
27
## file. Please review the following information to ensure the GNU General
28
## Public License version 3.0 requirements will be met:
29
## http://www.gnu.org/copyleft/gpl.html.
30
##
31
## Other Usage
32
## Alternatively, this file may be used in accordance with the terms and
33
## conditions contained in a signed written agreement between you and Nokia.
34
##
35
##
36
##
37
##
38
##
39
## $QT_END_LICENSE$
40
##
41
#############################################################################
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`
51
relpath=`(cd "$relpath"; /bin/pwd)`
52
# the current directory is the "build tree" or "object tree"
53
outpath=`/bin/pwd`
54
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
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=
70
QTCONFIG_CONFIG=
71
QT_CONFIG=
72
SUPPORTED=
73
QMAKE_VARS_FILE=.qmake.vars
74
75
:> "$QMAKE_VARS_FILE"
76
77
#-------------------------------------------------------------------------------
78
# utility functions
79
#-------------------------------------------------------------------------------
80
81
shellEscape()
82
{
83
    echo "$@" | sed 's/ /\ /g'
84
}
85
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
106
    echo "$2" "$eq" "$3" >> "$QMAKE_VARS_FILE"
107
}
108
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"
118
	    if [ ! -f  "$conf_file" ]; then
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
getQMakeConf2()
131
{
132
    $AWK '
133
BEGIN {
134
    values["LITERAL_WHITESPACE"] = " "
135
    values["LITERAL_DOLLAR"] = "$"
136
}
137
/^[_A-Z0-9.]+[ \t]*\+?=/ {
138
    valStart = index($0, "=") + 1
139
140
    append = 0
141
    if (substr($0, valStart - 2, 1) == "+") {
142
        append = 1
143
    }
144
145
    variable = substr($0, 0, valStart - 2 - append)
146
    value = substr($0, valStart)
147
    gsub("[ \t]+", "", variable)
148
    gsub("^[ \t]+", "", value)
149
    gsub("[ \t]+$", "", value)
150
151
    ovalue = ""
152
    while (match(value, /\$\$(\{[_A-Z0-9.]+\}|[_A-Z0-9.]+)/)) {
153
        ovalue = ovalue substr(value, 1, RSTART - 1)
154
        var = substr(value, RSTART + 2, RLENGTH - 2)
155
        value = substr(value, RSTART + RLENGTH)
156
        if (var ~ /^\{/) {
157
            var = substr(var, 2, length(var) - 2)
158
        }
159
        ovalue = ovalue values[var]
160
    }
161
    ovalue = ovalue value
162
163
    combinedValue = values[variable]
164
    if (append == 1 && length(combinedValue) > 0) {
165
        combinedValue = combinedValue " " ovalue
166
    } else {
167
        combinedValue = ovalue
168
    }
169
    values[variable] = combinedValue
170
}
171
END {
172
    for (var in values) {
173
        print var "=" values[var]
174
    }
175
}
176
'
177
}
178
179
getQMakeConf3()
180
{
181
    echo "$2" | $AWK "/^($1)=/ { print substr(\$0, index(\$0, \"=\") + 1) }"
182
}
183
184
# relies on $QMAKESPEC being set correctly. parses include statements in
185
# qmake.conf and prints out the expanded file
186
getQMakeConf()
187
{
188
    if [ -z "$specvals" ]; then
189
        specvals=`getQMakeConf1 "$QMAKESPEC/qmake.conf" | getQMakeConf2`
190
    fi
191
    getQMakeConf3 "$1" "$specvals"
192
}
193
194
getXQMakeConf()
195
{
196
    if [ -z "$xspecvals" ]; then
197
        xspecvals=`getQMakeConf1 "$XQMAKESPEC/qmake.conf" | getQMakeConf2`
198
    fi
199
    getQMakeConf3 "$1" "$xspecvals"
200
}
201
202
# relies on $TEST_COMPILER being set correctly
203
compilerSupportsFlag()
204
{
205
    cat >conftest.cpp <<EOF
206
int main() { return 0; }
207
EOF
208
    "$TEST_COMPILER" "$@" -o conftest.o conftest.cpp
209
    ret=$?
210
    rm -f conftest.cpp conftest.o
211
    return $ret
212
}
213
214
# relies on $TEST_COMPILER being set correctly
215
linkerSupportsFlag()
216
{
217
    lflags=-Wl
218
    for flag
219
    do
220
	safe_flag=`shellEscape "$flag"`
221
	lflags=$lflags,$safe_flag
222
    done
223
    compilerSupportsFlag "$lflags" >/dev/null 2>&1
224
}
225
226
#-------------------------------------------------------------------------------
227
# operating system detection
228
#-------------------------------------------------------------------------------
229
230
# need that throughout the script
231
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
232
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
233
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
234
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
235
236
# detect the "echo without newline" style. usage: echo $ECHO_N "<string>$ECHO_C"
237
if echo '\c' | grep '\c' >/dev/null; then
238
    ECHO_N=-n
239
else
240
    ECHO_C='\c'
241
fi
242
243
#-------------------------------------------------------------------------------
244
# window system detection
245
#-------------------------------------------------------------------------------
246
247
PLATFORM_X11=no
248
PLATFORM_QWS=maybe
249
PLATFORM_QPA=maybe
250
BUILD_ON_MAC=no
251
if [ -d /System/Library/Frameworks/Carbon.framework ]; then
252
    PLATFORM_MAC=maybe
253
    BUILD_ON_MAC=yes
254
else
255
    PLATFORM_MAC=no
256
fi
257
258
#-----------------------------------------------------------------------------
259
# Qt version detection
260
#-----------------------------------------------------------------------------
261
QT_VERSION=`grep '^# *define *QT_VERSION_STR' "$relpath"/src/corelib/global/qglobal.h`
262
QT_MAJOR_VERSION=
263
QT_MINOR_VERSION=0
264
QT_PATCH_VERSION=0
265
if [ -n "$QT_VERSION" ]; then
266
   QT_VERSION=`echo $QT_VERSION | sed 's,^# *define *QT_VERSION_STR *"*\([^ ]*\)"$,\1,'`
267
   MAJOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
268
   if [ -n "$MAJOR" ]; then
269
     MINOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
270
      PATCH=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
271
      QT_MAJOR_VERSION="$MAJOR"
272
      [ -z "$MINOR" ] || QT_MINOR_VERSION="$MINOR"
273
      [ -z "$PATCH" ] || QT_PATCH_VERSION="$PATCH"
274
   fi
275
fi
276
if [ -z "$QT_MAJOR_VERSION" ]; then
277
   echo "Cannot process version from qglobal.h: $QT_VERSION"
278
   echo "Cannot proceed."
279
   exit 1
280
fi
281
282
QT_PACKAGEDATE=`grep '^# *define *QT_PACKAGEDATE_STR' "$relpath"/src/corelib/global/qglobal.h | sed -e 's,^# *define *QT_PACKAGEDATE_STR *"\([^ ]*\)"$,\1,' -e s,-,,g`
283
if [ -z "$QT_PACKAGEDATE" ]; then
284
   echo "Unable to determine package date from qglobal.h: '$QT_PACKAGEDATE'"
285
   echo "Cannot proceed"
286
   exit 1
287
fi
288
289
#-------------------------------------------------------------------------------
290
# check the license
291
#-------------------------------------------------------------------------------
292
COMMERCIAL_USER=ask
293
CFG_DEV=no
294
CFG_NOKIA=no
295
CFG_EMBEDDED=no
296
CFG_RTOS_ENABLED=yes
297
EditionString=Commercial
298
299
earlyArgParse()
300
{
301
    # parse the arguments, setting things to "yes" or "no"
302
    while [ "$#" -gt 0 ]; do
303
        CURRENT_OPT="$1"
304
        UNKNOWN_ARG=no
305
        case "$1" in
306
        #Autoconf style options
307
        --enable-*)
308
            VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
309
            VAL=yes
310
            ;;
311
        --disable-*)
312
            VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
313
            VAL=no
314
            ;;
315
        --*=*)
316
            VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
317
            VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
318
            ;;
319
        --no-*)
320
            VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
321
            VAL=no
322
            ;;
323
        -embedded)
324
            VAR=embedded
325
            # this option may or may not be followed by an argument
326
            if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
327
                VAL=auto
328
            else
329
                shift;
330
                VAL=$1
331
            fi
332
            ;;
333
        -embedded-lite|-qpa)
334
            VAR=qpa
335
            # this option may or may not be followed by an argument
336
            if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
337
                VAL=auto
338
            else
339
                shift;
340
                VAL=$1
341
            fi
342
            ;;
343
        -nacl)
344
            shift;
345
            VAR=nacl
346
            VAL=$1
347
            ;;
348
349
        -h|help|--help|-help)
350
            if [ "$VAL" = "yes" ]; then
351
                OPT_HELP="$VAL"
352
                COMMERCIAL_USER="no" #doesn't matter we will display the help
353
            else
354
                UNKNOWN_OPT=yes
355
                COMMERCIAL_USER="no" #doesn't matter we will display the help
356
            fi
357
            ;;
358
        --*)
359
            VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
360
            VAL=yes
361
            ;;
362
        -*)
363
            VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
364
            VAL="unknown"
365
            ;;
366
        *)
367
            UNKNOWN_ARG=yes
368
            ;;
369
        esac
370
        if [ "$UNKNOWN_ARG" = "yes" ]; then
371
            shift
372
            continue
373
        fi
374
        shift
375
376
        UNKNOWN_OPT=no
377
        case "$VAR" in
378
        embedded)
379
            CFG_EMBEDDED="$VAL"
380
            PLATFORM_X11=no
381
            PLATFORM_MAC=no
382
            PLATFORM_QWS=yes
383
            PLATFORM_QPA=no
384
            ;;
385
        qpa)
386
            CFG_EMBEDDED="no"
387
            if [ "$PLATFORM_QPA" != "no" ]; then
388
                if [ "$PLATFORM_QPA" = "maybe" ]; then
389
                    PLATFORM_X11=no
390
                    PLATFORM_MAC=no
391
                    PLATFORM_QWS=no
392
                    PLATFORM_QPA=yes
393
                fi
394
            else
395
                echo "No license exists to enable Qt QPA. Disabling."
396
                CFG_EMBEDDED=no
397
            fi
398
            ;;
399
        nacl)
400
            echo "Using NaCl at $VAL."
401
            PLATFORM_X11=no
402
            PLATFORM_MAC=no
403
            PLATFORM_QWS=no
404
            CFG_NACL_PATH=$VAL
405
            CFG_EMBEDDED=nacl
406
            ;;
407
408
        developer-build)
409
            CFG_DEV="yes"
410
            ;;
411
        nokia-developer)
412
            CFG_DEV="yes"
413
            CFG_NOKIA="yes"
414
            COMMERCIAL_USER="no"
415
            ;;
416
        commercial)
417
            COMMERCIAL_USER="yes"
418
            ;;
419
        opensource)
420
            COMMERCIAL_USER="no"
421
            ;;
422
        *)
423
            UNKNOWN_OPT=yes
424
            ;;
425
        esac
426
    done
427
}
428
429
earlyArgParse "$@"
430
431
if [ "$COMMERCIAL_USER" = "ask" ]; then
432
    while true; do
433
        echo "Which edition of Qt do you want to use ?"
434
        echo
435
        echo "Type 'c' if you want to use the Commercial Edition."
436
        echo "Type 'o' if you want to use the Open Source Edition."
437
        echo
438
        read commercial
439
        echo
440
        if [ "$commercial" = "c" ]; then
441
            COMMERCIAL_USER="yes"
442
            break
443
        elif [ "$commercial" = "o" ]; then
444
            COMMERCIAL_USER="no"
445
            break
446
        fi
447
    done
448
fi
449
450
if [ "$CFG_NOKIA" = "yes" ]; then
451
    Licensee="Nokia"
452
    Edition="NokiaInternalBuild"
453
    EditionString="Nokia Internal Build"
454
    QT_EDITION="QT_EDITION_OPENSOURCE"
455
    [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
456
elif [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then
457
    # Commercial preview release
458
    [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
459
    Licensee="Preview"
460
    Edition="Preview"
461
    QT_EDITION="QT_EDITION_DESKTOP"
462
    LicenseType="Technology Preview"
463
elif [ $COMMERCIAL_USER = "yes" ]; then
464
    # one of commercial editions
465
    [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
466
    [ "$PLATFORM_QPA" = "maybe" ] && PLATFORM_QPA=no
467
    [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=no
468
469
    # read in the license file
470
    if [ -f "$LICENSE_FILE" ]; then
471
        . "$LICENSE_FILE" >/dev/null 2>&1
472
        if [ -z "$LicenseKeyExt" ]; then
473
            echo
474
            echo "You are using an old license file."
475
            echo
476
            echo "Please install the license file supplied by Nokia,"
477
            echo "or install the Qt Open Source Edition if you intend to"
478
            echo "develop free software."
479
            exit 1
480
        fi
481
	if [ -z "$Licensee" ]; then
482
	    echo
483
	    echo "Invalid license key. Please check the license key."
484
	    exit 1
485
	fi
486
    else
487
        if [ -z "$LicenseKeyExt" ]; then
488
            echo
489
            echo $ECHO_N "Please enter your license key: $ECHO_C"
490
            read LicenseKeyExt
491
            Licensee="Unknown user"
492
        fi
493
    fi
494
495
    # Key verification
496
    echo "$LicenseKeyExt" | grep ".....*-....*-....*-....*-.....*-.....*-...." >/dev/null 2>&1 \
497
        && LicenseValid="yes" \
498
        || LicenseValid="no"
499
    if [ "$LicenseValid" != "yes" ]; then
500
        echo
501
        echo "Invalid license key. Please check the license key."
502
        exit 1
503
    fi
504
    ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1`
505
    PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d -`
506
    LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -`
507
    LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1`
508
509
    # determine which edition we are licensed to use
510
    case "$LicenseTypeCode" in
511
    F4M)
512
        LicenseType="Commercial"
513
        case $ProductCode in
514
        F)
515
            Edition="Universal"
516
            QT_EDITION="QT_EDITION_UNIVERSAL"
517
            ;;
518
        B)
519
            Edition="FullFramework"
520
            EditionString="Full Framework"
521
            QT_EDITION="QT_EDITION_DESKTOP"
522
            ;;
523
        L)
524
            Edition="GUIFramework"
525
            EditionString="GUI Framework"
526
            QT_EDITION="QT_EDITION_DESKTOPLIGHT"
527
            ;;
528
        esac
529
        ;;
530
    Z4M|R4M|Q4M)
531
        LicenseType="Evaluation"
532
        QMakeVar add DEFINES QT_EVAL
533
        case $ProductCode in
534
         B)
535
            Edition="Evaluation"
536
            QT_EDITION="QT_EDITION_EVALUATION"
537
            ;;
538
        esac
539
        ;;
540
    esac
541
    if [ -z "$LicenseType" -o -z "$Edition" -o -z "$QT_EDITION" ]; then
542
        echo
543
        echo "Invalid license key. Please check the license key."
544
        exit 1
545
    fi
546
547
    # verify that we are licensed to use Qt on this platform
548
    LICENSE_EXTENSION=
549
    case "$PlatformCode" in
550
	*L)
551
	    CFG_RTOS_ENABLED=yes
552
	    PlatformCode=`echo "$PlatformCode" | sed 'h;y/8NPQRTZ/UCWX9M7/;x;G;s/\(.\)....\(.\)./\1\2/'`
553
	    ;;
554
	*)
555
	    CFG_RTOS_ENABLED=no
556
	    PlatformCode=`echo "$PlatformCode" | sed 's/.$//'`
557
	    ;;
558
    esac
559
    ### EMBEDDED_QPA logic missing ###
560
    case "$PlatformCode,$PLATFORM_MAC,$PLATFORM_QWS" in
561
        X9,* | XC,* | XU,* | XW,* | XM,*)
562
            # Qt All-OS
563
            LICENSE_EXTENSION="-ALLOS"
564
            ;;
565
        8M,* | KM,* | S9,* | SC,* | SM,* | SU,* | SW,* | X9,* | XC,* | XU,* | XW,*)
566
            # Qt for Embedded Linux
567
            LICENSE_EXTENSION="-EMBEDDED"
568
            ;;
569
        6M,*,no | N7,*,no | N9,*,no | NX,*,no)
570
            # Embedded no-deploy
571
            LICENSE_EXTENSION="-EMBEDDED"
572
            ;;
573
        FM,*,no | LM,yes,* | ZM,no,no)
574
            # Desktop
575
            LICENSE_EXTENSION="-DESKTOP"
576
            ;;
577
        *)
578
            Platform=Linux/X11
579
            [ "$PLATFORM_MAC" = "yes" ] && Platform='Mac OS X'
580
            [ "$PLATFORM_QWS" = "yes" ] && Platform='Embedded Linux'
581
            echo
582
            echo "You are not licensed for the $Platform platform."
583
            echo
584
            echo "Please contact qt-info@nokia.com to upgrade your license to"
585
            echo "include the $Platform platform, or install the Qt Open Source Edition"
586
            echo "if you intend to develop free software."
587
            exit 1
588
            ;;
589
    esac
590
591
    if test -r "$relpath/.LICENSE"; then
592
	# Generic, non-final license
593
	LICENSE_EXTENSION=""
594
	line=`sed 'y/a-z/A-Z/;q' "$relpath"/.LICENSE`
595
	case "$line" in
596
	    *BETA*)
597
		Edition=Beta
598
		;;
599
	    *TECHNOLOGY?PREVIEW*)
600
		Edition=Preview
601
		;;
602
	    *EVALUATION*)
603
		Edition=Evaluation
604
		;;
605
	    *)
606
		echo >&2 "Invalid license files; cannot continue"
607
		exit 1
608
		;;
609
	esac
610
	Licensee="$Edition"
611
	EditionString="$Edition"
612
	QT_EDITION="QT_EDITION_DESKTOP"
613
    fi
614
615
    case "$LicenseFeatureCode" in
616
    B|G|L|Y)
617
        # US
618
        case "$LicenseType" in
619
        Commercial)
620
            cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-US" "$outpath/LICENSE"
621
            ;;
622
        Evaluation)
623
            cp -f "$relpath/.LICENSE-EVALUATION-US" "$outpath/LICENSE"
624
            ;;
625
        esac
626
        ;;
627
    2|4|5|F)
628
        # non-US
629
        case "$LicenseType" in
630
        Commercial)
631
            cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}" "$outpath/LICENSE"
632
            ;;
633
        Evaluation)
634
            cp -f "$relpath/.LICENSE-EVALUATION" "$outpath/LICENSE"
635
            ;;
636
        esac
637
        ;;
638
    *)
639
        echo
640
        echo "Invalid license key. Please check the license key."
641
        exit 1
642
        ;;
643
    esac
644
    case "$LicenseFeatureCode" in
645
	4|B|F|Y)
646
	    CFG_RTOS_ENABLED=yes
647
	    ;;
648
	2|5|G|L)
649
	    CFG_RTOS_ENABLED=no
650
	    ;;
651
    esac
652
    if [ '!' -f "$outpath/LICENSE" ]; then
653
        echo "The LICENSE, LICENSE.GPL3 LICENSE.LGPL file shipped with"
654
        echo "this software has disappeared."
655
        echo
656
        echo "Sorry, you are not licensed to use this software."
657
        echo "Try re-installing."
658
        echo
659
        exit 1
660
    fi
661
elif [ $COMMERCIAL_USER = "no" ]; then
662
    # Open Source edition - may only be used under the terms of the GPL or LGPL.
663
    [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
664
    Licensee="Open Source"
665
    Edition="OpenSource"
666
    EditionString="Open Source"
667
    QT_EDITION="QT_EDITION_OPENSOURCE"
668
fi
669
670
#-------------------------------------------------------------------------------
671
# initalize variables
672
#-------------------------------------------------------------------------------
673
674
SYSTEM_VARIABLES="RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS"
675
for varname in $SYSTEM_VARIABLES; do
676
    qmakevarname="${varname}"
677
    # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
678
    if [ "${varname}" = "LDFLAGS" ]; then
679
        qmakevarname="LFLAGS"
680
    elif [ "${varname}" = "LD" ]; then
681
        qmakevarname="LINK"
682
    fi
683
    cmd=`echo \
684
'if [ -n "\$'${varname}'" ]; then
685
    QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}'"
686
fi'`
687
    eval "$cmd"
688
done
689
# Use CC/CXX to run config.tests
690
mkdir -p "$outpath/config.tests"
691
rm -f "$outpath/config.tests/.qmake.cache"
692
cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
693
694
QMakeVar add styles "cde mac motif plastique cleanlooks windows"
695
QMakeVar add decorations "default windows styled"
696
QMakeVar add mouse-drivers "pc"
697
if [ "$UNAME_SYSTEM" = "Linux" ] ; then
698
    QMakeVar add gfx-drivers "linuxfb"
699
    QMakeVar add mouse-drivers "linuxtp"
700
fi
701
QMakeVar add kbd-drivers "tty"
702
703
if [ "$CFG_DEV" = "yes" ]; then
704
    QMakeVar add kbd-drivers "um"
705
fi
706
707
# QTDIR may be set and point to an old or system-wide Qt installation
708
unset QTDIR
709
710
# the minimum version of libdbus-1 that we require:
711
MIN_DBUS_1_VERSION=0.93
712
713
# initalize internal variables
714
CFG_CONFIGURE_EXIT_ON_ERROR=yes
715
CFG_PROFILE=no
716
CFG_EXCEPTIONS=unspecified
717
CFG_GUI=auto # (yes|no|auto)
718
CFG_SCRIPT=auto # (yes|no|auto)
719
CFG_SCRIPTTOOLS=auto # (yes|no|auto)
720
CFG_XMLPATTERNS=auto # (yes|no|auto)
721
CFG_INCREMENTAL=auto
722
CFG_QCONFIG=full
723
CFG_DEBUG=auto
724
CFG_MYSQL_CONFIG=
725
CFG_DEBUG_RELEASE=no
726
CFG_SHARED=yes
727
CFG_SM=auto
728
CFG_XSHAPE=auto
729
CFG_XSYNC=auto
730
CFG_XVIDEO=auto
731
CFG_XINERAMA=runtime
732
CFG_XFIXES=runtime
733
CFG_ZLIB=auto
734
CFG_SYMBIAN_DEFFILES=auto
735
CFG_S60=auto
736
CFG_SQLITE=qt
737
CFG_GIF=auto
738
CFG_TIFF=auto
739
CFG_LIBTIFF=auto
740
CFG_PNG=yes
741
CFG_LIBPNG=auto
742
CFG_JPEG=auto
743
CFG_LIBJPEG=auto
744
CFG_MNG=auto
745
CFG_LIBMNG=auto
746
CFG_XCURSOR=runtime
747
CFG_XRANDR=runtime
748
CFG_XRENDER=auto
749
CFG_MITSHM=auto
750
CFG_OPENGL=auto
751
CFG_OPENVG=auto
752
CFG_OPENVG_LC_INCLUDES=no
753
CFG_OPENVG_SHIVA=auto
754
CFG_OPENVG_ON_OPENGL=auto
755
CFG_EGL=no
756
CFG_EGL_GLES_INCLUDES=no
757
CFG_SSE=auto
758
CFG_FONTCONFIG=auto
759
CFG_QWS_FREETYPE=auto
760
CFG_LIBFREETYPE=auto
761
CFG_SQL_AVAILABLE=
762
QT_DEFAULT_BUILD_PARTS="libs tools examples demos docs translations"
763
CFG_BUILD_PARTS=""
764
CFG_NOBUILD_PARTS=""
765
CFG_RELEASE_QMAKE=no
766
CFG_PHONON=auto
767
CFG_PHONON_BACKEND=yes
768
CFG_MULTIMEDIA=auto
769
CFG_AUDIO_BACKEND=auto
770
CFG_SVG=auto
771
CFG_DECLARATIVE=auto
772
CFG_DECLARATIVE_DEBUG=yes
773
CFG_WEBKIT=auto # (yes|no|auto|debug)
774
CFG_JAVASCRIPTCORE_JIT=auto
775
776
CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen directfb"
777
CFG_GFX_ON="linuxfb multiscreen"
778
CFG_GFX_PLUGIN_AVAILABLE=
779
CFG_GFX_PLUGIN=
780
CFG_GFX_OFF=
781
CFG_KBD_AVAILABLE="tty linuxinput qvfb"
782
CFG_KBD_ON="tty"    #default, see QMakeVar above
783
CFG_MOUSE_AVAILABLE="pc linuxtp linuxinput tslib qvfb"
784
CFG_MOUSE_ON="pc linuxtp"   #default, see QMakeVar above
785
786
if [ -f "$relpath/src/gui/embedded/qscreenqnx_qws.cpp" ]; then
787
    CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} qnx"
788
    CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} qnx"
789
    CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} qnx"
790
fi
791
if [ -f "$relpath/src/gui/embedded/qscreenintegrityfb_qws.cpp" ]; then
792
    CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} integrity"
793
    CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} integrity"
794
    CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} integrityfb"
795
fi
796
797
CFG_ARCH=
798
CFG_HOST_ARCH=
799
CFG_KBD_PLUGIN_AVAILABLE=
800
CFG_KBD_PLUGIN=
801
CFG_KBD_OFF=
802
CFG_MOUSE_PLUGIN_AVAILABLE=
803
CFG_MOUSE_PLUGIN=
804
CFG_MOUSE_OFF=
805
CFG_USE_GNUMAKE=no
806
CFG_IM=yes
807
CFG_DECORATION_AVAILABLE="styled windows default"
808
CFG_DECORATION_ON="${CFG_DECORATION_AVAILABLE}" # all on by default
809
CFG_DECORATION_PLUGIN_AVAILABLE=
810
CFG_DECORATION_PLUGIN=
811
CFG_XINPUT=runtime
812
CFG_XKB=auto
813
CFG_NIS=auto
814
CFG_CUPS=auto
815
CFG_ICONV=auto
816
CFG_DBUS=auto
817
CFG_GLIB=auto
818
CFG_GSTREAMER=auto
819
CFG_QGTKSTYLE=auto
820
CFG_QS60STYLE=auto
821
CFG_LARGEFILE=auto
822
CFG_OPENSSL=auto
823
CFG_PTMALLOC=no
824
CFG_STL=auto
825
CFG_PRECOMPILE=auto
826
CFG_SEPARATE_DEBUG_INFO=no
827
CFG_SEPARATE_DEBUG_INFO_NOCOPY=no
828
CFG_REDUCE_EXPORTS=auto
829
CFG_MMX=auto
830
CFG_3DNOW=auto
831
CFG_SSE=auto
832
CFG_SSE2=auto
833
CFG_SSE3=auto
834
CFG_SSSE3=auto
835
CFG_SSE4_1=auto
836
CFG_SSE4_2=auto
837
CFG_AVX=auto
838
CFG_REDUCE_RELOCATIONS=no
839
CFG_IPV6=auto
840
CFG_NAS=no
841
CFG_QWS_DEPTHS=all
842
CFG_USER_BUILD_KEY=
843
CFG_ACCESSIBILITY=auto
844
CFG_QT3SUPPORT=yes
845
CFG_ENDIAN=auto
846
CFG_HOST_ENDIAN=auto
847
CFG_DOUBLEFORMAT=auto
848
CFG_ARMFPA=auto
849
CFG_IWMMXT=no
850
CFG_NEON=auto
851
CFG_CLOCK_GETTIME=auto
852
CFG_CLOCK_MONOTONIC=auto
853
CFG_MREMAP=auto
854
CFG_GETADDRINFO=auto
855
CFG_IPV6IFNAME=auto
856
CFG_GETIFADDRS=auto
857
CFG_INOTIFY=auto
858
CFG_RPATH=yes
859
CFG_FRAMEWORK=auto
860
CFG_MAC_ARCHS=
861
MAC_CONFIG_TEST_COMMANDLINE=  # used to make the configure tests run with the correct arch's and SDK settings
862
CFG_MAC_DWARF2=auto
863
CFG_MAC_XARCH=auto
864
CFG_MAC_CARBON=no
865
CFG_MAC_COCOA=yes
866
COMMANDLINE_MAC_CARBON=no
867
CFG_MAC_HARFBUZZ=no
868
CFG_SXE=no
869
CFG_PREFIX_INSTALL=yes
870
CFG_SDK=
871
D_FLAGS=
872
I_FLAGS=
873
L_FLAGS=
874
RPATH_FLAGS=
875
l_FLAGS=
876
QCONFIG_FLAGS=
877
XPLATFORM=              # This seems to be the QMAKESPEC, like "linux-g++" or "symbian-gcce"
878
XPLATFORM_MINGW=no      # Whether target platform is MinGW (win32-g++*)
879
XPLATFORM_INTEGRITY=no  # Whether target platform is INTEGRITY (*integrity*)
880
XPLATFORM_SYMBIAN=no    # Whether target platform is SYMBIAN (*symbian*)
881
XPLATFORM_SYMBIAN_SBSV2=no # Whether target platform is SYMBIAN_SBSV2 (symbian-sbsv2)
882
PLATFORM=$QMAKESPEC
883
QT_CROSS_COMPILE=no
884
OPT_CONFIRM_LICENSE=no
885
OPT_SHADOW=maybe
886
OPT_FAST=auto
887
OPT_VERBOSE=no
888
OPT_HELP=
889
CFG_SILENT=no
890
CFG_GRAPHICS_SYSTEM=default
891
CFG_RUNTIME_SYSTEM=
892
CFG_ALSA=auto
893
CFG_PULSEAUDIO=auto
894
CFG_COREWLAN=auto
895
CFG_ICD=auto
896
CFG_NOPROCESS=no
897
CFG_ICU=auto
898
899
# initalize variables used for installation
900
QT_INSTALL_PREFIX=
901
QT_INSTALL_DOCS=
902
QT_INSTALL_HEADERS=
903
QT_INSTALL_LIBS=
904
QT_INSTALL_BINS=
905
QT_INSTALL_PLUGINS=
906
QT_INSTALL_IMPORTS=
907
QT_INSTALL_DATA=
908
QT_INSTALL_TRANSLATIONS=
909
QT_INSTALL_SETTINGS=
910
QT_INSTALL_EXAMPLES=
911
QT_INSTALL_DEMOS=
912
QT_HOST_PREFIX=
913
914
#flags for SQL drivers
915
QT_CFLAGS_PSQL=
916
QT_LFLAGS_PSQL=
917
QT_CFLAGS_MYSQL=
918
QT_LFLAGS_MYSQL=
919
QT_LFLAGS_MYSQL_R=
920
QT_CFLAGS_SQLITE=
921
QT_LFLAGS_SQLITE=
922
QT_LFLAGS_ODBC="-lodbc"
923
QT_LFLAGS_TDS=
924
925
# flags for libdbus-1
926
QT_CFLAGS_DBUS=
927
QT_LIBS_DBUS=
928
929
# flags for Glib (X11 only)
930
QT_CFLAGS_GLIB=
931
QT_LIBS_GLIB=
932
933
# flags for GStreamer (X11 only)
934
QT_CFLAGS_GSTREAMER=
935
QT_LIBS_GSTREAMER=
936
937
#flag for Symbian fpu settings
938
QT_CFLAGS_FPU=
939
940
# flags for libconnsettings0 (used for Maemo ICD bearer management plugin)
941
QT_CFLAGS_CONNSETTINGS=
942
QT_LIBS_CONNSETTINGS=
943
944
#-------------------------------------------------------------------------------
945
# check SQL drivers, mouse drivers and decorations available in this package
946
#-------------------------------------------------------------------------------
947
948
# opensource version removes some drivers, so force them to be off
949
CFG_SQL_tds=no
950
CFG_SQL_oci=no
951
CFG_SQL_db2=no
952
953
CFG_SQL_AVAILABLE=
954
if [ -d "$relpath/src/plugins/sqldrivers" ]; then
955
  for a in "$relpath/src/plugins/sqldrivers/"*; do
956
     if [ -d "$a" ]; then
957
	 base_a=`basename "$a"`
958
  	 CFG_SQL_AVAILABLE="${CFG_SQL_AVAILABLE} ${base_a}"
959
	 eval "CFG_SQL_${base_a}=auto"
960
     fi
961
  done
962
fi
963
964
CFG_DECORATION_PLUGIN_AVAILABLE=
965
if [ -d "$relpath/src/plugins/decorations" ]; then
966
  for a in "$relpath/src/plugins/decorations/"*; do
967
     if [ -d "$a" ]; then
968
	 base_a=`basename "$a"`
969
  	 CFG_DECORATION_PLUGIN_AVAILABLE="${CFG_DECORATION_PLUGIN_AVAILABLE} ${base_a}"
970
     fi
971
  done
972
fi
973
974
CFG_KBD_PLUGIN_AVAILABLE=
975
if [ -d "$relpath/src/plugins/kbddrivers" ]; then
976
  for a in "$relpath/src/plugins/kbddrivers/"*; do
977
     if [ -d "$a" ]; then
978
	 base_a=`basename "$a"`
979
  	 CFG_KBD_PLUGIN_AVAILABLE="${CFG_KBD_PLUGIN_AVAILABLE} ${base_a}"
980
     fi
981
  done
982
fi
983
984
CFG_MOUSE_PLUGIN_AVAILABLE=
985
if [ -d "$relpath/src/plugins/mousedrivers" ]; then
986
  for a in "$relpath/src/plugins/mousedrivers/"*; do
987
     if [ -d "$a" ]; then
988
	 base_a=`basename "$a"`
989
  	 CFG_MOUSE_PLUGIN_AVAILABLE="${CFG_MOUSE_PLUGIN_AVAILABLE} ${base_a}"
990
     fi
991
  done
992
fi
993
994
CFG_GFX_PLUGIN_AVAILABLE=
995
if [ -d "$relpath/src/plugins/gfxdrivers" ]; then
996
  for a in "$relpath/src/plugins/gfxdrivers/"*; do
997
     if [ -d "$a" ]; then
998
	 base_a=`basename "$a"`
999
  	 CFG_GFX_PLUGIN_AVAILABLE="${CFG_GFX_PLUGIN_AVAILABLE} ${base_a}"
1000
     fi
1001
  done
1002
  CFG_GFX_OFF="$CFG_GFX_AVAILABLE" # assume all off
1003
fi
1004
1005
CFG_IMAGEFORMAT_PLUGIN_AVAILABLE=
1006
if [ -d "$relpath/src/plugins/imageformats" ]; then
1007
    for a in "$relpath/src/plugins/imageformats/"*; do
1008
        if [ -d "$a" ]; then
1009
            base_a=`basename "$a"`
1010
            CFG_IMAGEFORMAT_PLUGIN_AVAILABLE="${CFG_IMAGEFORMAT_PLUGIN_AVAILABLE} ${base_a}"
1011
        fi
1012
    done
1013
fi
1014
1015
#-------------------------------------------------------------------------------
1016
# Set Default NaCl options
1017
#-------------------------------------------------------------------------------
1018
if [ "$CFG_EMBEDDED" = "nacl" ]; then
1019
    echo "Setting NaCl options:"
1020
    echo "-static"
1021
    CFG_SHARED=no
1022
    echo "-qpa nacl"
1023
    PLATFORM_QPA=yes
1024
    echo "-fast"
1025
    OPT_FAST=yes
1026
    echo "-qconfig nacl"
1027
    CFG_QCONFIG=nacl
1028
1029
    if [ `uname` = "Linux" ]; then
1030
        I_FLAGS="$I_FLAGS -I${CFG_NACL_PATH}/toolchain/linux_x86/sdk/nacl-sdk/include"
1031
        L_FLAGS="$L_FLAGS -I${CFG_NACL_PATH}/toolchain/linux_x86/sdk/nacl-sdk/lib"
1032
    else
1033
        I_FLAGS="$I_FLAGS -I${CFG_NACL_PATH}/toolchain/mac_x86/sdk/nacl-sdk/include"
1034
        L_FLAGS="$L_FLAGS -I${CFG_NACL_PATH}/toolchain/mac_x86/sdk/nacl-sdk/lib"
1035
    fi
1036
1037
    echo "-no-multimedia -no-webkit -no-phonon -no-nultimedia -no-mediaservices -no-xmlpatterns -no-script -no-sql-sqlite -nomake tests"
1038
    CFG_MULTIMEDIA=no
1039
    CFG_WEBKIT=no
1040
    CFG_PHONON=no
1041
    CFG_MULTIMEDIA=no
1042
    CFG_MEDIASERVICES=no
1043
    CFG_XMLPATTERNS=no
1044
    CFG_SCRIPT=no
1045
    CFG_SQLITE=no
1046
    CFG_SQL_sqlite=no
1047
    CFG_LIBTIFF=no
1048
    CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS tests"
1049
    QT_CONFIG="$QT_CONFIG nacl"
1050
fi
1051
1052
#-------------------------------------------------------------------------------
1053
# parse command line arguments
1054
#-------------------------------------------------------------------------------
1055
1056
# parse the arguments, setting things to "yes" or "no"
1057
while [ "$#" -gt 0 ]; do
1058
    CURRENT_OPT="$1"
1059
    UNKNOWN_ARG=no
1060
    case "$1" in
1061
    #Autoconf style options
1062
    --enable-*)
1063
        VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
1064
        VAL=yes
1065
        ;;
1066
    --disable-*)
1067
        VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
1068
        VAL=no
1069
        ;;
1070
    --*=*)
1071
        VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
1072
        VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
1073
        ;;
1074
    --no-*)
1075
        VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
1076
        VAL=no
1077
        ;;
1078
    --*)
1079
        VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
1080
        VAL=yes
1081
        ;;
1082
    #Qt plugin options
1083
    -no-*-*|-plugin-*-*|-qt-*-*)
1084
        VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
1085
        VAL=`echo $1 | sed "s,^-\([^-]*\).*,\1,"`
1086
        ;;
1087
    #WebKit options
1088
    -webkit)
1089
        VAR="webkit"
1090
        VAL="yes"
1091
        ;;
1092
    -webkit-debug)
1093
        VAR="webkit"
1094
        VAL="debug"
1095
        ;;
1096
    -no-webkit)
1097
        VAR="webkit"
1098
        VAL="no"
1099
        ;;
1100
    #Qt style no options
1101
    -no-*)
1102
        VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"`
1103
        VAL=no
1104
        ;;
1105
    #Qt style yes options
1106
    -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|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu)
1107
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1108
        VAL=yes
1109
        ;;
1110
    #Qt style options that pass an argument
1111
    -qconfig)
1112
        if [ "$PLATFORM_QWS" != "yes" -a "$PLATFORM_QPA" != "yes" ]; then
1113
            echo
1114
            echo "WARNING: -qconfig is only tested and supported on Qt for Embedded Linux."
1115
            echo
1116
        fi
1117
        CFG_QCONFIG="$VAL"
1118
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1119
        shift
1120
        VAL=$1
1121
        ;;
1122
    -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config|-sysroot)
1123
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1124
        shift
1125
        VAL="$1"
1126
        ;;
1127
    #Qt style complex options in one command
1128
    -enable-*|-disable-*)
1129
        VAR=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
1130
        VAL=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
1131
        ;;
1132
    #Qt Builtin/System style options
1133
    -no-*|-system-*|-qt-*)
1134
        VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
1135
        VAL=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
1136
        ;;
1137
    #Options that cannot be generalized
1138
    -k|-continue)
1139
        VAR=fatal_error
1140
        VAL=no
1141
        ;;
1142
    -embedded)
1143
        VAR=embedded
1144
        # this option may or may not be followed by an argument
1145
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1146
            VAL=auto
1147
        else
1148
            shift;
1149
            VAL=$1
1150
        fi
1151
	;;
1152
    -embedded-lite|-qpa)
1153
        VAR=qpa
1154
        # this option may or may not be followed by an argument
1155
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1156
            VAL=auto
1157
        else
1158
            shift;
1159
            VAL=$1
1160
        fi
1161
	;;
1162
    -nacl)
1163
        VAR=nacl
1164
        shift;
1165
    ;;
1166
    -opengl)
1167
        VAR=opengl
1168
        # this option may or may not be followed by an argument
1169
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1170
            VAL=yes
1171
        else
1172
            shift;
1173
            VAL=$1
1174
        fi
1175
	;;
1176
    -openvg)
1177
        VAR=openvg
1178
        # this option may or may not be followed by an argument
1179
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1180
            VAL=yes
1181
        else
1182
            shift;
1183
            VAL=$1
1184
        fi
1185
	;;
1186
    -hostprefix)
1187
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1188
        # this option may or may not be followed by an argument
1189
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1190
            VAL=$outpath
1191
        else
1192
            shift;
1193
            VAL=$1
1194
        fi
1195
        ;;
1196
    -host-*-endian)
1197
        VAR=host_endian
1198
        VAL=`echo $1 | sed "s,^-.*-\(.*\)-.*,\1,"`
1199
        ;;
1200
    -*-endian)
1201
        VAR=endian
1202
        VAL=`echo $1 | sed "s,^-\(.*\)-.*,\1,"`
1203
        ;;
1204
    -qtnamespace)
1205
        VAR="qtnamespace"
1206
        shift
1207
        VAL="$1"
1208
        ;;
1209
    -graphicssystem)
1210
	VAR="graphicssystem"
1211
	shift
1212
	VAL=$1
1213
	;;
1214
    -runtimegraphicssystem)
1215
	VAR="runtimegraphicssystem"
1216
	shift
1217
	VAL=$1
1218
	;;
1219
    -qtlibinfix)
1220
        VAR="qtlibinfix"
1221
        shift
1222
        VAL="$1"
1223
        ;;
1224
    -D?*|-D)
1225
        VAR="add_define"
1226
        if [ "$1" = "-D" ]; then
1227
            shift
1228
            VAL="$1"
1229
        else
1230
            VAL=`echo $1 | sed 's,-D,,'`
1231
        fi
1232
        ;;
1233
    -fpu)
1234
        VAR="fpu"
1235
        # this option may or may not be followed by an argument
1236
        if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1237
            VAL=no
1238
        else
1239
            shift
1240
            VAL=$1
1241
        fi
1242
        ;;
1243
    -I?*|-I)
1244
        VAR="add_ipath"
1245
        if [ "$1" = "-I" ]; then
1246
            shift
1247
            VAL="$1"
1248
        else
1249
            VAL=`echo $1 | sed 's,-I,,'`
1250
        fi
1251
        ;;
1252
    -L?*|-L)
1253
        VAR="add_lpath"
1254
        if [ "$1" = "-L" ]; then
1255
            shift
1256
            VAL="$1"
1257
        else
1258
            VAL=`echo $1 | sed 's,-L,,'`
1259
        fi
1260
        ;;
1261
    -R?*|-R)
1262
        VAR="add_rpath"
1263
        if [ "$1" = "-R" ]; then
1264
            shift
1265
            VAL="$1"
1266
        else
1267
            VAL=`echo $1 | sed 's,-R,,'`
1268
        fi
1269
        ;;
1270
    -l?*)
1271
        VAR="add_link"
1272
        VAL=`echo $1 | sed 's,-l,,'`
1273
        ;;
1274
    -F?*|-F)
1275
        VAR="add_fpath"
1276
        if [ "$1" = "-F" ]; then
1277
            shift
1278
            VAL="$1"
1279
        else
1280
            VAL=`echo $1 | sed 's,-F,,'`
1281
        fi
1282
        ;;
1283
    -fw?*|-fw)
1284
        VAR="add_framework"
1285
        if [ "$1" = "-fw" ]; then
1286
            shift
1287
            VAL="$1"
1288
        else
1289
            VAL=`echo $1 | sed 's,-fw,,'`
1290
        fi
1291
        ;;
1292
    -*)
1293
        VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1294
        VAL="unknown"
1295
        ;;
1296
    *)
1297
        UNKNOWN_ARG=yes
1298
        ;;
1299
    esac
1300
    if [ "$UNKNOWN_ARG" = "yes" ]; then
1301
        echo "$1: unknown argument"
1302
        OPT_HELP=yes
1303
        ERROR=yes
1304
        shift
1305
        continue
1306
     fi
1307
    shift
1308
1309
    UNKNOWN_OPT=no
1310
    case "$VAR" in
1311
    qt3support)
1312
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1313
            CFG_QT3SUPPORT="$VAL"
1314
        else
1315
            UNKNOWN_OPT=yes
1316
        fi
1317
        ;;
1318
    accessibility)
1319
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1320
            CFG_ACCESSIBILITY="$VAL"
1321
        else
1322
            UNKNOWN_OPT=yes
1323
        fi
1324
        ;;
1325
    license)
1326
	LICENSE_FILE="$VAL"
1327
	;;
1328
    gnumake)
1329
        CFG_USE_GNUMAKE="$VAL"
1330
        ;;
1331
    mysql_config)
1332
	CFG_MYSQL_CONFIG="$VAL"
1333
	;;
1334
    prefix)
1335
        QT_INSTALL_PREFIX="$VAL"
1336
        ;;
1337
    hostprefix)
1338
	QT_HOST_PREFIX="$VAL"
1339
	;;
1340
    force-pkg-config)
1341
        QT_FORCE_PKGCONFIG=yes
1342
        ;;
1343
    docdir)
1344
        QT_INSTALL_DOCS="$VAL"
1345
        ;;
1346
    headerdir)
1347
        QT_INSTALL_HEADERS="$VAL"
1348
        ;;
1349
    plugindir)
1350
        QT_INSTALL_PLUGINS="$VAL"
1351
        ;;
1352
    importdir)
1353
        QT_INSTALL_IMPORTS="$VAL"
1354
        ;;
1355
    datadir)
1356
        QT_INSTALL_DATA="$VAL"
1357
        ;;
1358
    libdir)
1359
        QT_INSTALL_LIBS="$VAL"
1360
        ;;
1361
    qtnamespace)
1362
        QT_NAMESPACE="$VAL"
1363
        ;;
1364
    qtlibinfix)
1365
        QT_LIBINFIX="$VAL"
1366
        ;;
1367
    translationdir)
1368
        QT_INSTALL_TRANSLATIONS="$VAL"
1369
        ;;
1370
    sysconfdir|settingsdir)
1371
        QT_INSTALL_SETTINGS="$VAL"
1372
        ;;
1373
    examplesdir)
1374
        QT_INSTALL_EXAMPLES="$VAL"
1375
        ;;
1376
    demosdir)
1377
        QT_INSTALL_DEMOS="$VAL"
1378
        ;;
1379
    qconfig)
1380
        CFG_QCONFIG="$VAL"
1381
        ;;
1382
    sysroot)
1383
        CFG_SYSROOT="$VAL"
1384
        ;;
1385
    bindir)
1386
        QT_INSTALL_BINS="$VAL"
1387
        ;;
1388
    buildkey)
1389
        CFG_USER_BUILD_KEY="$VAL"
1390
        ;;
1391
    sxe)
1392
	CFG_SXE="$VAL"
1393
        ;;
1394
    embedded)
1395
        CFG_EMBEDDED="$VAL"
1396
        PLATFORM_X11=no
1397
        PLATFORM_MAC=no
1398
        PLATFORM_QWS=yes
1399
        PLATFORM_QPA=no
1400
        ;;
1401
    embedded-lite|qpa)
1402
        CFG_EMBEDDED="no"
1403
        PLATFORM_X11=no
1404
        PLATFORM_MAC=no
1405
        PLATFORM_QWS=no
1406
        PLATFORM_QPA=yes
1407
        ;;
1408
    nacl)
1409
        ;;
1410
    sse)
1411
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1412
            CFG_SSE="$VAL"
1413
        else
1414
            UNKNOWN_OPT=yes
1415
        fi
1416
	;;
1417
    endian)
1418
        if [ "$VAL" = "little" ]; then
1419
            CFG_ENDIAN="Q_LITTLE_ENDIAN"
1420
        elif [ "$VAL" = "big" ]; then
1421
            CFG_ENDIAN="Q_BIG_ENDIAN"
1422
        else
1423
            UNKNOWN_OPT=yes
1424
        fi
1425
        ;;
1426
    host_endian)
1427
        if [ "$VAL" = "little" ]; then
1428
            CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
1429
        elif [ "$VAL" = "big" ]; then
1430
            CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
1431
        else
1432
            UNKNOWN_OPT=yes
1433
        fi
1434
        ;;
1435
    armfpa)
1436
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1437
            CFG_ARMFPA="$VAL"
1438
        else
1439
            UNKNOWN_OPT=yes
1440
        fi
1441
        ;;
1442
    depths)
1443
        CFG_QWS_DEPTHS="$VAL"
1444
        ;;
1445
    opengl)
1446
        if  [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
1447
            [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
1448
            [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then
1449
            CFG_OPENGL="$VAL"
1450
            if  [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then
1451
                CFG_EGL="yes"
1452
            fi
1453
        else
1454
            UNKNOWN_OPT=yes
1455
        fi
1456
        ;;
1457
    openvg)
1458
        if [ "$VAL" = "auto" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1459
            CFG_OPENVG="$VAL"
1460
            if [ "$CFG_EGL" = "no" ] && [ "$VAL" != "no" ]; then
1461
                CFG_EGL=auto
1462
            fi
1463
        else
1464
            UNKNOWN_OPT=yes
1465
        fi
1466
        ;;
1467
    graphicssystem)
1468
        if [ "$PLATFORM_QWS" = "yes" ]; then
1469
            echo "Error: Graphics System plugins are not supported on QWS."
1470
            echo "   On QWS, the graphics system API is part of the QScreen plugin architecture "
1471
            echo "   rather than existing as a separate plugin."
1472
            echo ""
1473
            UNKNOWN_OPT=yes
1474
        else
1475
            if  [ "$VAL" = "opengl" ]; then
1476
                CFG_GRAPHICS_SYSTEM="opengl"
1477
            elif [ "$VAL" = "openvg" ]; then
1478
                CFG_GRAPHICS_SYSTEM="openvg"
1479
            elif [ "$VAL" = "raster" ]; then
1480
                CFG_GRAPHICS_SYSTEM="raster"
1481
            elif [ "$VAL" = "runtime" ]; then
1482
                CFG_GRAPHICS_SYSTEM="runtime"
1483
            else
1484
                UNKNOWN_OPT=yes
1485
            fi
1486
        fi
1487
	;;
1488
    runtimegraphicssystem)
1489
        if  [ "$VAL" != "runtime" ]; then
1490
            CFG_RUNTIME_SYSTEM="$VAL"
1491
        fi
1492
	;;
1493
1494
    qvfb) # left for commandline compatibility, not documented
1495
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1496
            if [ "$VAL" = "yes" ]; then
1497
		QMakeVar add gfx-drivers qvfb
1498
		QMakeVar add kbd-drivers qvfb
1499
		QMakeVar add mouse-drivers qvfb
1500
                CFG_GFX_ON="$CFG_GFX_ON qvfb"
1501
                CFG_KBD_ON="$CFG_KBD_ON qvfb"
1502
                CFG_MOUSE_ON="$CFG_MOUSE_ON qvfb"
1503
            fi
1504
        else
1505
            UNKNOWN_OPT=yes
1506
        fi
1507
        ;;
1508
    nomake)
1509
	CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL"
1510
        ;;
1511
    make)
1512
	CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL"
1513
        ;;
1514
    x11)
1515
        PLATFORM_QPA=no
1516
        PLATFORM_MAC=no
1517
        PLATFORM_QWS=no
1518
        PLATFORM_X11=yes
1519
        ;;
1520
    sdk)
1521
        if [ "$PLATFORM_MAC" = "yes" ]; then
1522
            CFG_SDK="$VAL"
1523
        else
1524
            UNKNOWN_OPT=yes
1525
        fi
1526
	;;
1527
     dwarf2)
1528
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1529
            CFG_MAC_DWARF2="$VAL"
1530
        else
1531
            UNKNOWN_OPT=yes
1532
        fi
1533
	;;
1534
    arch)
1535
        # if this is a Mac then "windows" probably means
1536
        # we are cross-compiling for MinGW
1537
        if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" != "windows" ]; then
1538
            CFG_MAC_ARCHS="$CFG_MAC_ARCHS $VAL"
1539
        else
1540
            CFG_ARCH=$VAL
1541
        fi
1542
        ;;
1543
    host-arch)
1544
        CFG_HOST_ARCH=$VAL
1545
        ;;
1546
    universal)
1547
        if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1548
            CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86 ppc"
1549
        else
1550
            UNKNOWN_OPT=yes
1551
        fi
1552
        ;;
1553
    cocoa)
1554
#       do nothing - Cocoa is the default.
1555
        ;;
1556
    carbon)
1557
        if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1558
            CFG_MAC_CARBON="$VAL"
1559
            COMMANDLINE_MAC_CARBON="$VAL"
1560
        else
1561
            UNKNOWN_OPT=yes
1562
        fi
1563
        ;;
1564
    harfbuzz)
1565
        if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_CARBON" != "yes" ] && [ "$VAL" = "yes" ]; then
1566
            CFG_MAC_HARFBUZZ="$VAL"
1567
        else
1568
            UNKNOWN_OPT=yes
1569
        fi
1570
        ;;
1571
1572
    framework)
1573
        if [ "$PLATFORM_MAC" = "yes" ] || [ "$PLATFORM_QPA" = "yes" ]; then
1574
            CFG_FRAMEWORK="$VAL"
1575
        else
1576
            UNKNOWN_OPT=yes
1577
        fi
1578
        ;;
1579
    profile)
1580
        if [ "$VAL" = "yes" ]; then
1581
            CFG_PROFILE=yes
1582
	    QMakeVar add QMAKE_CFLAGS -pg
1583
	    QMakeVar add QMAKE_CXXFLAGS -pg
1584
	    QMakeVar add QMAKE_LFLAGS -pg
1585
            QMAKE_VARS="$QMAKE_VARS CONFIG+=nostrip"
1586
        else
1587
            UNKNOWN_OPT=yes
1588
        fi
1589
        ;;
1590
    exceptions|g++-exceptions)
1591
        if [ "$VAL" = "no" ]; then
1592
            CFG_EXCEPTIONS=no
1593
        elif [ "$VAL" = "yes" ]; then
1594
            CFG_EXCEPTIONS=yes
1595
        else
1596
            UNKNOWN_OPT=yes
1597
        fi
1598
        ;;
1599
    platform)
1600
        PLATFORM="$VAL"
1601
        # keep compatibility with old platform names
1602
        case $PLATFORM in
1603
        aix-64)
1604
            PLATFORM=aix-xlc-64
1605
            ;;
1606
        hpux-o64)
1607
            PLATFORM=hpux-acc-o64
1608
            ;;
1609
        hpux-n64)
1610
            PLATFORM=hpux-acc-64
1611
            ;;
1612
        hpux-acc-n64)
1613
            PLATFORM=hpux-acc-64
1614
            ;;
1615
        irix-n32)
1616
            PLATFORM=irix-cc
1617
            ;;
1618
        irix-64)
1619
            PLATFORM=irix-cc-64
1620
            ;;
1621
        irix-cc-n64)
1622
            PLATFORM=irix-cc-64
1623
            ;;
1624
        reliant-64)
1625
            PLATFORM=reliant-cds-64
1626
            ;;
1627
        solaris-64)
1628
            PLATFORM=solaris-cc-64
1629
            ;;
1630
        openunix-cc)
1631
            PLATFORM=unixware-cc
1632
            ;;
1633
        openunix-g++)
1634
            PLATFORM=unixware-g++
1635
            ;;
1636
        unixware7-cc)
1637
            PLATFORM=unixware-cc
1638
            ;;
1639
        unixware7-g++)
1640
            PLATFORM=unixware-g++
1641
            ;;
1642
        macx-g++-64)
1643
            PLATFORM=macx-g++
1644
	    NATIVE_64_ARCH=
1645
            case `uname -p` in
1646
            i386) NATIVE_64_ARCH="x86_64" ;;
1647
            powerpc) NATIVE_64_ARCH="ppc64" ;;
1648
            *)   echo "WARNING: Can't detect CPU architecture for macx-g++-64" ;;
1649
            esac
1650
	    if [ ! -z "$NATIVE_64_ARCH" ]; then
1651
		QTCONFIG_CONFIG="$QTCONFIG_CONFIG $NATIVE_64_ARCH"
1652
		CFG_MAC_ARCHS="$CFG_MAC_ARCHS $NATIVE_64_ARCH"
1653
            fi
1654
            ;;
1655
        esac
1656
        ;;
1657
    xplatform)
1658
        XPLATFORM="$VAL"
1659
        case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
1660
        case "$XPLATFORM" in *integrity*) XPLATFORM_INTEGRITY=yes;; esac
1661
        case "$XPLATFORM" in *symbian*) XPLATFORM_SYMBIAN=yes;; esac
1662
        case "$XPLATFORM" in symbian-sbsv2) XPLATFORM_SYMBIAN_SBSV2=yes;; esac
1663
        ;;
1664
    debug-and-release)
1665
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1666
            CFG_DEBUG_RELEASE="$VAL"
1667
        else
1668
            UNKNOWN_OPT=yes
1669
        fi
1670
        ;;
1671
    optimized-qmake)
1672
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1673
            CFG_RELEASE_QMAKE="$VAL"
1674
        else
1675
            UNKNOWN_OPT=yes
1676
        fi
1677
        ;;
1678
    release)
1679
        if [ "$VAL" = "yes" ]; then
1680
            CFG_DEBUG=no
1681
        elif [ "$VAL" = "no" ]; then
1682
            CFG_DEBUG=yes
1683
        else
1684
            UNKNOWN_OPT=yes
1685
        fi
1686
        ;;
1687
    prefix-install)
1688
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1689
	    CFG_PREFIX_INSTALL="$VAL"
1690
        else
1691
            UNKNOWN_OPT=yes
1692
        fi
1693
	;;
1694
    debug)
1695
        CFG_DEBUG="$VAL"
1696
        ;;
1697
    developer-build|commercial|opensource|nokia-developer)
1698
        # These switches have been dealt with already
1699
        ;;
1700
    static)
1701
        if [ "$VAL" = "yes" ]; then
1702
            CFG_SHARED=no
1703
        elif [ "$VAL" = "no" ]; then
1704
            CFG_SHARED=yes
1705
        else
1706
            UNKNOWN_OPT=yes
1707
        fi
1708
        ;;
1709
    incremental)
1710
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1711
            CFG_INCREMENTAL="$VAL"
1712
        else
1713
            UNKNOWN_OPT=yes
1714
        fi
1715
        ;;
1716
    fatal_error)
1717
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1718
            CFG_CONFIGURE_EXIT_ON_ERROR="$VAL"
1719
        else
1720
            UNKNOWN_OPT=yes
1721
        fi
1722
        ;;
1723
    feature-*)
1724
            FEATURE=`echo $VAR | sed "s,^[^-]*-\([^-]*\),\1," | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
1725
            if [ "$VAL" = "no" ]; then
1726
                QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE"
1727
            elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then
1728
                QCONFIG_FLAGS="$QCONFIG_FLAGS QT_$FEATURE"
1729
            else
1730
                UNKNOWN_OPT=yes
1731
            fi
1732
        ;;
1733
    shared)
1734
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1735
            CFG_SHARED="$VAL"
1736
        else
1737
            UNKNOWN_OPT=yes
1738
        fi
1739
        ;;
1740
    gif)
1741
        if [ "$VAL" = "no" ]; then
1742
            CFG_GIF="$VAL"
1743
        else
1744
            UNKNOWN_OPT=yes
1745
        fi
1746
        ;;
1747
    sm)
1748
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1749
            CFG_SM="$VAL"
1750
        else
1751
            UNKNOWN_OPT=yes
1752
        fi
1753
1754
        ;;
1755
    xinerama)
1756
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1757
            CFG_XINERAMA="$VAL"
1758
        else
1759
            UNKNOWN_OPT=yes
1760
        fi
1761
        ;;
1762
    xshape)
1763
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1764
            CFG_XSHAPE="$VAL"
1765
        else
1766
            UNKNOWN_OPT=yes
1767
        fi
1768
        ;;
1769
    xvideo)
1770
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1771
            CFG_XVIDEO="$VAL"
1772
        else
1773
            UNKNOWN_OPT=yes
1774
        fi
1775
        ;;
1776
    xsync)
1777
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1778
            CFG_XSYNC="$VAL"
1779
        else
1780
            UNKNOWN_OPT=yes
1781
        fi
1782
        ;;
1783
    xinput)
1784
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1785
            CFG_XINPUT="$VAL"
1786
        else
1787
            UNKNOWN_OPT=yes
1788
        fi
1789
        ;;
1790
    egl)
1791
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1792
            CFG_EGL="$VAL"
1793
        else
1794
            UNKNOWN_OPT=yes
1795
        fi
1796
        ;;
1797
    stl)
1798
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1799
            CFG_STL="$VAL"
1800
        else
1801
            UNKNOWN_OPT=yes
1802
        fi
1803
        ;;
1804
    pch)
1805
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1806
            CFG_PRECOMPILE="$VAL"
1807
        else
1808
            UNKNOWN_OPT=yes
1809
        fi
1810
        ;;
1811
    separate-debug-info)
1812
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1813
            CFG_SEPARATE_DEBUG_INFO="$VAL"
1814
        elif [ "$VAL" = "nocopy" ] ; then
1815
            CFG_SEPARATE_DEBUG_INFO="yes"
1816
            CFG_SEPARATE_DEBUG_INFO_NOCOPY="yes"
1817
        else
1818
            UNKNOWN_OPT=yes
1819
        fi
1820
        ;;
1821
    reduce-exports)
1822
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1823
            CFG_REDUCE_EXPORTS="$VAL"
1824
        else
1825
            UNKNOWN_OPT=yes
1826
        fi
1827
        ;;
1828
    mmx)
1829
        if [ "$VAL" = "no" ]; then
1830
            CFG_MMX="$VAL"
1831
        else
1832
            UNKNOWN_OPT=yes
1833
        fi
1834
        ;;
1835
    3dnow)
1836
        if [ "$VAL" = "no" ]; then
1837
            CFG_3DNOW="$VAL"
1838
        else
1839
            UNKNOWN_OPT=yes
1840
        fi
1841
        ;;
1842
    sse)
1843
        if [ "$VAL" = "no" ]; then
1844
            CFG_SSE="$VAL"
1845
        else
1846
            UNKNOWN_OPT=yes
1847
        fi
1848
        ;;
1849
    sse2)
1850
        if [ "$VAL" = "no" ]; then
1851
            CFG_SSE2="$VAL"
1852
        else
1853
            UNKNOWN_OPT=yes
1854
        fi
1855
        ;;
1856
    sse3)
1857
        if [ "$VAL" = "no" ]; then
1858
            CFG_SSE3="$VAL"
1859
        else
1860
            UNKNOWN_OPT=yes
1861
        fi
1862
        ;;
1863
    ssse3)
1864
        if [ "$VAL" = "no" ]; then
1865
            CFG_SSSE3="$VAL"
1866
        else
1867
            UNKNOWN_OPT=yes
1868
        fi
1869
        ;;
1870
    sse4.1)
1871
        if [ "$VAL" = "no" ]; then
1872
            CFG_SSE4_1="$VAL"
1873
        else
1874
            UNKNOWN_OPT=yes
1875
        fi
1876
        ;;
1877
    sse4.2)
1878
        if [ "$VAL" = "no" ]; then
1879
            CFG_SSE4_2="$VAL"
1880
        else
1881
            UNKNOWN_OPT=yes
1882
        fi
1883
        ;;
1884
    avx)
1885
        if [ "$VAL" = "no" ]; then
1886
            CFG_AVX="$VAL"
1887
        else
1888
            UNKNOWN_OPT=yes
1889
        fi
1890
        ;;
1891
    iwmmxt)
1892
	CFG_IWMMXT="yes"
1893
	;;
1894
    neon)
1895
        if [ "$VAL" = "no" ]; then
1896
            CFG_NEON="$VAL"
1897
        else
1898
            UNKNOWN_OPT=yes
1899
        fi
1900
        ;;
1901
    reduce-relocations)
1902
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1903
            CFG_REDUCE_RELOCATIONS="$VAL"
1904
        else
1905
            UNKNOWN_OPT=yes
1906
        fi
1907
        ;;
1908
    freetype)
1909
        [ "$VAL" = "qt" ] && VAL=yes
1910
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1911
            CFG_QWS_FREETYPE="$VAL"
1912
        else
1913
            UNKNOWN_OPT=yes
1914
        fi
1915
        ;;
1916
    zlib)
1917
        [ "$VAL" = "qt" ] && VAL=yes
1918
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1919
            CFG_ZLIB="$VAL"
1920
        else
1921
            UNKNOWN_OPT=yes
1922
        fi
1923
        # No longer supported:
1924
        #[ "$VAL" = "no" ] && CFG_LIBPNG=no
1925
        ;;
1926
    s60)
1927
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1928
            CFG_S60="$VAL"
1929
        else
1930
            UNKNOWN_OPT=yes
1931
        fi
1932
        ;;
1933
    usedeffiles)
1934
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1935
            CFG_SYMBIAN_DEFFILES="$VAL"
1936
        else
1937
            UNKNOWN_OPT=yes
1938
        fi
1939
        ;;
1940
    sqlite)
1941
        if [ "$VAL" = "system" ]; then
1942
            CFG_SQLITE=system
1943
        else
1944
            UNKNOWN_OPT=yes
1945
        fi
1946
        ;;
1947
    libpng)
1948
        [ "$VAL" = "yes" ] && VAL=qt
1949
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1950
            CFG_LIBPNG="$VAL"
1951
        else
1952
            UNKNOWN_OPT=yes
1953
        fi
1954
        ;;
1955
    libjpeg)
1956
        [ "$VAL" = "yes" ] && VAL=qt
1957
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1958
            CFG_LIBJPEG="$VAL"
1959
        else
1960
            UNKNOWN_OPT=yes
1961
        fi
1962
        ;;
1963
    libmng)
1964
        [ "$VAL" = "yes" ] && VAL=qt
1965
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1966
            CFG_LIBMNG="$VAL"
1967
        else
1968
            UNKNOWN_OPT=yes
1969
        fi
1970
        ;;
1971
    libtiff)
1972
        [ "$VAL" = "yes" ] && VAL=qt
1973
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1974
            CFG_LIBTIFF="$VAL"
1975
        else
1976
            UNKNOWN_OPT=yes
1977
        fi
1978
        ;;
1979
    nas-sound)
1980
        if [ "$VAL" = "system" ] || [ "$VAL" = "no" ]; then
1981
            CFG_NAS="$VAL"
1982
        else
1983
            UNKNOWN_OPT=yes
1984
        fi
1985
        ;;
1986
    xcursor)
1987
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1988
            CFG_XCURSOR="$VAL"
1989
        else
1990
            UNKNOWN_OPT=yes
1991
        fi
1992
        ;;
1993
    xfixes)
1994
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1995
            CFG_XFIXES="$VAL"
1996
        else
1997
            UNKNOWN_OPT=yes
1998
        fi
1999
        ;;
2000
    xrandr)
2001
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
2002
            CFG_XRANDR="$VAL"
2003
        else
2004
            UNKNOWN_OPT=yes
2005
        fi
2006
        ;;
2007
    xrender)
2008
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2009
            CFG_XRENDER="$VAL"
2010
        else
2011
            UNKNOWN_OPT=yes
2012
        fi
2013
        ;;
2014
    mitshm)
2015
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2016
            CFG_MITSHM="$VAL"
2017
        else
2018
            UNKNOWN_OPT=yes
2019
        fi
2020
        ;;
2021
    fontconfig)
2022
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2023
            CFG_FONTCONFIG="$VAL"
2024
        else
2025
            UNKNOWN_OPT=yes
2026
        fi
2027
        ;;
2028
    xkb)
2029
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2030
            CFG_XKB="$VAL"
2031
        else
2032
            UNKNOWN_OPT=yes
2033
        fi
2034
        ;;
2035
    cups)
2036
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2037
            CFG_CUPS="$VAL"
2038
        else
2039
            UNKNOWN_OPT=yes
2040
        fi
2041
        ;;
2042
    iconv)
2043
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2044
            CFG_ICONV="$VAL"
2045
        else
2046
            UNKNOWN_OPT=yes
2047
        fi
2048
        ;;
2049
    glib)
2050
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2051
            CFG_GLIB="$VAL"
2052
        else
2053
            UNKNOWN_OPT=yes
2054
        fi
2055
        ;;
2056
    gstreamer)
2057
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2058
            CFG_GSTREAMER="$VAL"
2059
        else
2060
            UNKNOWN_OPT=yes
2061
        fi
2062
        ;;
2063
    gtkstyle)
2064
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2065
            CFG_QGTKSTYLE="$VAL"
2066
        else
2067
            UNKNOWN_OPT=yes
2068
        fi
2069
        ;;
2070
    style-s60)
2071
        if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ]; then
2072
            CFG_QS60STYLE="$VAL"
2073
        else
2074
            UNKNOWN_OPT=yes
2075
        fi
2076
        ;;
2077
    gui)
2078
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
2079
            CFG_GUI="yes"
2080
        else
2081
            if [ "$VAL" = "no" ]; then
2082
                CFG_GUI="no"
2083
            else
2084
                UNKNOWN_OPT=yes
2085
            fi
2086
        fi
2087
        ;;
2088
    qdbus|dbus)
2089
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ]; then
2090
            CFG_DBUS="$VAL"
2091
	elif [ "$VAL" = "runtime" ]; then
2092
	    CFG_DBUS="yes"
2093
        else
2094
            UNKNOWN_OPT=yes
2095
        fi
2096
        ;;
2097
    dbus-linked)
2098
        if [ "$VAL" = "yes" ]; then
2099
	    CFG_DBUS="linked"
2100
	else
2101
            UNKNOWN_OPT=yes
2102
        fi
2103
        ;;
2104
    nis)
2105
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2106
            CFG_NIS="$VAL"
2107
        else
2108
            UNKNOWN_OPT=yes
2109
        fi
2110
        ;;
2111
    largefile)
2112
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2113
            CFG_LARGEFILE="$VAL"
2114
        else
2115
            UNKNOWN_OPT=yes
2116
        fi
2117
        ;;
2118
    openssl)
2119
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2120
            CFG_OPENSSL="$VAL"
2121
        else
2122
            UNKNOWN_OPT=yes
2123
        fi
2124
        ;;
2125
    openssl-linked)
2126
        if [ "$VAL" = "yes" ]; then
2127
            CFG_OPENSSL="linked"
2128
        else
2129
            UNKNOWN_OPT=yes
2130
        fi
2131
        ;;
2132
    ptmalloc)
2133
        if [ "$VAL" = "yes" ]; then
2134
            CFG_PTMALLOC="yes"
2135
        else
2136
            UNKNOWN_OPT=yes
2137
        fi
2138
        ;;
2139
2140
    xmlpatterns)
2141
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
2142
            CFG_XMLPATTERNS="yes"
2143
        else
2144
            if [ "$VAL" = "no" ]; then
2145
                CFG_XMLPATTERNS="no"
2146
            else
2147
                UNKNOWN_OPT=yes
2148
            fi
2149
        fi
2150
        ;;
2151
    script)
2152
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
2153
            CFG_SCRIPT="yes"
2154
        else
2155
            if [ "$VAL" = "no" ]; then
2156
                CFG_SCRIPT="no"
2157
            else
2158
                UNKNOWN_OPT=yes
2159
            fi
2160
        fi
2161
        ;;
2162
    scripttools)
2163
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
2164
            CFG_SCRIPTTOOLS="yes"
2165
        else
2166
            if [ "$VAL" = "no" ]; then
2167
                CFG_SCRIPTTOOLS="no"
2168
            else
2169
                UNKNOWN_OPT=yes
2170
            fi
2171
        fi
2172
        ;;
2173
    svg)
2174
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
2175
            CFG_SVG="yes"
2176
        else
2177
            if [ "$VAL" = "no" ]; then
2178
                CFG_SVG="no"
2179
            else
2180
                UNKNOWN_OPT=yes
2181
            fi
2182
        fi
2183
        ;;
2184
    declarative)
2185
        if [ "$VAL" = "yes" ]; then
2186
            CFG_DECLARATIVE="yes"
2187
        else
2188
            if [ "$VAL" = "no" ]; then
2189
                CFG_DECLARATIVE="no"
2190
            else
2191
                UNKNOWN_OPT=yes
2192
            fi
2193
        fi
2194
	;;
2195
    declarative-debug)
2196
        if [ "$VAL" = "yes" ]; then
2197
            CFG_DECLARATIVE_DEBUG="yes"
2198
        else
2199
            if [ "$VAL" = "no" ]; then
2200
                CFG_DECLARATIVE_DEBUG="no"
2201
            else
2202
                UNKNOWN_OPT=yes
2203
            fi
2204
        fi
2205
        ;;
2206
    webkit)
2207
        [ "$VAL" = "auto" ] && VAL="yes"
2208
        CFG_WEBKIT="$VAL"
2209
        ;;
2210
    javascript-jit)
2211
        if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then 
2212
            CFG_JAVASCRIPTCORE_JIT="$VAL"
2213
        else
2214
            UNKNOWN_OPT=yes
2215
        fi
2216
        ;;
2217
    confirm-license)
2218
        if [ "$VAL" = "yes" ]; then
2219
            OPT_CONFIRM_LICENSE="$VAL"
2220
        else
2221
            UNKNOWN_OPT=yes
2222
        fi
2223
        ;;
2224
    h|help)
2225
        if [ "$VAL" = "yes" ]; then
2226
            OPT_HELP="$VAL"
2227
        else
2228
            UNKNOWN_OPT=yes
2229
        fi
2230
        ;;
2231
    sql-*|gfx-*|decoration-*|kbd-*|mouse-*|imageformat-*)
2232
        # if Qt style options were used, $VAL can be "no", "qt", or "plugin"
2233
        # if autoconf style options were used, $VAL can be "yes" or "no"
2234
        [ "$VAL" = "yes" ] && VAL=qt
2235
        # now $VAL should be "no", "qt", or "plugin"... double-check
2236
        if [ "$VAL" != "no" ] && [ "$VAL" != "qt" ] && [ "$VAL" != "plugin" ]; then
2237
            UNKNOWN_OPT=yes
2238
        fi
2239
        # now $VAL is "no", "qt", or "plugin"
2240
        OPT="$VAL"
2241
        VAL=`echo $VAR | sed "s,^[^-]*-\([^-]*\).*,\1,"`
2242
        VAR=`echo $VAR | sed "s,^\([^-]*\).*,\1,"`
2243
2244
        # Grab the available values
2245
        case "$VAR" in
2246
        sql)
2247
            avail="$CFG_SQL_AVAILABLE"
2248
            ;;
2249
        gfx)
2250
            avail="$CFG_GFX_AVAILABLE"
2251
	    if [ "$OPT" = "plugin" ]; then
2252
		avail="$CFG_GFX_PLUGIN_AVAILABLE"
2253
	    fi
2254
            ;;
2255
        decoration)
2256
            avail="$CFG_DECORATION_AVAILABLE"
2257
	    if [ "$OPT" = "plugin" ]; then
2258
		avail="$CFG_DECORATION_PLUGIN_AVAILABLE"
2259
	    fi
2260
            ;;
2261
        kbd)
2262
            avail="$CFG_KBD_AVAILABLE"
2263
	    if [ "$OPT" = "plugin" ]; then
2264
		avail="$CFG_KBD_PLUGIN_AVAILABLE"
2265
	    fi
2266
            ;;
2267
        mouse)
2268
            avail="$CFG_MOUSE_AVAILABLE"
2269
	    if [ "$OPT" = "plugin" ]; then
2270
		avail="$CFG_MOUSE_PLUGIN_AVAILABLE"
2271
	    fi
2272
            ;;
2273
        imageformat)
2274
            avail="$CFG_IMAGEFORMAT_PLUGIN_AVAILABLE"
2275
            if [ "$OPT" != "plugin" ]; then
2276
                # png is always built in
2277
                avail="$avail png"
2278
            fi
2279
            ;;
2280
        *)
2281
            avail=""
2282
            echo "BUG: Unhandled type $VAR used in $CURRENT_OPT"
2283
            ;;
2284
        esac
2285
2286
        # Check that that user's value is available.
2287
        found=no
2288
        for d in $avail; do
2289
            if [ "$VAL" = "$d" ]; then
2290
                found=yes
2291
                break
2292
            fi
2293
        done
2294
        [ "$found" = yes ] || ERROR=yes
2295
2296
        if [ "$VAR" = "sql" ]; then
2297
            # set the CFG_SQL_driver
2298
            eval "CFG_SQL_$VAL=\$OPT"
2299
            continue
2300
        elif [ "$VAR" = "imageformat" ]; then
2301
            [ "$OPT" = "qt" ] && OPT=yes
2302
            VAL="`echo $VAL |tr a-z A-Z`"
2303
            eval "CFG_$VAL=$OPT"
2304
            continue
2305
        fi
2306
2307
        if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then
2308
            if [ "$OPT" = "plugin" ]; then
2309
                [ "$VAR" = "decoration" ] && QMakeVar del "${VAR}s" "$VAL"
2310
                [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"` && CFG_DECORATION_PLUGIN="$CFG_DECORATION_PLUGIN ${VAL}"
2311
                [ "$VAR" = "kbd" ] && QMakeVar del "${VAR}s" "$VAL"
2312
                [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"` && CFG_KBD_PLUGIN="$CFG_KBD_PLUGIN ${VAL}"
2313
                [ "$VAR" = "mouse" ] && QMakeVar del "${VAR}s" "$VAL"
2314
                [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_MOUSE_PLUGIN="$CFG_MOUSE_PLUGIN ${VAL}"
2315
                [ "$VAR" = "gfx" ] && QMakeVar del "${VAR}s" "$VAL"
2316
                [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"` && CFG_GFX_PLUGIN="${CFG_GFX_PLUGIN} ${VAL}"
2317
                VAR="${VAR}-${OPT}"
2318
            else
2319
                if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "decoration" ] || [ "$VAR" = "mouse" ]; then
2320
                    [ "$VAR" = "gfx" ] && CFG_GFX_ON="$CFG_GFX_ON $VAL"
2321
                    [ "$VAR" = "kbd" ] && CFG_KBD_ON="$CFG_KBD_ON $VAL"
2322
		    [ "$VAR" = "decoration" ] && CFG_DECORATION_ON="$CFG_DECORATION_ON $VAL"
2323
                    [ "$VAR" = "mouse" ] && CFG_MOUSE_ON="$CFG_MOUSE_ON $VAL"
2324
                    VAR="${VAR}-driver"
2325
                fi
2326
            fi
2327
	    QMakeVar add "${VAR}s" "${VAL}"
2328
        elif [ "$OPT" = "no" ]; then
2329
            PLUG_VAR="${VAR}-plugin"
2330
            if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "mouse" ]; then
2331
                IN_VAR="${VAR}-driver"
2332
            else
2333
                IN_VAR="${VAR}"
2334
            fi
2335
            [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"`
2336
            [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"`
2337
            [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"`
2338
            [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"`
2339
	    QMakeVar del "${IN_VAR}s" "$VAL"
2340
	    QMakeVar del "${PLUG_VAR}s" "$VAL"
2341
        fi
2342
        if [ "$ERROR" = "yes" ]; then
2343
           echo "$CURRENT_OPT: unknown argument"
2344
           OPT_HELP=yes
2345
        fi
2346
        ;;
2347
    v|verbose)
2348
        if [ "$VAL" = "yes" ]; then
2349
            if [ "$OPT_VERBOSE" = "$VAL" ]; then            # takes two verboses to turn on qmake debugs
2350
                QMAKE_SWITCHES="$QMAKE_SWITCHES -d"
2351
            else
2352
                OPT_VERBOSE=yes
2353
            fi
2354
        elif [ "$VAL" = "no" ]; then
2355
            if [ "$OPT_VERBOSE" = "$VAL" ] && echo "$QMAKE_SWITCHES" | grep ' -d' >/dev/null 2>&1; then
2356
                QMAKE_SWITCHES=`echo $QMAKE_SWITCHES | sed "s, -d,,"`
2357
            else
2358
                OPT_VERBOSE=no
2359
            fi
2360
        else
2361
            UNKNOWN_OPT=yes
2362
        fi
2363
        ;;
2364
    fast)
2365
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2366
            OPT_FAST="$VAL"
2367
        else
2368
            UNKNOWN_OPT=yes
2369
        fi
2370
        ;;
2371
    rpath)
2372
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2373
            CFG_RPATH="$VAL"
2374
        else
2375
            UNKNOWN_OPT=yes
2376
        fi
2377
        ;;
2378
    add_define)
2379
        D_FLAGS="$D_FLAGS \"$VAL\""
2380
        ;;
2381
    add_ipath)
2382
        I_FLAGS="$I_FLAGS -I\"${VAL}\""
2383
        ;;
2384
    add_lpath)
2385
        L_FLAGS="$L_FLAGS -L\"${VAL}\""
2386
        ;;
2387
    add_rpath)
2388
        RPATH_FLAGS="$RPATH_FLAGS \"${VAL}\""
2389
        ;;
2390
    add_link)
2391
        l_FLAGS="$l_FLAGS -l\"${VAL}\""
2392
        ;;
2393
    add_fpath)
2394
        if [ "$PLATFORM_MAC" = "yes" ]; then
2395
            L_FLAGS="$L_FLAGS -F\"${VAL}\""
2396
            I_FLAGS="$I_FLAGS -F\"${VAL}\""
2397
        else
2398
            UNKNOWN_OPT=yes
2399
        fi
2400
        ;;
2401
    add_framework)
2402
        if [ "$PLATFORM_MAC" = "yes" ]; then
2403
            l_FLAGS="$l_FLAGS -framework \"${VAL}\""
2404
        else
2405
            UNKNOWN_OPT=yes
2406
        fi
2407
        ;;
2408
    silent)
2409
        CFG_SILENT="$VAL"
2410
        ;;
2411
    phonon)
2412
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2413
            CFG_PHONON="$VAL"
2414
        else
2415
            UNKNOWN_OPT=yes
2416
        fi
2417
        ;;
2418
    phonon-backend)
2419
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2420
            CFG_PHONON_BACKEND="$VAL"
2421
        else
2422
            UNKNOWN_OPT=yes
2423
        fi
2424
        ;;
2425
    multimedia)
2426
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2427
            CFG_MULTIMEDIA="$VAL"
2428
        else
2429
            UNKNOWN_OPT=yes
2430
        fi
2431
        ;;
2432
    dont-process)
2433
        CFG_NOPROCESS=yes
2434
        ;;
2435
    process)
2436
        CFG_NOPROCESS=no
2437
        ;;
2438
    audio-backend)
2439
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2440
            CFG_AUDIO_BACKEND="$VAL"
2441
        else
2442
            UNKNOWN_OPT=yes
2443
        fi
2444
        ;;
2445
    fpu)
2446
       if [ "$VAL" != "no" ]; then
2447
          QT_CFLAGS_FPU=$VAL
2448
       fi
2449
       ;;
2450
    icu)
2451
        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2452
            CFG_ICU="$VAL"
2453
        else
2454
            UNKNOWN_OPT=yes
2455
        fi
2456
        ;;
2457
    *)
2458
        UNKNOWN_OPT=yes
2459
        ;;
2460
    esac
2461
    if [ "$UNKNOWN_OPT" = "yes" ]; then
2462
        echo "${CURRENT_OPT}: invalid command-line switch"
2463
        OPT_HELP=yes
2464
        ERROR=yes
2465
    fi
2466
done
2467
2468
if [ "$CFG_QCONFIG" != "full" ] && [ "$CFG_QT3SUPPORT" = "yes" ]; then
2469
    echo "Warning: '-qconfig $CFG_QCONFIG' will disable the qt3support library."
2470
    CFG_QT3SUPPORT="no"
2471
fi
2472
if [ "$CFG_GUI" = "no" ]; then
2473
    echo "Warning: -no-gui will disable the qt3support library."
2474
    CFG_QT3SUPPORT="no"
2475
fi
2476
2477
#disable Qt3Support for Lighthouse
2478
if [ "$PLATFORM_QPA" = "yes" ]; then
2479
    CFG_QT3SUPPORT="no"
2480
fi
2481
2482
# update QT_CONFIG to show our current predefined configuration
2483
case "$CFG_QCONFIG" in
2484
minimal|small|medium|large|full)
2485
    # these are a sequence of increasing functionality
2486
    for c in minimal small medium large full; do
2487
        QT_CONFIG="$QT_CONFIG $c-config"
2488
        [ "$CFG_QCONFIG" = $c ] && break
2489
    done
2490
    ;;
2491
*)
2492
    # not known to be sufficient for anything
2493
    if [ '!' -f "$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" ] && [ '!' -f `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` ]; then
2494
        echo >&2 "Error: configuration file not found:"
2495
        echo >&2 "  $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h"
2496
        echo >&2 "  or"
2497
        echo >&2 "  `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"`"
2498
        OPT_HELP=yes
2499
    fi
2500
esac
2501
2502
#-------------------------------------------------------------------------------
2503
# build tree initialization
2504
#-------------------------------------------------------------------------------
2505
2506
# where to find which..
2507
unixtests="$relpath/config.tests/unix"
2508
mactests="$relpath/config.tests/mac"
2509
symbiantests="$relpath/config.tests/symbian"
2510
WHICH="$unixtests/which.test"
2511
2512
PERL=`$WHICH perl 2>/dev/null`
2513
2514
# find out which awk we want to use, prefer gawk, then nawk, then regular awk
2515
AWK=
2516
for e in gawk nawk awk; do
2517
    if "$WHICH" $e >/dev/null 2>&1 && ( $e -f /dev/null /dev/null ) >/dev/null 2>&1; then
2518
        AWK=$e
2519
        break
2520
    fi
2521
done
2522
2523
# find perl
2524
PERL="/usr/bin/perl"
2525
if "$WHICH" perl >/dev/null 2>&1 && ( perl /dev/null ) >/dev/null 2>&1; then
2526
    PERL=`$WHICH perl`
2527
fi
2528
2529
### skip this if the user just needs help...
2530
if [ "$OPT_HELP" != "yes" ]; then
2531
2532
# is this a shadow build?
2533
if [ "$OPT_SHADOW" = "maybe" ]; then
2534
    OPT_SHADOW=no
2535
    if [ "$relpath" != "$outpath" ] && [ '!' -f "$outpath/configure" ]; then
2536
        if [ -h "$outpath" ]; then
2537
            [ "$relpath" -ef "$outpath" ] || OPT_SHADOW=yes
2538
        else
2539
            OPT_SHADOW=yes
2540
        fi
2541
    fi
2542
fi
2543
if [ "$OPT_SHADOW" = "yes" ]; then
2544
    if [ -f "$relpath/.qmake.cache" -o -f "$relpath/src/corelib/global/qconfig.h" -o -f "$relpath/src/corelib/global/qconfig.cpp" ]; then
2545
        echo >&2 "You cannot make a shadow build from a source tree containing a previous build."
2546
        echo >&2 "Cannot proceed."
2547
        exit 1
2548
    fi
2549
    [ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
2550
fi
2551
2552
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2553
    echo
2554
    echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux"
2555
    echo "Qt can be built in release mode with separate debug information, so"
2556
    echo "-debug-and-release is not necessary anymore"
2557
    echo
2558
fi
2559
2560
# detect build style
2561
if [ "$CFG_DEBUG" = "auto" ]; then
2562
    if [ "$PLATFORM_MAC" = "yes" -o "$XPLATFORM_MINGW" = "yes" ]; then
2563
        CFG_DEBUG_RELEASE=yes
2564
        CFG_DEBUG=yes
2565
    elif [ "$CFG_DEV" = "yes" ]; then
2566
        CFG_DEBUG_RELEASE=no
2567
        CFG_DEBUG=yes
2568
    else
2569
        CFG_DEBUG_RELEASE=no
2570
        CFG_DEBUG=no
2571
    fi
2572
fi
2573
if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2574
    QMAKE_CONFIG="$QMAKE_CONFIG build_all"
2575
fi
2576
2577
if [ "$CFG_SILENT" = "yes" ]; then
2578
    QMAKE_CONFIG="$QMAKE_CONFIG silent"
2579
fi
2580
2581
# if the source tree is different from the build tree,
2582
# symlink or copy part of the sources
2583
if [ "$OPT_SHADOW" = "yes" ]; then
2584
    echo "Preparing build tree..."
2585
2586
    if [ -z "$PERL" ]; then
2587
        echo
2588
        echo "You need perl in your PATH to make a shadow build."
2589
        echo "Cannot proceed."
2590
        exit 1
2591
    fi
2592
2593
    [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
2594
2595
    # symlink the qmake directory
2596
    find "$relpath/qmake" | while read a; do
2597
        my_a=`echo "$a" | sed "s,^${relpath}/,${outpath}/,"`
2598
        if [ '!' -f "$my_a" ]; then
2599
            if [ -d "$a" ]; then
2600
                # directories are created...
2601
                mkdir -p "$my_a"
2602
            else
2603
                a_dir=`dirname "$my_a"`
2604
                [ -d "$a_dir" ] || mkdir -p "$a_dir"
2605
                # ... and files are symlinked
2606
                case `basename "$a"` in
2607
                *.o|*.d|GNUmakefile*|qmake)
2608
                    ;;
2609
                *)
2610
                    rm -f "$my_a"
2611
                    ln -s "$a" "$my_a"
2612
                    ;;
2613
                esac
2614
            fi
2615
        fi
2616
    done
2617
2618
    # make a syncqt script that can be used in the shadow
2619
    rm -f "$outpath/bin/syncqt"
2620
    if [ -x "$relpath/bin/syncqt" ]; then
2621
        mkdir -p "$outpath/bin"
2622
        echo "#!/bin/sh" >"$outpath/bin/syncqt"
2623
        echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/syncqt"
2624
        echo "perl \"$relpath/bin/syncqt\" -outdir \"$outpath\" \"\$@\"" >>"$outpath/bin/syncqt"
2625
        chmod 755 "$outpath/bin/syncqt"
2626
    fi
2627
2628
    for i in elf2e32_qtwrapper createpackage patch_capabilities; do
2629
        rm -f "$outpath/bin/$i"
2630
        if [ -x "$relpath/bin/$i" ]; then
2631
            mkdir -p "$outpath/bin"
2632
            echo "#!/bin/sh" >"$outpath/bin/$i"
2633
            echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/$i"
2634
            echo "\"$relpath/bin/$i\" \"\$@\"" >>"$outpath/bin/$i"
2635
            chmod 755 "$outpath/bin/$i"
2636
        fi
2637
    done
2638
2639
    # symlink the mkspecs directory
2640
    mkdir -p "$outpath/mkspecs"
2641
    rm -rf "$outpath"/mkspecs/*
2642
    ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
2643
    rm -f "$outpath/mkspecs/default"
2644
2645
    ShadowMkspecs()
2646
    {
2647
        rm -rf "$outpath/mkspecs/$1"
2648
        find "$relpath/mkspecs/$1" -type d | sed "s,^$relpath,$outpath," | xargs mkdir -p
2649
        find "$relpath/mkspecs/$1" -type f | sed "s,^$relpath/,," | while read f; do ln -s "$relpath/$f" "$outpath/$f"; done
2650
    }
2651
2652
    # Special case for mkspecs/features directory.
2653
    # To be able to place .prf files into a shadow build directory,
2654
    # we're creating links for files only. The directory structure is reproduced.
2655
    ShadowMkspecs features
2656
2657
    # The modules dir is special, too.
2658
    ShadowMkspecs modules
2659
2660
    # symlink the doc directory
2661
    rm -rf "$outpath/doc"
2662
    ln -s "$relpath/doc" "$outpath/doc"
2663
2664
    # make sure q3porting.xml can be found
2665
    mkdir -p "$outpath/tools/porting/src"
2666
    rm -f "$outpath/tools/porting/src/q3porting.xml"
2667
    ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src"
2668
fi
2669
2670
# symlink fonts to be able to run application from build directory
2671
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ] && [ ! -d "${outpath}/lib/fonts" ]; then
2672
    if [ "$PLATFORM" = "$XPLATFORM" ]; then
2673
        mkdir -p "${outpath}/lib"
2674
        ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
2675
    fi
2676
fi
2677
2678
if [ "$OPT_FAST" = "auto" ]; then
2679
   if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then
2680
       OPT_FAST=yes
2681
   else
2682
       OPT_FAST=no
2683
   fi
2684
fi
2685
2686
# find a make command
2687
if [ -z "$MAKE" ]; then
2688
    MAKE=
2689
    for mk in gmake make; do
2690
        if "$WHICH" $mk >/dev/null 2>&1; then
2691
            MAKE=`"$WHICH" $mk`
2692
            break
2693
        fi
2694
    done
2695
    if [ -z "$MAKE" ]; then
2696
        echo >&2 "You don't seem to have 'make' or 'gmake' in your PATH."
2697
        echo >&2 "Cannot proceed."
2698
        exit 1
2699
    fi
2700
    # export MAKE, we need it later in the config.tests
2701
    export MAKE
2702
fi
2703
2704
fi ### help
2705
2706
#-------------------------------------------------------------------------------
2707
# auto-detect all that hasn't been specified in the arguments
2708
#-------------------------------------------------------------------------------
2709
2710
[ "$PLATFORM_QWS" = "yes" -a "$CFG_EMBEDDED" = "no" ] && CFG_EMBEDDED=auto
2711
if [ "$CFG_EMBEDDED" != "no" ]; then
2712
    case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2713
    Darwin:*)
2714
        [ -z "$PLATFORM" ] && PLATFORM=qws/macx-generic-g++
2715
        if [ -z "$XPLATFORM" ]; then
2716
            [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2717
            XPLATFORM="qws/macx-$CFG_EMBEDDED-g++"
2718
        fi
2719
        ;;
2720
    FreeBSD:*)
2721
        [ -z "$PLATFORM" ] && PLATFORM=qws/freebsd-generic-g++
2722
        if [ -z "$XPLATFORM" ]; then
2723
            [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2724
            XPLATFORM="qws/freebsd-$CFG_EMBEDDED-g++"
2725
        fi
2726
        ;;
2727
    SunOS:5*)
2728
        [ -z "$PLATFORM" ] && PLATFORM=qws/solaris-generic-g++
2729
        if [ -z "$XPLATFORM" ]; then
2730
            [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2731
            XPLATFORM="qws/solaris-$CFG_EMBEDDED-g++"
2732
        fi
2733
        ;;
2734
    Linux:*)
2735
        if [ -z "$PLATFORM" ]; then
2736
            case "$UNAME_MACHINE" in
2737
            *86)
2738
                PLATFORM=qws/linux-x86-g++
2739
                ;;
2740
            *86_64)
2741
                PLATFORM=qws/linux-x86_64-g++
2742
                ;;
2743
            *)
2744
                PLATFORM=qws/linux-generic-g++
2745
                ;;
2746
            esac
2747
        fi
2748
        if [ -z "$XPLATFORM" ]; then
2749
            if [ "$CFG_EMBEDDED" = "auto" ]; then
2750
                if [ -n "$CFG_ARCH" ]; then
2751
                    CFG_EMBEDDED=$CFG_ARCH
2752
                else
2753
                    case "$UNAME_MACHINE" in
2754
                    *86)
2755
                        CFG_EMBEDDED=x86
2756
                        ;;
2757
                    *86_64)
2758
                        CFG_EMBEDDED=x86_64
2759
                        ;;
2760
                    *)
2761
                        CFG_EMBEDDED=generic
2762
                        ;;
2763
                    esac
2764
                fi
2765
            fi
2766
            XPLATFORM="qws/linux-$CFG_EMBEDDED-g++"
2767
        fi
2768
        ;;
2769
    QNX:*)
2770
        [ -z "$PLATFORM" ] && PLATFORM=qws/qnx-generic-g++
2771
        if [ -z "$XPLATFORM" ]; then
2772
            [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2773
            XPLATFORM="qws/qnx-$CFG_EMBEDDED-g++"
2774
        fi
2775
        ;;
2776
    CYGWIN*:*)
2777
	if [ -z "$XPLATFORM" ]; then
2778
		CFG_EMBEDDED=x86
2779
	fi
2780
	;;
2781
    *)
2782
        echo "Qt for Embedded Linux is not supported on this platform. Disabling."
2783
        CFG_EMBEDDED=no
2784
        PLATFORM_QWS=no
2785
        PLATFORM_QPA=no
2786
        ;;
2787
    esac
2788
fi
2789
if [ -z "$PLATFORM" ]; then
2790
    PLATFORM_NOTES=
2791
    case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2792
     Darwin:*)
2793
        if [ "$PLATFORM_MAC" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
2794
          PLATFORM=macx-g++
2795
        # PLATFORM=macx-xcode
2796
        else
2797
          PLATFORM=darwin-g++
2798
        fi
2799
        ;;
2800
     AIX:*)
2801
        #PLATFORM=aix-g++
2802
        #PLATFORM=aix-g++-64
2803
        PLATFORM=aix-xlc
2804
        #PLATFORM=aix-xlc-64
2805
        PLATFORM_NOTES="
2806
            - Also available for AIX: aix-g++ aix-g++-64 aix-xlc-64
2807
        "
2808
        ;;
2809
     GNU:*)
2810
        PLATFORM=hurd-g++
2811
        ;;
2812
     dgux:*)
2813
        PLATFORM=dgux-g++
2814
        ;;
2815
#     DYNIX/ptx:4*)
2816
#       PLATFORM=dynix-g++
2817
#       ;;
2818
     ULTRIX:*)
2819
        PLATFORM=ultrix-g++
2820
        ;;
2821
     FreeBSD:*)
2822
        PLATFORM=freebsd-g++
2823
        PLATFORM_NOTES="
2824
            - Also available for FreeBSD: freebsd-icc
2825
        "
2826
        ;;
2827
     OpenBSD:*)
2828
        PLATFORM=openbsd-g++
2829
        ;;
2830
     NetBSD:*)
2831
        PLATFORM=netbsd-g++
2832
        ;;
2833
     BSD/OS:*|BSD/386:*)
2834
        PLATFORM=bsdi-g++
2835
        ;;
2836
     IRIX*:*)
2837
        #PLATFORM=irix-g++
2838
        PLATFORM=irix-cc
2839
        #PLATFORM=irix-cc-64
2840
        PLATFORM_NOTES="
2841
            - Also available for IRIX: irix-g++ irix-cc-64
2842
        "
2843
        ;;
2844
     HP-UX:*)
2845
        case "$UNAME_MACHINE" in
2846
            ia64)
2847
                #PLATFORM=hpuxi-acc-32
2848
                PLATFORM=hpuxi-acc-64
2849
                PLATFORM_NOTES="
2850
                    - Also available for HP-UXi: hpuxi-acc-32
2851
                "
2852
            ;;
2853
            *)
2854
                #PLATFORM=hpux-g++
2855
                PLATFORM=hpux-acc
2856
                #PLATFORM=hpux-acc-64
2857
                #PLATFORM=hpux-cc
2858
                #PLATFORM=hpux-acc-o64
2859
                PLATFORM_NOTES="
2860
                    - Also available for HP-UX: hpux-g++ hpux-acc-64 hpux-acc-o64
2861
                "
2862
            ;;
2863
        esac
2864
        ;;
2865
     OSF1:*)
2866
        #PLATFORM=tru64-g++
2867
        PLATFORM=tru64-cxx
2868
        PLATFORM_NOTES="
2869
            - Also available for Tru64: tru64-g++
2870
        "
2871
        ;;
2872
     Linux:*)
2873
        case "$UNAME_MACHINE" in
2874
            x86_64|s390x|ppc64)
2875
                PLATFORM=linux-g++-64
2876
                ;;
2877
            *)
2878
                PLATFORM=linux-g++
2879
                ;;
2880
        esac
2881
        PLATFORM_NOTES="
2882
            - Also available for Linux: linux-kcc linux-icc linux-cxx
2883
        "
2884
        ;;
2885
     SunOS:5*)
2886
        if [ "$XPLATFORM_MINGW" = "yes" ]; then
2887
            PLATFORM="solaris-g++"
2888
        else
2889
            #PLATFORM=solaris-g++
2890
            PLATFORM=solaris-cc
2891
            #PLATFORM=solaris-cc64
2892
        fi
2893
        PLATFORM_NOTES="
2894
            - Also available for Solaris: solaris-g++ solaris-cc-64
2895
        "
2896
        ;;
2897
     ReliantUNIX-*:*|SINIX-*:*)
2898
        PLATFORM=reliant-cds
2899
        #PLATFORM=reliant-cds-64
2900
        PLATFORM_NOTES="
2901
            - Also available for Reliant UNIX: reliant-cds-64
2902
        "
2903
        ;;
2904
     CYGWIN*:*)
2905
        PLATFORM=cygwin-g++
2906
        ;;
2907
     LynxOS*:*)
2908
        PLATFORM=lynxos-g++
2909
        ;;
2910
     OpenUNIX:*)
2911
        #PLATFORM=unixware-g++
2912
        PLATFORM=unixware-cc
2913
        PLATFORM_NOTES="
2914
            - Also available for OpenUNIX: unixware-g++
2915
        "
2916
        ;;
2917
     UnixWare:*)
2918
        #PLATFORM=unixware-g++
2919
        PLATFORM=unixware-cc
2920
        PLATFORM_NOTES="
2921
            - Also available for UnixWare: unixware-g++
2922
        "
2923
        ;;
2924
     SCO_SV:*)
2925
        #PLATFORM=sco-g++
2926
        PLATFORM=sco-cc
2927
        PLATFORM_NOTES="
2928
            - Also available for SCO OpenServer: sco-g++
2929
        "
2930
        ;;
2931
     UNIX_SV:*)
2932
        PLATFORM=unixware-g++
2933
        ;;
2934
     QNX:*)
2935
        PLATFORM=unsupported/qnx-g++
2936
        ;;
2937
     *)
2938
        if [ "$OPT_HELP" != "yes" ]; then
2939
            echo
2940
            for p in $PLATFORMS; do
2941
                echo "    $relconf $* -platform $p"
2942
            done
2943
            echo >&2
2944
            echo "   The build script does not currently recognize all" >&2
2945
            echo "   platforms supported by Qt." >&2
2946
            echo "   Rerun this script with a -platform option listed to" >&2
2947
            echo "   set the system/compiler combination you use." >&2
2948
            echo >&2
2949
            exit 2
2950
        fi
2951
    esac
2952
fi
2953
2954
if [ "$PLATFORM_QWS" = "yes" ]; then
2955
    CFG_SM=no
2956
    PLATFORMS=`find "$relpath/mkspecs/qws" | sed "s,$relpath/mkspecs/qws/,,"`
2957
else
2958
    PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mkspecs/qws/,,"`
2959
fi
2960
2961
[ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
2962
2963
case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
2964
case "$XPLATFORM" in *integrity*) XPLATFORM_INTEGRITY=yes;; esac
2965
case "$XPLATFORM" in *symbian*) XPLATFORM_SYMBIAN=yes;; esac
2966
case "$XPLATFORM" in symbian-sbsv2) XPLATFORM_SYMBIAN_SBSV2=yes;; esac
2967
2968
if [ -d "$PLATFORM" ]; then
2969
  QMAKESPEC="$PLATFORM"
2970
else
2971
  QMAKESPEC="$relpath/mkspecs/${PLATFORM}"
2972
fi
2973
if [ -d "$XPLATFORM" ]; then
2974
  XQMAKESPEC="$XPLATFORM"
2975
else
2976
  XQMAKESPEC="$relpath/mkspecs/${XPLATFORM}"
2977
fi
2978
if [ "$PLATFORM" != "$XPLATFORM" ]; then
2979
    QT_CROSS_COMPILE=yes
2980
    QMAKE_CONFIG="$QMAKE_CONFIG cross_compile"
2981
fi
2982
2983
if [ "$PLATFORM_MAC" = "yes" ]; then
2984
   if [ `basename $QMAKESPEC` = "macx-xcode" ] || [ `basename $XQMAKESPEC` = "macx-xcode" ]; then
2985
      echo >&2
2986
      echo "   Platform 'macx-xcode' should not be used when building Qt/Mac." >&2
2987
      echo "   Please build Qt/Mac with 'macx-g++', then if you would like to" >&2
2988
      echo "   use mac-xcode on your application code it can link to a Qt/Mac" >&2
2989
      echo "   built with 'macx-g++'" >&2
2990
      echo >&2
2991
      exit 2
2992
    fi
2993
fi
2994
2995
# check specified platforms are supported
2996
if [ '!' -d "$QMAKESPEC" ]; then
2997
    echo
2998
    echo "   The specified system/compiler is not supported:"
2999
    echo
3000
    echo "      $QMAKESPEC"
3001
    echo
3002
    echo "   Please see the README file for a complete list."
3003
    echo
3004
    exit 2
3005
fi
3006
if [ '!' -d "$XQMAKESPEC" ]; then
3007
    echo
3008
    echo "   The specified system/compiler is not supported:"
3009
    echo
3010
    echo "      $XQMAKESPEC"
3011
    echo
3012
    echo "   Please see the README file for a complete list."
3013
    echo
3014
    exit 2
3015
fi
3016
if [ '!' -f "${XQMAKESPEC}/qplatformdefs.h" ]; then
3017
    echo
3018
    echo "   The specified system/compiler port is not complete:"
3019
    echo
3020
    echo "      $XQMAKESPEC/qplatformdefs.h"
3021
    echo
3022
    echo "   Please contact qt-bugs@trolltech.com."
3023
    echo
3024
    exit 2
3025
fi
3026
3027
# now look at the configs and figure out what platform we are config'd for
3028
[ "$CFG_EMBEDDED" = "no" ] && [ "$PLATFORM_QPA" != "yes" ] \
3029
  && [ -n "`getXQMakeConf QMAKE_LIBS_X11`" ] \
3030
  && PLATFORM_X11=yes
3031
### echo "$XQMAKESPEC" | grep mkspecs/qws >/dev/null 2>&1 && PLATFORM_QWS=yes
3032
3033
if [ "$UNAME_SYSTEM" = "SunOS" ]; then
3034
    # Solaris 2.5 and 2.6 have libposix4, which was renamed to librt for Solaris 7 and up
3035
    if echo $UNAME_RELEASE | grep "^5\.[5|6]" >/dev/null 2>&1; then
3036
        sed -e "s,-lrt,-lposix4," "$XQMAKESPEC/qmake.conf" > "$XQMAKESPEC/qmake.conf.new"
3037
        mv "$XQMAKESPEC/qmake.conf.new" "$XQMAKESPEC/qmake.conf"
3038
    fi
3039
fi
3040
3041
#-------------------------------------------------------------------------------
3042
# determine the system architecture
3043
#-------------------------------------------------------------------------------
3044
if [ "$OPT_VERBOSE" = "yes" ]; then
3045
    echo "Determining system architecture... ($UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE)"
3046
fi
3047
3048
if [ "$CFG_EMBEDDED" != "no" -a "$CFG_EMBEDDED" != "auto" ] && [ -n "$CFG_ARCH" ]; then
3049
    if [ "$CFG_ARCH" != "$CFG_EMBEDDED" ]; then
3050
        echo ""
3051
        echo "You have specified a target architecture with -embedded and -arch."
3052
        echo "The two architectures you have specified are different, so we can"
3053
        echo "not proceed. Either set both to be the same, or only use -embedded."
3054
        echo ""
3055
        exit 1
3056
    fi
3057
fi
3058
3059
if [ "$CFG_RTOS_ENABLED" = "no" ]; then
3060
    case `basename "$XPLATFORM"` in
3061
	qnx-* | vxworks-*)
3062
            echo ""
3063
            echo "You are not licensed for Qt for `basename $XPLATFORM`."
3064
            echo ""
3065
            echo "Please contact qt-info@nokia.com to upgrade your license to"
3066
            echo "include this platform, or install the Qt Open Source Edition"
3067
            echo "if you intend to develop free software."
3068
            exit 1
3069
	    ;;
3070
    esac
3071
fi
3072
3073
if [ -z "${CFG_HOST_ARCH}" ]; then
3074
    case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in
3075
    GNU:*:*)
3076
        CFG_HOST_ARCH=`echo ${UNAME_MACHINE} | sed -e 's,[-/].*$,,'`
3077
        case "$CFG_HOST_ARCH" in
3078
            i?86)
3079
                CFG_HOST_ARCH=i386
3080
                ;;
3081
        esac
3082
        if [ "$OPT_VERBOSE" = "yes" ]; then
3083
            echo "    GNU/Hurd ($CFG_HOST_ARCH)"
3084
        fi
3085
        ;;
3086
    IRIX*:*:*)
3087
        CFG_HOST_ARCH=`uname -p`
3088
        if [ "$OPT_VERBOSE" = "yes" ]; then
3089
            echo "    SGI ($CFG_HOST_ARCH)"
3090
        fi
3091
        ;;
3092
    SunOS:5*:*)
3093
        case "$UNAME_MACHINE" in
3094
	sun4u*|sun4v*)
3095
            if [ "$OPT_VERBOSE" = "yes" ]; then
3096
                echo "    Sun SPARC (sparc)"
3097
            fi
3098
            CFG_HOST_ARCH=sparc
3099
            ;;
3100
        i86pc)
3101
	    case "$PLATFORM" in
3102
	    *-64*)
3103
                if [ "$OPT_VERBOSE" = "yes" ]; then
3104
	            echo "    64-bit AMD 80x86 (x86_64)"
3105
                fi
3106
                CFG_HOST_ARCH=x86_64
3107
                ;;
3108
	    *)
3109
                if [ "$OPT_VERBOSE" = "yes" ]; then
3110
	            echo "    32-bit Intel 80x86 (i386)"
3111
                fi
3112
                CFG_HOST_ARCH=i386
3113
                ;;
3114
            esac
3115
        esac
3116
        ;;
3117
    Darwin:*:*)
3118
        case "$UNAME_MACHINE" in
3119
            Power?Macintosh)
3120
                if [ "$OPT_VERBOSE" = "yes" ]; then
3121
                    echo "    32-bit Apple PowerPC (powerpc)"
3122
                fi
3123
                ;;
3124
            x86)
3125
                if [ "$OPT_VERBOSE" = "yes" ]; then
3126
                    echo "    32-bit Intel 80x86 (i386)"
3127
                fi
3128
                ;;
3129
        esac
3130
        CFG_HOST_ARCH=macosx
3131
        ;;
3132
    AIX:*:00????????00)
3133
        if [ "$OPT_VERBOSE" = "yes" ]; then
3134
        echo "    64-bit IBM PowerPC (powerpc)"
3135
        fi
3136
        CFG_HOST_ARCH=powerpc
3137
        ;;
3138
    HP-UX:*:9000*)
3139
        if [ "$OPT_VERBOSE" = "yes" ]; then
3140
            echo "    HP PA-RISC (parisc)"
3141
        fi
3142
        CFG_HOST_ARCH=parisc
3143
        ;;
3144
    *:*:i?86)
3145
        if [ "$OPT_VERBOSE" = "yes" ]; then
3146
            echo "    32-bit Intel 80x86 (i386)"
3147
        fi
3148
        CFG_HOST_ARCH=i386
3149
        ;;
3150
    *:*:x86_64|*:*:amd64)
3151
        if [ "$PLATFORM" = "linux-g++-32" -o "$PLATFORM" = "linux-icc-32" ]; then
3152
            if [ "$OPT_VERBOSE" = "yes" ]; then
3153
                echo "    32 bit on 64-bit AMD 80x86 (i386)"
3154
            fi
3155
            CFG_HOST_ARCH=i386
3156
        else
3157
            if [ "$OPT_VERBOSE" = "yes" ]; then
3158
                echo "    64-bit AMD 80x86 (x86_64)"
3159
            fi
3160
            CFG_HOST_ARCH=x86_64
3161
        fi
3162
        ;;
3163
    *:*:ppc)
3164
        if [ "$OPT_VERBOSE" = "yes" ]; then
3165
            echo "    32-bit PowerPC (powerpc)"
3166
        fi
3167
        CFG_HOST_ARCH=powerpc
3168
        ;;
3169
    *:*:ppc64)
3170
        if [ "$OPT_VERBOSE" = "yes" ]; then
3171
            echo "    64-bit PowerPC (powerpc)"
3172
        fi
3173
        CFG_HOST_ARCH=powerpc
3174
        ;;
3175
    *:*:s390*)
3176
    	if [ "$OPT_VERBOSE" = "yes" ]; then
3177
    	    echo "    IBM S/390 (s390)"
3178
    	fi
3179
    	CFG_HOST_ARCH=s390
3180
    	;;
3181
    *:*:arm*)
3182
        if [ "$OPT_VERBOSE" = "yes" ]; then
3183
            echo "    ARM (arm)"
3184
        fi
3185
        CFG_HOST_ARCH=arm
3186
        ;;
3187
    Linux:*:sparc*)
3188
        if [ "$OPT_VERBOSE" = "yes" ]; then
3189
            echo "    Linux on SPARC"
3190
        fi
3191
        CFG_HOST_ARCH=sparc
3192
        ;;
3193
    QNX:*:*)
3194
        case "$UNAME_MACHINE" in
3195
        x86pc)
3196
            if [ "$OPT_VERBOSE" = "yes" ]; then
3197
                echo "    QNX on Intel 80x86 (i386)"
3198
            fi
3199
            CFG_HOST_ARCH=i386
3200
            ;;
3201
        esac
3202
        ;;
3203
    *:*:*)
3204
        if [ "$OPT_VERBOSE" = "yes" ]; then
3205
            echo "    Trying '$UNAME_MACHINE'..."
3206
        fi
3207
        CFG_HOST_ARCH="$UNAME_MACHINE"
3208
        ;;
3209
    esac
3210
fi
3211
3212
if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
3213
    if [ -n "$CFG_ARCH" ]; then
3214
        CFG_EMBEDDED=$CFG_ARCH
3215
    fi
3216
3217
    case "$CFG_EMBEDDED" in
3218
    x86)
3219
        CFG_ARCH=i386
3220
        ;;
3221
    x86_64)
3222
        CFG_ARCH=x86_64
3223
        ;;
3224
    ipaq|sharp)
3225
        CFG_ARCH=arm
3226
        ;;
3227
    dm7000)
3228
        CFG_ARCH=powerpc
3229
        ;;
3230
    dm800)
3231
        CFG_ARCH=mips
3232
        ;;
3233
    sh4al)
3234
        CFG_ARCH=sh4a
3235
        ;;
3236
    arm*)
3237
        CFG_ARCH=arm
3238
        ;;
3239
    *)
3240
        CFG_ARCH="$CFG_EMBEDDED"
3241
        ;;
3242
    esac
3243
elif [ "$XPLATFORM_MINGW" = "yes" ]; then
3244
    [ -z "$CFG_ARCH" ] && CFG_ARCH="windows"
3245
elif [ "$XPLATFORM_INTEGRITY" = "yes" ]; then
3246
    CFG_ARCH=integrity
3247
elif [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
3248
    CFG_ARCH=symbian
3249
elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
3250
    CFG_ARCH=$CFG_HOST_ARCH
3251
fi
3252
3253
# for compatibility
3254
COMPAT_ARCH=
3255
case "$CFG_ARCH" in
3256
arm*)
3257
    # previously, armv6 was a different arch
3258
    CFG_ARCH=arm
3259
    COMPAT_ARCH=armv6
3260
    ;;
3261
esac
3262
3263
if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then
3264
    if [ "$OPT_VERBOSE" = "yes" ]; then
3265
        echo "    '$CFG_ARCH' is supported"
3266
    fi
3267
else
3268
    if [ "$OPT_VERBOSE" = "yes" ]; then
3269
        echo "    '$CFG_ARCH' is unsupported, using 'generic'"
3270
    fi
3271
    CFG_ARCH=generic
3272
fi
3273
if [ "$CFG_HOST_ARCH" != "$CFG_ARCH" ]; then
3274
    if [ -d "$relpath/src/corelib/arch/$CFG_HOST_ARCH" ]; then
3275
        if [ "$OPT_VERBOSE" = "yes" ]; then
3276
            echo "    '$CFG_HOST_ARCH' is supported"
3277
        fi
3278
    else
3279
        if [ "$OPT_VERBOSE" = "yes" ]; then
3280
            echo "    '$CFG_HOST_ARCH' is unsupported, using 'generic'"
3281
        fi
3282
        CFG_HOST_ARCH=generic
3283
    fi
3284
fi
3285
3286
if [ "$OPT_VERBOSE" = "yes" ]; then
3287
    echo "System architecture: '$CFG_ARCH'"
3288
    if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
3289
	echo "Host architecture: '$CFG_HOST_ARCH'"
3290
    fi
3291
fi
3292
3293
#-------------------------------------------------------------------------------
3294
# tests that don't need qmake (must be run before displaying help)
3295
#-------------------------------------------------------------------------------
3296
3297
if [ -z "$PKG_CONFIG" ]; then
3298
    # See if PKG_CONFIG is set in the mkspec:
3299
    PKG_CONFIG=`getXQMakeConf PKG_CONFIG`
3300
fi
3301
if [ -z "$PKG_CONFIG" ]; then
3302
    PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
3303
fi
3304
3305
# Work out if we can use pkg-config
3306
if [ "$QT_CROSS_COMPILE" = "yes" ]; then
3307
    if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then
3308
        echo >&2 ""
3309
        echo >&2 "You have asked to use pkg-config and are cross-compiling."
3310
        echo >&2 "Please make sure you have a correctly set-up pkg-config"
3311
        echo >&2 "environment!"
3312
        echo >&2 ""
3313
        if [ -z "$PKG_CONFIG_PATH" ]; then
3314
            echo >&2 ""
3315
            echo >&2 "Warning: PKG_CONFIG_PATH has not been set.  This could mean"
3316
            echo >&2 "the host compiler's .pc files will be used. This is probably"
3317
            echo >&2 "not what you want."
3318
            echo >&2 ""
3319
        elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
3320
            echo >&2 ""
3321
            echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not"
3322
            echo >&2 "been set. This means your toolchain's .pc files must contain"
3323
            echo >&2 "the paths to the toolchain's libraries & headers. If configure"
3324
            echo >&2 "tests are failing, please check these files."
3325
            echo >&2 ""
3326
        fi
3327
    else
3328
        echo >&2 ""
3329
        echo >&2 "You have not explicitly asked to use pkg-config and are cross-compiling."
3330
        echo >&2 "pkg-config will not be used to automatically query cflag/lib parameters for"
3331
        echo >&2 "dependencies"
3332
        echo >&2 ""
3333
        PKG_CONFIG=""
3334
    fi
3335
fi
3336
3337
if [ ! -n "$PKG_CONFIG" ]; then
3338
    QT_CONFIG="$QT_CONFIG no-pkg-config"
3339
fi
3340
3341
# process CFG_MAC_ARCHS
3342
if [ "$PLATFORM_MAC" = "yes" ]; then
3343
#   check -arch arguments for validity.
3344
    ALLOWED="x86 ppc x86_64 ppc64 i386 arm armv6 armv7"
3345
    # Save the list so we can re-write it using only valid values
3346
    CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS"
3347
    CFG_MAC_ARCHS=
3348
    for i in $CFG_MAC_ARCHS_IN
3349
    do 
3350
        if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then
3351
            echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64 arm armv6 armv7";
3352
            exit 2;
3353
        fi
3354
        if [ "$i" = "i386" -o "$i" = "x86" ]; then
3355
            # These are synonymous values
3356
            # CFG_MAC_ARCHS requires x86 while GCC requires i386
3357
            CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86"
3358
            MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch i386"
3359
        else
3360
            CFG_MAC_ARCHS="$CFG_MAC_ARCHS $i"
3361
            MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch $i"
3362
        fi
3363
    done
3364
fi
3365
3366
# pass on $CFG_SDK to the configure tests.
3367
if [ '!' -z "$CFG_SDK" ]; then
3368
    MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK"
3369
fi
3370
3371
# find the default framework value
3372
if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
3373
    if [ "$CFG_FRAMEWORK" = "auto" ]; then
3374
        CFG_FRAMEWORK="$CFG_SHARED"
3375
    elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
3376
	echo
3377
	echo "WARNING: Using static linking will disable the use of Mac frameworks."
3378
	echo
3379
        CFG_FRAMEWORK="no"
3380
    fi
3381
else
3382
    CFG_FRAMEWORK=no
3383
fi
3384
3385
QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`
3386
TEST_COMPILER="$CXX"
3387
3388
[ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
3389
if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
3390
    #for Symbian we don't need this checking
3391
    if [ -z "$TEST_COMPILER" ]; then
3392
        echo "ERROR: Cannot set the compiler for the configuration tests"
3393
        exit 1
3394
    fi
3395
fi
3396
3397
if [ "$CFG_EMBEDDED" = "nacl" ]; then
3398
    TEST_COMPILER="nacl-gcc"
3399
fi
3400
3401
SYSROOT_FLAG=
3402
if [ -n "$CFG_SYSROOT" ]; then
3403
    if compilerSupportsFlag --sysroot="$CFG_SYSROOT"; then
3404
	[ "$OPT_VERBOSE" = "yes" ] && echo "Setting sysroot to: $CFG_SYSROOT"
3405
	SYSROOT_FLAG="--sysroot=$CFG_SYSROOT"
3406
    else
3407
	echo >&2 "The compiler doesn't support the --sysroot flag, I can't set the sysroot"
3408
	exit 1
3409
    fi
3410
fi
3411
export SYSROOT_FLAG    # used by config.tests/unix/compile.test
3412
3413
# auto-detect precompiled header support
3414
if [ "$CFG_PRECOMPILE" = "auto" ]; then
3415
    if [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
3416
       CFG_PRECOMPILE=no
3417
    elif "$unixtests/precomp.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
3418
       CFG_PRECOMPILE=no
3419
    else
3420
       CFG_PRECOMPILE=yes
3421
    fi
3422
elif [ "$CFG_PRECOMPILE" = "yes" ] && [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
3423
    echo
3424
    echo "WARNING: Using universal binaries disables precompiled headers."
3425
    echo
3426
    CFG_PRECOMPILE=no
3427
fi
3428
3429
#auto-detect DWARF2 on the mac
3430
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "auto" ]; then
3431
    if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
3432
        CFG_MAC_DWARF2=no
3433
    else
3434
        CFG_MAC_DWARF2=yes
3435
    fi
3436
fi
3437
3438
# auto-detect support for -Xarch on the mac
3439
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" = "auto" ]; then
3440
    if "$mactests/xarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
3441
        CFG_MAC_XARCH=no
3442
    else
3443
        CFG_MAC_XARCH=yes
3444
    fi
3445
fi
3446
3447
# don't autodetect support for separate debug info on objcopy when
3448
# cross-compiling as lots of toolchains seems to have problems with this
3449
if [ "$QT_CROSS_COMPILE" = "yes" ] && [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
3450
    CFG_SEPARATE_DEBUG_INFO="no"
3451
fi
3452
3453
# auto-detect support for separate debug info in objcopy
3454
if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
3455
    TEST_COMPILER_CFLAGS=`getXQMakeConf QMAKE_CFLAGS`
3456
    TEST_COMPILER_CXXFLAGS=`getXQMakeConf QMAKE_CXXFLAGS`
3457
    TEST_OBJCOPY=`getXQMakeConf QMAKE_OBJCOPY`
3458
    COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
3459
    COMPILER_WITH_FLAGS=`echo "$COMPILER_WITH_FLAGS" | sed -e "s%\\$\\$QMAKE_CFLAGS%$TEST_COMPILER_CFLAGS%g"`
3460
    if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$TEST_OBJCOPY" "$OPT_VERBOSE"; then
3461
       CFG_SEPARATE_DEBUG_INFO=no
3462
    else
3463
       case "$PLATFORM" in
3464
       hpux-*)
3465
           # binutils on HP-UX is buggy; default to no.
3466
           CFG_SEPARATE_DEBUG_INFO=no
3467
           ;;
3468
       *)
3469
           CFG_SEPARATE_DEBUG_INFO=yes
3470
           ;;
3471
       esac
3472
    fi
3473
fi
3474
3475
# auto-detect -fvisibility support
3476
if [ "$CFG_REDUCE_EXPORTS" = "auto" ]; then
3477
    if "$unixtests/fvisibility.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
3478
       CFG_REDUCE_EXPORTS=no
3479
    else
3480
       CFG_REDUCE_EXPORTS=yes
3481
    fi
3482
fi
3483
3484
# detect the availability of the -Bsymbolic-functions linker optimization
3485
if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then
3486
    if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
3487
        CFG_REDUCE_RELOCATIONS=no
3488
    else
3489
        CFG_REDUCE_RELOCATIONS=yes
3490
    fi
3491
fi
3492
3493
# auto-detect GNU make support
3494
if [ "$CFG_USE_GNUMAKE" = "auto" ] && "$MAKE" -v | grep "GNU Make" >/dev/null 2>&1; then
3495
   CFG_USE_GNUMAKE=yes
3496
fi
3497
3498
# If -opengl wasn't specified, don't try to auto-detect
3499
if [ "$PLATFORM_QWS" = "yes" ] && [ "$CFG_OPENGL" = "auto" ]; then
3500
        CFG_OPENGL=no
3501
fi
3502
3503
# mac
3504
if [ "$PLATFORM_MAC" = "yes" ] && [ "$XPLATFORM_SYMBIAN" = "no" ]; then
3505
    if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
3506
        CFG_OPENGL=desktop
3507
    fi
3508
fi
3509
3510
# find the default framework value
3511
if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
3512
    if [ "$CFG_FRAMEWORK" = "auto" ]; then
3513
        CFG_FRAMEWORK="$CFG_SHARED"
3514
    elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
3515
	echo
3516
	echo "WARNING: Using static linking will disable the use of Mac frameworks."
3517
	echo
3518
        CFG_FRAMEWORK="no"
3519
    fi
3520
else
3521
    CFG_FRAMEWORK=no
3522
fi
3523
3524
# Print a warning if configure was called with the 10.4u SDK option on Snow Leopard
3525
# with the default mkspec. The 10.4u SDK does not support gcc 4.2.
3526
if [ "$PLATFORM_MAC" = "yes" ] && [ '!' -z "$CFG_SDK" ]; then
3527
    # get the darwin version. 10.0.0 and up means snow leopard.
3528
    VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'`
3529
    if [ "$VERSION" -gt 9 ] && [ "$CFG_SDK" == "/Developer/SDKs/MacOSX10.4u.sdk/" ] && [ "$PLATFORM" == "macx-g++" ]; then
3530
        echo
3531
        echo "WARNING: The 10.4u SDK does not support gcc 4.2. Configure with -platform macx-g++40. "
3532
        echo
3533
    fi
3534
fi
3535
3536
# x11 tests are done after qmake is built
3537
3538
3539
#setup the build parts
3540
if [ -z "$CFG_BUILD_PARTS" ]; then
3541
    CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
3542
3543
    # don't build tools by default when cross-compiling
3544
    if [ "$PLATFORM" != "$XPLATFORM" ]; then
3545
	CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, tools,,g"`
3546
    fi
3547
fi
3548
for nobuild in $CFG_NOBUILD_PARTS; do
3549
    CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, $nobuild,,g"`
3550
done
3551
if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then
3552
#    echo
3553
#    echo "WARNING: libs is a required part of the build."
3554
#    echo
3555
    CFG_BUILD_PARTS="$CFG_BUILD_PARTS libs"
3556
fi
3557
3558
#-------------------------------------------------------------------------------
3559
# post process QT_INSTALL_* variables
3560
#-------------------------------------------------------------------------------
3561
3562
#prefix
3563
if [ -z "$QT_INSTALL_PREFIX" ]; then
3564
    if [ "$CFG_DEV" = "yes" ]; then
3565
        QT_INSTALL_PREFIX="$outpath" # In Development, we use sandboxed builds by default
3566
    elif [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
3567
        if [ "$PLATFORM_QPA" = "yes" ]; then
3568
	QT_INSTALL_PREFIX="/usr/local/Trolltech/QtLighthouse-${QT_VERSION}"
3569
        else
3570
	QT_INSTALL_PREFIX="/usr/local/Trolltech/QtEmbedded-${QT_VERSION}"
3571
        fi
3572
        if [ "$PLATFORM" != "$XPLATFORM" ]; then
3573
            QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}"
3574
        fi
3575
    elif [ -d "$EPOCROOT" ] && [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
3576
        if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
3577
            QT_INSTALL_PREFIX="$EPOCROOT/epoc32/"
3578
            QT_INSTALL_LIBS="$EPOCROOT/epoc32/release/armv5/lib/"
3579
        fi
3580
    else
3581
        QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION
3582
    fi
3583
fi
3584
QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
3585
3586
if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
3587
    [ -z "$QT_HOST_PREFIX" ] && QT_HOST_PREFIX="$QT_INSTALL_PREFIX"
3588
    [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS=
3589
    [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS=
3590
    [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS=
3591
    [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS=
3592
    [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="\\\\resource\\\\qt$QT_LIBINFIX\\\\plugins"
3593
    [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="\\\\resource\\\\qt$QT_LIBINFIX\\\\imports"
3594
    [ -z "$QT_INSTALL_DATA" ] && QT_INSTALL_DATA=
3595
    [ -z "$QT_INSTALL_TRANSLATIONS" ] && QT_INSTALL_TRANSLATIONS="\\\\resource\\\\qt$QT_LIBINFIX\\\\translations"
3596
    [ -z "$QT_INSTALL_SETTINGS" ] && QT_INSTALL_SETTINGS=
3597
    [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES=
3598
    [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS=
3599
elif [ "$XPLATFORM_INTEGRITY" = "yes" ]; then
3600
    [ -z "$QT_HOST_PREFIX" ] && QT_HOST_PREFIX="$QT_INSTALL_PREFIX"
3601
    [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc"
3602
    [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
3603
    [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib"
3604
    [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin"
3605
    [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins"
3606
    [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="$QT_INSTALL_PREFIX/imports"
3607
    [ -z "$QT_INSTALL_DATA" ] && QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
3608
    [ -z "$QT_INSTALL_TRANSLATIONS" ] && QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
3609
    [ -z "$QT_INSTALL_SETTINGS" ] && QT_INSTALL_SETTINGS="$QT_INSTALL_PREFIX"
3610
    [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples"
3611
    [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos"
3612
else
3613
    #docs
3614
    if [ -z "$QT_INSTALL_DOCS" ]; then #default
3615
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3616
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3617
	        QT_INSTALL_DOCS="/Developer/Documentation/Qt"
3618
            fi
3619
        fi
3620
        [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
3621
3622
    fi
3623
    QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
3624
3625
    #headers
3626
    if [ -z "$QT_INSTALL_HEADERS" ]; then #default
3627
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3628
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3629
	        if [ "$CFG_FRAMEWORK" = "yes" ]; then
3630
		    QT_INSTALL_HEADERS=
3631
                fi
3632
            fi
3633
        fi
3634
        [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
3635
3636
    fi
3637
    QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"`
3638
3639
    #libs
3640
    if [ -z "$QT_INSTALL_LIBS" ]; then #default
3641
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3642
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3643
	        if [ "$CFG_FRAMEWORK" = "yes" ]; then
3644
		    QT_INSTALL_LIBS="/Libraries/Frameworks"
3645
                fi
3646
            fi
3647
        fi
3648
        [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback
3649
    fi
3650
    QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
3651
3652
    #bins
3653
    if [ -z "$QT_INSTALL_BINS" ]; then #default
3654
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3655
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3656
	        QT_INSTALL_BINS="/Developer/Applications/Qt"
3657
            fi
3658
        fi
3659
        [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
3660
3661
    fi
3662
    QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
3663
3664
    #plugins
3665
    if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
3666
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3667
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3668
	        QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins"
3669
            fi
3670
        fi
3671
        [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
3672
    fi
3673
    QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
3674
3675
    #imports
3676
    if [ -z "$QT_INSTALL_IMPORTS" ]; then #default
3677
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3678
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3679
	        QT_INSTALL_IMPORTS="/Developer/Applications/Qt/imports"
3680
            fi
3681
        fi
3682
        [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="$QT_INSTALL_PREFIX/imports" #fallback
3683
    fi
3684
    QT_INSTALL_IMPORTS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_IMPORTS"`
3685
3686
    #data
3687
    if [ -z "$QT_INSTALL_DATA" ]; then #default
3688
        QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
3689
    fi
3690
    QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
3691
3692
    #translations
3693
    if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
3694
        QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
3695
    fi
3696
    QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
3697
3698
    #settings
3699
    if [ -z "$QT_INSTALL_SETTINGS" ]; then #default
3700
        if [ "$PLATFORM_MAC" = "yes" ]; then
3701
	    QT_INSTALL_SETTINGS=/Library/Preferences/Qt
3702
        else
3703
	    QT_INSTALL_SETTINGS=/etc/xdg
3704
        fi
3705
    fi
3706
    QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"`
3707
3708
    #examples
3709
    if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default
3710
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3711
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3712
	        QT_INSTALL_EXAMPLES="/Developer/Examples/Qt"
3713
            fi
3714
        fi
3715
        [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback
3716
    fi
3717
    QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"`
3718
3719
    #demos
3720
    if [ -z "$QT_INSTALL_DEMOS" ]; then #default
3721
        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3722
	    if [ "$PLATFORM_MAC" = "yes" ]; then
3723
	        QT_INSTALL_DEMOS="/Developer/Examples/Qt/Demos"
3724
            fi
3725
        fi
3726
        [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos"
3727
    fi
3728
    QT_INSTALL_DEMOS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DEMOS"`
3729
fi
3730
3731
#-------------------------------------------------------------------------------
3732
# help - interactive parts of the script _after_ this section please
3733
#-------------------------------------------------------------------------------
3734
3735
# next, emit a usage message if something failed.
3736
if [ "$OPT_HELP" = "yes" ]; then
3737
    [ "x$ERROR" = "xyes" ] && echo
3738
    if [ "$CFG_NIS" = "no" ]; then
3739
        NSY=" "
3740
        NSN="*"
3741
    else
3742
        NSY="*"
3743
        NSN=" "
3744
    fi
3745
    if [ "$CFG_CUPS" = "no" ]; then
3746
        CUY=" "
3747
        CUN="*"
3748
    else
3749
        CUY="*"
3750
        CUN=" "
3751
    fi
3752
    if [ "$CFG_ICONV" = "no" ]; then
3753
        CIY=" "
3754
        CIN="*"
3755
    else
3756
        CIY="*"
3757
        CIN=" "
3758
    fi
3759
    if [ "$CFG_LARGEFILE" = "no" ]; then
3760
        LFSY=" "
3761
        LFSN="*"
3762
    else
3763
        LFSY="*"
3764
        LFSN=" "
3765
    fi
3766
    if [ "$CFG_STL" = "auto" ] || [ "$CFG_STL" = "yes" ]; then
3767
        SHY="*"
3768
        SHN=" "
3769
    else
3770
        SHY=" "
3771
        SHN="*"
3772
    fi
3773
    if [ "$CFG_IPV6" = "auto" ]; then
3774
        I6Y="*"
3775
        I6N=" "
3776
    fi
3777
    if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then
3778
        PHY=" "
3779
        PHN="*"
3780
    else
3781
        PHY="*"
3782
        PHN=" "
3783
    fi
3784
3785
    cat <<EOF
3786
Usage:  $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
3787
        [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-importdir <dir>] [-datadir <dir>]
3788
        [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>]
3789
        [-demosdir <dir>] [-buildkey <key>] [-release] [-debug]
3790
        [-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
3791
        [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]
3792
        [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>]
3793
        [-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support] [-qt3support]
3794
        [-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
3795
        [-qt-zlib] [-system-zlib] [-no-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff]
3796
        [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng]
3797
        [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>]
3798
        [-nomake <part>] [-R <string>]  [-l <string>] [-no-rpath]  [-rpath] [-continue]
3799
        [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
3800
        [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-gui]
3801
        [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]
3802
        [-no-sse3] [-no-ssse3] [-no-sse4.1] [-no-sse4.2] [-no-avx] [-no-neon]
3803
        [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info] [-armfpa]
3804
        [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns]
3805
        [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend]
3806
        [-no-media-backend] [-media-backend] [-no-audio-backend] [-audio-backend] 
3807
        [-no-openssl] [-openssl] [-openssl-linked]
3808
        [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-webkit-debug]
3809
        [-no-javascript-jit] [-javascript-jit]
3810
        [-no-script] [-script] [-no-scripttools] [-scripttools] 
3811
        [-no-declarative] [-declarative] [-no-declarative-debug] [-declarative-debug]
3812
        [additional platform specific options (see below)]
3813
3814
3815
Installation options:
3816
3817
    -qpa ................ This will enable the QPA build.
3818
                          QPA is a window system agnostic implementation of Qt.
3819
3820
 These are optional, but you may specify install directories.
3821
3822
    -prefix <dir> ...... This will install everything relative to <dir>
3823
                         (default $QT_INSTALL_PREFIX)
3824
EOF
3825
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
3826
cat <<EOF
3827
3828
    -hostprefix [dir] .. Tools and libraries needed when developing
3829
                         applications are installed in [dir]. If [dir] is
3830
                         not given, the current build directory will be used.
3831
EOF
3832
fi
3833
cat <<EOF
3834
3835
  * -prefix-install .... Force a sandboxed "local" installation of
3836
                         Qt. This will install into
3837
                         $QT_INSTALL_PREFIX, if this option is
3838
                         disabled then some platforms will attempt a
3839
                         "system" install by placing default values to
3840
                         be placed in a system location other than
3841
                         PREFIX.
3842
3843
 You may use these to separate different parts of the install:
3844
3845
    -bindir <dir> ......... Executables will be installed to <dir>
3846
                            (default PREFIX/bin)
3847
    -libdir <dir> ......... Libraries will be installed to <dir>
3848
                            (default PREFIX/lib)
3849
    -docdir <dir> ......... Documentation will be installed to <dir>
3850
                            (default PREFIX/doc)
3851
    -headerdir <dir> ...... Headers will be installed to <dir>
3852
                            (default PREFIX/include)
3853
    -plugindir <dir> ...... Plugins will be installed to <dir>
3854
                            (default PREFIX/plugins)
3855
    -importdir <dir> ...... Imports for QML will be installed to <dir>
3856
                            (default PREFIX/imports)
3857
    -datadir <dir> ........ Data used by Qt programs will be installed to <dir>
3858
                            (default PREFIX)
3859
    -translationdir <dir> . Translations of Qt programs will be installed to <dir>
3860
                            (default PREFIX/translations)
3861
    -sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>
3862
                            (default PREFIX/etc/settings)
3863
    -examplesdir <dir> .... Examples will be installed to <dir>
3864
                            (default PREFIX/examples)
3865
    -demosdir <dir> ....... Demos will be installed to <dir>
3866
                            (default PREFIX/demos)
3867
3868
 You may use these options to turn on strict plugin loading.
3869
3870
    -buildkey <key> .... Build the Qt library and plugins using the specified
3871
                         <key>.  When the library loads plugins, it will only
3872
                         load those that have a matching key.
3873
3874
Configure options:
3875
3876
 The defaults (*) are usually acceptable. A plus (+) denotes a default value
3877
 that needs to be evaluated. If the evaluation succeeds, the feature is
3878
 included. Here is a short explanation of each option:
3879
3880
 *  -release ........... Compile and link Qt with debugging turned off.
3881
    -debug ............. Compile and link Qt with debugging turned on.
3882
    -debug-and-release . Compile and link two versions of Qt, with and without
3883
                         debugging turned on (Mac only).
3884
3885
    -developer-build ... Compile and link Qt with Qt developer options (including auto-tests exporting)
3886
3887
    -opensource ........ Compile and link the Open-Source Edition of Qt.
3888
    -commercial ........ Compile and link the Commercial Edition of Qt.
3889
3890
3891
 *  -shared ............ Create and use shared Qt libraries.
3892
    -static ............ Create and use static Qt libraries.
3893
3894
 *  -no-fast ........... Configure Qt normally by generating Makefiles for all
3895
                         project files.
3896
    -fast .............. Configure Qt quickly by generating Makefiles only for
3897
                         library and subdirectory targets.  All other Makefiles
3898
                         are created as wrappers, which will in turn run qmake.
3899
3900
    -no-largefile ...... Disables large file support.
3901
 +  -largefile ......... Enables Qt to access files larger than 4 GB.
3902
3903
EOF
3904
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
3905
    EXCN="*"
3906
    EXCY=" "
3907
else
3908
    EXCN=" "
3909
    EXCY="*"
3910
fi
3911
if [ "$CFG_DBUS" = "no" ]; then
3912
    DBY=" "
3913
    DBN="+"
3914
else
3915
    DBY="+"
3916
    DBN=" "
3917
fi
3918
3919
    cat << EOF
3920
 $EXCN  -no-exceptions ..... Disable exceptions on compilers that support it.
3921
 $EXCY  -exceptions ........ Enable exceptions on compilers that support it.
3922
3923
    -no-accessibility .. Do not compile Accessibility support.
3924
 *  -accessibility ..... Compile Accessibility support.
3925
3926
 $SHN  -no-stl ............ Do not compile STL support.
3927
 $SHY  -stl ............... Compile STL support.
3928
3929
    -no-sql-<driver> ... Disable SQL <driver> entirely.
3930
    -qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default
3931
                         none are turned on.
3932
    -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to
3933
                         at run time.
3934
3935
                         Possible values for <driver>:
3936
                         [ $CFG_SQL_AVAILABLE ]
3937
3938
    -system-sqlite ..... Use sqlite from the operating system.
3939
3940
    -no-qt3support ..... Disables the Qt 3 support functionality.
3941
 *  -qt3support ........ Enables the Qt 3 support functionality.
3942
3943
    -no-xmlpatterns .... Do not build the QtXmlPatterns module.
3944
 +  -xmlpatterns ....... Build the QtXmlPatterns module.
3945
                         QtXmlPatterns is built if a decent C++ compiler
3946
                         is used and exceptions are enabled.
3947
3948
    -no-multimedia ..... Do not build the QtMultimedia module.
3949
 +  -multimedia ........ Build the QtMultimedia module.
3950
3951
    -no-audio-backend .. Do not build the platform audio backend into QtMultimedia.
3952
 +  -audio-backend ..... Build the platform audio backend into QtMultimedia if available.
3953
3954
    -no-phonon ......... Do not build the Phonon module.
3955
 +  -phonon ............ Build the Phonon module.
3956
                         Phonon is built if a decent C++ compiler is used.
3957
    -no-phonon-backend.. Do not build the platform phonon plugin.
3958
 +  -phonon-backend..... Build the platform phonon plugin.
3959
3960
    -no-svg ............ Do not build the SVG module.
3961
 +  -svg ............... Build the SVG module.
3962
3963
    -no-webkit ......... Do not build the WebKit module.
3964
 +  -webkit ............ Build the WebKit module.
3965
                         WebKit is built if a decent C++ compiler is used.
3966
    -webkit-debug ...... Build the WebKit module with debug symbols.
3967
3968
    -no-javascript-jit . Do not build the JavaScriptCore JIT compiler.
3969
 +  -javascript-jit .... Build the JavaScriptCore JIT compiler.
3970
3971
    -no-script ......... Do not build the QtScript module.
3972
 +  -script ............ Build the QtScript module.
3973
3974
    -no-scripttools .... Do not build the QtScriptTools module.
3975
 +  -scripttools ....... Build the QtScriptTools module.
3976
3977
    -no-declarative ..... Do not build the declarative module.
3978
 +  -declarative ....... Build the declarative module.
3979
3980
    -no-declarative-debug ..... Do not build the declarative debugging support.
3981
 +  -declarative-debug ....... Build the declarative debugging support.
3982
3983
    -platform target ... The operating system and compiler you are building
3984
                         on ($PLATFORM).
3985
3986
                         See the README file for a list of supported
3987
                         operating systems and compilers.
3988
EOF
3989
3990
if [ "${PLATFORM_QWS}" != "yes" -a "${PLATFORM_QPA}" != "yes" ]; then
3991
cat << EOF
3992
    -graphicssystem <sys> Sets an alternate graphics system. Available options are:
3993
                           raster - Software rasterizer
3994
                           opengl - Rendering via OpenGL, Experimental!
3995
                           openvg - Rendering via OpenVG, Experimental!
3996
3997
EOF
3998
fi
3999
4000
cat << EOF
4001
4002
    -no-mmx ............ Do not compile with use of MMX instructions.
4003
    -no-3dnow .......... Do not compile with use of 3DNOW instructions.
4004
    -no-sse ............ Do not compile with use of SSE instructions.
4005
    -no-sse2 ........... Do not compile with use of SSE2 instructions.
4006
    -no-sse3 ........... Do not compile with use of SSE3 instructions.
4007
    -no-ssse3 .......... Do not compile with use of SSSE3 instructions.
4008
    -no-sse4.1.......... Do not compile with use of SSE4.1 instructions.
4009
    -no-sse4.2.......... Do not compile with use of SSE4.2 instructions.
4010
    -no-avx ............ Do not compile with use of AVX instructions.
4011
    -no-neon ........... Do not compile with use of NEON instructions.
4012
4013
    -qtnamespace <name>  Wraps all Qt library code in 'namespace <name> {...}'.
4014
    -qtlibinfix <infix>  Renames all libQt*.so to libQt*<infix>.so.
4015
4016
    -D <string> ........ Add an explicit define to the preprocessor.
4017
    -I <string> ........ Add an explicit include path.
4018
    -L <string> ........ Add an explicit library path.
4019
4020
    -help, -h .......... Display this information.
4021
4022
Third Party Libraries:
4023
4024
    -qt-zlib ........... Use the zlib bundled with Qt.
4025
 +  -system-zlib ....... Use zlib from the operating system.
4026
                         See http://www.gzip.org/zlib
4027
4028
    -no-gif ............ Do not compile GIF reading support.
4029
4030
    -no-libtiff ........ Do not compile TIFF support.
4031
    -qt-libtiff ........ Use the libtiff bundled with Qt.
4032
 +  -system-libtiff .... Use libtiff from the operating system.
4033
                         See http://www.libtiff.org
4034
4035
    -no-libpng ......... Do not compile PNG support.
4036
    -qt-libpng ......... Use the libpng bundled with Qt.
4037
 +  -system-libpng ..... Use libpng from the operating system.
4038
                         See http://www.libpng.org/pub/png
4039
4040
    -no-libmng ......... Do not compile MNG support.
4041
    -qt-libmng ......... Use the libmng bundled with Qt.
4042
 +  -system-libmng ..... Use libmng from the operating system.
4043
                         See http://www.libmng.com
4044
4045
    -no-libjpeg ........ Do not compile JPEG support.
4046
    -qt-libjpeg ........ Use the libjpeg bundled with Qt.
4047
 +  -system-libjpeg .... Use libjpeg from the operating system.
4048
                         See http://www.ijg.org
4049
4050
    -no-openssl ........ Do not compile support for OpenSSL.
4051
 +  -openssl ........... Enable run-time OpenSSL support.
4052
    -openssl-linked .... Enabled linked OpenSSL support.
4053
4054
    -ptmalloc .......... Override the system memory allocator with ptmalloc.
4055
                         (Experimental.)
4056
4057
Additional options:
4058
4059
    -make <part> ....... Add part to the list of parts to be built at make time.
4060
                         ($QT_DEFAULT_BUILD_PARTS)
4061
    -nomake <part> ..... Exclude part from the list of parts to be built.
4062
4063
    -R <string> ........ Add an explicit runtime library path to the Qt
4064
                         libraries.
4065
    -l <string> ........ Add an explicit library.
4066
4067
    -no-rpath .......... Do not use the library install path as a runtime
4068
                         library path.
4069
 +  -rpath ............. Link Qt libraries and executables using the library
4070
                         install path as a runtime library path. Equivalent
4071
                         to -R install_libpath
4072
4073
    -continue .......... Continue as far as possible if an error occurs.
4074
4075
    -verbose, -v ....... Print verbose information about each step of the
4076
                         configure process.
4077
4078
    -silent ............ Reduce the build output so that warnings and errors
4079
                         can be seen more easily.
4080
4081
 *  -no-optimized-qmake ... Do not build qmake optimized.
4082
    -optimized-qmake ...... Build qmake optimized.
4083
4084
    -no-gui ............ Don't build the Qt GUI library
4085
4086
 $NSN  -no-nis ............ Do not compile NIS support.
4087
 $NSY  -nis ............... Compile NIS support.
4088
4089
 $CUN  -no-cups ........... Do not compile CUPS support.
4090
 $CUY  -cups .............. Compile CUPS support.
4091
                         Requires cups/cups.h and libcups.so.2.
4092
4093
 $CIN  -no-iconv .......... Do not compile support for iconv(3).
4094
 $CIY  -iconv ............. Compile support for iconv(3).
4095
4096
 $PHN  -no-pch ............ Do not use precompiled header support.
4097
 $PHY  -pch ............... Use precompiled header support.
4098
4099
 $DBN  -no-dbus ........... Do not compile the QtDBus module.
4100
 $DBY  -dbus .............. Compile the QtDBus module and dynamically load libdbus-1.
4101
    -dbus-linked ....... Compile the QtDBus module and link to libdbus-1.
4102
4103
    -reduce-relocations ..... Reduce relocations in the libraries through extra
4104
                              linker optimizations (Qt/X11 and Qt for Embedded Linux only;
4105
                              experimental; needs GNU ld >= 2.18).
4106
EOF
4107
4108
if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
4109
    if [ "$QT_CROSS_COMPILE" = "yes" ]; then
4110
        SBY=""
4111
        SBN="*"
4112
    else
4113
        SBY="*"
4114
        SBN=" "
4115
    fi
4116
elif [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
4117
    SBY="*"
4118
    SBN=" "
4119
else
4120
    SBY=" "
4121
    SBN="*"
4122
fi
4123
4124
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
4125
4126
    cat << EOF
4127
4128
 $SBN  -no-separate-debug-info . Do not store debug information in a separate file.
4129
 $SBY  -separate-debug-info .... Strip debug information into a separate .debug file.
4130
4131
EOF
4132
4133
fi # X11/QWS
4134
4135
if [ "$PLATFORM_X11" = "yes" ]; then
4136
    if [ "$CFG_SM" = "no" ]; then
4137
        SMY=" "
4138
        SMN="*"
4139
    else
4140
        SMY="*"
4141
        SMN=" "
4142
    fi
4143
    if [ "$CFG_XSHAPE" = "no" ]; then
4144
        SHY=" "
4145
        SHN="*"
4146
    else
4147
        SHY="*"
4148
        SHN=" "
4149
    fi
4150
    if [ "$CFG_XVIDEO" = "no" ]; then
4151
        XVY=" "
4152
        XVN="*"
4153
    else
4154
        XVY="*"
4155
        XVN=" "
4156
    fi
4157
    if [ "$CFG_XINERAMA" = "no" ]; then
4158
        XAY=" "
4159
        XAN="*"
4160
    else
4161
        XAY="*"
4162
        XAN=" "
4163
    fi
4164
    if [ "$CFG_FONTCONFIG" = "no" ]; then
4165
        FCGY=" "
4166
        FCGN="*"
4167
    else
4168
        FCGY="*"
4169
        FCGN=" "
4170
    fi
4171
    if [ "$CFG_XCURSOR" = "no" ]; then
4172
        XCY=" "
4173
        XCN="*"
4174
    else
4175
        XCY="*"
4176
        XCN=" "
4177
    fi
4178
    if [ "$CFG_XFIXES" = "no" ]; then
4179
        XFY=" "
4180
        XFN="*"
4181
    else
4182
        XFY="*"
4183
        XFN=" "
4184
    fi
4185
    if [ "$CFG_XRANDR" = "no" ]; then
4186
        XZY=" "
4187
        XZN="*"
4188
    else
4189
        XZY="*"
4190
        XZN=" "
4191
    fi
4192
    if [ "$CFG_XRENDER" = "no" ]; then
4193
        XRY=" "
4194
        XRN="*"
4195
    else
4196
        XRY="*"
4197
        XRN=" "
4198
    fi
4199
    if [ "$CFG_MITSHM" = "no" ]; then
4200
        XMY=" "
4201
        XMN="*"
4202
    else
4203
        XMY="*"
4204
        XMN=" "
4205
    fi
4206
    if [ "$CFG_XINPUT" = "no" ]; then
4207
        XIY=" "
4208
        XIN="*"
4209
    else
4210
        XIY="*"
4211
        XIN=" "
4212
    fi
4213
    if [ "$CFG_XKB" = "no" ]; then
4214
        XKY=" "
4215
        XKN="*"
4216
    else
4217
        XKY="*"
4218
        XKN=" "
4219
    fi
4220
    if [ "$CFG_IM" = "no" ]; then
4221
        IMY=" "
4222
        IMN="*"
4223
    else
4224
        IMY="*"
4225
        IMN=" "
4226
    fi
4227
    cat << EOF
4228
4229
Qt/X11 only:
4230
4231
    -no-gtkstyle ....... Do not build the GTK theme integration.
4232
 +  -gtkstyle .......... Build the GTK theme integration.
4233
4234
 *  -no-nas-sound ...... Do not compile in NAS sound support.
4235
    -system-nas-sound .. Use NAS libaudio from the operating system.
4236
                         See http://radscan.com/nas.html
4237
4238
    -egl ............... Use EGL instead of GLX to manage contexts.
4239
                         When building for desktop OpenGL, this option will
4240
                         make Qt use EGL to manage contexts rather than the
4241
                         GLX, which is the default. Note: For OpenGL ES, EGL
4242
                         is always used.
4243
4244
    -no-opengl ......... Do not support OpenGL.
4245
 +  -opengl <api> ...... Enable OpenGL support.
4246
                         With no parameter, this will auto-detect the "best"
4247
                         OpenGL API to use. If desktop OpenGL is available, it
4248
                         will be used. Use desktop, es1, or es2 for <api>
4249
                         to force the use of the Desktop (OpenGL 1.x or 2.x),
4250
                         OpenGL ES 1.x Common profile, or 2.x APIs instead.
4251
4252
     -no-openvg ........ Do not support OpenVG.
4253
 +   -openvg ........... Enable OpenVG support.
4254
                         Requires EGL support, typically supplied by an OpenGL
4255
                         or other graphics implementation.
4256
4257
 $SMN  -no-sm ............. Do not support X Session Management.
4258
 $SMY  -sm ................ Support X Session Management, links in -lSM -lICE.
4259
4260
 $SHN  -no-xshape ......... Do not compile XShape support.
4261
 $SHY  -xshape ............ Compile XShape support.
4262
                         Requires X11/extensions/shape.h.
4263
4264
 $XVN  -no-xvideo ......... Do not compile XVideo support.
4265
 $XVY  -xvideo ............ Compile XVideo support.
4266
                         Requires X11/extensions/Xv.h & Xvlib.h.
4267
4268
 $SHN  -no-xsync .......... Do not compile XSync support.
4269
 $SHY  -xsync ............. Compile XSync support.
4270
                         Requires X11/extensions/sync.h.
4271
4272
 $XAN  -no-xinerama ....... Do not compile Xinerama (multihead) support.
4273
 $XAY  -xinerama .......... Compile Xinerama support.
4274
                         Requires X11/extensions/Xinerama.h and libXinerama.
4275
			 By default, Xinerama support will be compiled if
4276
                         available and the shared libraries are dynamically
4277
                         loaded at runtime.
4278
4279
 $XCN  -no-xcursor ........ Do not compile Xcursor support.
4280
 $XCY  -xcursor ........... Compile Xcursor support.
4281
                         Requires X11/Xcursor/Xcursor.h and libXcursor.
4282
			 By default, Xcursor support will be compiled if
4283
                         available and the shared libraries are dynamically
4284
                         loaded at runtime.
4285
4286
 $XFN  -no-xfixes ......... Do not compile Xfixes support.
4287
 $XFY  -xfixes ............ Compile Xfixes support.
4288
                         Requires X11/extensions/Xfixes.h and libXfixes.
4289
			 By default, Xfixes support will be compiled if
4290
                         available and the shared libraries are dynamically
4291
                         loaded at runtime.
4292
4293
 $XZN  -no-xrandr ......... Do not compile Xrandr (resize and rotate) support.
4294
 $XZY  -xrandr ............ Compile Xrandr support.
4295
                         Requires X11/extensions/Xrandr.h and libXrandr.
4296
4297
 $XRN  -no-xrender ........ Do not compile Xrender support.
4298
 $XRY  -xrender ........... Compile Xrender support.
4299
                         Requires X11/extensions/Xrender.h and libXrender.
4300
4301
 $XMN  -no-mitshm ......... Do not compile MIT-SHM support.
4302
 $XMY  -mitshm ............ Compile MIT-SHM support.
4303
                         Requires sys/ipc.h, sys/shm.h and X11/extensions/XShm.h
4304
4305
 $FCGN  -no-fontconfig ..... Do not compile FontConfig (anti-aliased font) support.
4306
 $FCGY  -fontconfig ........ Compile FontConfig support.
4307
                         Requires fontconfig/fontconfig.h, libfontconfig,
4308
                         freetype.h and libfreetype.
4309
4310
 $XIN  -no-xinput ......... Do not compile Xinput support.
4311
 $XIY  -xinput ............ Compile Xinput support. This also enabled tablet support
4312
                         which requires IRIX with wacom.h and libXi or
4313
                         XFree86 with X11/extensions/XInput.h and libXi.
4314
4315
 $XKN  -no-xkb ............ Do not compile XKB (X KeyBoard extension) support.
4316
 $XKY  -xkb ............... Compile XKB support.
4317
4318
EOF
4319
fi
4320
4321
if [ "$PLATFORM_MAC" = "yes" ]; then
4322
    cat << EOF
4323
4324
Qt/Mac only:
4325
4326
    -Fstring ........... Add an explicit framework path.
4327
    -fw string ......... Add an explicit framework.
4328
4329
    -cocoa ............. [Deprecated] Cocoa is now enabled by default.
4330
4331
    -carbon .............Build the Carbon version of Qt. 64-bit archs
4332
                         are not supported by carbon and will be built
4333
                         with cocoa
4334
4335
 *  -framework ......... Build Qt as a series of frameworks and
4336
                         link tools against those frameworks.
4337
    -no-framework ...... Do not build Qt as a series of frameworks.
4338
4339
 *  -dwarf2 ............ Enable dwarf2 debugging symbols.
4340
    -no-dwarf2 ......... Disable dwarf2 debugging symbols.
4341
4342
    -universal ......... Equivalent to -arch "ppc x86"
4343
4344
    -arch <arch> ....... Build Qt for <arch>
4345
                         Example values for <arch>: x86 ppc x86_64 ppc64
4346
                         Multiple -arch arguments can be specified.
4347
4348
    -sdk <sdk> ......... Build Qt using Apple provided SDK <sdk>. This option requires gcc 4.
4349
                         To use a different SDK with gcc 3.3, set the SDKROOT environment variable.
4350
4351
    -harfbuzz .......... Use HarfBuzz to do text layout instead of Core Text when possible.
4352
                         It is only available to Cocoa builds.
4353
 *  -no-harfbuzz ....... Disable HarfBuzz on Mac. It can still be enabled by setting
4354
                         QT_ENABLE_HARFBUZZ environment variable.
4355
4356
EOF
4357
fi
4358
4359
if [ "$PLATFORM_QWS" = "yes" ]; then
4360
    cat << EOF
4361
Qt for Embedded Linux:
4362
4363
    -embedded <arch> .... This will enable the embedded build, you must have a
4364
                          proper license for this switch to work.
4365
                          Example values for <arch>: arm mips x86 generic
4366
EOF
4367
fi
4368
4369
if [ "$PLATFORM_QPA" = "yes" ]; then
4370
    cat << EOF
4371
Qt for QPA only:
4372
EOF
4373
fi
4374
4375
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
4376
    cat << EOF
4377
4378
    -xplatform target ... The target platform when cross-compiling.
4379
4380
    -no-feature-<feature> Do not compile in <feature>.
4381
    -feature-<feature> .. Compile in <feature>. The available features
4382
                          are described in src/corelib/global/qfeatures.txt
4383
4384
    -armfpa ............. Target platform uses the ARM-FPA floating point format.
4385
    -no-armfpa .......... Target platform does not use the ARM-FPA floating point format.
4386
4387
                          The floating point format is usually autodetected by configure. Use this
4388
                          to override the detected value.
4389
4390
    -little-endian ...... Target platform is little endian (LSB first).
4391
    -big-endian ......... Target platform is big endian (MSB first).
4392
4393
    -host-little-endian . Host platform is little endian (LSB first).
4394
    -host-big-endian .... Host platform is big endian (MSB first).
4395
4396
                          You only need to specify the endianness when
4397
                          cross-compiling, otherwise the host
4398
                          endianness will be used.
4399
4400
    -no-freetype ........ Do not compile in Freetype2 support.
4401
    -qt-freetype ........ Use the libfreetype bundled with Qt.
4402
 *  -system-freetype .... Use libfreetype from the operating system.
4403
                          See http://www.freetype.org/
4404
4405
    -qconfig local ...... Use src/corelib/global/qconfig-local.h rather than the
4406
                          default ($CFG_QCONFIG).
4407
4408
    -no-opengl .......... Do not support OpenGL.
4409
    -opengl <api> ....... Enable OpenGL ES support
4410
                          With no parameter, this will attempt to auto-detect OpenGL ES 1.x
4411
                          or 2.x, or regular desktop OpenGL.
4412
                          Use es1 or es2 for <api> to override auto-detection.
4413
EOF
4414
fi
4415
4416
if [ "$PLATFORM_QWS" = "yes" ]; then
4417
    cat << EOF
4418
4419
    -depths <list> ...... Comma-separated list of supported bit-per-pixel
4420
                          depths, from: 1, 4, 8, 12, 15, 16, 18, 24, 32 and 'all'.
4421
4422
    -qt-decoration-<style> ....Enable a decoration <style> in the QtGui library,
4423
                               by default all available decorations are on.
4424
			       Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
4425
    -plugin-decoration-<style> Enable decoration <style> as a plugin to be
4426
                               linked to at run time.
4427
			       Possible values for <style>: [ $CFG_DECORATION_PLUGIN_AVAILABLE ]
4428
    -no-decoration-<style> ....Disable decoration <style> entirely.
4429
                               Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
4430
4431
    -qt-gfx-<driver> ... Enable a graphics <driver> in the QtGui library.
4432
                         Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
4433
    -plugin-gfx-<driver> Enable graphics <driver> as a plugin to be
4434
                         linked to at run time.
4435
                         Possible values for <driver>: [ $CFG_GFX_PLUGIN_AVAILABLE ]
4436
    -no-gfx-<driver> ... Disable graphics <driver> entirely.
4437
                         Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
4438
4439
    -qt-kbd-<driver> ... Enable a keyboard <driver> in the QtGui library.
4440
                         Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
4441
4442
    -plugin-kbd-<driver> Enable keyboard <driver> as a plugin to be linked to
4443
                         at runtime.
4444
                         Possible values for <driver>: [ $CFG_KBD_PLUGIN_AVAILABLE ]
4445
4446
    -no-kbd-<driver> ... Disable keyboard <driver> entirely.
4447
                         Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
4448
4449
    -qt-mouse-<driver> ... Enable a mouse <driver> in the QtGui library.
4450
                           Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
4451
    -plugin-mouse-<driver> Enable mouse <driver> as a plugin to be linked to
4452
                           at runtime.
4453
                           Possible values for <driver>: [ $CFG_MOUSE_PLUGIN_AVAILABLE ]
4454
    -no-mouse-<driver> ... Disable mouse <driver> entirely.
4455
                           Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
4456
4457
    -iwmmxt ............ Compile using the iWMMXt instruction set
4458
                         (available on some XScale CPUs).
4459
EOF
4460
fi
4461
4462
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
4463
    if [ "$CFG_GLIB" = "no" ]; then
4464
        GBY=" "
4465
        GBN="+"
4466
    else
4467
        GBY="+"
4468
        GBN=" "
4469
    fi
4470
    cat << EOF
4471
 $GBN  -no-glib ........... Do not compile Glib support.
4472
 $GBY  -glib .............. Compile Glib support.
4473
4474
EOF
4475
fi
4476
4477
if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
4478
    cat << EOF
4479
4480
Qt for Symbian only:
4481
    -no-s60 ............ Do not compile in S60 support.
4482
 +  -s60 ............... Compile with support for the S60 UI Framework.
4483
    -no-style-s60....... Disable s60 style
4484
 +  -qt-style-s60....... Enable s60 style in the Qt Library
4485
4486
    -no-usedeffiles .... Disable the usage of DEF files.
4487
 *  -usedeffiles ....... Enable the usage of DEF files.
4488
EOF
4489
fi
4490
   [ "x$ERROR" = "xyes" ] && exit 1
4491
   exit 0
4492
fi # Help
4493
4494
4495
# -----------------------------------------------------------------------------
4496
# LICENSING, INTERACTIVE PART
4497
# -----------------------------------------------------------------------------
4498
4499
if [ "$PLATFORM_QWS" = "yes" ]; then
4500
    Platform="Qt for Embedded Linux"
4501
elif [ "$PLATFORM_QPA" = "yes" ]; then
4502
    Platform="Qt Lighthouse"
4503
elif [ "$XPLATFORM_INTEGRITY" = "yes" ]; then
4504
    Platform="Qt for INTEGRITY"
4505
elif [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
4506
    Platform="Qt for Symbian"
4507
elif [ "$PLATFORM_MAC" = "yes" ]; then
4508
    Platform="Qt for Mac OS X"
4509
elif [ "$XPLATFORM_MINGW" = "yes" ]; then
4510
    Platform="Qt for Windows"
4511
elif [ -n "`getXQMakeConf grep QMAKE_LIBS_X11`" ]; then
4512
    PLATFORM_X11=yes
4513
    Platform="Qt for Linux/X11"
4514
fi
4515
4516
echo
4517
echo "This is the $Platform ${EditionString} Edition."
4518
echo
4519
4520
if [ "$Edition" = "NokiaInternalBuild" ]; then
4521
    echo "Detected -nokia-developer option"
4522
    echo "Nokia employees and agents are allowed to use this software under"
4523
    echo "the authority of Nokia Corporation and/or its subsidiary(-ies)"
4524
elif [ "$Edition" = "OpenSource" ]; then
4525
    while true; do
4526
        echo "You are licensed to use this software under the terms of"
4527
        echo "the Lesser GNU General Public License (LGPL) versions 2.1."
4528
        if [ -f "$relpath/LICENSE.GPL3" ]; then
4529
            echo "You are also licensed to use this software under the terms of"
4530
            echo "the GNU General Public License (GPL) versions 3."
4531
            affix="either"
4532
        else
4533
            affix="the"
4534
        fi
4535
        echo
4536
        if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
4537
            echo "You have already accepted the terms of the $LicenseType license."
4538
            acceptance=yes
4539
        else
4540
            if [ -f "$relpath/LICENSE.GPL3" ]; then
4541
                echo "Type '3' to view the GNU General Public License version 3."
4542
            fi
4543
            echo "Type 'L' to view the Lesser GNU General Public License version 2.1."
4544
            echo "Type 'yes' to accept this license offer."
4545
            echo "Type 'no' to decline this license offer."
4546
            echo
4547
            echo $ECHO_N "Do you accept the terms of $affix license? $ECHO_C"
4548
            read acceptance
4549
        fi
4550
        echo
4551
        if [ "$acceptance" = "yes" ] || [ "$acceptance" = "y" ]; then
4552
            break
4553
        elif [ "$acceptance" = "no" ]; then
4554
            echo "You are not licensed to use this software."
4555
            echo
4556
            exit 1
4557
        elif [ "$acceptance" = "3" ]; then
4558
            more "$relpath/LICENSE.GPL3"
4559
        elif [ "$acceptance" = "L" ]; then
4560
            more "$relpath/LICENSE.LGPL"
4561
        fi
4562
    done
4563
elif [ "$Edition" = "Preview" ]; then
4564
    TheLicense=`head -n 1 "$relpath/LICENSE.PREVIEW.COMMERCIAL"`
4565
    while true; do
4566
4567
        if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
4568
            echo "You have already accepted the terms of the $LicenseType license."
4569
            acceptance=yes
4570
        else
4571
            echo "You are licensed to use this software under the terms of"
4572
            echo "the $TheLicense"
4573
            echo
4574
            echo "Type '?' to read the Preview License."
4575
            echo "Type 'yes' to accept this license offer."
4576
            echo "Type 'no' to decline this license offer."
4577
            echo
4578
            echo $ECHO_N "Do you accept the terms of the license? $ECHO_C"
4579
            read acceptance
4580
        fi
4581
        echo
4582
        if [ "$acceptance" = "yes" ]; then
4583
            break
4584
        elif [ "$acceptance" = "no" ] ;then
4585
            echo "You are not licensed to use this software."
4586
            echo
4587
            exit 0
4588
        elif [ "$acceptance" = "?" ]; then
4589
            more "$relpath/LICENSE.PREVIEW.COMMERCIAL"
4590
        fi
4591
    done
4592
elif [ "$Edition" != "OpenSource" ]; then
4593
    if [ -n "$ExpiryDate" ]; then
4594
        ExpiryDate=`echo $ExpiryDate | sed -e "s,-,,g" | tr -d "\n\r"`
4595
        [ -z "$ExpiryDate" ] && ExpiryDate="0"
4596
        Today=`date +%Y%m%d`
4597
        if [ "$Today" -gt "$ExpiryDate" ]; then
4598
            case "$LicenseType" in
4599
            Commercial|Academic|Educational)
4600
                if [ "$QT_PACKAGEDATE" -gt "$ExpiryDate" ]; then
4601
                    echo
4602
                    echo "NOTICE  NOTICE  NOTICE  NOTICE"
4603
                    echo
4604
                    echo "  Your support and upgrade period has expired."
4605
                    echo
4606
                    echo "  You are no longer licensed to use this version of Qt."
4607
                    echo "  Please contact qt-info@nokia.com to renew your support"
4608
                    echo "  and upgrades for this license."
4609
                    echo
4610
                    echo "NOTICE  NOTICE  NOTICE  NOTICE"
4611
                    echo
4612
                    exit 1
4613
                else
4614
                    echo
4615
                    echo "WARNING  WARNING  WARNING  WARNING"
4616
                    echo
4617
                    echo "  Your support and upgrade period has expired."
4618
                    echo
4619
                    echo "  You may continue to use your last licensed release"
4620
                    echo "  of Qt under the terms of your existing license"
4621
                    echo "  agreement. But you are not entitled to technical"
4622
                    echo "  support, nor are you entitled to use any more recent"
4623
                    echo "  Qt releases."
4624
                    echo
4625
                    echo "  Please contact qt-info@nokia.com to renew your"
4626
                    echo "  support and upgrades for this license."
4627
                    echo
4628
                    echo "WARNING  WARNING  WARNING  WARNING"
4629
                    echo
4630
                    sleep 3
4631
                fi
4632
                ;;
4633
            Evaluation|*)
4634
                echo
4635
                echo "NOTICE  NOTICE  NOTICE  NOTICE"
4636
                echo
4637
                echo "  Your Evaluation license has expired."
4638
                echo
4639
                echo "  You are no longer licensed to use this software. Please"
4640
                echo "  contact qt-info@nokia.com to purchase license, or install"
4641
                echo "  the Qt Open Source Edition if you intend to develop free"
4642
                echo "  software."
4643
                echo
4644
                echo "NOTICE  NOTICE  NOTICE  NOTICE"
4645
                echo
4646
                exit 1
4647
                ;;
4648
            esac
4649
        fi
4650
    fi
4651
    TheLicense=`head -n 1 "$outpath/LICENSE"`
4652
    while true; do
4653
        if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
4654
	    echo "You have already accepted the terms of the $TheLicense."
4655
            acceptance=yes
4656
        else
4657
            echo "You are licensed to use this software under the terms of"
4658
            echo "the $TheLicense."
4659
            echo
4660
            echo "Type '?' to view the $TheLicense."
4661
            echo "Type 'yes' to accept this license offer."
4662
            echo "Type 'no' to decline this license offer."
4663
            echo
4664
            echo $ECHO_N "Do you accept the terms of the $TheLicense? $ECHO_C"
4665
            read acceptance
4666
        fi
4667
        echo
4668
        if [ "$acceptance" = "yes" ]; then
4669
            break
4670
        elif [ "$acceptance" = "no" ]; then
4671
            echo "You are not licensed to use this software."
4672
            echo
4673
            exit 1
4674
        else [ "$acceptance" = "?" ]
4675
            more "$outpath/LICENSE"
4676
        fi
4677
    done
4678
fi
4679
4680
# this should be moved somewhere else
4681
case "$PLATFORM" in
4682
aix-*)
4683
    AIX_VERSION=`uname -v`
4684
    if [ "$AIX_VERSION" -lt "5" ]; then
4685
	QMakeVar add QMAKE_LIBS_X11 -lbind
4686
    fi
4687
    ;;
4688
*)
4689
    ;;
4690
esac
4691
4692
#-------------------------------------------------------------------------------
4693
# generate qconfig.cpp
4694
#-------------------------------------------------------------------------------
4695
[ -d "$outpath/src/corelib/global" ] || mkdir -p "$outpath/src/corelib/global"
4696
4697
LICENSE_USER_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_lcnsuser=$Licensee"`
4698
LICENSE_PRODUCTS_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_lcnsprod=$Edition"`
4699
PREFIX_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_prfxpath=$QT_INSTALL_PREFIX"`
4700
DOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_INSTALL_DOCS"`
4701
HEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_INSTALL_HEADERS"`
4702
LIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_INSTALL_LIBS"`
4703
BINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_INSTALL_BINS"`
4704
PLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_INSTALL_PLUGINS"`
4705
IMPORTS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_impspath=$QT_INSTALL_IMPORTS"`
4706
DATA_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_datapath=$QT_INSTALL_DATA"`
4707
TRANSLATIONS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_trnspath=$QT_INSTALL_TRANSLATIONS"`
4708
SETTINGS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_stngpath=$QT_INSTALL_SETTINGS"`
4709
EXAMPLES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_xmplpath=$QT_INSTALL_EXAMPLES"`
4710
DEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INSTALL_DEMOS"`
4711
4712
TODAY=`date +%Y-%m-%d`
4713
cat > "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
4714
/* License Info */
4715
static const char qt_configure_licensee_str          [256 + 12] = "$LICENSE_USER_STR";
4716
static const char qt_configure_licensed_products_str [256 + 12] = "$LICENSE_PRODUCTS_STR";
4717
4718
/* Installation date */
4719
static const char qt_configure_installation          [12+11]    = "qt_instdate=$TODAY";
4720
EOF
4721
4722
4723
if [ ! -z "$QT_HOST_PREFIX" ]; then
4724
    HOSTPREFIX_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_prfxpath=$QT_HOST_PREFIX"`
4725
    HOSTDOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_HOST_PREFIX/doc"`
4726
    HOSTHEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_HOST_PREFIX/include"`
4727
    HOSTLIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_HOST_PREFIX/lib"`
4728
    HOSTBINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_HOST_PREFIX/bin"`
4729
    HOSTPLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_HOST_PREFIX/plugins"`
4730
    HOSTIMPORTS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_impspath=$QT_HOST_PREFIX/IMPORTS"`
4731
    HOSTDATA_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_datapath=$QT_HOST_PREFIX"`
4732
    HOSTTRANSLATIONS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_trnspath=$QT_HOST_PREFIX/translations"`
4733
    HOSTSETTINGS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_stngpath=$QT_INSTALL_SETTINGS"`
4734
    HOSTEXAMPLES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_xmplpath=$QT_INSTALL_EXAMPLES"`
4735
    HOSTDEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INSTALL_DEMOS"`
4736
4737
    cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
4738
4739
#if defined(QT_BOOTSTRAPPED) || defined(QT_BUILD_QMAKE)
4740
/* Installation Info */
4741
static const char qt_configure_prefix_path_str       [256 + 12] = "$HOSTPREFIX_PATH_STR";
4742
static const char qt_configure_documentation_path_str[256 + 12] = "$HOSTDOCUMENTATION_PATH_STR";
4743
static const char qt_configure_headers_path_str      [256 + 12] = "$HOSTHEADERS_PATH_STR";
4744
static const char qt_configure_libraries_path_str    [256 + 12] = "$HOSTLIBRARIES_PATH_STR";
4745
static const char qt_configure_binaries_path_str     [256 + 12] = "$HOSTBINARIES_PATH_STR";
4746
static const char qt_configure_plugins_path_str      [256 + 12] = "$HOSTPLUGINS_PATH_STR";
4747
static const char qt_configure_imports_path_str      [256 + 12] = "$HOSTIMPORTS_PATH_STR";
4748
static const char qt_configure_data_path_str         [256 + 12] = "$HOSTDATA_PATH_STR";
4749
static const char qt_configure_translations_path_str [256 + 12] = "$HOSTTRANSLATIONS_PATH_STR";
4750
static const char qt_configure_settings_path_str     [256 + 12] = "$HOSTSETTINGS_PATH_STR";
4751
static const char qt_configure_examples_path_str     [256 + 12] = "$HOSTEXAMPLES_PATH_STR";
4752
static const char qt_configure_demos_path_str        [256 + 12] = "$HOSTDEMOS_PATH_STR";
4753
#else // QT_BOOTSTRAPPED
4754
EOF
4755
fi
4756
4757
cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
4758
/* Installation Info */
4759
static const char qt_configure_prefix_path_str       [256 + 12] = "$PREFIX_PATH_STR";
4760
static const char qt_configure_documentation_path_str[256 + 12] = "$DOCUMENTATION_PATH_STR";
4761
static const char qt_configure_headers_path_str      [256 + 12] = "$HEADERS_PATH_STR";
4762
static const char qt_configure_libraries_path_str    [256 + 12] = "$LIBRARIES_PATH_STR";
4763
static const char qt_configure_binaries_path_str     [256 + 12] = "$BINARIES_PATH_STR";
4764
static const char qt_configure_plugins_path_str      [256 + 12] = "$PLUGINS_PATH_STR";
4765
static const char qt_configure_imports_path_str      [256 + 12] = "$IMPORTS_PATH_STR";
4766
static const char qt_configure_data_path_str         [256 + 12] = "$DATA_PATH_STR";
4767
static const char qt_configure_translations_path_str [256 + 12] = "$TRANSLATIONS_PATH_STR";
4768
static const char qt_configure_settings_path_str     [256 + 12] = "$SETTINGS_PATH_STR";
4769
static const char qt_configure_examples_path_str     [256 + 12] = "$EXAMPLES_PATH_STR";
4770
static const char qt_configure_demos_path_str        [256 + 12] = "$DEMOS_PATH_STR";
4771
EOF
4772
4773
if [ ! -z "$QT_HOST_PREFIX" ]; then
4774
    cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
4775
#endif // QT_BOOTSTRAPPED
4776
4777
EOF
4778
fi
4779
4780
cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
4781
/* strlen( "qt_lcnsxxxx" ) == 12 */
4782
#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;
4783
#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;
4784
#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12;
4785
#define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;
4786
#define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;
4787
#define QT_CONFIGURE_LIBRARIES_PATH qt_configure_libraries_path_str + 12;
4788
#define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12;
4789
#define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;
4790
#define QT_CONFIGURE_IMPORTS_PATH qt_configure_imports_path_str + 12;
4791
#define QT_CONFIGURE_DATA_PATH qt_configure_data_path_str + 12;
4792
#define QT_CONFIGURE_TRANSLATIONS_PATH qt_configure_translations_path_str + 12;
4793
#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;
4794
#define QT_CONFIGURE_EXAMPLES_PATH qt_configure_examples_path_str + 12;
4795
#define QT_CONFIGURE_DEMOS_PATH qt_configure_demos_path_str + 12;
4796
EOF
4797
4798
# avoid unecessary rebuilds by copying only if qconfig.cpp has changed
4799
if cmp -s "$outpath/src/corelib/global/qconfig.cpp" "$outpath/src/corelib/global/qconfig.cpp.new"; then
4800
    rm -f "$outpath/src/corelib/global/qconfig.cpp.new"
4801
else
4802
    [ -f "$outpath/src/corelib/global/qconfig.cpp" ] && chmod +w "$outpath/src/corelib/global/qconfig.cpp"
4803
    mv "$outpath/src/corelib/global/qconfig.cpp.new" "$outpath/src/corelib/global/qconfig.cpp"
4804
    chmod -w "$outpath/src/corelib/global/qconfig.cpp"
4805
fi
4806
4807
# -----------------------------------------------------------------------------
4808
if [ "$LicenseType" = "Evaluation" ]; then
4809
    EVALKEY=`"$relpath/config.tests/unix/padstring" 524 "qt_qevalkey=$LicenseKeyExt"`
4810
elif echo "$D_FLAGS" | grep QT_EVAL >/dev/null 2>&1; then
4811
    EVALKEY=`"$relpath/config.tests/unix/padstring" 524 "qt_qevalkey="`
4812
fi
4813
4814
if [ -n "$EVALKEY" ]; then
4815
    rm -f "$outpath/src/corelib/global/qconfig_eval.cpp"
4816
    cat > "$outpath/src/corelib/global/qconfig_eval.cpp" <<EOF
4817
/* Evaluation license key */
4818
static const volatile char qt_eval_key_data                   [512 + 12] = "$EVALKEY";
4819
EOF
4820
    chmod -w "$outpath/src/corelib/global/qconfig_eval.cpp"
4821
fi
4822
4823
4824
# -----------------------------------------------------------------------------
4825
# build qmake
4826
# -----------------------------------------------------------------------------
4827
4828
# symlink includes
4829
if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt" ]; then
4830
    SYNCQT_OPTS=
4831
    [ "$CFG_DEV" = "yes" ] && SYNCQT_OPTS="$SYNCQT_OPTS -check-includes"
4832
    if [ "$OPT_SHADOW" = "yes" ]; then
4833
        "$outpath/bin/syncqt" $SYNCQT_OPTS || exit 1
4834
    elif [ "$CFG_DEV" = "yes" ] || [ ! -d $relpath/include ] || [ -d $relpath/.git ]; then
4835
        QTDIR="$relpath" perl "$outpath/bin/syncqt" $SYNCQT_OPTS || exit 1
4836
    fi
4837
fi
4838
4839
# $1: input variable name (awk regexp)
4840
# $2: optional output variable name
4841
# $3: optional value transformation (sed command)
4842
# relies on $QMAKESPEC, $COMPILER_CONF and $mkfile being set correctly, as the latter
4843
# is where the resulting variable is written to
4844
setBootstrapVariable()
4845
{
4846
    getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
4847
}
4848
4849
# build qmake
4850
if true; then ###[ '!' -f "$outpath/bin/qmake" ];
4851
    echo "Creating qmake. Please wait..."
4852
4853
    OLD_QCONFIG_H=
4854
    QCONFIG_H="$outpath/src/corelib/global/qconfig.h"
4855
    QMAKE_QCONFIG_H="${QCONFIG_H}.qmake"
4856
    if [ -f "$QCONFIG_H" ]; then
4857
         OLD_QCONFIG_H=$QCONFIG_H
4858
         mv -f "$OLD_QCONFIG_H" "${OLD_QCONFIG_H}.old"
4859
    fi
4860
4861
    # create temporary qconfig.h for compiling qmake, if it doesn't exist
4862
    # when building qmake, we use #defines for the install paths,
4863
    # however they are real functions in the library
4864
    if [ '!' -f "$QMAKE_QCONFIG_H" ]; then
4865
        mkdir -p "$outpath/src/corelib/global"
4866
        [ -f "$QCONFIG_H" ] && chmod +w "$QCONFIG_H"
4867
        echo "/* All features enabled while building qmake */" >"$QMAKE_QCONFIG_H"
4868
    fi
4869
4870
    mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
4871
4872
    #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
4873
    rm -rf mkspecs/default
4874
    ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
4875
    # fix makefiles
4876
    for mkfile in GNUmakefile Makefile; do
4877
        EXTRA_LFLAGS=
4878
        EXTRA_CFLAGS=
4879
        in_mkfile="${mkfile}.in"
4880
        if [ "$mkfile" = "Makefile" ]; then
4881
#           if which qmake >/dev/null 2>&1 && [ -f qmake/qmake.pro ]; then
4882
#               (cd qmake && qmake) >/dev/null 2>&1 && continue
4883
#           fi
4884
            in_mkfile="${mkfile}.unix"
4885
        fi
4886
        in_mkfile="$relpath/qmake/$in_mkfile"
4887
        mkfile="$outpath/qmake/$mkfile"
4888
        if [ -f "$mkfile" ]; then
4889
            [ "$CFG_DEV" = "yes" ] && "$WHICH" chflags >/dev/null 2>&1 && chflags nouchg "$mkfile"
4890
            rm -f "$mkfile"
4891
        fi
4892
        [ -f "$in_mkfile" ] || continue
4893
4894
        echo "########################################################################" > "$mkfile"
4895
        echo "## This file was autogenerated by configure, all changes will be lost ##" >> "$mkfile"
4896
        echo "########################################################################" >> "$mkfile"
4897
        EXTRA_OBJS=
4898
        EXTRA_SRCS=
4899
        EXTRA_CFLAGS="\$(QMAKE_CFLAGS)"
4900
        EXTRA_CXXFLAGS="\$(QMAKE_CXXFLAGS)"
4901
        EXTRA_LFLAGS="\$(QMAKE_LFLAGS)"
4902
4903
        if [ "$PLATFORM" = "irix-cc" ] || [ "$PLATFORM" = "irix-cc-64" ]; then
4904
	    EXTRA_LFLAGS="$EXTRA_LFLAGS -lm"
4905
        fi
4906
4907
	[ -n "$CC" ] && echo "CC = $CC" >> "$mkfile"
4908
	[ -n "$CXX" ] && echo "CXX = $CXX" >> "$mkfile"
4909
        [ "$CFG_SILENT" = "yes" ] && CC_TRANSFORM='s,^,\@,' || CC_TRANSFORM=
4910
        [ -z "$CC" ] && setBootstrapVariable QMAKE_CC CC "$CC_TRANSFORM"
4911
        [ -z "$CXX" ] && setBootstrapVariable QMAKE_CXX CXX "$CC_TRANSFORM"
4912
        setBootstrapVariable QMAKE_CFLAGS
4913
        setBootstrapVariable QMAKE_CXXFLAGS
4914
        setBootstrapVariable QMAKE_LFLAGS
4915
4916
        if [ $QT_EDITION = "QT_EDITION_OPENSOURCE" ]; then
4917
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DQMAKE_OPENSOURCE_EDITION"
4918
            EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -DQMAKE_OPENSOURCE_EDITION"
4919
        fi
4920
        if [ "$CFG_RELEASE_QMAKE" = "yes" ]; then
4921
            setBootstrapVariable QMAKE_CFLAGS_RELEASE
4922
            setBootstrapVariable QMAKE_CXXFLAGS_RELEASE
4923
            EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
4924
            EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_RELEASE)"
4925
        elif [ "$CFG_DEBUG" = "yes" ]; then
4926
            setBootstrapVariable QMAKE_CFLAGS_DEBUG
4927
            setBootstrapVariable QMAKE_CXXFLAGS_DEBUG
4928
            EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_DEBUG)"
4929
            EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_DEBUG)"
4930
        fi
4931
4932
        if [ -n "$RPATH_FLAGS" ] && [ -n "`getQMakeConf 'QMAKE_(LFLAGS_)?RPATH'`" ]; then
4933
            setBootstrapVariable "QMAKE_(LFLAGS_)?RPATH" QMAKE_LFLAGS_RPATH
4934
            for rpath in $RPATH_FLAGS; do
4935
                EXTRA_LFLAGS="\$(QMAKE_LFLAGS_RPATH)\"$rpath\" $EXTRA_LFLAGS"
4936
            done
4937
        fi
4938
        if [ "$BUILD_ON_MAC" = "yes" ]; then
4939
            echo "export MACOSX_DEPLOYMENT_TARGET = 10.5" >> "$mkfile"
4940
            echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
4941
            echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"
4942
            EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
4943
            EXTRA_CFLAGS="$EXTRA_CFLAGS \$(CARBON_CFLAGS)"
4944
            EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
4945
            EXTRA_OBJS="qsettings_mac.o qcore_mac.o"
4946
            EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\""
4947
	    if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then # matches both x86 and x86_64
4948
		X86_CFLAGS="-arch i386"
4949
		X86_LFLAGS="-arch i386"
4950
		EXTRA_CFLAGS="$X86_CFLAGS $EXTRA_CFLAGS"
4951
		EXTRA_CXXFLAGS="$X86_CFLAGS $EXTRA_CXXFLAGS"
4952
                EXTRA_LFLAGS="$EXTRA_LFLAGS $X86_LFLAGS"
4953
            fi
4954
	    if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then # matches both ppc and ppc64
4955
		PPC_CFLAGS="-arch ppc"
4956
		PPC_LFLAGS="-arch ppc"
4957
		EXTRA_CFLAGS="$PPC_CFLAGS $EXTRA_CFLAGS"
4958
		EXTRA_CXXFLAGS="$PPC_CFLAGS $EXTRA_CXXFLAGS"
4959
                EXTRA_LFLAGS="$EXTRA_LFLAGS $PPC_LFLAGS"
4960
            fi
4961
	    if [ '!' -z "$CFG_SDK" ]; then
4962
		echo "SDK_LFLAGS =-Wl,-syslibroot,$CFG_SDK" >>"$mkfile"
4963
		echo "SDK_CFLAGS =-isysroot $CFG_SDK" >>"$mkfile"
4964
		EXTRA_CFLAGS="$EXTRA_CFLAGS \$(SDK_CFLAGS)"
4965
		EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(SDK_CFLAGS)"
4966
		EXTRA_LFLAGS="$EXTRA_LFLAGS \$(SDK_LFLAGS)"
4967
            fi
4968
        fi
4969
        [ "$CFG_EMBEDDED" != "no" ] && EXTRA_CFLAGS="$EXTRA_CFLAGS -DQWS"
4970
        if [ '!' -z "$D_FLAGS" ]; then
4971
            for DEF in $D_FLAGS; do
4972
                EXTRA_CFLAGS="$EXTRA_CFLAGS \"-D${DEF}\""
4973
            done
4974
        fi
4975
        QMAKE_BIN_DIR="$QT_INSTALL_BINS"
4976
        [ -z "$QMAKE_BIN_DIR" ] && QMAKE_BIN_DIR="${QT_INSTALL_PREFIX}/bin"
4977
        QMAKE_DATA_DIR="$QT_INSTALL_DATA"
4978
        [ -z "$QMAKE_DATA_DIR" ] && QMAKE_DATA_DIR="${QT_INSTALL_PREFIX}"
4979
        echo >>"$mkfile"
4980
	adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`
4981
	adjoutpath=`echo "$outpath" | sed 's/ /\\\\\\\\ /g'`
4982
	adjqmakespec=`echo "$QMAKESPEC" | sed 's/ /\\\\\\\\ /g'`
4983
        sed -e "s,@SOURCE_PATH@,$adjrelpath,g" -e "s,@BUILD_PATH@,$adjoutpath,g" \
4984
            -e "s,@QMAKE_CFLAGS@,$EXTRA_CFLAGS,g" -e "s,@QMAKE_LFLAGS@,$EXTRA_LFLAGS,g" \
4985
            -e "s,@QMAKE_CXXFLAGS@,$EXTRA_CXXFLAGS,g" \
4986
            -e "s,@QT_INSTALL_BINS@,\$(INSTALL_ROOT)$QMAKE_BIN_DIR,g" \
4987
            -e "s,@QT_INSTALL_DATA@,\$(INSTALL_ROOT)$QMAKE_DATA_DIR,g" \
4988
            -e "s,@QMAKE_QTOBJS@,$EXTRA_OBJS,g" -e "s,@QMAKE_QTSRCS@,$EXTRA_SRCS,g" \
4989
	    -e "s,@QMAKESPEC@,$adjqmakespec,g" "$in_mkfile" >>"$mkfile"
4990
4991
        if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
4992
            (cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
4993
	    sed "s,^.*/\([^/]*.o\):,\1:,g" "$mkfile" >"$mkfile.tmp"
4994
	    sed "s,$outpath,$adjoutpath,g" "$mkfile.tmp" >"$mkfile"
4995
	    rm "$mkfile.tmp"
4996
        fi
4997
    done
4998
4999
    QMAKE_BUILD_ERROR=no
5000
    (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes
5001
    [ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake
5002
    [ '!' -z "$OLD_QCONFIG_H" ] && mv -f "${OLD_QCONFIG_H}.old" "$OLD_QCONFIG_H" #put back qconfig.h
5003
    [ "$QMAKE_BUILD_ERROR" = "yes" ] && exit 2
5004
fi # Build qmake
5005
5006
#-------------------------------------------------------------------------------
5007
# tests that need qmake
5008
#-------------------------------------------------------------------------------
5009
5010
# detect availability of float math.h functions
5011
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/floatmath "floatmath" $L_FLAGS $I_FLAGS $l_FLAGS; then
5012
    CFG_USE_FLOATMATH=yes
5013
else
5014
    CFG_USE_FLOATMATH=no
5015
fi
5016
5017
# detect mmx support
5018
if [ "${CFG_MMX}" = "auto" ]; then
5019
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mmx "mmx" $L_FLAGS $I_FLAGS $l_FLAGS "-mmmx"; then
5020
	CFG_MMX=yes
5021
    else
5022
	CFG_MMX=no
5023
    fi
5024
fi
5025
5026
# detect 3dnow support
5027
if [ "${CFG_3DNOW}" = "auto" ]; then
5028
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/3dnow "3dnow" $L_FLAGS $I_FLAGS $l_FLAGS "-m3dnow"; then
5029
	CFG_3DNOW=yes
5030
    else
5031
	CFG_3DNOW=no
5032
    fi
5033
fi
5034
5035
# detect sse support
5036
if [ "${CFG_SSE}" = "auto" ]; then
5037
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse "sse" $L_FLAGS $I_FLAGS $l_FLAGS "-msse"; then
5038
	CFG_SSE=yes
5039
    else
5040
	CFG_SSE=no
5041
    fi
5042
fi
5043
5044
# detect sse2 support
5045
if [ "${CFG_SSE2}" = "auto" ]; then
5046
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse2 "sse2" $L_FLAGS $I_FLAGS $l_FLAGS "-msse2"; then
5047
       CFG_SSE2=yes
5048
    else
5049
       CFG_SSE2=no
5050
    fi
5051
fi
5052
5053
# detect sse3 support
5054
if [ "${CFG_SSE3}" = "auto" ]; then
5055
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse3 "sse3" $L_FLAGS $I_FLAGS $l_FLAGS "-msse3"; then
5056
       CFG_SSE3=yes
5057
    else
5058
       CFG_SSE3=no
5059
    fi
5060
fi
5061
5062
# detect ssse3 support
5063
if [ "${CFG_SSSE3}" = "auto" ]; then
5064
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ssse3 "ssse3" $L_FLAGS $I_FLAGS $l_FLAGS "-mssse3"; then
5065
       CFG_SSSE3=yes
5066
    else
5067
       CFG_SSSE3=no
5068
    fi
5069
fi
5070
5071
# detect sse4.1 support
5072
if [ "${CFG_SSE4_1}" = "auto" ]; then
5073
    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
5074
       CFG_SSE4_1=yes
5075
    else
5076
       CFG_SSE4_1=no
5077
    fi
5078
fi
5079
5080
# detect sse4.2 support
5081
if [ "${CFG_SSE4_2}" = "auto" ]; then
5082
    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
5083
       CFG_SSE4_2=yes
5084
    else
5085
       CFG_SSE4_2=no
5086
    fi
5087
fi
5088
5089
# detect avx support
5090
if [ "${CFG_AVX}" = "auto" ]; then
5091
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/avx "avx" $L_FLAGS $I_FLAGS $l_FLAGS "-mavx"; then
5092
       CFG_AVX=yes
5093
    else
5094
       CFG_AVX=no
5095
    fi
5096
fi
5097
5098
# check iWMMXt support
5099
if [ "$CFG_IWMMXT" = "yes" ]; then
5100
    "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $l_FLAGS "-mcpu=iwmmxt"
5101
    if [ $? != "0" ]; then
5102
        echo "The iWMMXt functionality test failed!"
5103
	echo " Please make sure your compiler supports iWMMXt intrinsics!"
5104
	exit 1
5105
    fi
5106
fi
5107
5108
# detect neon support
5109
if [ "$CFG_ARCH" = "arm" ] && [ "${CFG_NEON}" = "auto" ]; then
5110
    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
5111
	CFG_NEON=yes
5112
    else
5113
	CFG_NEON=no
5114
    fi
5115
fi
5116
5117
[ "$XPLATFORM_MINGW" = "yes" ] && QMakeVar add styles "windowsxp windowsvista"
5118
5119
if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
5120
    QMakeVar set styles "windows s60"   #overwrite previous default
5121
    CFG_LIBFREETYPE=no
5122
    CFG_ZLIB=yes
5123
5124
    if [ "$CFG_LARGEFILE" = auto ]; then
5125
        CFG_LARGEFILE=no
5126
    fi
5127
    if [ "$CFG_PHONON" = auto ]; then
5128
        CFG_PHONON=yes
5129
    fi
5130
5131
    if test -z "$EPOCROOT"; then
5132
        echo "Please export EPOCROOT. It should point to the sdk install dir"
5133
        exit 1
5134
    fi
5135
    if test ! -d "$EPOCROOT/epoc32"; then
5136
        echo "Could not find the 'epoc32' dir in your EPOCROOT."
5137
        exit 1
5138
    fi
5139
5140
    if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
5141
        # Raptor does not support configure tests.
5142
5143
        # the main commands needed to compile;
5144
        (mkdir -p config.tests/symbian/rcomp
5145
            cd config.tests/symbian/rcomp
5146
            rm -f rcomp_test.rsg
5147
            touch rcomp_test.rpp rcomp_test.rsc rcomp_test.rss
5148
            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
5149
            if test ! -f rcomp_test.rsg; then
5150
                echo "Finding a working rcomp in your PATH failed."
5151
                echo "Fatal error. Make sure you have the epoc tools working and in your PATH";
5152
                exit 1;
5153
            fi
5154
        )
5155
5156
        # compile a simple main that uses printf
5157
        if ! "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/simple "simple" $L_FLAGS $I_FLAGS $l_FLAGS
5158
        then
5159
            echo "Testing your compiler failed. Could not compile a simple application."
5160
            echo "Fatal error; Rerun configure with -verbose to get more details."
5161
            exit 1;
5162
        fi
5163
    fi
5164
fi
5165
# Adjust all variables for INTEGRITY
5166
if [ "$XPLATFORM_INTEGRITY" = "yes" ]; then
5167
    QMakeVar set gfx-drivers "integrityfb"
5168
    QMakeVar set kbd-drivers "integrity"
5169
    QMakeVar set mouse-drivers "integrity"
5170
    CFG_TIFF="no"
5171
    CFG_KBD_ON="integrity"
5172
    CFG_MOUSE_ON="integrity"
5173
    CFG_GFX_ON="integrityfb"
5174
    CFG_LARGEFILE="no"
5175
    CFG_STL="yes"
5176
    CFG_OPENSSL="no"
5177
    CFG_GLIB="no"
5178
    CFG_SHARED="no"
5179
    if [ "$CFG_SCRIPT" != "yes" ]; then
5180
      CFG_SCRIPT="no"
5181
    fi
5182
    CFG_BUILD_PARTS="libs examples demos"
5183
    CFG_GIF="no"
5184
fi
5185
5186
# check IPC support
5187
if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
5188
    # Raptor does not support configure tests.
5189
    if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipc_sysv "ipc_sysv" $L_FLAGS $I_FLAGS $l_FLAGS ; then
5190
        # SYSV IPC is not supported - check POSIX IPC
5191
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipc_posix "ipc_posix" $L_FLAGS $I_FLAGS $l_FLAGS ; then
5192
            QCONFIG_FLAGS="$QCONFIG_FLAGS QT_POSIX_IPC"
5193
        else
5194
            QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SYSTEMSEMAPHORE QT_NO_SHAREDMEMORY"
5195
            if [ "$PLATFORM_QWS" = "yes" ]; then
5196
                QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SEMAPHORE QT_NO_QWS_MULTIPROCESS QT_NO_QWS_SHARE_FONTS"
5197
            fi
5198
        fi
5199
    fi
5200
fi
5201
5202
# detect zlib
5203
if [ "$CFG_ZLIB" = "no" ]; then
5204
    # Note: Qt no longer support builds without zlib
5205
    # So we force a "no" to be "auto" here.
5206
    # If you REALLY really need no zlib support, you can still disable
5207
    # it by doing the following:
5208
    #   add "no-zlib" to mkspecs/qconfig.pri
5209
    #   #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
5210
    #
5211
    # There's no guarantee that Qt will build under those conditions
5212
5213
    CFG_ZLIB=auto
5214
    ZLIB_FORCED=yes
5215
fi
5216
if [ "$CFG_ZLIB" = "auto" ]; then
5217
    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
5218
       CFG_ZLIB=system
5219
    else
5220
       CFG_ZLIB=yes
5221
    fi
5222
fi
5223
5224
if [ "$CFG_LARGEFILE" = "auto" ]; then
5225
    #Large files should be enabled for all Linux systems
5226
    CFG_LARGEFILE=yes
5227
fi
5228
5229
5230
if [ "$CFG_S60" = "auto" ]; then
5231
    if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
5232
        CFG_S60=yes
5233
    else
5234
        CFG_S60=no
5235
    fi
5236
fi
5237
5238
if [ "$CFG_QS60STYLE" = "auto" ]; then
5239
    if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
5240
        CFG_QS60STYLE=qt
5241
    else
5242
        CFG_QS60STYLE=no
5243
    fi
5244
fi
5245
5246
if [ "$CFG_SYMBIAN_DEFFILES" = "auto" ]; then
5247
    # elf2e32 crashes when using def files together with gcce.
5248
    if [ "$XPLATFORM_SYMBIAN" = "yes" ] && [ "$CFG_DEV" = "no" ] && [ "$XPLATFORM" != "symbian-gcce" ]; then
5249
        CFG_SYMBIAN_DEFFILES=yes
5250
    else
5251
        CFG_SYMBIAN_DEFFILES=no
5252
    fi
5253
fi
5254
5255
# detect how jpeg should be built
5256
if [ "$CFG_JPEG" = "auto" ]; then
5257
    if [ "$CFG_SHARED" = "yes" ]; then
5258
        CFG_JPEG=plugin
5259
    else
5260
        CFG_JPEG=yes
5261
    fi
5262
fi
5263
# detect jpeg
5264
if [ "$CFG_LIBJPEG" = "auto" ]; then
5265
    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
5266
       CFG_LIBJPEG=system
5267
    else
5268
       CFG_LIBJPEG=qt
5269
    fi
5270
fi
5271
5272
# detect how gif should be built
5273
if [ "$CFG_GIF" = "auto" ]; then
5274
    if [ "$CFG_SHARED" = "yes" ]; then
5275
        CFG_GIF=plugin
5276
    else
5277
        CFG_GIF=yes
5278
    fi
5279
fi
5280
5281
# detect how tiff should be built
5282
if [ "$CFG_TIFF" = "auto" ]; then
5283
    if [ "$CFG_SHARED" = "yes" ]; then
5284
        CFG_TIFF=plugin
5285
    else
5286
        CFG_TIFF=yes
5287
    fi
5288
fi
5289
5290
# detect tiff
5291
if [ "$CFG_LIBTIFF" = "auto" ]; then
5292
    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
5293
        CFG_LIBTIFF=system
5294
    else
5295
        CFG_LIBTIFF=qt
5296
    fi
5297
fi
5298
5299
# detect how mng should be built
5300
if [ "$CFG_MNG" = "auto" ]; then
5301
    if [ "$CFG_SHARED" = "yes" ]; then
5302
        CFG_MNG=plugin
5303
    else
5304
        CFG_MNG=yes
5305
    fi
5306
fi
5307
# detect mng
5308
if [ "$CFG_LIBMNG" = "auto" ]; then
5309
    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
5310
       CFG_LIBMNG=system
5311
    else
5312
       CFG_LIBMNG=qt
5313
    fi
5314
fi
5315
5316
# detect png
5317
if [ "$CFG_LIBPNG" = "auto" ]; then
5318
    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
5319
       CFG_LIBPNG=system
5320
    else
5321
       CFG_LIBPNG=qt
5322
    fi
5323
fi
5324
5325
# detect accessibility
5326
if [ "$CFG_ACCESSIBILITY" = "auto" ]; then
5327
    if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
5328
        # accessibility is currently unsupported
5329
        CFG_ACCESSIBILITY=no
5330
    else
5331
        CFG_ACCESSIBILITY=yes
5332
    fi
5333
fi
5334
5335
# auto-detect SQL-modules support
5336
for _SQLDR in $CFG_SQL_AVAILABLE; do
5337
        case $_SQLDR in
5338
        mysql)
5339
            if [ "$CFG_SQL_mysql" != "no" ]; then
5340
		[ -z "$CFG_MYSQL_CONFIG" ] && CFG_MYSQL_CONFIG=`"$WHICH" mysql_config`
5341
                if [ -x "$CFG_MYSQL_CONFIG" ]; then
5342
                    QT_CFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --include 2>/dev/null`
5343
                    QT_LFLAGS_MYSQL_R=`$CFG_MYSQL_CONFIG --libs_r 2>/dev/null`
5344
                    QT_LFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --libs 2>/dev/null`
5345
		    QT_MYSQL_VERSION=`$CFG_MYSQL_CONFIG --version 2>/dev/null`
5346
                    QT_MYSQL_VERSION_MAJOR=`echo $QT_MYSQL_VERSION | cut -d . -f 1`
5347
                fi
5348
                if [ -n "$QT_MYSQL_VERSION" ] && [ "$QT_MYSQL_VERSION_MAJOR" -lt 4 ]; then
5349
                    if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5350
                        echo "This version of MySql is not supported ($QT_MYSQL_VERSION)."
5351
                        echo " You need MySql 4 or higher."
5352
                        echo " If you believe this message is in error you may use the continue"
5353
                        echo " switch (-continue) to $0 to continue."
5354
                        exit 101
5355
                    else
5356
                        CFG_SQL_mysql="no"
5357
			QT_LFLAGS_MYSQL=""
5358
			QT_LFLAGS_MYSQL_R=""
5359
			QT_CFLAGS_MYSQL=""
5360
                    fi
5361
                else
5362
                    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
5363
                        QMakeVar add CONFIG use_libmysqlclient_r
5364
                        if [ "$CFG_SQL_mysql" = "auto" ]; then
5365
                            CFG_SQL_mysql=plugin
5366
                        fi
5367
                        QT_LFLAGS_MYSQL="$QT_LFLAGS_MYSQL_R"
5368
                    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
5369
                        if [ "$CFG_SQL_mysql" = "auto" ]; then
5370
                            CFG_SQL_mysql=plugin
5371
                        fi
5372
                    else
5373
                        if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5374
                            echo "MySQL support cannot be enabled due to functionality tests!"
5375
                            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5376
                            echo " If you believe this message is in error you may use the continue"
5377
                            echo " switch (-continue) to $0 to continue."
5378
                            exit 101
5379
                        else
5380
                            CFG_SQL_mysql=no
5381
			    QT_LFLAGS_MYSQL=""
5382
			    QT_LFLAGS_MYSQL_R=""
5383
			    QT_CFLAGS_MYSQL=""
5384
                        fi
5385
                    fi
5386
                fi
5387
            fi
5388
            ;;
5389
        psql)
5390
            if [ "$CFG_SQL_psql" != "no" ]; then
5391
                # Be careful not to use native pg_config when cross building.
5392
                if [ "$XPLATFORM_MINGW" != "yes" ] && "$WHICH" pg_config >/dev/null 2>&1; then
5393
                    QT_CFLAGS_PSQL=`pg_config --includedir 2>/dev/null`
5394
                    QT_LFLAGS_PSQL=`pg_config --libdir 2>/dev/null`
5395
                fi
5396
                [ -z "$QT_CFLAGS_PSQL" ] || QT_CFLAGS_PSQL="-I$QT_CFLAGS_PSQL"
5397
                [ -z "$QT_LFLAGS_PSQL" ] || QT_LFLAGS_PSQL="-L$QT_LFLAGS_PSQL"
5398
                # But, respect PSQL_LIBS if set
5399
                [ -z "$PSQL_LIBS" ] || QT_LFLAGS_PSQL="$PSQL_LIBS"
5400
                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
5401
                    if [ "$CFG_SQL_psql" = "auto" ]; then
5402
                        CFG_SQL_psql=plugin
5403
                    fi
5404
                else
5405
                    if [ "$CFG_SQL_psql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5406
                        echo "PostgreSQL support cannot be enabled due to functionality tests!"
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
                    else
5412
                        CFG_SQL_psql=no
5413
                        QT_CFLAGS_PSQL=""
5414
                        QT_LFLAGS_PSQL=""
5415
                    fi
5416
                fi
5417
            fi
5418
        ;;
5419
        odbc)
5420
            if [ "$CFG_SQL_odbc" != "no" ]; then
5421
                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
5422
                    if [ "$CFG_SQL_odbc" = "auto" ]; then
5423
                        CFG_SQL_odbc=plugin
5424
                    fi
5425
                else
5426
                    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
5427
                        QT_LFLAGS_ODBC="-liodbc"
5428
                        if [ "$CFG_SQL_odbc" = "auto" ]; then
5429
                            CFG_SQL_odbc=plugin
5430
                        fi
5431
                    else
5432
                        if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5433
                            echo "ODBC support cannot be enabled due to functionality tests!"
5434
                            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5435
                            echo " If you believe this message is in error you may use the continue"
5436
                            echo " switch (-continue) to $0 to continue."
5437
                            exit 101
5438
                        else
5439
                            CFG_SQL_odbc=no
5440
                        fi
5441
                    fi
5442
                fi
5443
            fi
5444
            ;;
5445
        oci)
5446
            if [ "$CFG_SQL_oci" != "no" ]; then
5447
                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
5448
                    if [ "$CFG_SQL_oci" = "auto" ]; then
5449
                        CFG_SQL_oci=plugin
5450
                    fi
5451
                else
5452
                    if [ "$CFG_SQL_oci" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5453
                        echo "Oracle (OCI) support cannot be enabled due to functionality tests!"
5454
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5455
                        echo " If you believe this message is in error you may use the continue"
5456
                        echo " switch (-continue) to $0 to continue."
5457
                        exit 101
5458
                    else
5459
                        CFG_SQL_oci=no
5460
                    fi
5461
                fi
5462
            fi
5463
            ;;
5464
        tds)
5465
            if [ "$CFG_SQL_tds" != "no" ]; then
5466
                [ -z "$SYBASE" ] || QT_LFLAGS_TDS="-L$SYBASE/lib"
5467
                [ -z "$SYBASE_LIBS" ] || QT_LFLAGS_TDS="$QT_LFLAGS_TDS $SYBASE_LIBS"
5468
                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
5469
                    if [ "$CFG_SQL_tds" = "auto" ]; then
5470
                        CFG_SQL_tds=plugin
5471
                    fi
5472
                else
5473
                    if [ "$CFG_SQL_tds" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5474
                        echo "TDS support cannot be enabled due to functionality tests!"
5475
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5476
                        echo " If you believe this message is in error you may use the continue"
5477
                        echo " switch (-continue) to $0 to continue."
5478
                        exit 101
5479
                    else
5480
                        CFG_SQL_tds=no
5481
                    fi
5482
                fi
5483
            fi
5484
            ;;
5485
        db2)
5486
            if [ "$CFG_SQL_db2" != "no" ]; then
5487
                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
5488
                    if [ "$CFG_SQL_db2" = "auto" ]; then
5489
                        CFG_SQL_db2=plugin
5490
                    fi
5491
                else
5492
                    if [ "$CFG_SQL_db2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5493
                        echo "ODBC support cannot be enabled due to functionality tests!"
5494
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5495
                        echo " If you believe this message is in error you may use the continue"
5496
                        echo " switch (-continue) to $0 to continue."
5497
                        exit 101
5498
                    else
5499
                        CFG_SQL_db2=no
5500
                    fi
5501
                fi
5502
            fi
5503
            ;;
5504
        ibase)
5505
            if [ "$CFG_SQL_ibase" != "no" ]; then
5506
                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
5507
                    if [ "$CFG_SQL_ibase" = "auto" ]; then
5508
                        CFG_SQL_ibase=plugin
5509
                    fi
5510
                else
5511
                    if [ "$CFG_SQL_ibase" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5512
                        echo "InterBase support cannot be enabled due to functionality tests!"
5513
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5514
                        echo " If you believe this message is in error you may use the continue"
5515
                        echo " switch (-continue) to $0 to continue."
5516
                        exit 101
5517
                    else
5518
                        CFG_SQL_ibase=no
5519
                    fi
5520
                fi
5521
            fi
5522
            ;;
5523
        sqlite2)
5524
            if [ "$CFG_SQL_sqlite2" != "no" ]; then
5525
                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
5526
                    if [ "$CFG_SQL_sqlite2" = "auto" ]; then
5527
                        CFG_SQL_sqlite2=plugin
5528
                    fi
5529
                else
5530
                    if [ "$CFG_SQL_sqlite2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5531
                        echo "SQLite2 support cannot be enabled due to functionality tests!"
5532
                        echo " Turn on verbose messaging (-v) to $0 to see the final report."
5533
                        echo " If you believe this message is in error you may use the continue"
5534
                        echo " switch (-continue) to $0 to continue."
5535
                        exit 101
5536
                    else
5537
                        CFG_SQL_sqlite2=no
5538
                    fi
5539
                fi
5540
            fi
5541
            ;;
5542
        sqlite)
5543
            if [ "$CFG_SQL_sqlite" = "auto" ]; then # the default
5544
                if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
5545
                    # sqlite on symbian is typically not build in Qt but deployed as a pre-existing sis file and should be marked as driver.
5546
                    # Configuration parameters should be set
5547
                    CFG_SQL_sqlite=qt
5548
                    QT_LFLAGS_SQLITE=-lsqlite3
5549
                    QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
5550
                fi
5551
            fi
5552
            if [ "$CFG_SQL_sqlite" != "no" ]; then
5553
                SQLITE_AUTODETECT_FAILED="no"
5554
                if [ "$CFG_SQLITE" = "system" ]; then
5555
                    if [ -n "$PKG_CONFIG" ]; then
5556
                        QT_CFLAGS_SQLITE=`$PKG_CONFIG --cflags sqlite3 2>/dev/null`
5557
                        QT_LFLAGS_SQLITE=`$PKG_CONFIG --libs sqlite3 2>/dev/null`
5558
                    fi
5559
                    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
5560
                        if [ "$CFG_SQL_sqlite" = "auto" ]; then
5561
                            CFG_SQL_sqlite=plugin
5562
                        fi
5563
                        QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
5564
                    else
5565
                        SQLITE_AUTODETECT_FAILED="yes"
5566
                        CFG_SQL_sqlite=no
5567
                    fi
5568
                elif [ -f "$relpath/src/3rdparty/sqlite/sqlite3.h" ]; then
5569
                    if [ "$CFG_SQL_sqlite" = "auto" ]; then
5570
                            CFG_SQL_sqlite=plugin
5571
                    fi
5572
                else
5573
                    SQLITE_AUTODETECT_FAILED="yes"
5574
                    CFG_SQL_sqlite=no
5575
                fi
5576
5577
                if [ "$SQLITE_AUTODETECT_FAILED" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5578
                    echo "SQLite support cannot be enabled due to functionality tests!"
5579
                    echo " Turn on verbose messaging (-v) to $0 to see the final report."
5580
                    echo " If you believe this message is in error you may use the continue"
5581
                    echo " switch (-continue) to $0 to continue."
5582
                    exit 101
5583
                fi
5584
            fi
5585
            ;;
5586
        *)
5587
            if [ "$OPT_VERBOSE" = "yes" ]; then
5588
                echo "unknown SQL driver: $_SQLDR"
5589
            fi
5590
            ;;
5591
        esac
5592
done
5593
5594
# auto-detect NIS support
5595
if [ "$CFG_NIS" != "no" ]; then
5596
    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
5597
        CFG_NIS=yes
5598
    else
5599
        if [ "$CFG_NIS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5600
            echo "NIS support cannot be enabled due to functionality tests!"
5601
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5602
            echo " If you believe this message is in error you may use the continue"
5603
            echo " switch (-continue) to $0 to continue."
5604
            exit 101
5605
        else
5606
            CFG_NIS=no
5607
        fi
5608
    fi
5609
fi
5610
5611
# auto-detect CUPS support
5612
if [ "$CFG_CUPS" != "no" ]; then
5613
    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
5614
        CFG_CUPS=yes
5615
    else
5616
        if [ "$CFG_CUPS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5617
            echo "Cups support cannot be enabled due to functionality tests!"
5618
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5619
            echo " If you believe this message is in error you may use the continue"
5620
            echo " switch (-continue) to $0 to continue."
5621
            exit 101
5622
        else
5623
            CFG_CUPS=no
5624
        fi
5625
    fi
5626
fi
5627
5628
# auto-detect iconv(3) support
5629
if [ "$CFG_ICONV" != "no" ]; then
5630
    if [ "$PLATFORM_QWS" = "yes" ] || [ "$PLATFORM_QPA" = "yes" -a "$CFG_ICONV" = "auto" ]; then
5631
        CFG_ICONV=no
5632
    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
5633
        CFG_ICONV=yes
5634
    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
5635
        CFG_ICONV=sun
5636
    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
5637
        CFG_ICONV=gnu
5638
    else
5639
        if [ "$CFG_ICONV" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5640
            echo "Iconv support cannot be enabled due to functionality tests!"
5641
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5642
            echo " If you believe this message is in error you may use the continue"
5643
            echo " switch (-continue) to $0 to continue."
5644
            exit 101
5645
        else
5646
            CFG_ICONV=no
5647
        fi
5648
    fi
5649
fi
5650
5651
# auto-detect libdbus-1 support
5652
if [ "$CFG_DBUS" != "no" ]; then
5653
    if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then
5654
        QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null`
5655
        QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null`
5656
    fi
5657
    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
5658
        [ "$CFG_DBUS" = "auto" ] && CFG_DBUS=yes
5659
        QMakeVar set QT_CFLAGS_DBUS "$QT_CFLAGS_DBUS"
5660
        QMakeVar set QT_LIBS_DBUS "$QT_LIBS_DBUS"
5661
    else
5662
        if [ "$CFG_DBUS" = "auto" ]; then
5663
            CFG_DBUS=no
5664
        elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5665
            # CFG_DBUS is "yes" or "linked" here
5666
5667
            echo "The QtDBus module cannot be enabled because libdbus-1 version $MIN_DBUS_1_VERSION was not found."
5668
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
5669
            echo " If you believe this message is in error you may use the continue"
5670
            echo " switch (-continue) to $0 to continue."
5671
            exit 101
5672
        fi
5673
    fi
5674
fi
5675
5676
if [ "$CFG_MULTIMEDIA" = "auto" ]; then
5677
    CFG_MULTIMEDIA="$CFG_GUI"
5678
fi
5679
5680
if [ "$CFG_MULTIMEDIA" = "yes" ] && [ "$CFG_GUI" = "no" ]; then
5681
    echo "QtMultimedia requested, but it can't be built without QtGui"
5682
    exit 1
5683
fi
5684
5685
# Generate a CRC of the namespace for using in constants for the Carbon port.
5686
# This should mean that you really *can* load two Qt's and have our custom
5687
# Carbon events work.
5688
if [ "$PLATFORM_MAC" = "yes" -a ! -z "$QT_NAMESPACE" ]; then
5689
    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`
5690
fi
5691
5692
# X11/QWS/Lighthouse
5693
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
5694
5695
    # auto-detect Glib support
5696
    if [ "$CFG_GLIB" != "no" ]; then
5697
        if [ -n "$PKG_CONFIG" ]; then
5698
            QT_CFLAGS_GLIB=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0 2>/dev/null`
5699
            QT_LIBS_GLIB=`$PKG_CONFIG --libs glib-2.0 gthread-2.0 2>/dev/null`
5700
        fi
5701
        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
5702
            CFG_GLIB=yes
5703
            QMakeVar set QT_CFLAGS_GLIB "$QT_CFLAGS_GLIB"
5704
            QMakeVar set QT_LIBS_GLIB "$QT_LIBS_GLIB"
5705
        else
5706
            if [ "$CFG_GLIB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5707
                echo "Glib support cannot be enabled due to functionality tests!"
5708
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5709
                echo " If you believe this message is in error you may use the continue"
5710
                echo " switch (-continue) to $0 to continue."
5711
                exit 101
5712
            else
5713
                CFG_GLIB=no
5714
            fi
5715
        fi
5716
    fi
5717
5718
    if [ "$CFG_GUI" = "no" ]; then
5719
        if [ "$CFG_PHONON" = "auto" ]; then
5720
            CFG_PHONON=no
5721
        fi
5722
        if [ "$CFG_PHONON" != "no" ]; then
5723
            echo "Phonon enabled, but GUI disabled."
5724
            echo " You might need to either enable the GUI or disable Phonon"
5725
            exit 1
5726
        fi
5727
    fi
5728
5729
    # Auto-detect GStreamer support (needed for Phonon)
5730
    if [ "$CFG_PHONON" != "no" ]; then
5731
        if [ "$CFG_GLIB" = "yes" -a "$CFG_GSTREAMER" != "no" ]; then
5732
            if [ -n "$PKG_CONFIG" ]; then
5733
                QT_CFLAGS_GSTREAMER=`$PKG_CONFIG --cflags gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
5734
                QT_LIBS_GSTREAMER=`$PKG_CONFIG --libs gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
5735
            fi
5736
            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
5737
                CFG_GSTREAMER=yes
5738
                QMakeVar set QT_CFLAGS_GSTREAMER "$QT_CFLAGS_GSTREAMER"
5739
                QMakeVar set QT_LIBS_GSTREAMER "$QT_LIBS_GSTREAMER"
5740
            else
5741
                if [ "$CFG_GSTREAMER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5742
                    echo "Gstreamer support cannot be enabled due to functionality tests!"
5743
                    echo " Turn on verbose messaging (-v) to $0 to see the final report."
5744
                    echo " If you believe this message is in error you may use the continue"
5745
                    echo " switch (-continue) to $0 to continue."
5746
                    exit 101
5747
                else
5748
                    CFG_GSTREAMER=no
5749
                fi
5750
            fi
5751
        elif [ "$CFG_GLIB" = "no" ]; then
5752
            CFG_GSTREAMER=no
5753
        fi
5754
    else
5755
        CFG_GSTREAMER=no
5756
    fi
5757
5758
    if [ "$CFG_PHONON" != "no" ]; then
5759
        if [ "$CFG_PHONON_BACKEND" != "no" ]; then
5760
            if [ "$CFG_GSTREAMER" = "yes" ]; then
5761
                CFG_PHONON=yes
5762
            else
5763
                if [ "$CFG_PHONON" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5764
                    echo "Phonon support cannot be enabled due to functionality tests!"
5765
                    echo " Turn on verbose messaging (-v) to $0 to see the final report."
5766
                    echo " If you believe this message is in error you may use the continue"
5767
                    echo " switch (-continue) to $0 to continue."
5768
                    exit 101
5769
                else
5770
                    CFG_PHONON=no
5771
                fi
5772
            fi
5773
        else
5774
            CFG_PHONON=yes
5775
        fi
5776
    fi
5777
5778
    # auto-detect icd support
5779
    if [ "$CFG_GLIB" = "yes" -a "$CFG_ICD" != "no" ]; then
5780
        if [ -n "$PKG_CONFIG" ]; then
5781
            QT_CFLAGS_CONNSETTINGS=`$PKG_CONFIG --cflags connsettings icd2 2>/dev/null`
5782
            QT_LIBS_CONNSETTINGS=`$PKG_CONFIG --libs connsettings icd2 2>/dev/null`
5783
        fi
5784
        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
5785
            [ "$CFG_ICD" = "auto" ] && CFG_ICD=yes
5786
            QMakeVar set QT_CFLAGS_CONNSETTINGS "$QT_CFLAGS_CONNSETTINGS"
5787
            QMakeVar set QT_LIBS_CONNSETTINGS "$QT_LIBS_CONNSETTINGS"
5788
        else
5789
            if [ "$CFG_ICD" = "auto" ]; then
5790
                CFG_ICD=no
5791
            elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5792
                # CFG_ICD is "yes"
5793
5794
                echo "The ICD Bearer Management plugin cannot be enabled because connsettings was not found."
5795
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5796
                echo " If you believe this message is in error you may use the continue"
5797
                echo " switch (-continue) to $0 to continue."
5798
                exit 101
5799
            fi
5800
        fi
5801
    elif [ "$CFG_GLIB" = "no" ]; then
5802
        CFG_ICD=no
5803
    fi
5804
5805
    # auto-detect libicu support
5806
    if [ "$CFG_ICU" != "no" ]; then
5807
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/icu "ICU" $L_FLAGS $I_FLAGS $l_FLAGS; then
5808
            [ "$CFG_ICU" = "auto" ] && CFG_ICU=yes
5809
        else
5810
            if [ "$CFG_ICU" = "auto" ]; then
5811
                CFG_ICU=no
5812
            elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5813
                # CFG_ICU is "yes"
5814
5815
                echo "The ICU library support cannot be enabled."
5816
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5817
                echo " If you believe this message is in error you may use the continue"
5818
                echo " switch (-continue) to $0 to continue."
5819
                exit 101
5820
            fi
5821
        fi
5822
    fi
5823
5824
    # Auto-detect PulseAudio support
5825
    if [ "$CFG_PULSEAUDIO" != "no" ]; then
5826
        if [ -n "$PKG_CONFIG" ]; then
5827
            QT_CFLAGS_PULSEAUDIO=`$PKG_CONFIG --cflags libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null`
5828
            QT_LIBS_PULSEAUDIO=`$PKG_CONFIG --libs libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null`
5829
        fi
5830
        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
5831
            CFG_PULSEAUDIO=yes
5832
            QMakeVar set QT_CFLAGS_PULSEAUDIO "$QT_CFLAGS_PULSEAUDIO"
5833
            QMakeVar set QT_LIBS_PULSEAUDIO "$QT_LIBS_PULSEAUDIO"
5834
        else
5835
            if [ "$CFG_PULSEAUDIO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5836
                echo "PulseAudio support cannot be enabled due to functionality tests!"
5837
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
5838
                echo " If you believe this message is in error you may use the continue"
5839
                echo " switch (-continue) to $0 to continue."
5840
                exit 101
5841
            else
5842
		CFG_PULSEAUDIO=no
5843
            fi
5844
        fi
5845
    fi
5846
fi # X11/QWS/Lighthouse
5847
5848
# X11
5849
if [ "$PLATFORM_X11" = "yes" -a "$CFG_GUI" != "no" ]; then
5850
    x11tests="$relpath/config.tests/x11"
5851
    X11TESTS_FLAGS=
5852
5853
    # work around broken X11 headers when using GCC 2.95 or later
5854
    NOTYPE=no
5855
    "$x11tests/notype.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath" && NOTYPE=yes
5856
    if [ $NOTYPE = "yes" ]; then
5857
	QMakeVar add QMAKE_CXXFLAGS -fpermissive
5858
        X11TESTS_FLAGS="$X11TESTS_FLAGS -fpermissive"
5859
    fi
5860
5861
    # Check we actually have X11 :-)
5862
    "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xlib "XLib" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
5863
    if [ $? != "0" ]; then
5864
        echo "Basic XLib functionality test failed!"
5865
        echo " You might need to modify the include and library search paths by editing"
5866
        echo " QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in ${XQMAKESPEC}."
5867
        exit 1
5868
    fi
5869
fi
5870
5871
# X11/MINGW/SYMBIAN OpenGL
5872
if [ "$PLATFORM_X11" = "yes" -o "$XPLATFORM_MINGW" = "yes" -o "$XPLATFORM_SYMBIAN" = "yes" ]; then
5873
    # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x)
5874
    if [ "$CFG_GUI" = "no" ]; then
5875
        if [ "$CFG_OPENGL" = "auto" ]; then
5876
            CFG_OPENGL=no
5877
        fi
5878
        if [ "$CFG_OPENGL" != "no" ]; then
5879
            echo "OpenGL enabled, but GUI disabled."
5880
            echo " You might need to either enable the GUI or disable OpenGL"
5881
            exit 1
5882
        fi
5883
    fi
5884
    if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
5885
        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
5886
            CFG_OPENGL=desktop
5887
        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
5888
            CFG_OPENGL=es2
5889
            if [ "$CFG_EGL" = "no" ]; then
5890
                CFG_EGL=auto
5891
            fi
5892
        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
5893
            CFG_OPENGL=es1
5894
            if [ "$CFG_EGL" = "no" ]; then
5895
                CFG_EGL=auto
5896
            fi
5897
        else
5898
            if [ "$CFG_OPENGL" = "yes" ]; then
5899
                echo "All the OpenGL functionality tests failed!"
5900
                echo " You might need to modify the include and library search paths by editing"
5901
                echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5902
                echo " ${XQMAKESPEC}."
5903
                exit 1
5904
            fi
5905
            CFG_OPENGL=no
5906
        fi
5907
        case "$PLATFORM" in
5908
        hpux*)
5909
            # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
5910
            if [ "$CFG_OPENGL" = "desktop" ]; then
5911
                "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
5912
                if [ $? != "0" ]; then
5913
                    QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
5914
                fi
5915
            fi
5916
            ;;
5917
        *)
5918
            ;;
5919
        esac
5920
    elif [ "$CFG_OPENGL" = "es1" ]; then
5921
        # OpenGL ES 1.x
5922
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS
5923
        if [ $? != "0" ]; then
5924
            echo "The OpenGL ES 1.x functionality test failed!"
5925
            echo " You might need to modify the include and library search paths by editing"
5926
            echo " QMAKE_INCDIR_OPENGL_ES1, QMAKE_LIBDIR_OPENGL_ES1 and QMAKE_LIBS_OPENGL_ES1 in"
5927
            echo " ${XQMAKESPEC}."
5928
            exit 1
5929
        fi
5930
    elif [ "$CFG_OPENGL" = "es2" ]; then
5931
        #OpenGL ES 2.x
5932
        if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
5933
            # Raptor does not support configure tests.
5934
            "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS
5935
            if [ $? != "0" ]; then
5936
                echo "The OpenGL ES 2.0 functionality test failed!"
5937
                echo " You might need to modify the include and library search paths by editing"
5938
                echo " QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in"
5939
                echo " ${XQMAKESPEC}."
5940
                exit 1
5941
            fi
5942
        fi
5943
    elif [ "$CFG_OPENGL" = "desktop" ]; then
5944
        # Desktop OpenGL support
5945
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
5946
        if [ $? != "0" ]; then
5947
            echo "The OpenGL functionality test failed!"
5948
            echo " You might need to modify the include and library search paths by editing"
5949
            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5950
            echo " ${XQMAKESPEC}."
5951
            exit 1
5952
        fi
5953
        case "$PLATFORM" in
5954
        hpux*)
5955
            # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
5956
            "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
5957
            if [ $? != "0" ]; then
5958
                QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
5959
            fi
5960
            ;;
5961
        *)
5962
            ;;
5963
        esac
5964
    fi
5965
5966
    # if opengl is disabled and the user specified graphicssystem gl, disable it...
5967
    if [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && [ "$CFG_OPENGL" = "no" ]; then
5968
	echo "OpenGL Graphics System is disabled due to missing OpenGL support..."
5969
	CFG_GRAPHICS_SYSTEM=default
5970
    fi
5971
fi # X11/MINGW OpenGL
5972
5973
# X11
5974
if [ "$PLATFORM_X11" = "yes" ]; then
5975
    # auto-detect Xcursor support
5976
    if [ "$CFG_XCURSOR" != "no" ]; then
5977
	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
5978
	    if [ "$CFG_XCURSOR" != "runtime" ]; then
5979
		CFG_XCURSOR=yes;
5980
	    fi
5981
	else
5982
	    if [ "$CFG_XCURSOR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5983
		echo "Xcursor support cannot be enabled due to functionality tests!"
5984
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
5985
		echo " If you believe this message is in error you may use the continue"
5986
		echo " switch (-continue) to $0 to continue."
5987
		exit 101
5988
	    else
5989
		CFG_XCURSOR=no
5990
	    fi
5991
	fi
5992
    fi
5993
5994
    # auto-detect Xfixes support
5995
    if [ "$CFG_XFIXES" != "no" ]; then
5996
	if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xfixes "Xfixes" $L_FLAGS $I_FLAGS $X11TESTS_FLAGS; then
5997
	    if [ "$CFG_XFIXES" != "runtime" ]; then
5998
		CFG_XFIXES=yes;
5999
	    fi
6000
	else
6001
	    if [ "$CFG_XFIXES" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6002
		echo "Xfixes support cannot be enabled due to functionality tests!"
6003
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6004
		echo " If you believe this message is in error you may use the continue"
6005
		echo " switch (-continue) to $0 to continue."
6006
		exit 101
6007
	    else
6008
		CFG_XFIXES=no
6009
	    fi
6010
	fi
6011
    fi
6012
6013
    # auto-detect Xrandr support (resize and rotate extension)
6014
    if [ "$CFG_XRANDR" != "no" ]; then
6015
	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
6016
            if [ "$CFG_XRANDR" != "runtime" ]; then
6017
	    CFG_XRANDR=yes
6018
            fi
6019
	else
6020
	    if [ "$CFG_XRANDR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6021
		echo "Xrandr support cannot be enabled due to functionality tests!"
6022
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6023
		echo " If you believe this message is in error you may use the continue"
6024
		echo " switch (-continue) to $0 to continue."
6025
		exit 101
6026
	    else
6027
		CFG_XRANDR=no
6028
	    fi
6029
	fi
6030
    fi
6031
6032
    # auto-detect Xrender support
6033
    if [ "$CFG_XRENDER" != "no" ]; then
6034
	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
6035
	    CFG_XRENDER=yes
6036
	else
6037
	    if [ "$CFG_XRENDER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6038
		echo "Xrender support cannot be enabled due to functionality tests!"
6039
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6040
		echo " If you believe this message is in error you may use the continue"
6041
		echo " switch (-continue) to $0 to continue."
6042
		exit 101
6043
	    else
6044
		CFG_XRENDER=no
6045
	    fi
6046
	fi
6047
    fi
6048
6049
    # Additional check to decide if WebKit support will be included
6050
    if [ "$CFG_XRENDER" = "no" ] && [ "$CFG_WEBKIT" != "no" ]; then
6051
        echo "Warning: -no-xrender will disable the QtWebkit module."
6052
        CFG_WEBKIT="no"
6053
    fi
6054
6055
    # auto-detect MIT-SHM support
6056
    if [ "$CFG_MITSHM" != "no" ]; then
6057
	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
6058
	    CFG_MITSHM=yes
6059
	else
6060
	    if [ "$CFG_MITSHM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6061
		echo "MITSHM support cannot be enabled due to functionality tests!"
6062
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6063
		echo " If you believe this message is in error you may use the continue"
6064
		echo " switch (-continue) to $0 to continue."
6065
		exit 101
6066
	    else
6067
		CFG_MITSHM=no
6068
	    fi
6069
	fi
6070
    fi
6071
6072
    # auto-detect FontConfig support
6073
    if [ "$CFG_FONTCONFIG" != "no" ]; then
6074
    if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig --exists freetype2 2>/dev/null; then
6075
        QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig --cflags freetype2 2>/dev/null`
6076
        QT_LIBS_FONTCONFIG=`$PKG_CONFIG --libs fontconfig --libs freetype2 2>/dev/null`
6077
    else
6078
        QT_CFLAGS_FONTCONFIG=
6079
        QT_LIBS_FONTCONFIG="-lfreetype -lfontconfig"
6080
    fi
6081
    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
6082
	    CFG_FONTCONFIG=yes
6083
        QMakeVar set QMAKE_CFLAGS_X11 "$QT_CFLAGS_FONTCONFIG \$\$QMAKE_CFLAGS_X11"
6084
        QMakeVar set QMAKE_LIBS_X11 "$QT_LIBS_FONTCONFIG \$\$QMAKE_LIBS_X11"
6085
	    CFG_LIBFREETYPE=system
6086
	else
6087
	    if [ "$CFG_FONTCONFIG" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6088
		echo "FontConfig support cannot be enabled due to functionality tests!"
6089
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6090
		echo " If you believe this message is in error you may use the continue"
6091
		echo " switch (-continue) to $0 to continue."
6092
		exit 101
6093
	    else
6094
		CFG_FONTCONFIG=no
6095
	    fi
6096
	fi
6097
    fi
6098
6099
    # auto-detect Session Management support
6100
    if [ "$CFG_SM" = "auto" ]; then
6101
	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
6102
	    CFG_SM=yes
6103
	else
6104
	    if [ "$CFG_SM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6105
		echo "Session Management support cannot be enabled due to functionality tests!"
6106
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6107
		echo " If you believe this message is in error you may use the continue"
6108
		echo " switch (-continue) to $0 to continue."
6109
		exit 101
6110
	    else
6111
		CFG_SM=no
6112
	    fi
6113
	fi
6114
    fi
6115
6116
    # auto-detect SHAPE support
6117
    if [ "$CFG_XSHAPE" != "no" ]; then
6118
	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
6119
	    CFG_XSHAPE=yes
6120
	else
6121
	    if [ "$CFG_XSHAPE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6122
		echo "XShape support cannot be enabled due to functionality tests!"
6123
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6124
		echo " If you believe this message is in error you may use the continue"
6125
		echo " switch (-continue) to $0 to continue."
6126
		exit 101
6127
	    else
6128
		CFG_XSHAPE=no
6129
	    fi
6130
	fi
6131
    fi
6132
6133
    # auto-detect XVideo support
6134
    if [ "$CFG_XVIDEO" != "no" ]; then
6135
	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
6136
	    CFG_XVIDEO=yes
6137
	else
6138
	    if [ "$CFG_XVIDEO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6139
		echo "XVideo support cannot be enabled due to functionality tests!"
6140
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6141
		echo " If you believe this message is in error you may use the continue"
6142
		echo " switch (-continue) to $0 to continue."
6143
		exit 101
6144
	    else
6145
		CFG_XVIDEO=no
6146
	    fi
6147
	fi
6148
    fi
6149
6150
    # auto-detect XSync support
6151
    if [ "$CFG_XSYNC" != "no" ]; then
6152
	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
6153
	    CFG_XSYNC=yes
6154
	else
6155
	    if [ "$CFG_XSYNC" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6156
		echo "XSync support cannot be enabled due to functionality tests!"
6157
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6158
		echo " If you believe this message is in error you may use the continue"
6159
		echo " switch (-continue) to $0 to continue."
6160
		exit 101
6161
	    else
6162
		CFG_XSYNC=no
6163
	    fi
6164
	fi
6165
    fi
6166
6167
    # auto-detect Xinerama support
6168
    if [ "$CFG_XINERAMA" != "no" ]; then
6169
	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
6170
	    if [ "$CFG_XINERAMA" != "runtime" ]; then
6171
		CFG_XINERAMA=yes
6172
	    fi
6173
	else
6174
	    if [ "$CFG_XINERAMA" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6175
		echo "Xinerama support cannot be enabled due to functionality tests!"
6176
		echo " Turn on verbose messaging (-v) to $0 to see the final report."
6177
		echo " If you believe this message is in error you may use the continue"
6178
		echo " switch (-continue) to $0 to continue."
6179
		exit 101
6180
	    else
6181
		CFG_XINERAMA=no
6182
	    fi
6183
	fi
6184
    fi
6185
6186
    # auto-detect Xinput support
6187
    if [ "$CFG_XINPUT" != "no" ]; then
6188
        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
6189
	    if [ "$CFG_XINPUT" != "runtime" ]; then
6190
		CFG_XINPUT=yes
6191
	    fi
6192
        else
6193
            if [ "$CFG_XINPUT" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6194
                echo "Tablet and Xinput support cannot be enabled due to functionality tests!"
6195
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
6196
                echo " If you believe this message is in error you may use the continue"
6197
                echo " switch (-continue) to $0 to continue."
6198
                exit 101
6199
            else
6200
                CFG_XINPUT=no
6201
            fi
6202
        fi
6203
    fi
6204
6205
    # auto-detect XKB support
6206
    if [ "$CFG_XKB" != "no" ]; then
6207
        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
6208
            CFG_XKB=yes
6209
        else
6210
            if [ "$CFG_XKB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6211
                echo "XKB support cannot be enabled due to functionality tests!"
6212
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
6213
                echo " If you believe this message is in error you may use the continue"
6214
                echo " switch (-continue) to $0 to continue."
6215
                exit 101
6216
            else
6217
                CFG_XKB=no
6218
            fi
6219
        fi
6220
    fi
6221
6222
    if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then
6223
        if [ -n "$PKG_CONFIG" ]; then
6224
            QT_CFLAGS_QGTKSTYLE=`$PKG_CONFIG --cflags gtk+-2.0 ">=" 2.10 atk 2>/dev/null`
6225
            QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
6226
        fi
6227
        if [ -n "$QT_CFLAGS_QGTKSTYLE" ] ; then
6228
            CFG_QGTKSTYLE=yes
6229
            QMakeVar set QT_CFLAGS_QGTKSTYLE "$QT_CFLAGS_QGTKSTYLE"
6230
            QMakeVar set QT_LIBS_QGTKSTYLE "$QT_LIBS_QGTKSTYLE"
6231
        else
6232
            if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6233
                echo "Gtk theme support cannot be enabled due to functionality tests!"
6234
                echo " Turn on verbose messaging (-v) to $0 to see the final report."
6235
                echo " If you believe this message is in error you may use the continue"
6236
                echo " switch (-continue) to $0 to continue."
6237
                exit 101
6238
            else
6239
                CFG_QGTKSTYLE=no
6240
            fi
6241
        fi
6242
    elif [ "$CFG_GLIB" = "no" ]; then
6243
        CFG_QGTKSTYLE=no
6244
    fi
6245
fi # X11
6246
6247
6248
if [ "$PLATFORM_MAC" = "yes" ]; then
6249
    if [ "$CFG_PHONON" != "no" ]; then
6250
        # Always enable Phonon (unless it was explicitly disabled)
6251
        CFG_PHONON=yes
6252
    fi
6253
6254
    if [ "$CFG_COREWLAN" = "auto" ]; then
6255
        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
6256
            CFG_COREWLAN=yes
6257
        else
6258
            CFG_COREWLAN=no
6259
        fi
6260
    fi
6261
fi
6262
6263
6264
if [ "$PLATFORM_QPA" = "yes" ]; then
6265
    # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x)
6266
    if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
6267
        if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengldesktop "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
6268
            CFG_OPENGL=desktop
6269
        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
6270
            CFG_OPENGL=es2
6271
        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
6272
            CFG_OPENGL=es1
6273
        else
6274
            if [ "$CFG_OPENGL" = "yes" ]; then
6275
                echo "All the OpenGL functionality tests failed!"
6276
                echo " You might need to modify the include and library search paths by editing"
6277
                echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
6278
                echo " ${XQMAKESPEC}."
6279
                exit 1
6280
            fi
6281
            CFG_OPENGL=no
6282
        fi
6283
    elif [ "$CFG_OPENGL" = "es1" ]; then
6284
        # OpenGL ES 1.x
6285
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS
6286
        if [ $? != "0" ]; then
6287
            echo "The OpenGL ES 1.x functionality test failed!"
6288
            echo " You might need to modify the include and library search paths by editing"
6289
            echo " QMAKE_INCDIR_OPENGL_ES1, QMAKE_LIBDIR_OPENGL_ES1 and QMAKE_LIBS_OPENGL_ES1 in"
6290
            echo " ${XQMAKESPEC}."
6291
            exit 1
6292
        fi
6293
    elif [ "$CFG_OPENGL" = "es2" ]; then
6294
        #OpenGL ES 2.x
6295
        if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists glesv2 2>/dev/null; then
6296
            QMAKE_INCDIR_OPENGL_ES2=`$PKG_CONFIG --variable=includedir glesv2 2>/dev/null`
6297
            QMAKE_LIBDIR_OPENGL_ES2=`$PKG_CONFIG --variable=libdir glesv2 2>/dev/null`
6298
            QMAKE_LIBS_OPENGL_ES2=`$PKG_CONFIG --libs glesv2 2>/dev/null`
6299
            QMAKE_CFLAGS_OPENGL_ES2=`$PKG_CONFIG --cflags glesv2 2>/dev/null`
6300
            QMakeVar set QMAKE_INCDIR_OPENGL_ES2 "$QMAKE_INCDIR_OPENGL_ES2"
6301
            QMakeVar set QMAKE_LIBDIR_OPENGL_ES2 "$QMAKE_LIBDIR_OPENGL_ES2"
6302
            QMakeVar set QMAKE_LIBS_OPENGL_ES2 "$QMAKE_LIBS_OPENGL_ES2"
6303
        fi
6304
6305
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2
6306
        if [ $? != "0" ]; then
6307
            echo "The OpenGL ES 2.0 functionality test failed!"
6308
            echo " You might need to modify the include and library search paths by editing"
6309
            echo " QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in"
6310
            echo " ${XQMAKESPEC}."
6311
            exit 1
6312
        fi
6313
    elif [ "$CFG_OPENGL" = "desktop" ]; then
6314
        # Desktop OpenGL support
6315
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengldesktop "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
6316
        if [ $? != "0" ]; then
6317
            echo "The OpenGL functionality test failed!"
6318
            echo " You might need to modify the include and library search paths by editing"
6319
            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
6320
            echo " ${XQMAKESPEC}."
6321
            exit 1
6322
        fi
6323
    fi
6324
6325
    # auto-detect FontConfig support
6326
    if [ "$CFG_FONTCONFIG" != "no" ]; then
6327
        if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig --exists freetype2 2>/dev/null; then
6328
            QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig --cflags freetype2 2>/dev/null`
6329
            QT_LIBS_FONTCONFIG=`$PKG_CONFIG --libs fontconfig --libs freetype2 2>/dev/null`
6330
        else
6331
            QT_CFLAGS_FONTCONFIG=
6332
            QT_LIBS_FONTCONFIG="-lfreetype -lfontconfig"
6333
        fi
6334
        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
6335
                QT_CONFIG="$QT_CONFIG fontconfig"
6336
                QMakeVar set QMAKE_CFLAGS_FONTCONFIG "$QT_CFLAGS_FONTCONFIG"
6337
                QMakeVar set QMAKE_LIBS_FONTCONFIG "$QT_LIBS_FONTCONFIG"
6338
                CFG_LIBFREETYPE=system
6339
        fi
6340
6341
    fi
6342
6343
    if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists wayland-client 2>/dev/null; then
6344
        QMAKE_CFLAGS_WAYLAND=`$PKG_CONFIG --cflags wayland-client 2>/dev/null`
6345
        QMAKE_LIBS_WAYLAND=`$PKG_CONFIG --libs wayland-client 2>/dev/null`
6346
        QMAKE_INCDIR_WAYLAND=`$PKG_CONFIG --variable=includedir wayland-client 2>/dev/null`
6347
        QMAKE_LIBDIR_WAYLAND=`$PKG_CONFIG --variable=libdir wayland-client 2>/dev/null`
6348
6349
        if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists xkbcommon 2>/dev/null; then
6350
            QMAKE_CFLAGS_WAYLAND="$QMAKE_CFLAGS_WAYLAND `$PKG_CONFIG --cflags xkbcommon 2>/dev/null`"
6351
            QMAKE_LIBS_WAYLAND="$QMAKE_LIBS_WAYLAND `$PKG_CONFIG --libs xkbcommon 2>/dev/null`"
6352
        else
6353
            QMAKE_DEFINES_WAYLAND=QT_NO_WAYLAND_XKB
6354
        fi
6355
    fi
6356
6357
    # QMake variables set here override those in the mkspec. Therefore we only set the variables here if they are not zero.
6358
    if [ -n "$QMAKE_CFLAGS_WAYLAND" ] || [ -n "$QMAKE_LIBS_WAYLAND" ]; then
6359
        QMakeVar set QMAKE_CFLAGS_WAYLAND "$QMAKE_CFLAGS_WAYLAND"
6360
        QMakeVar set QMAKE_INCDIR_WAYLAND "$QMAKE_INCDIR_WAYLAND"
6361
        QMakeVar set QMAKE_LIBS_WAYLAND "$QMAKE_LIBS_WAYLAND"
6362
        QMakeVar set QMAKE_LIBDIR_WAYLAND "$QMAKE_LIBDIR_WAYLAND"
6363
        QMakeVar set QMAKE_DEFINES_WAYLAND " $QMAKE_DEFINES_WAYLAND"
6364
    fi
6365
6366
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qpa/wayland "Wayland" $L_FLAGS $I_FLAGS $l_FLAGS $QMAKE_CFLAGS_WAYLAND $QMAKE_LIBS_WAYLAND; then
6367
        QT_CONFIG="$QT_CONFIG wayland"
6368
    fi
6369
6370
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
6371
        QT_CONFIG="$QT_CONFIG coreservices"
6372
    else
6373
        QMakeVar add DEFINES QT_NO_CORESERVICES
6374
    fi
6375
6376
fi
6377
6378
6379
# QWS
6380
if [ "$PLATFORM_QWS" = "yes" ]; then
6381
6382
    # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x)
6383
    if [ "$CFG_GUI" = "no" ]; then
6384
        if [ "$CFG_OPENGL" = "auto" ]; then
6385
            CFG_OPENGL=no
6386
        fi
6387
        if [ "$CFG_OPENGL" != "no" ]; then
6388
            echo "OpenGL enabled, but GUI disabled."
6389
            echo " You might need to either enable the GUI or disable OpenGL"
6390
            exit 1
6391
        fi
6392
    fi
6393
    if [ "$CFG_OPENGL" = "yes" ]; then
6394
        CFG_EGL=auto
6395
        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
6396
            CFG_OPENGL=es2
6397
    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
6398
            CFG_OPENGL=es1
6399
        else
6400
            echo "All the OpenGL ES functionality tests failed!"
6401
            echo " You might need to modify the include and library search paths by editing"
6402
            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
6403
            echo " ${XQMAKESPEC}."
6404
            exit 1
6405
        fi
6406
    elif [ "$CFG_OPENGL" = "es1" ]; then
6407
        # OpenGL ES 1.x
6408
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS
6409
        if [ $? != "0" ]; then
6410
            echo "The OpenGL ES 1.x functionality test failed!"
6411
            echo " You might need to modify the include and library search paths by editing"
6412
            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
6413
            echo " ${XQMAKESPEC}."
6414
            exit 1
6415
        fi
6416
        CFG_EGL=yes
6417
    elif [ "$CFG_OPENGL" = "es2" ]; then
6418
        #OpenGL ES 2.x
6419
        "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS
6420
        if [ $? != "0" ]; then
6421
            echo "The OpenGL ES 2.0 functionality test failed!"
6422
            echo " You might need to modify the include and library search paths by editing"
6423
            echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
6424
            echo " ${XQMAKESPEC}."
6425
            exit 1
6426
        fi
6427
        CFG_EGL=yes
6428
    elif [ "$CFG_OPENGL" = "desktop" ]; then
6429
        # Desktop OpenGL support
6430
        echo "Desktop OpenGL support is not avaliable on Qt for Embedded Linux"
6431
        exit 1
6432
    fi
6433
fi
6434
6435
if [ "$PLATFORM_QWS" = "yes" ]; then
6436
6437
    # screen drivers
6438
    for screen in ${CFG_GFX_ON} ${CFG_GFX_PLUGIN}; do
6439
       if [ "${screen}" = "ahi" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
6440
           "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/ahi "Ahi" $L_FLAGS $I_FLAGS $l_FLAGS
6441
           if [ $? != "0" ]; then
6442
               echo "The Ahi screen driver functionality test failed!"
6443
               echo " You might need to modify the include and library search paths by editing"
6444
               echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
6445
               echo " ${XQMAKESPEC}."
6446
               exit 1
6447
           fi
6448
       fi
6449
6450
       if [ "${screen}" = "svgalib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
6451
           "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/svgalib "SVGAlib" $L_FLAGS $I_FLAGS $l_FLAGS
6452
           if [ $? != "0" ]; then
6453
               echo "The SVGAlib screen driver functionality test failed!"
6454
               echo " You might need to modify the include and library search paths by editing"
6455
               echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
6456
               echo " ${XQMAKESPEC}."
6457
               exit 1
6458
           fi
6459
       fi
6460
6461
       if [ "${screen}" = "directfb" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
6462
           if test -n "$PKG_CONFIG" && "$PKG_CONFIG" --exists directfb 2>/dev/null; then
6463
               QT_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
6464
               QT_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
6465
           elif directfb-config --version >/dev/null 2>&1; then
6466
               QT_CFLAGS_DIRECTFB=`directfb-config --cflags 2>/dev/null`
6467
               QT_LIBS_DIRECTFB=`directfb-config --libs 2>/dev/null`
6468
           fi
6469
6470
           # QMake variables set here override those in the mkspec. Therefore we only set the variables here if they are not zero.
6471
           if [ -n "$QT_CFLAGS_DIRECTFB" ] || [ -n "$QT_LIBS_DIRECTFB" ]; then
6472
               QMakeVar set QT_CFLAGS_DIRECTFB "$QT_CFLAGS_DIRECTFB"
6473
               QMakeVar set QT_LIBS_DIRECTFB "$QT_LIBS_DIRECTFB"
6474
           fi
6475
           if [ "$CFG_QT3SUPPORT" = "yes" ]; then
6476
               QMakeVar set QT_DEFINES_DIRECTFB "QT3_SUPPORT"
6477
           fi
6478
6479
           "$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
6480
           if [ $? != "0" ]; then
6481
               echo "The DirectFB screen driver functionality test failed!"
6482
               echo " You might need to modify the include and library search paths by editing"
6483
               echo " QT_CFLAGS_DIRECTFB and QT_LIBS_DIRECTFB in"
6484
               echo " ${XQMAKESPEC}."
6485
               exit 1
6486
           fi
6487
       fi
6488
6489
    done
6490
6491
    # mouse drivers
6492
    for mouse in ${CFG_MOUSE_ON} ${CFG_MOUSE_PLUGIN}; do
6493
	if [ "${mouse}" = "tslib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
6494
	    "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tslib "tslib" $L_FLAGS $I_FLAGS $l_FLAGS
6495
            if [ $? != "0" ]; then
6496
               echo "The tslib functionality test failed!"
6497
               echo " You might need to modify the include and library search paths by editing"
6498
               echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
6499
               echo " ${XQMAKESPEC}."
6500
		exit 1
6501
	    fi
6502
	fi
6503
    done
6504
6505
    CFG_QGTKSTYLE=no
6506
6507
    # sound
6508
    "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/sound "sound" $L_FLAGS $I_FLAGS $l_FLAGS
6509
    if [ $? != "0" ]; then
6510
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SOUND"
6511
    fi
6512
6513
fi # QWS
6514
6515
EGL_VARIANT=none
6516
# EGL Support
6517
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
6518
    if [ "$CFG_EGL" != "no" ]; then
6519
        # detect EGL support
6520
        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
6521
            # EGL specified by QMAKE_*_EGL, included with <EGL/egl.h>
6522
            EGL_VARIANT=regular
6523
            CFG_EGL=yes
6524
        fi
6525
6526
        # Prefer this variant for ES1
6527
        if [ "$CFG_OPENGL" = "es1" -o "$EGL_VARIANT" = "none" ]; then
6528
            if "$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
6529
                # EGL specified by QMAKE_*_EGL, included with <GLES/egl.h>
6530
                EGL_VARIANT=gles
6531
                CFG_EGL=yes
6532
                CFG_EGL_GLES_INCLUDES=yes
6533
            fi
6534
        fi
6535
6536
        if [ "$EGL_VARIANT" = "none" ]; then
6537
            if [ "$CFG_EGL" = "yes" ]; then
6538
                echo "The EGL functionality test failed!"
6539
                echo " EGL is required for OpenGL ES to manage contexts & surfaces."
6540
                echo " You might need to modify the include and library search paths by editing"
6541
                echo " QMAKE_INCDIR_EGL, QMAKE_LIBDIR_EGL and QMAKE_LIBS_EGL in"
6542
                echo " ${XQMAKESPEC}."
6543
                exit 1
6544
            fi
6545
            CFG_EGL=no
6546
            # If QtOpenGL would be built against OpenGL ES, disable it as we can't to that if EGL is missing
6547
            if [ "$CFG_OPENGL" = "es1" -o "$CFG_OPENGL" = "es2" ]; then
6548
                CFG_OPENGL=no
6549
            fi
6550
        fi
6551
    fi
6552
fi
6553
6554
[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_PHONON" != "no" ] && CFG_PHONON="yes"
6555
6556
# freetype support
6557
[ "x$CFG_EMBEDDED" != "xno" ] && CFG_LIBFREETYPE="$CFG_QWS_FREETYPE"
6558
[ "x$PLATFORM_MAC" = "xyes" ] && CFG_LIBFREETYPE=no
6559
[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_LIBFREETYPE" = "auto" ] && CFG_LIBFREETYPE=no
6560
if [ "$CFG_LIBFREETYPE" = "auto" ]; then
6561
    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
6562
        CFG_LIBFREETYPE=system
6563
    else
6564
        CFG_LIBFREETYPE=yes
6565
    fi
6566
fi
6567
6568
if [ "$CFG_ENDIAN" = "auto" ]; then
6569
    if [ "$XPLATFORM_MINGW" = "yes" ]; then
6570
        CFG_ENDIAN="Q_LITTLE_ENDIAN"
6571
    elif [ "$XPLATFORM_SYMBIAN_SBSV2" = "yes" ]; then
6572
        CFG_ENDIAN="Q_LITTLE_ENDIAN"
6573
    elif [ "$PLATFORM_MAC" = "yes" ] && [ "$XPLATFORM_SYMBIAN" = "no" ]; then
6574
        true #leave as auto
6575
    else
6576
        "$unixtests/endian.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
6577
	F="$?"
6578
        if [ "$F" -eq 0 ]; then
6579
            CFG_ENDIAN="Q_LITTLE_ENDIAN"
6580
        elif [ "$F" -eq 1 ]; then
6581
            CFG_ENDIAN="Q_BIG_ENDIAN"
6582
        else
6583
            echo
6584
	    echo "The target system byte order could not be detected!"
6585
	    echo "Turn on verbose messaging (-v) to see the final report."
6586
	    echo "You can use the -little-endian or -big-endian switch to"
6587
	    echo "$0 to continue."
6588
            exit 101
6589
        fi
6590
    fi
6591
fi
6592
6593
if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
6594
    if [ "$PLATFORM_MAC" = "yes" ]; then
6595
	true #leave as auto
6596
    else
6597
        "$unixtests/endian.test" "$QMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
6598
	F="$?"
6599
        if [ "$F" -eq 0 ]; then
6600
            CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
6601
        elif [ "$F" -eq 1 ]; then
6602
            CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
6603
        else
6604
            echo
6605
	    echo "The host system byte order could not be detected!"
6606
	    echo "Turn on verbose messaging (-v) to see the final report."
6607
	    echo "You can use the -host-little-endian or -host-big-endian switch to"
6608
	    echo "$0 to continue."
6609
            exit 101
6610
        fi
6611
    fi
6612
fi
6613
6614
if [ "$CFG_ARMFPA" != "auto" ]; then
6615
    if [ "$CFG_ARMFPA" = "yes" ]; then
6616
        if [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
6617
            CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
6618
        else
6619
            CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
6620
        fi
6621
    else
6622
        CFG_DOUBLEFORMAT="normal"
6623
    fi
6624
fi
6625
6626
6627
if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then
6628
    if [ "$PLATFORM_QWS" != "yes" -o "$PLATFORM_QPA" = "yes" ]; then
6629
        CFG_DOUBLEFORMAT=normal
6630
    else
6631
        "$unixtests/doubleformat.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
6632
	F="$?"
6633
        if [ "$F" -eq 10 ] && [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
6634
            CFG_DOUBLEFORMAT=normal
6635
        elif [ "$F" -eq 11 ] && [ "$CFG_ENDIAN" = "Q_BIG_ENDIAN" ]; then
6636
            CFG_DOUBLEFORMAT=normal
6637
        elif [ "$F" -eq 10 ]; then
6638
            CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE"
6639
        elif [ "$F" -eq 11 ]; then
6640
            CFG_DOUBLEFORMAT="Q_DOUBLE_BIG"
6641
        elif [ "$F" -eq 12 ]; then
6642
            CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
6643
            CFG_ARMFPA="yes"
6644
        elif [ "$F" -eq 13 ]; then
6645
            CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
6646
            CFG_ARMFPA="yes"
6647
        else
6648
            echo
6649
	    echo "The system floating point format could not be detected."
6650
	    echo "This may cause data to be generated in a wrong format"
6651
	    echo "Turn on verbose messaging (-v) to see the final report."
6652
	    # we do not fail on this since this is a new test, and if it fails,
6653
	    # the old behavior should be correct in most cases
6654
            CFG_DOUBLEFORMAT=normal
6655
        fi
6656
    fi
6657
fi
6658
6659
HAVE_STL=no
6660
if [ "$XPLATFORM_SYMBIAN" = "yes" ] || [ "$XPLATFORM_INTEGRITY" = "yes" ] || "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then
6661
    HAVE_STL=yes
6662
fi
6663
6664
if [ "$CFG_STL" != "no" ]; then
6665
    if [ "$HAVE_STL" = "yes" ]; then
6666
        CFG_STL=yes
6667
    else
6668
        if [ "$CFG_STL" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6669
            echo "STL support cannot be enabled due to functionality tests!"
6670
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6671
            echo " If you believe this message is in error you may use the continue"
6672
            echo " switch (-continue) to $0 to continue."
6673
            exit 101
6674
        else
6675
            CFG_STL=no
6676
        fi
6677
    fi
6678
fi
6679
6680
# find if the platform supports IPv6
6681
if [ "$CFG_IPV6" != "no" ]; then
6682
    if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
6683
        #IPV6 should always be enabled for Symbian release
6684
        CFG_IPV6=yes
6685
    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
6686
        CFG_IPV6=yes
6687
    else
6688
        if [ "$CFG_IPV6" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6689
            echo "IPv6 support cannot be enabled due to functionality tests!"
6690
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6691
            echo " If you believe this message is in error you may use the continue"
6692
            echo " switch (-continue) to $0 to continue."
6693
            exit 101
6694
        else
6695
            CFG_IPV6=no
6696
        fi
6697
    fi
6698
fi
6699
6700
# detect POSIX clock_gettime()
6701
if [ "$CFG_CLOCK_GETTIME" = "auto" ]; then
6702
    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
6703
	CFG_CLOCK_GETTIME=yes
6704
    else
6705
	CFG_CLOCK_GETTIME=no
6706
    fi
6707
fi
6708
6709
# detect POSIX monotonic clocks
6710
if [ "$CFG_CLOCK_GETTIME" = "yes" ] && [ "$CFG_CLOCK_MONOTONIC" = "auto" ]; then
6711
    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
6712
	CFG_CLOCK_MONOTONIC=yes
6713
    else
6714
	CFG_CLOCK_MONOTONIC=no
6715
    fi
6716
elif [ "$CFG_CLOCK_GETTIME" = "no" ]; then
6717
    CFG_CLOCK_MONOTONIC=no
6718
fi
6719
6720
# detect mremap
6721
if [ "$CFG_MREMAP" = "auto" ]; then
6722
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mremap "mremap" $L_FLAGS $I_FLAGS $l_FLAGS; then
6723
	CFG_MREMAP=yes
6724
    else
6725
	CFG_MREMAP=no
6726
    fi
6727
fi
6728
6729
# find if the platform provides getaddrinfo (ipv6 dns lookups)
6730
if [ "$CFG_GETADDRINFO" != "no" ]; then
6731
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getaddrinfo "getaddrinfo" $L_FLAGS $I_FLAGS $l_FLAGS; then
6732
        CFG_GETADDRINFO=yes
6733
    else
6734
	if [ "$CFG_GETADDRINFO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6735
            echo "getaddrinfo support cannot be enabled due to functionality tests!"
6736
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6737
            echo " If you believe this message is in error you may use the continue"
6738
            echo " switch (-continue) to $0 to continue."
6739
            exit 101
6740
	else
6741
	    CFG_GETADDRINFO=no
6742
	fi
6743
    fi
6744
fi
6745
6746
# find if the platform provides inotify
6747
if [ "$CFG_INOTIFY" != "no" ]; then
6748
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/inotify "inotify" $L_FLAGS $I_FLAGS $l_FLAGS; then
6749
        CFG_INOTIFY=yes
6750
    else
6751
	if [ "$CFG_INOTIFY" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6752
            echo "inotify support cannot be enabled due to functionality tests!"
6753
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6754
            echo " If you believe this message is in error you may use the continue"
6755
            echo " switch (-continue) to $0 to continue."
6756
            exit 101
6757
	else
6758
	    CFG_INOTIFY=no
6759
	fi
6760
    fi
6761
fi
6762
6763
# find if the platform provides if_nametoindex (ipv6 interface name support)
6764
if [ "$CFG_IPV6IFNAME" != "no" ]; then
6765
    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
6766
        CFG_IPV6IFNAME=yes
6767
    else
6768
        if [ "$CFG_IPV6IFNAME" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6769
            echo "IPv6 interface name support cannot be enabled due to functionality tests!"
6770
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6771
            echo " If you believe this message is in error you may use the continue"
6772
            echo " switch (-continue) to $0 to continue."
6773
            exit 101
6774
        else
6775
	    CFG_IPV6IFNAME=no
6776
	fi
6777
    fi
6778
fi
6779
6780
# find if the platform provides getifaddrs (network interface enumeration)
6781
if [ "$CFG_GETIFADDRS" != "no" ]; then
6782
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getifaddrs "getifaddrs" $L_FLAGS $I_FLAGS $l_FLAGS; then
6783
        CFG_GETIFADDRS=yes
6784
    else
6785
        if [ "$CFG_GETIFADDRS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6786
            echo "getifaddrs support cannot be enabled due to functionality tests!"
6787
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6788
            echo " If you believe this message is in error you may use the continue"
6789
            echo " switch (-continue) to $0 to continue."
6790
            exit 101
6791
        else
6792
	    CFG_GETIFADDRS=no
6793
	fi
6794
    fi
6795
fi
6796
6797
# detect OpenSSL
6798
if [ "$CFG_OPENSSL" != "no" ] && [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
6799
    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
6800
        if [ "$CFG_OPENSSL" = "auto" ]; then
6801
            CFG_OPENSSL=yes
6802
        fi
6803
    else
6804
        if ( [ "$CFG_OPENSSL" = "yes" ] || [ "$CFG_OPENSSL" = "linked" ] ) && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6805
            echo "OpenSSL support cannot be enabled due to functionality tests!"
6806
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6807
            echo " If you believe this message is in error you may use the continue"
6808
            echo " switch (-continue) to $0 to continue."
6809
            exit 101
6810
        else
6811
            CFG_OPENSSL=no
6812
        fi
6813
    fi
6814
else
6815
    if [ "$CFG_OPENSSL" = "auto" ] && [ "$XPLATFORM_SYMBIAN_SBSV2" = "yes" ]; then
6816
        #OpenSSl should be enabled for Symbian release
6817
        CFG_OPENSSL=yes
6818
    fi
6819
fi
6820
6821
# detect OpenVG support
6822
if [ "$CFG_OPENVG" != "no" ] && [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
6823
    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
6824
        if [ "$CFG_OPENVG" = "auto" ]; then
6825
            CFG_OPENVG=yes
6826
        fi
6827
    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
6828
        if [ "$CFG_OPENVG" = "auto" ]; then
6829
            CFG_OPENVG=yes
6830
        fi
6831
        CFG_OPENVG_ON_OPENGL=yes
6832
    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
6833
        if [ "$CFG_OPENVG" = "auto" ]; then
6834
            CFG_OPENVG=yes
6835
        fi
6836
        CFG_OPENVG_LC_INCLUDES=yes
6837
    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
6838
        if [ "$CFG_OPENVG" = "auto" ]; then
6839
            CFG_OPENVG=yes
6840
        fi
6841
        CFG_OPENVG_LC_INCLUDES=yes
6842
        CFG_OPENVG_ON_OPENGL=yes
6843
    else
6844
        if [ "$CFG_OPENVG" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
6845
            echo "$CFG_OPENVG was specified for OpenVG but cannot be enabled due to functionality tests!"
6846
            echo " Turn on verbose messaging (-v) to $0 to see the final report."
6847
            echo " If you believe this message is in error you may use the continue"
6848
            echo " switch (-continue) to $0 to continue."
6849
            exit 101
6850
        else
6851
            CFG_OPENVG=no
6852
        fi
6853
    fi
6854
    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
6855
        CFG_OPENVG_SHIVA=yes
6856
    fi
6857
fi
6858
6859
# if openvg is disabled and the user specified graphicssystem vg, disable it...
6860
if [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && [ "$CFG_OPENVG" = "no" ]; then
6861
    echo "OpenVG Graphics System is disabled due to missing OpenVG support..."
6862
    CFG_GRAPHICS_SYSTEM=default
6863
fi
6864
6865
if [ -n "$CFG_RUNTIME_SYSTEM" -a "$CFG_GRAPHICS_SYSTEM" != "runtime" ] || [ "$CFG_RUNTIME_SYSTEM" = "runtime" ]; then
6866
    echo "Argument to -runtimegraphicssystem is invalid so ignoring..."
6867
    CFG_RUNTIME_SYSTEM=
6868
fi
6869
6870
if [ "$CFG_PTMALLOC" != "no" ]; then
6871
    # build ptmalloc, copy .a file to lib/
6872
    echo "Building ptmalloc. Please wait..."
6873
    (cd "$relpath/src/3rdparty/ptmalloc/"; "$MAKE" "clean" ; "$MAKE" "posix"
6874
     mkdir "$outpath/lib/" ; cp "libptmalloc3.a" "$outpath/lib/")
6875
6876
    QMakeVar add QMAKE_LFLAGS "$outpath/lib/libptmalloc3.a"
6877
fi
6878
6879
if [ "$CFG_ALSA" = "auto" ] && [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
6880
    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/alsa "alsa" $L_FLAGS $I_FLAGS $l_FLAGS; then
6881
        CFG_ALSA=yes
6882
    else
6883
        CFG_ALSA=no
6884
    fi
6885
elif [ "$XPLATFORM_SYMBIAN_SBSV2" = "yes" ]; then
6886
    # Disabled for Symbian release
6887
    CFG_ALSA=no
6888
fi
6889
6890
if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then 
6891
    if [ "$CFG_ARCH" = "arm" ]; then
6892
       "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/javascriptcore-jit "javascriptcore-jit" $L_FLAGS $I_FLAGS $l_FLAGS
6893
        if [ $? != "0" ]; then
6894
           CFG_JAVASCRIPTCORE_JIT=no
6895
        fi
6896
    else
6897
	case "$XPLATFORM" in
6898
	    symbian-gcce)
6899
		CFG_JAVASCRIPTCORE_JIT=no
6900
		;;
6901
	    linux-icc*)
6902
		CFG_JAVASCRIPTCORE_JIT=no
6903
		;;
6904
	esac
6905
    fi
6906
fi
6907
6908
if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ]; then
6909
    QMakeVar set JAVASCRIPTCORE_JIT yes
6910
elif [ "$CFG_JAVASCRIPTCORE_JIT" = "no" ]; then
6911
    QMakeVar set JAVASCRIPTCORE_JIT no
6912
fi
6913
6914
if [ "$CFG_AUDIO_BACKEND" = "auto" ]; then
6915
    if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
6916
         if "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/audio "audio" $L_FLAGS $I_FLAGS $l_FLAGS ; then
6917
            CFG_AUDIO_BACKEND=yes
6918
         fi
6919
    else
6920
        CFG_AUDIO_BACKEND=yes
6921
    fi
6922
fi
6923
6924
if [ "$CFG_LARGEFILE" != "yes" ] && [ "$XPLATFORM_MINGW" = "yes" ]; then
6925
    echo "Warning: largefile support cannot be disabled for win32."
6926
    CFG_LARGEFILE="yes"
6927
elif [ "$CFG_LARGEFILE" != "no" ] && [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
6928
    echo "Warning: largefile support cannot be enabled for symbian."
6929
    CFG_LARGEFILE="no"
6930
fi
6931
6932
#-------------------------------------------------------------------------------
6933
# ask for all that hasn't been auto-detected or specified in the arguments
6934
#-------------------------------------------------------------------------------
6935
6936
### fix this: user input should be validated in a loop
6937
if [ "$PLATFORM_QWS" = "yes" ]; then
6938
    PROMPT_FOR_DEPTHS="yes"
6939
else
6940
    PROMPT_FOR_DEPTHS="no"
6941
fi
6942
if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PROMPT_FOR_DEPTHS" = "yes" ]; then
6943
    echo
6944
    echo "Choose pixel-depths to support:"
6945
    echo
6946
    echo "   1. 1bpp, black/white"
6947
    echo "   4. 4bpp, grayscale"
6948
    echo "   8. 8bpp, paletted"
6949
    echo "  12. 12bpp, rgb 4-4-4"
6950
    echo "  15. 15bpp, rgb 5-5-5"
6951
    echo "  16. 16bpp, rgb 5-6-5"
6952
    echo "  18. 18bpp, rgb 6-6-6"
6953
    echo "  24. 24bpp, rgb 8-8-8"
6954
    echo "  32. 32bpp, argb 8-8-8-8 and rgb 8-8-8"
6955
    echo " all. All supported depths"
6956
    echo
6957
    echo "Your choices (default 8,16,32):"
6958
    read CFG_QWS_DEPTHS
6959
    if [ -z "$CFG_QWS_DEPTHS" ] || [ "$CFG_QWS_DEPTHS" = "yes" ]; then
6960
        CFG_QWS_DEPTHS=8,16,32
6961
    fi
6962
fi
6963
if [ -n "$CFG_QWS_DEPTHS" -a "$PLATFORM_QWS" = "yes" ]; then
6964
    if [ "$CFG_QWS_DEPTHS" = "all" ]; then
6965
        CFG_QWS_DEPTHS="1 4 8 12 15 16 18 24 32 generic"
6966
    fi
6967
    for D in `echo "$CFG_QWS_DEPTHS" | sed -e 's/,/ /g'`; do
6968
	case $D in
6969
	    1|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";;
6970
	    generic) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_GENERIC";;
6971
	esac
6972
    done
6973
fi
6974
6975
# enable dwarf2 support on Mac
6976
if [ "$CFG_MAC_DWARF2" = "yes" ]; then
6977
    QT_CONFIG="$QT_CONFIG dwarf2"
6978
fi
6979
6980
# Set the default arch if there are no "-arch" arguments on the configure line
6981
# For "-carbon" builds: 32 bit x86/ppc.
6982
# For builds on snow leopard : compiler default (64-bit).
6983
# For builds on leopard : compiler default (32-bit).
6984
if [ "$PLATFORM_MAC" = "yes" ]  && [ "$CFG_MAC_ARCHS" = "" ]; then
6985
    source "$mactests/defaultarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests"
6986
6987
	if [ "$CFG_MAC_CARBON" = "yes" ]; then
6988
		if [ "$QT_MAC_DEFAULT_ARCH" = "x86_64" ]; then
6989
			CFG_MAC_ARCHS=" x86"
6990
		elif [ "$QT_MAC_DEFAULT_ARCH" = "ppc64" ]; then
6991
			CFG_MAC_ARCHS=" ppc"
6992
		else
6993
			CFG_MAC_ARCHS=" $QT_MAC_DEFAULT_ARCH"
6994
		fi
6995
	else
6996
		CFG_MAC_ARCHS=" $QT_MAC_DEFAULT_ARCH"
6997
    fi
6998
6999
    [ "$OPT_VERBOSE" = "yes" ] && echo "Setting Mac architechture to$CFG_MAC_ARCHS."
7000
fi
7001
7002
# enable Cocoa and/or Carbon on Mac
7003
#  -carbon on the command line disables Cocoa, except for 64-bit archs
7004
if [ "$CFG_MAC_CARBON" = "yes" ]; then
7005
    CFG_MAC_CARBON="YES"
7006
    CFG_MAC_COCOA="NO"
7007
7008
#    check which archs are in use, enable cocoa if we find a 64-bit one
7009
    if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then
7010
        CFG_MAC_COCOA="yes";
7011
        CFG_MAC_CARBON="no";
7012
        if echo "$CFG_MAC_ARCHS" | grep -w ppc > /dev/null 2>&1; then
7013
            CFG_MAC_CARBON="yes";
7014
        fi
7015
        if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then
7016
            CFG_MAC_CARBON="yes";
7017
        fi
7018
    fi
7019
fi
7020
7021
# select Carbon on 10.4 Tiger.
7022
if [ "$PLATFORM_MAC" = "yes" ]; then
7023
    VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'`
7024
    if [ "$VERSION" == 8 ]; then
7025
        CFG_MAC_COCOA="no";
7026
        CFG_MAC_CARBON="yes";
7027
    fi
7028
fi
7029
7030
# select Carbon when using the 10.4u SDK
7031
if [ "$PLATFORM_MAC" = "yes" ]; then
7032
    if [ "TEST$CFG_SDK" = "TEST/Developer/SDKs/MacOSX10.4u.sdk/" ]; then
7033
        echo "Carbon on";
7034
        CFG_MAC_COCOA="no";
7035
        CFG_MAC_CARBON="yes";
7036
    fi
7037
fi
7038
7039
# but disable Cocoa if cross-building for mingw and symbian
7040
[ "$XPLATFORM_MINGW" = "yes" ] && CFG_MAC_COCOA="no"
7041
[ "$XPLATFORM_SYMBIAN" = "yes" ] && CFG_MAC_COCOA="no"
7042
7043
# set the global Mac deployment target. This is overridden on an arch-by-arch basis
7044
# in some cases, see code further down
7045
case "$PLATFORM,$CFG_MAC_COCOA" in
7046
    macx*,yes)
7047
	# Cocoa
7048
	QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.5
7049
	;;
7050
    macx*,no)
7051
	# gcc, Carbon
7052
	QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.4
7053
	;;
7054
esac
7055
7056
# disable Qt 3 support on VxWorks, Symbian and INTEGRITY
7057
case "$XPLATFORM" in
7058
    unsupported/vxworks*|symbian*|unsupported/integrity*)
7059
	CFG_QT3SUPPORT="no"
7060
    ;;
7061
esac
7062
7063
# enable Qt 3 support functionality
7064
if [ "$CFG_QT3SUPPORT" = "yes" ]; then
7065
    QT_CONFIG="$QT_CONFIG qt3support"
7066
fi
7067
7068
# enable Phonon
7069
if [ "$CFG_PHONON" = "yes" ]; then
7070
    QT_CONFIG="$QT_CONFIG phonon"
7071
    if [ "$CFG_PHONON_BACKEND" = "yes" ]; then
7072
        QT_CONFIG="$QT_CONFIG phonon-backend"
7073
    fi
7074
else
7075
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PHONON"
7076
fi
7077
7078
# disable accessibility
7079
if [ "$CFG_ACCESSIBILITY" = "no" ]; then
7080
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ACCESSIBILITY"
7081
else
7082
    QT_CONFIG="$QT_CONFIG accessibility"
7083
fi
7084
7085
# egl stuff does not belong in lighthouse, but rather in plugins
7086
if [ "$PLATFORM_QPA" = "yes" ]; then
7087
    CFG_EGL="no"
7088
fi
7089
7090
# enable egl
7091
if [ "$CFG_EGL" = "no" ]; then
7092
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL"
7093
else
7094
    QT_CONFIG="$QT_CONFIG egl"
7095
    if [ "$CFG_EGL_GLES_INCLUDES" = "yes" ]; then
7096
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GLES_EGL"
7097
    fi
7098
fi
7099
7100
# enable openvg
7101
if [ "$CFG_OPENVG" = "no" ]; then
7102
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENVG"
7103
else
7104
    QT_CONFIG="$QT_CONFIG openvg"
7105
    if [ "$CFG_OPENVG_LC_INCLUDES" = "yes" ]; then
7106
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LOWER_CASE_VG_INCLUDES"
7107
    fi
7108
    if [ "$CFG_OPENVG_ON_OPENGL" = "yes" ]; then
7109
        QT_CONFIG="$QT_CONFIG openvg_on_opengl"
7110
    fi
7111
    if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
7112
        QT_CONFIG="$QT_CONFIG shivavg"
7113
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SHIVAVG"
7114
    fi
7115
fi
7116
7117
if [ "$CFG_QS60STYLE" = "no" ]; then
7118
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_S60"
7119
else
7120
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_STYLE_S60"
7121
fi
7122
7123
# Just check if OpenGL is not set by command argumets for Symbian.
7124
if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
7125
        if [ "$CFG_OPENGL" = "auto" ]; then
7126
            CFG_OPENGL="no"
7127
        fi
7128
fi
7129
7130
# enable opengl
7131
if [ "$CFG_OPENGL" = "no" ]; then
7132
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENGL"
7133
else
7134
    QT_CONFIG="$QT_CONFIG opengl"
7135
fi
7136
7137
if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ]; then
7138
    if [ "$PLATFORM_QWS" = "yes" ]; then
7139
        QCONFIG_FLAGS="$QCONFIG_FLAGS Q_BACKINGSTORE_SUBSURFACES"
7140
    fi
7141
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES"
7142
fi
7143
7144
if [ "$CFG_OPENGL" = "es1" ]; then
7145
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1"
7146
    QT_CONFIG="$QT_CONFIG opengles1"
7147
fi
7148
7149
if [ "$CFG_OPENGL" = "es2" ]; then
7150
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_2"
7151
    QT_CONFIG="$QT_CONFIG opengles2"
7152
fi
7153
7154
# safe execution environment
7155
if [ "$CFG_SXE" != "no" ]; then
7156
    QT_CONFIG="$QT_CONFIG sxe"
7157
fi
7158
7159
# build up the variables for output
7160
if [ "$CFG_DEBUG" = "yes" ]; then
7161
    QMAKE_OUTDIR="${QMAKE_OUTDIR}debug"
7162
    QMAKE_CONFIG="$QMAKE_CONFIG debug"
7163
elif [ "$CFG_DEBUG" = "no" ]; then
7164
    QMAKE_OUTDIR="${QMAKE_OUTDIR}release"
7165
    QMAKE_CONFIG="$QMAKE_CONFIG release"
7166
fi
7167
if [ "$CFG_SHARED" = "yes" ]; then
7168
    QMAKE_OUTDIR="${QMAKE_OUTDIR}-shared"
7169
    QMAKE_CONFIG="$QMAKE_CONFIG shared dll"
7170
elif [ "$CFG_SHARED" = "no" ]; then
7171
    QMAKE_OUTDIR="${QMAKE_OUTDIR}-static"
7172
    QMAKE_CONFIG="$QMAKE_CONFIG static"
7173
fi
7174
if [ "$PLATFORM_QWS" = "yes" ]; then
7175
    QMAKE_OUTDIR="${QMAKE_OUTDIR}-emb-$CFG_EMBEDDED"
7176
    QMAKE_CONFIG="$QMAKE_CONFIG embedded"
7177
    QT_CONFIG="$QT_CONFIG embedded"
7178
    rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
7179
fi
7180
if [ "$PLATFORM_QPA" = "yes" ]; then
7181
    QMAKE_CONFIG="$QMAKE_CONFIG qpa"
7182
    QT_CONFIG="$QT_CONFIG qpa"
7183
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG qpa"
7184
    rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
7185
fi
7186
7187
if [ "$CFG_EMBEDDED" = "nacl" ]; then
7188
    QMAKE_CONFIG="$QMAKE_CONFIG nacl pepper"
7189
    QT_CONFIG="$QT_CONFIG nacl pepper"
7190
    rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
7191
fi
7192
7193
if [ "$XPLATFORM_MINGW" != "yes" ]; then
7194
    # Do not set this here for Windows. Let qmake do it so
7195
    # debug and release precompiled headers are kept separate.
7196
    QMakeVar set PRECOMPILED_DIR ".pch/$QMAKE_OUTDIR"
7197
fi
7198
if [ "$XPLATFORM_INTEGRITY" = "yes" ]; then
7199
    QMakeVar set OBJECTS_DIR "$PWD/work"
7200
    QMakeVar set MOC_DIR "$PWD/work"
7201
    QMakeVar set RCC_DIR "$PWD/work"
7202
    QMakeVar set UI_DIR "$PWD/work"
7203
else
7204
    QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR"
7205
    QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR"
7206
    QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR"
7207
    QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR"
7208
fi
7209
if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
7210
    QMAKE_CONFIG="$QMAKE_CONFIG largefile"
7211
fi
7212
if [ "$CFG_STL" = "no" ]; then
7213
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STL"
7214
else
7215
    QMAKE_CONFIG="$QMAKE_CONFIG stl"
7216
fi
7217
if [ "$CFG_USE_GNUMAKE" = "yes" ]; then
7218
    QMAKE_CONFIG="$QMAKE_CONFIG GNUmake"
7219
fi
7220
[ "$CFG_REDUCE_EXPORTS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_exports"
7221
[ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
7222
[ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
7223
if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
7224
    QMakeVar add QMAKE_CFLAGS -g
7225
    QMakeVar add QMAKE_CXXFLAGS -g
7226
    QMAKE_CONFIG="$QMAKE_CONFIG separate_debug_info"
7227
fi
7228
if [ "$CFG_SEPARATE_DEBUG_INFO_NOCOPY" = "yes" ] ; then
7229
    QMAKE_CONFIG="$QMAKE_CONFIG separate_debug_info_nocopy"
7230
fi
7231
[ "$CFG_MMX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mmx"
7232
[ "$CFG_3DNOW" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG 3dnow"
7233
[ "$CFG_SSE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse"
7234
[ "$CFG_SSE2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse2"
7235
[ "$CFG_SSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse3"
7236
[ "$CFG_SSSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG ssse3"
7237
[ "$CFG_SSE4_1" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_1"
7238
[ "$CFG_SSE4_2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_2"
7239
[ "$CFG_AVX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx"
7240
[ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
7241
[ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon"
7242
[ "$PLATFORM_MAC" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG $CFG_MAC_ARCHS"
7243
if [ "$CFG_IPV6" = "yes" ]; then
7244
    QT_CONFIG="$QT_CONFIG ipv6"
7245
fi
7246
if [ "$CFG_CLOCK_GETTIME" = "yes" ]; then
7247
    QT_CONFIG="$QT_CONFIG clock-gettime"
7248
fi
7249
if [ "$CFG_CLOCK_MONOTONIC" = "yes" ]; then
7250
    QT_CONFIG="$QT_CONFIG clock-monotonic"
7251
fi
7252
if [ "$CFG_MREMAP" = "yes" ]; then
7253
    QT_CONFIG="$QT_CONFIG mremap"
7254
fi
7255
if [ "$CFG_GETADDRINFO" = "yes" ]; then
7256
    QT_CONFIG="$QT_CONFIG getaddrinfo"
7257
fi
7258
if [ "$CFG_IPV6IFNAME" = "yes" ]; then
7259
    QT_CONFIG="$QT_CONFIG ipv6ifname"
7260
fi
7261
if [ "$CFG_GETIFADDRS" = "yes" ]; then
7262
    QT_CONFIG="$QT_CONFIG getifaddrs"
7263
fi
7264
if [ "$CFG_INOTIFY" = "yes" ]; then
7265
    QT_CONFIG="$QT_CONFIG inotify"
7266
fi
7267
if [ "$CFG_LIBJPEG" = "no" ]; then
7268
    CFG_JPEG="no"
7269
elif [ "$CFG_LIBJPEG" = "system" ]; then
7270
    QT_CONFIG="$QT_CONFIG system-jpeg"
7271
fi
7272
if [ "$CFG_JPEG" = "no" ]; then
7273
    QT_CONFIG="$QT_CONFIG no-jpeg"
7274
elif [ "$CFG_JPEG" = "yes" ]; then
7275
    QT_CONFIG="$QT_CONFIG jpeg"
7276
fi
7277
if [ "$CFG_LIBMNG" = "no" ]; then
7278
    CFG_MNG="no"
7279
elif [ "$CFG_LIBMNG" = "system" ]; then
7280
    QT_CONFIG="$QT_CONFIG system-mng"
7281
fi
7282
if [ "$CFG_MNG" = "no" ]; then
7283
    QT_CONFIG="$QT_CONFIG no-mng"
7284
elif [ "$CFG_MNG" = "yes" ]; then
7285
    QT_CONFIG="$QT_CONFIG mng"
7286
fi
7287
if [ "$CFG_LIBPNG" = "no" ]; then
7288
    CFG_PNG="no"
7289
fi
7290
if [ "$CFG_LIBPNG" = "system" ]; then
7291
    QT_CONFIG="$QT_CONFIG system-png"
7292
fi
7293
if [ "$CFG_PNG" = "no" ]; then
7294
    QT_CONFIG="$QT_CONFIG no-png"
7295
elif [ "$CFG_PNG" = "yes" ]; then
7296
    QT_CONFIG="$QT_CONFIG png"
7297
fi
7298
if [ "$CFG_GIF" = "no" ]; then
7299
    QT_CONFIG="$QT_CONFIG no-gif"
7300
elif [ "$CFG_GIF" = "yes" ]; then
7301
    QT_CONFIG="$QT_CONFIG gif"
7302
fi
7303
if [ "$CFG_LIBTIFF" = "no" ]; then
7304
    CFG_TIFF="no"
7305
elif [ "$CFG_LIBTIFF" = "system" ]; then
7306
    QT_CONFIG="$QT_CONFIG system-tiff"
7307
fi
7308
if [ "$CFG_TIFF" = "no" ]; then
7309
    QT_CONFIG="$QT_CONFIG no-tiff"
7310
elif [ "$CFG_TIFF" = "yes" ]; then
7311
    QT_CONFIG="$QT_CONFIG tiff"
7312
fi
7313
if [ "$CFG_LIBFREETYPE" = "no" ]; then
7314
    QT_CONFIG="$QT_CONFIG no-freetype"
7315
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FREETYPE"
7316
elif [ "$CFG_LIBFREETYPE" = "system" ]; then
7317
    QT_CONFIG="$QT_CONFIG system-freetype"
7318
else
7319
    QT_CONFIG="$QT_CONFIG freetype"
7320
fi
7321
if [ "$CFG_GUI" = "auto" ]; then
7322
    CFG_GUI="yes"
7323
fi
7324
if [ "$CFG_GUI" = "no" ]; then
7325
    QT_CONFIG="$QT_CONFIG no-gui"
7326
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GUI"
7327
fi
7328
7329
7330
if [ "x$PLATFORM_MAC" = "xyes" ] && [ "$XPLATFORM_MINGW" != "yes" ] && [ "$XPLATFORM_SYMBIAN" != "yes" ]; then
7331
    #On Mac we implicitly link against libz, so we
7332
    #never use the 3rdparty stuff.
7333
    [ "$CFG_ZLIB" = "yes" ] && CFG_ZLIB="system"
7334
fi
7335
if [ "$CFG_ZLIB" = "yes" ]; then
7336
    QT_CONFIG="$QT_CONFIG zlib"
7337
elif [ "$CFG_ZLIB" = "system" ]; then
7338
    QT_CONFIG="$QT_CONFIG system-zlib"
7339
fi
7340
7341
if [ "$CFG_S60" = "yes" ]; then
7342
    QT_CONFIG="$QT_CONFIG s60"
7343
fi
7344
7345
if [ "$CFG_SYMBIAN_DEFFILES" = "yes" ]; then
7346
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG def_files"
7347
else
7348
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG def_files_disabled"
7349
fi
7350
7351
[ "$CFG_NIS" = "yes" ] && QT_CONFIG="$QT_CONFIG nis"
7352
[ "$CFG_CUPS" = "yes" ] && QT_CONFIG="$QT_CONFIG cups"
7353
[ "$CFG_ICONV" = "yes" ] && QT_CONFIG="$QT_CONFIG iconv"
7354
[ "$CFG_ICONV" = "sun" ] && QT_CONFIG="$QT_CONFIG sun-libiconv"
7355
[ "$CFG_ICONV" = "gnu" ] && QT_CONFIG="$QT_CONFIG gnu-libiconv"
7356
[ "$CFG_GLIB" = "yes" ] && QT_CONFIG="$QT_CONFIG glib"
7357
[ "$CFG_GSTREAMER" = "yes" ] && QT_CONFIG="$QT_CONFIG gstreamer"
7358
[ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus"
7359
[ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked"
7360
[ "$CFG_NAS" = "system" ] && QT_CONFIG="$QT_CONFIG nas"
7361
[ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl"
7362
[ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked"
7363
[ "$CFG_MAC_HARFBUZZ" = "yes" ] && QT_CONFIG="$QT_CONFIG harfbuzz"
7364
7365
if [ "$PLATFORM_X11" = "yes" ]; then
7366
    [ "$CFG_SM" = "yes" ] && QT_CONFIG="$QT_CONFIG x11sm"
7367
7368
    # for some reason, the following libraries are not always built shared,
7369
    # so *every* program/lib (including Qt) has to link against them
7370
    if [ "$CFG_XSHAPE" = "yes" ]; then
7371
        QT_CONFIG="$QT_CONFIG xshape"
7372
    fi
7373
    if [ "$CFG_XVIDEO" = "yes" ]; then
7374
        QT_CONFIG="$QT_CONFIG xvideo"
7375
    fi
7376
    if [ "$CFG_XSYNC" = "yes" ]; then
7377
        QT_CONFIG="$QT_CONFIG xsync"
7378
    fi
7379
    if [ "$CFG_XINERAMA" = "yes" ]; then
7380
        QT_CONFIG="$QT_CONFIG xinerama"
7381
	QMakeVar set QMAKE_LIBS_X11 '-lXinerama $$QMAKE_LIBS_X11'
7382
    fi
7383
    if [ "$CFG_XCURSOR" = "yes" ]; then
7384
        QT_CONFIG="$QT_CONFIG xcursor"
7385
	QMakeVar set QMAKE_LIBS_X11 '-lXcursor $$QMAKE_LIBS_X11'
7386
    fi
7387
    if [ "$CFG_XFIXES" = "yes" ]; then
7388
        QT_CONFIG="$QT_CONFIG xfixes"
7389
	QMakeVar set QMAKE_LIBS_X11 '-lXfixes $$QMAKE_LIBS_X11'
7390
    fi
7391
    if [ "$CFG_XRANDR" = "yes" ]; then
7392
        QT_CONFIG="$QT_CONFIG xrandr"
7393
        if [ "$CFG_XRENDER" != "yes" ]; then
7394
            # libXrandr uses 1 function from libXrender, so we always have to have it :/
7395
	    QMakeVar set QMAKE_LIBS_X11 '-lXrandr -lXrender $$QMAKE_LIBS_X11'
7396
        else
7397
	    QMakeVar set QMAKE_LIBS_X11 '-lXrandr $$QMAKE_LIBS_X11'
7398
        fi
7399
    fi
7400
    if [ "$CFG_XRENDER" = "yes" ]; then
7401
        QT_CONFIG="$QT_CONFIG xrender"
7402
	QMakeVar set QMAKE_LIBS_X11 '-lXrender $$QMAKE_LIBS_X11'
7403
    fi
7404
    if [ "$CFG_MITSHM" = "yes" ]; then
7405
        QT_CONFIG="$QT_CONFIG mitshm"
7406
    fi
7407
    if [ "$CFG_FONTCONFIG" = "yes" ]; then
7408
        QT_CONFIG="$QT_CONFIG fontconfig"
7409
    fi
7410
    if [ "$CFG_XINPUT" = "yes" ]; then
7411
	QMakeVar set QMAKE_LIBS_X11 '-lXi $$QMAKE_LIBS_X11'
7412
    fi
7413
    if [ "$CFG_XINPUT" = "yes" ]; then
7414
        QT_CONFIG="$QT_CONFIG xinput tablet"
7415
    fi
7416
    if [ "$CFG_XKB" = "yes" ]; then
7417
        QT_CONFIG="$QT_CONFIG xkb"
7418
    fi
7419
fi
7420
7421
[ '!' -z "$D_FLAGS" ] && QMakeVar add DEFINES "$D_FLAGS"
7422
[ '!' -z "$L_FLAGS" ] && QMakeVar add QMAKE_LIBDIR_FLAGS "$L_FLAGS"
7423
[ '!' -z "$l_FLAGS" ] && QMakeVar add LIBS "$l_FLAGS"
7424
7425
if [ "$PLATFORM_MAC" = "yes" ]; then
7426
    if [ "$CFG_RPATH" = "yes" ]; then
7427
       QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname"
7428
    fi
7429
elif [ -z "`getXQMakeConf 'QMAKE_(LFLAGS_)?RPATH'`" ]; then
7430
    if [ -n "$RPATH_FLAGS" ]; then
7431
        echo
7432
        echo "ERROR: -R cannot be used on this platform as \$QMAKE_LFLAGS_RPATH is"
7433
        echo "       undefined."
7434
        echo
7435
        exit 1
7436
    elif [ "$CFG_RPATH" = "yes" ]; then
7437
        RPATH_MESSAGE="        NOTE: This platform does not support runtime library paths, using -no-rpath."
7438
        CFG_RPATH=no
7439
    fi
7440
else
7441
    if [ "$CFG_RPATH" = "yes" ]; then
7442
        # set the default rpath to the library installation directory
7443
        RPATH_FLAGS="\"$QT_INSTALL_LIBS\" $RPATH_FLAGS"
7444
    fi
7445
    if [ -n "$RPATH_FLAGS" ]; then
7446
        # add the user defined rpaths
7447
	QMakeVar add QMAKE_RPATHDIR "$RPATH_FLAGS"
7448
    fi
7449
fi
7450
7451
if [ '!' -z "$I_FLAGS" ]; then
7452
    # add the user define include paths
7453
    QMakeVar add QMAKE_CFLAGS "$I_FLAGS"
7454
    QMakeVar add QMAKE_CXXFLAGS "$I_FLAGS"
7455
fi
7456
7457
# turn off exceptions for the compilers that support it
7458
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
7459
    COMPILER=`echo $XPLATFORM | cut -f 3- -d-`
7460
elif [ "$XPLATFORM" != "$PLATFORM" ]; then
7461
    COMPILER=`echo $XPLATFORM | cut -f 2- -d-`
7462
else
7463
    COMPILER=`echo $PLATFORM | cut -f 2- -d-`
7464
fi
7465
if [ "$CFG_EXCEPTIONS" = "unspecified" -a "$PLATFORM_QWS" = "yes" ]; then
7466
    CFG_EXCEPTIONS=no
7467
fi
7468
7469
if [ "$CFG_EXCEPTIONS" != "no" ]; then
7470
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG exceptions"
7471
fi
7472
7473
if [ "$XPLATFORM_MINGW" = "yes" ] || [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
7474
    # mkspecs/features/win32/default_pre.prf sets "no-rtti".
7475
    # Follow default behavior of configure.exe by overriding with "rtti"
7476
    # (also on Symbian).
7477
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG rtti"
7478
fi
7479
7480
if [ "$CFG_ALSA" = "yes" ]; then
7481
    QT_CONFIG="$QT_CONFIG alsa"
7482
fi
7483
7484
if [ "$CFG_PULSEAUDIO" = "yes" ]; then
7485
    QT_CONFIG="$QT_CONFIG pulseaudio"
7486
fi
7487
7488
if [ "$CFG_COREWLAN" = "yes" ]; then
7489
    QT_CONFIG="$QT_CONFIG corewlan"
7490
fi
7491
7492
if [ "$CFG_ICD" = "yes" ]; then
7493
    QT_CONFIG="$QT_CONFIG icd"
7494
fi
7495
7496
if [ "$CFG_ICU" = "yes" ]; then
7497
    QT_CONFIG="$QT_CONFIG icu"
7498
fi
7499
7500
#
7501
# Some Qt modules are too advanced in C++ for some old compilers
7502
# Detect here the platforms where they are known to work.
7503
#
7504
# See Qt documentation for more information on which features are
7505
# supported and on which compilers.
7506
#
7507
canBuildQtXmlPatterns="yes"
7508
canBuildWebKit="$HAVE_STL"
7509
canBuildQtConcurrent="yes"
7510
7511
# WebKit requires stdint.h
7512
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stdint "Stdint" $L_FLAGS $I_FLAGS $l_FLAGS
7513
if [ $? != "0" ]; then
7514
    canBuildWebKit="no"
7515
fi
7516
7517
case "$XPLATFORM" in
7518
    hpux-g++*)
7519
	# PA-RISC's assembly is too limited
7520
	# gcc 3.4 on that platform can't build QtXmlPatterns
7521
	# the assembly it generates cannot be compiled
7522
7523
	# Check gcc's version
7524
	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
7525
	    4*)
7526
		;;
7527
	    3.4*)
7528
		canBuildQtXmlPatterns="no"
7529
		;;
7530
	    *)
7531
		canBuildWebKit="no"
7532
		canBuildQtXmlPatterns="no"
7533
		;;
7534
	esac
7535
	;;
7536
    unsupported/vxworks-*-g++*)
7537
	canBuildWebKit="no"
7538
	;;
7539
    unsupported/vxworks-*-dcc*)
7540
	canBuildWebKit="no"
7541
	canBuildQtXmlPatterns="no"
7542
	;;
7543
    *-g++*)
7544
	# Check gcc's version
7545
	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
7546
	    4*|3.4*)
7547
		;;
7548
            3.3*)
7549
                canBuildWebKit="no"
7550
                ;;
7551
	    *)
7552
		canBuildWebKit="no"
7553
		canBuildQtXmlPatterns="no"
7554
		;;
7555
	esac
7556
	;;
7557
    solaris-cc*)
7558
        # Check the compiler version
7559
        case `${QMAKE_CONF_COMPILER} -V 2>&1 | awk '{print $4}'` in
7560
            5.[012345678])
7561
                canBuildWebKit="no"
7562
                canBuildQtXmlPatterns="no"
7563
                canBuildQtConcurrent="no"
7564
                ;;
7565
            5.*)
7566
                canBuildWebKit="no"
7567
                canBuildQtConcurrent="no"
7568
                ;;
7569
        esac
7570
        ;;
7571
    hpux-acc*)
7572
	canBuildWebKit="no"
7573
	canBuildQtXmlPatterns="no"
7574
        canBuildQtConcurrent="no"
7575
	;;
7576
    hpuxi-acc*)
7577
	canBuildWebKit="no"
7578
	;;
7579
    aix-xlc*)
7580
        # Get the xlC version
7581
        cat > xlcver.c <<EOF
7582
#include <stdio.h>
7583
int main()
7584
{
7585
    printf("%d.%d\n", __xlC__ >> 8, __xlC__ & 0xFF);
7586
    return 0;
7587
}
7588
EOF
7589
        xlcver=
7590
        if ${QMAKE_CONF_COMPILER} -o xlcver xlcver.c >/dev/null 2>/dev/null; then
7591
            xlcver=`./xlcver 2>/dev/null`
7592
            rm -f ./xlcver
7593
        fi
7594
        if [ "$OPT_VERBOSE" = "yes" ]; then
7595
            if [ -n "$xlcver" ]; then
7596
                echo Found IBM xlC version: $xlcver.
7597
            else
7598
                echo Could not determine IBM xlC version, assuming oldest supported.
7599
            fi
7600
        fi
7601
7602
        case "$xlcver" in
7603
            [123456].*)
7604
                canBuildWebKit="no"
7605
                canBuildQtXmlPatterns="no"
7606
                canBuildQtConcurrent="no"
7607
                ;;
7608
            *)
7609
                canBuildWebKit="no"
7610
                canBuildQtConcurrent="no"
7611
                ;;
7612
        esac
7613
        ;;
7614
    irix-cc*)
7615
        canBuildWebKit="no"
7616
        canBuildQtConcurrent="no"
7617
	;;
7618
    symbian-gcce)
7619
        ;;
7620
    symbian-armcc)
7621
        ;;
7622
esac
7623
7624
if [ "$CFG_GUI" = "no" ]; then
7625
    # WebKit requires QtGui
7626
    canBuildWebKit="no"
7627
fi
7628
7629
if [ "$CFG_SHARED" = "no" ]; then
7630
    echo
7631
    echo "WARNING: Using static linking will disable the WebKit module."
7632
    echo
7633
    canBuildWebKit="no"
7634
fi
7635
7636
CFG_CONCURRENT="yes"
7637
if [ "$canBuildQtConcurrent" = "no" ]; then
7638
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CONCURRENT"
7639
    CFG_CONCURRENT="no"
7640
else
7641
    QT_CONFIG="$QT_CONFIG concurrent"
7642
fi
7643
7644
if [ "$CFG_XMLPATTERNS" = "yes" -a "$CFG_EXCEPTIONS" = "no" ]; then
7645
    echo "QtXmlPatterns was requested, but it can't be built due to exceptions being disabled."
7646
    exit 1
7647
fi
7648
if [ "$CFG_XMLPATTERNS" = "auto" -a "$CFG_EXCEPTIONS" != "no" ]; then
7649
    CFG_XMLPATTERNS="$canBuildQtXmlPatterns"
7650
elif [ "$CFG_EXCEPTIONS" = "no" ]; then
7651
    CFG_XMLPATTERNS="no"
7652
fi
7653
if [ "$CFG_XMLPATTERNS" = "yes" ]; then
7654
    QT_CONFIG="$QT_CONFIG xmlpatterns"
7655
else
7656
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XMLPATTERNS"
7657
fi
7658
7659
if [ "$CFG_MULTIMEDIA" = "no" ]; then
7660
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MULTIMEDIA"
7661
else
7662
    QT_CONFIG="$QT_CONFIG multimedia"
7663
fi
7664
7665
if [ "$CFG_AUDIO_BACKEND" = "yes" ]; then
7666
    QT_CONFIG="$QT_CONFIG audio-backend"
7667
fi
7668
7669
if [ "$CFG_SVG" = "auto" ]; then
7670
    CFG_SVG=$CFG_GUI
7671
fi
7672
7673
if [ "$CFG_SVG" = "yes" ] && [ "$CFG_GUI" = "no" ]; then
7674
    echo "QtSvg requested, but it can't be built without QtGui"
7675
    exit 1
7676
fi
7677
7678
if [ "$CFG_SVG" = "yes" ]; then
7679
    QT_CONFIG="$QT_CONFIG svg"
7680
else
7681
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SVG"
7682
fi
7683
7684
if [ "$CFG_WEBKIT" != "no" ]; then
7685
    CFG_WEBKIT="$canBuildWebKit"
7686
fi
7687
7688
if [ "$CFG_WEBKIT" != "no" ]; then
7689
    # This include takes care of adding "webkit" to QT_CONFIG.
7690
    cp -f "$relpath/src/3rdparty/webkit/Source/WebKit/qt/qt_webkit_version.pri" "$outpath/mkspecs/modules/qt_webkit_version.pri"
7691
    # The reason we set CFG_WEBKIT, is such that the printed overview of what will be enabled, shows correctly.
7692
    if [ "$CFG_WEBKIT" = "debug" ]; then
7693
        QMAKE_CONFIG="$QMAKE_CONFIG webkit-debug"
7694
    fi
7695
else
7696
    rm -f "$outpath/mkspecs/modules/qt_webkit_version.pri"
7697
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WEBKIT"
7698
fi
7699
7700
if [ "$CFG_SCRIPT" = "auto" ]; then
7701
    CFG_SCRIPT="yes"
7702
fi
7703
7704
if [ "$CFG_SCRIPT" = "yes" ]; then
7705
    QT_CONFIG="$QT_CONFIG script"
7706
else
7707
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPT"
7708
fi
7709
7710
if [ "$CFG_SCRIPTTOOLS" = "yes" -a "$CFG_SCRIPT" = "no" ]; then
7711
    echo "QtScriptTools was requested, but it can't be built due to QtScript being disabled."
7712
    exit 1
7713
fi
7714
if [ "$CFG_SCRIPTTOOLS" = "auto" -a "$CFG_SCRIPT" != "no" ]; then
7715
    case "$XPLATFORM" in
7716
    symbian*)
7717
        CFG_SCRIPTTOOLS="no"
7718
        ;;
7719
    *)
7720
        CFG_SCRIPTTOOLS="yes"
7721
        ;;
7722
    esac
7723
elif [ "$CFG_SCRIPT" = "no" ]; then
7724
    CFG_SCRIPTTOOLS="no"
7725
fi
7726
7727
if [ "$CFG_SCRIPTTOOLS" = "yes" ]; then
7728
    QT_CONFIG="$QT_CONFIG scripttools"
7729
else
7730
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPTTOOLS"
7731
fi
7732
7733
7734
if [ "$CFG_DECLARATIVE" = "yes" ]; then
7735
    if [ "$CFG_SCRIPT" = "no" -o "$CFG_GUI" = "no" ]; then
7736
        echo "Error: QtDeclarative was requested, but it can't be built due to QtScript or QtGui being disabled."
7737
        exit 1
7738
    fi
7739
fi
7740
if [ "$CFG_DECLARATIVE" = "auto" ]; then
7741
    if [ "$CFG_SCRIPT" = "no" -o "$CFG_GUI" = "no" ]; then
7742
            CFG_DECLARATIVE=no
7743
    else
7744
            CFG_DECLARATIVE=yes
7745
    fi
7746
fi
7747
7748
if [ "$CFG_DECLARATIVE" = "yes" ]; then
7749
    QT_CONFIG="$QT_CONFIG declarative"
7750
    if [ "$CFG_DECLARATIVE_DEBUG" = "no" ]; then
7751
        QCONFIG_FLAGS="$QCONFIG_FLAGS QDECLARATIVE_NO_DEBUG_PROTOCOL"
7752
    fi
7753
else
7754
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DECLARATIVE"
7755
fi
7756
7757
if [ "$CFG_EXCEPTIONS" = "no" ]; then
7758
    case "$COMPILER" in
7759
    g++*)
7760
	QMakeVar add QMAKE_CFLAGS -fno-exceptions
7761
	QMakeVar add QMAKE_CXXFLAGS -fno-exceptions
7762
	QMakeVar add QMAKE_LFLAGS -fno-exceptions
7763
        ;;
7764
    cc*)
7765
        case "$PLATFORM" in
7766
        irix-cc*)
7767
	    QMakeVar add QMAKE_CFLAGS -LANG:exceptions=off
7768
	    QMakeVar add QMAKE_CXXFLAGS -LANG:exceptions=off
7769
	    QMakeVar add QMAKE_LFLAGS -LANG:exceptions=off
7770
            ;;
7771
        *) ;;
7772
        esac
7773
        ;;
7774
    *) ;;
7775
    esac
7776
    QMAKE_CONFIG="$QMAKE_CONFIG exceptions_off"
7777
fi
7778
7779
# On Mac, set the minimum deployment target for the different architechtures 
7780
# using the Xarch compiler option when supported (10.5 and up).  On 10.4 the
7781
# deployment version is set to 10.4 globally using the QMAKE_MACOSX_DEPLOYMENT_TARGET
7782
# env. variable. 
7783
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] ; then
7784
    if echo "$CFG_MAC_ARCHS" | grep '\<x86\>' > /dev/null 2>&1; then
7785
        QMakeVar add QMAKE_CFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
7786
        QMakeVar add QMAKE_CXXFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
7787
        QMakeVar add QMAKE_LFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
7788
        QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86 "-arch i386 -Xarch_i386 -mmacosx-version-min=10.4"
7789
    fi
7790
    if echo "$CFG_MAC_ARCHS" | grep '\<ppc\>' > /dev/null 2>&1; then
7791
        QMakeVar add QMAKE_CFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
7792
        QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
7793
        QMakeVar add QMAKE_LFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
7794
        QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=10.4"
7795
    fi
7796
    if echo "$CFG_MAC_ARCHS" | grep '\<x86_64\>' > /dev/null 2>&1; then
7797
        QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
7798
        QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
7799
        QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
7800
        QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5"
7801
    fi
7802
    if echo "$CFG_MAC_ARCHS" | grep '\<ppc64\>' > /dev/null 2>&1; then
7803
        QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
7804
        QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
7805
        QMakeVar add QMAKE_LFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
7806
        QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC_64 "-arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5"
7807
    fi
7808
fi
7809
7810
#-------------------------------------------------------------------------------
7811
# generate QT_BUILD_KEY
7812
#-------------------------------------------------------------------------------
7813
7814
# some compilers generate binary incompatible code between different versions,
7815
# so we need to generate a build key that is different between these compilers
7816
COMPAT_COMPILER=
7817
case "$COMPILER" in
7818
g++*)
7819
    # GNU C++
7820
    COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
7821
7822
    case "$COMPILER_VERSION" in
7823
    *.*.*)
7824
        QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
7825
        QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
7826
        QT_GCC_PATCH_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
7827
        ;;
7828
    *.*)
7829
        QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\1,'`
7830
        QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\2,'`
7831
        QT_GCC_PATCH_VERSION=0
7832
        ;;
7833
    esac
7834
7835
    case "$COMPILER_VERSION" in
7836
    2.95.*)
7837
        COMPILER_VERSION="2.95.*"
7838
        ;;
7839
    3.*)
7840
        COMPILER_VERSION="3.*"
7841
        ;;
7842
    4.*)
7843
        COMPILER_VERSION="4"
7844
        ;;
7845
    *)
7846
        ;;
7847
    esac
7848
    [ '!' -z "$COMPILER_VERSION" ] && COMPILER="g++-${COMPILER_VERSION}"
7849
    ;;
7850
icc*)
7851
    # The Intel CC compiler on Unix systems matches the ABI of the g++
7852
    # that is found on PATH
7853
    COMPAT_COMPILER="icc"
7854
    COMPILER="g++-4"
7855
    case "`g++ -dumpversion` 2>/dev/null" in
7856
    2.95.*)
7857
        COMPILER="g++-2.95.*"
7858
        ;;
7859
    3.*)
7860
a        COMPILER="g++-3.*"
7861
        ;;
7862
    *)
7863
        ;;
7864
    esac
7865
    ;;
7866
*)
7867
    #
7868
    ;;
7869
esac
7870
7871
# QT_CONFIG can contain the following:
7872
#
7873
# Things that affect the Qt API/ABI:
7874
#
7875
#   Options:
7876
#     minimal-config small-config medium-config large-config full-config
7877
#
7878
#   Different edition modules:
7879
#     gui network canvas table xml opengl sql
7880
#
7881
# Things that do not affect the Qt API/ABI:
7882
#     stl
7883
#     system-jpeg no-jpeg jpeg
7884
#     system-mng no-mng mng
7885
#     system-png no-png png
7886
#     system-zlib no-zlib zlib
7887
#     system-libtiff no-libtiff
7888
#     no-gif gif
7889
#     debug release
7890
#     dll staticlib
7891
#
7892
#     nocrosscompiler
7893
#     GNUmake
7894
#     largefile
7895
#     nis
7896
#     nas
7897
#     tablet
7898
#     ipv6
7899
#
7900
#     X11     : x11sm xinerama xcursor xfixes xrandr xrender mitshm fontconfig xkb
7901
#     Embedded: embedded qpa freetype
7902
#
7903
ALL_OPTIONS=
7904
BUILD_CONFIG=
7905
BUILD_OPTIONS=
7906
7907
# determine the build options
7908
for config_option in $QMAKE_CONFIG $QT_CONFIG; do
7909
    SKIP="yes"
7910
    case "$config_option" in
7911
    *-config)
7912
        # take the last *-config setting.  this is the highest config being used,
7913
        # and is the one that we will use for tagging plugins
7914
        BUILD_CONFIG="$config_option"
7915
        ;;
7916
7917
    *) # skip all other options since they don't affect the Qt API/ABI.
7918
        ;;
7919
    esac
7920
7921
    if [ "$SKIP" = "no" ]; then
7922
        BUILD_OPTIONS="$BUILD_OPTIONS $config_option"
7923
    fi
7924
done
7925
7926
# put the options that we are missing into .options
7927
rm -f .options
7928
for opt in `echo $ALL_OPTIONS`; do
7929
    SKIP="no"
7930
    if echo $BUILD_OPTIONS | grep $opt >/dev/null 2>&1; then
7931
        SKIP="yes"
7932
    fi
7933
    if [ "$SKIP" = "no" ]; then
7934
        echo "$opt" >> .options
7935
    fi
7936
done
7937
7938
# reconstruct BUILD_OPTIONS with a sorted negative feature list
7939
# (ie. only things that are missing are will be put into the build key)
7940
BUILD_OPTIONS=
7941
if [ -f .options ]; then
7942
    for opt in `sort -f .options | uniq`; do
7943
        BUILD_OPTIONS="$BUILD_OPTIONS no-$opt"
7944
    done
7945
fi
7946
rm -f .options
7947
7948
# QT_NO* defines affect the Qt API (and binary compatibility).  they need
7949
# to be included in the build key
7950
for build_option in $D_FLAGS; do
7951
    build_option=`echo $build_option | cut -d \" -f 2 -`
7952
    case "$build_option" in
7953
    QT_NO*)
7954
        echo "$build_option" >> .options
7955
        ;;
7956
    *)
7957
        # skip all other compiler defines
7958
        ;;
7959
    esac
7960
done
7961
7962
# sort the compile time defines (helps ensure that changes in this configure
7963
# script don't affect the QT_BUILD_KEY generation)
7964
if [ -f .options ]; then
7965
    for opt in `sort -f .options | uniq`; do
7966
        BUILD_OPTIONS="$BUILD_OPTIONS $opt"
7967
    done
7968
fi
7969
rm -f .options
7970
7971
BUILD_OPTIONS="$BUILD_CONFIG $BUILD_OPTIONS"
7972
# extract the operating system from the XPLATFORM
7973
TARGET_OPERATING_SYSTEM=`echo $XPLATFORM | cut -f 2- -d/ | cut -f -1 -d-`
7974
if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
7975
    QT_BUILD_KEY_SYSTEM_PART="Symbian"
7976
else
7977
    QT_BUILD_KEY_SYSTEM_PART="$CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER"
7978
fi
7979
7980
# when cross-compiling, don't include build-host information (build key is target specific)
7981
QT_BUILD_KEY="$CFG_USER_BUILD_KEY $QT_BUILD_KEY_SYSTEM_PART $BUILD_OPTIONS"
7982
if [ -n "$QT_NAMESPACE" ]; then
7983
    QT_BUILD_KEY="$QT_BUILD_KEY $QT_NAMESPACE"
7984
fi
7985
MAC_NEED_TWO_BUILD_KEYS="no"
7986
if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then
7987
    QT_BUILD_KEY_CARBON=$QT_BUILD_KEY
7988
    TARGET_OPERATING_SYSTEM="$TARGET_OPERATING_SYSTEM-cocoa"
7989
    QT_BUILD_KEY_COCOA="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
7990
    if [ "$CFG_MAC_CARBON" = "no" ]; then
7991
        QT_BUILD_KEY=$QT_BUILD_KEY_COCOA
7992
    else
7993
        MAC_NEED_TWO_BUILD_KEYS="yes"
7994
    fi
7995
fi
7996
# don't break loading plugins build with an older version of Qt
7997
QT_BUILD_KEY_COMPAT=
7998
if [ "$QT_CROSS_COMPILE" = "no" ]; then
7999
    # previous versions of Qt used a build key built from the uname
8000
    QT_BUILD_KEY_COMPAT="$CFG_USER_BUILD_KEY $UNAME_MACHINE $UNAME_SYSTEM $COMPILER $BUILD_OPTIONS"
8001
    if [ -n "$QT_NAMESPACE" ]; then
8002
        QT_BUILD_KEY_COMPAT="$QT_BUILD_KEY_COMPAT $QT_NAMESPACE"
8003
    fi
8004
fi
8005
8006
# is this compiler compatible with some other "standard" build key
8007
QT_BUILD_KEY_COMPAT_COMPILER=
8008
if [ ! -z "$COMPAT_COMPILER" ]; then
8009
    QT_BUILD_KEY_COMPAT_COMPILER="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPAT_COMPILER $BUILD_OPTIONS"
8010
    if [ -n "$QT_NAMESPACE" ]; then
8011
        QT_BUILD_KEY_COMPAT_COMPILER="$QT_BUILD_KEY_COMPAT_COMPILER $QT_NAMESPACE"
8012
    fi
8013
fi
8014
8015
# is this arch compatible with some other "standard" build key
8016
QT_BUILD_KEY_COMPAT_ARCH=
8017
if [ ! -z "$COMPAT_ARCH" ]; then
8018
    QT_BUILD_KEY_COMPAT_ARCH="$CFG_USER_BUILD_KEY $COMPAT_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
8019
    if [ -n "$QT_NAMESPACE" ]; then
8020
        QT_BUILD_KEY_COMPAT_COMPILER="$QT_BUILD_KEY_COMPAT_ARCH $QT_NAMESPACE"
8021
    fi
8022
fi
8023
8024
# strip out leading/trailing/extra whitespace
8025
QT_BUILD_KEY=`echo $QT_BUILD_KEY | sed -e "s,  *, ,g" -e "s,^  *,," -e "s,  *$,,"`
8026
QT_BUILD_KEY_COMPAT=`echo $QT_BUILD_KEY_COMPAT | sed -e "s,  *, ,g" -e "s,^  *,," -e "s,  *$,,"`
8027
QT_BUILD_KEY_COMPAT_COMPILER=`echo $QT_BUILD_KEY_COMPAT_COMPILER | sed -e "s,  *, ,g" -e "s,^  *,," -e "s,  *$,,"`
8028
QT_BUILD_KEY_COMPAT_ARCH=`echo $QT_BUILD_KEY_COMPAT_ARCH | sed -e "s,  *, ,g" -e "s,^  *,," -e "s,  *$,,"`
8029
8030
#-------------------------------------------------------------------------------
8031
# part of configuration information goes into qconfig.h
8032
#-------------------------------------------------------------------------------
8033
8034
case "$CFG_QCONFIG" in
8035
full)
8036
    echo "/* Everything */" >"$outpath/src/corelib/global/qconfig.h.new"
8037
    ;;
8038
*)
8039
    tmpconfig="$outpath/src/corelib/global/qconfig.h.new"
8040
    echo "#ifndef QT_BOOTSTRAPPED" >"$tmpconfig"
8041
    if [ -f "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" ]; then
8042
        cat "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" >>"$tmpconfig"
8043
    elif [ -f `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` ]; then
8044
        cat `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` >>"$tmpconfig"
8045
    fi
8046
    echo "#endif" >>"$tmpconfig"
8047
    ;;
8048
esac
8049
8050
cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
8051
8052
/* Qt Edition */
8053
#ifndef QT_EDITION
8054
#  define QT_EDITION $QT_EDITION
8055
#endif
8056
8057
/* Machine byte-order */
8058
#define Q_BIG_ENDIAN 4321
8059
#define Q_LITTLE_ENDIAN 1234
8060
EOF
8061
8062
if [ "$MAC_NEED_TWO_BUILD_KEYS" = "no" ]; then
8063
    echo "#define QT_BUILD_KEY \"$QT_BUILD_KEY\"" \
8064
        >> "$outpath/src/corelib/global/qconfig.h.new"
8065
else
8066
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
8067
8068
#define QT_BUILD_KEY_CARBON "$QT_BUILD_KEY_CARBON"
8069
#define QT_BUILD_KEY_COCOA "$QT_BUILD_KEY_COCOA"
8070
EOF
8071
fi
8072
8073
if [ -n "$QT_BUILD_KEY_COMPAT" ]; then
8074
    echo "#define QT_BUILD_KEY_COMPAT \"$QT_BUILD_KEY_COMPAT\"" \
8075
        >> "$outpath/src/corelib/global/qconfig.h.new"
8076
fi
8077
if [ -n "$QT_BUILD_KEY_COMPAT_COMPILER" ]; then
8078
    echo "#define QT_BUILD_KEY_COMPAT2 \"$QT_BUILD_KEY_COMPAT_COMPILER\"" \
8079
        >> "$outpath/src/corelib/global/qconfig.h.new"
8080
fi
8081
if [ -n "$QT_BUILD_KEY_COMPAT_ARCH" ]; then
8082
    echo "#define QT_BUILD_KEY_COMPAT3 \"$QT_BUILD_KEY_COMPAT_ARCH\"" \
8083
        >> "$outpath/src/corelib/global/qconfig.h.new"
8084
fi
8085
8086
echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
8087
8088
echo "#ifdef QT_BOOTSTRAPPED" >>"$outpath/src/corelib/global/qconfig.h.new"
8089
if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
8090
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
8091
#if defined(__BIG_ENDIAN__)
8092
# define Q_BYTE_ORDER Q_BIG_ENDIAN
8093
#elif defined(__LITTLE_ENDIAN__)
8094
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
8095
#else
8096
# error "Unable to determine byte order!"
8097
#endif
8098
EOF
8099
else
8100
    echo "#define Q_BYTE_ORDER $CFG_HOST_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
8101
fi
8102
echo "#else" >>"$outpath/src/corelib/global/qconfig.h.new"
8103
if [ "$CFG_ENDIAN" = "auto" ]; then
8104
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
8105
#if defined(__BIG_ENDIAN__)
8106
# define Q_BYTE_ORDER Q_BIG_ENDIAN
8107
#elif defined(__LITTLE_ENDIAN__)
8108
# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
8109
#else
8110
# error "Unable to determine byte order!"
8111
#endif
8112
EOF
8113
else
8114
    echo "#define Q_BYTE_ORDER $CFG_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
8115
fi
8116
echo "#endif" >>"$outpath/src/corelib/global/qconfig.h.new"
8117
8118
if [ "$CFG_DOUBLEFORMAT" != "normal" ]; then
8119
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
8120
/* Non-IEEE double format */
8121
#define Q_DOUBLE_LITTLE "01234567"
8122
#define Q_DOUBLE_BIG "76543210"
8123
#define Q_DOUBLE_LITTLE_SWAPPED "45670123"
8124
#define Q_DOUBLE_BIG_SWAPPED "32107654"
8125
#define Q_DOUBLE_FORMAT $CFG_DOUBLEFORMAT
8126
EOF
8127
fi
8128
if [ "$CFG_ARMFPA" = "yes" ]; then
8129
    if [ "$CFG_ARCH" != "$CFG_HOST_ARCH" ]; then
8130
	cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
8131
#ifndef QT_BOOTSTRAPPED
8132
# define QT_ARMFPA
8133
#endif
8134
EOF
8135
    else
8136
	echo "#define QT_ARMFPA" >>"$outpath/src/corelib/global/qconfig.h.new"
8137
    fi
8138
fi
8139
8140
CFG_ARCH_STR=`echo $CFG_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8141
CFG_HOST_ARCH_STR=`echo $CFG_HOST_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8142
cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
8143
/* Machine Architecture */
8144
#ifndef QT_BOOTSTRAPPED
8145
# define QT_ARCH_${CFG_ARCH_STR}
8146
#else
8147
# define QT_ARCH_${CFG_HOST_ARCH_STR}
8148
#endif
8149
EOF
8150
8151
echo '/* Compile time features */' >>"$outpath/src/corelib/global/qconfig.h.new"
8152
[ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\"" >>"$outpath/src/corelib/global/qconfig.h.new"
8153
8154
if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
8155
    echo "#define QT_LARGEFILE_SUPPORT 64" >>"$outpath/src/corelib/global/qconfig.h.new"
8156
fi
8157
8158
# if both carbon and cocoa are specified, enable the autodetection code.
8159
if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then
8160
    echo "#define QT_AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
8161
elif [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then
8162
    echo "#define QT_MAC_USE_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
8163
fi
8164
8165
if [ "$CFG_FRAMEWORK" = "yes" ]; then
8166
    echo "#define QT_MAC_FRAMEWORK_BUILD" >>"$outpath/src/corelib/global/qconfig.h.new"
8167
fi
8168
8169
if [ "$PLATFORM_MAC" = "yes" ]; then
8170
    cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
8171
#if defined(__LP64__)
8172
# define QT_POINTER_SIZE 8
8173
#else
8174
# define QT_POINTER_SIZE 4
8175
#endif
8176
EOF
8177
elif [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
8178
    # Raptor does not support configure tests.
8179
    "$unixtests/ptrsize.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
8180
    echo "#define QT_POINTER_SIZE $?" >>"$outpath/src/corelib/global/qconfig.h.new"
8181
fi
8182
8183
8184
echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
8185
8186
if [ "$CFG_DEV" = "yes" ]; then
8187
    echo "#define QT_BUILD_INTERNAL" >>"$outpath/src/corelib/global/qconfig.h.new"
8188
fi
8189
8190
# Embedded compile time options
8191
if [ "$PLATFORM_QWS" = "yes" ]; then
8192
    # Add QWS to config.h
8193
    QCONFIG_FLAGS="$QCONFIG_FLAGS Q_WS_QWS"
8194
8195
    # Add excluded decorations to $QCONFIG_FLAGS
8196
    decors=`grep '^decorations -= ' "$QMAKE_VARS_FILE" | ${AWK} '{print $3}'`
8197
    for decor in $decors; do
8198
        NODECORATION=`echo $decor | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8199
        QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_NO_QWS_DECORATION_${NODECORATION}"
8200
    done
8201
8202
    # Figure which embedded drivers which are turned off
8203
    CFG_GFX_OFF="$CFG_GFX_AVAILABLE"
8204
    for ADRIVER in $CFG_GFX_ON; do
8205
        CFG_GFX_OFF=`echo "${CFG_GFX_OFF} " | sed "s,${ADRIVER} ,,g"`
8206
    done
8207
8208
    CFG_KBD_OFF="$CFG_KBD_AVAILABLE"
8209
    # the um driver is currently not in the available list for external builds
8210
    if [ "$CFG_DEV" = "no" ]; then
8211
	CFG_KBD_OFF="$CFG_KBD_OFF um"
8212
    fi
8213
    for ADRIVER in $CFG_KBD_ON; do
8214
        CFG_KBD_OFF=`echo "${CFG_KBD_OFF} " | sed "s,${ADRIVER} ,,g"`
8215
    done
8216
8217
    CFG_MOUSE_OFF="$CFG_MOUSE_AVAILABLE"
8218
    for ADRIVER in $CFG_MOUSE_ON; do
8219
        CFG_MOUSE_OFF=`echo "${CFG_MOUSE_OFF} " | sed "s,${ADRIVER} ,,g"`
8220
    done
8221
8222
    for DRIVER in $CFG_GFX_OFF; do
8223
        NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8224
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_$NODRIVER"
8225
    done
8226
8227
    for DRIVER in $CFG_KBD_OFF; do
8228
        NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8229
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_KBD_$NODRIVER"
8230
    done
8231
8232
    for DRIVER in $CFG_MOUSE_OFF; do
8233
        NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8234
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_MOUSE_$NODRIVER"
8235
    done
8236
fi # QWS
8237
8238
if [ "$PLATFORM_QPA" = "yes" ]; then
8239
    # Add QPA to config.h
8240
    QCONFIG_FLAGS="$QCONFIG_FLAGS Q_WS_QPA QT_NO_QWS_QPF QT_NO_QWS_QPF2"
8241
fi
8242
8243
if [ "${CFG_USE_FLOATMATH}" = "yes" ]; then
8244
    QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_USE_MATH_H_FLOATS"
8245
fi
8246
8247
# Add turned on SQL drivers
8248
for DRIVER in $CFG_SQL_AVAILABLE; do
8249
    eval "VAL=\$CFG_SQL_$DRIVER"
8250
    case "$VAL" in
8251
    qt)
8252
        ONDRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8253
        QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SQL_$ONDRIVER"
8254
        SQL_DRIVERS="$SQL_DRIVERS $DRIVER"
8255
    ;;
8256
    plugin)
8257
        SQL_PLUGINS="$SQL_PLUGINS $DRIVER"
8258
    ;;
8259
    esac
8260
done
8261
8262
8263
QMakeVar set sql-drivers "$SQL_DRIVERS"
8264
QMakeVar set sql-plugins "$SQL_PLUGINS"
8265
8266
# Add other configuration options to the qconfig.h file
8267
[ "$CFG_GIF" = "yes" ]       && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_BUILTIN_GIF_READER=1"
8268
[ "$CFG_TIFF" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_TIFF"
8269
[ "$CFG_PNG" != "yes" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_PNG"
8270
[ "$CFG_JPEG" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_JPEG"
8271
[ "$CFG_MNG" != "yes" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_MNG"
8272
[ "$CFG_ZLIB" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB"
8273
[ "$CFG_S60" != "yes" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_S60"
8274
[ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS"
8275
[ "$CFG_IPV6" = "no" ]       && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6"
8276
[ "$CFG_SXE" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE"
8277
[ "$CFG_DBUS" = "no" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS"
8278
8279
if [ "$PLATFORM_QWS" != "yes" -a "$PLATFORM_QPA" != "yes" ]; then
8280
    [ "$CFG_GRAPHICS_SYSTEM" = "raster" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RASTER"
8281
    [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENGL"
8282
    [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENVG"
8283
    [ "$CFG_GRAPHICS_SYSTEM" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RUNTIME"
8284
fi
8285
8286
# X11/Unix/Mac only configs
8287
[ "$CFG_ICONV" = "no" ]      && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICONV"
8288
[ "$CFG_GLIB" != "yes" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLIB"
8289
[ "$CFG_QGTKSTYLE" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_GTK"
8290
if [ "$XPLATFORM_SYMBIAN" = "no" ]; then
8291
    # Do not apply following negative X11/Unix/Mac only flags on Symbian, so that
8292
    # configuration matches with the one generated by configure executable tool
8293
    [ "$CFG_CUPS" = "no" ]       && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CUPS"
8294
    [ "$CFG_GSTREAMER" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GSTREAMER"
8295
    [ "$CFG_CLOCK_MONOTONIC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CLOCK_MONOTONIC"
8296
    [ "$CFG_MREMAP" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MREMAP"
8297
    [ "$CFG_GETADDRINFO" = "no" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETADDRINFO"
8298
    [ "$CFG_IPV6IFNAME" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6IFNAME"
8299
    [ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS"
8300
    [ "$CFG_INOTIFY" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY"
8301
    [ "$CFG_NAS" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NAS"
8302
    [ "$CFG_NIS" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS"
8303
    [ "$CFG_OPENSSL" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL"
8304
    [ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL"
8305
8306
    [ "$CFG_SM" = "no" ]         && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SESSIONMANAGER"
8307
    [ "$CFG_XCURSOR" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XCURSOR"
8308
    [ "$CFG_XFIXES" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XFIXES"
8309
    [ "$CFG_FONTCONFIG" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FONTCONFIG"
8310
    [ "$CFG_XINERAMA" = "no" ]   && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINERAMA"
8311
    [ "$CFG_XKB" = "no" ]        && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XKB"
8312
    [ "$CFG_XRANDR" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRANDR"
8313
    [ "$CFG_XRENDER" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRENDER"
8314
    [ "$CFG_MITSHM" = "no" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MITSHM"
8315
    [ "$CFG_XSHAPE" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE"
8316
    [ "$CFG_XVIDEO" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XVIDEO"
8317
    [ "$CFG_XSYNC" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC"
8318
    [ "$CFG_XINPUT" = "no" ]     && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET"
8319
8320
    [ "$CFG_XCURSOR" = "runtime" ]   && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR"
8321
    [ "$CFG_XINERAMA" = "runtime" ]  && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINERAMA"
8322
    [ "$CFG_XFIXES" = "runtime" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XFIXES"
8323
    [ "$CFG_XRANDR" = "runtime" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XRANDR"
8324
    [ "$CFG_XINPUT" = "runtime" ]    && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINPUT"
8325
    [ "$CFG_ALSA" = "no" ]           && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ALSA"
8326
    [ "$CFG_PULSEAUDIO" = "no" ]          && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PULSEAUDIO"
8327
    [ "$CFG_COREWLAN" = "no" ]       && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_COREWLAN"
8328
    [ "$CFG_ICD" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICD"
8329
fi
8330
8331
if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
8332
    # Disable styles not applicable on Symbian
8333
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_CDE"
8334
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_CLEANLOOKS"
8335
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_MOTIF"
8336
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_PLASTIQUE"
8337
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_WINDOWSCE"
8338
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_WINDOWSMOBILE"
8339
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_WINDOWSVISTA"
8340
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_WINDOWSXP"
8341
fi
8342
8343
# sort QCONFIG_FLAGS for neatness if we can
8344
[ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq`
8345
QCONFIG_FLAGS=`echo $QCONFIG_FLAGS`
8346
8347
if [ "$XPLATFORM_SYMBIAN" = "yes" ]; then
8348
    # Enable Symbian DLLs and export rules.
8349
    # We cannot use Linux's default export rules since they export everything.
8350
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_DLL"
8351
    # Disable non-working features.
8352
    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CRASHHANDLER QT_NO_PRINTER QT_NO_SYSTEMTRAYICON"
8353
fi
8354
8355
if [ -n "$QCONFIG_FLAGS" ]; then
8356
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
8357
#ifndef QT_BOOTSTRAPPED
8358
8359
EOF
8360
    for cfg in $QCONFIG_FLAGS; do
8361
        cfgd=`echo $cfg | sed 's/=.*$//'` # trim pushed 'Foo=Bar' defines
8362
        cfg=`echo $cfg | sed 's/=/ /'`    # turn first '=' into a space
8363
        # figure out define logic, so we can output the correct
8364
        # ifdefs to override the global defines in a project
8365
        cfgdNeg=
8366
        if [ true ] && echo "$cfgd" | grep 'QT_NO_' >/dev/null 2>&1; then
8367
            # QT_NO_option can be forcefully turned on by QT_option
8368
            cfgdNeg=`echo $cfgd | sed "s,QT_NO_,QT_,"`
8369
        elif [ true ] && echo "$cfgd" | grep 'QT_' >/dev/null 2>&1; then
8370
            # QT_option can be forcefully turned off by QT_NO_option
8371
            cfgdNeg=`echo $cfgd | sed "s,QT_,QT_NO_,"`
8372
        fi
8373
8374
        if [ -z $cfgdNeg ]; then
8375
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
8376
#ifndef $cfgd
8377
# define $cfg
8378
#endif
8379
8380
EOF
8381
        else
8382
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
8383
#if defined($cfgd) && defined($cfgdNeg)
8384
# undef $cfgd
8385
#elif !defined($cfgd) && !defined($cfgdNeg)
8386
# define $cfg
8387
#endif
8388
8389
EOF
8390
        fi
8391
    done
8392
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
8393
#endif // QT_BOOTSTRAPPED
8394
8395
EOF
8396
fi
8397
8398
if [ "$CFG_REDUCE_EXPORTS" = "yes" ]; then
8399
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
8400
#define QT_VISIBILITY_AVAILABLE
8401
8402
EOF
8403
fi
8404
8405
if [ -n "$QT_LIBINFIX" ]; then
8406
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
8407
#define QT_LIBINFIX "$QT_LIBINFIX"
8408
8409
EOF
8410
fi
8411
8412
if [ -n "$CFG_RUNTIME_SYSTEM" ]; then
8413
cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
8414
#define QT_DEFAULT_RUNTIME_SYSTEM "$CFG_RUNTIME_SYSTEM"
8415
8416
EOF
8417
fi
8418
8419
# avoid unecessary rebuilds by copying only if qconfig.h has changed
8420
if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
8421
    rm -f "$outpath/src/corelib/global/qconfig.h.new"
8422
else
8423
    [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h"
8424
    mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
8425
    chmod -w "$outpath/src/corelib/global/qconfig.h"
8426
    for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
8427
        ln -s "$outpath/src/corelib/global/qconfig.h" "$conf"
8428
    done
8429
fi
8430
#-------------------------------------------------------------------------------
8431
# save configuration into qconfig.pri
8432
#-------------------------------------------------------------------------------
8433
8434
QTCONFIG="$outpath/mkspecs/qconfig.pri"
8435
QTCONFIG_CONFIG="$QTCONFIG_CONFIG no_mocdepend"
8436
[ -f "$QTCONFIG.tmp" ] && rm -f "$QTCONFIG.tmp"
8437
if [ "$CFG_DEBUG" = "yes" ]; then
8438
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG debug"
8439
    if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
8440
        QT_CONFIG="$QT_CONFIG release"
8441
    fi
8442
    QT_CONFIG="$QT_CONFIG debug"
8443
elif [ "$CFG_DEBUG" = "no" ]; then
8444
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG release"
8445
    if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
8446
        QT_CONFIG="$QT_CONFIG debug"
8447
    fi
8448
    QT_CONFIG="$QT_CONFIG release"
8449
fi
8450
if [ "$CFG_STL" = "yes" ]; then
8451
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG stl"
8452
fi
8453
if [ "$CFG_FRAMEWORK" = "no" ]; then
8454
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_no_framework"
8455
else
8456
    QT_CONFIG="$QT_CONFIG qt_framework"
8457
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_framework"
8458
fi
8459
if [ "$PLATFORM_MAC" = "yes" ]; then
8460
    QT_CONFIG="$QT_CONFIG $CFG_MAC_ARCHS"
8461
fi
8462
if [ "$CFG_DEV" = "yes" ]; then
8463
    QT_CONFIG="$QT_CONFIG private_tests"
8464
fi
8465
8466
if [ -z "$QT_CFLAGS_FPU" ]; then
8467
    if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null 2>&1; then
8468
        QT_CFLAGS_FPU=softvfp
8469
    fi
8470
fi
8471
8472
# Make the application arch follow the Qt arch for single arch builds.
8473
# (for multiple-arch builds, set CONFIG manually in the application .pro file)
8474
if [ `echo "$CFG_MAC_ARCHS" | wc -w` -eq 1 ]; then
8475
    QTCONFIG_CONFIG="$QTCONFIG_CONFIG $CFG_MAC_ARCHS"
8476
fi
8477
8478
cat >>"$QTCONFIG.tmp" <<EOF
8479
#configuration
8480
CONFIG += $QTCONFIG_CONFIG
8481
QT_ARCH = $CFG_ARCH
8482
QT_EDITION = $Edition
8483
QT_CONFIG += $QT_CONFIG
8484
8485
#versioning
8486
QT_VERSION = $QT_VERSION
8487
QT_MAJOR_VERSION = $QT_MAJOR_VERSION
8488
QT_MINOR_VERSION = $QT_MINOR_VERSION
8489
QT_PATCH_VERSION = $QT_PATCH_VERSION
8490
8491
#namespaces
8492
QT_LIBINFIX = $QT_LIBINFIX
8493
QT_NAMESPACE = $QT_NAMESPACE
8494
QT_NAMESPACE_MAC_CRC = $QT_NAMESPACE_MAC_CRC
8495
8496
EOF
8497
if [ -n "$CFG_SYSROOT" ]; then
8498
    echo "# sysroot" >>"$QTCONFIG.tmp"
8499
    echo `basename "$XQMAKESPEC"` \{ >>"$QTCONFIG.tmp"
8500
    echo "  QT_SYSROOT      += \$\$quote($CFG_SYSROOT)" >>"$QTCONFIG.tmp"
8501
    echo "  QMAKE_CFLAGS    += --sysroot=\$\$QT_SYSROOT" >>"$QTCONFIG.tmp"
8502
    echo "  QMAKE_CXXFLAGS  += --sysroot=\$\$QT_SYSROOT" >>"$QTCONFIG.tmp"
8503
    echo "  QMAKE_LFLAGS    += --sysroot=\$\$QT_SYSROOT" >>"$QTCONFIG.tmp"
8504
    echo "}" >> "$QTCONFIG.tmp"
8505
    echo >> "$QTCONFIG.tmp"
8506
fi
8507
if [ "$CFG_RPATH" = "yes" ]; then
8508
    echo "QMAKE_RPATHDIR += \"$QT_INSTALL_LIBS\"" >> "$QTCONFIG.tmp"
8509
fi
8510
if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
8511
    echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION" >> "$QTCONFIG.tmp"
8512
    echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION" >> "$QTCONFIG.tmp"
8513
    echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION" >> "$QTCONFIG.tmp"
8514
fi
8515
if [ -n "$QT_CFLAGS_FPU" ]; then
8516
    echo "#Qt for symbian FPU settings" >> "$QTCONFIG.tmp"
8517
    echo "MMP_RULES += \"ARMFPU $QT_CFLAGS_FPU\"" >> "$QTCONFIG.tmp"
8518
fi
8519
8520
if [ -n "$QMAKE_INCDIR_OPENGL_ES2" ]; then
8521
    echo "#Qt opengl include path" >> "$QTCONFIG.tmp"
8522
    echo "QMAKE_INCDIR_OPENGL_ES2 = \"$QMAKE_INCDIR_OPENGL_ES2\"" >> "$QTCONFIG.tmp"
8523
fi
8524
8525
# replace qconfig.pri if it differs from the newly created temp file
8526
if cmp -s "$QTCONFIG.tmp" "$QTCONFIG"; then
8527
    rm -f "$QTCONFIG.tmp"
8528
else
8529
    mv -f "$QTCONFIG.tmp" "$QTCONFIG"
8530
fi
8531
8532
#-------------------------------------------------------------------------------
8533
# save configuration into .qmake.cache
8534
#-------------------------------------------------------------------------------
8535
8536
CACHEFILE="$outpath/.qmake.cache"
8537
[ -f "$CACHEFILE.tmp" ] && rm -f "$CACHEFILE.tmp"
8538
cat >>"$CACHEFILE.tmp" <<EOF
8539
CONFIG += $QMAKE_CONFIG dylib create_prl link_prl depend_includepath fix_output_dirs QTDIR_build
8540
QT_SOURCE_TREE = \$\$quote($relpath)
8541
QT_BUILD_TREE = \$\$quote($outpath)
8542
QT_BUILD_PARTS = $CFG_BUILD_PARTS
8543
QMAKE_ABSOLUTE_SOURCE_ROOT = \$\$QT_SOURCE_TREE
8544
QMAKE_MOC_SRC    = \$\$QT_BUILD_TREE/src/moc
8545
8546
#local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR
8547
QMAKE_MOC        = \$\$QT_BUILD_TREE/bin/moc
8548
QMAKE_UIC        = \$\$QT_BUILD_TREE/bin/uic
8549
QMAKE_UIC3       = \$\$QT_BUILD_TREE/bin/uic3
8550
QMAKE_RCC        = \$\$QT_BUILD_TREE/bin/rcc
8551
QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp
8552
QMAKE_INCDIR_QT  = \$\$QT_BUILD_TREE/include
8553
QMAKE_LIBDIR_QT  = \$\$QT_BUILD_TREE/lib
8554
8555
EOF
8556
8557
# Ensure we can link to uninistalled libraries
8558
if [ "$XPLATFORM_MINGW" != "yes" ] && [ "$CFG_EMBEDDED" != "nacl" ] && linkerSupportsFlag -rpath-link "$outpath/lib"; then
8559
    echo "QMAKE_LFLAGS    = -Wl,-rpath-link,\$\$QT_BUILD_TREE/lib \$\$QMAKE_LFLAGS" >> "$CACHEFILE.tmp"
8560
fi
8561
if [ -n "$QT_CFLAGS_PSQL" ]; then
8562
    echo "QT_CFLAGS_PSQL   = $QT_CFLAGS_PSQL" >> "$CACHEFILE.tmp"
8563
fi
8564
if [ -n "$QT_LFLAGS_PSQL" ]; then
8565
    echo "QT_LFLAGS_PSQL   = $QT_LFLAGS_PSQL" >> "$CACHEFILE.tmp"
8566
fi
8567
if [ -n "$QT_CFLAGS_MYSQL" ]; then
8568
    echo "QT_CFLAGS_MYSQL   = $QT_CFLAGS_MYSQL" >> "$CACHEFILE.tmp"
8569
fi
8570
if [ -n "$QT_LFLAGS_MYSQL" ]; then
8571
    echo "QT_LFLAGS_MYSQL   = $QT_LFLAGS_MYSQL" >> "$CACHEFILE.tmp"
8572
fi
8573
if [ -n "$QT_CFLAGS_SQLITE" ]; then
8574
    echo "QT_CFLAGS_SQLITE   = $QT_CFLAGS_SQLITE" >> "$CACHEFILE.tmp"
8575
fi
8576
if [ -n "$QT_LFLAGS_SQLITE" ]; then
8577
    echo "QT_LFLAGS_SQLITE   = $QT_LFLAGS_SQLITE" >> "$CACHEFILE.tmp"
8578
fi
8579
if [ -n "$QT_LFLAGS_ODBC" ]; then
8580
    echo "QT_LFLAGS_ODBC   = $QT_LFLAGS_ODBC" >> "$CACHEFILE.tmp"
8581
fi
8582
if [ -n "$QT_LFLAGS_TDS" ]; then
8583
    echo "QT_LFLAGS_TDS   = $QT_LFLAGS_TDS" >> "$CACHEFILE.tmp"
8584
fi
8585
8586
if [ "$QT_EDITION" != "QT_EDITION_OPENSOURCE" ]; then
8587
    echo "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" >> "$CACHEFILE.tmp"
8588
fi
8589
8590
#dump in the OPENSSL_LIBS info
8591
if [ '!' -z "$OPENSSL_LIBS" ]; then
8592
    echo "OPENSSL_LIBS = $OPENSSL_LIBS" >> "$CACHEFILE.tmp"
8593
elif [ "$CFG_OPENSSL" = "linked" ]; then
8594
    echo "OPENSSL_LIBS = -lssl -lcrypto" >> "$CACHEFILE.tmp"
8595
fi
8596
8597
#dump in the SDK info
8598
if [ '!' -z "$CFG_SDK" ]; then
8599
   echo "QMAKE_MAC_SDK = $CFG_SDK" >> "$CACHEFILE.tmp"
8600
fi
8601
8602
# mac gcc -Xarch support
8603
if [ "$CFG_MAC_XARCH" = "no" ]; then
8604
   echo "QMAKE_MAC_XARCH = no" >> "$CACHEFILE.tmp"
8605
fi
8606
8607
#dump the qmake spec
8608
if [ -d "$outpath/mkspecs/$XPLATFORM" ]; then
8609
   echo "QMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$XPLATFORM" >> "$CACHEFILE.tmp"
8610
else
8611
   echo "QMAKESPEC = $XPLATFORM" >> "$CACHEFILE.tmp"
8612
fi
8613
8614
# cmdline args
8615
cat "$QMAKE_VARS_FILE" >> "$CACHEFILE.tmp"
8616
rm -f "$QMAKE_VARS_FILE" 2>/dev/null
8617
8618
# incrementals
8619
INCREMENTAL=""
8620
[ "$CFG_INCREMENTAL" = "auto" ] && "$WHICH" p4 >/dev/null 2>&1 && [ "$CFG_DEV" = "yes" ] && CFG_INCREMENTAL="yes"
8621
if [ "$CFG_INCREMENTAL" = "yes" ]; then
8622
    find "$relpath" -perm u+w -mtime -3 | grep 'cpp$' | while read f; do
8623
        # don't need to worry about generated files
8624
        [ -r `echo $f | sed "s,cpp$,ui,"` ] && continue
8625
        basename "$f" | grep '^moc_' >/dev/null 2>&1 && continue
8626
        # done
8627
        INCREMENTAL="$INCREMENTAL `basename \"$f\" | sed 's,.cpp,.o,'`"
8628
    done
8629
    [ '!' -z "$INCREMENTAL" ] && echo "QMAKE_INCREMENTAL += $INCREMENTAL" >> "$CACHEFILE.tmp"
8630
    [ -r "$outpath/.qmake.incremental" ] && echo "include($outpath/.qmake.incremental)" >> "$CACHEFILE.tmp"
8631
fi
8632
8633
# replace .qmake.cache if it differs from the newly created temp file
8634
if cmp -s "$CACHEFILE.tmp" "$CACHEFILE"; then
8635
    rm -f "$CACHEFILE.tmp"
8636
else
8637
    mv -f "$CACHEFILE.tmp" "$CACHEFILE"
8638
fi
8639
8640
#-------------------------------------------------------------------------------
8641
# give feedback on configuration
8642
#-------------------------------------------------------------------------------
8643
8644
case "$COMPILER" in
8645
g++*)
8646
    if [ "$CFG_EXCEPTIONS" != "no" ]; then
8647
        cat <<EOF
8648
8649
        This target is using the GNU C++ compiler ($PLATFORM).
8650
8651
        Recent versions of this compiler automatically include code for
8652
        exceptions, which increase both the size of the Qt libraries and
8653
        the amount of memory taken by your applications.
8654
8655
        You may choose to re-run `basename $0` with the -no-exceptions
8656
        option to compile Qt without exceptions. This is completely binary
8657
        compatible, and existing applications will continue to work.
8658
8659
EOF
8660
    fi
8661
    ;;
8662
cc*)
8663
    case "$PLATFORM" in
8664
    irix-cc*)
8665
        if [ "$CFG_EXCEPTIONS" != "no" ]; then
8666
            cat <<EOF
8667
8668
        This target is using the MIPSpro C++ compiler ($PLATFORM).
8669
8670
        You may choose to re-run `basename $0` with the -no-exceptions
8671
        option to compile Qt without exceptions. This will make the
8672
        size of the Qt library smaller and reduce the amount of memory
8673
        taken by your applications.
8674
8675
EOF
8676
        fi
8677
        ;;
8678
    *) ;;
8679
    esac
8680
    ;;
8681
*) ;;
8682
esac
8683
8684
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "no" ]  && [ "$CFG_WEBKIT" != "no" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
8685
    cat <<EOF
8686
        WARNING: DWARF2 debug symbols are not enabled. Linking webkit
8687
        in debug mode will run out of memory on systems with 2GB or less.
8688
        Install Xcode 2.4.1 or higher to enable DWARF2, or configure with
8689
         -no-webkit or -release to skip webkit debug.
8690
EOF
8691
fi
8692
8693
echo
8694
if [ "$XPLATFORM" = "$PLATFORM" ]; then
8695
    echo "Build type:    $PLATFORM"
8696
else
8697
    echo "Building on:   $PLATFORM"
8698
    echo "Building for:  $XPLATFORM"
8699
fi
8700
8701
if [ "$PLATFORM_MAC" = "yes" ]; then
8702
    echo "Architecture:  $CFG_ARCH ($CFG_MAC_ARCHS )"
8703
else
8704
    echo "Architecture:  $CFG_ARCH"
8705
fi
8706
8707
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
8708
    echo "Host architecture: $CFG_HOST_ARCH"
8709
fi
8710
8711
if [ "$PLATFORM_MAC" = "yes" ]; then
8712
    if [ "$CFG_MAC_COCOA" = "yes" ]; then
8713
        if [ "$CFG_MAC_CARBON" = "yes" ]; then
8714
            echo "Using framework: Carbon for 32-bit, Cocoa for 64-bit"
8715
        else
8716
            echo "Using framework: Cocoa"
8717
        fi
8718
    else
8719
        echo "Using framework: Carbon"
8720
    fi
8721
fi
8722
8723
if [ -n "$PLATFORM_NOTES" ]; then
8724
    echo "Platform notes:"
8725
    echo "$PLATFORM_NOTES"
8726
else
8727
    echo
8728
fi
8729
8730
if [ "$OPT_VERBOSE" = "yes" ]; then
8731
    echo $ECHO_N "qmake vars .......... $ECHO_C"
8732
    cat "$QMAKE_VARS_FILE" | tr '\n' ' '
8733
    echo "qmake switches ......... $QMAKE_SWITCHES"
8734
fi
8735
8736
[ "$CFG_INCREMENTAL" = "yes" ] && [ '!' -z "$INCREMENTAL" ] && echo "Incremental ............ $INCREMENTAL"
8737
echo "Build .................. $CFG_BUILD_PARTS"
8738
echo "Configuration .......... $QMAKE_CONFIG $QT_CONFIG"
8739
if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
8740
   echo "Debug .................. yes (combined)"
8741
   if [ "$CFG_DEBUG" = "yes" ]; then
8742
       echo "Default Link ........... debug"
8743
   else
8744
       echo "Default Link ........... release"
8745
   fi
8746
else
8747
   echo "Debug .................. $CFG_DEBUG"
8748
fi
8749
echo "Qt 3 compatibility ..... $CFG_QT3SUPPORT"
8750
[ "$CFG_DBUS" = "no" ]     && echo "QtDBus module .......... no"
8751
[ "$CFG_DBUS" = "yes" ]    && echo "QtDBus module .......... yes (run-time)"
8752
[ "$CFG_DBUS" = "linked" ] && echo "QtDBus module .......... yes (linked)"
8753
echo "QtConcurrent code ...... $CFG_CONCURRENT"
8754
echo "QtGui module ........... $CFG_GUI"
8755
echo "QtScript module ........ $CFG_SCRIPT"
8756
echo "QtScriptTools module ... $CFG_SCRIPTTOOLS"
8757
echo "QtXmlPatterns module ... $CFG_XMLPATTERNS"
8758
echo "Phonon module .......... $CFG_PHONON"
8759
echo "Multimedia module ...... $CFG_MULTIMEDIA"
8760
echo "SVG module ............. $CFG_SVG"
8761
case "$CFG_WEBKIT" in
8762
    yes)   echo "WebKit module .......... yes" ;;
8763
    debug) echo "WebKit module .......... yes (debug)" ;;
8764
    no)    echo "WebKit module .......... no" ;;
8765
esac
8766
if [ "$CFG_WEBKIT" != "no" ] || [ "$CFG_SCRIPT" != "no" ]; then
8767
    if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
8768
        echo "JavaScriptCore JIT ..... To be decided by JavaScriptCore"
8769
    else
8770
        echo "JavaScriptCore JIT ..... $CFG_JAVASCRIPTCORE_JIT"
8771
    fi
8772
fi
8773
echo "Declarative module ..... $CFG_DECLARATIVE"
8774
if [ "$CFG_DECLARATIVE" = "yes" ]; then
8775
    echo "Declarative debugging ...$CFG_DECLARATIVE_DEBUG"
8776
fi
8777
echo "Support for S60 ........ $CFG_S60"
8778
echo "Symbian DEF files ...... $CFG_SYMBIAN_DEFFILES"
8779
echo "STL support ............ $CFG_STL"
8780
echo "PCH support ............ $CFG_PRECOMPILE"
8781
echo "MMX/3DNOW/SSE/SSE2/SSE3. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}/${CFG_SSE3}"
8782
echo "SSSE3/SSE4.1/SSE4.2..... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}"
8783
echo "AVX..................... ${CFG_AVX}"
8784
if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then
8785
    echo "iWMMXt support ......... ${CFG_IWMMXT}"
8786
    echo "NEON support ........... ${CFG_NEON}"
8787
fi
8788
[ "${PLATFORM_QWS}" != "yes" -a "${PLATFORM_QPA}" != "yes" ] && echo "Graphics System ........ $CFG_GRAPHICS_SYSTEM"
8789
echo "IPv6 support ........... $CFG_IPV6"
8790
echo "IPv6 ifname support .... $CFG_IPV6IFNAME"
8791
echo "getaddrinfo support .... $CFG_GETADDRINFO"
8792
echo "getifaddrs support ..... $CFG_GETIFADDRS"
8793
echo "Accessibility .......... $CFG_ACCESSIBILITY"
8794
echo "NIS support ............ $CFG_NIS"
8795
echo "CUPS support ........... $CFG_CUPS"
8796
echo "Iconv support .......... $CFG_ICONV"
8797
echo "Glib support ........... $CFG_GLIB"
8798
echo "GStreamer support ...... $CFG_GSTREAMER"
8799
echo "PulseAudio support ..... $CFG_PULSEAUDIO"
8800
echo "Large File support ..... $CFG_LARGEFILE"
8801
echo "GIF support ............ $CFG_GIF"
8802
if [ "$CFG_TIFF" = "no" ]; then
8803
    echo "TIFF support ........... $CFG_TIFF"
8804
else
8805
    echo "TIFF support ........... $CFG_TIFF ($CFG_LIBTIFF)"
8806
fi
8807
if [ "$CFG_JPEG" = "no" ]; then
8808
    echo "JPEG support ........... $CFG_JPEG"
8809
else
8810
    echo "JPEG support ........... $CFG_JPEG ($CFG_LIBJPEG)"
8811
fi
8812
if [ "$CFG_PNG" = "no" ]; then
8813
    echo "PNG support ............ $CFG_PNG"
8814
else
8815
    echo "PNG support ............ $CFG_PNG ($CFG_LIBPNG)"
8816
fi
8817
if [ "$CFG_MNG" = "no" ]; then
8818
    echo "MNG support ............ $CFG_MNG"
8819
else
8820
    echo "MNG support ............ $CFG_MNG ($CFG_LIBMNG)"
8821
fi
8822
echo "zlib support ........... $CFG_ZLIB"
8823
echo "Session management ..... $CFG_SM"
8824
if [ "$PLATFORM_QWS" = "yes" ]; then
8825
    echo "Embedded support ....... $CFG_EMBEDDED"
8826
    if [ "$CFG_QWS_FREETYPE" = "auto" ]; then
8827
	echo "Freetype2 support ...... $CFG_QWS_FREETYPE ($CFG_LIBFREETYPE)"
8828
    else
8829
	echo "Freetype2 support ...... $CFG_QWS_FREETYPE"
8830
    fi
8831
    # Normalize the decoration output first
8832
    CFG_GFX_ON=`echo ${CFG_GFX_ON}`
8833
    CFG_GFX_PLUGIN=`echo ${CFG_GFX_PLUGIN}`
8834
    echo "Graphics (qt) .......... ${CFG_GFX_ON}"
8835
    echo "Graphics (plugin) ...... ${CFG_GFX_PLUGIN}"
8836
    CFG_DECORATION_ON=`echo ${CFG_DECORATION_ON}`
8837
    CFG_DECORATION_PLUGIN=`echo ${CFG_DECORATION_PLUGIN}`
8838
    echo "Decorations (qt) ....... $CFG_DECORATION_ON"
8839
    echo "Decorations (plugin) ... $CFG_DECORATION_PLUGIN"
8840
    CFG_KBD_ON=`echo ${CFG_KBD_ON}`
8841
    CFG_KBD_PLUGIN=`echo ${CFG_KBD_PLUGIN}`
8842
    echo "Keyboard driver (qt) ... ${CFG_KBD_ON}"
8843
    echo "Keyboard driver (plugin) .. ${CFG_KBD_PLUGIN}"
8844
    CFG_MOUSE_ON=`echo ${CFG_MOUSE_ON}`
8845
    CFG_MOUSE_PLUGIN=`echo ${CFG_MOUSE_PLUGIN}`
8846
    echo "Mouse driver (qt) ...... $CFG_MOUSE_ON"
8847
    echo "Mouse driver (plugin) .. $CFG_MOUSE_PLUGIN"
8848
fi
8849
if [ "$CFG_OPENGL" = "desktop" ]; then
8850
    echo "OpenGL support ......... yes (Desktop OpenGL)"
8851
elif [ "$CFG_OPENGL" = "es1" ]; then
8852
    echo "OpenGL support ......... yes (OpenGL ES 1.x Common profile)"
8853
elif [ "$CFG_OPENGL" = "es2" ]; then
8854
    echo "OpenGL support ......... yes (OpenGL ES 2.x)"
8855
else
8856
    echo "OpenGL support ......... no"
8857
fi
8858
if [ "$CFG_EGL" != "no" ]; then
8859
    if [ "$CFG_EGL_GLES_INCLUDES" = "yes" ]; then
8860
        echo "EGL support ............ yes <GLES/egl.h>"
8861
    else
8862
        echo "EGL support ............ yes <EGL/egl.h>"
8863
    fi
8864
fi
8865
if [ "$CFG_OPENVG" ]; then
8866
    if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
8867
        echo "OpenVG support ......... ShivaVG"
8868
    else
8869
        echo "OpenVG support ......... $CFG_OPENVG"
8870
    fi
8871
fi
8872
if [ "$PLATFORM_X11" = "yes" ]; then
8873
    echo "NAS sound support ...... $CFG_NAS"
8874
    echo "XShape support ......... $CFG_XSHAPE"
8875
    echo "XVideo support ......... $CFG_XVIDEO"
8876
    echo "XSync support .......... $CFG_XSYNC"
8877
    echo "Xinerama support ....... $CFG_XINERAMA"
8878
    echo "Xcursor support ........ $CFG_XCURSOR"
8879
    echo "Xfixes support ......... $CFG_XFIXES"
8880
    echo "Xrandr support ......... $CFG_XRANDR"
8881
    echo "Xrender support ........ $CFG_XRENDER"
8882
    echo "Xi support ............. $CFG_XINPUT"
8883
    echo "MIT-SHM support ........ $CFG_MITSHM"
8884
    echo "FontConfig support ..... $CFG_FONTCONFIG"
8885
    echo "XKB Support ............ $CFG_XKB"
8886
    echo "immodule support ....... $CFG_IM"
8887
    echo "GTK theme support ...... $CFG_QGTKSTYLE"
8888
fi
8889
[ "$CFG_SQL_mysql" != "no" ] && echo "MySQL support .......... $CFG_SQL_mysql"
8890
[ "$CFG_SQL_psql" != "no" ] && echo "PostgreSQL support ..... $CFG_SQL_psql"
8891
[ "$CFG_SQL_odbc" != "no" ] && echo "ODBC support ........... $CFG_SQL_odbc"
8892
[ "$CFG_SQL_oci" != "no" ] && echo "OCI support ............ $CFG_SQL_oci"
8893
[ "$CFG_SQL_tds" != "no" ] && echo "TDS support ............ $CFG_SQL_tds"
8894
[ "$CFG_SQL_db2" != "no" ] && echo "DB2 support ............ $CFG_SQL_db2"
8895
[ "$CFG_SQL_ibase" != "no" ] && echo "InterBase support ...... $CFG_SQL_ibase"
8896
[ "$CFG_SQL_sqlite2" != "no" ] && echo "SQLite 2 support ....... $CFG_SQL_sqlite2"
8897
[ "$CFG_SQL_sqlite" != "no" ] && echo "SQLite support ......... $CFG_SQL_sqlite ($CFG_SQLITE)"
8898
8899
OPENSSL_LINKAGE=""
8900
if [ "$CFG_OPENSSL" = "yes" ]; then
8901
    OPENSSL_LINKAGE="(run-time)"
8902
elif [ "$CFG_OPENSSL" = "linked" ]; then
8903
    OPENSSL_LINKAGE="(linked)"
8904
fi
8905
echo "OpenSSL support ........ $CFG_OPENSSL $OPENSSL_LINKAGE"
8906
echo "Alsa support ........... $CFG_ALSA"
8907
if [ "$PLATFORM_MAC" = "yes" ]; then
8908
    echo "CoreWlan support ....... $CFG_COREWLAN"
8909
fi
8910
echo "ICD support ............ $CFG_ICD"
8911
echo "libICU support ......... $CFG_ICU"
8912
echo
8913
8914
[ "$CFG_PTMALLOC" != "no" ] && echo "Use ptmalloc ........... $CFG_PTMALLOC"
8915
8916
# complain about not being able to use dynamic plugins if we are using a static build
8917
if [ "$CFG_SHARED" = "no" ]; then
8918
    echo
8919
    echo "WARNING: Using static linking will disable the use of dynamically"
8920
    echo "loaded plugins. Make sure to import all needed static plugins,"
8921
    echo "or compile needed modules into the library."
8922
    echo
8923
fi
8924
if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
8925
    echo
8926
    echo "NOTE: When linking against OpenSSL, you can override the default"
8927
    echo "library names through OPENSSL_LIBS."
8928
    echo "For example:"
8929
    echo "    OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
8930
    echo
8931
fi
8932
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "no" ]; then
8933
    echo
8934
    echo "Error: debug-only framework builds are not supported. Configure with -no-framework"
8935
    echo "if you want a pure debug build."
8936
    echo
8937
    exit 1
8938
fi
8939
8940
sepath=`echo "$relpath" | sed -e 's/\\./\\\\./g'`
8941
PROCS=1
8942
EXEC=""
8943
8944
8945
#-------------------------------------------------------------------------------
8946
# build makefiles based on the configuration
8947
#-------------------------------------------------------------------------------
8948
8949
echo "Finding project files. Please wait..."
8950
if [ "$CFG_NOPROCESS" != "yes" ]; then
8951
    "$outpath/bin/qmake" -prl -r "${relpath}/projects.pro"
8952
    if [ -f "${relpath}/projects.pro" ]; then
8953
        mkfile="${outpath}/Makefile"
8954
        [ -f "$mkfile" ] && chmod +w "$mkfile"
8955
        QTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" "${relpath}/projects.pro" -o "$mkfile"
8956
    fi
8957
fi
8958
8959
# .projects      -> projects to process
8960
# .projects.1    -> qt and moc
8961
# .projects.2    -> subdirs and libs
8962
# .projects.3    -> the rest
8963
rm -f .projects .projects.1 .projects.2 .projects.3
8964
8965
QMAKE_PROJECTS=`find "$relpath/." -name '*.pro' -print | sed 's-/\./-/-'`
8966
if [ -z "$AWK" ]; then
8967
    for p in `echo $QMAKE_PROJECTS`; do
8968
        echo "$p" >> .projects
8969
    done
8970
else
8971
    cat >projects.awk <<EOF
8972
BEGIN {
8973
    files = 0
8974
    target_file = ""
8975
    input_file = ""
8976
8977
    first = "./.projects.1.tmp"
8978
    second = "./.projects.2.tmp"
8979
    third = "./.projects.3.tmp"
8980
}
8981
8982
FNR == 1 {
8983
    if ( input_file ) {
8984
        if ( ! target_file )
8985
            target_file = third
8986
        print input_file >target_file
8987
    }
8988
8989
    matched_target = 0
8990
    template_lib = 0
8991
    input_file = FILENAME
8992
    target_file = ""
8993
}
8994
8995
/^(TARGET.*=)/ {
8996
    if ( \$3 == "moc" || \$3 ~ /^Qt/ ) {
8997
        target_file = first
8998
        matched_target = 1
8999
    } else if ( \$3 == "lrelease" || \$3 == "qm_phony_target" ) {
9000
        target_file = second
9001
        matched_target = 1
9002
    }
9003
}
9004
9005
matched_target == 0 && /^(TEMPLATE.*=)/ {
9006
    if ( \$3 == "subdirs" )
9007
        target_file = second
9008
    else if ( \$3 == "lib" )
9009
        template_lib = 1
9010
    else
9011
        target_file = third
9012
}
9013
9014
matched_target == 0 && template_lib == 1 && /^(CONFIG.*=)/ {
9015
    if ( \$0 ~ /plugin/ )
9016
        target_file = third
9017
    else
9018
        target_file = second
9019
}
9020
9021
END {
9022
    if ( input_file ) {
9023
        if ( ! target_file )
9024
            target_file = third
9025
        print input_file >>target_file
9026
    }
9027
}
9028
9029
EOF
9030
9031
    rm -f .projects.all
9032
    for p in `echo $QMAKE_PROJECTS`; do
9033
       echo "$p" >> .projects.all
9034
    done
9035
9036
    # if you get errors about the length of the command line to awk, change the -l arg
9037
    # to split below
9038
    split -l 100 .projects.all .projects.all.
9039
    for p in .projects.all.*; do
9040
       "$AWK" -f projects.awk `cat $p`
9041
       [ -f .projects.1.tmp ] && cat .projects.1.tmp >> .projects.1
9042
       [ -f .projects.2.tmp ] && cat .projects.2.tmp >> .projects.2
9043
       [ -f .projects.3.tmp ] && cat .projects.3.tmp >> .projects.3
9044
       rm -f .projects.1.tmp .projects.2.tmp .projects.3.tmp $p
9045
    done
9046
    rm -f .projects.all* projects.awk
9047
9048
    [ -f .projects.1 ] && cat .projects.1 >>.projects
9049
    [ -f .projects.2 ] && cat .projects.2 >>.projects
9050
    rm -f .projects.1 .projects.2
9051
    if [ -f .projects.3 ] && [ "$OPT_FAST" = "no" ]; then
9052
       cat .projects.3 >>.projects
9053
       rm -f .projects.3
9054
    fi
9055
fi
9056
# don't sort Qt and MOC in with the other project files
9057
# also work around a segfaulting uniq(1)
9058
if [ -f .sorted.projects.2 ]; then
9059
    sort .sorted.projects.2 > .sorted.projects.2.new
9060
    mv -f .sorted.projects.2.new .sorted.projects.2
9061
    cat .sorted.projects.2 >> .sorted.projects.1
9062
fi
9063
[ -f .sorted.projects.1 ] && sort .sorted.projects.1 >> .sorted.projects
9064
rm -f .sorted.projects.2 .sorted.projects.1
9065
9066
NORM_PROJECTS=0
9067
FAST_PROJECTS=0
9068
if [ -f .projects ]; then
9069
   uniq .projects >.tmp
9070
   mv -f .tmp .projects
9071
   NORM_PROJECTS=`cat .projects | wc -l | sed -e "s, ,,g"`
9072
fi
9073
if [ -f .projects.3 ]; then
9074
   uniq .projects.3 >.tmp
9075
   mv -f .tmp .projects.3
9076
   FAST_PROJECTS=`cat .projects.3 | wc -l | sed -e "s, ,,g"`
9077
fi
9078
echo "  `expr $NORM_PROJECTS + $FAST_PROJECTS` projects found."
9079
echo
9080
9081
PART_ROOTS=
9082
for part in $CFG_BUILD_PARTS; do
9083
    case "$part" in
9084
    tools) PART_ROOTS="$PART_ROOTS tools" ;;
9085
    libs) PART_ROOTS="$PART_ROOTS src tools/linguist/lrelease" ;;
9086
    translations) PART_ROOTS="$PART_ROOTS translations" ;;
9087
    examples) PART_ROOTS="$PART_ROOTS examples demos" ;;
9088
    *) ;;
9089
    esac
9090
done
9091
9092
if [ "$CFG_DEV" = "yes" ]; then
9093
    PART_ROOTS="$PART_ROOTS tests"
9094
fi
9095
9096
echo "Creating makefiles. Please wait..."
9097
for file in .projects .projects.3; do
9098
    [ '!' -f "$file" ] && continue
9099
    for a in `cat $file`; do
9100
        IN_ROOT=no
9101
	for r in $PART_ROOTS; do
9102
	    if echo "$a" | grep "^$r" >/dev/null 2>&1 || echo "$a" | grep "^$relpath/$r" >/dev/null 2>&1; then
9103
		IN_ROOT=yes
9104
		break
9105
            fi
9106
	done
9107
        [ "$IN_ROOT" = "no" ] && continue
9108
9109
        case $a in
9110
        *winmain/winmain.pro)
9111
            if [ "$CFG_NOPROCESS" = "yes" ] || [ "$XPLATFORM_MINGW" != "yes" ]; then
9112
                continue
9113
            fi
9114
            SPEC=$XQMAKESPEC ;;
9115
        *s60main/s60main.pro)
9116
            if [ "$CFG_NOPROCESS" = "yes" ] || [ "$XPLATFORM_SYMBIAN" != "yes" ]; then
9117
                continue
9118
            fi;;
9119
        *examples/activeqt/*) continue ;;
9120
        */qmake/qmake.pro) continue ;;
9121
        *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*linguist/lrelease*) SPEC=$QMAKESPEC ;;
9122
        *) if [ "$CFG_NOPROCESS" = "yes" ]; then
9123
              continue
9124
           else
9125
              SPEC=$XQMAKESPEC
9126
           fi;;
9127
        esac
9128
        dir=`dirname "$a" | sed -e "s;$sepath;.;g"`
9129
        test -d "$dir" || mkdir -p "$dir"
9130
        OUTDIR="$outpath/$dir"
9131
        if [ -f "${OUTDIR}/Makefile" ] && [ "$OPT_FAST" = "yes" ]; then
9132
            # fast configure - the makefile exists, skip it
9133
            # since the makefile exists, it was generated by qmake, which means we
9134
            # can skip it, since qmake has a rule to regenerate the makefile if the .pro
9135
            # file changes...
9136
            [ "$OPT_VERBOSE" = "yes" ] && echo "  skipping $a"
9137
            continue;
9138
        fi
9139
        QMAKE_SPEC_ARGS="-spec $SPEC"
9140
        echo $ECHO_N "  for $a$ECHO_C"
9141
9142
        QMAKE="$outpath/bin/qmake"
9143
	QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS"
9144
        if [ "$file" = ".projects.3" ]; then
9145
            echo " (fast)"
9146
9147
            cat >"${OUTDIR}/Makefile" <<EOF
9148
# ${OUTDIR}/Makefile: generated by configure
9149
#
9150
# WARNING: This makefile will be replaced with a real makefile.
9151
# All changes made to this file will be lost.
9152
EOF
9153
            [ "$CFG_DEBUG_RELEASE" = "no" ] && echo "first_target: first" >>${OUTDIR}/Makefile
9154
9155
            cat >>"${OUTDIR}/Makefile" <<EOF
9156
QMAKE = "$QMAKE"
9157
all clean install qmake first Makefile: FORCE
9158
	\$(QMAKE) $QMAKE_ARGS -o "$OUTDIR" "$a"
9159
	cd "$OUTDIR"
9160
	\$(MAKE) \$@
9161
9162
FORCE:
9163
9164
EOF
9165
        else
9166
            if [ "$OPT_VERBOSE" = "yes" ]; then
9167
                echo " (`basename $SPEC`)"
9168
                echo "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
9169
	    else
9170
		echo
9171
            fi
9172
9173
            [ -f "${OUTDIR}/Makefile" ] && chmod +w "${OUTDIR}/Makefile"
9174
            QTDIR="$outpath" "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
9175
       fi
9176
    done
9177
done
9178
rm -f .projects .projects.3
9179
9180
#-------------------------------------------------------------------------------
9181
# check for platforms that we don't yet know about
9182
#-------------------------------------------------------------------------------
9183
if [ "$CFG_ARCH" = "generic" ]; then
9184
cat <<EOF
9185
9186
        NOTICE: Atomic operations are not yet supported for this
9187
        architecture.
9188
9189
        Qt will use the 'generic' architecture instead, which uses a
9190
        single pthread_mutex_t to protect all atomic operations. This
9191
        implementation is the slow (but safe) fallback implementation
9192
        for architectures Qt does not yet support.
9193
EOF
9194
fi
9195
9196
#-------------------------------------------------------------------------------
9197
# check if the user passed the -no-zlib option, which is no longer supported
9198
#-------------------------------------------------------------------------------
9199
if [ -n "$ZLIB_FORCED" ]; then
9200
    which_zlib="supplied"
9201
    if [ "$CFG_ZLIB" = "system" ]; then
9202
	which_zlib="system"
9203
    fi
9204
9205
cat <<EOF
9206
9207
        NOTICE: The -no-zlib option was supplied but is no longer
9208
        supported.
9209
9210
        Qt now requires zlib support in all builds, so the -no-zlib
9211
        option was ignored. Qt will be built using the $which_zlib
9212
        zlib.
9213
EOF
9214
fi
9215
9216
#-------------------------------------------------------------------------------
9217
# finally save the executed command to another script
9218
#-------------------------------------------------------------------------------
9219
if [ `basename $0` != "config.status" ]; then
9220
    CONFIG_STATUS="$relpath/$relconf $OPT_CMDLINE"
9221
9222
    # add the system variables
9223
    for varname in $SYSTEM_VARIABLES; do
9224
        cmd=`echo \
9225
'if [ -n "\$'${varname}'" ]; then
9226
    CONFIG_STATUS="'${varname}'='"'\\\$${varname}'"' \$CONFIG_STATUS"
9227
fi'`
9228
	eval "$cmd"
9229
    done
9230
9231
    echo "$CONFIG_STATUS" | grep '\-confirm\-license' >/dev/null 2>&1 || CONFIG_STATUS="$CONFIG_STATUS -confirm-license"
9232
9233
    [ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
9234
    echo "#!/bin/sh" > "$outpath/config.status"
9235
    echo "if [ \"\$#\" -gt 0 ]; then" >> "$outpath/config.status"
9236
    echo "  $CONFIG_STATUS \"\$@\"" >> "$outpath/config.status"
9237
    echo "else" >> "$outpath/config.status"
9238
    echo "  $CONFIG_STATUS" >> "$outpath/config.status"
9239
    echo "fi" >> "$outpath/config.status"
9240
    chmod +x "$outpath/config.status"
9241
fi
9242
9243
if [ -n "$RPATH_MESSAGE" ]; then
9244
    echo
9245
    echo "$RPATH_MESSAGE"
9246
fi
9247
9248
MAKE=`basename "$MAKE"`
9249
echo
9250
echo Qt is now configured for building. Just run \'$MAKE\'.
9251
if [ "$relpath" = "$QT_INSTALL_PREFIX" ]; then
9252
    echo Once everything is built, Qt is installed.
9253
    echo You should not run \'$MAKE install\'.
9254
else
9255
    echo Once everything is built, you must run \'$MAKE install\'.
9256
    echo Qt will be installed into $QT_INSTALL_PREFIX
9257
fi
9258
echo
9259
echo To reconfigure, run \'$MAKE confclean\' and \'configure\'.
9260
echo