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