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