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