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