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