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