Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
[qt:qt.git] / configure
1 #!/bin/sh
2 #############################################################################
3 ##
4 ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 ## All rights reserved.
6 ## Contact: Nokia Corporation (qt-info@nokia.com)
7 ##
8 ## This file is the build configuration utility of the Qt Toolkit.
9 ##
10 ## $QT_BEGIN_LICENSE:LGPL$
11 ## No Commercial Usage
12 ## This file contains pre-release code and may not be distributed.
13 ## You may use this file in accordance with the terms and conditions
14 ## contained in the Technology Preview License Agreement accompanying
15 ## this package.
16 ##
17 ## GNU Lesser General Public License Usage
18 ## Alternatively, this file may be used under the terms of the GNU Lesser
19 ## General Public License version 2.1 as published by the Free Software
20 ## Foundation and appearing in the file LICENSE.LGPL included in the
21 ## packaging of this file.  Please review the following information to
22 ## ensure the GNU Lesser General Public License version 2.1 requirements
23 ## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ##
25 ## In addition, as a special exception, Nokia gives you certain additional
26 ## rights.  These rights are described in the Nokia Qt LGPL Exception
27 ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ##
29 ## If you have questions regarding the use of this file, please contact
30 ## Nokia at qt-info@nokia.com.
31 ##
32 ##
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_MAC=no
189 PLATFORM_QWS=no
190
191 if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ] && [ -d /System/Library/Frameworks/Carbon.framework ]; then
192     # Qt/Mac
193     # ~ the Carbon SDK exists
194     # ~ src/gui/base/qapplication_mac.cpp is present
195     # ~ this is the internal edition and Qt/Mac sources exist
196     PLATFORM_MAC=maybe
197 elif [ -f "$relpath"/src/gui/kernel/qapplication_qws.cpp ]; then
198     # Qt Embedded
199     # ~ src/gui/base/qapplication_qws.cpp is present
200     # ~ this is the free or commercial edition
201     # ~ this is the internal edition and Qt Embedded is explicitly enabled
202     if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ]; then
203         # This is a depot build, or an all-platforms package
204         PLATFORM_QWS=maybe
205     else
206         # This must be the embedded package, since the Qt/Mac source files are not present
207         PLATFORM_QWS=yes
208     fi
209 fi
210
211 #-----------------------------------------------------------------------------
212 # Qt version detection
213 #-----------------------------------------------------------------------------
214 QT_VERSION=`grep '^# *define *QT_VERSION_STR' "$relpath"/src/corelib/global/qglobal.h`
215 QT_MAJOR_VERSION=
216 QT_MINOR_VERSION=0
217 QT_PATCH_VERSION=0
218 if [ -n "$QT_VERSION" ]; then
219    QT_VERSION=`echo $QT_VERSION | sed 's,^# *define *QT_VERSION_STR *"*\([^ ]*\)"$,\1,'`
220    MAJOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
221    if [ -n "$MAJOR" ]; then
222      MINOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
223       PATCH=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
224       QT_MAJOR_VERSION="$MAJOR"
225       [ -z "$MINOR" ] || QT_MINOR_VERSION="$MINOR"
226       [ -z "$PATCH" ] || QT_PATCH_VERSION="$PATCH"
227    fi
228 fi
229 if [ -z "$QT_MAJOR_VERSION" ]; then
230    echo "Cannot process version from qglobal.h: $QT_VERSION"
231    echo "Cannot proceed."
232    exit 1
233 fi
234
235 QT_PACKAGEDATE=`grep '^# *define *QT_PACKAGEDATE_STR' "$relpath"/src/corelib/global/qglobal.h | sed -e 's,^# *define *QT_PACKAGEDATE_STR *"\([^ ]*\)"$,\1,' -e s,-,,g`
236 if [ -z "$QT_PACKAGEDATE" ]; then
237    echo "Unable to determine package date from qglobal.h: '$QT_PACKAGEDATE'"
238    echo "Cannot proceed"
239    exit 1
240 fi
241
242 #-------------------------------------------------------------------------------
243 # check the license
244 #-------------------------------------------------------------------------------
245 COMMERCIAL_USER=ask
246 CFG_DEV=no
247 CFG_NOKIA=no
248 CFG_EMBEDDED=no
249 CFG_RTOS_ENABLED=yes
250 EditionString=Commercial
251
252 earlyArgParse()
253 {
254     # parse the arguments, setting things to "yes" or "no"
255     while [ "$#" -gt 0 ]; do
256         CURRENT_OPT="$1"
257         UNKNOWN_ARG=no
258         case "$1" in
259         #Autoconf style options
260         --enable-*)
261             VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
262             VAL=yes
263             ;;
264         --disable-*)
265             VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
266             VAL=no
267             ;;
268         --*=*)
269             VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
270             VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
271             ;;
272         --no-*)
273             VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
274             VAL=no
275             ;;
276         -embedded)
277             VAR=embedded
278             # this option may or may not be followed by an argument
279             if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
280                 VAL=auto
281             else
282                 shift;
283                 VAL=$1
284             fi
285             ;;
286         -h|help|--help|-help)
287             if [ "$VAL" = "yes" ]; then
288                 OPT_HELP="$VAL"
289                 COMMERCIAL_USER="no" #doesn't matter we will display the help
290             else
291                 UNKNOWN_OPT=yes
292                 COMMERCIAL_USER="no" #doesn't matter we will display the help
293             fi
294             ;;
295         --*)
296             VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
297             VAL=yes
298             ;;
299         -*)
300             VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
301             VAL="unknown"
302             ;;
303         *)
304             UNKNOWN_ARG=yes
305             ;;
306         esac
307         if [ "$UNKNOWN_ARG" = "yes" ]; then
308             shift
309             continue
310         fi
311         shift
312
313         UNKNOWN_OPT=no
314         case "$VAR" in
315         embedded)
316             CFG_EMBEDDED="$VAL"
317             if [ "$PLATFORM_QWS" != "no" ]; then
318                 if [ "$PLATFORM_QWS" = "maybe" ]; then
319                     PLATFORM_X11=no
320                     PLATFORM_MAC=no
321                     PLATFORM_QWS=yes
322                 fi
323             else
324                 echo "No license exists to enable Qt for Embedded Linux. Disabling."
325                 CFG_EMBEDDED=no
326             fi
327             ;;
328         developer-build)
329             CFG_DEV="yes"
330             ;;
331         nokia-developer)
332             CFG_DEV="yes"
333             CFG_NOKIA="yes"
334             COMMERCIAL_USER="no"
335             ;;
336         commercial)
337             COMMERCIAL_USER="yes"
338             ;;
339         opensource)
340             COMMERCIAL_USER="no"
341             ;;
342         *)
343             UNKNOWN_OPT=yes
344             ;;
345         esac
346     done
347 }
348
349 earlyArgParse "$@"
350
351 if [ "$COMMERCIAL_USER" = "ask" ]; then
352     while true; do
353         echo "Which edition of Qt do you want to use ?"
354         echo
355         echo "Type 'c' if you want to use the Commercial Edition."
356         echo "Type 'o' if you want to use the Open Source Edition."
357         echo
358         read commercial
359         echo
360         if [ "$commercial" = "c" ]; then
361             COMMERCIAL_USER="yes"
362             break
363         elif [ "$commercial" = "o" ]; then
364             COMMERCIAL_USER="no"
365             break
366         fi
367     done
368 fi
369
370 if [ "$CFG_NOKIA" = "yes" ]; then
371     Licensee="Nokia"
372     Edition="NokiaInternalBuild"
373     EditionString="Nokia Internal Build"
374     QT_EDITION="QT_EDITION_OPENSOURCE"
375     [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
376 elif [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then
377     # Commercial preview release
378     [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
379     Licensee="Preview"
380     Edition="Preview"
381     QT_EDITION="QT_EDITION_DESKTOP"
382     LicenseType="Technology Preview"
383 elif [ $COMMERCIAL_USER = "yes" ]; then
384     # one of commercial editions
385     [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
386     [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=no
387
388     # read in the license file
389     if [ -f "$LICENSE_FILE" ]; then
390         . "$LICENSE_FILE" >/dev/null 2>&1
391         if [ -z "$LicenseKeyExt" ]; then
392             echo
393             echo "You are using an old license file."
394             echo
395             echo "Please install the license file supplied by Nokia,"
396             echo "or install the Qt Open Source Edition if you intend to"
397             echo "develop free software."
398             exit 1
399         fi
400         if [ -z "$Licensee" ]; then
401             echo
402             echo "Invalid license key. Please check the license key."
403             exit 1
404         fi
405     else
406         if [ -z "$LicenseKeyExt" ]; then
407             echo
408             echo $ECHO_N "Please enter your license key: $ECHO_C"
409             read LicenseKeyExt
410             Licensee="Unknown user"
411         fi
412     fi
413
414     # Key verification
415     echo "$LicenseKeyExt" | grep ".....*-....*-....*-....*-.....*-.....*-...." >/dev/null 2>&1 \
416         && LicenseValid="yes" \
417         || LicenseValid="no"
418     if [ "$LicenseValid" != "yes" ]; then
419         echo
420         echo "Invalid license key. Please check the license key."
421         exit 1
422     fi
423     ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1`
424     PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d -`
425     LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -`
426     LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1`
427
428     # determine which edition we are licensed to use
429     case "$LicenseTypeCode" in
430     F4M)
431         LicenseType="Commercial"
432         case $ProductCode in
433         F)
434             Edition="Universal"
435             QT_EDITION="QT_EDITION_UNIVERSAL"
436             ;;
437         B)
438             Edition="FullFramework"
439             EditionString="Full Framework"
440             QT_EDITION="QT_EDITION_DESKTOP"
441             ;;
442         L)
443             Edition="GUIFramework"
444             EditionString="GUI Framework"
445             QT_EDITION="QT_EDITION_DESKTOPLIGHT"
446             ;;
447         esac
448         ;;
449     Z4M|R4M|Q4M)
450         LicenseType="Evaluation"
451         QMakeVar add DEFINES QT_EVAL
452         case $ProductCode in
453          B)
454             Edition="Evaluation"
455             QT_EDITION="QT_EDITION_EVALUATION"
456             ;;
457         esac
458         ;;
459     esac
460     if [ -z "$LicenseType" -o -z "$Edition" -o -z "$QT_EDITION" ]; then
461         echo
462         echo "Invalid license key. Please check the license key."
463         exit 1
464     fi
465
466     # verify that we are licensed to use Qt on this platform
467     LICENSE_EXTENSION=
468     case "$PlatformCode" in
469         *L)
470             CFG_RTOS_ENABLED=yes
471             PlatformCode=`echo "$PlatformCode" | sed 'h;y/8NPQRTZ/UCWX9M7/;x;G;s/\(.\)....\(.\)./\1\2/'`
472             ;;
473         *)
474             CFG_RTOS_ENABLED=no
475             PlatformCode=`echo "$PlatformCode" | sed 's/.$//'`
476             ;;
477     esac
478     case "$PlatformCode,$PLATFORM_MAC,$PLATFORM_QWS" in
479         X9,* | XC,* | XU,* | XW,* | XM,*)
480             # Qt All-OS
481             LICENSE_EXTENSION="-ALLOS"
482             ;;
483         8M,* | KM,* | S9,* | SC,* | SU,* | SW,* | X9,* | XC,* | XU,* | XW,*)
484             # Qt for Embedded Linux
485             LICENSE_EXTENSION="-EMBEDDED"
486             ;;
487         6M,*,no | N7,*,no | N9,*,no | NX,*,no)
488             # Embedded no-deploy
489             LICENSE_EXTENSION="-EMBEDDED"
490             ;;
491         FM,*,no | LM,yes,* | ZM,no,no)
492             # Desktop
493             LICENSE_EXTENSION="-DESKTOP"
494             ;;
495         *)
496             Platform=Linux/X11
497             [ "$PLATFORM_MAC" = "yes" ] && Platform='Mac OS X'
498             [ "$PLATFORM_QWS" = "yes" ] && Platform='Embedded Linux'
499             echo
500             echo "You are not licensed for the $Platform platform."
501             echo
502             echo "Please contact qt-info@nokia.com to upgrade your license to"
503             echo "include the $Platform platform, or install the Qt Open Source Edition"
504             echo "if you intend to develop free software."
505             exit 1
506             ;;
507     esac
508
509     if test -r "$relpath/.LICENSE"; then
510         # Generic, non-final license
511         LICENSE_EXTENSION=""
512         line=`sed 'y/a-z/A-Z/;q' "$relpath"/.LICENSE`
513         case "$line" in
514             *BETA*)
515                 Edition=Beta
516                 ;;
517             *TECHNOLOGY?PREVIEW*)
518                 Edition=Preview
519                 ;;
520             *EVALUATION*)
521                 Edition=Evaluation
522                 ;;
523             *)
524                 echo >&2 "Invalid license files; cannot continue"
525                 exit 1
526                 ;;
527         esac
528         Licensee="$Edition"
529         EditionString="$Edition"
530         QT_EDITION="QT_EDITION_DESKTOP"
531     fi
532
533     case "$LicenseFeatureCode" in
534     B|G|L|Y)
535         # US
536         case "$LicenseType" in
537         Commercial)
538             cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-US" "$outpath/LICENSE"
539             ;;
540         Evaluation)
541             cp -f "$relpath/.LICENSE-EVALUATION-US" "$outpath/LICENSE"
542             ;;
543         esac
544         ;;
545     2|4|5|F)
546         # non-US
547         case "$LicenseType" in
548         Commercial)
549             cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}" "$outpath/LICENSE"
550             ;;
551         Evaluation)
552             cp -f "$relpath/.LICENSE-EVALUATION" "$outpath/LICENSE"
553             ;;
554         esac
555         ;;
556     *)
557         echo
558         echo "Invalid license key. Please check the license key."
559         exit 1
560         ;;
561     esac
562     case "$LicenseFeatureCode" in
563         4|B|F|Y)
564             CFG_RTOS_ENABLED=yes
565             ;;
566         2|5|G|L)
567             CFG_RTOS_ENABLED=no
568             ;;
569     esac
570     if [ '!' -f "$outpath/LICENSE" ]; then
571         echo "The LICENSE, LICENSE.GPL3 LICENSE.LGPL file shipped with"
572         echo "this software has disappeared."
573         echo
574         echo "Sorry, you are not licensed to use this software."
575         echo "Try re-installing."
576         echo
577         exit 1
578     fi
579 elif [ $COMMERCIAL_USER = "no" ]; then
580     # Open Source edition - may only be used under the terms of the GPL or LGPL.
581     [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
582     Licensee="Open Source"
583     Edition="OpenSource"
584     EditionString="Open Source"
585     QT_EDITION="QT_EDITION_OPENSOURCE"
586 fi
587
588 #-------------------------------------------------------------------------------
589 # initalize variables
590 #-------------------------------------------------------------------------------
591
592 SYSTEM_VARIABLES="CC CXX CFLAGS CXXFLAGS LDFLAGS"
593 for varname in $SYSTEM_VARIABLES; do
594     qmakevarname="${varname}"
595     # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
596     if [ "${varname}" = "LDFLAGS" ]; then
597         qmakevarname="LFLAGS"
598     fi
599     cmd=`echo \
600 'if [ -n "\$'${varname}'" ]; then
601     QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}'"
602 fi'`
603     eval "$cmd"
604 done
605 # Use CC/CXX to run config.tests
606 mkdir -p "$outpath/config.tests"
607 rm -f "$outpath/config.tests/.qmake.cache"
608 cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
609
610 QMakeVar add styles "cde mac motif plastique cleanlooks windows"
611 QMakeVar add decorations "default windows styled"
612 QMakeVar add mouse-drivers "pc"
613 if [ "$UNAME_SYSTEM" = "Linux" ] ; then
614     QMakeVar add gfx-drivers "linuxfb"
615     QMakeVar add mouse-drivers "linuxtp"
616 fi
617 QMakeVar add kbd-drivers "tty"
618
619 if [ "$CFG_DEV" = "yes" ]; then
620     QMakeVar add kbd-drivers "um"
621 fi
622
623 # QTDIR may be set and point to an old or system-wide Qt installation
624 unset QTDIR
625
626 # the minimum version of libdbus-1 that we require:
627 MIN_DBUS_1_VERSION=0.93
628
629 # initalize internal variables
630 CFG_CONFIGURE_EXIT_ON_ERROR=yes
631 CFG_PROFILE=no
632 CFG_EXCEPTIONS=unspecified
633 CFG_SCRIPT=auto # (yes|no|auto)
634 CFG_SCRIPTTOOLS=auto # (yes|no|auto)
635 CFG_XMLPATTERNS=auto # (yes|no|auto)
636 CFG_INCREMENTAL=auto
637 CFG_QCONFIG=full
638 CFG_DEBUG=auto
639 CFG_MYSQL_CONFIG=
640 CFG_DEBUG_RELEASE=no
641 CFG_SHARED=yes
642 CFG_SM=auto
643 CFG_XSHAPE=auto
644 CFG_XSYNC=auto
645 CFG_XINERAMA=runtime
646 CFG_XFIXES=runtime
647 CFG_ZLIB=auto
648 CFG_SQLITE=qt
649 CFG_GIF=auto
650 CFG_TIFF=auto
651 CFG_LIBTIFF=auto
652 CFG_PNG=yes
653 CFG_LIBPNG=auto
654 CFG_JPEG=auto
655 CFG_LIBJPEG=auto
656 CFG_MNG=auto
657 CFG_LIBMNG=auto
658 CFG_XCURSOR=runtime
659 CFG_XRANDR=runtime
660 CFG_XRENDER=auto
661 CFG_MITSHM=auto
662 CFG_OPENGL=auto
663 CFG_OPENVG=no
664 CFG_OPENVG_LC_INCLUDES=no
665 CFG_OPENVG_SHIVA=no
666 CFG_OPENVG_ON_OPENGL=no
667 CFG_EGL=no
668 CFG_EGL_GLES_INCLUDES=no
669 CFG_SSE=auto
670 CFG_FONTCONFIG=auto
671 CFG_QWS_FREETYPE=auto
672 CFG_LIBFREETYPE=auto
673 CFG_SQL_AVAILABLE=
674 QT_DEFAULT_BUILD_PARTS="libs tools examples demos docs translations"
675 CFG_BUILD_PARTS=""
676 CFG_NOBUILD_PARTS=""
677 CFG_RELEASE_QMAKE=no
678 CFG_PHONON=auto
679 CFG_PHONON_BACKEND=yes
680 CFG_MULTIMEDIA=yes
681 CFG_AUDIO_BACKEND=yes
682 CFG_SVG=yes
683 CFG_DECLARATIVE=auto
684 CFG_WEBKIT=auto # (yes|no|auto)
685 CFG_JAVASCRIPTCORE_JIT=auto
686
687 CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen directfb"
688 CFG_GFX_ON="linuxfb multiscreen"
689 CFG_GFX_PLUGIN_AVAILABLE=
690 CFG_GFX_PLUGIN=
691 CFG_GFX_OFF=
692 CFG_KBD_AVAILABLE="tty linuxinput qvfb"
693 CFG_KBD_ON="tty"    #default, see QMakeVar above
694 CFG_MOUSE_AVAILABLE="pc linuxtp linuxinput tslib qvfb"
695 CFG_MOUSE_ON="pc linuxtp"   #default, see QMakeVar above
696
697 if [ -f "$relpath/src/gui/embedded/qscreenqnx_qws.cpp" ]; then
698     CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} qnx"
699     CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} qnx"
700     CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} qnx"
701 fi
702
703 CFG_ARCH=
704 CFG_HOST_ARCH=
705 CFG_KBD_PLUGIN_AVAILABLE=
706 CFG_KBD_PLUGIN=
707 CFG_KBD_OFF=
708 CFG_MOUSE_PLUGIN_AVAILABLE=
709 CFG_MOUSE_PLUGIN=
710 CFG_MOUSE_OFF=
711 CFG_USE_GNUMAKE=no
712 CFG_IM=yes
713 CFG_DECORATION_AVAILABLE="styled windows default"
714 CFG_DECORATION_ON="${CFG_DECORATION_AVAILABLE}" # all on by default
715 CFG_DECORATION_PLUGIN_AVAILABLE=
716 CFG_DECORATION_PLUGIN=
717 CFG_XINPUT=runtime
718 CFG_XKB=auto
719 CFG_NIS=auto
720 CFG_CUPS=auto
721 CFG_ICONV=auto
722 CFG_DBUS=auto
723 CFG_GLIB=auto
724 CFG_GSTREAMER=auto
725 CFG_QGTKSTYLE=auto
726 CFG_LARGEFILE=auto
727 CFG_OPENSSL=auto
728 CFG_PTMALLOC=no
729 CFG_STL=auto
730 CFG_PRECOMPILE=auto
731 CFG_SEPARATE_DEBUG_INFO=auto
732 CFG_SEPARATE_DEBUG_INFO_NOCOPY=no
733 CFG_REDUCE_EXPORTS=auto
734 CFG_MMX=auto
735 CFG_3DNOW=auto
736 CFG_SSE=auto
737 CFG_SSE2=auto
738 CFG_REDUCE_RELOCATIONS=no
739 CFG_IPV6=auto
740 CFG_NAS=no
741 CFG_QWS_DEPTHS=all
742 CFG_USER_BUILD_KEY=
743 CFG_ACCESSIBILITY=auto
744 CFG_QT3SUPPORT=yes
745 CFG_ENDIAN=auto
746 CFG_HOST_ENDIAN=auto
747 CFG_DOUBLEFORMAT=auto
748 CFG_ARMFPA=auto
749 CFG_IWMMXT=no
750 CFG_NEON=auto
751 CFG_CLOCK_GETTIME=auto
752 CFG_CLOCK_MONOTONIC=auto
753 CFG_MREMAP=auto
754 CFG_GETADDRINFO=auto
755 CFG_IPV6IFNAME=auto
756 CFG_GETIFADDRS=auto
757 CFG_INOTIFY=auto
758 CFG_RPATH=yes
759 CFG_FRAMEWORK=auto
760 CFG_MAC_ARCHS=
761 MAC_CONFIG_TEST_COMMANDLINE=  # used to make the configure tests run with the correct arch's and SDK settings
762 CFG_MAC_DWARF2=auto
763 CFG_MAC_XARCH=auto
764 CFG_MAC_CARBON=yes
765 CFG_MAC_COCOA=auto
766 COMMANDLINE_MAC_COCOA=no
767 CFG_SXE=no
768 CFG_PREFIX_INSTALL=yes
769 CFG_SDK=
770 D_FLAGS=
771 I_FLAGS=
772 L_FLAGS=
773 RPATH_FLAGS=
774 l_FLAGS=
775 QCONFIG_FLAGS=
776 XPLATFORM=              # This seems to be the QMAKESPEC, like "linux-g++"
777 PLATFORM=$QMAKESPEC
778 QT_CROSS_COMPILE=no
779 OPT_CONFIRM_LICENSE=no
780 OPT_SHADOW=maybe
781 OPT_FAST=auto
782 OPT_VERBOSE=no
783 OPT_HELP=
784 CFG_SILENT=no
785 CFG_GRAPHICS_SYSTEM=default
786 CFG_ALSA=auto
787
788 # initalize variables used for installation
789 QT_INSTALL_PREFIX=
790 QT_INSTALL_DOCS=
791 QT_INSTALL_HEADERS=
792 QT_INSTALL_LIBS=
793 QT_INSTALL_BINS=
794 QT_INSTALL_PLUGINS=
795 QT_INSTALL_DATA=
796 QT_INSTALL_TRANSLATIONS=
797 QT_INSTALL_SETTINGS=
798 QT_INSTALL_EXAMPLES=
799 QT_INSTALL_DEMOS=
800 QT_HOST_PREFIX=
801
802 #flags for SQL drivers
803 QT_CFLAGS_PSQL=
804 QT_LFLAGS_PSQL=
805 QT_CFLAGS_MYSQL=
806 QT_LFLAGS_MYSQL=
807 QT_LFLAGS_MYSQL_R=
808 QT_CFLAGS_SQLITE=
809 QT_LFLAGS_SQLITE=
810 QT_LFLAGS_ODBC="-lodbc"
811
812 # flags for libdbus-1
813 QT_CFLAGS_DBUS=
814 QT_LIBS_DBUS=
815
816 # flags for Glib (X11 only)
817 QT_CFLAGS_GLIB=
818 QT_LIBS_GLIB=
819
820 # flags for GStreamer (X11 only)
821 QT_CFLAGS_GSTREAMER=
822 QT_LIBS_GSTREAMER=
823
824 #-------------------------------------------------------------------------------
825 # check SQL drivers, mouse drivers and decorations available in this package
826 #-------------------------------------------------------------------------------
827
828 # opensource version removes some drivers, so force them to be off
829 CFG_SQL_tds=no
830 CFG_SQL_oci=no
831 CFG_SQL_db2=no
832
833 CFG_SQL_AVAILABLE=
834 if [ -d "$relpath/src/plugins/sqldrivers" ]; then
835   for a in "$relpath/src/plugins/sqldrivers/"*; do
836      if [ -d "$a" ]; then
837          base_a=`basename "$a"`
838          CFG_SQL_AVAILABLE="${CFG_SQL_AVAILABLE} ${base_a}"
839          eval "CFG_SQL_${base_a}=auto"
840      fi
841   done
842 fi
843
844 CFG_DECORATION_PLUGIN_AVAILABLE=
845 if [ -d "$relpath/src/plugins/decorations" ]; then
846   for a in "$relpath/src/plugins/decorations/"*; do
847      if [ -d "$a" ]; then
848          base_a=`basename "$a"`
849          CFG_DECORATION_PLUGIN_AVAILABLE="${CFG_DECORATION_PLUGIN_AVAILABLE} ${base_a}"
850      fi
851   done
852 fi
853
854 CFG_KBD_PLUGIN_AVAILABLE=
855 if [ -d "$relpath/src/plugins/kbddrivers" ]; then
856   for a in "$relpath/src/plugins/kbddrivers/"*; do
857      if [ -d "$a" ]; then
858          base_a=`basename "$a"`
859          CFG_KBD_PLUGIN_AVAILABLE="${CFG_KBD_PLUGIN_AVAILABLE} ${base_a}"
860      fi
861   done
862 fi
863
864 CFG_MOUSE_PLUGIN_AVAILABLE=
865 if [ -d "$relpath/src/plugins/mousedrivers" ]; then
866   for a in "$relpath/src/plugins/mousedrivers/"*; do
867      if [ -d "$a" ]; then
868          base_a=`basename "$a"`
869          CFG_MOUSE_PLUGIN_AVAILABLE="${CFG_MOUSE_PLUGIN_AVAILABLE} ${base_a}"
870      fi
871   done
872 fi
873
874 CFG_GFX_PLUGIN_AVAILABLE=
875 if [ -d "$relpath/src/plugins/gfxdrivers" ]; then
876   for a in "$relpath/src/plugins/gfxdrivers/"*; do
877      if [ -d "$a" ]; then
878          base_a=`basename "$a"`
879          CFG_GFX_PLUGIN_AVAILABLE="${CFG_GFX_PLUGIN_AVAILABLE} ${base_a}"
880      fi
881   done
882   CFG_GFX_OFF="$CFG_GFX_AVAILABLE" # assume all off
883 fi
884
885 #-------------------------------------------------------------------------------
886 # parse command line arguments
887 #-------------------------------------------------------------------------------
888
889 # parse the arguments, setting things to "yes" or "no"
890 while [ "$#" -gt 0 ]; do
891     CURRENT_OPT="$1"
892     UNKNOWN_ARG=no
893     case "$1" in
894     #Autoconf style options
895     --enable-*)
896         VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
897         VAL=yes
898         ;;
899     --disable-*)
900         VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
901         VAL=no
902         ;;
903     --*=*)
904         VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
905         VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
906         ;;
907     --no-*)
908         VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
909         VAL=no
910         ;;
911     --*)
912         VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
913         VAL=yes
914         ;;
915     #Qt plugin options
916     -no-*-*|-plugin-*-*|-qt-*-*)
917         VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
918         VAL=`echo $1 | sed "s,^-\([^-]*\).*,\1,"`
919         ;;
920     #Qt style no options
921     -no-*)
922         VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"`
923         VAL=no
924         ;;
925     #Qt style yes options
926         -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config)
927         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
928         VAL=yes
929         ;;
930     #Qt style options that pass an argument
931     -qconfig)
932         if [ "$PLATFORM_QWS" != "yes" ]; then
933             echo
934             echo "WARNING: -qconfig is only tested and supported on Qt for Embedded Linux."
935             echo
936         fi
937         CFG_QCONFIG="$VAL"
938         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
939         shift
940         VAL=$1
941         ;;
942     -prefix|-docdir|-headerdir|-plugindir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config)
943         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
944         shift
945         VAL="$1"
946         ;;
947     #Qt style complex options in one command
948     -enable-*|-disable-*)
949         VAR=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
950         VAL=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
951         ;;
952     #Qt Builtin/System style options
953     -no-*|-system-*|-qt-*)
954         VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
955         VAL=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
956         ;;
957     #Options that cannot be generalized
958     -k|-continue)
959         VAR=fatal_error
960         VAL=no
961         ;;
962     -embedded)
963         VAR=embedded
964         # this option may or may not be followed by an argument
965         if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
966             VAL=auto
967         else
968             shift;
969             VAL=$1
970         fi
971         ;;
972     -opengl)
973         VAR=opengl
974         # this option may or may not be followed by an argument
975         if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
976             VAL=yes
977         else
978             shift;
979             VAL=$1
980         fi
981         ;;
982     -openvg)
983         VAR=openvg
984         # this option may or may not be followed by an argument
985         if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
986             VAL=yes
987         else
988             shift;
989             VAL=$1
990         fi
991         ;;
992     -hostprefix)
993         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
994         # this option may or may not be followed by an argument
995         if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
996             VAL=$outpath
997         else
998             shift;
999             VAL=$1
1000         fi
1001         ;;
1002     -host-*-endian)
1003         VAR=host_endian
1004         VAL=`echo $1 | sed "s,^-.*-\(.*\)-.*,\1,"`
1005         ;;
1006     -*-endian)
1007         VAR=endian
1008         VAL=`echo $1 | sed "s,^-\(.*\)-.*,\1,"`
1009         ;;
1010     -qtnamespace)
1011         VAR="qtnamespace"
1012         shift
1013         VAL="$1"
1014         ;;
1015     -graphicssystem)
1016         VAR="graphicssystem"
1017         shift
1018         VAL=$1
1019         ;;
1020     -qtlibinfix)
1021         VAR="qtlibinfix"
1022         shift
1023         VAL="$1"
1024         ;;
1025     -D?*|-D)
1026         VAR="add_define"
1027         if [ "$1" = "-D" ]; then
1028             shift
1029             VAL="$1"
1030         else
1031             VAL=`echo $1 | sed 's,-D,,'`
1032         fi
1033         ;;
1034     -I?*|-I)
1035         VAR="add_ipath"
1036         if [ "$1" = "-I" ]; then
1037             shift
1038             VAL="$1"
1039         else
1040             VAL=`echo $1 | sed 's,-I,,'`
1041         fi
1042         ;;
1043     -L?*|-L)
1044         VAR="add_lpath"
1045         if [ "$1" = "-L" ]; then
1046             shift
1047             VAL="$1"
1048         else
1049             VAL=`echo $1 | sed 's,-L,,'`
1050         fi
1051         ;;
1052     -R?*|-R)
1053         VAR="add_rpath"
1054         if [ "$1" = "-R" ]; then
1055             shift
1056             VAL="$1"
1057         else
1058             VAL=`echo $1 | sed 's,-R,,'`
1059         fi
1060         ;;
1061     -l?*)
1062         VAR="add_link"
1063         VAL=`echo $1 | sed 's,-l,,'`
1064         ;;
1065     -F?*|-F)
1066         VAR="add_fpath"
1067         if [ "$1" = "-F" ]; then
1068             shift
1069             VAL="$1"
1070         else
1071             VAL=`echo $1 | sed 's,-F,,'`
1072         fi
1073         ;;
1074     -fw?*|-fw)
1075         VAR="add_framework"
1076         if [ "$1" = "-fw" ]; then
1077             shift
1078             VAL="$1"
1079         else
1080             VAL=`echo $1 | sed 's,-fw,,'`
1081         fi
1082         ;;
1083     -*)
1084         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1085         VAL="unknown"
1086         ;;
1087     *)
1088         UNKNOWN_ARG=yes
1089         ;;
1090     esac
1091     if [ "$UNKNOWN_ARG" = "yes" ]; then
1092         echo "$1: unknown argument"
1093         OPT_HELP=yes
1094         ERROR=yes
1095         shift
1096         continue
1097      fi
1098     shift
1099
1100     UNKNOWN_OPT=no
1101     case "$VAR" in
1102     qt3support)
1103         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1104             CFG_QT3SUPPORT="$VAL"
1105         else
1106             UNKNOWN_OPT=yes
1107         fi
1108         ;;
1109     accessibility)
1110         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1111             CFG_ACCESSIBILITY="$VAL"
1112         else
1113             UNKNOWN_OPT=yes
1114         fi
1115         ;;
1116     license)
1117         LICENSE_FILE="$VAL"
1118         ;;
1119     gnumake)
1120         CFG_USE_GNUMAKE="$VAL"
1121         ;;
1122     mysql_config)
1123         CFG_MYSQL_CONFIG="$VAL"
1124         ;;
1125     prefix)
1126         QT_INSTALL_PREFIX="$VAL"
1127         ;;
1128     hostprefix)
1129         QT_HOST_PREFIX="$VAL"
1130         ;;
1131     force-pkg-config)
1132         QT_FORCE_PKGCONFIG=yes
1133         ;;
1134     docdir)
1135         QT_INSTALL_DOCS="$VAL"
1136         ;;
1137     headerdir)
1138         QT_INSTALL_HEADERS="$VAL"
1139         ;;
1140     plugindir)
1141         QT_INSTALL_PLUGINS="$VAL"
1142         ;;
1143     datadir)
1144         QT_INSTALL_DATA="$VAL"
1145         ;;
1146     libdir)
1147         QT_INSTALL_LIBS="$VAL"
1148         ;;
1149     qtnamespace)
1150         QT_NAMESPACE="$VAL"
1151         ;;
1152     qtlibinfix)
1153         QT_LIBINFIX="$VAL"
1154         ;;
1155     translationdir)
1156         QT_INSTALL_TRANSLATIONS="$VAL"
1157         ;;
1158     sysconfdir|settingsdir)
1159         QT_INSTALL_SETTINGS="$VAL"
1160         ;;
1161     examplesdir)
1162         QT_INSTALL_EXAMPLES="$VAL"
1163         ;;
1164     demosdir)
1165         QT_INSTALL_DEMOS="$VAL"
1166         ;;
1167     qconfig)
1168         CFG_QCONFIG="$VAL"
1169         ;;
1170     bindir)
1171         QT_INSTALL_BINS="$VAL"
1172         ;;
1173     buildkey)
1174         CFG_USER_BUILD_KEY="$VAL"
1175         ;;
1176     sxe)
1177         CFG_SXE="$VAL"
1178         ;;
1179     embedded)
1180         CFG_EMBEDDED="$VAL"
1181         if [ "$PLATFORM_QWS" != "no" ]; then
1182             if [ "$PLATFORM_QWS" = "maybe" ]; then
1183                 PLATFORM_X11=no
1184                 PLATFORM_MAC=no
1185                 PLATFORM_QWS=yes
1186             fi
1187         else
1188             echo "No license exists to enable Qt for Embedded Linux. Disabling."
1189             CFG_EMBEDDED=no
1190         fi
1191         ;;
1192     sse)
1193         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1194             CFG_SSE="$VAL"
1195         else
1196             UNKNOWN_OPT=yes
1197         fi
1198         ;;
1199     endian)
1200         if [ "$VAL" = "little" ]; then
1201             CFG_ENDIAN="Q_LITTLE_ENDIAN"
1202         elif [ "$VAL" = "big" ]; then
1203             CFG_ENDIAN="Q_BIG_ENDIAN"
1204         else
1205             UNKNOWN_OPT=yes
1206         fi
1207         ;;
1208     host_endian)
1209         if [ "$VAL" = "little" ]; then
1210             CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
1211         elif [ "$VAL" = "big" ]; then
1212             CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
1213         else
1214             UNKNOWN_OPT=yes
1215         fi
1216         ;;
1217     armfpa)
1218         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1219             CFG_ARMFPA="$VAL"
1220         else
1221             UNKNOWN_OPT=yes
1222         fi
1223         ;;
1224     depths)
1225         CFG_QWS_DEPTHS="$VAL"
1226         ;;
1227     opengl)
1228         if  [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
1229             [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
1230             [ "$VAL" = "es1cl" ] || [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then
1231             CFG_OPENGL="$VAL"
1232         else
1233             UNKNOWN_OPT=yes
1234         fi
1235         ;;
1236     openvg)
1237         if [ "$VAL" = "auto" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1238             CFG_OPENVG="$VAL"
1239         else
1240             UNKNOWN_OPT=yes
1241         fi
1242         ;;
1243     graphicssystem)
1244         if [ "$PLATFORM_QWS" = "yes" ]; then
1245             echo "Error: Graphics System plugins are not supported on QWS."
1246             echo "   On QWS, the graphics system API is part of the QScreen plugin architecture "
1247             echo "   rather than existing as a separate plugin."
1248             echo ""
1249             UNKNOWN_OPT=yes
1250         else
1251             if  [ "$VAL" = "opengl" ]; then
1252                 CFG_GRAPHICS_SYSTEM="opengl"
1253             elif [ "$VAL" = "openvg" ]; then
1254                 CFG_GRAPHICS_SYSTEM="openvg"
1255             elif [ "$VAL" = "raster" ]; then
1256                 CFG_GRAPHICS_SYSTEM="raster"
1257             else
1258                 UNKNOWN_OPT=yes
1259             fi
1260         fi
1261         ;;
1262
1263     qvfb) # left for commandline compatibility, not documented
1264         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1265             if [ "$VAL" = "yes" ]; then
1266                 QMakeVar add gfx-drivers qvfb
1267                 QMakeVar add kbd-drivers qvfb
1268                 QMakeVar add mouse-drivers qvfb
1269                 CFG_GFX_ON="$CFG_GFX_ON qvfb"
1270                 CFG_KBD_ON="$CFG_KBD_ON qvfb"
1271                 CFG_MOUSE_ON="$CFG_MOUSE_ON qvfb"
1272             fi
1273         else
1274             UNKNOWN_OPT=yes
1275         fi
1276         ;;
1277     nomake)
1278         CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL"
1279         ;;
1280     make)
1281         CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL"
1282         ;;
1283     x11)
1284         if [ "$PLATFORM_MAC" = "yes" ]; then
1285             PLATFORM_MAC=no
1286         elif [ "$PLATFORM_QWS" = "yes" ]; then
1287             PLATFORM_QWS=no
1288         fi
1289         if [ "$CFG_FRAMEWORK" = "auto" ]; then
1290             CFG_FRAMEWORK=no
1291         fi
1292         PLATFORM_X11=yes
1293         ;;
1294     sdk)
1295         if [ "$PLATFORM_MAC" = "yes" ]; then
1296             CFG_SDK="$VAL"
1297         else
1298             UNKNOWN_OPT=yes
1299         fi
1300         ;;
1301      dwarf2)
1302         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1303             CFG_MAC_DWARF2="$VAL"
1304         else
1305             UNKNOWN_OPT=yes
1306         fi
1307         ;;
1308     arch)
1309         if [ "$PLATFORM_MAC" = "yes" ]; then
1310             CFG_MAC_ARCHS="$CFG_MAC_ARCHS $VAL"
1311         else
1312             CFG_ARCH=$VAL
1313         fi
1314         ;;
1315     host-arch)
1316         CFG_HOST_ARCH=$VAL
1317         ;;
1318     universal)
1319         if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1320             CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86 ppc"
1321         else
1322             UNKNOWN_OPT=yes
1323         fi
1324         ;;
1325     cocoa)
1326         if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1327             CFG_MAC_COCOA="$VAL"
1328             COMMANDLINE_MAC_COCOA="$VAL"
1329         else
1330             UNKNOWN_OPT=yes
1331         fi
1332         ;;
1333     framework)
1334         if [ "$PLATFORM_MAC" = "yes" ]; then
1335             CFG_FRAMEWORK="$VAL"
1336         else
1337             UNKNOWN_OPT=yes
1338         fi
1339         ;;
1340     profile)
1341         if [ "$VAL" = "yes" ]; then
1342             CFG_PROFILE=yes
1343             QMakeVar add QMAKE_CFLAGS -pg
1344             QMakeVar add QMAKE_CXXFLAGS -pg
1345             QMakeVar add QMAKE_LFLAGS -pg
1346             QMAKE_VARS="$QMAKE_VARS CONFIG+=nostrip"
1347         else
1348             UNKNOWN_OPT=yes
1349         fi
1350         ;;
1351     exceptions|g++-exceptions)
1352         if [ "$VAL" = "no" ]; then
1353             CFG_EXCEPTIONS=no
1354         elif [ "$VAL" = "yes" ]; then
1355             CFG_EXCEPTIONS=yes
1356         else
1357             UNKNOWN_OPT=yes
1358         fi
1359         ;;
1360     platform)
1361         PLATFORM="$VAL"
1362         # keep compatibility with old platform names
1363         case $PLATFORM in
1364         aix-64)
1365             PLATFORM=aix-xlc-64
1366             ;;
1367         hpux-o64)
1368             PLATFORM=hpux-acc-o64
1369             ;;
1370         hpux-n64)
1371             PLATFORM=hpux-acc-64
1372             ;;
1373         hpux-acc-n64)
1374             PLATFORM=hpux-acc-64
1375             ;;
1376         irix-n32)
1377             PLATFORM=irix-cc
1378             ;;
1379         irix-64)
1380             PLATFORM=irix-cc-64
1381             ;;
1382         irix-cc-n64)
1383             PLATFORM=irix-cc-64
1384             ;;
1385         reliant-64)
1386             PLATFORM=reliant-cds-64
1387             ;;
1388         solaris-64)
1389             PLATFORM=solaris-cc-64
1390             ;;
1391         solaris-64)
1392             PLATFORM=solaris-cc-64
1393             ;;
1394         openunix-cc)
1395             PLATFORM=unixware-cc
1396             ;;
1397         openunix-g++)
1398             PLATFORM=unixware-g++
1399             ;;
1400         unixware7-cc)
1401             PLATFORM=unixware-cc
1402             ;;
1403         unixware7-g++)
1404             PLATFORM=unixware-g++
1405             ;;
1406         macx-g++-64)
1407             PLATFORM=macx-g++
1408             NATIVE_64_ARCH=
1409             case `uname -p` in
1410             i386) NATIVE_64_ARCH="x86_64" ;;
1411             powerpc) NATIVE_64_ARCH="ppc64" ;;
1412             *)   echo "WARNING: Can't detect CPU architecture for macx-g++-64" ;;
1413             esac
1414             if [ ! -z "$NATIVE_64_ARCH" ]; then
1415                 QTCONFIG_CONFIG="$QTCONFIG_CONFIG $NATIVE_64_ARCH"
1416                 CFG_MAC_ARCHS="$CFG_MAC_ARCHS $NATIVE_64_ARCH"
1417             fi
1418             ;;
1419         esac
1420         ;;
1421     xplatform)
1422         XPLATFORM="$VAL"
1423         ;;
1424     debug-and-release)
1425         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1426             CFG_DEBUG_RELEASE="$VAL"
1427         else
1428             UNKNOWN_OPT=yes
1429         fi
1430         ;;
1431     optimized-qmake)
1432         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1433             CFG_RELEASE_QMAKE="$VAL"
1434         else
1435             UNKNOWN_OPT=yes
1436         fi
1437         ;;
1438     release)
1439         if [ "$VAL" = "yes" ]; then
1440             CFG_DEBUG=no
1441         elif [ "$VAL" = "no" ]; then
1442             CFG_DEBUG=yes
1443         else
1444             UNKNOWN_OPT=yes
1445         fi
1446         ;;
1447     prefix-install)
1448         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1449             CFG_PREFIX_INSTALL="$VAL"
1450         else
1451             UNKNOWN_OPT=yes
1452         fi
1453         ;;
1454     debug)
1455         CFG_DEBUG="$VAL"
1456         ;;
1457     developer-build|commercial|opensource|nokia-developer)
1458         # These switches have been dealt with already
1459         ;;
1460     static)
1461         if [ "$VAL" = "yes" ]; then
1462             CFG_SHARED=no
1463         elif [ "$VAL" = "no" ]; then
1464             CFG_SHARED=yes
1465         else
1466             UNKNOWN_OPT=yes
1467         fi
1468         ;;
1469     incremental)
1470         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1471             CFG_INCREMENTAL="$VAL"
1472         else
1473             UNKNOWN_OPT=yes
1474         fi
1475         ;;
1476     fatal_error)
1477         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1478             CFG_CONFIGURE_EXIT_ON_ERROR="$VAL"
1479         else
1480             UNKNOWN_OPT=yes
1481         fi
1482         ;;
1483     feature-*)
1484         if [ "$PLATFORM_QWS" = "yes" ]; then
1485             FEATURE=`echo $VAR | sed "s,^[^-]*-\([^-]*\),\1," | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
1486             if [ "$VAL" = "no" ]; then
1487                 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE"
1488             elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then
1489                 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_$FEATURE"
1490             else
1491                 UNKNOWN_OPT=yes
1492             fi
1493         else
1494             UNKNOWN_OPT=yes
1495         fi
1496         ;;
1497     shared)
1498         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1499             CFG_SHARED="$VAL"
1500         else
1501             UNKNOWN_OPT=yes
1502         fi
1503         ;;
1504     gif)
1505         [ "$VAL" = "qt" ] && VAL=yes
1506         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1507             CFG_GIF="$VAL"
1508         else
1509             UNKNOWN_OPT=yes
1510         fi
1511         ;;
1512     sm)
1513         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1514             CFG_SM="$VAL"
1515         else
1516             UNKNOWN_OPT=yes
1517         fi
1518
1519         ;;
1520     xinerama)
1521         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1522             CFG_XINERAMA="$VAL"
1523         else
1524             UNKNOWN_OPT=yes
1525         fi
1526         ;;
1527     xshape)
1528         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1529             CFG_XSHAPE="$VAL"
1530         else
1531             UNKNOWN_OPT=yes
1532         fi
1533         ;;
1534     xsync)
1535         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1536             CFG_XSYNC="$VAL"
1537         else
1538             UNKNOWN_OPT=yes
1539         fi
1540         ;;
1541     xinput)
1542         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1543             CFG_XINPUT="$VAL"
1544         else
1545             UNKNOWN_OPT=yes
1546         fi
1547         ;;
1548     stl)
1549         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1550             CFG_STL="$VAL"
1551         else
1552             UNKNOWN_OPT=yes
1553         fi
1554         ;;
1555     pch)
1556         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1557             CFG_PRECOMPILE="$VAL"
1558         else
1559             UNKNOWN_OPT=yes
1560         fi
1561         ;;
1562     separate-debug-info)
1563         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1564             CFG_SEPARATE_DEBUG_INFO="$VAL"
1565         elif [ "$VAL" = "nocopy" ] ; then
1566             CFG_SEPARATE_DEBUG_INFO="yes"
1567             CFG_SEPARATE_DEBUG_INFO_NOCOPY="yes"
1568         else
1569             UNKNOWN_OPT=yes
1570         fi
1571         ;;
1572     reduce-exports)
1573         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1574             CFG_REDUCE_EXPORTS="$VAL"
1575         else
1576             UNKNOWN_OPT=yes
1577         fi
1578         ;;
1579     mmx)
1580         if [ "$VAL" = "no" ]; then
1581             CFG_MMX="$VAL"
1582         else
1583             UNKNOWN_OPT=yes
1584         fi
1585         ;;
1586     3dnow)
1587         if [ "$VAL" = "no" ]; then
1588             CFG_3DNOW="$VAL"
1589         else
1590             UNKNOWN_OPT=yes
1591         fi
1592         ;;
1593     sse)
1594         if [ "$VAL" = "no" ]; then
1595             CFG_SSE="$VAL"
1596         else
1597             UNKNOWN_OPT=yes
1598         fi
1599         ;;
1600     sse2)
1601         if [ "$VAL" = "no" ]; then
1602             CFG_SSE2="$VAL"
1603         else
1604             UNKNOWN_OPT=yes
1605         fi
1606         ;;
1607     iwmmxt)
1608         CFG_IWMMXT="yes"
1609         ;;
1610     neon)
1611         if [ "$VAL" = "no" ]; then
1612             CFG_NEON="$VAL"
1613         else
1614             UNKNOWN_OPT=yes
1615         fi
1616         ;;
1617     reduce-relocations)
1618         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1619             CFG_REDUCE_RELOCATIONS="$VAL"
1620         else
1621             UNKNOWN_OPT=yes
1622         fi
1623         ;;
1624     freetype)
1625         [ "$VAL" = "qt" ] && VAL=yes
1626         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1627             CFG_QWS_FREETYPE="$VAL"
1628         else
1629             UNKNOWN_OPT=yes
1630         fi
1631         ;;
1632     zlib)
1633         [ "$VAL" = "qt" ] && VAL=yes
1634         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1635             CFG_ZLIB="$VAL"
1636         else
1637             UNKNOWN_OPT=yes
1638         fi
1639         # No longer supported:
1640         #[ "$VAL" = "no" ] && CFG_LIBPNG=no
1641         ;;
1642     sqlite)
1643         if [ "$VAL" = "system" ]; then
1644             CFG_SQLITE=system
1645         else
1646             UNKNOWN_OPT=yes
1647         fi
1648         ;;
1649     libpng)
1650         [ "$VAL" = "yes" ] && VAL=qt
1651         if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1652             CFG_LIBPNG="$VAL"
1653         else
1654             UNKNOWN_OPT=yes
1655         fi
1656         ;;
1657     libjpeg)
1658         [ "$VAL" = "yes" ] && VAL=qt
1659         if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1660             CFG_LIBJPEG="$VAL"
1661         else
1662             UNKNOWN_OPT=yes
1663         fi
1664         ;;
1665     libmng)
1666         [ "$VAL" = "yes" ] && VAL=qt
1667         if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1668             CFG_LIBMNG="$VAL"
1669         else
1670             UNKNOWN_OPT=yes
1671         fi
1672         ;;
1673     libtiff)
1674         [ "$VAL" = "yes" ] && VAL=qt
1675         if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1676             CFG_LIBTIFF="$VAL"
1677         else
1678             UNKNOWN_OPT=yes
1679         fi
1680         ;;
1681     nas-sound)
1682         if [ "$VAL" = "system" ] || [ "$VAL" = "no" ]; then
1683             CFG_NAS="$VAL"
1684         else
1685             UNKNOWN_OPT=yes
1686         fi
1687         ;;
1688     xcursor)
1689         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1690             CFG_XCURSOR="$VAL"
1691         else
1692             UNKNOWN_OPT=yes
1693         fi
1694         ;;
1695     xfixes)
1696         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1697             CFG_XFIXES="$VAL"
1698         else
1699             UNKNOWN_OPT=yes
1700         fi
1701         ;;
1702     xrandr)
1703         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1704             CFG_XRANDR="$VAL"
1705         else
1706             UNKNOWN_OPT=yes
1707         fi
1708         ;;
1709     xrender)
1710         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1711             CFG_XRENDER="$VAL"
1712         else
1713             UNKNOWN_OPT=yes
1714         fi
1715         ;;
1716     mitshm)
1717         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1718             CFG_MITSHM="$VAL"
1719         else
1720             UNKNOWN_OPT=yes
1721         fi
1722         ;;
1723     fontconfig)
1724         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1725             CFG_FONTCONFIG="$VAL"
1726         else
1727             UNKNOWN_OPT=yes
1728         fi
1729         ;;
1730     xkb)
1731         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1732             CFG_XKB="$VAL"
1733         else
1734             UNKNOWN_OPT=yes
1735         fi
1736         ;;
1737     cups)
1738         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1739             CFG_CUPS="$VAL"
1740         else
1741             UNKNOWN_OPT=yes
1742         fi
1743         ;;
1744     iconv)
1745         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1746             CFG_ICONV="$VAL"
1747         else
1748             UNKNOWN_OPT=yes
1749         fi
1750         ;;
1751     glib)
1752         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1753             CFG_GLIB="$VAL"
1754         else
1755             UNKNOWN_OPT=yes
1756         fi
1757         ;;
1758     gstreamer)
1759         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1760             CFG_GSTREAMER="$VAL"
1761         else
1762             UNKNOWN_OPT=yes
1763         fi
1764         ;;
1765     gtkstyle)
1766         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1767             CFG_QGTKSTYLE="$VAL"
1768         else
1769             UNKNOWN_OPT=yes
1770         fi
1771         ;;
1772     qdbus|dbus)
1773         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ]; then
1774             CFG_DBUS="$VAL"
1775         elif [ "$VAL" = "runtime" ]; then
1776             CFG_DBUS="yes"
1777         else
1778             UNKNOWN_OPT=yes
1779         fi
1780         ;;
1781     dbus-linked)
1782         if [ "$VAL" = "yes" ]; then
1783             CFG_DBUS="linked"
1784         else
1785             UNKNOWN_OPT=yes
1786         fi
1787         ;;
1788     nis)
1789         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1790             CFG_NIS="$VAL"
1791         else
1792             UNKNOWN_OPT=yes
1793         fi
1794         ;;
1795     largefile)
1796         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1797             CFG_LARGEFILE="$VAL"
1798         else
1799             UNKNOWN_OPT=yes
1800         fi
1801         ;;
1802     openssl)
1803         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1804             CFG_OPENSSL="$VAL"
1805         else
1806             UNKNOWN_OPT=yes
1807         fi
1808         ;;
1809     openssl-linked)
1810         if [ "$VAL" = "yes" ]; then
1811             CFG_OPENSSL="linked"
1812         else
1813             UNKNOWN_OPT=yes
1814         fi
1815         ;;
1816     ptmalloc)
1817         if [ "$VAL" = "yes" ]; then
1818             CFG_PTMALLOC="yes"
1819         else
1820             UNKNOWN_OPT=yes
1821         fi
1822         ;;
1823
1824     xmlpatterns)
1825         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1826             CFG_XMLPATTERNS="yes"
1827         else
1828             if [ "$VAL" = "no" ]; then
1829                 CFG_XMLPATTERNS="no"
1830             else
1831                 UNKNOWN_OPT=yes
1832             fi
1833         fi
1834         ;;
1835     script)
1836         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1837             CFG_SCRIPT="yes"
1838         else
1839             if [ "$VAL" = "no" ]; then
1840                 CFG_SCRIPT="no"
1841             else
1842                 UNKNOWN_OPT=yes
1843             fi
1844         fi
1845         ;;
1846     scripttools)
1847         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1848             CFG_SCRIPTTOOLS="yes"
1849         else
1850             if [ "$VAL" = "no" ]; then
1851                 CFG_SCRIPTTOOLS="no"
1852             else
1853                 UNKNOWN_OPT=yes
1854             fi
1855         fi
1856         ;;
1857     svg)
1858         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1859             CFG_SVG="yes"
1860         else
1861             if [ "$VAL" = "no" ]; then
1862                 CFG_SVG="no"
1863             else
1864                 UNKNOWN_OPT=yes
1865             fi
1866         fi
1867         ;;
1868     declarative)
1869         if [ "$VAL" = "yes" ]; then
1870             CFG_DECLARATIVE="yes"
1871         else
1872             if [ "$VAL" = "no" ]; then
1873                 CFG_DECLARATIVE="no"
1874             else
1875                 UNKNOWN_OPT=yes
1876             fi
1877         fi
1878         ;;
1879     webkit)
1880         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1881             CFG_WEBKIT="yes"
1882         else
1883             if [ "$VAL" = "no" ]; then
1884                 CFG_WEBKIT="no"
1885             else
1886                 UNKNOWN_OPT=yes
1887             fi
1888         fi
1889         ;;
1890     javascript-jit)
1891         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then 
1892             CFG_JAVASCRIPTCORE_JIT="$VAL"
1893         else
1894             UNKNOWN_OPT=yes
1895         fi
1896         ;;
1897     confirm-license)
1898         if [ "$VAL" = "yes" ]; then
1899             OPT_CONFIRM_LICENSE="$VAL"
1900         else
1901             UNKNOWN_OPT=yes
1902         fi
1903         ;;
1904     h|help)
1905         if [ "$VAL" = "yes" ]; then
1906             OPT_HELP="$VAL"
1907         else
1908             UNKNOWN_OPT=yes
1909         fi
1910         ;;
1911     sql-*|gfx-*|decoration-*|kbd-*|mouse-*)
1912         # if Qt style options were used, $VAL can be "no", "qt", or "plugin"
1913         # if autoconf style options were used, $VAL can be "yes" or "no"
1914         [ "$VAL" = "yes" ] && VAL=qt
1915         # now $VAL should be "no", "qt", or "plugin"... double-check
1916         if [ "$VAL" != "no" ] && [ "$VAL" != "qt" ] && [ "$VAL" != "plugin" ]; then
1917             UNKNOWN_OPT=yes
1918         fi
1919         # now $VAL is "no", "qt", or "plugin"
1920         OPT="$VAL"
1921         VAL=`echo $VAR | sed "s,^[^-]*-\([^-]*\).*,\1,"`
1922         VAR=`echo $VAR | sed "s,^\([^-]*\).*,\1,"`
1923
1924         # Grab the available values
1925         case "$VAR" in
1926         sql)
1927             avail="$CFG_SQL_AVAILABLE"
1928             ;;
1929         gfx)
1930             avail="$CFG_GFX_AVAILABLE"
1931             if [ "$OPT" = "plugin" ]; then
1932                 avail="$CFG_GFX_PLUGIN_AVAILABLE"
1933             fi
1934             ;;
1935         decoration)
1936             avail="$CFG_DECORATION_AVAILABLE"
1937             if [ "$OPT" = "plugin" ]; then
1938                 avail="$CFG_DECORATION_PLUGIN_AVAILABLE"
1939             fi
1940             ;;
1941         kbd)
1942             avail="$CFG_KBD_AVAILABLE"
1943             if [ "$OPT" = "plugin" ]; then
1944                 avail="$CFG_KBD_PLUGIN_AVAILABLE"
1945             fi
1946             ;;
1947         mouse)
1948             avail="$CFG_MOUSE_AVAILABLE"
1949             if [ "$OPT" = "plugin" ]; then
1950                 avail="$CFG_MOUSE_PLUGIN_AVAILABLE"
1951             fi
1952             ;;
1953         *)
1954             avail=""
1955             echo "BUG: Unhandled type $VAR used in $CURRENT_OPT"
1956             ;;
1957         esac
1958
1959         # Check that that user's value is available.
1960         found=no
1961         for d in $avail; do
1962             if [ "$VAL" = "$d" ]; then
1963                 found=yes
1964                 break
1965             fi
1966         done
1967         [ "$found" = yes ] || ERROR=yes
1968
1969         if [ "$VAR" = "sql" ]; then
1970             # set the CFG_SQL_driver
1971             eval "CFG_SQL_$VAL=\$OPT"
1972             continue
1973         fi
1974
1975         if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then
1976             if [ "$OPT" = "plugin" ]; then
1977                 [ "$VAR" = "decoration" ] && QMakeVar del "${VAR}s" "$VAL"
1978                 [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"` && CFG_DECORATION_PLUGIN="$CFG_DECORATION_PLUGIN ${VAL}"
1979                 [ "$VAR" = "kbd" ] && QMakeVar del "${VAR}s" "$VAL"
1980                 [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_KBD_PLUGIN="$CFG_KBD_PLUGIN ${VAL}"
1981                 [ "$VAR" = "mouse" ] && QMakeVar del "${VAR}s" "$VAL"
1982                 [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_MOUSE_PLUGIN="$CFG_MOUSE_PLUGIN ${VAL}"
1983                 [ "$VAR" = "gfx" ] && QMakeVar del "${VAR}s" "$VAL"
1984                 [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"` && CFG_GFX_PLUGIN="${CFG_GFX_PLUGIN} ${VAL}"
1985                 VAR="${VAR}-${OPT}"
1986             else
1987                 if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "decoration" ] || [ "$VAR" = "mouse" ]; then
1988                     [ "$VAR" = "gfx" ] && CFG_GFX_ON="$CFG_GFX_ON $VAL"
1989                     [ "$VAR" = "kbd" ] && CFG_KBD_ON="$CFG_KBD_ON $VAL"
1990                     [ "$VAR" = "decoration" ] && CFG_DECORATION_ON="$CFG_DECORATION_ON $VAL"
1991                     [ "$VAR" = "mouse" ] && CFG_MOUSE_ON="$CFG_MOUSE_ON $VAL"
1992                     VAR="${VAR}-driver"
1993                 fi
1994             fi
1995             QMakeVar add "${VAR}s" "${VAL}"
1996         elif [ "$OPT" = "no" ]; then
1997             PLUG_VAR="${VAR}-plugin"
1998             if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "mouse" ]; then
1999                 IN_VAR="${VAR}-driver"
2000             else
2001                 IN_VAR="${VAR}"
2002             fi
2003             [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"`
2004             [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"`
2005             [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"`
2006             [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"`
2007             QMakeVar del "${IN_VAR}s" "$VAL"
2008             QMakeVar del "${PLUG_VAR}s" "$VAL"
2009         fi
2010         if [ "$ERROR" = "yes" ]; then
2011            echo "$CURRENT_OPT: unknown argument"
2012            OPT_HELP=yes
2013         fi
2014         ;;
2015     v|verbose)
2016         if [ "$VAL" = "yes" ]; then
2017             if [ "$OPT_VERBOSE" = "$VAL" ]; then            # takes two verboses to turn on qmake debugs
2018                 QMAKE_SWITCHES="$QMAKE_SWITCHES -d"
2019             else
2020                 OPT_VERBOSE=yes
2021             fi
2022         elif [ "$VAL" = "no" ]; then
2023             if [ "$OPT_VERBOSE" = "$VAL" ] && echo "$QMAKE_SWITCHES" | grep ' -d' >/dev/null 2>&1; then
2024                 QMAKE_SWITCHES=`echo $QMAKE_SWITCHES | sed "s, -d,,"`
2025             else
2026                 OPT_VERBOSE=no
2027             fi
2028         else
2029             UNKNOWN_OPT=yes
2030         fi
2031         ;;
2032     fast)
2033         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2034             OPT_FAST="$VAL"
2035         else
2036             UNKNOWN_OPT=yes
2037         fi
2038         ;;
2039     rpath)
2040         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2041             CFG_RPATH="$VAL"
2042         else
2043             UNKNOWN_OPT=yes
2044         fi
2045         ;;
2046     add_define)
2047         D_FLAGS="$D_FLAGS \"$VAL\""
2048         ;;
2049     add_ipath)
2050         I_FLAGS="$I_FLAGS -I\"${VAL}\""
2051         ;;
2052     add_lpath)
2053         L_FLAGS="$L_FLAGS -L\"${VAL}\""
2054         ;;
2055     add_rpath)
2056         RPATH_FLAGS="$RPATH_FLAGS \"${VAL}\""
2057         ;;
2058     add_link)
2059         l_FLAGS="$l_FLAGS -l\"${VAL}\""
2060         ;;
2061     add_fpath)
2062         if [ "$PLATFORM_MAC" = "yes" ]; then
2063             L_FLAGS="$L_FLAGS -F\"${VAL}\""
2064             I_FLAGS="$I_FLAGS -F\"${VAL}\""
2065         else
2066             UNKNOWN_OPT=yes
2067         fi
2068         ;;
2069     add_framework)
2070         if [ "$PLATFORM_MAC" = "yes" ]; then
2071             l_FLAGS="$l_FLAGS -framework \"${VAL}\""
2072         else
2073             UNKNOWN_OPT=yes
2074         fi
2075         ;;
2076     silent)
2077         CFG_SILENT="$VAL"
2078         ;;
2079     phonon)
2080         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2081             CFG_PHONON="$VAL"
2082         else
2083             UNKNOWN_OPT=yes
2084         fi
2085         ;;
2086     phonon-backend)
2087         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2088             CFG_PHONON_BACKEND="$VAL"
2089         else
2090             UNKNOWN_OPT=yes
2091         fi
2092         ;;
2093     multimedia)
2094         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2095             CFG_MULTIMEDIA="$VAL"
2096         else
2097             UNKNOWN_OPT=yes
2098         fi
2099         ;;
2100     audio-backend)
2101         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2102             CFG_AUDIO_BACKEND="$VAL"
2103         else
2104             UNKNOWN_OPT=yes
2105         fi
2106         ;;
2107     *)
2108         UNKNOWN_OPT=yes
2109         ;;
2110     esac
2111     if [ "$UNKNOWN_OPT" = "yes" ]; then
2112         echo "${CURRENT_OPT}: invalid command-line switch"
2113         OPT_HELP=yes
2114         ERROR=yes
2115     fi
2116 done
2117
2118 if [ "$CFG_QCONFIG" != "full" ] && [ "$CFG_QT3SUPPORT" = "yes" ]; then
2119     echo "Warning: '-qconfig $CFG_QCONFIG' will disable the qt3support library."
2120     CFG_QT3SUPPORT="no"
2121 fi
2122
2123 # update QT_CONFIG to show our current predefined configuration
2124 case "$CFG_QCONFIG" in
2125 minimal|small|medium|large|full)
2126     # these are a sequence of increasing functionality
2127     for c in minimal small medium large full; do
2128         QT_CONFIG="$QT_CONFIG $c-config"
2129         [ "$CFG_QCONFIG" = $c ] && break
2130     done
2131     ;;
2132 *)
2133     # not known to be sufficient for anything
2134     if [ '!' -f "$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" ]; then
2135         echo >&2 "Error: configuration file not found:"
2136         echo >&2 "  $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h"
2137         OPT_HELP=yes
2138     fi
2139 esac
2140
2141 #-------------------------------------------------------------------------------
2142 # build tree initialization
2143 #-------------------------------------------------------------------------------
2144
2145 # where to find which..
2146 unixtests="$relpath/config.tests/unix"
2147 mactests="$relpath/config.tests/mac"
2148 WHICH="$unixtests/which.test"
2149
2150 PERL=`$WHICH perl 2>/dev/null`
2151
2152 # find out which awk we want to use, prefer gawk, then nawk, then regular awk
2153 AWK=
2154 for e in gawk nawk awk; do
2155     if "$WHICH" $e >/dev/null 2>&1 && ( $e -f /dev/null /dev/null ) >/dev/null 2>&1; then
2156         AWK=$e
2157         break
2158     fi
2159 done
2160
2161 # find perl
2162 PERL="/usr/bin/perl"
2163 if "$WHICH" perl >/dev/null 2>&1 && ( perl /dev/null ) >/dev/null 2>&1; then
2164     PERL=`$WHICH perl`
2165 fi
2166
2167 ### skip this if the user just needs help...
2168 if [ "$OPT_HELP" != "yes" ]; then
2169
2170 # is this a shadow build?
2171 if [ "$OPT_SHADOW" = "maybe" ]; then
2172     OPT_SHADOW=no
2173     if [ "$relpath" != "$outpath" ] && [ '!' -f "$outpath/configure" ]; then
2174         if [ -h "$outpath" ]; then
2175             [ "$relpath" -ef "$outpath" ] || OPT_SHADOW=yes
2176         else
2177             OPT_SHADOW=yes
2178         fi
2179     fi
2180 fi
2181 if [ "$OPT_SHADOW" = "yes" ]; then
2182     if [ -f "$relpath/.qmake.cache" -o -f "$relpath/src/corelib/global/qconfig.h" -o -f "$relpath/src/corelib/global/qconfig.cpp" ]; then
2183         echo >&2 "You cannot make a shadow build from a source tree containing a previous build."
2184         echo >&2 "Cannot proceed."
2185         exit 1
2186     fi
2187     [ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
2188 fi
2189
2190 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2191     echo
2192     echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux"
2193     echo "By default, Qt is built in release mode with separate debug information, so"
2194     echo "-debug-and-release is not necessary anymore"
2195     echo
2196 fi
2197
2198 # detect build style
2199 if [ "$CFG_DEBUG" = "auto" ]; then
2200     if [ "$PLATFORM_MAC" = "yes" ]; then
2201         CFG_DEBUG_RELEASE=yes
2202         CFG_DEBUG=yes
2203     elif [ "$CFG_DEV" = "yes" ]; then
2204         CFG_DEBUG_RELEASE=no
2205         CFG_DEBUG=yes
2206     else
2207         CFG_DEBUG_RELEASE=no
2208         CFG_DEBUG=no
2209     fi
2210 fi
2211 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2212     QMAKE_CONFIG="$QMAKE_CONFIG build_all"
2213 fi
2214
2215 if [ "$CFG_SILENT" = "yes" ]; then
2216     QMAKE_CONFIG="$QMAKE_CONFIG silent"
2217 fi
2218
2219 # if the source tree is different from the build tree,
2220 # symlink or copy part of the sources
2221 if [ "$OPT_SHADOW" = "yes" ]; then
2222     echo "Preparing build tree..."
2223
2224     if [ -z "$PERL" ]; then
2225         echo
2226         echo "You need perl in your PATH to make a shadow build."
2227         echo "Cannot proceed."
2228         exit 1
2229     fi
2230
2231     [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
2232
2233     # symlink the qmake directory
2234     find "$relpath/qmake" | while read a; do
2235         my_a=`echo "$a" | sed "s,^${relpath}/,${outpath}/,"`
2236         if [ '!' -f "$my_a" ]; then
2237             if [ -d "$a" ]; then
2238                 # directories are created...
2239                 mkdir -p "$my_a"
2240             else
2241                 a_dir=`dirname "$my_a"`
2242                 [ -d "$a_dir" ] || mkdir -p "$a_dir"
2243                 # ... and files are symlinked
2244                 case `basename "$a"` in
2245                 *.o|*.d|GNUmakefile*|qmake)
2246                     ;;
2247                 *)
2248                     rm -f "$my_a"
2249                     ln -s "$a" "$my_a"
2250                     ;;
2251                 esac
2252             fi
2253         fi
2254     done
2255
2256     # make a syncqt script that can be used in the shadow
2257     rm -f "$outpath/bin/syncqt"
2258     if [ -x "$relpath/bin/syncqt" ]; then
2259         mkdir -p "$outpath/bin"
2260         echo "#!/bin/sh" >"$outpath/bin/syncqt"
2261         echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/syncqt"
2262         echo "perl \"$relpath/bin/syncqt\" -outdir \"$outpath\" \"\$@\"" >>"$outpath/bin/syncqt"
2263         chmod 755 "$outpath/bin/syncqt"
2264     fi
2265
2266     # symlink the mkspecs directory
2267     mkdir -p "$outpath/mkspecs"
2268     rm -f "$outpath"/mkspecs/*
2269     ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
2270     rm -f "$outpath/mkspecs/default"
2271
2272     # symlink the doc directory
2273     rm -rf "$outpath/doc"
2274     ln -s "$relpath/doc" "$outpath/doc"
2275
2276     # make sure q3porting.xml can be found
2277     mkdir -p "$outpath/tools/porting/src"
2278     rm -f "$outpath/tools/porting/src/q3porting.xml"
2279     ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src"
2280 fi
2281
2282 # symlink fonts to be able to run application from build directory
2283 if [ "$PLATFORM_QWS" = "yes" ] && [ ! -d "${outpath}/lib/fonts" ]; then
2284     if [ "$PLATFORM" = "$XPLATFORM" ]; then
2285         mkdir -p "${outpath}/lib"
2286         ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
2287     fi
2288 fi
2289
2290 if [ "$OPT_FAST" = "auto" ]; then
2291    if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then
2292        OPT_FAST=yes
2293    else
2294        OPT_FAST=no
2295    fi
2296 fi
2297
2298 # find a make command
2299 if [ -z "$MAKE" ]; then
2300     MAKE=
2301     for mk in gmake make; do
2302         if "$WHICH" $mk >/dev/null 2>&1; then
2303             MAKE=`"$WHICH" $mk`
2304             break
2305         fi
2306     done
2307     if [ -z "$MAKE" ]; then
2308         echo >&2 "You don't seem to have 'make' or 'gmake' in your PATH."
2309         echo >&2 "Cannot proceed."
2310         exit 1
2311     fi
2312     # export MAKE, we need it later in the config.tests
2313     export MAKE
2314 fi
2315
2316 fi ### help
2317
2318 #-------------------------------------------------------------------------------
2319 # auto-detect all that hasn't been specified in the arguments
2320 #-------------------------------------------------------------------------------
2321
2322 [ "$PLATFORM_QWS" = "yes" -a "$CFG_EMBEDDED" = "no" ] && CFG_EMBEDDED=auto
2323 if [ "$CFG_EMBEDDED" != "no" ]; then
2324     case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2325     Darwin:*)
2326         [ -z "$PLATFORM" ] && PLATFORM=qws/macx-generic-g++
2327         if [ -z "$XPLATFORM" ]; then
2328             [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2329             XPLATFORM="qws/macx-$CFG_EMBEDDED-g++"
2330         fi
2331         ;;
2332     FreeBSD:*)
2333         [ -z "$PLATFORM" ] && PLATFORM=qws/freebsd-generic-g++
2334         if [ -z "$XPLATFORM" ]; then
2335             [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2336             XPLATFORM="qws/freebsd-$CFG_EMBEDDED-g++"
2337         fi
2338         ;;
2339     SunOS:5*)
2340         [ -z "$PLATFORM" ] && PLATFORM=qws/solaris-generic-g++
2341         if [ -z "$XPLATFORM" ]; then
2342             [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2343             XPLATFORM="qws/solaris-$CFG_EMBEDDED-g++"
2344         fi
2345         ;;
2346     Linux:*)
2347         if [ -z "$PLATFORM" ]; then
2348             case "$UNAME_MACHINE" in
2349             *86)
2350                 PLATFORM=qws/linux-x86-g++
2351                 ;;
2352             *86_64)
2353                 PLATFORM=qws/linux-x86_64-g++
2354                 ;;
2355             *)
2356                 PLATFORM=qws/linux-generic-g++
2357                 ;;
2358             esac
2359         fi
2360         if [ -z "$XPLATFORM" ]; then
2361             if [ "$CFG_EMBEDDED" = "auto" ]; then
2362                 if [ -n "$CFG_ARCH" ]; then
2363                     CFG_EMBEDDED=$CFG_ARCH
2364                 else
2365                     case "$UNAME_MACHINE" in
2366                     *86)
2367                         CFG_EMBEDDED=x86
2368                         ;;
2369                     *86_64)
2370                         CFG_EMBEDDED=x86_64
2371                         ;;
2372                     *)
2373                         CFG_EMBEDDED=generic
2374                         ;;
2375                     esac
2376                 fi
2377             fi
2378             XPLATFORM="qws/linux-$CFG_EMBEDDED-g++"
2379         fi
2380         ;;
2381     QNX:*)
2382         [ -z "$PLATFORM" ] && PLATFORM=unsupported/qws/qnx-generic-g++
2383         if [ -z "$XPLATFORM" ]; then
2384             [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2385             XPLATFORM="unsupported/qws/qnx-$CFG_EMBEDDED-g++"
2386         fi
2387         ;;
2388     CYGWIN*:*)
2389         CFG_EMBEDDED=x86
2390         ;;
2391     *)
2392         echo "Qt for Embedded Linux is not supported on this platform. Disabling."
2393         CFG_EMBEDDED=no
2394         PLATFORM_QWS=no
2395         ;;
2396     esac
2397 fi
2398 if [ -z "$PLATFORM" ]; then
2399     PLATFORM_NOTES=
2400     case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2401      Darwin:*)
2402         if [ "$PLATFORM_MAC" = "yes" ]; then
2403           PLATFORM=macx-g++
2404         # PLATFORM=macx-xcode
2405         else
2406           PLATFORM=darwin-g++
2407         fi
2408         ;;
2409      AIX:*)
2410         #PLATFORM=aix-g++
2411         #PLATFORM=aix-g++-64
2412         PLATFORM=aix-xlc
2413         #PLATFORM=aix-xlc-64
2414         PLATFORM_NOTES="
2415             - Also available for AIX: aix-g++ aix-g++-64 aix-xlc-64
2416         "
2417         ;;
2418      GNU:*)
2419         PLATFORM=hurd-g++
2420         ;;
2421      dgux:*)
2422         PLATFORM=dgux-g++
2423         ;;
2424 #     DYNIX/ptx:4*)
2425 #       PLATFORM=dynix-g++
2426 #       ;;
2427      ULTRIX:*)
2428         PLATFORM=ultrix-g++
2429         ;;
2430      FreeBSD:*)
2431         PLATFORM=freebsd-g++
2432         PLATFORM_NOTES="
2433             - Also available for FreeBSD: freebsd-icc
2434         "
2435         ;;
2436      OpenBSD:*)
2437         PLATFORM=openbsd-g++
2438         ;;
2439      NetBSD:*)
2440         PLATFORM=netbsd-g++
2441         ;;
2442      BSD/OS:*|BSD/386:*)
2443         PLATFORM=bsdi-g++
2444         ;;
2445      IRIX*:*)
2446         #PLATFORM=irix-g++
2447         PLATFORM=irix-cc
2448         #PLATFORM=irix-cc-64
2449         PLATFORM_NOTES="
2450             - Also available for IRIX: irix-g++ irix-cc-64
2451         "
2452         ;;
2453      HP-UX:*)
2454         case "$UNAME_MACHINE" in
2455             ia64)
2456                 #PLATFORM=hpuxi-acc-32
2457                 PLATFORM=hpuxi-acc-64
2458                 PLATFORM_NOTES="
2459                     - Also available for HP-UXi: hpuxi-acc-32
2460                 "
2461             ;;
2462             *)
2463                 #PLATFORM=hpux-g++
2464                 PLATFORM=hpux-acc
2465                 #PLATFORM=hpux-acc-64
2466                 #PLATFORM=hpux-cc
2467                 #PLATFORM=hpux-acc-o64
2468                 PLATFORM_NOTES="
2469                     - Also available for HP-UX: hpux-g++ hpux-acc-64 hpux-acc-o64
2470                 "
2471             ;;
2472         esac
2473         ;;
2474      OSF1:*)
2475         #PLATFORM=tru64-g++
2476         PLATFORM=tru64-cxx
2477         PLATFORM_NOTES="
2478             - Also available for Tru64: tru64-g++
2479         "
2480         ;;
2481      Linux:*)
2482         case "$UNAME_MACHINE" in
2483             x86_64|s390x|ppc64)
2484                 PLATFORM=linux-g++-64
2485                 ;;
2486             *)
2487                 PLATFORM=linux-g++
2488                 ;;
2489         esac
2490         PLATFORM_NOTES="
2491             - Also available for Linux: linux-kcc linux-icc linux-cxx
2492         "
2493         ;;
2494      SunOS:5*)
2495         #PLATFORM=solaris-g++
2496         PLATFORM=solaris-cc
2497         #PLATFORM=solaris-cc64
2498         PLATFORM_NOTES="
2499             - Also available for Solaris: solaris-g++ solaris-cc-64
2500         "
2501         ;;
2502      ReliantUNIX-*:*|SINIX-*:*)
2503         PLATFORM=reliant-cds
2504         #PLATFORM=reliant-cds-64
2505         PLATFORM_NOTES="
2506             - Also available for Reliant UNIX: reliant-cds-64
2507         "
2508         ;;
2509      CYGWIN*:*)
2510         PLATFORM=cygwin-g++
2511         ;;
2512      LynxOS*:*)
2513         PLATFORM=lynxos-g++
2514         ;;
2515      OpenUNIX:*)
2516         #PLATFORM=unixware-g++
2517         PLATFORM=unixware-cc
2518         PLATFORM_NOTES="
2519             - Also available for OpenUNIX: unixware-g++
2520         "
2521         ;;
2522      UnixWare:*)
2523         #PLATFORM=unixware-g++
2524         PLATFORM=unixware-cc
2525         PLATFORM_NOTES="
2526             - Also available for UnixWare: unixware-g++
2527         "
2528         ;;
2529      SCO_SV:*)
2530         #PLATFORM=sco-g++
2531         PLATFORM=sco-cc
2532         PLATFORM_NOTES="
2533             - Also available for SCO OpenServer: sco-g++
2534         "
2535         ;;
2536      UNIX_SV:*)
2537         PLATFORM=unixware-g++
2538         ;;
2539      QNX:*)
2540         PLATFORM=unsupported/qnx-g++
2541         ;;
2542      *)
2543         if [ "$OPT_HELP" != "yes" ]; then
2544             echo
2545             for p in $PLATFORMS; do
2546                 echo "    $relconf $* -platform $p"
2547             done
2548             echo >&2
2549             echo "   The build script does not currently recognize all" >&2
2550             echo "   platforms supported by Qt." >&2
2551             echo "   Rerun this script with a -platform option listed to" >&2
2552             echo "   set the system/compiler combination you use." >&2
2553             echo >&2
2554             exit 2
2555         fi
2556     esac
2557 fi
2558
2559 if [ "$PLATFORM_QWS" = "yes" ]; then
2560     CFG_SM=no
2561     PLATFORMS=`find "$relpath/mkspecs/qws" | sed "s,$relpath/mkspecs/qws/,,"`
2562 else
2563     PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mkspecs/qws/,,"`
2564 fi
2565
2566 [ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
2567 if [ -d "$PLATFORM" ]; then
2568   QMAKESPEC="$PLATFORM"
2569 else
2570   QMAKESPEC="$relpath/mkspecs/${PLATFORM}"
2571 fi
2572 if [ -d "$XPLATFORM" ]; then
2573   XQMAKESPEC="$XPLATFORM"
2574 else
2575   XQMAKESPEC="$relpath/mkspecs/${XPLATFORM}"
2576 fi
2577 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2578     QT_CROSS_COMPILE=yes
2579     QMAKE_CONFIG="$QMAKE_CONFIG cross_compile"
2580 fi
2581
2582 if [ "$PLATFORM_MAC" = "yes" ]; then
2583    if [ `basename $QMAKESPEC` = "macx-xcode" ] || [ `basename $XQMAKESPEC` = "macx-xcode" ]; then
2584       echo >&2
2585       echo "   Platform 'macx-xcode' should not be used when building Qt/Mac." >&2
2586       echo "   Please build Qt/Mac with 'macx-g++', then if you would like to" >&2
2587       echo "   use mac-xcode on your application code it can link to a Qt/Mac" >&2
2588       echo "   built with 'macx-g++'" >&2
2589       echo >&2
2590       exit 2
2591     fi
2592 fi
2593
2594 # check specified platforms are supported
2595 if [ '!' -d "$QMAKESPEC" ]; then
2596     echo
2597     echo "   The specified system/compiler is not supported:"
2598     echo
2599     echo "      $QMAKESPEC"
2600     echo
2601     echo "   Please see the README file for a complete list."
2602     echo
2603     exit 2
2604 fi
2605 if [ '!' -d "$XQMAKESPEC" ]; then
2606     echo
2607     echo "   The specified system/compiler is not supported:"
2608     echo
2609     echo "      $XQMAKESPEC"
2610     echo
2611     echo "   Please see the README file for a complete list."
2612     echo
2613     exit 2
2614 fi
2615 if [ '!' -f "${XQMAKESPEC}/qplatformdefs.h" ]; then
2616     echo
2617     echo "   The specified system/compiler port is not complete:"
2618     echo
2619     echo "      $XQMAKESPEC/qplatformdefs.h"
2620     echo
2621     echo "   Please contact qt-bugs@trolltech.com."
2622     echo
2623     exit 2
2624 fi
2625
2626 # now look at the configs and figure out what platform we are config'd for
2627 [ "$CFG_EMBEDDED" = "no" ] \
2628   && [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ] \
2629   && PLATFORM_X11=yes
2630 ### echo "$XQMAKESPEC" | grep mkspecs/qws >/dev/null 2>&1 && PLATFORM_QWS=yes
2631
2632 if [ "$UNAME_SYSTEM" = "SunOS" ]; then
2633     # Solaris 2.5 and 2.6 have libposix4, which was renamed to librt for Solaris 7 and up
2634     if echo $UNAME_RELEASE | grep "^5\.[5|6]" >/dev/null 2>&1; then
2635         sed -e "s,-lrt,-lposix4," "$XQMAKESPEC/qmake.conf" > "$XQMAKESPEC/qmake.conf.new"
2636         mv "$XQMAKESPEC/qmake.conf.new" "$XQMAKESPEC/qmake.conf"
2637     fi
2638 fi
2639
2640 #-------------------------------------------------------------------------------
2641 # determine the system architecture
2642 #-------------------------------------------------------------------------------
2643 if [ "$OPT_VERBOSE" = "yes" ]; then
2644     echo "Determining system architecture... ($UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE)"
2645 fi
2646
2647 if [ "$CFG_EMBEDDED" != "no" -a "$CFG_EMBEDDED" != "auto" ] && [ -n "$CFG_ARCH" ]; then
2648     if [ "$CFG_ARCH" != "$CFG_EMBEDDED" ]; then
2649         echo ""
2650         echo "You have specified a target architecture with -embedded and -arch."
2651         echo "The two architectures you have specified are different, so we can"
2652         echo "not proceed. Either set both to be the same, or only use -embedded."
2653         echo ""
2654         exit 1
2655     fi
2656 fi
2657
2658 if [ "$CFG_RTOS_ENABLED" = "no" ]; then
2659     case `basename "$XPLATFORM"` in
2660         qnx-* | vxworks-*)
2661             echo ""
2662             echo "You are not licensed for Qt for `basename $XPLATFORM`."
2663             echo ""
2664             echo "Please contact qt-info@nokia.com to upgrade your license to"
2665             echo "include this platform, or install the Qt Open Source Edition"
2666             echo "if you intend to develop free software."
2667             exit 1
2668             ;;
2669     esac
2670 fi
2671
2672 if [ -z "${CFG_HOST_ARCH}" ]; then
2673     case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in
2674     IRIX*:*:*)
2675         CFG_HOST_ARCH=`uname -p`
2676         if [ "$OPT_VERBOSE" = "yes" ]; then
2677             echo "    SGI ($CFG_HOST_ARCH)"
2678         fi
2679         ;;
2680     SunOS:5*:*)
2681         case "$UNAME_MACHINE" in
2682         sun4u*|sun4v*)
2683             if [ "$OPT_VERBOSE" = "yes" ]; then
2684                 echo "    Sun SPARC (sparc)"
2685             fi
2686             CFG_HOST_ARCH=sparc
2687             ;;
2688         i86pc)
2689             case "$PLATFORM" in
2690             *-64)
2691                 if [ "$OPT_VERBOSE" = "yes" ]; then
2692                     echo "    64-bit AMD 80x86 (x86_64)"
2693                 fi
2694                 CFG_HOST_ARCH=x86_64
2695                 ;;
2696             *)
2697                 if [ "$OPT_VERBOSE" = "yes" ]; then
2698                     echo "    32-bit Intel 80x86 (i386)"
2699                 fi
2700                 CFG_HOST_ARCH=i386
2701                 ;;
2702             esac
2703         esac
2704         ;;
2705     Darwin:*:*)
2706         case "$UNAME_MACHINE" in
2707             Power?Macintosh)
2708                 if [ "$OPT_VERBOSE" = "yes" ]; then
2709                     echo "    32-bit Apple PowerPC (powerpc)"
2710                 fi
2711                 ;;
2712             x86)
2713                 if [ "$OPT_VERBOSE" = "yes" ]; then
2714                     echo "    32-bit Intel 80x86 (i386)"
2715                 fi
2716                 ;;
2717         esac
2718         CFG_HOST_ARCH=macosx
2719         ;;
2720     AIX:*:00????????00)
2721         if [ "$OPT_VERBOSE" = "yes" ]; then
2722         echo "    64-bit IBM PowerPC (powerpc)"
2723         fi
2724         CFG_HOST_ARCH=powerpc
2725         ;;
2726     HP-UX:*:9000*)
2727         if [ "$OPT_VERBOSE" = "yes" ]; then
2728             echo "    HP PA-RISC (parisc)"
2729         fi
2730         CFG_HOST_ARCH=parisc
2731         ;;
2732     *:*:i?86)
2733         if [ "$OPT_VERBOSE" = "yes" ]; then
2734             echo "    32-bit Intel 80x86 (i386)"
2735         fi
2736         CFG_HOST_ARCH=i386
2737         ;;
2738     *:*:x86_64|*:*:amd64)
2739         if [ "$PLATFORM" = "linux-g++-32" -o "$PLATFORM" = "linux-icc-32" ]; then
2740             if [ "$OPT_VERBOSE" = "yes" ]; then
2741                 echo "    32 bit on 64-bit AMD 80x86 (i386)"
2742             fi
2743             CFG_HOST_ARCH=i386
2744         else
2745             if [ "$OPT_VERBOSE" = "yes" ]; then
2746                 echo "    64-bit AMD 80x86 (x86_64)"
2747             fi
2748             CFG_HOST_ARCH=x86_64
2749         fi
2750         ;;
2751     *:*:ppc)
2752         if [ "$OPT_VERBOSE" = "yes" ]; then
2753             echo "    32-bit PowerPC (powerpc)"
2754         fi
2755         CFG_HOST_ARCH=powerpc
2756         ;;
2757     *:*:ppc64)
2758         if [ "$OPT_VERBOSE" = "yes" ]; then
2759             echo "    64-bit PowerPC (powerpc)"
2760         fi
2761         CFG_HOST_ARCH=powerpc
2762         ;;
2763     *:*:s390*)
2764         if [ "$OPT_VERBOSE" = "yes" ]; then
2765             echo "    IBM S/390 (s390)"
2766         fi
2767         CFG_HOST_ARCH=s390
2768         ;;
2769     *:*:arm*)
2770         if [ "$OPT_VERBOSE" = "yes" ]; then
2771             echo "    ARM (arm)"
2772         fi
2773         CFG_HOST_ARCH=arm
2774         ;;
2775     Linux:*:sparc*)
2776         if [ "$OPT_VERBOSE" = "yes" ]; then
2777             echo "    Linux on SPARC"
2778         fi
2779         CFG_HOST_ARCH=sparc
2780         ;;
2781     QNX:*:*)
2782         case "$UNAME_MACHINE" in
2783         x86pc)
2784             if [ "$OPT_VERBOSE" = "yes" ]; then
2785                 echo "    QNX on Intel 80x86 (i386)"
2786             fi
2787             CFG_HOST_ARCH=i386
2788             ;;
2789         esac
2790         ;;
2791     *:*:*)
2792         if [ "$OPT_VERBOSE" = "yes" ]; then
2793             echo "    Trying '$UNAME_MACHINE'..."
2794         fi
2795         CFG_HOST_ARCH="$UNAME_MACHINE"
2796         ;;
2797     esac
2798 fi
2799
2800 if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
2801     if [ -n "$CFG_ARCH" ]; then
2802         CFG_EMBEDDED=$CFG_ARCH
2803     fi
2804
2805     case "$CFG_EMBEDDED" in
2806     x86)
2807         CFG_ARCH=i386
2808         ;;
2809     x86_64)
2810         CFG_ARCH=x86_64
2811         ;;
2812     ipaq|sharp)
2813         CFG_ARCH=arm
2814         ;;
2815     dm7000)
2816         CFG_ARCH=powerpc
2817         ;;
2818     dm800)
2819         CFG_ARCH=mips
2820         ;;
2821     sh4al)
2822         CFG_ARCH=sh4a
2823         ;;
2824     *)
2825         CFG_ARCH="$CFG_EMBEDDED"
2826         ;;
2827     esac
2828 elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
2829     CFG_ARCH=$CFG_HOST_ARCH
2830 fi
2831
2832 if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then
2833     if [ "$OPT_VERBOSE" = "yes" ]; then
2834         echo "    '$CFG_ARCH' is supported"
2835     fi
2836 else
2837     if [ "$OPT_VERBOSE" = "yes" ]; then
2838         echo "    '$CFG_ARCH' is unsupported, using 'generic'"
2839     fi
2840     CFG_ARCH=generic
2841 fi
2842 if [ "$CFG_HOST_ARCH" != "$CFG_ARCH" ]; then
2843     if [ -d "$relpath/src/corelib/arch/$CFG_HOST_ARCH" ]; then
2844         if [ "$OPT_VERBOSE" = "yes" ]; then
2845             echo "    '$CFG_HOST_ARCH' is supported"
2846         fi
2847     else
2848         if [ "$OPT_VERBOSE" = "yes" ]; then
2849             echo "    '$CFG_HOST_ARCH' is unsupported, using 'generic'"
2850         fi
2851         CFG_HOST_ARCH=generic
2852     fi
2853 fi
2854
2855 if [ "$OPT_VERBOSE" = "yes" ]; then
2856     echo "System architecture: '$CFG_ARCH'"
2857     if [ "$PLATFORM_QWS" = "yes" ]; then
2858         echo "Host architecture: '$CFG_HOST_ARCH'"
2859     fi
2860 fi
2861
2862 #-------------------------------------------------------------------------------
2863 # tests that don't need qmake (must be run before displaying help)
2864 #-------------------------------------------------------------------------------
2865
2866 if [ -z "$PKG_CONFIG" ]; then
2867     # See if PKG_CONFIG is set in the mkspec:
2868     PKG_CONFIG=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%PKG_CONFIG[^_].*=%%p' | tr '\n' ' '`
2869 fi
2870 if [ -z "$PKG_CONFIG" ]; then
2871     PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
2872 fi
2873
2874 # Work out if we can use pkg-config
2875 if [ "$QT_CROSS_COMPILE" = "yes" ]; then
2876     if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then
2877         echo >&2 ""
2878         echo >&2 "You have asked to use pkg-config and are cross-compiling."
2879         echo >&2 "Please make sure you have a correctly set-up pkg-config"
2880         echo >&2 "environment!"
2881         echo >&2 ""
2882         if [ -z "$PKG_CONFIG_PATH" ]; then
2883             echo >&2 ""
2884             echo >&2 "Warning: PKG_CONFIG_PATH has not been set.  This could mean"
2885             echo >&2 "the host compiler's .pc files will be used. This is probably"
2886             echo >&2 "not what you want."
2887             echo >&2 ""
2888         elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
2889             echo >&2 ""
2890             echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not"
2891             echo >&2 "been set. This means your toolchain's .pc files must contain"
2892             echo >&2 "the paths to the toolchain's libraries & headers. If configure"
2893             echo >&2 "tests are failing, please check these files."
2894             echo >&2 ""
2895         fi
2896     else
2897         echo >&2 ""
2898         echo >&2 "You have not explicitly asked to use pkg-config and are cross-compiling."
2899         echo >&2 "pkg-config will not be used to automatically query cflag/lib parameters for"
2900         echo >&2 "dependencies"
2901         echo >&2 ""
2902         PKG_CONFIG=""
2903     fi
2904 fi
2905
2906 # process CFG_MAC_ARCHS
2907 if [ "$PLATFORM_MAC" = "yes" ]; then
2908 #   check -arch arguments for validity.
2909     ALLOWED="x86 ppc x86_64 ppc64 i386"
2910     # Save the list so we can re-write it using only valid values
2911     CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS"
2912     CFG_MAC_ARCHS=
2913     for i in $CFG_MAC_ARCHS_IN
2914     do 
2915         if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then
2916             echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64";
2917             exit 2;
2918         fi
2919         if [ "$i" = "i386" -o "$i" = "x86" ]; then
2920             # These are synonymous values
2921             # CFG_MAC_ARCHS requires x86 while GCC requires i386
2922             CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86"
2923             MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch i386"
2924         else
2925             CFG_MAC_ARCHS="$CFG_MAC_ARCHS $i"
2926             MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch $i"
2927         fi
2928     done
2929 fi
2930
2931 # pass on $CFG_SDK to the configure tests.
2932 if [ '!' -z "$CFG_SDK" ]; then
2933     MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK"
2934 fi
2935
2936 # find the default framework value
2937 if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
2938     if [ "$CFG_FRAMEWORK" = "auto" ]; then
2939         CFG_FRAMEWORK="$CFG_SHARED"
2940     elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
2941         echo
2942         echo "WARNING: Using static linking will disable the use of Mac frameworks."
2943         echo
2944         CFG_FRAMEWORK="no"
2945     fi
2946 else
2947     CFG_FRAMEWORK=no
2948 fi
2949
2950 QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
2951 TEST_COMPILER="$CC"
2952 [ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
2953 if [ -z "$TEST_COMPILER" ]; then
2954     echo "ERROR: Cannot set the compiler for the configuration tests"
2955     exit 1
2956 fi
2957
2958 # auto-detect precompiled header support
2959 if [ "$CFG_PRECOMPILE" = "auto" ]; then
2960     if [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
2961        CFG_PRECOMPILE=no
2962     elif "$unixtests/precomp.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2963        CFG_PRECOMPILE=no
2964     else
2965        CFG_PRECOMPILE=yes
2966     fi
2967 elif [ "$CFG_PRECOMPILE" = "yes" ] && [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
2968     echo
2969     echo "WARNING: Using universal binaries disables precompiled headers."
2970     echo
2971     CFG_PRECOMPILE=no
2972 fi
2973
2974 #auto-detect DWARF2 on the mac
2975 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "auto" ]; then
2976     if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
2977         CFG_MAC_DWARF2=no
2978     else
2979         CFG_MAC_DWARF2=yes
2980     fi
2981 fi
2982
2983 # auto-detect support for -Xarch on the mac
2984 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" = "auto" ]; then
2985     if "$mactests/xarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
2986         CFG_MAC_XARCH=no
2987     else
2988         CFG_MAC_XARCH=yes
2989     fi
2990 fi
2991
2992 # don't autodetect support for separate debug info on objcopy when
2993 # cross-compiling as lots of toolchains seems to have problems with this
2994 if [ "$QT_CROSS_COMPILE" = "yes" ] && [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
2995     CFG_SEPARATE_DEBUG_INFO="no"
2996 fi
2997
2998 # auto-detect support for separate debug info in objcopy
2999 if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
3000     TEST_COMPILER_CFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CFLAGS[^_].*=%%p' | tr '\n' ' '`
3001     TEST_COMPILER_CXXFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CXXFLAGS[^_].*=%%p' | tr '\n' ' '`
3002     TEST_OBJCOPY=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_OBJCOPY" | sed "s%.* *= *\(.*\)$%\1%" | tail -1`
3003     COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
3004     COMPILER_WITH_FLAGS=`echo "$COMPILER_WITH_FLAGS" | sed -e "s%\\$\\$QMAKE_CFLAGS%$TEST_COMPILER_CFLAGS%g"`
3005     if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$TEST_OBJCOPY" "$OPT_VERBOSE"; then
3006        CFG_SEPARATE_DEBUG_INFO=no
3007     else
3008        case "$PLATFORM" in
3009        hpux-*)
3010            # binutils on HP-UX is buggy; default to no.
3011            CFG_SEPARATE_DEBUG_INFO=no
3012            ;;
3013        *)
3014            CFG_SEPARATE_DEBUG_INFO=yes
3015            ;;
3016        esac
3017     fi
3018 fi
3019
3020 # auto-detect -fvisibility support
3021 if [ "$CFG_REDUCE_EXPORTS" = "auto" ]; then
3022     if "$unixtests/fvisibility.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
3023        CFG_REDUCE_EXPORTS=no
3024     else
3025        CFG_REDUCE_EXPORTS=yes
3026     fi
3027 fi
3028
3029 # detect the availability of the -Bsymbolic-functions linker optimization
3030 if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then
3031     if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
3032         CFG_REDUCE_RELOCATIONS=no
3033     else
3034         CFG_REDUCE_RELOCATIONS=yes
3035     fi
3036 fi
3037
3038 # auto-detect GNU make support
3039 if [ "$CFG_USE_GNUMAKE" = "auto" ] && "$MAKE" -v | grep "GNU Make" >/dev/null 2>&1; then
3040    CFG_USE_GNUMAKE=yes
3041 fi
3042
3043 # If -opengl wasn't specified, don't try to auto-detect
3044 if [ "$PLATFORM_QWS" = "yes" ] && [ "$CFG_OPENGL" = "auto" ]; then
3045         CFG_OPENGL=no
3046 fi
3047
3048 # mac
3049 if [ "$PLATFORM_MAC" = "yes" ]; then
3050     if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
3051         CFG_OPENGL=desktop
3052     fi
3053 fi
3054
3055 # find the default framework value
3056 if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
3057     if [ "$CFG_FRAMEWORK" = "auto" ]; then
3058         CFG_FRAMEWORK="$CFG_SHARED"
3059     elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
3060         echo
3061         echo "WARNING: Using static linking will disable the use of Mac frameworks."
3062         echo
3063         CFG_FRAMEWORK="no"
3064     fi
3065 else
3066     CFG_FRAMEWORK=no
3067 fi
3068
3069 # Print a warning if configure was called with the 10.4u SDK option on Snow Leopard
3070 # with the default mkspec. The 10.4u SDK does not support gcc 4.2.
3071 if [ "$PLATFORM_MAC" = "yes" ] && [ '!' -z "$CFG_SDK" ]; then
3072     # get the darwin version. 10.0.0 and up means snow leopard.
3073     VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'`
3074     if [ "$VERSION" -gt 9 ] && [ "$CFG_SDK" == "/Developer/SDKs/MacOSX10.4u.sdk/" ] && [ "$PLATFORM" == "macx-g++" ]; then
3075         echo
3076         echo "WARNING: The 10.4u SDK does not support gcc 4.2. Configure with -platform macx-g++40. "
3077         echo
3078     fi
3079 fi
3080
3081 # x11 tests are done after qmake is built
3082
3083
3084 #setup the build parts
3085 if [ -z "$CFG_BUILD_PARTS" ]; then
3086     CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
3087
3088     # don't build tools by default when cross-compiling
3089     if [ "$PLATFORM" != "$XPLATFORM" ]; then
3090         CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, tools,,g"`
3091     fi
3092 fi
3093 for nobuild in $CFG_NOBUILD_PARTS; do
3094     CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, $nobuild,,g"`
3095 done
3096 if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then
3097 #    echo
3098 #    echo "WARNING: libs is a required part of the build."
3099 #    echo
3100     CFG_BUILD_PARTS="$CFG_BUILD_PARTS libs"
3101 fi
3102
3103 #-------------------------------------------------------------------------------
3104 # post process QT_INSTALL_* variables
3105 #-------------------------------------------------------------------------------
3106
3107 #prefix
3108 if [ -z "$QT_INSTALL_PREFIX" ]; then
3109     if [ "$CFG_DEV" = "yes" ]; then
3110         QT_INSTALL_PREFIX="$outpath" # In Development, we use sandboxed builds by default
3111     elif [ "$PLATFORM_QWS" = "yes" ]; then
3112         QT_INSTALL_PREFIX="/usr/local/Trolltech/QtEmbedded-${QT_VERSION}"
3113         if [ "$PLATFORM" != "$XPLATFORM" ]; then
3114             QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}"
3115         fi
3116     else
3117         QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION
3118     fi
3119 fi
3120 QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
3121
3122 #docs
3123 if [ -z "$QT_INSTALL_DOCS" ]; then #default
3124     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3125         if [ "$PLATFORM_MAC" = "yes" ]; then
3126             QT_INSTALL_DOCS="/Developer/Documentation/Qt"
3127         fi
3128     fi
3129     [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
3130
3131 fi
3132 QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
3133
3134 #headers
3135 if [ -z "$QT_INSTALL_HEADERS" ]; then #default
3136     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3137         if [ "$PLATFORM_MAC" = "yes" ]; then
3138             if [ "$CFG_FRAMEWORK" = "yes" ]; then
3139                 QT_INSTALL_HEADERS=
3140             fi
3141         fi
3142     fi
3143     [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
3144
3145 fi
3146 QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"`
3147
3148 #libs
3149 if [ -z "$QT_INSTALL_LIBS" ]; then #default
3150     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3151         if [ "$PLATFORM_MAC" = "yes" ]; then
3152             if [ "$CFG_FRAMEWORK" = "yes" ]; then
3153                 QT_INSTALL_LIBS="/Libraries/Frameworks"
3154             fi
3155         fi
3156     fi
3157     [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback
3158 fi
3159 QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
3160
3161 #bins
3162 if [ -z "$QT_INSTALL_BINS" ]; then #default
3163     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3164         if [ "$PLATFORM_MAC" = "yes" ]; then
3165             QT_INSTALL_BINS="/Developer/Applications/Qt"
3166         fi
3167     fi
3168     [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
3169
3170 fi
3171 QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
3172
3173 #plugins
3174 if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
3175     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3176         if [ "$PLATFORM_MAC" = "yes" ]; then
3177             QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins"
3178         fi
3179     fi
3180     [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
3181 fi
3182 QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
3183
3184 #data
3185 if [ -z "$QT_INSTALL_DATA" ]; then #default
3186     QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
3187 fi
3188 QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
3189
3190 #translations
3191 if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
3192     QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
3193 fi
3194 QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
3195
3196 #settings
3197 if [ -z "$QT_INSTALL_SETTINGS" ]; then #default
3198     if [ "$PLATFORM_MAC" = "yes" ]; then
3199         QT_INSTALL_SETTINGS=/Library/Preferences/Qt
3200     else
3201         QT_INSTALL_SETTINGS=/etc/xdg
3202     fi
3203 fi
3204 QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"`
3205
3206 #examples
3207 if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default
3208     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3209         if [ "$PLATFORM_MAC" = "yes" ]; then
3210             QT_INSTALL_EXAMPLES="/Developer/Examples/Qt"
3211         fi
3212     fi
3213     [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback
3214 fi
3215 QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"`
3216
3217 #demos
3218 if [ -z "$QT_INSTALL_DEMOS" ]; then #default
3219     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3220         if [ "$PLATFORM_MAC" = "yes" ]; then
3221             QT_INSTALL_DEMOS="/Developer/Examples/Qt/Demos"
3222         fi
3223     fi
3224     [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos"
3225 fi
3226 QT_INSTALL_DEMOS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DEMOS"`
3227
3228 #-------------------------------------------------------------------------------
3229 # help - interactive parts of the script _after_ this section please
3230 #-------------------------------------------------------------------------------
3231
3232 # next, emit a usage message if something failed.
3233 if [ "$OPT_HELP" = "yes" ]; then
3234     [ "x$ERROR" = "xyes" ] && echo
3235     if [ "$CFG_NIS" = "no" ]; then
3236         NSY=" "
3237         NSN="*"
3238     else
3239         NSY="*"
3240         NSN=" "
3241     fi
3242     if [ "$CFG_CUPS" = "no" ]; then
3243         CUY=" "
3244         CUN="*"
3245     else
3246         CUY="*"
3247         CUN=" "
3248     fi
3249     if [ "$CFG_ICONV" = "no" ]; then
3250         CIY=" "
3251         CIN="*"
3252     else
3253         CIY="*"
3254         CIN=" "
3255     fi
3256     if [ "$CFG_LARGEFILE" = "no" ]; then
3257         LFSY=" "
3258         LFSN="*"
3259     else
3260         LFSY="*"
3261         LFSN=" "
3262     fi
3263     if [ "$CFG_STL" = "auto" ] || [ "$CFG_STL" = "yes" ]; then
3264         SHY="*"
3265         SHN=" "
3266     else
3267         SHY=" "
3268         SHN="*"
3269     fi
3270     if [ "$CFG_IPV6" = "auto" ]; then
3271         I6Y="*"
3272         I6N=" "
3273     fi
3274     if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then
3275         PHY=" "
3276         PHN="*"
3277     else
3278         PHY="*"
3279         PHN=" "
3280     fi
3281
3282     cat <<EOF
3283 Usage:  $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
3284         [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-datadir <dir>]
3285         [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>]
3286         [-demosdir <dir>] [-buildkey <key>] [-release] [-debug]
3287         [-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
3288         [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]
3289         [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>]
3290         [-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support] [-qt3support]
3291         [-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
3292         [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff]
3293         [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng]
3294         [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>]
3295         [-nomake <part>] [-R <string>]  [-l <string>] [-no-rpath]  [-rpath] [-continue]
3296         [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
3297         [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked]
3298         [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]
3299         [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info] [-armfpa]
3300         [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns]
3301         [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend]
3302         [-no-audio-backend] [-audio-backend] [-no-openssl] [-openssl] [-openssl-linked]
3303         [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-javascript-jit] [-javascript-jit]
3304         [-no-script] [-script] [-no-scripttools] [-scripttools] [-no-declarative] [-declarative]
3305
3306         [additional platform specific options (see below)]
3307
3308
3309 Installation options:
3310
3311  These are optional, but you may specify install directories.
3312
3313     -prefix <dir> ...... This will install everything relative to <dir>
3314                          (default $QT_INSTALL_PREFIX)
3315 EOF
3316 if [ "$PLATFORM_QWS" = "yes" ]; then
3317 cat <<EOF
3318
3319     -hostprefix [dir] .. Tools and libraries needed when developing
3320                          applications are installed in [dir]. If [dir] is
3321                          not given, the current build directory will be used.
3322 EOF
3323 fi
3324 cat <<EOF
3325
3326   * -prefix-install .... Force a sandboxed "local" installation of
3327                          Qt. This will install into
3328                          $QT_INSTALL_PREFIX, if this option is
3329                          disabled then some platforms will attempt a
3330                          "system" install by placing default values to
3331                          be placed in a system location other than
3332                          PREFIX.
3333
3334  You may use these to separate different parts of the install:
3335
3336     -bindir <dir> ......... Executables will be installed to <dir>
3337                             (default PREFIX/bin)
3338     -libdir <dir> ......... Libraries will be installed to <dir>
3339                             (default PREFIX/lib)
3340     -docdir <dir> ......... Documentation will be installed to <dir>
3341                             (default PREFIX/doc)
3342     -headerdir <dir> ...... Headers will be installed to <dir>
3343                             (default PREFIX/include)
3344     -plugindir <dir> ...... Plugins will be installed to <dir>
3345                             (default PREFIX/plugins)
3346     -datadir <dir> ........ Data used by Qt programs will be installed to <dir>
3347                             (default PREFIX)
3348     -translationdir <dir> . Translations of Qt programs will be installed to <dir>
3349                             (default PREFIX/translations)
3350     -sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>
3351                             (default PREFIX/etc/settings)
3352     -examplesdir <dir> .... Examples will be installed to <dir>
3353                             (default PREFIX/examples)
3354     -demosdir <dir> ....... Demos will be installed to <dir>
3355                             (default PREFIX/demos)
3356
3357  You may use these options to turn on strict plugin loading.
3358
3359     -buildkey <key> .... Build the Qt library and plugins using the specified
3360                          <key>.  When the library loads plugins, it will only
3361                          load those that have a matching key.
3362
3363 Configure options:
3364
3365  The defaults (*) are usually acceptable. A plus (+) denotes a default value
3366  that needs to be evaluated. If the evaluation succeeds, the feature is
3367  included. Here is a short explanation of each option:
3368
3369  *  -release ........... Compile and link Qt with debugging turned off.
3370     -debug ............. Compile and link Qt with debugging turned on.
3371     -debug-and-release . Compile and link two versions of Qt, with and without
3372                          debugging turned on (Mac only).
3373
3374     -developer-build ... Compile and link Qt with Qt developer options (including auto-tests exporting)
3375
3376     -opensource ........ Compile and link the Open-Source Edition of Qt.
3377     -commercial ........ Compile and link the Commercial Edition of Qt.
3378
3379
3380  *  -shared ............ Create and use shared Qt libraries.
3381     -static ............ Create and use static Qt libraries.
3382
3383  *  -no-fast ........... Configure Qt normally by generating Makefiles for all
3384                          project files.
3385     -fast .............. Configure Qt quickly by generating Makefiles only for
3386                          library and subdirectory targets.  All other Makefiles
3387                          are created as wrappers, which will in turn run qmake.
3388
3389     -no-largefile ...... Disables large file support.
3390  +  -largefile ......... Enables Qt to access files larger than 4 GB.
3391
3392 EOF
3393 if [ "$PLATFORM_QWS" = "yes" ]; then
3394     EXCN="*"
3395     EXCY=" "
3396 else
3397     EXCN=" "
3398     EXCY="*"
3399 fi
3400 if [ "$CFG_DBUS" = "no" ]; then
3401     DBY=" "
3402     DBN="+"
3403 else
3404     DBY="+"
3405     DBN=" "
3406 fi
3407
3408     cat << EOF
3409  $EXCN  -no-exceptions ..... Disable exceptions on compilers that support it.
3410  $EXCY  -exceptions ........ Enable exceptions on compilers that support it.
3411
3412     -no-accessibility .. Do not compile Accessibility support.
3413  *  -accessibility ..... Compile Accessibility support.
3414
3415  $SHN  -no-stl ............ Do not compile STL support.
3416  $SHY  -stl ............... Compile STL support.
3417
3418     -no-sql-<driver> ... Disable SQL <driver> entirely.
3419     -qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default
3420                          none are turned on.
3421     -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to
3422                          at run time.
3423
3424                          Possible values for <driver>:
3425                          [ $CFG_SQL_AVAILABLE ]
3426
3427     -system-sqlite ..... Use sqlite from the operating system.
3428
3429     -no-qt3support ..... Disables the Qt 3 support functionality.
3430  *  -qt3support ........ Enables the Qt 3 support functionality.
3431
3432     -no-xmlpatterns .... Do not build the QtXmlPatterns module.
3433  +  -xmlpatterns ....... Build the QtXmlPatterns module.
3434                          QtXmlPatterns is built if a decent C++ compiler
3435                          is used and exceptions are enabled.
3436
3437     -no-multimedia ..... Do not build the QtMultimedia module.
3438  +  -multimedia ........ Build the QtMultimedia module.
3439
3440     -no-audio-backend .. Do not build the platform audio backend into QtMultimedia.
3441  +  -audio-backend ..... Build the platform audio backend into QtMultimedia if available.
3442
3443     -no-phonon ......... Do not build the Phonon module.
3444  +  -phonon ............ Build the Phonon module.
3445                          Phonon is built if a decent C++ compiler is used.
3446     -no-phonon-backend.. Do not build the platform phonon plugin.
3447  +  -phonon-backend..... Build the platform phonon plugin.
3448
3449     -no-svg ............ Do not build the SVG module.
3450  +  -svg ............... Build the SVG module.
3451
3452     -no-webkit ......... Do not build the WebKit module.
3453  +  -webkit ............ Build the WebKit module.
3454                          WebKit is built if a decent C++ compiler is used.
3455
3456     -no-javascript-jit . Do not build the JavaScriptCore JIT compiler.
3457  +  -javascript-jit .... Build the JavaScriptCore JIT compiler.
3458
3459     -no-script ......... Do not build the QtScript module.
3460  +  -script ............ Build the QtScript module.
3461
3462     -no-scripttools .... Do not build the QtScriptTools module.
3463  +  -scripttools ....... Build the QtScriptTools module.
3464
3465  +  -no-declarative .....Do not build the declarative module.
3466     -declarative ....... Build the declarative module.
3467
3468     -platform target ... The operating system and compiler you are building
3469                          on ($PLATFORM).
3470
3471                          See the README file for a list of supported
3472                          operating systems and compilers.
3473 EOF
3474 if [ "${PLATFORM_QWS}" != "yes" ]; then
3475 cat << EOF
3476     -graphicssystem <sys> Sets an alternate graphics system. Available options are:
3477                            raster - Software rasterizer
3478                            opengl - Rendering via OpenGL, Experimental!
3479 EOF
3480 fi
3481 cat << EOF
3482
3483     -no-mmx ............ Do not compile with use of MMX instructions.
3484     -no-3dnow .......... Do not compile with use of 3DNOW instructions.
3485     -no-sse ............ Do not compile with use of SSE instructions.
3486     -no-sse2 ........... Do not compile with use of SSE2 instructions.
3487
3488     -qtnamespace <name>  Wraps all Qt library code in 'namespace <name> {...}'.
3489     -qtlibinfix <infix>  Renames all libQt*.so to libQt*<infix>.so.
3490
3491     -D <string> ........ Add an explicit define to the preprocessor.
3492     -I <string> ........ Add an explicit include path.
3493     -L <string> ........ Add an explicit library path.
3494
3495     -help, -h .......... Display this information.
3496
3497 Third Party Libraries:
3498
3499     -qt-zlib ........... Use the zlib bundled with Qt.
3500  +  -system-zlib ....... Use zlib from the operating system.
3501                          See http://www.gzip.org/zlib
3502
3503     -no-gif ............ Do not compile the plugin for GIF reading support.
3504  *  -qt-gif ............ Compile the plugin for GIF reading support.
3505                          See also src/plugins/imageformats/gif/qgifhandler.h
3506
3507     -no-libtiff ........ Do not compile the plugin for TIFF support.
3508     -qt-libtiff ........ Use the libtiff bundled with Qt.
3509  +  -system-libtiff .... Use libtiff from the operating system.
3510                          See http://www.libtiff.org
3511
3512     -no-libpng ......... Do not compile in PNG support.
3513     -qt-libpng ......... Use the libpng bundled with Qt.
3514  +  -system-libpng ..... Use libpng from the operating system.
3515                          See http://www.libpng.org/pub/png
3516
3517     -no-libmng ......... Do not compile the plugin for MNG support.
3518     -qt-libmng ......... Use the libmng bundled with Qt.
3519  +  -system-libmng ..... Use libmng from the operating system.
3520                          See http://www.libmng.com
3521
3522     -no-libjpeg ........ Do not compile the plugin for JPEG support.
3523     -qt-libjpeg ........ Use the libjpeg bundled with Qt.
3524  +  -system-libjpeg .... Use libjpeg from the operating system.
3525                          See http://www.ijg.org
3526
3527     -no-openssl ........ Do not compile support for OpenSSL.
3528  +  -openssl ........... Enable run-time OpenSSL support.
3529     -openssl-linked .... Enabled linked OpenSSL support.
3530
3531     -ptmalloc .......... Override the system memory allocator with ptmalloc.
3532                          (Experimental.)
3533
3534 Additional options:
3535
3536     -make <part> ....... Add part to the list of parts to be built at make time.
3537                          ($QT_DEFAULT_BUILD_PARTS)
3538     -nomake <part> ..... Exclude part from the list of parts to be built.
3539
3540     -R <string> ........ Add an explicit runtime library path to the Qt
3541                          libraries.
3542     -l <string> ........ Add an explicit library.
3543
3544     -no-rpath .......... Do not use the library install path as a runtime
3545                          library path.
3546  +  -rpath ............. Link Qt libraries and executables using the library
3547                          install path as a runtime library path. Equivalent
3548                          to -R install_libpath
3549
3550     -continue .......... Continue as far as possible if an error occurs.
3551
3552     -verbose, -v ....... Print verbose information about each step of the
3553                          configure process.
3554
3555     -silent ............ Reduce the build output so that warnings and errors
3556                          can be seen more easily.
3557
3558  *  -no-optimized-qmake ... Do not build qmake optimized.
3559     -optimized-qmake ...... Build qmake optimized.
3560
3561  $NSN  -no-nis ............ Do not compile NIS support.
3562  $NSY  -nis ............... Compile NIS support.
3563
3564  $CUN  -no-cups ........... Do not compile CUPS support.
3565  $CUY  -cups .............. Compile CUPS support.
3566                          Requires cups/cups.h and libcups.so.2.
3567
3568  $CIN  -no-iconv .......... Do not compile support for iconv(3).
3569  $CIY  -iconv ............. Compile support for iconv(3).
3570
3571  $PHN  -no-pch ............ Do not use precompiled header support.
3572  $PHY  -pch ............... Use precompiled header support.
3573
3574  $DBN  -no-dbus ........... Do not compile the QtDBus module.
3575  $DBY  -dbus .............. Compile the QtDBus module and dynamically load libdbus-1.
3576     -dbus-linked ....... Compile the QtDBus module and link to libdbus-1.
3577
3578     -reduce-relocations ..... Reduce relocations in the libraries through extra
3579                               linker optimizations (Qt/X11 and Qt for Embedded Linux only;
3580                               experimental; needs GNU ld >= 2.18).
3581 EOF
3582
3583 if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
3584     if [ "$QT_CROSS_COMPILE" = "yes" ]; then
3585         SBY=""
3586         SBN="*"
3587     else
3588         SBY="*"
3589         SBN=" "
3590     fi
3591 elif [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
3592     SBY="*"
3593     SBN=" "
3594 else
3595     SBY=" "
3596     SBN="*"
3597 fi
3598
3599 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
3600
3601     cat << EOF
3602
3603  $SBN  -no-separate-debug-info . Do not store debug information in a separate file.
3604  $SBY  -separate-debug-info .... Strip debug information into a separate .debug file.
3605
3606 EOF
3607
3608 fi # X11/QWS
3609
3610 if [ "$PLATFORM_X11" = "yes" ]; then
3611     if [ "$CFG_SM" = "no" ]; then
3612         SMY=" "
3613         SMN="*"
3614     else
3615         SMY="*"
3616         SMN=" "
3617     fi
3618     if [ "$CFG_XSHAPE" = "no" ]; then
3619         SHY=" "
3620         SHN="*"
3621     else
3622         SHY="*"
3623         SHN=" "
3624     fi
3625     if [ "$CFG_XINERAMA" = "no" ]; then
3626         XAY=" "
3627         XAN="*"
3628     else
3629         XAY="*"
3630         XAN=" "
3631     fi
3632     if [ "$CFG_FONTCONFIG" = "no" ]; then
3633         FCGY=" "
3634         FCGN="*"
3635     else
3636         FCGY="*"
3637         FCGN=" "
3638     fi
3639     if [ "$CFG_XCURSOR" = "no" ]; then
3640         XCY=" "
3641         XCN="*"
3642     else
3643         XCY="*"
3644         XCN=" "
3645     fi
3646     if [ "$CFG_XFIXES" = "no" ]; then
3647         XFY=" "
3648         XFN="*"
3649     else
3650         XFY="*"
3651         XFN=" "
3652     fi
3653     if [ "$CFG_XRANDR" = "no" ]; then
3654         XZY=" "
3655         XZN="*"
3656     else
3657         XZY="*"
3658         XZN=" "
3659     fi
3660     if [ "$CFG_XRENDER" = "no" ]; then
3661         XRY=" "
3662         XRN="*"
3663     else
3664         XRY="*"
3665         XRN=" "
3666     fi
3667     if [ "$CFG_MITSHM" = "no" ]; then
3668         XMY=" "
3669         XMN="*"
3670     else
3671         XMY="*"
3672         XMN=" "
3673     fi
3674     if [ "$CFG_XINPUT" = "no" ]; then
3675         XIY=" "
3676         XIN="*"
3677     else
3678         XIY="*"
3679         XIN=" "
3680     fi
3681     if [ "$CFG_XKB" = "no" ]; then
3682         XKY=" "
3683         XKN="*"
3684     else
3685         XKY="*"
3686         XKN=" "
3687     fi
3688     if [ "$CFG_IM" = "no" ]; then
3689         IMY=" "
3690         IMN="*"
3691     else
3692         IMY="*"
3693         IMN=" "
3694     fi
3695     cat << EOF
3696
3697 Qt/X11 only:
3698
3699     -no-gtkstyle ....... Do not build the GTK theme integration.
3700  +  -gtkstyle .......... Build the GTK theme integration.
3701
3702  *  -no-nas-sound ...... Do not compile in NAS sound support.
3703     -system-nas-sound .. Use NAS libaudio from the operating system.
3704                          See http://radscan.com/nas.html
3705
3706     -no-opengl ......... Do not support OpenGL.
3707  +  -opengl <api> ...... Enable OpenGL support.
3708                          With no parameter, this will auto-detect the "best"
3709                          OpenGL API to use. If desktop OpenGL is available, it
3710                          will be used. Use desktop, es1, es1cl or es2 for <api>
3711                          to force the use of the Desktop (OpenGL 1.x or 2.x),
3712                          OpenGL ES 1.x Common profile, 1.x Common Lite profile
3713                          or 2.x APIs instead. On X11, the EGL API will be used
3714                          to manage GL contexts in the case of OpenGL ES
3715
3716      -no-openvg ........ Do not support OpenVG.
3717  +   -openvg ........... Enable OpenVG support.
3718                          Requires EGL support, typically supplied by an OpenGL
3719                          or other graphics implementation.
3720
3721  $SMN  -no-sm ............. Do not support X Session Management.
3722  $SMY  -sm ................ Support X Session Management, links in -lSM -lICE.
3723
3724  $SHN  -no-xshape ......... Do not compile XShape support.
3725  $SHY  -xshape ............ Compile XShape support.
3726                          Requires X11/extensions/shape.h.
3727
3728  $SHN  -no-xsync .......... Do not compile XSync support.
3729  $SHY  -xsync ............. Compile XSync support.
3730                          Requires X11/extensions/sync.h.
3731
3732  $XAN  -no-xinerama ....... Do not compile Xinerama (multihead) support.
3733  $XAY  -xinerama .......... Compile Xinerama support.
3734                          Requires X11/extensions/Xinerama.h and libXinerama.
3735                          By default, Xinerama support will be compiled if
3736                          available and the shared libraries are dynamically
3737                          loaded at runtime.
3738
3739  $XCN  -no-xcursor ........ Do not compile Xcursor support.
3740  $XCY  -xcursor ........... Compile Xcursor support.
3741                          Requires X11/Xcursor/Xcursor.h and libXcursor.
3742                          By default, Xcursor support will be compiled if
3743                          available and the shared libraries are dynamically
3744                          loaded at runtime.
3745
3746  $XFN  -no-xfixes ......... Do not compile Xfixes support.
3747  $XFY  -xfixes ............ Compile Xfixes support.
3748                          Requires X11/extensions/Xfixes.h and libXfixes.
3749                          By default, Xfixes support will be compiled if
3750                          available and the shared libraries are dynamically
3751                          loaded at runtime.
3752
3753  $XZN  -no-xrandr ......... Do not compile Xrandr (resize and rotate) support.
3754  $XZY  -xrandr ............ Compile Xrandr support.
3755                          Requires X11/extensions/Xrandr.h and libXrandr.
3756
3757  $XRN  -no-xrender ........ Do not compile Xrender support.
3758 &