Merge branch 'README' into 4.6.3-patched
[qt:kde-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 ## Commercial Usage
12 ## Licensees holding valid Qt Commercial licenses may use this file in
13 ## accordance with the Qt Commercial License Agreement provided with the
14 ## Software or, alternatively, in accordance with the terms contained in
15 ## a written agreement between you and Nokia.
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 ## GNU General Public License Usage
30 ## Alternatively, this file may be used under the terms of the GNU
31 ## General Public License version 3.0 as published by the Free Software
32 ## Foundation and appearing in the file LICENSE.GPL included in the
33 ## packaging of this file.  Please review the following information to
34 ## ensure the GNU General Public License version 3.0 requirements will be
35 ## met: http://www.gnu.org/copyleft/gpl.html.
36 ##
37 ## If you have questions regarding the use of this file, please contact
38 ## Nokia at qt-info@nokia.com.
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     -isystem)
1035         VAR="add_isystempath"
1036         shift
1037         VAL="$1"
1038         ;;
1039     -I?*|-I)
1040         VAR="add_ipath"
1041         if [ "$1" = "-I" ]; then
1042             shift
1043             VAL="$1"
1044         else
1045             VAL=`echo $1 | sed 's,-I,,'`
1046         fi
1047         ;;
1048     -L?*|-L)
1049         VAR="add_lpath"
1050         if [ "$1" = "-L" ]; then
1051             shift
1052             VAL="$1"
1053         else
1054             VAL=`echo $1 | sed 's,-L,,'`
1055         fi
1056         ;;
1057     -R?*|-R)
1058         VAR="add_rpath"
1059         if [ "$1" = "-R" ]; then
1060             shift
1061             VAL="$1"
1062         else
1063             VAL=`echo $1 | sed 's,-R,,'`
1064         fi
1065         ;;
1066     -l?*)
1067         VAR="add_link"
1068         VAL=`echo $1 | sed 's,-l,,'`
1069         ;;
1070     -F?*|-F)
1071         VAR="add_fpath"
1072         if [ "$1" = "-F" ]; then
1073             shift
1074             VAL="$1"
1075         else
1076             VAL=`echo $1 | sed 's,-F,,'`
1077         fi
1078         ;;
1079     -fw?*|-fw)
1080         VAR="add_framework"
1081         if [ "$1" = "-fw" ]; then
1082             shift
1083             VAL="$1"
1084         else
1085             VAL=`echo $1 | sed 's,-fw,,'`
1086         fi
1087         ;;
1088     -*)
1089         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1090         VAL="unknown"
1091         ;;
1092     *)
1093         UNKNOWN_ARG=yes
1094         ;;
1095     esac
1096     if [ "$UNKNOWN_ARG" = "yes" ]; then
1097         echo "$1: unknown argument"
1098         OPT_HELP=yes
1099         ERROR=yes
1100         shift
1101         continue
1102      fi
1103     shift
1104
1105     UNKNOWN_OPT=no
1106     case "$VAR" in
1107     qt3support)
1108         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1109             CFG_QT3SUPPORT="$VAL"
1110         else
1111             UNKNOWN_OPT=yes
1112         fi
1113         ;;
1114     accessibility)
1115         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1116             CFG_ACCESSIBILITY="$VAL"
1117         else
1118             UNKNOWN_OPT=yes
1119         fi
1120         ;;
1121     license)
1122         LICENSE_FILE="$VAL"
1123         ;;
1124     gnumake)
1125         CFG_USE_GNUMAKE="$VAL"
1126         ;;
1127     mysql_config)
1128         CFG_MYSQL_CONFIG="$VAL"
1129         ;;
1130     prefix)
1131         QT_INSTALL_PREFIX="$VAL"
1132         ;;
1133     hostprefix)
1134         QT_HOST_PREFIX="$VAL"
1135         ;;
1136     force-pkg-config)
1137         QT_FORCE_PKGCONFIG=yes
1138         ;;
1139     docdir)
1140         QT_INSTALL_DOCS="$VAL"
1141         ;;
1142     headerdir)
1143         QT_INSTALL_HEADERS="$VAL"
1144         ;;
1145     plugindir)
1146         QT_INSTALL_PLUGINS="$VAL"
1147         ;;
1148     datadir)
1149         QT_INSTALL_DATA="$VAL"
1150         ;;
1151     libdir)
1152         QT_INSTALL_LIBS="$VAL"
1153         ;;
1154     qtnamespace)
1155         QT_NAMESPACE="$VAL"
1156         ;;
1157     qtlibinfix)
1158         QT_LIBINFIX="$VAL"
1159         ;;
1160     translationdir)
1161         QT_INSTALL_TRANSLATIONS="$VAL"
1162         ;;
1163     sysconfdir|settingsdir)
1164         QT_INSTALL_SETTINGS="$VAL"
1165         ;;
1166     examplesdir)
1167         QT_INSTALL_EXAMPLES="$VAL"
1168         ;;
1169     demosdir)
1170         QT_INSTALL_DEMOS="$VAL"
1171         ;;
1172     qconfig)
1173         CFG_QCONFIG="$VAL"
1174         ;;
1175     bindir)
1176         QT_INSTALL_BINS="$VAL"
1177         ;;
1178     buildkey)
1179         CFG_USER_BUILD_KEY="$VAL"
1180         ;;
1181     sxe)
1182         CFG_SXE="$VAL"
1183         ;;
1184     embedded)
1185         CFG_EMBEDDED="$VAL"
1186         if [ "$PLATFORM_QWS" != "no" ]; then
1187             if [ "$PLATFORM_QWS" = "maybe" ]; then
1188                 PLATFORM_X11=no
1189                 PLATFORM_MAC=no
1190                 PLATFORM_QWS=yes
1191             fi
1192         else
1193             echo "No license exists to enable Qt for Embedded Linux. Disabling."
1194             CFG_EMBEDDED=no
1195         fi
1196         ;;
1197     sse)
1198         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1199             CFG_SSE="$VAL"
1200         else
1201             UNKNOWN_OPT=yes
1202         fi
1203         ;;
1204     endian)
1205         if [ "$VAL" = "little" ]; then
1206             CFG_ENDIAN="Q_LITTLE_ENDIAN"
1207         elif [ "$VAL" = "big" ]; then
1208             CFG_ENDIAN="Q_BIG_ENDIAN"
1209         else
1210             UNKNOWN_OPT=yes
1211         fi
1212         ;;
1213     host_endian)
1214         if [ "$VAL" = "little" ]; then
1215             CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
1216         elif [ "$VAL" = "big" ]; then
1217             CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
1218         else
1219             UNKNOWN_OPT=yes
1220         fi
1221         ;;
1222     armfpa)
1223         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1224             CFG_ARMFPA="$VAL"
1225         else
1226             UNKNOWN_OPT=yes
1227         fi
1228         ;;
1229     depths)
1230         CFG_QWS_DEPTHS="$VAL"
1231         ;;
1232     opengl)
1233         if  [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
1234             [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
1235             [ "$VAL" = "es1cl" ] || [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then
1236             CFG_OPENGL="$VAL"
1237         else
1238             UNKNOWN_OPT=yes
1239         fi
1240         ;;
1241     openvg)
1242         if [ "$VAL" = "auto" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1243             CFG_OPENVG="$VAL"
1244         else
1245             UNKNOWN_OPT=yes
1246         fi
1247         ;;
1248     graphicssystem)
1249         if [ "$PLATFORM_QWS" = "yes" ]; then
1250             echo "Error: Graphics System plugins are not supported on QWS."
1251             echo "   On QWS, the graphics system API is part of the QScreen plugin architecture "
1252             echo "   rather than existing as a separate plugin."
1253             echo ""
1254             UNKNOWN_OPT=yes
1255         else
1256             if  [ "$VAL" = "opengl" ]; then
1257                 CFG_GRAPHICS_SYSTEM="opengl"
1258             elif [ "$VAL" = "openvg" ]; then
1259                 CFG_GRAPHICS_SYSTEM="openvg"
1260             elif [ "$VAL" = "raster" ]; then
1261                 CFG_GRAPHICS_SYSTEM="raster"
1262             else
1263                 UNKNOWN_OPT=yes
1264             fi
1265         fi
1266         ;;
1267
1268     qvfb) # left for commandline compatibility, not documented
1269         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1270             if [ "$VAL" = "yes" ]; then
1271                 QMakeVar add gfx-drivers qvfb
1272                 QMakeVar add kbd-drivers qvfb
1273                 QMakeVar add mouse-drivers qvfb
1274                 CFG_GFX_ON="$CFG_GFX_ON qvfb"
1275                 CFG_KBD_ON="$CFG_KBD_ON qvfb"
1276                 CFG_MOUSE_ON="$CFG_MOUSE_ON qvfb"
1277             fi
1278         else
1279             UNKNOWN_OPT=yes
1280         fi
1281         ;;
1282     nomake)
1283         CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL"
1284         ;;
1285     make)
1286         CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL"
1287         ;;
1288     x11)
1289         if [ "$PLATFORM_MAC" = "yes" ]; then
1290             PLATFORM_MAC=no
1291         elif [ "$PLATFORM_QWS" = "yes" ]; then
1292             PLATFORM_QWS=no
1293         fi
1294         if [ "$CFG_FRAMEWORK" = "auto" ]; then
1295             CFG_FRAMEWORK=no
1296         fi
1297         PLATFORM_X11=yes
1298         ;;
1299     sdk)
1300         if [ "$PLATFORM_MAC" = "yes" ]; then
1301             CFG_SDK="$VAL"
1302         else
1303             UNKNOWN_OPT=yes
1304         fi
1305         ;;
1306      dwarf2)
1307         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1308             CFG_MAC_DWARF2="$VAL"
1309         else
1310             UNKNOWN_OPT=yes
1311         fi
1312         ;;
1313     arch)
1314         if [ "$PLATFORM_MAC" = "yes" ]; then
1315             CFG_MAC_ARCHS="$CFG_MAC_ARCHS $VAL"
1316         else
1317             CFG_ARCH=$VAL
1318         fi
1319         ;;
1320     host-arch)
1321         CFG_HOST_ARCH=$VAL
1322         ;;
1323     universal)
1324         if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1325             CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86 ppc"
1326         else
1327             UNKNOWN_OPT=yes
1328         fi
1329         ;;
1330     cocoa)
1331         if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1332             CFG_MAC_COCOA="$VAL"
1333             COMMANDLINE_MAC_COCOA="$VAL"
1334         else
1335             UNKNOWN_OPT=yes
1336         fi
1337         ;;
1338     framework)
1339         if [ "$PLATFORM_MAC" = "yes" ]; then
1340             CFG_FRAMEWORK="$VAL"
1341         else
1342             UNKNOWN_OPT=yes
1343         fi
1344         ;;
1345     profile)
1346         if [ "$VAL" = "yes" ]; then
1347             CFG_PROFILE=yes
1348             QMakeVar add QMAKE_CFLAGS -pg
1349             QMakeVar add QMAKE_CXXFLAGS -pg
1350             QMakeVar add QMAKE_LFLAGS -pg
1351             QMAKE_VARS="$QMAKE_VARS CONFIG+=nostrip"
1352         else
1353             UNKNOWN_OPT=yes
1354         fi
1355         ;;
1356     exceptions|g++-exceptions)
1357         if [ "$VAL" = "no" ]; then
1358             CFG_EXCEPTIONS=no
1359         elif [ "$VAL" = "yes" ]; then
1360             CFG_EXCEPTIONS=yes
1361         else
1362             UNKNOWN_OPT=yes
1363         fi
1364         ;;
1365     platform)
1366         PLATFORM="$VAL"
1367         # keep compatibility with old platform names
1368         case $PLATFORM in
1369         aix-64)
1370             PLATFORM=aix-xlc-64
1371             ;;
1372         hpux-o64)
1373             PLATFORM=hpux-acc-o64
1374             ;;
1375         hpux-n64)
1376             PLATFORM=hpux-acc-64
1377             ;;
1378         hpux-acc-n64)
1379             PLATFORM=hpux-acc-64
1380             ;;
1381         irix-n32)
1382             PLATFORM=irix-cc
1383             ;;
1384         irix-64)
1385             PLATFORM=irix-cc-64
1386             ;;
1387         irix-cc-n64)
1388             PLATFORM=irix-cc-64
1389             ;;
1390         reliant-64)
1391             PLATFORM=reliant-cds-64
1392             ;;
1393         solaris-64)
1394             PLATFORM=solaris-cc-64
1395             ;;
1396         solaris-64)
1397             PLATFORM=solaris-cc-64
1398             ;;
1399         openunix-cc)
1400             PLATFORM=unixware-cc
1401             ;;
1402         openunix-g++)
1403             PLATFORM=unixware-g++
1404             ;;
1405         unixware7-cc)
1406             PLATFORM=unixware-cc
1407             ;;
1408         unixware7-g++)
1409             PLATFORM=unixware-g++
1410             ;;
1411         macx-g++-64)
1412             PLATFORM=macx-g++
1413             NATIVE_64_ARCH=
1414             case `uname -p` in
1415             i386) NATIVE_64_ARCH="x86_64" ;;
1416             powerpc) NATIVE_64_ARCH="ppc64" ;;
1417             *)   echo "WARNING: Can't detect CPU architecture for macx-g++-64" ;;
1418             esac
1419             if [ ! -z "$NATIVE_64_ARCH" ]; then
1420                 QTCONFIG_CONFIG="$QTCONFIG_CONFIG $NATIVE_64_ARCH"
1421                 CFG_MAC_ARCHS="$CFG_MAC_ARCHS $NATIVE_64_ARCH"
1422             fi
1423             ;;
1424         esac
1425         ;;
1426     xplatform)
1427         XPLATFORM="$VAL"
1428         ;;
1429     debug-and-release)
1430         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1431             CFG_DEBUG_RELEASE="$VAL"
1432         else
1433             UNKNOWN_OPT=yes
1434         fi
1435         ;;
1436     optimized-qmake)
1437         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1438             CFG_RELEASE_QMAKE="$VAL"
1439         else
1440             UNKNOWN_OPT=yes
1441         fi
1442         ;;
1443     release)
1444         if [ "$VAL" = "yes" ]; then
1445             CFG_DEBUG=no
1446         elif [ "$VAL" = "no" ]; then
1447             CFG_DEBUG=yes
1448         else
1449             UNKNOWN_OPT=yes
1450         fi
1451         ;;
1452     prefix-install)
1453         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1454             CFG_PREFIX_INSTALL="$VAL"
1455         else
1456             UNKNOWN_OPT=yes
1457         fi
1458         ;;
1459     debug)
1460         CFG_DEBUG="$VAL"
1461         ;;
1462     developer-build|commercial|opensource|nokia-developer)
1463         # These switches have been dealt with already
1464         ;;
1465     static)
1466         if [ "$VAL" = "yes" ]; then
1467             CFG_SHARED=no
1468         elif [ "$VAL" = "no" ]; then
1469             CFG_SHARED=yes
1470         else
1471             UNKNOWN_OPT=yes
1472         fi
1473         ;;
1474     incremental)
1475         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1476             CFG_INCREMENTAL="$VAL"
1477         else
1478             UNKNOWN_OPT=yes
1479         fi
1480         ;;
1481     fatal_error)
1482         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1483             CFG_CONFIGURE_EXIT_ON_ERROR="$VAL"
1484         else
1485             UNKNOWN_OPT=yes
1486         fi
1487         ;;
1488     feature-*)
1489         if [ "$PLATFORM_QWS" = "yes" ]; then
1490             FEATURE=`echo $VAR | sed "s,^[^-]*-\([^-]*\),\1," | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
1491             if [ "$VAL" = "no" ]; then
1492                 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE"
1493             elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then
1494                 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_$FEATURE"
1495             else
1496                 UNKNOWN_OPT=yes
1497             fi
1498         else
1499             UNKNOWN_OPT=yes
1500         fi
1501         ;;
1502     shared)
1503         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1504             CFG_SHARED="$VAL"
1505         else
1506             UNKNOWN_OPT=yes
1507         fi
1508         ;;
1509     gif)
1510         [ "$VAL" = "qt" ] && VAL=yes
1511         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1512             CFG_GIF="$VAL"
1513         else
1514             UNKNOWN_OPT=yes
1515         fi
1516         ;;
1517     sm)
1518         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1519             CFG_SM="$VAL"
1520         else
1521             UNKNOWN_OPT=yes
1522         fi
1523
1524         ;;
1525     xinerama)
1526         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1527             CFG_XINERAMA="$VAL"
1528         else
1529             UNKNOWN_OPT=yes
1530         fi
1531         ;;
1532     xshape)
1533         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1534             CFG_XSHAPE="$VAL"
1535         else
1536             UNKNOWN_OPT=yes
1537         fi
1538         ;;
1539     xsync)
1540         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1541             CFG_XSYNC="$VAL"
1542         else
1543             UNKNOWN_OPT=yes
1544         fi
1545         ;;
1546     xinput)
1547         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1548             CFG_XINPUT="$VAL"
1549         else
1550             UNKNOWN_OPT=yes
1551         fi
1552         ;;
1553     stl)
1554         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1555             CFG_STL="$VAL"
1556         else
1557             UNKNOWN_OPT=yes
1558         fi
1559         ;;
1560     pch)
1561         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1562             CFG_PRECOMPILE="$VAL"
1563         else
1564             UNKNOWN_OPT=yes
1565         fi
1566         ;;
1567     separate-debug-info)
1568         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1569             CFG_SEPARATE_DEBUG_INFO="$VAL"
1570         elif [ "$VAL" = "nocopy" ] ; then
1571             CFG_SEPARATE_DEBUG_INFO="yes"
1572             CFG_SEPARATE_DEBUG_INFO_NOCOPY="yes"
1573         else
1574             UNKNOWN_OPT=yes
1575         fi
1576         ;;
1577     reduce-exports)
1578         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1579             CFG_REDUCE_EXPORTS="$VAL"
1580         else
1581             UNKNOWN_OPT=yes
1582         fi
1583         ;;
1584     mmx)
1585         if [ "$VAL" = "no" ]; then
1586             CFG_MMX="$VAL"
1587         else
1588             UNKNOWN_OPT=yes
1589         fi
1590         ;;
1591     3dnow)
1592         if [ "$VAL" = "no" ]; then
1593             CFG_3DNOW="$VAL"
1594         else
1595             UNKNOWN_OPT=yes
1596         fi
1597         ;;
1598     sse)
1599         if [ "$VAL" = "no" ]; then
1600             CFG_SSE="$VAL"
1601         else
1602             UNKNOWN_OPT=yes
1603         fi
1604         ;;
1605     sse2)
1606         if [ "$VAL" = "no" ]; then
1607             CFG_SSE2="$VAL"
1608         else
1609             UNKNOWN_OPT=yes
1610         fi
1611         ;;
1612     iwmmxt)
1613         CFG_IWMMXT="yes"
1614         ;;
1615     neon)
1616         if [ "$VAL" = "no" ]; then
1617             CFG_NEON="$VAL"
1618         else
1619             UNKNOWN_OPT=yes
1620         fi
1621         ;;
1622     reduce-relocations)
1623         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1624             CFG_REDUCE_RELOCATIONS="$VAL"
1625         else
1626             UNKNOWN_OPT=yes
1627         fi
1628         ;;
1629     freetype)
1630         [ "$VAL" = "qt" ] && VAL=yes
1631         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1632             CFG_QWS_FREETYPE="$VAL"
1633         else
1634             UNKNOWN_OPT=yes
1635         fi
1636         ;;
1637     zlib)
1638         [ "$VAL" = "qt" ] && VAL=yes
1639         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1640             CFG_ZLIB="$VAL"
1641         else
1642             UNKNOWN_OPT=yes
1643         fi
1644         # No longer supported:
1645         #[ "$VAL" = "no" ] && CFG_LIBPNG=no
1646         ;;
1647     sqlite)
1648         if [ "$VAL" = "system" ]; then
1649             CFG_SQLITE=system
1650         else
1651             UNKNOWN_OPT=yes
1652         fi
1653         ;;
1654     libpng)
1655         [ "$VAL" = "yes" ] && VAL=qt
1656         if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1657             CFG_LIBPNG="$VAL"
1658         else
1659             UNKNOWN_OPT=yes
1660         fi
1661         ;;
1662     libjpeg)
1663         [ "$VAL" = "yes" ] && VAL=qt
1664         if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1665             CFG_LIBJPEG="$VAL"
1666         else
1667             UNKNOWN_OPT=yes
1668         fi
1669         ;;
1670     libmng)
1671         [ "$VAL" = "yes" ] && VAL=qt
1672         if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1673             CFG_LIBMNG="$VAL"
1674         else
1675             UNKNOWN_OPT=yes
1676         fi
1677         ;;
1678     libtiff)
1679         [ "$VAL" = "yes" ] && VAL=qt
1680         if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1681             CFG_LIBTIFF="$VAL"
1682         else
1683             UNKNOWN_OPT=yes
1684         fi
1685         ;;
1686     nas-sound)
1687         if [ "$VAL" = "system" ] || [ "$VAL" = "no" ]; then
1688             CFG_NAS="$VAL"
1689         else
1690             UNKNOWN_OPT=yes
1691         fi
1692         ;;
1693     xcursor)
1694         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1695             CFG_XCURSOR="$VAL"
1696         else
1697             UNKNOWN_OPT=yes
1698         fi
1699         ;;
1700     xfixes)
1701         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1702             CFG_XFIXES="$VAL"
1703         else
1704             UNKNOWN_OPT=yes
1705         fi
1706         ;;
1707     xrandr)
1708         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1709             CFG_XRANDR="$VAL"
1710         else
1711             UNKNOWN_OPT=yes
1712         fi
1713         ;;
1714     xrender)
1715         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1716             CFG_XRENDER="$VAL"
1717         else
1718             UNKNOWN_OPT=yes
1719         fi
1720         ;;
1721     mitshm)
1722         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1723             CFG_MITSHM="$VAL"
1724         else
1725             UNKNOWN_OPT=yes
1726         fi
1727         ;;
1728     fontconfig)
1729         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1730             CFG_FONTCONFIG="$VAL"
1731         else
1732             UNKNOWN_OPT=yes
1733         fi
1734         ;;
1735     xkb)
1736         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1737             CFG_XKB="$VAL"
1738         else
1739             UNKNOWN_OPT=yes
1740         fi
1741         ;;
1742     cups)
1743         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1744             CFG_CUPS="$VAL"
1745         else
1746             UNKNOWN_OPT=yes
1747         fi
1748         ;;
1749     iconv)
1750         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1751             CFG_ICONV="$VAL"
1752         else
1753             UNKNOWN_OPT=yes
1754         fi
1755         ;;
1756     glib)
1757         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1758             CFG_GLIB="$VAL"
1759         else
1760             UNKNOWN_OPT=yes
1761         fi
1762         ;;
1763     gstreamer)
1764         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1765             CFG_GSTREAMER="$VAL"
1766         else
1767             UNKNOWN_OPT=yes
1768         fi
1769         ;;
1770     gtkstyle)
1771         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1772             CFG_QGTKSTYLE="$VAL"
1773         else
1774             UNKNOWN_OPT=yes
1775         fi
1776         ;;
1777     qdbus|dbus)
1778         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ]; then
1779             CFG_DBUS="$VAL"
1780         elif [ "$VAL" = "runtime" ]; then
1781             CFG_DBUS="yes"
1782         else
1783             UNKNOWN_OPT=yes
1784         fi
1785         ;;
1786     dbus-linked)
1787         if [ "$VAL" = "yes" ]; then
1788             CFG_DBUS="linked"
1789         else
1790             UNKNOWN_OPT=yes
1791         fi
1792         ;;
1793     nis)
1794         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1795             CFG_NIS="$VAL"
1796         else
1797             UNKNOWN_OPT=yes
1798         fi
1799         ;;
1800     largefile)
1801         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1802             CFG_LARGEFILE="$VAL"
1803         else
1804             UNKNOWN_OPT=yes
1805         fi
1806         ;;
1807     openssl)
1808         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1809             CFG_OPENSSL="$VAL"
1810         else
1811             UNKNOWN_OPT=yes
1812         fi
1813         ;;
1814     openssl-linked)
1815         if [ "$VAL" = "yes" ]; then
1816             CFG_OPENSSL="linked"
1817         else
1818             UNKNOWN_OPT=yes
1819         fi
1820         ;;
1821     ptmalloc)
1822         if [ "$VAL" = "yes" ]; then
1823             CFG_PTMALLOC="yes"
1824         else
1825             UNKNOWN_OPT=yes
1826         fi
1827         ;;
1828
1829     xmlpatterns)
1830         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1831             CFG_XMLPATTERNS="yes"
1832         else
1833             if [ "$VAL" = "no" ]; then
1834                 CFG_XMLPATTERNS="no"
1835             else
1836                 UNKNOWN_OPT=yes
1837             fi
1838         fi
1839         ;;
1840     script)
1841         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1842             CFG_SCRIPT="yes"
1843         else
1844             if [ "$VAL" = "no" ]; then
1845                 CFG_SCRIPT="no"
1846             else
1847                 UNKNOWN_OPT=yes
1848             fi
1849         fi
1850         ;;
1851     scripttools)
1852         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1853             CFG_SCRIPTTOOLS="yes"
1854         else
1855             if [ "$VAL" = "no" ]; then
1856                 CFG_SCRIPTTOOLS="no"
1857             else
1858                 UNKNOWN_OPT=yes
1859             fi
1860         fi
1861         ;;
1862     svg)
1863         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1864             CFG_SVG="yes"
1865         else
1866             if [ "$VAL" = "no" ]; then
1867                 CFG_SVG="no"
1868             else
1869                 UNKNOWN_OPT=yes
1870             fi
1871         fi
1872         ;;
1873     declarative)
1874         if [ "$VAL" = "yes" ]; then
1875             CFG_DECLARATIVE="yes"
1876         else
1877             if [ "$VAL" = "no" ]; then
1878                 CFG_DECLARATIVE="no"
1879             else
1880                 UNKNOWN_OPT=yes
1881             fi
1882         fi
1883         ;;
1884     webkit)
1885         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1886             CFG_WEBKIT="yes"
1887         else
1888             if [ "$VAL" = "no" ]; then
1889                 CFG_WEBKIT="no"
1890             else
1891                 UNKNOWN_OPT=yes
1892             fi
1893         fi
1894         ;;
1895     javascript-jit)
1896         if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then 
1897             CFG_JAVASCRIPTCORE_JIT="$VAL"
1898         else
1899             UNKNOWN_OPT=yes
1900         fi
1901         ;;
1902     confirm-license)
1903         if [ "$VAL" = "yes" ]; then
1904             OPT_CONFIRM_LICENSE="$VAL"
1905         else
1906             UNKNOWN_OPT=yes
1907         fi
1908         ;;
1909     h|help)
1910         if [ "$VAL" = "yes" ]; then
1911             OPT_HELP="$VAL"
1912         else
1913             UNKNOWN_OPT=yes
1914         fi
1915         ;;
1916     sql-*|gfx-*|decoration-*|kbd-*|mouse-*)
1917         # if Qt style options were used, $VAL can be "no", "qt", or "plugin"
1918         # if autoconf style options were used, $VAL can be "yes" or "no"
1919         [ "$VAL" = "yes" ] && VAL=qt
1920         # now $VAL should be "no", "qt", or "plugin"... double-check
1921         if [ "$VAL" != "no" ] && [ "$VAL" != "qt" ] && [ "$VAL" != "plugin" ]; then
1922             UNKNOWN_OPT=yes
1923         fi
1924         # now $VAL is "no", "qt", or "plugin"
1925         OPT="$VAL"
1926         VAL=`echo $VAR | sed "s,^[^-]*-\([^-]*\).*,\1,"`
1927         VAR=`echo $VAR | sed "s,^\([^-]*\).*,\1,"`
1928
1929         # Grab the available values
1930         case "$VAR" in
1931         sql)
1932             avail="$CFG_SQL_AVAILABLE"
1933             ;;
1934         gfx)
1935             avail="$CFG_GFX_AVAILABLE"
1936             if [ "$OPT" = "plugin" ]; then
1937                 avail="$CFG_GFX_PLUGIN_AVAILABLE"
1938             fi
1939             ;;
1940         decoration)
1941             avail="$CFG_DECORATION_AVAILABLE"
1942             if [ "$OPT" = "plugin" ]; then
1943                 avail="$CFG_DECORATION_PLUGIN_AVAILABLE"
1944             fi
1945             ;;
1946         kbd)
1947             avail="$CFG_KBD_AVAILABLE"
1948             if [ "$OPT" = "plugin" ]; then
1949                 avail="$CFG_KBD_PLUGIN_AVAILABLE"
1950             fi
1951             ;;
1952         mouse)
1953             avail="$CFG_MOUSE_AVAILABLE"
1954             if [ "$OPT" = "plugin" ]; then
1955                 avail="$CFG_MOUSE_PLUGIN_AVAILABLE"
1956             fi
1957             ;;
1958         *)
1959             avail=""
1960             echo "BUG: Unhandled type $VAR used in $CURRENT_OPT"
1961             ;;
1962         esac
1963
1964         # Check that that user's value is available.
1965         found=no
1966         for d in $avail; do
1967             if [ "$VAL" = "$d" ]; then
1968                 found=yes
1969                 break
1970             fi
1971         done
1972         [ "$found" = yes ] || ERROR=yes
1973
1974         if [ "$VAR" = "sql" ]; then
1975             # set the CFG_SQL_driver
1976             eval "CFG_SQL_$VAL=\$OPT"
1977             continue
1978         fi
1979
1980         if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then
1981             if [ "$OPT" = "plugin" ]; then
1982                 [ "$VAR" = "decoration" ] && QMakeVar del "${VAR}s" "$VAL"
1983                 [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"` && CFG_DECORATION_PLUGIN="$CFG_DECORATION_PLUGIN ${VAL}"
1984                 [ "$VAR" = "kbd" ] && QMakeVar del "${VAR}s" "$VAL"
1985                 [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_KBD_PLUGIN="$CFG_KBD_PLUGIN ${VAL}"
1986                 [ "$VAR" = "mouse" ] && QMakeVar del "${VAR}s" "$VAL"
1987                 [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_MOUSE_PLUGIN="$CFG_MOUSE_PLUGIN ${VAL}"
1988                 [ "$VAR" = "gfx" ] && QMakeVar del "${VAR}s" "$VAL"
1989                 [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"` && CFG_GFX_PLUGIN="${CFG_GFX_PLUGIN} ${VAL}"
1990                 VAR="${VAR}-${OPT}"
1991             else
1992                 if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "decoration" ] || [ "$VAR" = "mouse" ]; then
1993                     [ "$VAR" = "gfx" ] && CFG_GFX_ON="$CFG_GFX_ON $VAL"
1994                     [ "$VAR" = "kbd" ] && CFG_KBD_ON="$CFG_KBD_ON $VAL"
1995                     [ "$VAR" = "decoration" ] && CFG_DECORATION_ON="$CFG_DECORATION_ON $VAL"
1996                     [ "$VAR" = "mouse" ] && CFG_MOUSE_ON="$CFG_MOUSE_ON $VAL"
1997                     VAR="${VAR}-driver"
1998                 fi
1999             fi
2000             QMakeVar add "${VAR}s" "${VAL}"
2001         elif [ "$OPT" = "no" ]; then
2002             PLUG_VAR="${VAR}-plugin"
2003             if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "mouse" ]; then
2004                 IN_VAR="${VAR}-driver"
2005             else
2006                 IN_VAR="${VAR}"
2007             fi
2008             [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"`
2009             [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"`
2010             [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"`
2011             [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"`
2012             QMakeVar del "${IN_VAR}s" "$VAL"
2013             QMakeVar del "${PLUG_VAR}s" "$VAL"
2014         fi
2015         if [ "$ERROR" = "yes" ]; then
2016            echo "$CURRENT_OPT: unknown argument"
2017            OPT_HELP=yes
2018         fi
2019         ;;
2020     v|verbose)
2021         if [ "$VAL" = "yes" ]; then
2022             if [ "$OPT_VERBOSE" = "$VAL" ]; then            # takes two verboses to turn on qmake debugs
2023                 QMAKE_SWITCHES="$QMAKE_SWITCHES -d"
2024             else
2025                 OPT_VERBOSE=yes
2026             fi
2027         elif [ "$VAL" = "no" ]; then
2028             if [ "$OPT_VERBOSE" = "$VAL" ] && echo "$QMAKE_SWITCHES" | grep ' -d' >/dev/null 2>&1; then
2029                 QMAKE_SWITCHES=`echo $QMAKE_SWITCHES | sed "s, -d,,"`
2030             else
2031                 OPT_VERBOSE=no
2032             fi
2033         else
2034             UNKNOWN_OPT=yes
2035         fi
2036         ;;
2037     fast)
2038         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2039             OPT_FAST="$VAL"
2040         else
2041             UNKNOWN_OPT=yes
2042         fi
2043         ;;
2044     rpath)
2045         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2046             CFG_RPATH="$VAL"
2047         else
2048             UNKNOWN_OPT=yes
2049         fi
2050         ;;
2051     add_define)
2052         D_FLAGS="$D_FLAGS \"$VAL\""
2053         ;;
2054     add_ipath)
2055         I_FLAGS="$I_FLAGS -I\"${VAL}\""
2056         ;;
2057     add_isystempath)
2058         I_FLAGS="$I_FLAGS -isystem \"${VAL}\""
2059         ;;
2060     add_lpath)
2061         L_FLAGS="$L_FLAGS -L\"${VAL}\""
2062         ;;
2063     add_rpath)
2064         RPATH_FLAGS="$RPATH_FLAGS \"${VAL}\""
2065         ;;
2066     add_link)
2067         l_FLAGS="$l_FLAGS -l\"${VAL}\""
2068         ;;
2069     add_fpath)
2070         if [ "$PLATFORM_MAC" = "yes" ]; then
2071             L_FLAGS="$L_FLAGS -F\"${VAL}\""
2072             I_FLAGS="$I_FLAGS -F\"${VAL}\""
2073         else
2074             UNKNOWN_OPT=yes
2075         fi
2076         ;;
2077     add_framework)
2078         if [ "$PLATFORM_MAC" = "yes" ]; then
2079             l_FLAGS="$l_FLAGS -framework \"${VAL}\""
2080         else
2081             UNKNOWN_OPT=yes
2082         fi
2083         ;;
2084     silent)
2085         CFG_SILENT="$VAL"
2086         ;;
2087     phonon)
2088         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2089             CFG_PHONON="$VAL"
2090         else
2091             UNKNOWN_OPT=yes
2092         fi
2093         ;;
2094     phonon-backend)
2095         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2096             CFG_PHONON_BACKEND="$VAL"
2097         else
2098             UNKNOWN_OPT=yes
2099         fi
2100         ;;
2101     multimedia)
2102         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2103             CFG_MULTIMEDIA="$VAL"
2104         else
2105             UNKNOWN_OPT=yes
2106         fi
2107         ;;
2108     audio-backend)
2109         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
2110             CFG_AUDIO_BACKEND="$VAL"
2111         else
2112             UNKNOWN_OPT=yes
2113         fi
2114         ;;
2115     *)
2116         UNKNOWN_OPT=yes
2117         ;;
2118     esac
2119     if [ "$UNKNOWN_OPT" = "yes" ]; then
2120         echo "${CURRENT_OPT}: invalid command-line switch"
2121         OPT_HELP=yes
2122         ERROR=yes
2123     fi
2124 done
2125
2126 if [ "$CFG_QCONFIG" != "full" ] && [ "$CFG_QT3SUPPORT" = "yes" ]; then
2127     echo "Warning: '-qconfig $CFG_QCONFIG' will disable the qt3support library."
2128     CFG_QT3SUPPORT="no"
2129 fi
2130
2131 # update QT_CONFIG to show our current predefined configuration
2132 case "$CFG_QCONFIG" in
2133 minimal|small|medium|large|full)
2134     # these are a sequence of increasing functionality
2135     for c in minimal small medium large full; do
2136         QT_CONFIG="$QT_CONFIG $c-config"
2137         [ "$CFG_QCONFIG" = $c ] && break
2138     done
2139     ;;
2140 *)
2141     # not known to be sufficient for anything
2142     if [ '!' -f "$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" ]; then
2143         echo >&2 "Error: configuration file not found:"
2144         echo >&2 "  $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h"
2145         OPT_HELP=yes
2146     fi
2147 esac
2148
2149 #-------------------------------------------------------------------------------
2150 # build tree initialization
2151 #-------------------------------------------------------------------------------
2152
2153 # where to find which..
2154 unixtests="$relpath/config.tests/unix"
2155 mactests="$relpath/config.tests/mac"
2156 WHICH="$unixtests/which.test"
2157
2158 PERL=`$WHICH perl 2>/dev/null`
2159
2160 # find out which awk we want to use, prefer gawk, then nawk, then regular awk
2161 AWK=
2162 for e in gawk nawk awk; do
2163     if "$WHICH" $e >/dev/null 2>&1 && ( $e -f /dev/null /dev/null ) >/dev/null 2>&1; then
2164         AWK=$e
2165         break
2166     fi
2167 done
2168
2169 # find perl
2170 PERL="/usr/bin/perl"
2171 if "$WHICH" perl >/dev/null 2>&1 && ( perl /dev/null ) >/dev/null 2>&1; then
2172     PERL=`$WHICH perl`
2173 fi
2174
2175 ### skip this if the user just needs help...
2176 if [ "$OPT_HELP" != "yes" ]; then
2177
2178 # is this a shadow build?
2179 if [ "$OPT_SHADOW" = "maybe" ]; then
2180     OPT_SHADOW=no
2181     if [ "$relpath" != "$outpath" ] && [ '!' -f "$outpath/configure" ]; then
2182         if [ -h "$outpath" ]; then
2183             [ "$relpath" -ef "$outpath" ] || OPT_SHADOW=yes
2184         else
2185             OPT_SHADOW=yes
2186         fi
2187     fi
2188 fi
2189 if [ "$OPT_SHADOW" = "yes" ]; then
2190     if [ -f "$relpath/.qmake.cache" -o -f "$relpath/src/corelib/global/qconfig.h" -o -f "$relpath/src/corelib/global/qconfig.cpp" ]; then
2191         echo >&2 "You cannot make a shadow build from a source tree containing a previous build."
2192         echo >&2 "Cannot proceed."
2193         exit 1
2194     fi
2195     [ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
2196 fi
2197
2198 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2199     echo
2200     echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux"
2201     echo "By default, Qt is built in release mode with separate debug information, so"
2202     echo "-debug-and-release is not necessary anymore"
2203     echo
2204 fi
2205
2206 # detect build style
2207 if [ "$CFG_DEBUG" = "auto" ]; then
2208     if [ "$PLATFORM_MAC" = "yes" ]; then
2209         CFG_DEBUG_RELEASE=yes
2210         CFG_DEBUG=yes
2211     elif [ "$CFG_DEV" = "yes" ]; then
2212         CFG_DEBUG_RELEASE=no
2213         CFG_DEBUG=yes
2214     else
2215         CFG_DEBUG_RELEASE=no
2216         CFG_DEBUG=no
2217     fi
2218 fi
2219 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2220     QMAKE_CONFIG="$QMAKE_CONFIG build_all"
2221 fi
2222
2223 if [ "$CFG_SILENT" = "yes" ]; then
2224     QMAKE_CONFIG="$QMAKE_CONFIG silent"
2225 fi
2226
2227 # if the source tree is different from the build tree,
2228 # symlink or copy part of the sources
2229 if [ "$OPT_SHADOW" = "yes" ]; then
2230     echo "Preparing build tree..."
2231
2232     if [ -z "$PERL" ]; then
2233         echo
2234         echo "You need perl in your PATH to make a shadow build."
2235         echo "Cannot proceed."
2236         exit 1
2237     fi
2238
2239     [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
2240
2241     # symlink the qmake directory
2242     find "$relpath/qmake" | while read a; do
2243         my_a=`echo "$a" | sed "s,^${relpath}/,${outpath}/,"`
2244         if [ '!' -f "$my_a" ]; then
2245             if [ -d "$a" ]; then
2246                 # directories are created...
2247                 mkdir -p "$my_a"
2248             else
2249                 a_dir=`dirname "$my_a"`
2250                 [ -d "$a_dir" ] || mkdir -p "$a_dir"
2251                 # ... and files are symlinked
2252                 case `basename "$a"` in
2253                 *.o|*.d|GNUmakefile*|qmake)
2254                     ;;
2255                 *)
2256                     rm -f "$my_a"
2257                     ln -s "$a" "$my_a"
2258                     ;;
2259                 esac
2260             fi
2261         fi
2262     done
2263
2264     # make a syncqt script that can be used in the shadow
2265     rm -f "$outpath/bin/syncqt"
2266     if [ -x "$relpath/bin/syncqt" ]; then
2267         mkdir -p "$outpath/bin"
2268         echo "#!/bin/sh" >"$outpath/bin/syncqt"
2269         echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/syncqt"
2270         echo "perl \"$relpath/bin/syncqt\" -outdir \"$outpath\" \"\$@\"" >>"$outpath/bin/syncqt"
2271         chmod 755 "$outpath/bin/syncqt"
2272     fi
2273
2274     # symlink the mkspecs directory
2275     mkdir -p "$outpath/mkspecs"
2276     rm -f "$outpath"/mkspecs/*
2277     ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
2278     rm -f "$outpath/mkspecs/default"
2279
2280     # symlink the doc directory
2281     rm -rf "$outpath/doc"
2282     ln -s "$relpath/doc" "$outpath/doc"
2283
2284     # make sure q3porting.xml can be found
2285     mkdir -p "$outpath/tools/porting/src"
2286     rm -f "$outpath/tools/porting/src/q3porting.xml"
2287     ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src"
2288 fi
2289
2290 # symlink fonts to be able to run application from build directory
2291 if [ "$PLATFORM_QWS" = "yes" ] && [ ! -d "${outpath}/lib/fonts" ]; then
2292     if [ "$PLATFORM" = "$XPLATFORM" ]; then
2293         mkdir -p "${outpath}/lib"
2294         ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
2295     fi
2296 fi
2297
2298 if [ "$OPT_FAST" = "auto" ]; then
2299    if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then
2300        OPT_FAST=yes
2301    else
2302        OPT_FAST=no
2303    fi
2304 fi
2305
2306 # find a make command
2307 if [ -z "$MAKE" ]; then
2308     MAKE=
2309     for mk in gmake make; do
2310         if "$WHICH" $mk >/dev/null 2>&1; then
2311             MAKE=`"$WHICH" $mk`
2312             break
2313         fi
2314     done
2315     if [ -z "$MAKE" ]; then
2316         echo >&2 "You don't seem to have 'make' or 'gmake' in your PATH."
2317         echo >&2 "Cannot proceed."
2318         exit 1
2319     fi
2320     # export MAKE, we need it later in the config.tests
2321     export MAKE
2322 fi
2323
2324 fi ### help
2325
2326 #-------------------------------------------------------------------------------
2327 # auto-detect all that hasn't been specified in the arguments
2328 #-------------------------------------------------------------------------------
2329
2330 [ "$PLATFORM_QWS" = "yes" -a "$CFG_EMBEDDED" = "no" ] && CFG_EMBEDDED=auto
2331 if [ "$CFG_EMBEDDED" != "no" ]; then
2332     case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2333     Darwin:*)
2334         [ -z "$PLATFORM" ] && PLATFORM=qws/macx-generic-g++
2335         if [ -z "$XPLATFORM" ]; then
2336             [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2337             XPLATFORM="qws/macx-$CFG_EMBEDDED-g++"
2338         fi
2339         ;;
2340     FreeBSD:*)
2341         [ -z "$PLATFORM" ] && PLATFORM=qws/freebsd-generic-g++
2342         if [ -z "$XPLATFORM" ]; then
2343             [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2344             XPLATFORM="qws/freebsd-$CFG_EMBEDDED-g++"
2345         fi
2346         ;;
2347     SunOS:5*)
2348         [ -z "$PLATFORM" ] && PLATFORM=qws/solaris-generic-g++
2349         if [ -z "$XPLATFORM" ]; then
2350             [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2351             XPLATFORM="qws/solaris-$CFG_EMBEDDED-g++"
2352         fi
2353         ;;
2354     Linux:*)
2355         if [ -z "$PLATFORM" ]; then
2356             case "$UNAME_MACHINE" in
2357             *86)
2358                 PLATFORM=qws/linux-x86-g++
2359                 ;;
2360             *86_64)
2361                 PLATFORM=qws/linux-x86_64-g++
2362                 ;;
2363             *)
2364                 PLATFORM=qws/linux-generic-g++
2365                 ;;
2366             esac
2367         fi
2368         if [ -z "$XPLATFORM" ]; then
2369             if [ "$CFG_EMBEDDED" = "auto" ]; then
2370                 if [ -n "$CFG_ARCH" ]; then
2371                     CFG_EMBEDDED=$CFG_ARCH
2372                 else
2373                     case "$UNAME_MACHINE" in
2374                     *86)
2375                         CFG_EMBEDDED=x86
2376                         ;;
2377                     *86_64)
2378                         CFG_EMBEDDED=x86_64
2379                         ;;
2380                     *)
2381                         CFG_EMBEDDED=generic
2382                         ;;
2383                     esac
2384                 fi
2385             fi
2386             XPLATFORM="qws/linux-$CFG_EMBEDDED-g++"
2387         fi
2388         ;;
2389     QNX:*)
2390         [ -z "$PLATFORM" ] && PLATFORM=unsupported/qws/qnx-generic-g++
2391         if [ -z "$XPLATFORM" ]; then
2392             [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2393             XPLATFORM="unsupported/qws/qnx-$CFG_EMBEDDED-g++"
2394         fi
2395         ;;
2396     CYGWIN*:*)
2397         CFG_EMBEDDED=x86
2398         ;;
2399     *)
2400         echo "Qt for Embedded Linux is not supported on this platform. Disabling."
2401         CFG_EMBEDDED=no
2402         PLATFORM_QWS=no
2403         ;;
2404     esac
2405 fi
2406 if [ -z "$PLATFORM" ]; then
2407     PLATFORM_NOTES=
2408     case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2409      Darwin:*)
2410         if [ "$PLATFORM_MAC" = "yes" ]; then
2411           PLATFORM=macx-g++
2412         # PLATFORM=macx-xcode
2413         else
2414           PLATFORM=darwin-g++
2415         fi
2416         ;;
2417      AIX:*)
2418         #PLATFORM=aix-g++
2419         #PLATFORM=aix-g++-64
2420         PLATFORM=aix-xlc
2421         #PLATFORM=aix-xlc-64
2422         PLATFORM_NOTES="
2423             - Also available for AIX: aix-g++ aix-g++-64 aix-xlc-64
2424         "
2425         ;;
2426      GNU:*)
2427         PLATFORM=hurd-g++
2428         ;;
2429      dgux:*)
2430         PLATFORM=dgux-g++
2431         ;;
2432 #     DYNIX/ptx:4*)
2433 #       PLATFORM=dynix-g++
2434 #       ;;
2435      ULTRIX:*)
2436         PLATFORM=ultrix-g++
2437         ;;
2438      FreeBSD:*)
2439         PLATFORM=freebsd-g++
2440         PLATFORM_NOTES="
2441             - Also available for FreeBSD: freebsd-icc
2442         "
2443         ;;
2444      OpenBSD:*)
2445         PLATFORM=openbsd-g++
2446         ;;
2447      NetBSD:*)
2448         PLATFORM=netbsd-g++
2449         ;;
2450      BSD/OS:*|BSD/386:*)
2451         PLATFORM=bsdi-g++
2452         ;;
2453      IRIX*:*)
2454         #PLATFORM=irix-g++
2455         PLATFORM=irix-cc
2456         #PLATFORM=irix-cc-64
2457         PLATFORM_NOTES="
2458             - Also available for IRIX: irix-g++ irix-cc-64
2459         "
2460         ;;
2461      HP-UX:*)
2462         case "$UNAME_MACHINE" in
2463             ia64)
2464                 #PLATFORM=hpuxi-acc-32
2465                 PLATFORM=hpuxi-acc-64
2466                 PLATFORM_NOTES="
2467                     - Also available for HP-UXi: hpuxi-acc-32
2468                 "
2469             ;;
2470             *)
2471                 #PLATFORM=hpux-g++
2472                 PLATFORM=hpux-acc
2473                 #PLATFORM=hpux-acc-64
2474                 #PLATFORM=hpux-cc
2475                 #PLATFORM=hpux-acc-o64
2476                 PLATFORM_NOTES="
2477                     - Also available for HP-UX: hpux-g++ hpux-acc-64 hpux-acc-o64
2478                 "
2479             ;;
2480         esac
2481         ;;
2482      OSF1:*)
2483         #PLATFORM=tru64-g++
2484         PLATFORM=tru64-cxx
2485         PLATFORM_NOTES="
2486             - Also available for Tru64: tru64-g++
2487         "
2488         ;;
2489      Linux:*)
2490         case "$UNAME_MACHINE" in
2491             x86_64|s390x|ppc64)
2492                 PLATFORM=linux-g++-64
2493                 ;;
2494             *)
2495                 PLATFORM=linux-g++
2496                 ;;
2497         esac
2498         PLATFORM_NOTES="
2499             - Also available for Linux: linux-kcc linux-icc linux-cxx
2500         "
2501         ;;
2502      SunOS:5*)
2503         #PLATFORM=solaris-g++
2504         PLATFORM=solaris-cc
2505         #PLATFORM=solaris-cc64
2506         PLATFORM_NOTES="
2507             - Also available for Solaris: solaris-g++ solaris-cc-64
2508         "
2509         ;;
2510      ReliantUNIX-*:*|SINIX-*:*)
2511         PLATFORM=reliant-cds
2512         #PLATFORM=reliant-cds-64
2513         PLATFORM_NOTES="
2514             - Also available for Reliant UNIX: reliant-cds-64
2515         "
2516         ;;
2517      CYGWIN*:*)
2518         PLATFORM=cygwin-g++
2519         ;;
2520      LynxOS*:*)
2521         PLATFORM=lynxos-g++
2522         ;;
2523      OpenUNIX:*)
2524         #PLATFORM=unixware-g++
2525         PLATFORM=unixware-cc
2526         PLATFORM_NOTES="
2527             - Also available for OpenUNIX: unixware-g++
2528         "
2529         ;;
2530      UnixWare:*)
2531         #PLATFORM=unixware-g++
2532         PLATFORM=unixware-cc
2533         PLATFORM_NOTES="
2534             - Also available for UnixWare: unixware-g++
2535         "
2536         ;;
2537      SCO_SV:*)
2538         #PLATFORM=sco-g++
2539         PLATFORM=sco-cc
2540         PLATFORM_NOTES="
2541             - Also available for SCO OpenServer: sco-g++
2542         "
2543         ;;
2544      UNIX_SV:*)
2545         PLATFORM=unixware-g++
2546         ;;
2547      QNX:*)
2548         PLATFORM=unsupported/qnx-g++
2549         ;;
2550      *)
2551         if [ "$OPT_HELP" != "yes" ]; then
2552             echo
2553             for p in $PLATFORMS; do
2554                 echo "    $relconf $* -platform $p"
2555             done
2556             echo >&2
2557             echo "   The build script does not currently recognize all" >&2
2558             echo "   platforms supported by Qt." >&2
2559             echo "   Rerun this script with a -platform option listed to" >&2
2560             echo "   set the system/compiler combination you use." >&2
2561             echo >&2
2562             exit 2
2563         fi
2564     esac
2565 fi
2566
2567 if [ "$PLATFORM_QWS" = "yes" ]; then
2568     CFG_SM=no
2569     PLATFORMS=`find "$relpath/mkspecs/qws" | sed "s,$relpath/mkspecs/qws/,,"`
2570 else
2571     PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mkspecs/qws/,,"`
2572 fi
2573
2574 [ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
2575 if [ -d "$PLATFORM" ]; then
2576   QMAKESPEC="$PLATFORM"
2577 else
2578   QMAKESPEC="$relpath/mkspecs/${PLATFORM}"
2579 fi
2580 if [ -d "$XPLATFORM" ]; then
2581   XQMAKESPEC="$XPLATFORM"
2582 else
2583   XQMAKESPEC="$relpath/mkspecs/${XPLATFORM}"
2584 fi
2585 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2586     QT_CROSS_COMPILE=yes
2587     QMAKE_CONFIG="$QMAKE_CONFIG cross_compile"
2588 fi
2589
2590 if [ "$PLATFORM_MAC" = "yes" ]; then
2591    if [ `basename $QMAKESPEC` = "macx-xcode" ] || [ `basename $XQMAKESPEC` = "macx-xcode" ]; then
2592       echo >&2
2593       echo "   Platform 'macx-xcode' should not be used when building Qt/Mac." >&2
2594       echo "   Please build Qt/Mac with 'macx-g++', then if you would like to" >&2
2595       echo "   use mac-xcode on your application code it can link to a Qt/Mac" >&2
2596       echo "   built with 'macx-g++'" >&2
2597       echo >&2
2598       exit 2
2599     fi
2600 fi
2601
2602 # check specified platforms are supported
2603 if [ '!' -d "$QMAKESPEC" ]; then
2604     echo
2605     echo "   The specified system/compiler is not supported:"
2606     echo
2607     echo "      $QMAKESPEC"
2608     echo
2609     echo "   Please see the README file for a complete list."
2610     echo
2611     exit 2
2612 fi
2613 if [ '!' -d "$XQMAKESPEC" ]; then
2614     echo
2615     echo "   The specified system/compiler is not supported:"
2616     echo
2617     echo "      $XQMAKESPEC"
2618     echo
2619     echo "   Please see the README file for a complete list."
2620     echo
2621     exit 2
2622 fi
2623 if [ '!' -f "${XQMAKESPEC}/qplatformdefs.h" ]; then
2624     echo
2625     echo "   The specified system/compiler port is not complete:"
2626     echo
2627     echo "      $XQMAKESPEC/qplatformdefs.h"
2628     echo
2629     echo "   Please contact qt-bugs@trolltech.com."
2630     echo
2631     exit 2
2632 fi
2633
2634 # now look at the configs and figure out what platform we are config'd for
2635 [ "$CFG_EMBEDDED" = "no" ] \
2636   && [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ] \
2637   && PLATFORM_X11=yes
2638 ### echo "$XQMAKESPEC" | grep mkspecs/qws >/dev/null 2>&1 && PLATFORM_QWS=yes
2639
2640 if [ "$UNAME_SYSTEM" = "SunOS" ]; then
2641     # Solaris 2.5 and 2.6 have libposix4, which was renamed to librt for Solaris 7 and up
2642     if echo $UNAME_RELEASE | grep "^5\.[5|6]" >/dev/null 2>&1; then
2643         sed -e "s,-lrt,-lposix4," "$XQMAKESPEC/qmake.conf" > "$XQMAKESPEC/qmake.conf.new"
2644         mv "$XQMAKESPEC/qmake.conf.new" "$XQMAKESPEC/qmake.conf"
2645     fi
2646 fi
2647
2648 #-------------------------------------------------------------------------------
2649 # determine the system architecture
2650 #-------------------------------------------------------------------------------
2651 if [ "$OPT_VERBOSE" = "yes" ]; then
2652     echo "Determining system architecture... ($UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE)"
2653 fi
2654
2655 if [ "$CFG_EMBEDDED" != "no" -a "$CFG_EMBEDDED" != "auto" ] && [ -n "$CFG_ARCH" ]; then
2656     if [ "$CFG_ARCH" != "$CFG_EMBEDDED" ]; then
2657         echo ""
2658         echo "You have specified a target architecture with -embedded and -arch."
2659         echo "The two architectures you have specified are different, so we can"
2660         echo "not proceed. Either set both to be the same, or only use -embedded."
2661         echo ""
2662         exit 1
2663     fi
2664 fi
2665
2666 if [ "$CFG_RTOS_ENABLED" = "no" ]; then
2667     case `basename "$XPLATFORM"` in
2668         qnx-* | vxworks-*)
2669             echo ""
2670             echo "You are not licensed for Qt for `basename $XPLATFORM`."
2671             echo ""
2672             echo "Please contact qt-info@nokia.com to upgrade your license to"
2673             echo "include this platform, or install the Qt Open Source Edition"
2674             echo "if you intend to develop free software."
2675             exit 1
2676             ;;
2677     esac
2678 fi
2679
2680 if [ -z "${CFG_HOST_ARCH}" ]; then
2681     case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in
2682     IRIX*:*:*)
2683         CFG_HOST_ARCH=`uname -p`
2684         if [ "$OPT_VERBOSE" = "yes" ]; then
2685             echo "    SGI ($CFG_HOST_ARCH)"
2686         fi
2687         ;;
2688     SunOS:5*:*)
2689         case "$UNAME_MACHINE" in
2690         sun4u*|sun4v*)
2691             if [ "$OPT_VERBOSE" = "yes" ]; then
2692                 echo "    Sun SPARC (sparc)"
2693             fi
2694             CFG_HOST_ARCH=sparc
2695             ;;
2696         i86pc)
2697             case "$PLATFORM" in
2698             *-64)
2699                 if [ "$OPT_VERBOSE" = "yes" ]; then
2700                     echo "    64-bit AMD 80x86 (x86_64)"
2701                 fi
2702                 CFG_HOST_ARCH=x86_64
2703                 ;;
2704             *)
2705                 if [ "$OPT_VERBOSE" = "yes" ]; then
2706                     echo "    32-bit Intel 80x86 (i386)"
2707                 fi
2708                 CFG_HOST_ARCH=i386
2709                 ;;
2710             esac
2711         esac
2712         ;;
2713     Darwin:*:*)
2714         case "$UNAME_MACHINE" in
2715             Power?Macintosh)
2716                 if [ "$OPT_VERBOSE" = "yes" ]; then
2717                     echo "    32-bit Apple PowerPC (powerpc)"
2718                 fi
2719                 ;;
2720             x86)
2721                 if [ "$OPT_VERBOSE" = "yes" ]; then
2722                     echo "    32-bit Intel 80x86 (i386)"
2723                 fi
2724                 ;;
2725         esac
2726         CFG_HOST_ARCH=macosx
2727         ;;
2728     AIX:*:00????????00)
2729         if [ "$OPT_VERBOSE" = "yes" ]; then
2730         echo "    64-bit IBM PowerPC (powerpc)"
2731         fi
2732         CFG_HOST_ARCH=powerpc
2733         ;;
2734     HP-UX:*:9000*)
2735         if [ "$OPT_VERBOSE" = "yes" ]; then
2736             echo "    HP PA-RISC (parisc)"
2737         fi
2738         CFG_HOST_ARCH=parisc
2739         ;;
2740     *:*:i?86)
2741         if [ "$OPT_VERBOSE" = "yes" ]; then
2742             echo "    32-bit Intel 80x86 (i386)"
2743         fi
2744         CFG_HOST_ARCH=i386
2745         ;;
2746     *:*:x86_64|*:*:amd64)
2747         if [ "$PLATFORM" = "linux-g++-32" -o "$PLATFORM" = "linux-icc-32" ]; then
2748             if [ "$OPT_VERBOSE" = "yes" ]; then
2749                 echo "    32 bit on 64-bit AMD 80x86 (i386)"
2750             fi
2751             CFG_HOST_ARCH=i386
2752         else
2753             if [ "$OPT_VERBOSE" = "yes" ]; then
2754                 echo "    64-bit AMD 80x86 (x86_64)"
2755             fi
2756             CFG_HOST_ARCH=x86_64
2757         fi
2758         ;;
2759     *:*:ppc)
2760         if [ "$OPT_VERBOSE" = "yes" ]; then
2761             echo "    32-bit PowerPC (powerpc)"
2762         fi
2763         CFG_HOST_ARCH=powerpc
2764         ;;
2765     *:*:ppc64)
2766         if [ "$OPT_VERBOSE" = "yes" ]; then
2767             echo "    64-bit PowerPC (powerpc)"
2768         fi
2769         CFG_HOST_ARCH=powerpc
2770         ;;
2771     *:*:s390*)
2772         if [ "$OPT_VERBOSE" = "yes" ]; then
2773             echo "    IBM S/390 (s390)"
2774         fi
2775         CFG_HOST_ARCH=s390
2776         ;;
2777     *:*:arm*)
2778         if [ "$OPT_VERBOSE" = "yes" ]; then
2779             echo "    ARM (arm)"
2780         fi
2781         CFG_HOST_ARCH=arm
2782         ;;
2783     Linux:*:sparc*)
2784         if [ "$OPT_VERBOSE" = "yes" ]; then
2785             echo "    Linux on SPARC"
2786         fi
2787         CFG_HOST_ARCH=sparc
2788         ;;
2789     QNX:*:*)
2790         case "$UNAME_MACHINE" in
2791         x86pc)
2792             if [ "$OPT_VERBOSE" = "yes" ]; then
2793                 echo "    QNX on Intel 80x86 (i386)"
2794             fi
2795             CFG_HOST_ARCH=i386
2796             ;;
2797         esac
2798         ;;
2799     *:*:*)
2800         if [ "$OPT_VERBOSE" = "yes" ]; then
2801             echo "    Trying '$UNAME_MACHINE'..."
2802         fi
2803         CFG_HOST_ARCH="$UNAME_MACHINE"
2804         ;;
2805     esac
2806 fi
2807
2808 if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
2809     if [ -n "$CFG_ARCH" ]; then
2810         CFG_EMBEDDED=$CFG_ARCH
2811     fi
2812
2813     case "$CFG_EMBEDDED" in
2814     x86)
2815         CFG_ARCH=i386
2816         ;;
2817     x86_64)
2818         CFG_ARCH=x86_64
2819         ;;
2820     ipaq|sharp)
2821         CFG_ARCH=arm
2822         ;;
2823     dm7000)
2824         CFG_ARCH=powerpc
2825         ;;
2826     dm800)
2827         CFG_ARCH=mips
2828         ;;
2829     sh4al)
2830         CFG_ARCH=sh4a
2831         ;;
2832     *)
2833         CFG_ARCH="$CFG_EMBEDDED"
2834         ;;
2835     esac
2836 elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
2837     CFG_ARCH=$CFG_HOST_ARCH
2838 fi
2839
2840 if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then
2841     if [ "$OPT_VERBOSE" = "yes" ]; then
2842         echo "    '$CFG_ARCH' is supported"
2843     fi
2844 else
2845     if [ "$OPT_VERBOSE" = "yes" ]; then
2846         echo "    '$CFG_ARCH' is unsupported, using 'generic'"
2847     fi
2848     CFG_ARCH=generic
2849 fi
2850 if [ "$CFG_HOST_ARCH" != "$CFG_ARCH" ]; then
2851     if [ -d "$relpath/src/corelib/arch/$CFG_HOST_ARCH" ]; then
2852         if [ "$OPT_VERBOSE" = "yes" ]; then
2853             echo "    '$CFG_HOST_ARCH' is supported"
2854         fi
2855     else
2856         if [ "$OPT_VERBOSE" = "yes" ]; then
2857             echo "    '$CFG_HOST_ARCH' is unsupported, using 'generic'"
2858         fi
2859         CFG_HOST_ARCH=generic
2860     fi
2861 fi
2862
2863 if [ "$OPT_VERBOSE" = "yes" ]; then
2864     echo "System architecture: '$CFG_ARCH'"
2865     if [ "$PLATFORM_QWS" = "yes" ]; then
2866         echo "Host architecture: '$CFG_HOST_ARCH'"
2867     fi
2868 fi
2869
2870 #-------------------------------------------------------------------------------
2871 # tests that don't need qmake (must be run before displaying help)
2872 #-------------------------------------------------------------------------------
2873
2874 if [ -z "$PKG_CONFIG" ]; then
2875     # See if PKG_CONFIG is set in the mkspec:
2876     PKG_CONFIG=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%PKG_CONFIG[^_].*=%%p' | tr '\n' ' '`
2877 fi
2878 if [ -z "$PKG_CONFIG" ]; then
2879     PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
2880 fi
2881
2882 # Work out if we can use pkg-config
2883 if [ "$QT_CROSS_COMPILE" = "yes" ]; then
2884     if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then
2885         echo >&2 ""
2886         echo >&2 "You have asked to use pkg-config and are cross-compiling."
2887         echo >&2 "Please make sure you have a correctly set-up pkg-config"
2888         echo >&2 "environment!"
2889         echo >&2 ""
2890         if [ -z "$PKG_CONFIG_PATH" ]; then
2891             echo >&2 ""
2892             echo >&2 "Warning: PKG_CONFIG_PATH has not been set.  This could mean"
2893             echo >&2 "the host compiler's .pc files will be used. This is probably"
2894             echo >&2 "not what you want."
2895             echo >&2 ""
2896         elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
2897             echo >&2 ""
2898             echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not"
2899             echo >&2 "been set. This means your toolchain's .pc files must contain"
2900             echo >&2 "the paths to the toolchain's libraries & headers. If configure"
2901             echo >&2 "tests are failing, please check these files."
2902             echo >&2 ""
2903         fi
2904     else
2905         echo >&2 ""
2906         echo >&2 "You have not explicitly asked to use pkg-config and are cross-compiling."
2907         echo >&2 "pkg-config will not be used to automatically query cflag/lib parameters for"
2908         echo >&2 "dependencies"
2909         echo >&2 ""
2910         PKG_CONFIG=""
2911     fi
2912 fi
2913
2914 # process CFG_MAC_ARCHS
2915 if [ "$PLATFORM_MAC" = "yes" ]; then
2916 #   check -arch arguments for validity.
2917     ALLOWED="x86 ppc x86_64 ppc64 i386"
2918     # Save the list so we can re-write it using only valid values
2919     CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS"
2920     CFG_MAC_ARCHS=
2921     for i in $CFG_MAC_ARCHS_IN
2922     do 
2923         if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then
2924             echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64";
2925             exit 2;
2926         fi
2927         if [ "$i" = "i386" -o "$i" = "x86" ]; then
2928             # These are synonymous values
2929             # CFG_MAC_ARCHS requires x86 while GCC requires i386
2930             CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86"
2931             MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch i386"
2932         else
2933             CFG_MAC_ARCHS="$CFG_MAC_ARCHS $i"
2934             MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch $i"
2935         fi
2936     done
2937 fi
2938
2939 # pass on $CFG_SDK to the configure tests.
2940 if [ '!' -z "$CFG_SDK" ]; then
2941     MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK"
2942 fi
2943
2944 # find the default framework value
2945 if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
2946     if [ "$CFG_FRAMEWORK" = "auto" ]; then
2947         CFG_FRAMEWORK="$CFG_SHARED"
2948     elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
2949         echo
2950         echo "WARNING: Using static linking will disable the use of Mac frameworks."
2951         echo
2952         CFG_FRAMEWORK="no"
2953     fi
2954 else
2955     CFG_FRAMEWORK=no
2956 fi
2957
2958 QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
2959 TEST_COMPILER="$CC"
2960 [ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
2961 if [ -z "$TEST_COMPILER" ]; then
2962     echo "ERROR: Cannot set the compiler for the configuration tests"
2963     exit 1
2964 fi
2965
2966 # auto-detect precompiled header support
2967 if [ "$CFG_PRECOMPILE" = "auto" ]; then
2968     if [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
2969        CFG_PRECOMPILE=no
2970     elif "$unixtests/precomp.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2971        CFG_PRECOMPILE=no
2972     else
2973        CFG_PRECOMPILE=yes
2974     fi
2975 elif [ "$CFG_PRECOMPILE" = "yes" ] && [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
2976     echo
2977     echo "WARNING: Using universal binaries disables precompiled headers."
2978     echo
2979     CFG_PRECOMPILE=no
2980 fi
2981
2982 #auto-detect DWARF2 on the mac
2983 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "auto" ]; then
2984     if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
2985         CFG_MAC_DWARF2=no
2986     else
2987         CFG_MAC_DWARF2=yes
2988     fi
2989 fi
2990
2991 # auto-detect support for -Xarch on the mac
2992 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" = "auto" ]; then
2993     if "$mactests/xarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
2994         CFG_MAC_XARCH=no
2995     else
2996         CFG_MAC_XARCH=yes
2997     fi
2998 fi
2999
3000 # don't autodetect support for separate debug info on objcopy when
3001 # cross-compiling as lots of toolchains seems to have problems with this
3002 if [ "$QT_CROSS_COMPILE" = "yes" ] && [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
3003     CFG_SEPARATE_DEBUG_INFO="no"
3004 fi
3005
3006 # auto-detect support for separate debug info in objcopy
3007 if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
3008     TEST_COMPILER_CFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CFLAGS[^_].*=%%p' | tr '\n' ' '`
3009     TEST_COMPILER_CXXFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CXXFLAGS[^_].*=%%p' | tr '\n' ' '`
3010     TEST_OBJCOPY=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_OBJCOPY" | sed "s%.* *= *\(.*\)$%\1%" | tail -1`
3011     COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
3012     COMPILER_WITH_FLAGS=`echo "$COMPILER_WITH_FLAGS" | sed -e "s%\\$\\$QMAKE_CFLAGS%$TEST_COMPILER_CFLAGS%g"`
3013     if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$TEST_OBJCOPY" "$OPT_VERBOSE"; then
3014        CFG_SEPARATE_DEBUG_INFO=no
3015     else
3016        case "$PLATFORM" in
3017        hpux-*)
3018            # binutils on HP-UX is buggy; default to no.
3019            CFG_SEPARATE_DEBUG_INFO=no
3020            ;;
3021        *)
3022            CFG_SEPARATE_DEBUG_INFO=yes
3023            ;;
3024        esac
3025     fi
3026 fi
3027
3028 # auto-detect -fvisibility support
3029 if [ "$CFG_REDUCE_EXPORTS" = "auto" ]; then
3030     if "$unixtests/fvisibility.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
3031        CFG_REDUCE_EXPORTS=no
3032     else
3033        CFG_REDUCE_EXPORTS=yes
3034     fi
3035 fi
3036
3037 # detect the availability of the -Bsymbolic-functions linker optimization
3038 if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then
3039     if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
3040         CFG_REDUCE_RELOCATIONS=no
3041     else
3042         CFG_REDUCE_RELOCATIONS=yes
3043     fi
3044 fi
3045
3046 # auto-detect GNU make support
3047 if [ "$CFG_USE_GNUMAKE" = "auto" ] && "$MAKE" -v | grep "GNU Make" >/dev/null 2>&1; then
3048    CFG_USE_GNUMAKE=yes
3049 fi
3050
3051 # If -opengl wasn't specified, don't try to auto-detect
3052 if [ "$PLATFORM_QWS" = "yes" ] && [ "$CFG_OPENGL" = "auto" ]; then
3053         CFG_OPENGL=no
3054 fi
3055
3056 # mac
3057 if [ "$PLATFORM_MAC" = "yes" ]; then
3058     if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
3059         CFG_OPENGL=desktop
3060     fi
3061 fi
3062
3063 # find the default framework value
3064 if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
3065     if [ "$CFG_FRAMEWORK" = "auto" ]; then
3066         CFG_FRAMEWORK="$CFG_SHARED"
3067     elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
3068         echo
3069         echo "WARNING: Using static linking will disable the use of Mac frameworks."
3070         echo
3071         CFG_FRAMEWORK="no"
3072     fi
3073 else
3074     CFG_FRAMEWORK=no
3075 fi
3076
3077 # Print a warning if configure was called with the 10.4u SDK option on Snow Leopard
3078 # with the default mkspec. The 10.4u SDK does not support gcc 4.2.
3079 if [ "$PLATFORM_MAC" = "yes" ] && [ '!' -z "$CFG_SDK" ]; then
3080     # get the darwin version. 10.0.0 and up means snow leopard.
3081     VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'`
3082     if [ "$VERSION" -gt 9 ] && [ "$CFG_SDK" == "/Developer/SDKs/MacOSX10.4u.sdk/" ] && [ "$PLATFORM" == "macx-g++" ]; then
3083         echo
3084         echo "WARNING: The 10.4u SDK does not support gcc 4.2. Configure with -platform macx-g++40. "
3085         echo
3086     fi
3087 fi
3088
3089 # x11 tests are done after qmake is built
3090
3091
3092 #setup the build parts
3093 if [ -z "$CFG_BUILD_PARTS" ]; then
3094     CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
3095
3096     # don't build tools by default when cross-compiling
3097     if [ "$PLATFORM" != "$XPLATFORM" ]; then
3098         CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, tools,,g"`
3099     fi
3100 fi
3101 for nobuild in $CFG_NOBUILD_PARTS; do
3102     CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, $nobuild,,g"`
3103 done
3104 if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then
3105 #    echo
3106 #    echo "WARNING: libs is a required part of the build."
3107 #    echo
3108     CFG_BUILD_PARTS="$CFG_BUILD_PARTS libs"
3109 fi
3110
3111 #-------------------------------------------------------------------------------
3112 # post process QT_INSTALL_* variables
3113 #-------------------------------------------------------------------------------
3114
3115 #prefix
3116 if [ -z "$QT_INSTALL_PREFIX" ]; then
3117     if [ "$CFG_DEV" = "yes" ]; then
3118         QT_INSTALL_PREFIX="$outpath" # In Development, we use sandboxed builds by default
3119     elif [ "$PLATFORM_QWS" = "yes" ]; then
3120         QT_INSTALL_PREFIX="/usr/local/Trolltech/QtEmbedded-${QT_VERSION}"
3121         if [ "$PLATFORM" != "$XPLATFORM" ]; then
3122             QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}"
3123         fi
3124     else
3125         QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION
3126     fi
3127 fi
3128 QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
3129
3130 #docs
3131 if [ -z "$QT_INSTALL_DOCS" ]; then #default
3132     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3133         if [ "$PLATFORM_MAC" = "yes" ]; then
3134             QT_INSTALL_DOCS="/Developer/Documentation/Qt"
3135         fi
3136     fi
3137     [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
3138
3139 fi
3140 QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
3141
3142 #headers
3143 if [ -z "$QT_INSTALL_HEADERS" ]; then #default
3144     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3145         if [ "$PLATFORM_MAC" = "yes" ]; then
3146             if [ "$CFG_FRAMEWORK" = "yes" ]; then
3147                 QT_INSTALL_HEADERS=
3148             fi
3149         fi
3150     fi
3151     [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
3152
3153 fi
3154 QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"`
3155
3156 #libs
3157 if [ -z "$QT_INSTALL_LIBS" ]; then #default
3158     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3159         if [ "$PLATFORM_MAC" = "yes" ]; then
3160             if [ "$CFG_FRAMEWORK" = "yes" ]; then
3161                 QT_INSTALL_LIBS="/Libraries/Frameworks"
3162             fi
3163         fi
3164     fi
3165     [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback
3166 fi
3167 QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
3168
3169 #bins
3170 if [ -z "$QT_INSTALL_BINS" ]; then #default
3171     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3172         if [ "$PLATFORM_MAC" = "yes" ]; then
3173             QT_INSTALL_BINS="/Developer/Applications/Qt"
3174         fi
3175     fi
3176     [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
3177
3178 fi
3179 QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
3180
3181 #plugins
3182 if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
3183     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3184         if [ "$PLATFORM_MAC" = "yes" ]; then
3185             QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins"
3186         fi
3187     fi
3188     [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
3189 fi
3190 QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
3191
3192 #data
3193 if [ -z "$QT_INSTALL_DATA" ]; then #default
3194     QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
3195 fi
3196 QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
3197
3198 #translations
3199 if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
3200     QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
3201 fi
3202 QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
3203
3204 #settings
3205 if [ -z "$QT_INSTALL_SETTINGS" ]; then #default
3206     if [ "$PLATFORM_MAC" = "yes" ]; then
3207         QT_INSTALL_SETTINGS=/Library/Preferences/Qt
3208     else
3209         QT_INSTALL_SETTINGS=/etc/xdg
3210     fi
3211 fi
3212 QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"`
3213
3214 #examples
3215 if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default
3216     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3217         if [ "$PLATFORM_MAC" = "yes" ]; then
3218             QT_INSTALL_EXAMPLES="/Developer/Examples/Qt"
3219         fi
3220     fi
3221     [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback
3222 fi
3223 QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"`
3224
3225 #demos
3226 if [ -z "$QT_INSTALL_DEMOS" ]; then #default
3227     if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3228         if [ "$PLATFORM_MAC" = "yes" ]; then
3229             QT_INSTALL_DEMOS="/Developer/Examples/Qt/Demos"
3230         fi
3231     fi
3232     [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos"
3233 fi
3234 QT_INSTALL_DEMOS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DEMOS"`
3235
3236 #-------------------------------------------------------------------------------
3237 # help - interactive parts of the script _after_ this section please
3238 #-------------------------------------------------------------------------------
3239
3240 # next, emit a usage message if something failed.
3241 if [ "$OPT_HELP" = "yes" ]; then
3242     [ "x$ERROR" = "xyes" ] && echo
3243     if [ "$CFG_NIS" = "no" ]; then
3244         NSY=" "
3245         NSN="*"
3246     else
3247         NSY="*"
3248         NSN=" "
3249     fi
3250     if [ "$CFG_CUPS" = "no" ]; then
3251         CUY=" "
3252         CUN="*"
3253     else
3254         CUY="*"
3255         CUN=" "
3256     fi
3257     if [ "$CFG_ICONV" = "no" ]; then
3258         CIY=" "
3259         CIN="*"
3260     else
3261         CIY="*"
3262         CIN=" "
3263     fi
3264     if [ "$CFG_LARGEFILE" = "no" ]; then
3265         LFSY=" "
3266         LFSN="*"
3267     else
3268         LFSY="*"
3269         LFSN=" "
3270     fi
3271     if [ "$CFG_STL" = "auto" ] || [ "$CFG_STL" = "yes" ]; then
3272         SHY="*"
3273         SHN=" "
3274     else
3275         SHY=" "
3276         SHN="*"
3277     fi
3278     if [ "$CFG_IPV6" = "auto" ]; then
3279         I6Y="*"
3280         I6N=" "
3281     fi
3282     if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then
3283         PHY=" "
3284         PHN="*"
3285     else
3286         PHY="*"
3287         PHN=" "
3288     fi
3289
3290     cat <<EOF
3291 Usage:  $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
3292         [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-datadir <dir>]
3293         [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>]
3294         [-demosdir <dir>] [-buildkey <key>] [-release] [-debug]
3295         [-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
3296         [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]
3297         [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>]
3298         [-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support] [-qt3support]
3299         [-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
3300         [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff]
3301         [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng]
3302         [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>]
3303         [-nomake <part>] [-R <string>]  [-l <string>] [-no-rpath]  [-rpath] [-continue]
3304         [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
3305         [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked]
3306         [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]
3307         [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info] [-armfpa]
3308         [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns]
3309         [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend]
3310         [-no-audio-backend] [-audio-backend] [-no-openssl] [-openssl] [-openssl-linked]
3311         [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-javascript-jit] [-javascript-jit]
3312         [-no-script] [-script] [-no-scripttools] [-scripttools] [-no-declarative] [-declarative]
3313
3314         [additional platform specific options (see below)]
3315
3316
3317 Installation options:
3318
3319  These are optional, but you may specify install directories.
3320
3321     -prefix <dir> ...... This will install everything relative to <dir>
3322                          (default $QT_INSTALL_PREFIX)
3323 EOF
3324 if [ "$PLATFORM_QWS" = "yes" ]; then
3325 cat <<EOF
3326
3327     -hostprefix [dir] .. Tools and libraries needed when developing
3328                          applications are installed in [dir]. If [dir] is
3329                          not given, the current build directory will be used.
3330 EOF
3331 fi
3332 cat <<EOF
3333
3334   * -prefix-install .... Force a sandboxed "local" installation of
3335                          Qt. This will install into
3336                          $QT_INSTALL_PREFIX, if this option is
3337                          disabled then some platforms will attempt a
3338                          "system" install by placing default values to
3339                          be placed in a system location other than
3340                          PREFIX.
3341
3342  You may use these to separate different parts of the install:
3343
3344     -bindir <dir> ......... Executables will be installed to <dir>
3345                             (default PREFIX/bin)
3346     -libdir <dir> ......... Libraries will be installed to <dir>
3347                             (default PREFIX/lib)
3348     -docdir <dir> ......... Documentation will be installed to <dir>
3349                             (default PREFIX/doc)
3350     -headerdir <dir> ...... Headers will be installed to <dir>
3351                             (default PREFIX/include)
3352     -plugindir <dir> ...... Plugins will be installed to <dir>
3353                             (default PREFIX/plugins)
3354     -datadir <dir> ........ Data used by Qt programs will be installed to <dir>
3355                             (default PREFIX)
3356     -translationdir <dir> . Translations of Qt programs will be installed to <dir>
3357                             (default PREFIX/translations)
3358     -sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>
3359                             (default PREFIX/etc/settings)
3360     -examplesdir <dir> .... Examples will be installed to <dir>
3361                             (default PREFIX/examples)
3362     -demosdir <dir> ....... Demos will be installed to <dir>
3363                             (default PREFIX/demos)
3364
3365  You may use these options to turn on strict plugin loading.
3366
3367     -buildkey <key> .... Build the Qt library and plugins using the specified
3368                          <key>.  When the library loads plugins, it will only
3369                          load those that have a matching key.
3370
3371 Configure options:
3372
3373  The defaults (*) are usually acceptable. A plus (+) denotes a default value
3374  that needs to be evaluated. If the evaluation succeeds, the feature is
3375  included. Here is a short explanation of each option:
3376
3377  *  -release ........... Compile and link Qt with debugging turned off.
3378     -debug ............. Compile and link Qt with debugging turned on.
3379     -debug-and-release . Compile and link two versions of Qt, with and without
3380                          debugging turned on (Mac only).
3381
3382     -developer-build ... Compile and link Qt with Qt developer options (including auto-tests exporting)
3383
3384     -opensource ........ Compile and link the Open-Source Edition of Qt.
3385     -commercial ........ Compile and link the Commercial Edition of Qt.
3386
3387
3388  *  -shared ............ Create and use shared Qt libraries.
3389     -static ............ Create and use static Qt libraries.
3390
3391  *  -no-fast ........... Configure Qt normally by generating Makefiles for all
3392                          project files.
3393     -fast .............. Configure Qt quickly by generating Makefiles only for
3394                          library and subdirectory targets.  All other Makefiles
3395                          are created as wrappers, which will in turn run qmake.
3396
3397     -no-largefile ...... Disables large file support.
3398  +  -largefile ......... Enables Qt to access files larger than 4 GB.
3399
3400 EOF
3401 if [ "$PLATFORM_QWS" = "yes" ]; then
3402     EXCN="*"
3403     EXCY=" "
3404 else
3405     EXCN=" "
3406     EXCY="*"
3407 fi
3408 if [ "$CFG_DBUS" = "no" ]; then
3409     DBY=" "
3410     DBN="+"
3411 else
3412     DBY="+"
3413     DBN=" "
3414 fi
3415
3416     cat << EOF
3417  $EXCN  -no-exceptions ..... Disable exceptions on compilers that support it.
3418  $EXCY  -exceptions ........ Enable exceptions on compilers that support it.
3419
3420     -no-accessibility .. Do not compile Accessibility support.
3421  *  -accessibility ..... Compile Accessibility support.
3422
3423  $SHN  -no-stl ............ Do not compile STL support.
3424  $SHY  -stl ............... Compile STL support.
3425
3426     -no-sql-<driver> ... Disable SQL <driver> entirely.
3427     -qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default
3428                          none are turned on.
3429     -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to
3430                          at run time.
3431
3432                          Possible values for <driver>:
3433                          [ $CFG_SQL_AVAILABLE ]
3434
3435     -system-sqlite ..... Use sqlite from the operating system.
3436
3437     -no-qt3support ..... Disables the Qt 3 support functionality.
3438  *  -qt3support ........ Enables the Qt 3 support functionality.
3439
3440     -no-xmlpatterns .... Do not build the QtXmlPatterns module.
3441  +  -xmlpatterns ....... Build the QtXmlPatterns module.
3442                          QtXmlPatterns is built if a decent C++ compiler
3443                          is used and exceptions are enabled.
3444
3445     -no-multimedia ..... Do not build the QtMultimedia module.
3446  +  -multimedia ........ Build the QtMultimedia module.
3447
3448     -no-audio-backend .. Do not build the platform audio backend into QtMultimedia.
3449  +  -audio-backend ..... Build the platform audio backend into QtMultimedia if available.
3450
3451     -no-phonon ......... Do not build the Phonon module.
3452  +  -phonon ............ Build the Phonon module.
3453                          Phonon is built if a decent C++ compiler is used.
3454     -no-phonon-backend.. Do not build the platform phonon plugin.
3455  +  -phonon-backend..... Build the platform phonon plugin.
3456
3457     -no-svg ............ Do not build the SVG module.
3458  +  -svg ............... Build the SVG module.
3459
3460     -no-webkit ......... Do not build the WebKit module.
3461  +  -webkit ............ Build the WebKit module.
3462                          WebKit is built if a decent C++ compiler is used.
3463
3464     -no-javascript-jit . Do not build the JavaScriptCore JIT compiler.
3465  +  -javascript-jit .... Build the JavaScriptCore JIT compiler.
3466
3467     -no-script ......... Do not build the QtScript module.
3468  +  -script ............ Build the QtScript module.
3469
3470     -no-scripttools .... Do not build the QtScriptTools module.
3471  +  -scripttools ....... Build the QtScriptTools module.
3472
3473  +  -no-declarative .....Do not build the declarative module.
3474     -declarative ....... Build the declarative module.
3475
3476     -platform target ... The operating system and compiler you are building
3477                          on ($PLATFORM).
3478
3479                          See the README file for a list of supported
3480                          operating systems and compilers.
3481 EOF
3482 if [ "${PLATFORM_QWS}" != "yes" ]; then
3483 cat << EOF
3484     -graphicssystem <sys> Sets an alternate graphics system. Available options are:
3485                            raster - Software rasterizer
3486                            opengl - Rendering via OpenGL, Experimental!
3487 EOF
3488 fi
3489 cat << EOF
3490
3491     -no-mmx ............ Do not compile with use of MMX instructions.
3492     -no-3dnow .......... Do not compile with use of 3DNOW instructions.
3493     -no-sse ............ Do not compile with use of SSE instructions.
3494     -no-sse2 ........... Do not compile with use of SSE2 instructions.
3495
3496     -qtnamespace <name>  Wraps all Qt library code in 'namespace <name> {...}'.
3497     -qtlibinfix <infix>  Renames all libQt*.so to libQt*<infix>.so.
3498
3499     -D <string> ........ Add an explicit define to the preprocessor.
3500     -I <string> ........ Add an explicit include path.
3501     -L <string> ........ Add an explicit library path.
3502
3503     -help, -h .......... Display this information.
3504
3505 Third Party Libraries:
3506
3507     -qt-zlib ........... Use the zlib bundled with Qt.
3508  +  -system-zlib ....... Use zlib from the operating system.
3509                          See http://www.gzip.org/zlib
3510
3511     -no-gif ............ Do not compile the plugin for GIF reading support.
3512  *  -qt-gif ............ Compile the plugin for GIF reading support.
3513                          See also src/plugins/imageformats/gif/qgifhandler.h
3514
3515     -no-libtiff ........ Do not compile the plugin for TIFF support.
3516     -qt-libtiff ........ Use the libtiff bundled with Qt.
3517  +  -system-libtiff .... Use libtiff from the operating system.
3518                          See http://www.libtiff.org
3519
3520     -no-libpng ......... Do not compile in PNG support.
3521     -qt-libpng ......... Use the libpng bundled with Qt.
3522  +  -system-libpng ..... Use libpng from the operating system.
3523                          See http://www.libpng.org/pub/png
3524
3525     -no-libmng ......... Do not compile the plugin for MNG support.
3526     -qt-libmng ......... Use the libmng bundled with Qt.
3527  +  -system-libmng ..... Use libmng from the operating system.
3528                          See http://www.libmng.com
3529
3530     -no-libjpeg ........ Do not compile the plugin for JPEG support.
3531     -qt-libjpeg ........ Use the libjpeg bundled with Qt.
3532  +  -system-libjpeg .... Use libjpeg from the operating system.
3533                          See http://www.ijg.org
3534
3535     -no-openssl ........ Do not compile support for OpenSSL.
3536  +  -openssl ........... Enable run-time OpenSSL support.
3537     -openssl-linked .... Enabled linked OpenSSL support.
3538
3539     -ptmalloc .......... Override the system memory allocator with ptmalloc.
3540                          (Experimental.)
3541
3542 Additional options:
3543
3544     -make <part> ....... Add part to the list of parts to be built at make time.
3545                          ($QT_DEFAULT_BUILD_PARTS)
3546     -nomake <part> ..... Exclude part from the list of parts to be built.
3547
3548     -R <string> ........ Add an explicit runtime library path to the Qt
3549                          libraries.
3550     -l <string> ........ Add an explicit library.
3551
3552     -no-rpath .......... Do not use the library install path as a runtime
3553                          library path.
3554  +  -rpath ............. Link Qt libraries and executables using the library
3555                          install path as a runtime library path. Equivalent
3556                          to -R install_libpath
3557
3558     -continue .......... Continue as far as possible if an error occurs.
3559
3560     -verbose, -v ....... Print verbose information about each step of the
3561                          configure process.
3562
3563     -silent ............ Reduce the build output so that warnings and errors
3564                          can be seen more easily.
3565
3566  *  -no-optimized-qmake ... Do not build qmake optimized.
3567     -optimized-qmake ...... Build qmake optimized.
3568
3569  $NSN  -no-nis ............ Do not compile NIS support.
3570  $NSY  -nis ............... Compile NIS support.
3571
3572  $CUN  -no-cups ........... Do not compile CUPS support.
3573  $CUY  -cups .............. Compile CUPS support.
3574                          Requires cups/cups.h and libcups.so.2.
3575
3576  $CIN  -no-iconv .......... Do not compile support for iconv(3).
3577  $CIY  -iconv ............. Compile support for iconv(3).
3578
3579  $PHN  -no-pch ............ Do not use precompiled header support.
3580  $PHY  -pch ............... Use precompiled header support.
3581
3582  $DBN  -no-dbus ........... Do not compile the QtDBus module.
3583  $DBY  -dbus .............. Compile the QtDBus module and dynamically load libdbus-1.
3584     -dbus-linked ....... Compile the QtDBus module and link to libdbus-1.
3585
3586     -reduce-relocations ..... Reduce relocations in the libraries through extra
3587                               linker optimizations (Qt/X11 and Qt for Embedded Linux only;
3588                               experimental; needs GNU ld >= 2.18).
3589 EOF
3590
3591 if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
3592     if [ "$QT_CROSS_COMPILE" = "yes" ]; then
3593         SBY=""
3594         SBN="*"
3595     else
3596         SBY="*"
3597         SBN=" "
3598     fi
3599 elif [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
3600     SBY="*"
3601     SBN=" "
3602 else
3603     SBY=" "
3604     SBN="*"
3605 fi
3606
3607 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
3608
3609     cat << EOF
3610
3611  $SBN  -no-separate-debug-info . Do not store debug information in a separate file.
3612  $SBY  -separate-debug-info .... Strip debug information into a separate .debug file.
3613
3614 EOF
3615
3616 fi # X11/QWS
3617
3618 if [ "$PLATFORM_X11" = "yes" ]; then
3619     if [ "$CFG_SM" = "no" ]; then
3620         SMY=" "
3621         SMN="*"
3622     else
3623         SMY="*"
3624         SMN=" "
3625     fi
3626     if [ "$CFG_XSHAPE" = "no" ]; then
3627         SHY=" "
3628         SHN="*"
3629     else
3630         SHY="*"
3631         SHN=" "
3632     fi
3633     if [ "$CFG_XINERAMA" = "no" ]; then
3634         XAY=" "
3635         XAN="*"
3636     else
3637         XAY="*"
3638         XAN=" "
3639     fi
3640     if [ "$CFG_FONTCONFIG" = "no" ]; then
3641         FCGY=" "
3642         FCGN="*"
3643     else
3644         FCGY="*"
3645         FCGN=" "
3646     fi
3647     if [ "$CFG_XCURSOR" = "no" ]; then
3648         XCY=" "
3649         XCN="*"
3650     else
3651         XCY="*"
3652         XCN=" "
3653     fi
3654     if [ "$CFG_XFIXES" = "no" ]; then
3655         XFY=" "
3656         XFN="*"
3657     else
3658         XFY="*"
3659         XFN=" "
3660     fi
3661     if [ "$CFG_XRANDR" = "no" ]; then
3662         XZY=" "
3663         XZN="*"
3664     else
3665         XZY="*"
3666         XZN=" "
3667     fi
3668     if [ "$CFG_XRENDER" = "no" ]; then
3669         XRY=" "
3670         XRN="*"