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