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