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