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