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