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