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