blob: 4ea1ad05dd6126182bf4ac266c4f937c92f68d70 [file] [log] [blame]
<
#!/bin/sh
#############################################################################
##
## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
## This file is the build configuration utility of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial Usage
## Licensees holding valid Qt Commercial licenses may use this file in
## accordance with the Qt Commercial License Agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Nokia.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, Nokia gives you certain additional
## rights. These rights are described in the Nokia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
## GNU General Public License Usage
## Alternatively, this file may be used under the terms of the GNU
## General Public License version 3.0 as published by the Free Software
## Foundation and appearing in the file LICENSE.GPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU General Public License version 3.0 requirements will be
## met: http://www.gnu.org/copyleft/gpl.html.
##
## If you have questions regarding the use of this file, please contact
## Nokia at qt-info@nokia.com.
## $QT_END_LICENSE$
##
#############################################################################
#-------------------------------------------------------------------------------
# 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
:> "$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 "$2" "$eq" "$3" >> "$QMAKE_VARS_FILE"
}
# 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.mm ] && [ -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
# Qt Embedded
# ~ src/gui/base/qapplication_qws.cpp is present
# ~ this is the free or commercial edition
# ~ this is the internal edition and Qt Embedded is explicitly enabled
if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ]; then
# This is a depot build, or an all-platforms package
PLATFORM_QWS=maybe
else
# This must be the embedded package, since the Qt/Mac source files are not present
PLATFORM_QWS=yes
fi
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
#-------------------------------------------------------------------------------
COMMERCIAL_USER=ask
CFG_DEV=no
CFG_NOKIA=no
CFG_EMBEDDED=no
EditionString=Commercial
earlyArgParse()
{
# 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
;;
-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
;;
-h|help|--help|-help)
if [ "$VAL" = "yes" ]; then
OPT_HELP="$VAL"
COMMERCIAL_USER="no" #doesn't matter we will display the help
else
UNKNOWN_OPT=yes
COMMERCIAL_USER="no" #doesn't matter we will display the help
fi
;;
--*)
VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
VAL=yes
;;
-*)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
VAL="unknown"
;;
*)
UNKNOWN_ARG=yes
;;
esac
if [ "$UNKNOWN_ARG" = "yes" ]; then
shift
continue
fi
shift
UNKNOWN_OPT=no
case "$VAR" in
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 Qt for Embedded Linux. Disabling."
CFG_EMBEDDED=no
fi
;;
developer-build)
CFG_DEV="yes"
;;
nokia-developer)
CFG_DEV="yes"
CFG_NOKIA="yes"
COMMERCIAL_USER="no"
;;
commercial)
COMMERCIAL_USER="yes"
;;
opensource)
COMMERCIAL_USER="no"
;;
*)
UNKNOWN_OPT=yes
;;
esac
done
}
earlyArgParse "$@"
if [ "$COMMERCIAL_USER" = "ask" ]; then
while true; do
echo "Which edition of Qt do you want to use ?"
echo
echo "Type 'c' if you want to use the Commercial Edition."
echo "Type 'o' if you want to use the Open Source Edition."
echo
read commercial
echo
if [ "$commercial" = "c" ]; then
COMMERCIAL_USER="yes"
break
elif [ "$commercial" = "o" ]; then
COMMERCIAL_USER="no"
break
fi
done
fi
if [ "$CFG_NOKIA" = "yes" ]; then
Licensee="Nokia"
Edition="NokiaInternalBuild"
EditionString="Nokia Internal Build"
QT_EDITION="QT_EDITION_OPENSOURCE"
[ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
elif [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then
# Commercial preview release
[ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
Licensee="Preview"
Edition="Preview"
QT_EDITION="QT_EDITION_DESKTOP"
LicenseType="Technology Preview"
elif [ $COMMERCIAL_USER = "yes" ]; then
# 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 Nokia,"
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="FullFramework"
EditionString="Full Framework"
QT_EDITION="QT_EDITION_DESKTOP"
;;
L)
Edition="GUIFramework"
EditionString="GUI Framework"
QT_EDITION="QT_EDITION_DESKTOPLIGHT"
;;
esac
;;
Z4M|R4M|Q4M)
LicenseType="Evaluation"
case $ProductCode in
B)
Edition="Evaluation"
QT_EDITION="QT_EDITION_EVALUATION"
;;
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 [ "$PlatformCode" = "X" ]; then
# Qt All-OS
LICENSE_EXTENSION="-ALLOS"
elif [ "$PLATFORM_QWS" = "yes" ]; then
case $PlatformCode in
2|4|8|A|B|E|G|J|K|P|Q|S|U|V|W)
# Qt for Embedded Linux
LICENSE_EXTENSION="-EMBEDDED"
;;
*)
echo
echo "You are not licensed for Qt for Embedded Linux."
echo
echo "Please contact qt-info@nokia.com to upgrade your license"
echo "to include Qt for Embedded Linux, 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
2|4|5|7|9|B|C|E|F|G|L|M|U|W|Y)
# Qt/Mac
LICENSE_EXTENSION="-DESKTOP"
;;
3|6|8|A|D|H|J|K|P|Q|S|V)
# Embedded no-deploy
LICENSE_EXTENSION="-EMBEDDED"
;;
*)
echo
echo "You are not licensed for the Qt/Mac platform."
echo
echo "Please contact qt-info@nokia.com to upgrade your license"
echo "to include the Qt/Mac platform."
exit 1
;;
esac
else
case $PlatformCode in
2|3|4|5|7|D|E|F|J|M|Q|S|T|V|Z)
# Qt/X11
LICENSE_EXTENSION="-DESKTOP"
;;
6|8|9|A|B|C|G|H|K|P|U|W)
# Embedded no-deploy
LICENSE_EXTENSION="-EMBEDDED"
;;
*)
echo
echo "You are not licensed for the Qt/X11 platform."
echo
echo "Please contact qt-info@nokia.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
if test -r "$relpath/.LICENSE"; then
# Generic, non-final license
LICENSE_EXTENSION=""
line=`sed 'y/a-z/A-Z/;q' "$relpath"/.LICENSE`
case "$line" in
*BETA*)
Edition=Beta
;;
*TECHNOLOGY?PREVIEW*)
Edition=Preview
;;
*EVALUATION*)
Edition=Evaluation
;;
*)
echo >&2 "Invalid license files; cannot continue"
exit 1
;;
esac
Licensee="$Edition"
EditionString="$Edition"
QT_EDITION="QT_EDITION_DESKTOP"
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-EVALUATION-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-EVALUATION" "$outpath/LICENSE"
;;
esac
;;
*)
echo
echo "Invalid license key. Please check the license key."
exit 1
;;
esac
if [ '!' -f "$outpath/LICENSE" ]; then
echo "The LICENSE, LICENSE.GPL3 LICENSE.LGPL 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
elif [ $COMMERCIAL_USER = "no" ]; then
# Open Source edition - may only be used under the terms of the GPL or LGPL.
[ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
Licensee="Open Source"
Edition="OpenSource"
EditionString="Open Source"
QT_EDITION="QT_EDITION_OPENSOURCE"
fi
#-------------------------------------------------------------------------------
# initalize variables
#-------------------------------------------------------------------------------
SYSTEM_VARIABLES="CC CXX CFLAGS CXXFLAGS LDFLAGS"
for varname in $SYSTEM_VARIABLES; do
qmakevarname="${varname}"
# use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
if [ "${varname}" = "LDFLAGS" ]; then
qmakevarname="LFLAGS"
fi
cmd=`echo \
'if [ -n "\$'${varname}'" ]; then
QMakeVar set QMAKE_'${qmakevarname}' "\$'${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 [ "$CFG_DEV" = "yes" ]; 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_SCRIPTTOOLS=auto # (yes|no|auto)
CFG_XMLPATTERNS=auto # (yes|no|auto)
CFG_INCREMENTAL=auto
CFG_QCONFIG=full
CFG_DEBUG=auto
CFG_MYSQL_CONFIG=
CFG_DEBUG_RELEASE=no
CFG_SHARED=yes
CFG_SM=auto
CFG_XSHAPE=auto
CFG_XSYNC=auto
CFG_XINERAMA=runtime
CFG_XFIXES=runtime
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=runtime
CFG_XRANDR=runtime
CFG_XRENDER=auto
CFG_MITSHM=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 docs translations"
CFG_BUILD_PARTS=""
CFG_NOBUILD_PARTS=""
CFG_RELEASE_QMAKE=no
CFG_PHONON=auto
CFG_PHONON_BACKEND=yes
CFG_SVG=yes
CFG_WEBKIT=auto # (yes|no|auto)
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
CFG_ARCH=
CFG_HOST_ARCH=
CFG_KBD_PLUGIN_AVAILABLE=
CFG_KBD_PLUGIN=
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_XINPUT=runtime
CFG_XKB=auto
CFG_NIS=auto
CFG_CUPS=auto
CFG_ICONV=auto
CFG_DBUS=auto
CFG_GLIB=auto
CFG_GSTREAMER=auto
CFG_QGTKSTYLE=auto
CFG_LARGEFILE=auto
CFG_OPENSSL=auto
CFG_PTMALLOC=no
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=all
CFG_USER_BUILD_KEY=
CFG_ACCESSIBILITY=auto
CFG_QT3SUPPORT=yes
CFG_ENDIAN=auto
CFG_HOST_ENDIAN=auto
CFG_DOUBLEFORMAT=auto
CFG_ARMFPA=auto
CFG_IWMMXT=no
CFG_CLOCK_GETTIME=auto
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=
MAC_ARCHS_COMMANDLINE=
CFG_MAC_DWARF2=auto
CFG_MAC_XARCH=auto
CFG_MAC_CARBON=yes
CFG_MAC_COCOA=auto
COMMANDLINE_MAC_COCOA=no
CFG_SXE=no
CFG_PREFIX_INSTALL=yes
CFG_SDK=
D_FLAGS=
I_FLAGS=
L_FLAGS=
RPATH_FLAGS=
l_FLAGS=
QCONFIG_FLAGS=
XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++"
PLATFORM=$QMAKESPEC
QT_CROSS_COMPILE=no
OPT_CONFIRM_LICENSE=no
OPT_SHADOW=maybe
OPT_FAST=auto
OPT_VERBOSE=no
OPT_HELP=
CFG_SILENT=no
CFG_GRAPHICS_SYSTEM=default
# 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=
QT_HOST_PREFIX=
#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=
# flags for GStreamer (X11 only)
QT_CFLAGS_GSTREAMER=
QT_LIBS_GSTREAMER=
#-------------------------------------------------------------------------------
# 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_KBD_PLUGIN_AVAILABLE=
if [ -d "$relpath/src/plugins/kbddrivers" ]; then
for a in "$relpath/src/plugins/kbddrivers/"*; do
if [ -d "$a" ]; then
base_a=`basename $a`
CFG_KBD_PLUGIN_AVAILABLE="${CFG_KBD_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|-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|-svg|-webkit|-scripttools|-rpath|-force-pkg-config)
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|-host-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
;;
-opengl)
VAR=opengl
# this option may or may not be followed by an argument
if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
VAL=yes
else
shift;
VAL=$1
fi
;;
-hostprefix)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
# this option may or may not be followed by an argument
if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
VAL=$outpath
else
shift;
VAL=$1
fi
;;
-host-*-endian)
VAR=host_endian
VAL=`echo $1 | sed "s,^-.*-\(.*\)-.*,\1,"`
;;
-*-endian)
VAR=endian
VAL=`echo $1 | sed "s,^-\(.*\)-.*,\1,"`
;;
-qtnamespace)
VAR="qtnamespace"
shift
VAL="$1"
;;
-graphicssystem)
VAR="graphicssystem"
shift
VAL=$1
;;
-qtlibinfix)
VAR="qtlibinfix"
shift
VAL="$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"
;;
hostprefix)
QT_HOST_PREFIX="$VAL"
;;
force-pkg-config)
QT_FORCE_PKGCONFIG=yes
;;
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"
;;
qtnamespace)
QT_NAMESPACE="$VAL"
;;
qtlibinfix)
QT_LIBINFIX="$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 Qt for Embedded Linux. 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
;;
host_endian)
if [ "$VAL" = "little" ]; then
CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
elif [ "$VAL" = "big" ]; then
CFG_HOST_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" = "auto" ] || [ "$VAL" = "desktop" ] ||
[ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
[ "$VAL" = "es1cl" ] || [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then
CFG_OPENGL="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
graphicssystem)
if [ "$PLATFORM_QWS" = "yes" ]; then
echo "Error: Graphics System plugins are not supported on QWS."
echo " On QWS, the graphics system API is part of the QScreen plugin architecture "
echo " rather than existing as a separate plugin."
echo ""
UNKNOWN_OPT=yes
else
if [ "$VAL" = "opengl" ]; then
CFG_GRAPHICS_SYSTEM="opengl"
elif [ "$VAL" = "raster" ]; then
CFG_GRAPHICS_SYSTEM="raster"
else
UNKNOWN_OPT=yes
fi
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 [ "$PLATFORM_MAC" = "yes" ]; then
PLATFORM_MAC=no
elif [ "$PLATFORM_QWS" = "yes" ]; then
PLATFORM_QWS=no
fi
if [ "$CFG_FRAMEWORK" = "auto" ]; then
CFG_FRAMEWORK=no
fi
PLATFORM_X11=yes
;;
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
CFG_ARCH=$VAL
fi
;;
host-arch)
CFG_HOST_ARCH=$VAL
;;
universal)
if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86 ppc"
else
UNKNOWN_OPT=yes
fi
;;
cocoa)
if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
CFG_MAC_COCOA="$VAL"
COMMANDLINE_MAC_COCOA="$VAL"
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"
;;
developer-build|commercial|opensource|nokia-developer)
# These switches have been dealt with already
;;
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" ] || [ "$VAL" = "runtime" ]; then
CFG_XINERAMA="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
xshape)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_XSHAPE="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
xsync)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_XSYNC="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
xinput)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
CFG_XINPUT="$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
;;
iwmmxt)
CFG_IWMMXT="yes"
;;
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
# No longer supported:
#[ "$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" ] || [ "$VAL" = "runtime" ]; then
CFG_XCURSOR="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
xfixes)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
CFG_XFIXES="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
xrandr)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
CFG_XRANDR="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
xrender)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_XRENDER="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
mitshm)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_MITSHM="$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
;;
gstreamer)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_GSTREAMER="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
gtkstyle)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_QGTKSTYLE="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
qdbus|dbus)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ]; then
CFG_DBUS="$VAL"
elif [ "$VAL" = "runtime" ]; then
CFG_DBUS="yes"
else
UNKNOWN_OPT=yes
fi
;;
dbus-linked)
if [ "$VAL" = "yes" ]; then
CFG_DBUS="linked"
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
;;
openssl-linked)
if [ "$VAL" = "yes" ]; then
CFG_OPENSSL="linked"
else
UNKNOWN_OPT=yes
fi
;;
ptmalloc)
if [ "$VAL" = "yes" ]; then
CFG_PTMALLOC="yes"
else
UNKNOWN_OPT=yes
fi
;;
xmlpatterns)
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
CFG_XMLPATTERNS="yes"
else
if [ "$VAL" = "no" ]; then
CFG_XMLPATTERNS="no"
else
UNKNOWN_OPT=yes
fi
fi
;;
scripttools)
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
CFG_SCRIPTTOOLS="yes"
else
if [ "$VAL" = "no" ]; then
CFG_SCRIPTTOOLS="no"
else
UNKNOWN_OPT=yes
fi
fi
;;
svg)
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
CFG_SVG="yes"
else
if [ "$VAL" = "no" ]; then
CFG_SVG="no"
else
UNKNOWN_OPT=yes
fi
fi
;;
webkit)
if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
CFG_WEBKIT="yes"
else
if [ "$VAL" = "no" ]; then
CFG_WEBKIT="no"
else
UNKNOWN_OPT=yes
fi
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"
if [ "$OPT" = "plugin" ]; then
avail="$CFG_KBD_PLUGIN_AVAILABLE"
fi
;;
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" = "kbd" ] && QMakeVar del "${VAR}s" "$VAL"
[ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_KBD_PLUGIN="$CFG_KBD_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"
;;
phonon)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_PHONON="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
phonon-backend)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_PHONON_BACKEND="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
*)
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
# update QT_CONFIG to show our current predefined configuration
case "$CFG_QCONFIG" in
minimal|small|medium|large|full)
# these are a sequence of increasing functionality
for c in minimal small medium large full; do
QT_CONFIG="$QT_CONFIG $c-config"
[ "$CFG_QCONFIG" = $c ] && break
done
;;
*)
# not known to be sufficient for anything
if [ '!' -f "$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" ]; then
echo >&2 "Error: configuration file not found:"
echo >&2 " $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h"
OPT_HELP=yes
fi
esac
#-------------------------------------------------------------------------------
# build tree initialization
#-------------------------------------------------------------------------------
# where to find which..
unixtests="$relpath/config.tests/unix"
mactests="$relpath/config.tests/mac"
WHICH="$unixtests/which.test"
PERL=`$WHICH perl 2>/dev/null`
# 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 Qt for Embedded Linux"
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 [ "$CFG_DEV" = "yes" ]; 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..."
if [ -z "$PERL" ]; then
echo
echo "You need perl in your PATH to make a shadow build."
echo "Cannot proceed."
exit 1
fi
[ -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 "$relpath/bin/syncqt" ]; then
mkdir -p "$outpath/bin"
echo "#!/bin/sh" >"$outpath/bin/syncqt"
echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/syncqt"
echo "perl \"$relpath/bin/syncqt\" -outdir \"$outpath\" $*" >>"$outpath/bin/syncqt"
chmod 755 "$outpath/bin/syncqt"
fi
# symlink the mkspecs directory
mkdir -p "$outpath/mkspecs"
rm -f "$outpath"/mkspecs/*
ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
rm -f "$outpath/mkspecs/default"
# 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 [ "$CFG_DEV" = "yes" ]; 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
# symlink fonts to be able to run application from build directory
if [ "$PLATFORM_QWS" = "yes" ] && [ ! -e "${outpath}/lib/fonts" ]; then
if [ "$PLATFORM" = "$XPLATFORM" ]; then
mkdir -p "${outpath}/lib"
ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
fi
fi
if [ "$OPT_FAST" = "auto" ]; then
if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then
OPT_FAST=yes
else
OPT_FAST=no
fi
fi
# find a make command
if [ -z "$MAKE" ]; then
MAKE=
for mk in gmake 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++
;;
*ppc)
PLATFORM=qws/linux-ppc-g++
;;
*)
PLATFORM=qws/linux-generic-g++
;;
esac
fi
if [ -z "$XPLATFORM" ]; then
if [ "$CFG_EMBEDDED" = "auto" ]; then
if [ -n "$CFG_ARCH" ]; then
CFG_EMBEDDED=$CFG_ARCH
else
case "$UNAME_MACHINE" in
*86)
CFG_EMBEDDED=x86
;;
*86_64)
CFG_EMBEDDED=x86_64
;;
*ppc)
CFG_EMBEDDED=ppc
;;
*)
CFG_EMBEDDED=generic
;;
esac
fi
fi
XPLATFORM="qws/linux-$CFG_EMBEDDED-g++"
fi
;;
CYGWIN*:*)
CFG_EMBEDDED=x86
;;
*)
echo "Qt for Embedded Linux 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:*)
case "$UNAME_MACHINE" in
ia64)
#PLATFORM=hpuxi-acc-32
PLATFORM=hpuxi-acc-64
PLATFORM_NOTES="
- Also available for HP-UXi: hpuxi-acc-32
"
;;
*)
#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
"
;;
esac
;;
OSF1:*)
#PLATFORM=tru64-g++
PLATFORM=tru64-cxx
PLATFORM_NOTES="
- Also available for Tru64: tru64-g++
"
;;
Linux:*)
case "$UNAME_MACHINE" in
x86_64|s390x|ppc64)
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
if [ "$PLATFORM_QWS" = "yes" ]; then
CFG_SM=no
PLATFORMS=`find "$relpath/mkspecs/qws" | sed "s,$relpath/mkspecs/qws/,,"`
else
PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mkspecs/qws/,,"`
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
QT_CROSS_COMPILE=yes
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
[ "$CFG_EMBEDDED" = "no" ] \
&& [ '!' -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 [ "$CFG_EMBEDDED" != "no" -a "$CFG_EMBEDDED" != "auto" ] && [ -n "$CFG_ARCH" ]; then
if [ "$CFG_ARCH" != "$CFG_EMBEDDED" ]; then
echo ""
echo "You have specified a target architecture with -embedded and -arch."
echo "The two architectures you have specified are different, so we can"
echo "not proceed. Either set both to be the same, or only use -embedded."
echo ""
exit 1
fi
fi
if [ -z "${CFG_HOST_ARCH}" ]; then
case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in
IRIX*:*:*)
CFG_HOST_ARCH=`uname -p`
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " SGI ($CFG_HOST_ARCH)"
fi
;;
SunOS:5*:*)
case "$UNAME_MACHINE" in
sun4u*|sun4v*)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " Sun SPARC (sparc)"
fi
CFG_HOST_ARCH=sparc
;;
i86pc)
case "$PLATFORM" in
*-64)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " 64-bit AMD 80x86 (x86_64)"
fi
CFG_HOST_ARCH=x86_64
;;
*)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " 32-bit Intel 80x86 (i386)"
fi
CFG_HOST_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
CFG_HOST_ARCH=macosx
;;
AIX:*:00????????00)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " 64-bit IBM PowerPC (powerpc)"
fi
CFG_HOST_ARCH=powerpc
;;
HP-UX:*:9000*)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " HP PA-RISC (parisc)"
fi
CFG_HOST_ARCH=parisc
;;
*:*:i?86)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " 32-bit Intel 80x86 (i386)"
fi
CFG_HOST_ARCH=i386
;;
*:*:x86_64|*:*:amd64)
if [ "$PLATFORM" = "linux-g++-32" -o "$PLATFORM" = "linux-icc-32" ]; then
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " 32 bit on 64-bit AMD 80x86 (i386)"
fi
CFG_HOST_ARCH=i386
else
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " 64-bit AMD 80x86 (x86_64)"
fi
CFG_HOST_ARCH=x86_64
fi
;;
*:*:ppc)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " 32-bit PowerPC (powerpc)"
fi
CFG_HOST_ARCH=powerpc
;;
*:*:ppc64)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " 64-bit PowerPC (powerpc)"
fi
CFG_HOST_ARCH=powerpc
;;
*:*:s390*)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " IBM S/390 (s390)"
fi
CFG_HOST_ARCH=s390
;;
*:*:arm*)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " ARM (arm)"
fi
CFG_HOST_ARCH=arm
;;
Linux:*:sparc*)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " Linux on SPARC"
fi
CFG_HOST_ARCH=sparc
;;
*:*:*)
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " Trying '$UNAME_MACHINE'..."
fi
CFG_HOST_ARCH="$UNAME_MACHINE"
;;
esac
fi
if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
if [ -n "$CFG_ARCH" ]; then
CFG_EMBEDDED=$CFG_ARCH
fi
case "$CFG_EMBEDDED" in
x86)
CFG_ARCH=i386
;;
x86_64)
CFG_ARCH=x86_64
;;
ipaq|sharp)
CFG_ARCH=arm
;;
dm7000)
CFG_ARCH=powerpc
;;
dm800)
CFG_ARCH=mips
;;
sh4al)
CFG_ARCH=sh4a
;;
*)
CFG_ARCH="$CFG_EMBEDDED"
;;
esac
elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
CFG_ARCH=$CFG_HOST_ARCH
fi
if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " '$CFG_ARCH' is supported"
fi
else
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " '$CFG_ARCH' is unsupported, using 'generic'"
fi
CFG_ARCH=generic
fi
if [ "$CFG_HOST_ARCH" != "$CFG_ARCH" ]; then
if [ -d "$relpath/src/corelib/arch/$CFG_HOST_ARCH" ]; then
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " '$CFG_HOST_ARCH' is supported"
fi
else
if [ "$OPT_VERBOSE" = "yes" ]; then
echo " '$CFG_HOST_ARCH' is unsupported, using 'generic'"
fi
CFG_HOST_ARCH=generic
fi
fi
if [ "$OPT_VERBOSE" = "yes" ]; then
echo "System architecture: '$CFG_ARCH'"
if [ "$PLATFORM_QWS" = "yes" ]; then
echo "Host architecture: '$CFG_HOST_ARCH'"
fi
fi
#-------------------------------------------------------------------------------
# tests that don't need qmake (must be run before displaying help)
#-------------------------------------------------------------------------------
if [ -z "$PKG_CONFIG" ]; then
# See if PKG_CONFIG is set in the mkspec:
PKG_CONFIG=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%PKG_CONFIG[^_].*=%%p' | tr '\n' ' '`
fi
if [ -z "$PKG_CONFIG" ]; then
PKG_CONFIG=`$WHICH pkg-config 2>/dev/null`
fi
# Work out if we can use pkg-config
if [ "$QT_CROSS_COMPILE" = "yes" ]; then
if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then
echo >&2 ""
echo >&2 "You have asked to use pkg-config and are cross-compiling."
echo >&2 "Please make sure you have a correctly set-up pkg-config"
echo >&2 "environment!"
echo >&2 ""
if [ -z "$PKG_CONFIG_PATH" ]; then
echo >&2 ""
echo >&2 "Warning: PKG_CONFIG_PATH has not been set. This could mean"
echo >&2 "the host compiler's .pc files will be used. This is probably"
echo >&2 "not what you want."
echo >&2 ""
elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
echo >&2 ""
echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not"
echo >&2 "been set. This means your toolchain's .pc files must contain"
echo >&2 "the paths to the toolchain's libraries & headers. If configure"
echo >&2 "tests are failing, please check these files."
echo >&2 ""
fi
else
PKG_CONFIG=""
fi
fi
# process CFG_MAC_ARCHS
if [ "$PLATFORM_MAC" = "yes" ]; then
# check -arch arguments for validity.
ALLOWED="x86 ppc x86_64 ppc64 i386"
# Save the list so we can re-write it using only valid values
CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS"
CFG_MAC_ARCHS=
for i in $CFG_MAC_ARCHS_IN
do
if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then
echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64";
exit 2;
fi
if [ "$i" = "i386" -o "$i" = "x86" ]; then
# These are synonymous values
# CFG_MAC_ARCHS requires x86 while GCC requires i386
CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86"
MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch i386"
else
CFG_MAC_ARCHS="$CFG_MAC_ARCHS $i"
MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch $i"
fi
done
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
QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
TEST_COMPILER="$CC"
[ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
# 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" == "auto" ]; then
if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
CFG_MAC_DWARF2=no
else
CFG_MAC_DWARF2=yes
fi
fi
# auto-detect support for -Xarch on the mac
if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" == "auto" ]; then
if "$mactests/xarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
CFG_MAC_XARCH=no
else
CFG_MAC_XARCH=yes
fi
fi
# don't autodetect support for separate debug info on objcopy when
# cross-compiling as lots of toolchains seems to have problems with this
if [ "$QT_CROSS_COMPILE" = "yes" ] && [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then