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