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