#!/bin/sh # # Configures to build the Qt library # # Copyright (C) 1999-2007 Trolltech ASA. All rights reserved. # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # #------------------------------------------------------------------------------- # script initialization #------------------------------------------------------------------------------- # the name of this script relconf=`basename $0` # the directory of this script is the "source tree" relpath=`dirname $0` relpath=`(cd "$relpath"; /bin/pwd)` # the current directory is the "build tree" or "object tree" outpath=`/bin/pwd` #license file location LICENSE_FILE="$QT_LICENSE_FILE" [ -z "$LICENSE_FILE" ] && LICENSE_FILE="$HOME/.qt-license" if [ -f "$LICENSE_FILE" ]; then tr -d '\r' <"$LICENSE_FILE" >"${LICENSE_FILE}.tmp" diff "${LICENSE_FILE}.tmp" "${LICENSE_FILE}" >/dev/null 2>&1 || LICENSE_FILE="${LICENSE_FILE}.tmp" fi # later cache the command line in config.status OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"` # initialize global variables QMAKE_SWITCHES= QMAKE_VARS= QMAKE_CONFIG= QTCONFIG_CONFIG= QT_CONFIG= SUPPORTED= QMAKE_VARS_FILE=.qmake.vars exec 5> "$QMAKE_VARS_FILE" #------------------------------------------------------------------------------- # utility functions #------------------------------------------------------------------------------- # Adds a new qmake variable to the cache # Usage: QMakeVar mode varname contents # where mode is one of: set, add, del QMakeVar() { case "$1" in set) eq="=" ;; add) eq="+=" ;; del) eq="-=" ;; *) echo >&2 "BUG: wrong command to QMakeVar: $1" ;; esac echo >&5 "$2" "$eq" "$3" } # relies on $QMAKESPEC being set correctly. parses include statements in # qmake.conf and prints out the expanded file getQMakeConf() { tmpSPEC="$QMAKESPEC" if [ -n "$1" ]; then tmpSPEC="$1" fi $AWK -v "QMAKESPEC=$tmpSPEC" ' /^include\(.+\)$/{ fname = QMAKESPEC "/" substr($0, 9, length($0) - 9) while ((getline line < fname) > 0) print line close(fname) next } { print }' "$tmpSPEC/qmake.conf" } #------------------------------------------------------------------------------- # operating system detection #------------------------------------------------------------------------------- # need that throughout the script UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown #------------------------------------------------------------------------------- # window system detection #------------------------------------------------------------------------------- PLATFORM_X11=no PLATFORM_MAC=no PLATFORM_QWS=no if [ -f "$relpath"/src/gui/kernel/qapplication_mac.cpp ] && [ -d /System/Library/Frameworks/Carbon.framework ]; then # Qt/Mac # ~ the Carbon SDK exists # ~ src/gui/base/qapplication_mac.cpp is present # ~ this is the internal edition and Qt/Mac sources exist PLATFORM_MAC=maybe elif [ -f "$relpath"/src/gui/kernel/qapplication_qws.cpp ]; then # Qtopia Core # ~ src/gui/base/qapplication_qws.cpp is present # ~ this is the free or commercial edition # ~ this is the internal edition and Qtopia Core is explicitly enabled PLATFORM_QWS=maybe fi #----------------------------------------------------------------------------- # Qt version detection #----------------------------------------------------------------------------- QT_VERSION=`grep '^# *define *QT_VERSION_STR' "$relpath"/src/corelib/global/qglobal.h` QT_MAJOR_VERSION= QT_MINOR_VERSION=0 QT_PATCH_VERSION=0 if [ -n "$QT_VERSION" ]; then QT_VERSION=`echo $QT_VERSION | sed 's,^# *define *QT_VERSION_STR "*\([^ ]*\)"$,\1,'` MAJOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'` if [ -n "$MAJOR" ]; then MINOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'` PATCH=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'` QT_MAJOR_VERSION="$MAJOR" [ -z "$MINOR" ] || QT_MINOR_VERSION="$MINOR" [ -z "$PATCH" ] || QT_PATCH_VERSION="$PATCH" fi fi if [ -z "$QT_MAJOR_VERSION" ]; then echo "Cannot process version from qglobal.h: $QT_VERSION" echo "Cannot proceed." exit 1 fi QT_PACKAGEDATE=`grep '^# *define *QT_PACKAGEDATE_STR' "$relpath"/src/corelib/global/qglobal.h | sed -e 's,^# *define *QT_PACKAGEDATE_STR *"\([^ ]*\)"$,\1,' -e s,-,,g` if [ -z "$QT_PACKAGEDATE" ]; then echo "Unable to determine package date from qglobal.h: '$QT_PACKAGEDATE'" echo "Cannot proceed" exit 1 fi #------------------------------------------------------------------------------- # check the license #------------------------------------------------------------------------------- if [ -f "$relpath"/LICENSE.Qtopia ]; then # Qtopia Edition [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes Licensee="Qtopia" Edition="Qtopia" QT_EDITION="QT_EDITION_DESKTOP" elif [ -f "$relpath"/LICENSE.QPL -o -f "$relpath"/LICENSE.GPL ]; then # Open Source edition - may only be used under the terms of the QPL or GPL. [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=yes Licensee="Open Source" Edition="OpenSource" EditionString="Open Source" QT_EDITION="QT_EDITION_OPENSOURCE" elif [ -f "$relpath"/LICENSE.PREVIEW.OPENSOURCE ]; then # tech preview - opensource [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=yes Licensee="Preview" Edition="Preview" QT_EDITION="QT_EDITION_OPENSOURCE" elif [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ]; then # tech preview - commercial [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=yes Licensee="Preview" Edition="Preview" QT_EDITION="QT_EDITION_DESKTOP" elif [ -f "$relpath"/LICENSE.SNAPSHOT.COMMERCIAL ]; then # snapshot - commercial [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=yes Licensee="Snapshot" Edition="Snapshot" QT_EDITION="QT_EDITION_DESKTOP" elif [ -f "$relpath"/LICENSE.SNAPSHOT.OPENSOURCE ]; then # snapshot - opensource [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=yes Licensee="Snapshot" Edition="Snapshot" QT_EDITION="QT_EDITION_OPENSOURCE" elif [ -f "$relpath"/LICENSE.TROLL ]; then # internal Trolltech edition [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes Licensee="Trolltech" Edition="Trolltech" QT_EDITION="QT_EDITION_DESKTOP" else # one of commercial editions [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=yes # read in the license file if [ -f "$LICENSE_FILE" ]; then . "$LICENSE_FILE" >/dev/null 2>&1 if [ -z "$LicenseKeyExt" ]; then echo echo "You are using an old license file." echo echo "Please install the license file supplied by Trolltech," echo "or install the Qt Open Source Edition if you intend to" echo "develop free software." exit 1 fi if [ -z "$Licensee" ]; then echo echo "Invalid license key. Please check the license key." exit 1 fi else if [ -z "$LicenseKeyExt" ]; then echo if echo '\c' | grep '\c' >/dev/null; then echo -n "Please enter your license key: " else echo "Please enter your license key: \c" fi read LicenseKeyExt Licensee="Unknown user" fi fi # Key verification echo "$LicenseKeyExt" | grep ".....*-....*-....*-....*-.....*-.....*-...." >/dev/null 2>&1 \ && LicenseValid="yes" \ || LicenseValid="no" if [ "$LicenseValid" != "yes" ]; then echo echo "Invalid license key. Please check the license key." exit 1 fi ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1` PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d - | cut -b 1` LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -` LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1` # determine which edition we are licensed to use case "$LicenseTypeCode" in F4M) LicenseType="Commercial" case $ProductCode in F) Edition="Universal" QT_EDITION="QT_EDITION_UNIVERSAL" ;; B) Edition="Desktop" QT_EDITION="QT_EDITION_DESKTOP" ;; L) Edition="DesktopLight" EditionString="Desktop Light" QT_EDITION="QT_EDITION_DESKTOPLIGHT" ;; R) Edition="Console" QT_EDITION="QT_EDITION_CONSOLE" ;; esac ;; Z4M|R4M|Q4M) LicenseType="Evaluation" case $ProductCode in B) Edition="Evaluation" QT_EDITION="QT_EDITION_EVALUATION" ;; esac ;; 34M) LicenseType="Academic" case $ProductCode in B) Edition="Academic" QT_EDITION="QT_EDITION_ACADEMIC" ;; esac ;; TBM) LicenseType="Educational" case $ProductCode in B) Edition="Educational" QT_EDITION="QT_EDITION_EDUCATIONAL" ;; esac ;; esac if [ -z "$LicenseType" -o -z "$Edition" -o -z "$QT_EDITION" ]; then echo echo "Invalid license key. Please check the license key." exit 1 fi # verify that we are licensed to use Qt on this platform LICENSE_EXTENSION= if [ "$PLATFORM_QWS" = "yes" ]; then case $PlatformCode in 4|8|V|P|G|Q|2|B) LICENSE_EXTENSION="-QTOPIACORE" # Qtopia Core ;; *) echo echo "You are not licensed for Qtopia Core." echo echo "Please contact sales@trolltech.com to upgrade your license" echo "to include Qtopia Core, or install the" echo "Qt Open Source Edition if you intend to develop free software." exit 1 ;; esac elif [ "$PLATFORM_MAC" = "yes" ]; then case $PlatformCode in 4|L|5|G|Y|2|F|B) # Qt/Mac ;; *) echo echo "You are not licensed for the Qt/Mac platform." echo echo "Please contact sales@trolltech.com to upgrade your license" echo "to include the Qt/Mac platform." exit 1 ;; esac else case $PlatformCode in 4|Z|V|T|5|Q|2|F) # Qt/X11 ;; *) echo echo "You are not licensed for the Qt/X11 platform." echo echo "Please contact sales@trolltech.com to upgrade your license to" echo "include the Qt/X11 platform, or install the Qt Open Source Edition" echo "if you intend to develop free software." exit 1 ;; esac fi case "$LicenseFeatureCode" in G|L) # US case "$LicenseType" in Commercial) cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-US" "$outpath/LICENSE" ;; Evaluation) cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-EVALUATION-US" "$outpath/LICENSE" ;; Academic) cp -f "$relpath/.LICENSE-ACADEMIC-US" "$outpath/LICENSE" ;; Educational) cp -f "$relpath/.LICENSE-EDUCATIONAL-US" "$outpath/LICENSE" ;; esac ;; 2|5) # non-US case "$LicenseType" in Commercial) cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}" "$outpath/LICENSE" ;; Evaluation) cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-EVALUATION" "$outpath/LICENSE" ;; Academic) cp -f "$relpath/.LICENSE-ACADEMIC" "$outpath/LICENSE" ;; Educational) cp -f "$relpath/.LICENSE-EDUCATIONAL" "$outpath/LICENSE" ;; esac ;; *) echo echo "Invalid license key. Please check the license key." exit 1 ;; esac case "$LicenseFeatureCode" in G|2) # delete qtusagereporter for non-metered licenses rm -f "$relpath/bin/qtusagereporter" ;; L|5) # copy qtusagereporter for metered licenses if [ '!' -f "$outpath/bin/qtusagereporter" ]; then mkdir -p "$outpath/bin" cp -f "$relpath/bin/qtusagereporter" "$outpath/bin/qtusagereporter" fi QT_CONFIG="$QT_CONFIG qtusagereporter" ;; *) echo echo "Invalid license key. Please check the license key." exit 1 ;; esac if [ '!' -f "$outpath/LICENSE" ]; then echo "The LICENSE, LICENSE.QPL, or LICENSE.GPL file shipped with" echo "this software has disappeared." echo echo "Sorry, you are not licensed to use this software." echo "Try re-installing." echo exit 1 fi fi if [ "$PLATFORM_QWS" = "yes" ]; then Platform="Qtopia Core" elif [ "$PLATFORM_MAC" = "yes" ]; then Platform="Qt/Mac" else PLATFORM_X11=yes Platform="Qt/X11" fi echo echo "This is the $Platform ${EditionString-$Edition} Edition." echo #------------------------------------------------------------------------------- # initalize variables #------------------------------------------------------------------------------- SYSTEM_VARIABLES="CC CXX CFLAGS CXXFLAGS LDFLAGS" for varname in $SYSTEM_VARIABLES; do cmd=`echo \ 'if [ -n "\$'${varname}'" ]; then QMakeVar set QMAKE_'${varname}' "\$'${varname}'" fi'` eval "$cmd" done # Use CC/CXX to run config.tests mkdir -p "$outpath/config.tests" rm -f "$outpath/config.tests/.qmake.cache" cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache" QMakeVar add styles "cde mac motif plastique cleanlooks windows" QMakeVar add decorations "default windows styled" QMakeVar add gfx-drivers "linuxfb" QMakeVar add kbd-drivers "tty" QMakeVar add mouse-drivers "pc linuxtp" if [ "$Edition" = "Trolltech" ]; then QMakeVar add kbd-drivers "um" fi # QTDIR may be set and point to an old or system-wide Qt installation unset QTDIR # the minimum version of libdbus-1 that we require: MIN_DBUS_1_VERSION=0.62 # initalize internal variables CFG_CONFIGURE_EXIT_ON_ERROR=yes CFG_PROFILE=no CFG_EXCEPTIONS=unspecified CFG_INCREMENTAL=auto CFG_QCONFIG=full CFG_EMBEDDED=no CFG_DEBUG=auto CFG_MYSQL_CONFIG= CFG_DEBUG_RELEASE=no CFG_SHARED=yes CFG_SM=auto CFG_XSHAPE=auto CFG_XINERAMA=auto CFG_ZLIB=auto CFG_SQLITE=qt CFG_GIF=auto CFG_TIFF=auto CFG_LIBTIFF=auto CFG_PNG=yes CFG_LIBPNG=auto CFG_JPEG=auto CFG_LIBJPEG=auto CFG_MNG=auto CFG_LIBMNG=auto CFG_XCURSOR=auto CFG_XRANDR=auto CFG_XRENDER=auto CFG_OPENGL=auto CFG_SSE=auto CFG_FONTCONFIG=auto CFG_QWS_FREETYPE=auto CFG_LIBFREETYPE=auto CFG_SQL_AVAILABLE= QT_DEFAULT_BUILD_PARTS="libs tools examples demos" CFG_BUILD_PARTS="" CFG_NOBUILD_PARTS="" CFG_RELEASE_QMAKE=no CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen" CFG_GFX_ON="linuxfb multiscreen" CFG_GFX_PLUGIN_AVAILABLE= CFG_GFX_PLUGIN= CFG_GFX_OFF= CFG_KBD_AVAILABLE="tty usb sl5000 yopy vr41xx qvfb" CFG_KBD_ON="tty" #default, see QMakeVar above CFG_MOUSE_AVAILABLE="pc bus linuxtp yopy vr41xx tslib qvfb" CFG_MOUSE_ON="pc linuxtp" #default, see QMakeVar above if [ "$Edition" = "Trolltech" ]; then CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} um" CFG_KBD_ON="${CFG_KBD_ON} um" fi CFG_KBD_OFF= CFG_MOUSE_PLUGIN_AVAILABLE= CFG_MOUSE_PLUGIN= CFG_MOUSE_OFF= CFG_USE_GNUMAKE=no CFG_IM=yes CFG_DECORATION_AVAILABLE="styled windows default" CFG_DECORATION_ON="${CFG_DECORATION_AVAILABLE}" # all on by default CFG_DECORATION_PLUGIN_AVAILABLE= CFG_DECORATION_PLUGIN= CFG_TABLET=auto CFG_XKB=auto CFG_NIS=auto CFG_CUPS=auto CFG_ICONV=auto CFG_QDBUS=auto CFG_GLIB=auto CFG_LARGEFILE=auto CFG_OPENSSL=auto CFG_STL=auto CFG_PRECOMPILE=auto CFG_SEPARATE_DEBUG_INFO=auto CFG_REDUCE_EXPORTS=auto CFG_MMX=auto CFG_3DNOW=auto CFG_SSE=auto CFG_SSE2=auto CFG_REDUCE_RELOCATIONS=no CFG_IPV6=auto CFG_NAS=no CFG_QWS_DEPTHS=prompted CFG_USER_BUILD_KEY= CFG_ACCESSIBILITY=auto CFG_QT3SUPPORT=yes CFG_ENDIAN=auto CFG_DOUBLEFORMAT=auto CFG_ARMFPA=auto CFG_IWMMXT=no CFG_CLOCK_MONOTONIC=auto CFG_MREMAP=auto CFG_GETADDRINFO=auto CFG_IPV6IFNAME=auto CFG_GETIFADDRS=auto CFG_INOTIFY=auto CFG_RPATH=yes CFG_FRAMEWORK=auto CFG_MAC_ARCHS= CFG_MAC_DWARF2=no CFG_SXE=no CFG_PREFIX_INSTALL=yes CFG_SDK= D_FLAGS= I_FLAGS= L_FLAGS= RPATH_FLAGS= l_FLAGS= QCONFIG_FLAGS= XPLATFORM= PLATFORM=$QMAKESPEC OPT_CONFIRM_LICENSE=no OPT_SHADOW=maybe OPT_FAST=auto OPT_VERBOSE=no OPT_HELP= CFG_SILENT=no # initalize variables used for installation QT_INSTALL_PREFIX= QT_INSTALL_DOCS= QT_INSTALL_HEADERS= QT_INSTALL_LIBS= QT_INSTALL_BINS= QT_INSTALL_PLUGINS= QT_INSTALL_DATA= QT_INSTALL_TRANSLATIONS= QT_INSTALL_SETTINGS= QT_INSTALL_EXAMPLES= QT_INSTALL_DEMOS= #flags for SQL drivers QT_CFLAGS_PSQL= QT_LFLAGS_PSQL= QT_CFLAGS_MYSQL= QT_LFLAGS_MYSQL= QT_LFLAGS_MYSQL_R= QT_CFLAGS_SQLITE= QT_LFLAGS_SQLITE= # flags for libdbus-1 QT_CFLAGS_DBUS= QT_LIBS_DBUS= # flags for Glib (X11 only) QT_CFLAGS_GLIB= QT_LIBS_GLIB= #------------------------------------------------------------------------------- # check SQL drivers, mouse drivers and decorations available in this package #------------------------------------------------------------------------------- # opensource version removes some drivers, so force them to be off CFG_SQL_tds=no CFG_SQL_oci=no CFG_SQL_db2=no CFG_SQL_AVAILABLE= if [ -d "$relpath/src/plugins/sqldrivers" ]; then for a in "$relpath/src/plugins/sqldrivers/"*; do if [ -d "$a" ]; then base_a=`basename $a` CFG_SQL_AVAILABLE="${CFG_SQL_AVAILABLE} ${base_a}" eval "CFG_SQL_${base_a}=auto" fi done fi CFG_DECORATION_PLUGIN_AVAILABLE= if [ -d "$relpath/src/plugins/decorations" ]; then for a in "$relpath/src/plugins/decorations/"*; do if [ -d "$a" ]; then base_a=`basename $a` CFG_DECORATION_PLUGIN_AVAILABLE="${CFG_DECORATION_PLUGIN_AVAILABLE} ${base_a}" fi done fi CFG_MOUSE_PLUGIN_AVAILABLE= if [ -d "$relpath/src/plugins/mousedrivers" ]; then for a in "$relpath/src/plugins/mousedrivers/"*; do if [ -d "$a" ]; then base_a=`basename $a` CFG_MOUSE_PLUGIN_AVAILABLE="${CFG_MOUSE_PLUGIN_AVAILABLE} ${base_a}" fi done fi CFG_GFX_PLUGIN_AVAILABLE= if [ -d "$relpath/src/plugins/gfxdrivers" ]; then for a in "$relpath/src/plugins/gfxdrivers/"*; do if [ -d "$a" ]; then base_a=`basename $a` CFG_GFX_PLUGIN_AVAILABLE="${CFG_GFX_PLUGIN_AVAILABLE} ${base_a}" fi done CFG_GFX_OFF="$CFG_GFX_AVAILABLE" # assume all off fi #------------------------------------------------------------------------------- # parse command line arguments #------------------------------------------------------------------------------- # parse the arguments, setting things to "yes" or "no" while [ "$#" -gt 0 ]; do CURRENT_OPT="$1" UNKNOWN_ARG=no case "$1" in #Autoconf style options --enable-*) VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"` VAL=yes ;; --disable-*) VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"` VAL=no ;; --*=*) VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"` VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"` ;; --no-*) VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"` VAL=no ;; --*) VAR=`echo $1 | sed "s,^--\(.*\),\1,"` VAL=yes ;; #Qt plugin options -no-*-*|-plugin-*-*|-qt-*-*) VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"` VAL=`echo $1 | sed "s,^-\([^-]*\).*,\1,"` ;; #Qt style no options -no-*) VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"` VAL=no ;; #Qt style yes options -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-tablet|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-fontconfig|-xkb|-nis|-qdbus|-glib|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-opengl|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; #Qt style options that pass an argument -qconfig) if [ "$PLATFORM_QWS" = "yes" ]; then CFG_QCONFIG="$VAL" VAR=`echo $1 | sed "s,^-\(.*\),\1,"` shift VAL=$1 else UNKNOWN_ARG=yes fi ;; -prefix|-docdir|-headerdir|-plugindir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-mysql_config) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` shift VAL="$1" ;; #Qt style complex options in one command -enable-*|-disable-*) VAR=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"` VAL=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"` ;; #Qt Builtin/System style options -no-*|-system-*|-qt-*) VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"` VAL=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"` ;; #Options that cannot be generalized -k|-continue) VAR=fatal_error VAL=no ;; -embedded) VAR=embedded # this option may or may not be followed by an argument if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then VAL=auto else shift; VAL=$1 fi ;; -iwmmxt) CFG_IWMMXT="yes" ;; -*-endian) VAR=endian VAL=`echo $1 | sed "s,^-\(.*\)-.*,\1,"` ;; -D?*|-D) VAR="add_define" if [ "$1" = "-D" ]; then shift VAL="$1" else VAL=`echo $1 | sed 's,-D,,'` fi ;; -I?*|-I) VAR="add_ipath" if [ "$1" = "-I" ]; then shift VAL="$1" else VAL=`echo $1 | sed 's,-I,,'` fi ;; -L?*|-L) VAR="add_lpath" if [ "$1" = "-L" ]; then shift VAL="$1" else VAL=`echo $1 | sed 's,-L,,'` fi ;; -R?*|-R) VAR="add_rpath" if [ "$1" = "-R" ]; then shift VAL="$1" else VAL=`echo $1 | sed 's,-R,,'` fi ;; -l?*) VAR="add_link" VAL=`echo $1 | sed 's,-l,,'` ;; -F?*|-F) VAR="add_fpath" if [ "$1" = "-F" ]; then shift VAL="$1" else VAL=`echo $1 | sed 's,-F,,'` fi ;; -fw?*|-fw) VAR="add_framework" if [ "$1" = "-fw" ]; then shift VAL="$1" else VAL=`echo $1 | sed 's,-fw,,'` fi ;; -*) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL="unknown" ;; *) UNKNOWN_ARG=yes ;; esac if [ "$UNKNOWN_ARG" = "yes" ]; then echo "$1: unknown argument" OPT_HELP=yes ERROR=yes shift continue fi shift UNKNOWN_OPT=no case "$VAR" in qt3support) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_QT3SUPPORT="$VAL" else UNKNOWN_OPT=yes fi ;; accessibility) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_ACCESSIBILITY="$VAL" else UNKNOWN_OPT=yes fi ;; license) LICENSE_FILE="$VAL" ;; gnumake) CFG_USE_GNUMAKE="$VAL" ;; mysql_config) CFG_MYSQL_CONFIG="$VAL" ;; prefix) QT_INSTALL_PREFIX="$VAL" ;; docdir) QT_INSTALL_DOCS="$VAL" ;; headerdir) QT_INSTALL_HEADERS="$VAL" ;; plugindir) QT_INSTALL_PLUGINS="$VAL" ;; datadir) QT_INSTALL_DATA="$VAL" ;; libdir) QT_INSTALL_LIBS="$VAL" ;; translationdir) QT_INSTALL_TRANSLATIONS="$VAL" ;; sysconfdir|settingsdir) QT_INSTALL_SETTINGS="$VAL" ;; examplesdir) QT_INSTALL_EXAMPLES="$VAL" ;; demosdir) QT_INSTALL_DEMOS="$VAL" ;; qconfig) CFG_QCONFIG="$VAL" ;; bindir) QT_INSTALL_BINS="$VAL" ;; buildkey) CFG_USER_BUILD_KEY="$VAL" ;; sxe) CFG_SXE="$VAL" ;; embedded) CFG_EMBEDDED="$VAL" if [ "$PLATFORM_QWS" != "no" ]; then if [ "$PLATFORM_QWS" = "maybe" ]; then PLATFORM_X11=no PLATFORM_MAC=no PLATFORM_QWS=yes fi else echo "No license exists to enable Qtopia Core. Disabling." CFG_EMBEDDED=no fi ;; sse) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_SSE="$VAL" else UNKNOWN_OPT=yes fi ;; endian) if [ "$VAL" = "little" ]; then CFG_ENDIAN="Q_LITTLE_ENDIAN" elif [ "$VAL" = "big" ]; then CFG_ENDIAN="Q_BIG_ENDIAN" else UNKNOWN_OPT=yes fi ;; armfpa) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_ARMFPA="$VAL" else UNKNOWN_OPT=yes fi ;; depths) CFG_QWS_DEPTHS="$VAL" ;; opengl) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_OPENGL="$VAL" else UNKNOWN_OPT=yes fi ;; qvfb) # left for commandline compatibility, not documented if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then if [ "$VAL" = "yes" ]; then QMakeVar add gfx-drivers qvfb QMakeVar add kbd-drivers qvfb QMakeVar add mouse-drivers qvfb CFG_GFX_ON="$CFG_GFX_ON qvfb" CFG_KBD_ON="$CFG_KBD_ON qvfb" CFG_MOUSE_ON="$CFG_MOUSE_ON qvfb" fi else UNKNOWN_OPT=yes fi ;; nomake) CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL" ;; make) CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL" ;; x11) if [ "$Edition" = "Trolltech" ] && [ "$VAL" = "yes" ]; then if [ "$PLATFORM_MAC" = "yes" ]; then PLATFORM_MAC=no elif [ "$PLATFORM_QWS" = "yes" ]; then PLATFORM_QWS=no fi PLATFORM_X11=yes else UNKNOWN_OPT=yes fi ;; sdk) if [ "$PLATFORM_MAC" = "yes" ]; then CFG_SDK="$VAL" else UNKNOWN_OPT=yes fi ;; dwarf2) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_MAC_DWARF2="$VAL" else UNKNOWN_OPT=yes fi ;; arch) if [ "$PLATFORM_MAC" = "yes" ]; then CFG_MAC_ARCHS="$CFG_MAC_ARCHS $VAL" else UNKNOWN_OPT=yes fi ;; universal) if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86 ppc" else UNKNOWN_OPT=yes fi ;; framework) if [ "$PLATFORM_MAC" = "yes" ]; then CFG_FRAMEWORK="$VAL" else UNKNOWN_OPT=yes fi ;; profile) if [ "$VAL" = "yes" ]; then CFG_PROFILE=yes QMakeVar add QMAKE_CFLAGS -pg QMakeVar add QMAKE_CXXFLAGS -pg QMakeVar add QMAKE_LFLAGS -pg QMAKE_VARS="$QMAKE_VARS CONFIG+=nostrip" else UNKNOWN_OPT=yes fi ;; exceptions|g++-exceptions) if [ "$VAL" = "no" ]; then CFG_EXCEPTIONS=no elif [ "$VAL" = "yes" ]; then CFG_EXCEPTIONS=yes else UNKNOWN_OPT=yes fi ;; platform) PLATFORM="$VAL" # keep compatibility with old platform names case $PLATFORM in aix-64) PLATFORM=aix-xlc-64 ;; hpux-o64) PLATFORM=hpux-acc-o64 ;; hpux-n64) PLATFORM=hpux-acc-64 ;; hpux-acc-n64) PLATFORM=hpux-acc-64 ;; irix-n32) PLATFORM=irix-cc ;; irix-64) PLATFORM=irix-cc-64 ;; irix-cc-n64) PLATFORM=irix-cc-64 ;; reliant-64) PLATFORM=reliant-cds-64 ;; solaris-64) PLATFORM=solaris-cc-64 ;; solaris-64) PLATFORM=solaris-cc-64 ;; openunix-cc) PLATFORM=unixware-cc ;; openunix-g++) PLATFORM=unixware-g++ ;; unixware7-cc) PLATFORM=unixware-cc ;; unixware7-g++) PLATFORM=unixware-g++ ;; macx-g++-64) PLATFORM=macx-g++ NATIVE_64_ARCH= case `uname -p` in i386) NATIVE_64_ARCH="x86_64" ;; powerpc) NATIVE_64_ARCH="ppc64" ;; *) echo "WARNING: Can't detect CPU architecture for macx-g++-64" ;; esac if [ ! -z "$NATIVE_64_ARCH" ]; then QTCONFIG_CONFIG="$QTCONFIG_CONFIG $NATIVE_64_ARCH" CFG_MAC_ARCHS="$CFG_MAC_ARCHS $NATIVE_64_ARCH" fi ;; esac ;; xplatform) XPLATFORM="$VAL" ;; debug-and-release) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_DEBUG_RELEASE="$VAL" else UNKNOWN_OPT=yes fi ;; optimized-qmake) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_RELEASE_QMAKE="$VAL" else UNKNOWN_OPT=yes fi ;; release) if [ "$VAL" = "yes" ]; then CFG_DEBUG=no elif [ "$VAL" = "no" ]; then CFG_DEBUG=yes else UNKNOWN_OPT=yes fi ;; prefix-install) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_PREFIX_INSTALL="$VAL" else UNKNOWN_OPT=yes fi ;; debug) CFG_DEBUG="$VAL" ;; static) if [ "$VAL" = "yes" ]; then CFG_SHARED=no elif [ "$VAL" = "no" ]; then CFG_SHARED=yes else UNKNOWN_OPT=yes fi ;; incremental) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_INCREMENTAL="$VAL" else UNKNOWN_OPT=yes fi ;; fatal_error) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_CONFIGURE_EXIT_ON_ERROR="$VAL" else UNKNOWN_OPT=yes fi ;; feature-*) if [ "$PLATFORM_QWS" = "yes" ]; then FEATURE=`echo $VAR | sed "s,^[^-]*-\([^-]*\),\1," | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if [ "$VAL" = "no" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE" elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_$FEATURE" else UNKNOWN_OPT=yes fi else UNKNOWN_OPT=yes fi ;; shared) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_SHARED="$VAL" else UNKNOWN_OPT=yes fi ;; gif) [ "$VAL" = "qt" ] && VAL=yes if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_GIF="$VAL" else UNKNOWN_OPT=yes fi ;; sm) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_SM="$VAL" else UNKNOWN_OPT=yes fi ;; xinerama) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_XINERAMA="$VAL" else UNKNOWN_OPT=yes fi ;; xshape) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_XSHAPE="$VAL" else UNKNOWN_OPT=yes fi ;; tablet) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_TABLET="$VAL" else UNKNOWN_OPT=yes fi ;; stl) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_STL="$VAL" else UNKNOWN_OPT=yes fi ;; pch) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_PRECOMPILE="$VAL" else UNKNOWN_OPT=yes fi ;; separate-debug-info) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_SEPARATE_DEBUG_INFO="$VAL" else UNKNOWN_OPT=yes fi ;; reduce-exports) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_REDUCE_EXPORTS="$VAL" else UNKNOWN_OPT=yes fi ;; mmx) if [ "$VAL" = "no" ]; then CFG_MMX="$VAL" else UNKNOWN_OPT=yes fi ;; 3dnow) if [ "$VAL" = "no" ]; then CFG_3DNOW="$VAL" else UNKNOWN_OPT=yes fi ;; sse) if [ "$VAL" = "no" ]; then CFG_SSE="$VAL" else UNKNOWN_OPT=yes fi ;; sse2) if [ "$VAL" = "no" ]; then CFG_SSE2="$VAL" else UNKNOWN_OPT=yes fi ;; reduce-relocations) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_REDUCE_RELOCATIONS="$VAL" else UNKNOWN_OPT=yes fi ;; freetype) [ "$VAL" = "qt" ] && VAL=yes if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then CFG_QWS_FREETYPE="$VAL" else UNKNOWN_OPT=yes fi ;; zlib) [ "$VAL" = "qt" ] && VAL=yes if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then CFG_ZLIB="$VAL" else UNKNOWN_OPT=yes fi [ "$VAL" = "no" ] && CFG_LIBPNG=no ;; sqlite) if [ "$VAL" = "system" ]; then CFG_SQLITE=system else UNKNOWN_OPT=yes fi ;; libpng) [ "$VAL" = "yes" ] && VAL=qt if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then CFG_LIBPNG="$VAL" else UNKNOWN_OPT=yes fi ;; libjpeg) [ "$VAL" = "yes" ] && VAL=qt if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then CFG_LIBJPEG="$VAL" else UNKNOWN_OPT=yes fi ;; libmng) [ "$VAL" = "yes" ] && VAL=qt if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then CFG_LIBMNG="$VAL" else UNKNOWN_OPT=yes fi ;; libtiff) [ "$VAL" = "yes" ] && VAL=qt if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then CFG_LIBTIFF="$VAL" else UNKNOWN_OPT=yes fi ;; nas-sound) if [ "$VAL" = "system" ] || [ "$VAL" = "no" ]; then CFG_NAS="$VAL" else UNKNOWN_OPT=yes fi ;; xcursor) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_XCURSOR="$VAL" else UNKNOWN_OPT=yes fi ;; xfixes) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_XFIXES="$VAL" else UNKNOWN_OPT=yes fi ;; xrandr) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_XRANDR="$VAL" else UNKNOWN_OPT=yes fi ;; xrender) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_XRENDER="$VAL" else UNKNOWN_OPT=yes fi ;; fontconfig) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_FONTCONFIG="$VAL" else UNKNOWN_OPT=yes fi ;; xkb) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_XKB="$VAL" else UNKNOWN_OPT=yes fi ;; cups) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_CUPS="$VAL" else UNKNOWN_OPT=yes fi ;; iconv) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_ICONV="$VAL" else UNKNOWN_OPT=yes fi ;; glib) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_GLIB="$VAL" else UNKNOWN_OPT=yes fi ;; qdbus) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_QDBUS="$VAL" else UNKNOWN_OPT=yes fi ;; nis) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_NIS="$VAL" else UNKNOWN_OPT=yes fi ;; largefile) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_LARGEFILE="$VAL" else UNKNOWN_OPT=yes fi ;; openssl) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_OPENSSL="$VAL" else UNKNOWN_OPT=yes fi ;; confirm-license) if [ "$VAL" = "yes" ]; then OPT_CONFIRM_LICENSE="$VAL" else UNKNOWN_OPT=yes fi ;; h|help) if [ "$VAL" = "yes" ]; then OPT_HELP="$VAL" else UNKNOWN_OPT=yes fi ;; sql-*|gfx-*|decoration-*|kbd-*|mouse-*) # if Qt style options were used, $VAL can be "no", "qt", or "plugin" # if autoconf style options were used, $VAL can be "yes" or "no" [ "$VAL" = "yes" ] && VAL=qt # now $VAL should be "no", "qt", or "plugin"... double-check if [ "$VAL" != "no" ] && [ "$VAL" != "qt" ] && [ "$VAL" != "plugin" ]; then UNKNOWN_OPT=yes fi # now $VAL is "no", "qt", or "plugin" OPT="$VAL" VAL=`echo $VAR | sed "s,^[^-]*-\([^-]*\).*,\1,"` VAR=`echo $VAR | sed "s,^\([^-]*\).*,\1,"` # Grab the available values case "$VAR" in sql) avail="$CFG_SQL_AVAILABLE" ;; gfx) avail="$CFG_GFX_AVAILABLE" if [ "$OPT" = "plugin" ]; then avail="$CFG_GFX_PLUGIN_AVAILABLE" fi ;; decoration) avail="$CFG_DECORATION_AVAILABLE" if [ "$OPT" = "plugin" ]; then avail="$CFG_DECORATION_PLUGIN_AVAILABLE" fi ;; kbd) avail="$CFG_KBD_AVAILABLE" ;; mouse) avail="$CFG_MOUSE_AVAILABLE" if [ "$OPT" = "plugin" ]; then avail="$CFG_MOUSE_PLUGIN_AVAILABLE" fi ;; *) avail="" echo "BUG: Unhandled type $VAR used in $CURRENT_OPT" ;; esac # Check that that user's value is available. found=no for d in $avail; do if [ "$VAL" = "$d" ]; then found=yes break fi done [ "$found" = yes ] || ERROR=yes if [ "$VAR" = "sql" ]; then # set the CFG_SQL_driver eval "CFG_SQL_$VAL=\$OPT" continue fi if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then if [ "$OPT" = "plugin" ]; then [ "$VAR" = "decoration" ] && QMakeVar del "${VAR}s" "$VAL" [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"` && CFG_DECORATION_PLUGIN="$CFG_DECORATION_PLUGIN ${VAL}" [ "$VAR" = "mouse" ] && QMakeVar del "${VAR}s" "$VAL" [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_MOUSE_PLUGIN="$CFG_MOUSE_PLUGIN ${VAL}" [ "$VAR" = "gfx" ] && QMakeVar del "${VAR}s" "$VAL" [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"` && CFG_GFX_PLUGIN="${CFG_GFX_PLUGIN} ${VAL}" VAR="${VAR}-${OPT}" else if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "decoration" ] || [ "$VAR" = "mouse" ]; then [ "$VAR" = "gfx" ] && CFG_GFX_ON="$CFG_GFX_ON $VAL" [ "$VAR" = "kbd" ] && CFG_KBD_ON="$CFG_KBD_ON $VAL" [ "$VAR" = "decoration" ] && CFG_DECORATION_ON="$CFG_DECORATION_ON $VAL" [ "$VAR" = "mouse" ] && CFG_MOUSE_ON="$CFG_MOUSE_ON $VAL" VAR="${VAR}-driver" fi fi QMakeVar add "${VAR}s" "${VAL}" elif [ "$OPT" = "no" ]; then PLUG_VAR="${VAR}-plugin" if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "mouse" ]; then IN_VAR="${VAR}-driver" else IN_VAR="${VAR}" fi [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"` [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"` [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"` [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` QMakeVar del "${IN_VAR}s" "$VAL" QMakeVar del "${PLUG_VAR}s" "$VAL" fi if [ "$ERROR" = "yes" ]; then echo "$CURRENT_OPT: unknown argument" OPT_HELP=yes fi ;; v|verbose) if [ "$VAL" = "yes" ]; then if [ "$OPT_VERBOSE" = "$VAL" ]; then # takes two verboses to turn on qmake debugs QMAKE_SWITCHES="$QMAKE_SWITCHES -d" else OPT_VERBOSE=yes fi elif [ "$VAL" = "no" ]; then if [ "$OPT_VERBOSE" = "$VAL" ] && echo "$QMAKE_SWITCHES" | grep ' -d' >/dev/null 2>&1; then QMAKE_SWITCHES=`echo $QMAKE_SWITCHES | sed "s, -d,,"` else OPT_VERBOSE=no fi else UNKNOWN_OPT=yes fi ;; fast) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then OPT_FAST="$VAL" else UNKNOWN_OPT=yes fi ;; rpath) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_RPATH="$VAL" else UNKNOWN_OPT=yes fi ;; add_define) D_FLAGS="$D_FLAGS \"$VAL\"" ;; add_ipath) I_FLAGS="$I_FLAGS -I\"${VAL}\"" ;; add_lpath) L_FLAGS="$L_FLAGS -L\"${VAL}\"" ;; add_rpath) RPATH_FLAGS="$RPATH_FLAGS \"${VAL}\"" ;; add_link) l_FLAGS="$l_FLAGS -l\"${VAL}\"" ;; add_fpath) if [ "$PLATFORM_MAC" = "yes" ]; then L_FLAGS="$L_FLAGS -F\"${VAL}\"" I_FLAGS="$I_FLAGS -F\"${VAL}\"" else UNKNOWN_OPT=yes fi ;; add_framework) if [ "$PLATFORM_MAC" = "yes" ]; then l_FLAGS="$l_FLAGS -framework \"${VAL}\"" else UNKNOWN_OPT=yes fi ;; silent) CFG_SILENT="$VAL" ;; *) UNKNOWN_OPT=yes ;; esac if [ "$UNKNOWN_OPT" = "yes" ]; then echo "${CURRENT_OPT}: invalid command-line switch" OPT_HELP=yes ERROR=yes fi done if [ "$CFG_QCONFIG" != "full" ] && [ "$CFG_QT3SUPPORT" = "yes" ]; then echo "Warning: '-qconfig $CFG_QCONFIG' will disable the qt3support library." CFG_QT3SUPPORT="no" fi #------------------------------------------------------------------------------- # build tree initialization #------------------------------------------------------------------------------- # where to find which.. unixtests="$relpath/config.tests/unix" mactests="$relpath/config.tests/mac" WHICH="$unixtests/which.test" # find out which awk we want to use, prefer gawk, then nawk, then regular awk AWK= for e in gawk nawk awk; do if "$WHICH" $e >/dev/null 2>&1 && ( $e -f /dev/null /dev/null ) >/dev/null 2>&1; then AWK=$e break fi done ### skip this if the user just needs help... if [ "$OPT_HELP" != "yes" ]; then # is this a shadow build? if [ "$OPT_SHADOW" = "maybe" ]; then OPT_SHADOW=no if [ "$relpath" != "$outpath" ] && [ '!' -f "$outpath/configure" ]; then if [ -h "$outpath" ]; then [ "$relpath" -ef "$outpath" ] || OPT_SHADOW=yes else OPT_SHADOW=yes fi fi fi if [ "$OPT_SHADOW" = "yes" ]; then if [ -f "$relpath/.qmake.cache" -o -f "$relpath/src/corelib/global/qconfig.h" ]; then echo >&2 "You cannot make a shadow build from a source tree containing a previous build." echo >&2 "Cannot proceed." exit 1 fi [ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..." fi if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then echo echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qtopia Core" echo "By default, Qt is built in release mode with separate debug information, so" echo "-debug-and-release is not necessary anymore" echo fi # detect build style if [ "$CFG_DEBUG" = "auto" ]; then if [ "$PLATFORM_MAC" = "yes" ]; then CFG_DEBUG_RELEASE=yes CFG_DEBUG=yes elif [ "$Edition" = "Trolltech" ]; then CFG_DEBUG_RELEASE=no CFG_DEBUG=yes else CFG_DEBUG_RELEASE=no CFG_DEBUG=no fi fi if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then QMAKE_CONFIG="$QMAKE_CONFIG build_all" fi if [ "$CFG_SILENT" = "yes" ]; then QMAKE_CONFIG="$QMAKE_CONFIG silent" fi # if the source tree is different from the build tree, # symlink or copy part of the sources if [ "$OPT_SHADOW" = "yes" ]; then echo "Preparing build tree..." [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin" # symlink the qmake directory find "$relpath/qmake" | while read a; do my_a=`echo "$a" | sed "s,^${relpath}/,${outpath}/,"` if [ '!' -f "$my_a" ]; then if [ -d "$a" ]; then # directories are created... mkdir -p "$my_a" else a_dir=`dirname "$my_a"` [ -d "$a_dir" ] || mkdir -p "$a_dir" # ... and files are symlinked case `basename "$a"` in *.o|*.d|GNUmakefile*|qmake) ;; *) rm -f "$my_a" ln -s "$a" "$my_a" ;; esac fi fi done # make a syncqt script that can be used in the shadow rm -f "$outpath/bin/syncqt" if [ -x "/usr/bin/perl" ] && [ -x "$relpath/bin/syncqt" ]; then mkdir -p "$outpath/bin" echo "#!/bin/sh" >"$outpath/bin/syncqt" echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/syncqt" [ "$Edition" = "Trolltech" ] && echo "perl \"$relpath/bin/syncqt\" -outdir \"$relpath\"" >>"$outpath/bin/syncqt" echo "perl \"$relpath/bin/syncqt\" -outdir \"$outpath\"" >>"$outpath/bin/syncqt" chmod 755 "$outpath/bin/syncqt" fi # symlink the doc directory rm -rf "$outpath/doc" ln -s "$relpath/doc" "$outpath/doc" # make sure q3porting.xml can be found mkdir -p "$outpath/tools/porting/src" rm -f "$outpath/tools/porting/src/q3porting.xml" ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src" fi # symlink files from src/gui/embedded neccessary to build qvfb if [ "$Edition" = "Trolltech" -o "$Edition" = "Qtopia" ]; then for f in qvfbhdr.h qlock_p.h qlock.cpp qwssignalhandler_p.h qwssignalhandler.cpp; do dest="${relpath}/tools/qvfb/${f}" rm -f "$dest" ln -s "${relpath}/src/gui/embedded/${f}" "${dest}" done fi if [ "$OPT_FAST" = "auto" ]; then if [ '!' -z "$AWK" ] && [ "$Edition" = "Trolltech" ]; then OPT_FAST=yes else OPT_FAST=no fi fi # find a make command if [ -z "$MAKE" ]; then MAKE= for mk in make; do if "$WHICH" $mk >/dev/null 2>&1; then MAKE=`$WHICH $mk` break fi done if [ -z "$MAKE" ]; then echo >&2 "You don't seem to have 'make' or 'gmake' in your PATH." echo >&2 "Cannot proceed." exit 1 fi fi fi ### help #------------------------------------------------------------------------------- # auto-detect all that hasn't been specified in the arguments #------------------------------------------------------------------------------- [ "$PLATFORM_QWS" = "yes" -a "$CFG_EMBEDDED" = "no" ] && CFG_EMBEDDED=auto if [ "$CFG_EMBEDDED" != "no" ]; then case "$UNAME_SYSTEM:$UNAME_RELEASE" in Darwin:*) [ -z "$PLATFORM" ] && PLATFORM=qws/macx-generic-g++ if [ -z "$XPLATFORM" ]; then [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic XPLATFORM="qws/macx-$CFG_EMBEDDED-g++" fi ;; FreeBSD:*) [ -z "$PLATFORM" ] && PLATFORM=qws/freebsd-generic-g++ if [ -z "$XPLATFORM" ]; then [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic XPLATFORM="qws/freebsd-$CFG_EMBEDDED-g++" fi ;; SunOS:5*) [ -z "$PLATFORM" ] && PLATFORM=qws/solaris-generic-g++ if [ -z "$XPLATFORM" ]; then [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic XPLATFORM="qws/solaris-$CFG_EMBEDDED-g++" fi ;; Linux:*) if [ -z "$PLATFORM" ]; then case "$UNAME_MACHINE" in *86) PLATFORM=qws/linux-x86-g++ ;; *86_64) PLATFORM=qws/linux-x86_64-g++ ;; *) PLATFORM=qws/linux-generic-g++ ;; esac fi if [ -z "$XPLATFORM" ]; then if [ "$CFG_EMBEDDED" = "auto" ]; then case "$UNAME_MACHINE" in *86) CFG_EMBEDDED=x86 ;; *86_64) CFG_EMBEDDED=x86_64 ;; *) CFG_EMBEDDED=generic ;; esac fi XPLATFORM="qws/linux-$CFG_EMBEDDED-g++" fi ;; *) echo "Qtopia Core is not supported on this platform. Disabling." CFG_EMBEDDED=no PLATFORM_QWS=no ;; esac fi if [ -z "$PLATFORM" ]; then PLATFORM_NOTES= case "$UNAME_SYSTEM:$UNAME_RELEASE" in Darwin:*) if [ "$PLATFORM_MAC" = "yes" ]; then PLATFORM=macx-g++ # PLATFORM=macx-xcode else PLATFORM=darwin-g++ fi ;; AIX:*) #PLATFORM=aix-g++ #PLATFORM=aix-g++-64 PLATFORM=aix-xlc #PLATFORM=aix-xlc-64 PLATFORM_NOTES=" - Also available for AIX: aix-g++ aix-g++-64 aix-xlc-64 " ;; GNU:*) PLATFORM=hurd-g++ ;; dgux:*) PLATFORM=dgux-g++ ;; # DYNIX/ptx:4*) # PLATFORM=dynix-g++ # ;; ULTRIX:*) PLATFORM=ultrix-g++ ;; FreeBSD:*) PLATFORM=freebsd-g++ PLATFORM_NOTES=" - Also available for FreeBSD: freebsd-icc " ;; OpenBSD:*) PLATFORM=openbsd-g++ ;; NetBSD:*) PLATFORM=netbsd-g++ ;; BSD/OS:*|BSD/386:*) PLATFORM=bsdi-g++ ;; IRIX*:*) #PLATFORM=irix-g++ PLATFORM=irix-cc #PLATFORM=irix-cc-64 PLATFORM_NOTES=" - Also available for IRIX: irix-g++ irix-cc-64 " ;; HP-UX:*) #PLATFORM=hpux-g++ PLATFORM=hpux-acc #PLATFORM=hpux-acc-64 #PLATFORM=hpux-cc #PLATFORM=hpux-acc-o64 PLATFORM_NOTES=" - Also available for HP-UX: hpux-g++ hpux-acc-64 hpux-acc-o64 " ;; OSF1:*) #PLATFORM=tru64-g++ PLATFORM=tru64-cxx PLATFORM_NOTES=" - Also available for Tru64: tru64-g++ " ;; Linux:*) case "$UNAME_MACHINE" in x86_64|s390x) PLATFORM=linux-g++-64 ;; *) PLATFORM=linux-g++ ;; esac PLATFORM_NOTES=" - Also available for Linux: linux-kcc linux-icc linux-cxx " ;; SunOS:5*) #PLATFORM=solaris-g++ PLATFORM=solaris-cc #PLATFORM=solaris-cc64 PLATFORM_NOTES=" - Also available for Solaris: solaris-g++ solaris-cc-64 " ;; ReliantUNIX-*:*|SINIX-*:*) PLATFORM=reliant-cds #PLATFORM=reliant-cds-64 PLATFORM_NOTES=" - Also available for Reliant UNIX: reliant-cds-64 " ;; CYGWIN*:*) PLATFORM=cygwin-g++ ;; LynxOS*:*) PLATFORM=lynxos-g++ ;; OpenUNIX:*) #PLATFORM=unixware-g++ PLATFORM=unixware-cc PLATFORM_NOTES=" - Also available for OpenUNIX: unixware-g++ " ;; UnixWare:*) #PLATFORM=unixware-g++ PLATFORM=unixware-cc PLATFORM_NOTES=" - Also available for UnixWare: unixware-g++ " ;; SCO_SV:*) #PLATFORM=sco-g++ PLATFORM=sco-cc PLATFORM_NOTES=" - Also available for SCO OpenServer: sco-g++ " ;; UNIX_SV:*) PLATFORM=unixware-g++ ;; *) if [ "$OPT_HELP" != "yes" ]; then echo for p in $PLATFORMS; do echo " $relconf $* -platform $p" done echo >&2 echo " The build script does not currently recognize all" >&2 echo " platforms supported by Qt." >&2 echo " Rerun this script with a -platform option listed to" >&2 echo " set the system/compiler combination you use." >&2 echo >&2 exit 2 fi esac fi [ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM" if [ -d "$PLATFORM" ]; then QMAKESPEC="$PLATFORM" else QMAKESPEC="$relpath/mkspecs/${PLATFORM}" fi if [ -d "$XPLATFORM" ]; then XQMAKESPEC="$XPLATFORM" else XQMAKESPEC="$relpath/mkspecs/${XPLATFORM}" fi if [ "$PLATFORM" != "$XPLATFORM" ]; then QMAKE_CONFIG="$QMAKE_CONFIG cross_compile" fi if [ "$PLATFORM_MAC" = "yes" ]; then if [ `basename $QMAKESPEC` = "macx-xcode" ] || [ `basename $XQMAKESPEC` = "macx-xcode" ]; then echo >&2 echo " Platform 'macx-xcode' should not be used when building Qt/Mac." >&2 echo " Please build Qt/Mac with 'macx-g++', then if you would like to" >&2 echo " use mac-xcode on your application code it can link to a Qt/Mac" >&2 echo " built with 'macx-g++'" >&2 echo >&2 exit 2 fi fi # check specified platforms are supported if [ '!' -d "$QMAKESPEC" ]; then echo echo " The specified system/compiler is not supported:" echo echo " $QMAKESPEC" echo echo " Please see the README file for a complete list." echo exit 2 fi if [ '!' -d "$XQMAKESPEC" ]; then echo echo " The specified system/compiler is not supported:" echo echo " $XQMAKESPEC" echo echo " Please see the README file for a complete list." echo exit 2 fi if [ '!' -f "${XQMAKESPEC}/qplatformdefs.h" ]; then echo echo " The specified system/compiler port is not complete:" echo echo " $XQMAKESPEC/qplatformdefs.h" echo echo " Please contact qt-bugs@trolltech.com." echo exit 2 fi # now look at the configs and figure out what platform we are config'd for [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ] && PLATFORM_X11=yes ### echo "$XQMAKESPEC" | grep mkspecs/qws >/dev/null 2>&1 && PLATFORM_QWS=yes if [ "$UNAME_SYSTEM" = "SunOS" ]; then # Solaris 2.5 and 2.6 have libposix4, which was renamed to librt for Solaris 7 and up if echo $UNAME_RELEASE | grep "^5\.[5|6]" >/dev/null 2>&1; then sed -e "s,-lrt,-lposix4," "$XQMAKESPEC/qmake.conf" > "$XQMAKESPEC/qmake.conf.new" mv "$XQMAKESPEC/qmake.conf.new" "$XQMAKESPEC/qmake.conf" fi fi #------------------------------------------------------------------------------- # determine the system architecture #------------------------------------------------------------------------------- if [ "$OPT_VERBOSE" = "yes" ]; then echo "Determining system architecture... ($UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE)" fi if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then case "$CFG_EMBEDDED" in x86) ARCH=i386 ;; x86_64) ARCH=x86_64 ;; ipaq|sharp) ARCH=arm ;; *) ARCH="$CFG_EMBEDDED" ;; esac else case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in IRIX*:*:*) ARCH=`uname -p` if [ "$OPT_VERBOSE" = "yes" ]; then echo " SGI ($ARCH)" fi ;; SunOS:5*:*) case "$UNAME_MACHINE" in sun4u*|sun4v*) if [ "$OPT_VERBOSE" = "yes" ]; then echo " Sun SPARC (sparc)" fi ARCH=sparc ;; i86pc) case "$PLATFORM" in *-64) if [ "$OPT_VERBOSE" = "yes" ]; then echo " 64-bit AMD 80x86 (x86_64)" fi ARCH=x86_64 ;; *) if [ "$OPT_VERBOSE" = "yes" ]; then echo " 32-bit Intel 80x86 (i386)" fi ARCH=i386 ;; esac esac ;; Darwin:*:*) case "$UNAME_MACHINE" in Power?Macintosh) if [ "$OPT_VERBOSE" = "yes" ]; then echo " 32-bit Apple PowerPC (powerpc)" fi ;; x86) if [ "$OPT_VERBOSE" = "yes" ]; then echo " 32-bit Intel 80x86 (i386)" fi ;; esac ARCH=macosx ;; AIX:*:00????????00) if [ "$OPT_VERBOSE" = "yes" ]; then echo " 64-bit IBM PowerPC (powerpc)" fi ARCH=powerpc ;; HP-UX:*:9000*) if [ "$OPT_VERBOSE" = "yes" ]; then echo " HP PA-RISC (parisc)" fi ARCH=parisc ;; *:*:i?86) if [ "$OPT_VERBOSE" = "yes" ]; then echo " 32-bit Intel 80x86 (i386)" fi ARCH=i386 ;; *:*:x86_64|*:*:amd64) if [ "$PLATFORM" = "linux-g++-32" ]; then if [ "$OPT_VERBOSE" = "yes" ]; then echo " 32 bit on 64-bit AMD 80x86 (i386)" fi ARCH=i386 else if [ "$OPT_VERBOSE" = "yes" ]; then echo " 64-bit AMD 80x86 (x86_64)" fi ARCH=x86_64 fi ;; *:*:ppc) if [ "$OPT_VERBOSE" = "yes" ]; then echo " 32-bit PowerPC (powerpc)" fi ARCH=powerpc ;; *:*:ppc64) if [ "$OPT_VERBOSE" = "yes" ]; then echo " 64-bit PowerPC (powerpc)" fi ARCH=powerpc ;; *:*:s390*) if [ "$OPT_VERBOSE" = "yes" ]; then echo " IBM S/390 (s390)" fi ARCH=s390 ;; *:*:*) if [ "$OPT_VERBOSE" = "yes" ]; then echo " Trying '$UNAME_MACHINE'..." fi ARCH="$UNAME_MACHINE" ;; esac fi if [ -d "$relpath/src/corelib/arch/$ARCH" ]; then if [ "$OPT_VERBOSE" = "yes" ]; then echo " '$ARCH' is supported" fi else if [ "$OPT_VERBOSE" = "yes" ]; then echo " '$ARCH' is unsupported, using 'generic'" fi ARCH=generic fi if [ "$OPT_VERBOSE" = "yes" ]; then echo "System architecture: '$ARCH'" fi #------------------------------------------------------------------------------- # tests that don't need qmake (must be run before displaying help) #------------------------------------------------------------------------------- # find the default framework value if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then if [ "$CFG_FRAMEWORK" = "auto" ]; then CFG_FRAMEWORK="$CFG_SHARED" elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then echo echo "WARNING: Using static linking will disable the use of Mac frameworks." echo CFG_FRAMEWORK="no" fi else CFG_FRAMEWORK=no fi TEST_COMPILER="$CC" [ -z "$TEST_COMPILE" ] && TEST_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1,"` # auto-detect precompiled header support if [ "$CFG_PRECOMPILE" = "auto" ]; then if [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then CFG_PRECOMPILE=no elif "$unixtests/precomp.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then CFG_PRECOMPILE=no else CFG_PRECOMPILE=yes fi elif [ "$CFG_PRECOMPILE" = "yes" ] && [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then echo echo "WARNING: Using universal binaries disables precompiled headers." echo CFG_PRECOMPILE=no fi #auto-detect DWARF2 on the mac if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" != "no" ]; then if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then CFG_MAC_DWARF2=no else CFG_MAC_DWARF2=yes fi fi # auto-detect support for separate debug info in objcopy if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then TEST_COMPILER_CFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CFLAGS[^_].*=%%p' | tr '\n' ' '` TEST_COMPILER_CXXFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CXXFLAGS[^_].*=%%p' | tr '\n' ' '` TEST_CXX_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s%.* *= *\(.*\)$%\1%" | tr '\n' ' '` COMPILER_WITH_FLAGS="$TEST_CXX_COMPILER $TEST_COMPILER_CXXFLAGS" COMPILER_WITH_FLAGS=`echo "$COMPILER_WITH_FLAGS" | sed -e "s%\\$\\$QMAKE_CFLAGS%$TEST_COMPILER_CFLAGS%"` if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$OPT_VERBOSE"; then CFG_SEPARATE_DEBUG_INFO=no else case "$PLATFORM" in hpux-*) # binutils on HP-UX is buggy; default to no. CFG_SEPARATE_DEBUG_INFO=no ;; *) CFG_SEPARATE_DEBUG_INFO=yes ;; esac fi fi # auto-detect -fvisibility support if [ "$CFG_REDUCE_EXPORTS" = "auto" ]; then if "$unixtests/fvisibility.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then CFG_REDUCE_EXPORTS=no else CFG_REDUCE_EXPORTS=yes fi fi # detect the availability of the -Bsymbolic-functions linker optimization if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then CFG_REDUCE_RELOCATIONS=no else CFG_REDUCE_RELOCATIONS=yes fi fi # auto-detect GNU make support if [ "$CFG_USE_GNUMAKE" = "auto" ] && "$MAKE" -v | grep "GNU Make" >/dev/null 2>&1; then CFG_USE_GNUMAKE=yes fi # mac if [ "$PLATFORM_MAC" = "yes" ]; then if [ "$CFG_OPENGL" = "auto" ]; then CFG_OPENGL=yes fi fi # find the default framework value if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then if [ "$CFG_FRAMEWORK" = "auto" ]; then CFG_FRAMEWORK="$CFG_SHARED" elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then echo echo "WARNING: Using static linking will disable the use of Mac frameworks." echo CFG_FRAMEWORK="no" fi else CFG_FRAMEWORK=no fi # x11 tests are done after qmake is built # embedded if [ "$PLATFORM_QWS" = "yes" ]; then # No OpenGL by default for Qtopia Core if [ "$CFG_OPENGL" = "auto" ]; then CFG_OPENGL=no fi fi # QWS #setup the build parts if [ -z "$CFG_BUILD_PARTS" ]; then CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS" # don't build tools by default when cross-compiling if [ "$PLATFORM" != "$XPLATFORM" ]; then CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, tools,,g"` fi fi for nobuild in $CFG_NOBUILD_PARTS; do CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, $nobuild,,g"` done if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then # echo # echo "WARNING: libs is a required part of the build." # echo CFG_BUILD_PARTS="$CFG_BUILD_PARTS libs" fi #------------------------------------------------------------------------------- # post process QT_INSTALL_* variables #------------------------------------------------------------------------------- #prefix if [ -z "$QT_INSTALL_PREFIX" ]; then if [ "$Edition" = "Trolltech" ]; then QT_INSTALL_PREFIX="$outpath" # At Trolltech, we use sandboxed builds by default elif [ "$PLATFORM_QWS" = "yes" ]; then QT_INSTALL_PREFIX="/usr/local/Trolltech/QtopiaCore-${QT_VERSION}" if [ "$PLATFORM" != "$XPLATFORM" ]; then QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${ARCH}" fi else QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION fi fi QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"` #docs if [ -z "$QT_INSTALL_DOCS" ]; then #default if [ "$CFG_PREFIX_INSTALL" = "no" ]; then if [ "$PLATFORM_MAC" = "yes" ]; then QT_INSTALL_DOCS="/Developer/Documentation/Qt" fi fi [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback fi QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"` #headers if [ -z "$QT_INSTALL_HEADERS" ]; then #default if [ "$CFG_PREFIX_INSTALL" = "no" ]; then if [ "$PLATFORM_MAC" = "yes" ]; then if [ "$CFG_FRAMEWORK" = "yes" ]; then QT_INSTALL_HEADERS= fi fi fi [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include" fi QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"` #libs if [ -z "$QT_INSTALL_LIBS" ]; then #default if [ "$CFG_PREFIX_INSTALL" = "no" ]; then if [ "$PLATFORM_MAC" = "yes" ]; then if [ "$CFG_FRAMEWORK" = "yes" ]; then QT_INSTALL_LIBS="/Libraries/Frameworks" fi fi fi [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback fi QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"` #bins if [ -z "$QT_INSTALL_BINS" ]; then #default if [ "$CFG_PREFIX_INSTALL" = "no" ]; then if [ "$PLATFORM_MAC" = "yes" ]; then QT_INSTALL_BINS="/Developer/Applications/Qt" fi fi [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback fi QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"` #plugins if [ -z "$QT_INSTALL_PLUGINS" ]; then #default if [ "$CFG_PREFIX_INSTALL" = "no" ]; then if [ "$PLATFORM_MAC" = "yes" ]; then QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins" fi fi [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback fi QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"` #data if [ -z "$QT_INSTALL_DATA" ]; then #default QT_INSTALL_DATA="$QT_INSTALL_PREFIX" fi QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"` #translations if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations" fi QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"` #settings if [ -z "$QT_INSTALL_SETTINGS" ]; then #default if [ "$PLATFORM_MAC" = "yes" ]; then QT_INSTALL_SETTINGS=/Library/Preferences/Qt else QT_INSTALL_SETTINGS=/etc/xdg fi fi QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"` #examples if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default if [ "$CFG_PREFIX_INSTALL" = "no" ]; then if [ "$PLATFORM_MAC" = "yes" ]; then QT_INSTALL_EXAMPLES="/Developer/Examples/Qt" fi fi [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback fi QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"` #demos if [ -z "$QT_INSTALL_DEMOS" ]; then #default if [ "$CFG_PREFIX_INSTALL" = "no" ]; then if [ "$PLATFORM_MAC" = "yes" ]; then QT_INSTALL_DEMOS="/Developer/Examples/Qt/Demos" fi fi [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos" fi QT_INSTALL_DEMOS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DEMOS"` #------------------------------------------------------------------------------- # help - interactive parts of the script _after_ this section please #------------------------------------------------------------------------------- # next, emit a usage message if something failed. if [ "$OPT_HELP" = "yes" ]; then [ "x$ERROR" = "xyes" ] && echo if [ "$CFG_NIS" = "no" ]; then NSY=" " NSN="*" else NSY="*" NSN=" " fi if [ "$CFG_CUPS" = "no" ]; then CUY=" " CUN="*" else CUY="*" CUN=" " fi if [ "$CFG_ICONV" = "no" ]; then CIY=" " CIN="*" else CIY="*" CIN=" " fi if [ "$CFG_LARGEFILE" = "no" ]; then LFSY=" " LFSN="*" else LFSY="*" LFSN=" " fi if [ "$CFG_STL" = "auto" ] || [ "$CFG_STL" = "yes" ]; then SHY="*" SHN=" " else SHY=" " SHN="*" fi if [ "$CFG_IPV6" = "auto" ]; then I6Y="*" I6N=" " fi if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then PHY=" " PHN="*" else PHY="*" PHN=" " fi if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ] || [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then SBY="*" SBN=" " else SBY=" " SBN="*" fi cat <] [-prefix-install] [-bindir ] [-libdir ] [-docdir ] [-headerdir ] [-plugindir ] [-datadir ] [-translationdir ] [-sysconfdir ] [-examplesdir ] [-demosdir ] [-buildkey ] [-release] [-debug] [-debug-and-release] [-shared] [-static] [-no-fast] [-fast] [-no-largefile] [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility] [-accessibility] [-no-stl] [-stl] [-no-sql-] [-sql-] [-plugin-sql-] [-system-sqlite] [-no-qt3support] [-qt3support] [-platform] [-D ] [-I ] [-L ] [-help] [-no-zlib] [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-system-libtiff] [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng] [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make ] [-no-make ] [-R ] [-l ] [-no-rpath] [-rpath] [-continue] [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv] [-iconv] [-no-pch] [-pch] [-no-qdbus] [-qdbus] [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2] [-separate-debug-info] [-armfpa] [-no-optimized-qmake] [-optimized-qmake] [additional platform specific options (see below)] Installation options: These are optional, but you may specify install directories. -prefix ...... This will install everything relative to (default $QT_INSTALL_PREFIX) * -prefix-install .... Force a sandboxed "local" installation of Qt. This will install into $QT_INSTALL_PREFIX, if this option is disabled then some platforms will attempt a "system" install by placing default values to be placed in a system location other than PREFIX. You may use these to separate different parts of the install: -bindir ......... Executables will be installed to (default PREFIX/bin) -libdir ......... Libraries will be installed to (default PREFIX/lib) -docdir ......... Documentation will be installed to (default PREFIX/doc) -headerdir ...... Headers will be installed to (default PREFIX/include) -plugindir ...... Plugins will be installed to (default PREFIX/plugins) -datadir ........ Data used by Qt programs will be installed to (default PREFIX) -translationdir .. Translations of Qt programs will be installed to (default PREFIX/translations) -sysconfdir ..... Settings used by Qt programs will be looked for in (default PREFIX/etc/settings) -examplesdir .... Examples will be installed to (default PREFIX/examples) -demosdir ....... Demos will be installed to (default PREFIX/demos) You may use these options to turn on strict plugin loading. -buildkey .... Build the Qt library and plugins using the specified . When the library loads plugins, it will only load those that have a matching key. Configure options: The defaults (*) are usually acceptable. A plus (+) denotes a default value that needs to be evaluated. If the evaluation succeeds, the feature is included. Here is a short explanation of each option: * -release ........... Compile and link Qt with debugging turned off. -debug ............. Compile and link Qt with debugging turned on. -debug-and-release . Compile and link two versions of Qt, with and without debugging turned on. [Mac only] * -shared ............ Create and use shared Qt libraries. -static ............ Create and use static Qt libraries. * -no-fast ........... Configure Qt normally by generating Makefiles for all project files. -fast .............. Configure Qt quickly by generating Makefiles only for library and subdirectory targets. All other Makefiles are created as wrappers, which will in turn run qmake. -no-largefile....... Disables large file support. + -largefile.......... Enables Qt to access files larger than 4 GB. EOF if [ "$PLATFORM_QWS" = "yes" ]; then EXCN="*" EXCY=" " else EXCN=" " EXCY="*" fi if [ "$CFG_QDBUS" = "no" ]; then DBY=" " DBN="+" else DBY="+" DBN=" " fi cat << EOF $EXCN -no-exceptions ..... Disable exceptions on compilers that support it. $EXCY -exceptions ........ Enable exceptions on compilers that support it. -no-accessibility .. Do not compile Accessibility support. * -accessibility ..... Compile Accessibility support. $SHN -no-stl ............ Do not compile STL support. $SHY -stl ............... Compile STL support. -no-sql- ... Disable SQL entirely. -qt-sql- ... Enable a SQL in the QtSql library, by default none are turned on. -plugin-sql- Enable SQL as a plugin to be linked to at run time. Possible values for : [ $CFG_SQL_AVAILABLE ] -system-sqlite ..... Use sqlite from the operating system. -no-qt3support ..... Disables the Qt 3 support functionality. * -qt3support ........ Enables the Qt 3 support functionality. -platform target ... The operating system and compiler you are building on ($PLATFORM). See the README file for a list of supported operating systems and compilers. -no-mmx ............ Do not compile with use of MMX instructions. -no-3dnow .......... Do not compile with use of 3DNOW instructions. -no-sse ............ Do not compile with use of SSE instructions. -no-sse2 ........... Do not compile with use of SSE2 instructions. -D ........ Add an explicit define to the preprocessor. -I ........ Add an explicit include path. -L ........ Add an explicit library path. -help, -h .......... Display this information. Third Party Libraries: -no-zlib ........... Do not compile in ZLIB support. Implies -no-libpng. -qt-zlib ........... Use the zlib bundled with Qt. + -system-zlib ....... Use zlib from the operating system. See http://www.gzip.org/zlib * -no-gif ............ Do not compile the plugin for GIF reading support. -qt-gif ............ Compile the plugin for GIF reading support. See also src/plugins/imageformats/gif/qgifhandler.h -no-libtiff ........ Do not compile the plugin for TIFF support. -qt-libtiff ........ Use the libtiff bundled with Qt. + -system-libtiff .... Use libtiff from the operating system. See http://www.libtiff.org -no-libpng ......... Do not compile in PNG support. -qt-libpng ......... Use the libpng bundled with Qt. + -system-libpng ..... Use libpng from the operating system. See http://www.libpng.org/pub/png -no-libmng ......... Do not compile the plugin for MNG support. -qt-libmng ......... Use the libmng bundled with Qt. + -system-libmng ..... Use libmng from the operating system. See http://www.libmng.com -no-libjpeg ........ Do not compile the plugin for JPEG support. -qt-libjpeg ........ Use the libjpeg bundled with Qt. + -system-libjpeg .... Use libjpeg from the operating system. See http://www.ijg.org -no-openssl ........ Do not compile support for OpenSSL. + -openssl ........... Use OpenSSL from the operating system. Additional options: -make ....... Add part to the list of parts to be built at make time. ($QT_DEFAULT_BUILD_PARTS) -nomake ..... Exclude part from the list of parts to be built. -R ........ Add an explicit runtime library path to the Qt libraries. -l ........ Add an explicit library. -no-rpath .......... Do not use the library install path as a runtime library path. + -rpath ............. Link Qt libraries and executables using the library install path as a runtime library path. Equivalent to -R install_libpath -continue........... Continue as far as possible if an error occurs. -verbose, -v ....... Print verbose information about each step of the configure process. -silent ............ Reduce the build output so that warnings and errors can be seen more easily. * -no-optimized-qmake ... Do not build qmake optimized. -optimized-qmake ...... Build qmake optimized. $NSN -no-nis ............ Do not compile NIS support. $NSY -nis ............... Compile NIS support. $CUN -no-cups............ Do not compile CUPS support. $CUY -cups .............. Compile CUPS support. $CIN -no-iconv........... Do not compile support for iconv(3). $CIY -iconv.............. Compile support for iconv(3). $PHN -no-pch ............ Do not use precompiled header support. $PHY -pch ............... Use precompiled header support. $DBN -no-qdbus........... Do not compile the QtDBus module. $DBY -qdbus.............. Compile the QtDBus module. -reduce-relocations ... Reduce relocations in the libraries through extra linker optimizations (Qt/X11 / Qtopia/Core only; experimental; needs GNU ld >= 2.18) EOF if [ "$PLATFORM_X11" = "yes" ]; then if [ "$CFG_SM" = "no" ]; then SMY=" " SMN="*" else SMY="*" SMN=" " fi if [ "$CFG_XSHAPE" = "no" ]; then SHY=" " SHN="*" else SHY="*" SHN=" " fi if [ "$CFG_XINERAMA" = "no" ]; then XRY=" " XRN="*" else XRY="*" XRN=" " fi if [ "$CFG_FONTCONFIG" = "no" ]; then FCGY=" " FCGN="*" else FCGY="*" FCGN=" " fi if [ "$CFG_XCURSOR" = "no" ]; then XCY=" " XCN="*" else XCY="*" XCN=" " fi if [ "$CFG_XRANDR" = "no" ]; then XZY=" " XZN="*" else XZY="*" XZN=" " fi if [ "$CFG_XRENDER" = "no" ]; then XRY=" " XRN="*" else XRY="*" XRN=" " fi if [ "$CFG_TABLET" = "no" ]; then XIY=" " XIN="*" else XIY="*" XIN=" " fi if [ "$CFG_XKB" = "no" ]; then XKY=" " XKN="*" else XKY="*" XKN=" " fi if [ "$CFG_IM" = "no" ]; then IMY=" " IMN="*" else IMY="*" IMN=" " fi if [ "$CFG_GLIB" = "no" ]; then GBY=" " GBN="+" else GBY="+" GBN=" " fi cat << EOF Qt/X11 only: * -no-nas-sound ...... Do not compile in NAS sound support. -system-nas-sound .. Use NAS libaudio from the operating system. See http://radscan.com/nas.html -no-opengl.......... Do not support OpenGL. + -opengl............. Enable OpenGL support. $SMN -no-sm ............. Do not support X Session Management. $SMY -sm ................ Support X Session Management, links in -lSM -lICE. $SHN -no-xshape ......... Do not compile XShape support. $SHY -xshape ............ Compile XShape support. Requires X11/extensions/shape.h. $XRN -no-xinerama ....... Do not compile Xinerama (multihead) support. $XRY -xinerama .......... Compile Xinerama support. Requires X11/extensions/Xinerama.h and libXinerama. $XCN -no-xcursor ........ Do not compile Xcursor support. $XCY -xcursor ........... Compile Xcursor support. Requires X11/Xcursor/Xcursor.h and libXcursor. $XCN -no-xfixes ......... Do not compile Xfixes support. $XCY -xfixes ............ Compile Xfixes support. Requires X11/extensions/Xfixes.h and libXfixes. $XZN -no-xrandr ......... Do not compile Xrandr (resize and rotate) support. $XZY -xrandr ............ Compile Xrandr support. Requires X11/extensions/Xrandr.h and libXrandr. $XRN -no-xrender ........ Do not compile Xrender support. $XRY -xrender ........... Compile Xrender support. Requires X11/extensions/Xrender.h and libXrender $FCGN -no-fontconfig ..... Do not compile FontConfig (anti-aliased font) support. $FCGY -fontconfig ........ Compile FontConfig support. Requires fontconfig/fontconfig.h, libfontconfig, freetype.h and libfreetype. $XIN -no-tablet ......... Do not compile Tablet support. $XIY -tablet ............ Compile Tablet support. Requires IRIX with wacom.h and libXi or XFree86 with X11/extensions/XInput.h and libXi. $XKN -no-xkb ............ Do not compile XKB (X KeyBoard extension) support. $XKY -xkb ............... Compile XKB support. $GBN -no-glib............ Do not compile Glib support. $GBY -glib............... Compile Glib support. $SBN -no-separate-debug-info Do not store debug information in a separate file $SBY -separate-debug-info Strip debug information into a separate .debug file EOF fi if [ "$PLATFORM_MAC" = "yes" ]; then cat << EOF Qt/Mac only: -Fstring ........... Add an explicit framework path. -fw string ......... Add an explicit framework. * -framework ......... Build Qt as a series of frameworks and link tools against those frameworks. -no-framework ...... Do not build Qt as a series of frameworks. -dwarf2 ............ Enable dwarf2 debugging symbols. * -no-dwarf2 ......... Disable dwarf2 debugging symbols. -universal ......... Equivalent to -arch "ppc x86" -arch ....... Build Qt for Example values for : x86 ppc x86_64 ppc64 -sdk .......... Build Qt using Apple provided SDK . EOF fi if [ "$PLATFORM_QWS" = "yes" ]; then cat << EOF Qtopia Core only: -xplatform target ... The target platform when cross-compiling. -no-feature- Do not compile in . -feature- .. Compile in . The available features are described in src/corelib/global/qfeatures.txt -embedded ..... This will enable the embedded build, you must have a proper license for this switch to work. Example values for : arm mips x86 generic -armfpa ............. Target platform is uses the ARM-FPA floating point format. -no-armfpa .......... Target platform does not use the ARM-FPA floating point format. The floating point format is usually autodetected by configure. Use this to override the detected value. -little-endian ...... Target platform is little endian (LSB first). -big-endian ......... Target platform is big endian (MSB first). You only need to specify the endianness when cross-compiling, otherwise the host endianness will be used. -no-freetype ........ Do not compile in Freetype2 support. -qt-freetype ........ Use the libfreetype bundled with Qt. * -system-libfreetype. Use libfreetype from the operating system. See http://www.freetype.org/ -qconfig local ...... Use src/corelib/global/qconfig-local.h rather than the default ($CFG_QCONFIG). -depths ...... Comma-separated list of supported bit-per-pixel depths, from: 4, 8, 16, 18, 24, and 32. -qt-decoration-