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