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