2 #############################################################################
4 ## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
5 ## Contact: http://www.qt-project.org/
7 ## This file is the build configuration utility of the Qt Toolkit.
9 ## $QT_BEGIN_LICENSE:LGPL$
10 ## GNU Lesser General Public License Usage
11 ## This file may be used under the terms of the GNU Lesser General Public
12 ## License version 2.1 as published by the Free Software Foundation and
13 ## appearing in the file LICENSE.LGPL included in the packaging of this
14 ## file. Please review the following information to ensure the GNU Lesser
15 ## General Public License version 2.1 requirements will be met:
16 ## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ## In addition, as a special exception, Nokia gives you certain additional
19 ## rights. These rights are described in the Nokia Qt LGPL Exception
20 ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 ## GNU General Public License Usage
23 ## Alternatively, this file may be used under the terms of the GNU General
24 ## Public License version 3.0 as published by the Free Software Foundation
25 ## and appearing in the file LICENSE.GPL included in the packaging of this
26 ## file. Please review the following information to ensure the GNU General
27 ## Public License version 3.0 requirements will be met:
28 ## http://www.gnu.org/copyleft/gpl.html.
31 ## Alternatively, this file may be used in accordance with the terms and
32 ## conditions contained in a signed written agreement between you and Nokia.
41 #############################################################################
43 #-------------------------------------------------------------------------------
44 # script initialization
45 #-------------------------------------------------------------------------------
47 # the name of this script
49 # the directory of this script is the "source tree"
51 relpath=`(cd "$relpath"; /bin/pwd)`
52 # the current directory is the "build tree" or "object tree"
55 #license file location
56 LICENSE_FILE="$QT_LICENSE_FILE"
57 [ -z "$LICENSE_FILE" ] && LICENSE_FILE="$HOME/.qt-license"
58 if [ -f "$LICENSE_FILE" ]; then
59 tr -d '\r' <"$LICENSE_FILE" >"${LICENSE_FILE}.tmp"
60 diff "${LICENSE_FILE}.tmp" "${LICENSE_FILE}" >/dev/null 2>&1 || LICENSE_FILE="${LICENSE_FILE}.tmp"
63 # later cache the command line in config.status
64 OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"`
66 # initialize global variables
73 QMAKE_VARS_FILE=.qmake.vars
74 DEVICE_VARS_FILE=.device.vars
77 :> "$DEVICE_VARS_FILE"
79 #-------------------------------------------------------------------------------
81 #-------------------------------------------------------------------------------
85 echo "$@" | sed 's/ /\ /g'
88 # Adds a new qmake variable to the cache
89 # Usage: QMakeVar mode varname contents
90 # where mode is one of: set, add, del
104 echo >&2 "BUG: wrong command to QMakeVar: $1"
108 echo "$2" "$eq" "$3" >> "$QMAKE_VARS_FILE"
111 # Helper function for getQMakeConf. It parses include statements in
112 # qmake.conf and prints out the expanded file
115 while read line; do case "$line" in
117 inc_file=`echo "$line" | sed -n -e "/^include.*(.*)/s/include.*(\(.*\)).*$/\1/p"`
118 current_dir=`dirname "$1"`
119 conf_file="$current_dir/$inc_file"
120 if [ ! -f "$conf_file" ]; then
121 echo "WARNING: Unable to find file $conf_file" >&2
124 getQMakeConf1 "$conf_file"
126 *load\(device_config\)*)
127 conf_file="$DEVICE_VARS_FILE"
128 if [ ! -f "$conf_file" ]; then
129 echo "WARNING: Unable to find file $conf_file" >&2
132 getQMakeConf1 "$conf_file"
144 values["LITERAL_WHITESPACE"] = " "
145 values["LITERAL_DOLLAR"] = "$"
147 /^[_A-Z0-9.]+[ \t]*\+?=/ {
148 valStart = index($0, "=") + 1
151 if (substr($0, valStart - 2, 1) == "+") {
155 variable = substr($0, 0, valStart - 2 - append)
156 value = substr($0, valStart)
157 gsub("[ \t]+", "", variable)
158 gsub("^[ \t]+", "", value)
159 gsub("[ \t]+$", "", value)
162 while (match(value, /\$\$(\{[_A-Z0-9.]+\}|[_A-Z0-9.]+)/)) {
163 ovalue = ovalue substr(value, 1, RSTART - 1)
164 var = substr(value, RSTART + 2, RLENGTH - 2)
165 value = substr(value, RSTART + RLENGTH)
167 var = substr(var, 2, length(var) - 2)
169 ovalue = ovalue values[var]
171 ovalue = ovalue value
173 combinedValue = values[variable]
174 if (append == 1 && length(combinedValue) > 0) {
175 combinedValue = combinedValue " " ovalue
177 combinedValue = ovalue
179 values[variable] = combinedValue
182 for (var in values) {
183 print var "=" values[var]
191 echo "$2" | $AWK "/^($1)=/ { print substr(\$0, index(\$0, \"=\") + 1) }"
194 # relies on $QMAKESPEC being set correctly. parses include statements in
195 # qmake.conf and prints out the expanded file
198 if [ -z "$specvals" ]; then
199 specvals=`getQMakeConf1 "$QMAKESPEC/qmake.conf" | getQMakeConf2`
201 getQMakeConf3 "$1" "$specvals"
206 if [ -z "$xspecvals" ]; then
207 xspecvals=`getQMakeConf1 "$XQMAKESPEC/qmake.conf" | getQMakeConf2`
209 getQMakeConf3 "$1" "$xspecvals"
212 # relies on $TEST_COMPILER being set correctly
213 compilerSupportsFlag()
215 cat >conftest.cpp <<EOF
216 int main() { return 0; }
218 "$TEST_COMPILER" "$@" -o conftest.o conftest.cpp
220 rm -f conftest.cpp conftest.o
224 # relies on $TEST_COMPILER being set correctly
230 safe_flag=`shellEscape "$flag"`
231 lflags=$lflags,$safe_flag
233 compilerSupportsFlag "$lflags" >/dev/null 2>&1
236 #-------------------------------------------------------------------------------
238 #-------------------------------------------------------------------------------
246 echo >&2 "BUG: wrong command to QMakeVar: $1"
250 echo "$2" "$eq" "$3" >> "$DEVICE_VARS_FILE"
253 resolveDeviceMkspec()
255 result=$(find "$relpath/mkspecs/devices/" -type d -name "*$1*" | sed "s,^$relpath/mkspecs/,,")
256 match_count=$(echo "$result" | wc -w)
257 if [ "$match_count" -gt 1 ]; then
258 echo >&2 "Error: Multiple matches for device '$1'. Candidates are:"
259 tabbed_result=$(echo "$result" | sed "s,^, ,")
260 echo >&2 "$tabbed_result"
262 elif [ "$match_count" -eq 0 ]; then
263 echo >&2 "Error: No device matching '$1'"
270 #-------------------------------------------------------------------------------
271 # operating system detection
272 #-------------------------------------------------------------------------------
274 # need that throughout the script
275 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
276 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
277 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
278 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
280 # detect the "echo without newline" style. usage: echo $ECHO_N "<string>$ECHO_C"
281 if echo '\c' | grep '\c' >/dev/null; then
287 #-------------------------------------------------------------------------------
288 # window system detection
289 #-------------------------------------------------------------------------------
293 if [ -d /System/Library/Frameworks/Carbon.framework ]; then
298 #-----------------------------------------------------------------------------
299 # Qt version detection
300 #-----------------------------------------------------------------------------
301 QT_VERSION=`grep '^# *define *QT_VERSION_STR' "$relpath"/src/corelib/global/qglobal.h`
305 if [ -n "$QT_VERSION" ]; then
306 QT_VERSION=`echo $QT_VERSION | sed 's,^# *define *QT_VERSION_STR *"*\([^ ]*\)"$,\1,'`
307 MAJOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
308 if [ -n "$MAJOR" ]; then
309 MINOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
310 PATCH=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
311 QT_MAJOR_VERSION="$MAJOR"
312 [ -z "$MINOR" ] || QT_MINOR_VERSION="$MINOR"
313 [ -z "$PATCH" ] || QT_PATCH_VERSION="$PATCH"
316 if [ -z "$QT_MAJOR_VERSION" ]; then
317 echo "Cannot process version from qglobal.h: $QT_VERSION"
318 echo "Cannot proceed."
322 QT_PACKAGEDATE=`grep '^# *define *QT_PACKAGEDATE_STR' "$relpath"/src/corelib/global/qglobal.h | sed -e 's,^# *define *QT_PACKAGEDATE_STR *"\([^ ]*\)"$,\1,' -e s,-,,g`
323 if [ -z "$QT_PACKAGEDATE" ]; then
324 echo "Unable to determine package date from qglobal.h: '$QT_PACKAGEDATE'"
325 echo "Cannot proceed"
329 #-------------------------------------------------------------------------------
331 #-------------------------------------------------------------------------------
335 EditionString=Commercial
339 # parse the arguments, setting things to "yes" or "no"
340 while [ "$#" -gt 0 ]; do
344 #Autoconf style options
346 VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
350 VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
354 VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
355 VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
358 VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
361 -h|help|--help|-help)
362 if [ "$VAL" = "yes" ]; then
364 COMMERCIAL_USER="no" #doesn't matter we will display the help
367 COMMERCIAL_USER="no" #doesn't matter we will display the help
371 VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
375 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
382 if [ "$UNKNOWN_ARG" = "yes" ]; then
394 COMMERCIAL_USER="yes"
408 if [ "$COMMERCIAL_USER" = "ask" ]; then
410 echo "Which edition of Qt do you want to use ?"
412 echo "Type 'c' if you want to use the Commercial Edition."
413 echo "Type 'o' if you want to use the Open Source Edition."
417 if [ "$commercial" = "c" ]; then
418 COMMERCIAL_USER="yes"
420 elif [ "$commercial" = "o" ]; then
427 if [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then
428 # Commercial preview release
429 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
432 QT_EDITION="QT_EDITION_DESKTOP"
433 LicenseType="Technology Preview"
434 elif [ $COMMERCIAL_USER = "yes" ]; then
435 # one of commercial editions
436 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
438 # read in the license file
439 if [ -f "$LICENSE_FILE" ]; then
440 . "$LICENSE_FILE" >/dev/null 2>&1
441 if [ -z "$LicenseKeyExt" ]; then
443 echo "You are using an old license file."
445 echo "Please install the license file supplied by Nokia,"
446 echo "or install the Qt Open Source Edition if you intend to"
447 echo "develop free software."
450 if [ -z "$Licensee" ]; then
452 echo "Invalid license key. Please check the license key."
456 if [ -z "$LicenseKeyExt" ]; then
458 echo $ECHO_N "Please enter your license key: $ECHO_C"
460 Licensee="Unknown user"
465 echo "$LicenseKeyExt" | grep ".....*-....*-....*-....*-.....*-.....*-...." >/dev/null 2>&1 \
466 && LicenseValid="yes" \
468 if [ "$LicenseValid" != "yes" ]; then
470 echo "Invalid license key. Please check the license key."
473 ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1`
474 PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d -`
475 LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -`
476 LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1`
478 # determine which edition we are licensed to use
479 case "$LicenseTypeCode" in
481 LicenseType="Commercial"
485 QT_EDITION="QT_EDITION_UNIVERSAL"
488 Edition="FullFramework"
489 EditionString="Full Framework"
490 QT_EDITION="QT_EDITION_DESKTOP"
493 Edition="GUIFramework"
494 EditionString="GUI Framework"
495 QT_EDITION="QT_EDITION_DESKTOPLIGHT"
500 LicenseType="Evaluation"
501 QMakeVar add DEFINES QT_EVAL
505 QT_EDITION="QT_EDITION_EVALUATION"
510 if [ -z "$LicenseType" -o -z "$Edition" -o -z "$QT_EDITION" ]; then
512 echo "Invalid license key. Please check the license key."
516 # verify that we are licensed to use Qt on this platform
518 case "$PlatformCode" in
521 PlatformCode=`echo "$PlatformCode" | sed 'h;y/8NPQRTZ/UCWX9M7/;x;G;s/\(.\)....\(.\)./\1\2/'`
525 PlatformCode=`echo "$PlatformCode" | sed 's/.$//'`
528 ### EMBEDDED_QPA logic missing ###
529 case "$PlatformCode,$PLATFORM_MAC" in
530 X9,* | XC,* | XU,* | XW,* | XM,*)
532 LICENSE_EXTENSION="-ALLOS"
534 8M,* | KM,* | S9,* | SC,* | SM,* | SU,* | SW,* | X9,* | XC,* | XU,* | XW,*)
535 # Qt for Embedded Linux
536 LICENSE_EXTENSION="-EMBEDDED"
538 6M,* | N7,* | N9,* | NX,*)
540 LICENSE_EXTENSION="-EMBEDDED"
542 FM,* | LM,yes | ZM,no)
544 LICENSE_EXTENSION="-DESKTOP"
548 [ "$PLATFORM_MAC" = "yes" ] && Platform='Mac OS X'
550 echo "You are not licensed for the $Platform platform."
552 echo "Please contact qt-info@nokia.com to upgrade your license to"
553 echo "include the $Platform platform, or install the Qt Open Source Edition"
554 echo "if you intend to develop free software."
559 if test -r "$relpath/.LICENSE"; then
560 # Generic, non-final license
562 line=`sed 'y/a-z/A-Z/;q' "$relpath"/.LICENSE`
567 *TECHNOLOGY?PREVIEW*)
574 echo >&2 "Invalid license files; cannot continue"
579 EditionString="$Edition"
580 QT_EDITION="QT_EDITION_DESKTOP"
583 case "$LicenseFeatureCode" in
586 case "$LicenseType" in
588 cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-US" "$outpath/LICENSE"
591 cp -f "$relpath/.LICENSE-EVALUATION-US" "$outpath/LICENSE"
597 case "$LicenseType" in
599 cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}" "$outpath/LICENSE"
602 cp -f "$relpath/.LICENSE-EVALUATION" "$outpath/LICENSE"
608 echo "Invalid license key. Please check the license key."
612 case "$LicenseFeatureCode" in
620 if [ '!' -f "$outpath/LICENSE" ]; then
621 echo "The LICENSE, LICENSE.GPL3 LICENSE.LGPL file shipped with"
622 echo "this software has disappeared."
624 echo "Sorry, you are not licensed to use this software."
625 echo "Try re-installing."
629 elif [ $COMMERCIAL_USER = "no" ]; then
630 # Open Source edition - may only be used under the terms of the GPL or LGPL.
631 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
632 Licensee="Open Source"
634 EditionString="Open Source"
635 QT_EDITION="QT_EDITION_OPENSOURCE"
638 #-------------------------------------------------------------------------------
639 # initalize variables
640 #-------------------------------------------------------------------------------
642 SYSTEM_VARIABLES="RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS"
643 for varname in $SYSTEM_VARIABLES; do
644 qmakevarname="${varname}"
645 # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
646 if [ "${varname}" = "LDFLAGS" ]; then
647 qmakevarname="LFLAGS"
648 elif [ "${varname}" = "LD" ]; then
652 'if [ -n "\$'${varname}'" ]; then
653 QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}'"
657 # Use CC/CXX to run config.tests
658 mkdir -p "$outpath/config.tests"
659 rm -f "$outpath/config.tests/.qmake.cache"
660 cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
662 QMakeVar add styles "cde mac motif plastique cleanlooks windows"
664 # QTDIR may be set and point to an old or system-wide Qt installation
667 # the minimum version of libdbus-1 that we require:
668 MIN_DBUS_1_VERSION=0.93
670 # initalize internal variables
671 CFG_CONFIGURE_EXIT_ON_ERROR=yes
673 CFG_GUI=auto # (yes|no|auto)
699 CFG_OPENVG_LC_INCLUDES=no
700 CFG_OPENVG_SHIVA=auto
701 CFG_OPENVG_ON_OPENGL=auto
707 QT_DEFAULT_BUILD_PARTS="libs examples"
711 CFG_AUDIO_BACKEND=auto
714 CFG_JAVASCRIPTCORE_JIT=auto
717 # Target architecture
720 # Host architecture, same as CFG_ARCH when not cross-compiling
722 CFG_HOST_CPUFEATURES=
723 # Set when the -arch or -host-arch arguments are used
724 OPT_OBSOLETE_HOST_ARG=no
736 CFG_OBSOLETE_WAYLAND=no
748 CFG_SEPARATE_DEBUG_INFO=no
749 CFG_SEPARATE_DEBUG_INFO_NOCOPY=no
750 CFG_REDUCE_EXPORTS=auto
758 CFG_REDUCE_RELOCATIONS=auto
759 CFG_ACCESSIBILITY=auto
764 CFG_CLOCK_GETTIME=auto
765 CFG_CLOCK_MONOTONIC=auto
773 MAC_CONFIG_TEST_COMMANDLINE= # used to make the configure tests run with the correct arch's and SDK settings
776 CFG_PREFIX_INSTALL=yes
786 XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++"
787 XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*)
792 OPT_CONFIRM_LICENSE=no
805 QPA_PLATFORM_GUARD=yes
808 # initalize variables used for installation
817 QT_INSTALL_TRANSLATIONS=
826 #flags for SQL drivers
834 QT_LFLAGS_ODBC="-lodbc"
837 # flags for libdbus-1
841 # flags for Glib (X11 only)
845 # flags for GStreamer (X11 only)
849 # default qpa platform
850 QT_QPA_DEFAULT_PLATFORM=
852 #-------------------------------------------------------------------------------
853 # check SQL drivers available in this package
854 #-------------------------------------------------------------------------------
856 # opensource version removes some drivers, so force them to be off
862 if [ -d "$relpath/src/plugins/sqldrivers" ]; then
863 for a in "$relpath/src/plugins/sqldrivers/"*; do
865 base_a=`basename "$a"`
866 CFG_SQL_AVAILABLE="${CFG_SQL_AVAILABLE} ${base_a}"
867 eval "CFG_SQL_${base_a}=auto"
872 CFG_IMAGEFORMAT_PLUGIN_AVAILABLE=
873 if [ -d "$relpath/src/plugins/imageformats" ]; then
874 for a in "$relpath/src/plugins/imageformats/"*; do
876 base_a=`basename "$a"`
877 CFG_IMAGEFORMAT_PLUGIN_AVAILABLE="${CFG_IMAGEFORMAT_PLUGIN_AVAILABLE} ${base_a}"
882 #-------------------------------------------------------------------------------
883 # parse command line arguments
884 #-------------------------------------------------------------------------------
886 # parse the arguments, setting things to "yes" or "no"
887 while [ "$#" -gt 0 ]; do
891 #Autoconf style options
893 VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
897 VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
901 VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
902 VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
905 VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
909 VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
913 -no-*-*|-plugin-*-*|-qt-*-*)
914 VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
915 VAL=`echo $1 | sed "s,^-\([^-]*\).*,\1,"`
919 VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"`
922 #Qt style options that pass an argument
925 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
929 -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa)
930 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
934 #Qt style complex options in one command
935 -enable-*|-disable-*)
936 VAR=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
937 VAL=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
939 #Qt Builtin/System style options
940 -no-*|-system-*|-qt-*)
941 VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
942 VAL=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
944 #Options that cannot be generalized
951 # this option may or may not be followed by an argument
952 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
961 # this option may or may not be followed by an argument
962 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
970 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
971 # this option may or may not be followed by an argument
972 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
991 if [ "$1" = "-D" ]; then
995 VAL=`echo $1 | sed 's,-D,,'`
1000 # this option may or may not be followed by an argument
1001 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
1010 if [ "$1" = "-I" ]; then
1014 VAL=`echo $1 | sed 's,-I,,'`
1019 if [ "$1" = "-L" ]; then
1023 VAL=`echo $1 | sed 's,-L,,'`
1028 if [ "$1" = "-R" ]; then
1032 VAL=`echo $1 | sed 's,-R,,'`
1037 if [ "$1" = "-l" ]; then
1041 VAL=`echo $1 | sed 's,-l,,'`
1046 if [ "$1" = "-F" ]; then
1050 VAL=`echo $1 | sed 's,-F,,'`
1055 if [ "$1" = "-fw" ]; then
1059 VAL=`echo $1 | sed 's,-fw,,'`
1066 #General options, including Qt style yes options
1068 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1075 if [ "$UNKNOWN_ARG" = "yes" ]; then
1076 echo "$1: unknown argument"
1087 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1088 CFG_ACCESSIBILITY="$VAL"
1097 CFG_USE_GNUMAKE="$VAL"
1100 CFG_MYSQL_CONFIG="$VAL"
1103 QT_INSTALL_PREFIX="$VAL"
1106 QT_HOST_PREFIX="$VAL"
1115 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1116 CFG_PKGCONFIG="$VAL"
1122 CFG_PKGCONFIG="force"
1125 QT_INSTALL_DOCS="$VAL"
1128 QT_INSTALL_HEADERS="$VAL"
1131 QT_INSTALL_PLUGINS="$VAL"
1134 QT_INSTALL_IMPORTS="$VAL"
1137 QT_INSTALL_DATA="$VAL"
1140 QT_INSTALL_LIBS="$VAL"
1149 QT_INSTALL_TRANSLATIONS="$VAL"
1151 sysconfdir|settingsdir)
1152 QT_INSTALL_SETTINGS="$VAL"
1155 QT_INSTALL_EXAMPLES="$VAL"
1158 QT_INSTALL_TESTS="$VAL"
1167 QT_INSTALL_BINS="$VAL"
1173 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1180 if [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
1181 [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
1182 [ "$VAL" = "es2" ]; then
1189 if [ "$VAL" = "auto" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1196 CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL"
1199 CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL"
1202 if [ "$BUILD_ON_MAC" = "yes" ]; then
1209 OPT_OBSOLETE_HOST_ARG=yes
1212 if [ "$BUILD_ON_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1213 CFG_MAC_HARFBUZZ="$VAL"
1220 if [ "$BUILD_ON_MAC" = "yes" ]; then
1221 CFG_FRAMEWORK="$VAL"
1227 if [ "$VAL" = "yes" ]; then
1229 QMakeVar add QMAKE_CFLAGS -pg
1230 QMakeVar add QMAKE_CXXFLAGS -pg
1231 QMakeVar add QMAKE_LFLAGS -pg
1232 QMAKE_VARS="$QMAKE_VARS CONFIG+=nostrip"
1238 if [ "$VAL" = "yes" ]; then
1239 QTCONFIG_CONFIG="$QTCONFIG_CONFIG testcocoon"
1244 # keep compatibility with old platform names
1250 PLATFORM=hpux-acc-o64
1253 PLATFORM=hpux-acc-64
1256 PLATFORM=hpux-acc-64
1268 PLATFORM=reliant-cds-64
1271 PLATFORM=solaris-cc-64
1274 PLATFORM=unixware-cc
1277 PLATFORM=unixware-g++
1280 PLATFORM=unixware-cc
1283 PLATFORM=unixware-g++
1289 i386) NATIVE_64_ARCH="x86_64" ;;
1290 powerpc) NATIVE_64_ARCH="ppc64" ;;
1291 *) echo "WARNING: Can't detect CPU architecture for macx-g++-64" ;;
1293 if [ ! -z "$NATIVE_64_ARCH" ]; then
1294 QTCONFIG_CONFIG="$QTCONFIG_CONFIG $NATIVE_64_ARCH"
1301 case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
1304 XPLATFORM=`resolveDeviceMkspec $VAL`
1305 [ "$XPLATFORM" = "undefined" ] && exit 101
1308 DEV_VAR=`echo $VAL | sed "s,^\(.*\)=.*,\1,"`
1309 DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"`
1310 DeviceVar set $DEV_VAR $DEV_VAL
1313 QT_QPA_DEFAULT_PLATFORM="$VAL"
1316 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1317 CFG_DEBUG_RELEASE="$VAL"
1323 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1324 CFG_RELEASE_QMAKE="$VAL"
1330 if [ "$VAL" = "yes" ]; then
1332 elif [ "$VAL" = "no" ]; then
1339 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1340 CFG_PREFIX_INSTALL="$VAL"
1348 developer-build|commercial|opensource)
1349 # These switches have been dealt with already
1352 if [ "$VAL" = "yes" ]; then
1354 elif [ "$VAL" = "no" ]; then
1361 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1362 CFG_CONFIGURE_EXIT_ON_ERROR="$VAL"
1368 FEATURE=`echo $VAR | sed "s,^[^-]*-\([^-]*\),\1," | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
1369 if [ "$VAL" = "no" ]; then
1370 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE"
1371 elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then
1372 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_$FEATURE"
1378 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1385 if [ "$VAL" = "no" ]; then
1392 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1400 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1407 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1414 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1421 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1428 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1435 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1442 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1449 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1450 CFG_PRECOMPILE="$VAL"
1455 separate-debug-info)
1456 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1457 CFG_SEPARATE_DEBUG_INFO="$VAL"
1458 elif [ "$VAL" = "nocopy" ] ; then
1459 CFG_SEPARATE_DEBUG_INFO="yes"
1460 CFG_SEPARATE_DEBUG_INFO_NOCOPY="yes"
1466 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1467 CFG_REDUCE_EXPORTS="$VAL"
1473 if [ "$VAL" = "no" ]; then
1480 if [ "$VAL" = "no" ]; then
1487 if [ "$VAL" = "no" ]; then
1494 if [ "$VAL" = "no" ]; then
1501 if [ "$VAL" = "no" ]; then
1508 if [ "$VAL" = "no" ]; then
1515 if [ "$VAL" = "no" ]; then
1525 if [ "$VAL" = "no" ]; then
1532 if [ "$VAL" = "no" ]; then
1539 if [ "$VAL" = "no" ]; then
1540 CFG_MIPS_DSPR2="$VAL"
1546 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1547 CFG_REDUCE_RELOCATIONS="$VAL"
1553 [ "$VAL" = "qt" ] && VAL=yes
1554 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1559 # No longer supported:
1560 #[ "$VAL" = "no" ] && CFG_LIBPNG=no
1563 if [ "$VAL" = "system" ]; then
1570 [ "$VAL" = "yes" ] && VAL=qt
1571 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1578 [ "$VAL" = "yes" ] && VAL=qt
1579 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1586 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1593 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1600 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1607 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1614 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1621 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1622 CFG_FONTCONFIG="$VAL"
1628 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1635 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1642 CFG_OBSOLETE_WAYLAND=yes
1645 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1652 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1659 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1666 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1673 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1680 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1687 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1694 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1695 CFG_GSTREAMER="$VAL"
1701 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1702 CFG_QGTKSTYLE="$VAL"
1708 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1711 if [ "$VAL" = "no" ]; then
1719 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1721 elif [ "$VAL" = "no" ]; then
1728 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1729 QPA_PLATFORM_GUARD="$VAL"
1735 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ]; then
1737 elif [ "$VAL" = "runtime" ]; then
1744 if [ "$VAL" = "yes" ]; then
1751 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1758 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1759 CFG_LARGEFILE="$VAL"
1765 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1772 if [ "$VAL" = "yes" ]; then
1773 CFG_OPENSSL="linked"
1779 if [ "$VAL" = "yes" ]; then
1782 if [ "$VAL" = "no" ]; then
1790 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then
1791 CFG_JAVASCRIPTCORE_JIT="$VAL"
1797 if [ "$VAL" = "yes" ]; then
1798 OPT_CONFIRM_LICENSE="$VAL"
1804 if [ "$VAL" = "yes" ]; then
1810 sql-*|imageformat-*)
1811 # if Qt style options were used, $VAL can be "no", "qt", or "plugin"
1812 # if autoconf style options were used, $VAL can be "yes" or "no"
1813 [ "$VAL" = "yes" ] && VAL=qt
1814 # now $VAL should be "no", "qt", or "plugin"... double-check
1815 if [ "$VAL" != "no" ] && [ "$VAL" != "qt" ] && [ "$VAL" != "plugin" ]; then
1818 # now $VAL is "no", "qt", or "plugin"
1820 VAL=`echo $VAR | sed "s,^[^-]*-\([^-]*\).*,\1,"`
1821 VAR=`echo $VAR | sed "s,^\([^-]*\).*,\1,"`
1823 # Grab the available values
1826 avail="$CFG_SQL_AVAILABLE"
1829 avail="$CFG_IMAGEFORMAT_PLUGIN_AVAILABLE"
1830 if [ "$OPT" != "plugin" ]; then
1831 # png is always built in
1837 echo "BUG: Unhandled type $VAR used in $CURRENT_OPT"
1841 # Check that that user's value is available.
1844 if [ "$VAL" = "$d" ]; then
1849 [ "$found" = yes ] || ERROR=yes
1851 if [ "$VAR" = "sql" ]; then
1852 # set the CFG_SQL_driver
1853 eval "CFG_SQL_$VAL=\$OPT"
1855 elif [ "$VAR" = "imageformat" ]; then
1856 [ "$OPT" = "qt" ] && OPT=yes
1857 VAL="`echo $VAL |tr a-z A-Z`"
1858 eval "CFG_$VAL=$OPT"
1862 if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then
1863 if [ "$OPT" = "plugin" ]; then
1866 QMakeVar add "${VAR}s" "${VAL}"
1867 elif [ "$OPT" = "no" ]; then
1868 PLUG_VAR="${VAR}-plugin"
1870 QMakeVar del "${IN_VAR}s" "$VAL"
1871 QMakeVar del "${PLUG_VAR}s" "$VAL"
1873 if [ "$ERROR" = "yes" ]; then
1874 echo "$CURRENT_OPT: unknown argument"
1879 if [ "$VAL" = "yes" ]; then
1880 if [ "$OPT_VERBOSE" = "$VAL" ]; then # takes two verboses to turn on qmake debugs
1881 QMAKE_SWITCHES="$QMAKE_SWITCHES -d"
1885 elif [ "$VAL" = "no" ]; then
1886 if [ "$OPT_VERBOSE" = "$VAL" ] && echo "$QMAKE_SWITCHES" | grep ' -d' >/dev/null 2>&1; then
1887 QMAKE_SWITCHES=`echo $QMAKE_SWITCHES | sed "s, -d,,"`
1896 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1903 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1910 DEFINES="$DEFINES \"$VAL\""
1911 D_FLAGS="$D_FLAGS -D\"$VAL\""
1914 I_FLAGS="$I_FLAGS -I\"${VAL}\""
1917 L_FLAGS="$L_FLAGS -L\"${VAL}\""
1920 RPATH_FLAGS="$RPATH_FLAGS \"${VAL}\""
1923 l_FLAGS="$l_FLAGS -l\"${VAL}\""
1926 if [ "$BUILD_ON_MAC" = "yes" ]; then
1927 L_FLAGS="$L_FLAGS -F\"${VAL}\""
1928 I_FLAGS="$I_FLAGS -F\"${VAL}\""
1934 if [ "$BUILD_ON_MAC" = "yes" ]; then
1935 l_FLAGS="$l_FLAGS -framework \"${VAL}\""
1941 W_FLAGS="$W_FLAGS \"${VAL}\""
1947 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1948 CFG_PHONON_BACKEND="$VAL"
1960 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1961 CFG_AUDIO_BACKEND="$VAL"
1967 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1974 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1975 CFG_FORCE_ASSERTS="$VAL"
1981 if [ "$VAL" = "qt" ] || [ "$VAL" = "system" ]; then
1988 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1998 if [ "$UNKNOWN_OPT" = "yes" ]; then
1999 echo "${CURRENT_OPT}: invalid command-line switch"
2005 # update QT_CONFIG to show our current predefined configuration
2006 case "$CFG_QCONFIG" in
2007 minimal|small|medium|large|full)
2008 # these are a sequence of increasing functionality
2009 for c in minimal small medium large full; do
2010 QT_CONFIG="$QT_CONFIG $c-config"
2011 [ "$CFG_QCONFIG" = $c ] && break
2015 # not known to be sufficient for anything
2016 if [ '!' -f "$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" ] && [ '!' -f `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` ]; then
2017 echo >&2 "Error: configuration file not found:"
2018 echo >&2 " $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h"
2020 echo >&2 " `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"`"
2025 #-------------------------------------------------------------------------------
2026 # build tree initialization
2027 #-------------------------------------------------------------------------------
2029 # where to find which..
2030 unixtests="$relpath/config.tests/unix"
2031 mactests="$relpath/config.tests/mac"
2032 WHICH="$unixtests/which.test"
2034 PERL=`$WHICH perl 2>/dev/null`
2036 # find out which awk we want to use, prefer gawk, then nawk, then regular awk
2038 for e in gawk nawk awk; do
2039 if "$WHICH" $e >/dev/null 2>&1 && ( $e -f /dev/null /dev/null ) >/dev/null 2>&1; then
2046 PERL="/usr/bin/perl"
2047 if "$WHICH" perl >/dev/null 2>&1 && ( perl /dev/null ) >/dev/null 2>&1; then
2051 ### skip this if the user just needs help...
2052 if [ "$OPT_HELP" != "yes" ]; then
2054 # is this a shadow build?
2055 if [ "$OPT_SHADOW" = "maybe" ]; then
2057 if [ "$relpath" != "$outpath" ] && [ '!' -f "$outpath/configure" ]; then
2058 if [ -h "$outpath" ]; then
2059 [ "$relpath" -ef "$outpath" ] || OPT_SHADOW=yes
2065 if [ "$OPT_SHADOW" = "yes" ]; then
2066 if [ -f "$relpath/.qmake.cache" -o -f "$relpath/src/corelib/global/qconfig.h" -o -f "$relpath/src/corelib/global/qconfig.cpp" ]; then
2067 echo >&2 "You cannot make a shadow build from a source tree containing a previous build."
2068 echo >&2 "Cannot proceed."
2071 [ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
2074 if [ "$PLATFORM_MAC" = "no" -a "$CFG_DEBUG_RELEASE" = "yes" ]; then
2076 echo "WARNING: -debug-and-release is not supported outside of Mac OS X."
2077 echo "Qt can be built in release mode with separate debug information, so"
2078 echo "-debug-and-release is not necessary anymore"
2082 if [ "$CFG_SILENT" = "yes" ]; then
2083 QMAKE_CONFIG="$QMAKE_CONFIG silent"
2086 # if the source tree is different from the build tree,
2087 # symlink or copy part of the sources
2088 if [ "$OPT_SHADOW" = "yes" ]; then
2089 echo "Preparing build tree..."
2091 if [ -z "$PERL" ]; then
2093 echo "You need perl in your PATH to make a shadow build."
2094 echo "Cannot proceed."
2098 [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
2100 # make a syncqt script that can be used in the shadow
2101 rm -f "$outpath/bin/syncqt"
2102 if [ -x "$relpath/bin/syncqt" ]; then
2103 mkdir -p "$outpath/bin"
2104 echo "#!/bin/sh" >"$outpath/bin/syncqt"
2105 echo "perl \"$relpath/bin/syncqt\" -qtdir \"$outpath\" \"\$@\"" >>"$outpath/bin/syncqt"
2106 chmod 755 "$outpath/bin/syncqt"
2109 for i in elf2e32_qtwrapper createpackage patch_capabilities qtmodule-configtests; do
2110 rm -f "$outpath/bin/$i"
2111 if [ -x "$relpath/bin/$i" ]; then
2112 mkdir -p "$outpath/bin"
2113 echo "#!/bin/sh" >"$outpath/bin/$i"
2114 echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/$i"
2115 echo "\"$relpath/bin/$i\" \"\$@\"" >>"$outpath/bin/$i"
2116 chmod 755 "$outpath/bin/$i"
2120 # save a pre-existing mkspecs/modules dir
2121 test -d "$outpath/mkspecs/modules" && \
2122 mv "$outpath/mkspecs/modules" "$outpath/mkspecs-modules"
2124 # symlink the mkspecs directory
2125 mkdir -p "$outpath/mkspecs"
2126 rm -rf "$outpath"/mkspecs/*
2127 ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
2128 rm -f "$outpath/mkspecs/default"
2132 rm -rf "$outpath/mkspecs/$1"
2133 find "$relpath/mkspecs/$1" -type d | sed "s,^$relpath,$outpath," | xargs mkdir -p
2134 find "$relpath/mkspecs/$1" -type f | sed "s,^$relpath/,," | while read f; do ln -s "$relpath/$f" "$outpath/$f"; done
2137 # Special case for mkspecs/features directory.
2138 # To be able to place .prf files into a shadow build directory,
2139 # we're creating links for files only. The directory structure is reproduced.
2140 ShadowMkspecs features
2142 # The modules dir is special, too.
2143 if test -d "$outpath/mkspecs-modules"; then
2144 rm -rf "$outpath/mkspecs/modules"
2145 mv "$outpath/mkspecs-modules" "$outpath/mkspecs/modules"
2147 ShadowMkspecs modules
2150 # symlink the doc directory
2151 rm -rf "$outpath/doc"
2152 ln -s "$relpath/doc" "$outpath/doc"
2155 # symlink fonts to be able to run application from build directory
2156 if [ ! -d "${outpath}/lib/fonts" ]; then
2157 if [ "$PLATFORM" = "$XPLATFORM" ]; then
2158 mkdir -p "${outpath}/lib"
2159 ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
2163 if [ "$OPT_FAST" = "auto" ]; then
2164 if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then
2171 # find a make command
2172 if [ -z "$MAKE" ]; then
2174 for mk in gmake make; do
2175 if "$WHICH" $mk >/dev/null 2>&1; then
2180 if [ -z "$MAKE" ]; then
2181 echo >&2 "You don't seem to have 'make' or 'gmake' in your PATH."
2182 echo >&2 "Cannot proceed."
2185 # export MAKE, we need it later in the config.tests
2191 #-------------------------------------------------------------------------------
2192 # auto-detect all that hasn't been specified in the arguments
2193 #-------------------------------------------------------------------------------
2195 if [ -z "$PLATFORM" ]; then
2197 case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2199 OSX_VERSION=`uname -r | cut -d. -f1`
2200 # Select compiler. Use g++ unless we find a usable Clang version
2202 if [ "$OSX_VERSION" -ge 12 ]; then
2203 # We're on Mountain Lion or above. Use Clang. Don't advertise gcc.
2205 elif [ "$OSX_VERSION" -eq 11 ]; then
2206 # We're on Lion. Check if we have a supported Clang version
2207 case "$(clang -v 2>&1 | grep -Po '(?<=version )\d[\d.]+')" in
2210 PLATFORM_NOTES="\n - Also available for Mac OS X: macx-g++\n"
2217 #PLATFORM=aix-g++-64
2219 #PLATFORM=aix-xlc-64
2221 - Also available for AIX: aix-g++ aix-g++-64 aix-xlc-64
2231 # PLATFORM=dynix-g++
2237 PLATFORM=freebsd-g++
2239 - Also available for FreeBSD: freebsd-icc
2243 PLATFORM=openbsd-g++
2254 #PLATFORM=irix-cc-64
2256 - Also available for IRIX: irix-g++ irix-cc-64
2260 case "$UNAME_MACHINE" in
2262 #PLATFORM=hpuxi-acc-32
2263 PLATFORM=hpuxi-acc-64
2265 - Also available for HP-UXi: hpuxi-acc-32
2271 #PLATFORM=hpux-acc-64
2273 #PLATFORM=hpux-acc-o64
2275 - Also available for HP-UX: hpux-g++ hpux-acc-64 hpux-acc-o64
2284 - Also available for Tru64: tru64-g++
2288 case "$UNAME_MACHINE" in
2290 PLATFORM=linux-g++-64
2297 - Also available for Linux: linux-kcc linux-icc linux-cxx
2301 if [ "$XPLATFORM_MINGW" = "yes" ]; then
2302 PLATFORM="solaris-g++"
2304 #PLATFORM=solaris-g++
2306 #PLATFORM=solaris-cc64
2309 - Also available for Solaris: solaris-g++ solaris-cc-64
2312 ReliantUNIX-*:*|SINIX-*:*)
2313 PLATFORM=reliant-cds
2314 #PLATFORM=reliant-cds-64
2316 - Also available for Reliant UNIX: reliant-cds-64
2326 #PLATFORM=unixware-g++
2327 PLATFORM=unixware-cc
2329 - Also available for OpenUNIX: unixware-g++
2333 #PLATFORM=unixware-g++
2334 PLATFORM=unixware-cc
2336 - Also available for UnixWare: unixware-g++
2343 - Also available for SCO OpenServer: sco-g++
2347 PLATFORM=unixware-g++
2350 PLATFORM=unsupported/qnx-g++
2353 if [ "$OPT_HELP" != "yes" ]; then
2355 echo " The build script does not currently recognize all" >&2
2356 echo " platforms supported by Qt." >&2
2357 echo " Rerun this script with a -platform option listed to" >&2
2358 echo " set the system/compiler combination you use." >&2
2365 [ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
2367 case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
2368 case "$XPLATFORM" in linux-g++-maemo) XPLATFORM_MAEMO=yes;; esac
2369 case "$XPLATFORM" in *qnx-*|*blackberry-*) XPLATFORM_QNX=yes;; esac
2371 if [ -d "$PLATFORM" ]; then
2372 QMAKESPEC="$PLATFORM"
2374 QMAKESPEC="$relpath/mkspecs/${PLATFORM}"
2376 if [ -d "$XPLATFORM" ]; then
2377 XQMAKESPEC="$XPLATFORM"
2379 XQMAKESPEC="$relpath/mkspecs/${XPLATFORM}"
2381 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2382 QT_CROSS_COMPILE=yes
2383 QMAKE_CONFIG="$QMAKE_CONFIG cross_compile"
2384 QTCONFIG_CONFIG="$QTCONFIG_CONFIG cross_compile"
2387 if [ "$BUILD_ON_MAC" = "yes" ]; then
2388 if [ `basename $QMAKESPEC` = "macx-xcode" ] || [ `basename $XQMAKESPEC` = "macx-xcode" ]; then
2390 echo " Platform 'macx-xcode' should not be used when building Qt/Mac." >&2
2391 echo " Please build Qt/Mac with 'macx-g++', then if you would like to" >&2
2392 echo " use mac-xcode on your application code it can link to a Qt/Mac" >&2
2393 echo " built with 'macx-g++'" >&2
2399 # check specified platforms are supported
2400 if [ '!' -d "$QMAKESPEC" ]; then
2402 echo " The specified system/compiler is not supported:"
2406 echo " Please see the README file for a complete list."
2410 if [ '!' -d "$XQMAKESPEC" ]; then
2412 echo " The specified system/compiler is not supported:"
2416 echo " Please see the README file for a complete list."
2420 if [ '!' -f "${XQMAKESPEC}/qplatformdefs.h" ]; then
2422 echo " The specified system/compiler port is not complete:"
2424 echo " $XQMAKESPEC/qplatformdefs.h"
2426 echo " Please contact qt-info@nokia.com."
2431 if [ "$UNAME_SYSTEM" = "SunOS" ]; then
2432 # Solaris 2.5 and 2.6 have libposix4, which was renamed to librt for Solaris 7 and up
2433 if echo $UNAME_RELEASE | grep "^5\.[5|6]" >/dev/null 2>&1; then
2434 sed -e "s,-lrt,-lposix4," "$XQMAKESPEC/qmake.conf" > "$XQMAKESPEC/qmake.conf.new"
2435 mv "$XQMAKESPEC/qmake.conf.new" "$XQMAKESPEC/qmake.conf"
2439 if [ "$CFG_RTOS_ENABLED" = "no" ]; then
2440 case `basename "$XPLATFORM"` in
2443 echo "You are not licensed for Qt for `basename $XPLATFORM`."
2445 echo "Please contact qt-info@nokia.com to upgrade your license to"
2446 echo "include this platform, or install the Qt Open Source Edition"
2447 echo "if you intend to develop free software."
2453 #-------------------------------------------------------------------------------
2454 # tests that don't need qmake (must be run before displaying help)
2455 #-------------------------------------------------------------------------------
2457 # detect build style
2458 if [ "$CFG_DEBUG" = "auto" ]; then
2459 if [ "$PLATFORM_MAC" = "yes" -o "$XPLATFORM_MINGW" = "yes" ]; then
2460 CFG_DEBUG_RELEASE=yes
2462 elif [ "$CFG_DEV" = "yes" ]; then
2463 CFG_DEBUG_RELEASE=no
2466 CFG_DEBUG_RELEASE=no
2470 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2471 QT_CONFIG="$QT_CONFIG build_all debug_and_release"
2474 # pass on $CFG_SDK to the configure tests.
2475 if [ '!' -z "$CFG_SDK" ]; then
2476 MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK"
2479 # find the default framework value
2480 if [ "$BUILD_ON_MAC" = "yes" ]; then
2481 if [ "$CFG_FRAMEWORK" = "auto" ]; then
2482 CFG_FRAMEWORK="$CFG_SHARED"
2483 elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
2485 echo "WARNING: Using static linking will disable the use of Mac frameworks."
2493 QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`
2495 TEST_COMPILER=$QMAKE_CONF_COMPILER
2496 if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
2497 if [ -z "$TEST_COMPILER" ]; then
2498 echo "ERROR: Cannot set the compiler for the configuration tests"
2504 case "$TEST_COMPILER" in *g++) GCC_MACHINE_DUMP=$($TEST_COMPILER -dumpmachine);; esac
2505 if [ -n "$GCC_MACHINE_DUMP" ]; then
2506 DeviceVar set GCC_MACHINE_DUMP $($TEST_COMPILER -dumpmachine)
2509 if [ -n "$CFG_SYSROOT" ]; then
2510 SYSROOT_FLAG="--sysroot=$CFG_SYSROOT"
2514 export SYSROOT_FLAG # used by config.tests/unix/compile.test
2516 # auto-detect precompiled header support
2517 if [ "$CFG_PRECOMPILE" = "auto" ]; then
2518 if "$unixtests/precomp.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2525 # auto-detect support for separate debug info in objcopy
2526 if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
2527 TEST_COMPILER_CFLAGS=`getXQMakeConf QMAKE_CFLAGS`
2528 TEST_COMPILER_CXXFLAGS=`getXQMakeConf QMAKE_CXXFLAGS`
2529 TEST_OBJCOPY=`getXQMakeConf QMAKE_OBJCOPY`
2530 COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
2531 COMPILER_WITH_FLAGS=`echo "$COMPILER_WITH_FLAGS" | sed -e "s%\\$\\$QMAKE_CFLAGS%$TEST_COMPILER_CFLAGS%g"`
2532 if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$TEST_OBJCOPY" "$OPT_VERBOSE"; then
2533 CFG_SEPARATE_DEBUG_INFO=no
2537 # binutils on HP-UX is buggy; default to no.
2538 CFG_SEPARATE_DEBUG_INFO=no
2541 CFG_SEPARATE_DEBUG_INFO=yes
2547 # auto-detect -fvisibility support
2548 if [ "$CFG_REDUCE_EXPORTS" != "no" ]; then
2549 if "$unixtests/fvisibility.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2550 if [ "$CFG_REDUCE_EXPORTS" = "yes" ]; then
2551 echo "-reduce-exports was requested but this compiler does not support it"
2552 echo "Re-run configure with -v for more information"
2555 CFG_REDUCE_EXPORTS=no
2557 CFG_REDUCE_EXPORTS=yes
2561 # detect the availability of the -Bsymbolic-functions linker optimization
2562 if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then
2563 if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2564 if [ "$CFG_REDUCE_RELOCATIONS" = "yes" ]; then
2565 echo "-reduce-relocations was requested but this compiler does not support it"
2566 echo "Re-run configure with -v for more information"
2569 CFG_REDUCE_RELOCATIONS=no
2571 CFG_REDUCE_RELOCATIONS=yes
2575 # auto-detect GNU make support
2576 if [ "$CFG_USE_GNUMAKE" = "auto" ] && "$MAKE" -v | grep "GNU Make" >/dev/null 2>&1; then
2580 # find the default framework value
2581 if [ "$BUILD_ON_MAC" = "yes" ]; then
2582 if [ "$CFG_FRAMEWORK" = "auto" ]; then
2583 CFG_FRAMEWORK="$CFG_SHARED"
2584 elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
2586 echo "WARNING: Using static linking will disable the use of Mac frameworks."
2594 #setup the build parts
2595 if [ -z "$CFG_BUILD_PARTS" ]; then
2596 CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
2598 # build tests by default, if a developer build
2599 if [ "$CFG_DEV" = "yes" ]; then
2600 CFG_BUILD_PARTS="$CFG_BUILD_PARTS tests"
2603 # don't build tools by default when cross-compiling
2604 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2605 CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, tools,,g"`
2608 for nobuild in $CFG_NOBUILD_PARTS; do
2609 CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, $nobuild,,g"`
2611 if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then
2613 # echo "WARNING: libs is a required part of the build."
2615 CFG_BUILD_PARTS="$CFG_BUILD_PARTS libs"
2618 #-------------------------------------------------------------------------------
2619 # post process QT_INSTALL_* variables
2620 #-------------------------------------------------------------------------------
2622 if [ -z "$QT_INSTALL_PREFIX" ]; then
2623 if [ "$CFG_DEV" = "yes" ]; then
2624 QT_INSTALL_PREFIX="$outpath" # In Development, we use sandboxed builds by default
2626 QT_INSTALL_PREFIX="/usr/local/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Qt-$QT_VERSION
2629 QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
2631 if [ -z "$QT_INSTALL_DOCS" ]; then #default
2632 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2633 if [ "$BUILD_ON_MAC" = "yes" ]; then
2634 QT_INSTALL_DOCS="/Developer/Documentation/Qt"
2637 [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
2640 QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
2642 if [ -z "$QT_INSTALL_HEADERS" ]; then #default
2643 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2644 if [ "$BUILD_ON_MAC" = "yes" ]; then
2645 if [ "$CFG_FRAMEWORK" = "yes" ]; then
2650 [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
2653 QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"`
2655 if [ -z "$QT_INSTALL_LIBS" ]; then #default
2656 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2657 if [ "$BUILD_ON_MAC" = "yes" ]; then
2658 if [ "$CFG_FRAMEWORK" = "yes" ]; then
2659 QT_INSTALL_LIBS="/Libraries/Frameworks"
2663 [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback
2665 QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
2667 if [ -z "$QT_INSTALL_BINS" ]; then #default
2668 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2669 if [ "$BUILD_ON_MAC" = "yes" ]; then
2670 QT_INSTALL_BINS="/Developer/Applications/Qt"
2673 [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
2675 QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
2677 if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
2678 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2679 if [ "$BUILD_ON_MAC" = "yes" ]; then
2680 QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins"
2683 [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
2685 QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
2687 if [ -z "$QT_INSTALL_IMPORTS" ]; then #default
2688 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2689 if [ "$BUILD_ON_MAC" = "yes" ]; then
2690 QT_INSTALL_IMPORTS="/Developer/Applications/Qt/imports"
2693 [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="$QT_INSTALL_PREFIX/imports" #fallback
2695 QT_INSTALL_IMPORTS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_IMPORTS"`
2697 if [ -z "$QT_INSTALL_DATA" ]; then #default
2698 QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
2700 QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
2702 if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
2703 QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
2705 QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
2707 if [ -z "$QT_INSTALL_SETTINGS" ]; then #default
2708 if [ "$BUILD_ON_MAC" = "yes" ]; then
2709 QT_INSTALL_SETTINGS=/Library/Preferences/Qt
2711 QT_INSTALL_SETTINGS=/etc/xdg
2714 QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"`
2716 if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default
2717 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2718 if [ "$BUILD_ON_MAC" = "yes" ]; then
2719 QT_INSTALL_EXAMPLES="/Developer/Examples/Qt"
2722 [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback
2724 QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"`
2727 if [ -z "$QT_INSTALL_TESTS" ]; then #default
2728 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2729 if [ "$BUILD_ON_MAC" = "yes" ]; then
2730 QT_INSTALL_TESTS="/Developer/Tests/Qt"
2733 [ -z "$QT_INSTALL_TESTS" ] && QT_INSTALL_TESTS="$QT_INSTALL_PREFIX/tests" #fallback
2735 QT_INSTALL_TESTS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TESTS"`
2737 #------- host paths --------
2739 if [ -z "$QT_HOST_PREFIX" ]; then
2740 QT_HOST_PREFIX=$QT_INSTALL_PREFIX
2743 QT_HOST_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_PREFIX"`
2747 if [ -z "$QT_HOST_BINS" ]; then #default
2749 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2750 if [ "$BUILD_ON_MAC" = "yes" ]; then
2751 QT_HOST_BINS="/Developer/Applications/Qt"
2754 [ -z "$QT_HOST_BINS" ] && QT_HOST_BINS="$QT_HOST_PREFIX/bin" #fallback
2756 QT_HOST_BINS="$QT_INSTALL_BINS"
2759 QT_HOST_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_BINS"`
2761 if [ -z "$QT_HOST_DATA" ]; then #default
2763 QT_HOST_DATA="$QT_HOST_PREFIX"
2765 QT_HOST_DATA="$QT_INSTALL_DATA"
2768 QT_HOST_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_DATA"`
2771 #-------------------------------------------------------------------------------
2772 # help - interactive parts of the script _after_ this section please
2773 #-------------------------------------------------------------------------------
2775 # next, emit a usage message if something failed.
2776 if [ "$OPT_HELP" = "yes" ]; then
2777 [ "x$ERROR" = "xyes" ] && echo
2778 if [ "$CFG_NIS" = "no" ]; then
2785 if [ "$CFG_CUPS" = "no" ]; then
2792 if [ "$CFG_ICONV" = "no" ]; then
2799 if [ "$CFG_LARGEFILE" = "no" ]; then
2806 if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then
2814 if [ "$CFG_XCB" = "no" ]; then
2822 if [ "$CFG_EGLFS" = "no" ]; then
2830 if [ "$CFG_DIRECTFB" = "no" ]; then
2837 if [ "$CFG_XINPUT2" = "no" ]; then
2845 if [ "$CFG_DBUS" = "no" ]; then
2853 if [ "$CFG_SEPARATE_DEBUG_INFO" = "no" ]; then
2861 if [ "$CFG_GLIB" = "no" ]; then
2870 Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
2871 [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-importdir <dir>] [-datadir <dir>]
2872 [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>] [-testsdir <dir>]
2873 [-release] [-debug] [-debug-and-release] [-c++11] [-no-c++11]
2874 [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
2875 [-largefile] [-no-accessibility] [-accessibility] [-no-sql-<driver>] [-sql-<driver>]
2876 [-plugin-sql-<driver>] [-system-sqlite]
2877 [-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
2878 [-qt-zlib] [-system-zlib] [-no-gif] [-no-libpng] [-qt-libpng] [-system-libpng]
2879 [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>]
2880 [-nomake <part>] [-R <string>] [-l <string>] [-no-rpath] [-rpath] [-continue]
2881 [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
2882 [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-gui]
2883 [-no-separate-debug-info] [-no-sse2]
2884 [-no-sse3] [-no-ssse3] [-no-sse4.1] [-no-sse4.2] [-no-avx] [-no-neon]
2885 [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info]
2886 [-no-phonon-backend] [-phonon-backend] [-no-media-backend] [-media-backend]
2887 [-no-audio-backend] [-audio-backend]
2888 [-no-javascript-jit] [-javascript-jit] [-no-qml-debug] [-qml-debug]
2889 [-no-optimized-qmake] [-optimized-qmake]
2890 [-no-openssl] [-openssl] [-openssl-linked]
2891 [-no-gtkstyle] [-gtkstyle]
2892 [-qt-pcre] [-system-pcre]
2893 [-device <name>] [-device-option <key=value>]
2894 [additional platform specific options (see below)]
2897 Installation options:
2899 These are optional, but you may specify install directories.
2901 -prefix <dir> ...... This will install everything relative to <dir>
2902 (default $QT_INSTALL_PREFIX)
2904 -hostprefix [dir] .. Tools and libraries needed when developing
2905 applications are installed in [dir]. If [dir] is
2906 not given, the current build directory will be used.
2909 * -prefix-install .... Force a sandboxed "local" installation of
2910 Qt. This will install into
2911 $QT_INSTALL_PREFIX, if this option is
2912 disabled then some platforms will attempt a
2913 "system" install by placing default values to
2914 be placed in a system location other than
2917 You may use these to separate different parts of the install:
2919 -bindir <dir> ......... Executables will be installed to <dir>
2920 (default PREFIX/bin)
2921 -libdir <dir> ......... Libraries will be installed to <dir>
2922 (default PREFIX/lib)
2923 -docdir <dir> ......... Documentation will be installed to <dir>
2924 (default PREFIX/doc)
2925 -headerdir <dir> ...... Headers will be installed to <dir>
2926 (default PREFIX/include)
2927 -plugindir <dir> ...... Plugins will be installed to <dir>
2928 (default PREFIX/plugins)
2929 -importdir <dir> ...... Imports for QML will be installed to <dir>
2930 (default PREFIX/imports)
2931 -datadir <dir> ........ Data used by Qt programs will be installed to <dir>
2933 -translationdir <dir> . Translations of Qt programs will be installed to <dir>
2934 (default PREFIX/translations)
2935 -sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>
2936 (default PREFIX/etc/settings)
2937 -examplesdir <dir> .... Examples will be installed to <dir>
2938 (default PREFIX/examples)
2939 -testsdir <dir> ....... Tests will be installed to <dir>
2940 (default PREFIX/tests)
2942 -hostbindir <dir> .. Host executables will be installed to <dir>
2943 (default HOSTPREFIX/bin)
2944 -hostdatadir <dir> . Data used by qmake will be installed to <dir>
2945 (default HOSTPREFIX)
2949 The defaults (*) are usually acceptable. A plus (+) denotes a default value
2950 that needs to be evaluated. If the evaluation succeeds, the feature is
2951 included. Here is a short explanation of each option:
2953 * -release ........... Compile and link Qt with debugging turned off.
2954 -debug ............. Compile and link Qt with debugging turned on.
2955 -debug-and-release . Compile and link two versions of Qt, with and without
2956 debugging turned on (Mac only).
2958 -developer-build ... Compile and link Qt with Qt developer options (including auto-tests exporting)
2960 -opensource ........ Compile and link the Open-Source Edition of Qt.
2961 -commercial ........ Compile and link the Commercial Edition of Qt.
2963 -no-c++11 .......... Do not compile Qt with C++11 support enabled.
2964 + -c++11 ............. Compile Qt with C++11 support enabled.
2966 * -shared ............ Create and use shared Qt libraries.
2967 -static ............ Create and use static Qt libraries.
2969 * -no-fast ........... Configure Qt normally by generating Makefiles for all
2971 -fast .............. Configure Qt quickly by generating Makefiles only for
2972 library and subdirectory targets. All other Makefiles
2973 are created as wrappers, which will in turn run qmake.
2975 -no-largefile ...... Disables large file support.
2976 + -largefile ......... Enables Qt to access files larger than 4 GB.
2978 -no-accessibility .. Do not compile Accessibility support.
2979 * -accessibility ..... Compile Accessibility support.
2981 -no-sql-<driver> ... Disable SQL <driver> entirely.
2982 -qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default
2984 -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to
2987 Possible values for <driver>:
2988 [ $CFG_SQL_AVAILABLE ]
2990 -system-sqlite ..... Use sqlite from the operating system.
2992 -no-phonon-backend.. Do not build the platform phonon plugin.
2993 + -phonon-backend..... Build the platform phonon plugin.
2995 -no-javascript-jit . Do not build the JavaScriptCore JIT compiler.
2996 + -javascript-jit .... Build the JavaScriptCore JIT compiler.
2998 -no-qml-debug ...... Do not build the in-process QML debugging support.
2999 + -qml-debug ......... Build the QML debugging support.
3001 -platform target ... The operating system and compiler you are building
3004 See the README file for a list of supported
3005 operating systems and compilers.
3007 -no-sse2 ........... Do not compile with use of SSE2 instructions.
3008 -no-sse3 ........... Do not compile with use of SSE3 instructions.
3009 -no-ssse3 .......... Do not compile with use of SSSE3 instructions.
3010 -no-sse4.1.......... Do not compile with use of SSE4.1 instructions.
3011 -no-sse4.2.......... Do not compile with use of SSE4.2 instructions.
3012 -no-avx ............ Do not compile with use of AVX instructions.
3013 -no-avx2 ........... Do not compile with use of AVX2 instructions.
3014 -no-neon ........... Do not compile with use of NEON instructions.
3015 -no-mips_dsp ....... Do not compile with use of MIPS DSP instructions.
3016 -no-mips_dspr2 ..... Do not compile with use of MIPS DSP rev2 instructions.
3018 -qtnamespace <name> Wraps all Qt library code in 'namespace <name> {...}'.
3019 -qtlibinfix <infix> Renames all libQt*.so to libQt*<infix>.so.
3021 -testcocoon Instrument Qt with the TestCocoon code coverage tool.
3023 -D <string> ........ Add an explicit define to the preprocessor.
3024 -I <string> ........ Add an explicit include path.
3025 -L <string> ........ Add an explicit library path.
3027 + -pkg-config ........ Use pkg-config to detect include and library paths. By default,
3028 configure determines whether to use pkg-config or not with
3029 some heuristics such as checking the environment variables.
3030 -no-pkg-config ..... Disable use of pkg-config.
3031 -force-pkg-config .. Force usage of pkg-config (skips pkg-config usability
3032 detection heuristic).
3034 -help, -h .......... Display this information.
3036 Third Party Libraries:
3038 -qt-zlib ........... Use the zlib bundled with Qt.
3039 + -system-zlib ....... Use zlib from the operating system.
3040 See http://www.gzip.org/zlib
3042 -no-gif ............ Do not compile GIF reading support.
3044 -no-libpng ......... Do not compile PNG support.
3045 -qt-libpng ......... Use the libpng bundled with Qt.
3046 + -system-libpng ..... Use libpng from the operating system.
3047 See http://www.libpng.org/pub/png
3049 -no-libjpeg ........ Do not compile JPEG support.
3050 -qt-libjpeg ........ Use the libjpeg bundled with Qt.
3051 + -system-libjpeg .... Use libjpeg from the operating system.
3052 See http://www.ijg.org
3054 -no-openssl ........ Do not compile support for OpenSSL.
3055 + -openssl ........... Enable run-time OpenSSL support.
3056 -openssl-linked .... Enabled linked OpenSSL support.
3058 -qt-pcre ........... Use the PCRE library bundled with Qt.
3059 + -system-pcre ....... Use the PCRE library from the operating system.
3063 -make <part> ....... Add part to the list of parts to be built at make time.
3064 ($QT_DEFAULT_BUILD_PARTS)
3065 -nomake <part> ..... Exclude part from the list of parts to be built.
3067 -R <string> ........ Add an explicit runtime library path to the Qt
3069 -l <string> ........ Add an explicit library.
3071 -no-rpath .......... Do not use the library install path as a runtime
3073 + -rpath ............. Link Qt libraries and executables using the library
3074 install path as a runtime library path. Equivalent
3075 to -R install_libpath
3077 -continue .......... Continue as far as possible if an error occurs.
3079 -verbose, -v ....... Print verbose information about each step of the
3082 -silent ............ Reduce the build output so that warnings and errors
3083 can be seen more easily.
3085 * -no-optimized-qmake ... Do not build qmake optimized.
3086 -optimized-qmake ...... Build qmake optimized.
3088 -no-gui ............ Don't build the Qt GUI library
3090 $NSN -no-nis ............ Do not compile NIS support.
3091 $NSY -nis ............... Compile NIS support.
3093 $CUN -no-cups ........... Do not compile CUPS support.
3094 $CUY -cups .............. Compile CUPS support.
3095 Requires cups/cups.h and libcups.so.2.
3097 $CIN -no-iconv .......... Do not compile support for iconv(3).
3098 $CIY -iconv ............. Compile support for iconv(3).
3100 $PHN -no-pch ............ Do not use precompiled header support.
3101 $PHY -pch ............... Use precompiled header support.
3103 $DBN -no-dbus ........... Do not compile the QtDBus module.
3104 $DBY -dbus .............. Compile the QtDBus module and dynamically load libdbus-1.
3105 -dbus-linked ....... Compile the QtDBus module and link to libdbus-1.
3107 -reduce-relocations ..... Reduce relocations in the libraries through extra
3108 linker optimizations (Qt/X11 and Qt for Embedded Linux only;
3109 experimental; needs GNU ld >= 2.18).
3111 -force-asserts ........ Force Q_ASSERT to be enabled even in release builds.
3113 -device <name> ............... Cross-compile for device <name> (experimental)
3114 -device-option <key=value> ... Add device specific options for the device mkspec
3117 $SBN -no-separate-debug-info . Do not store debug information in a separate file.
3118 $SBY -separate-debug-info .... Strip debug information into a separate .debug file.
3120 $XCBN -no-xcb ............ Do not compile Xcb (X protocol C-language Binding) support.
3121 $XCBY -xcb ............... Compile Xcb support.
3123 $EGLFSN -no-eglfs .......... Do not compile EGLFS (EGL Full Screen/Single Surface) support.
3124 $EGLFSY -eglfs ............. Compile EGLFS support (Requires OpenGL ES 2 support).
3126 $DFBN -no-directfb ....... Do not compile DirectFB support.
3127 $DFBY -directfb .......... Compile DirectFB support.
3129 -qpa <name> ......... Sets the default QPA platform (e.g xcb, cocoa, windows).
3131 -xplatform target ... The target platform when cross-compiling.
3133 -sysroot <dir> ...... Sets <dir> as the target compiler's and qmake's sysroot.
3135 -no-feature-<feature> Do not compile in <feature>.
3136 -feature-<feature> .. Compile in <feature>. The available features
3137 are described in src/corelib/global/qfeatures.txt
3139 -no-freetype ........ Do not compile in Freetype2 support.
3140 -qt-freetype ........ Use the libfreetype bundled with Qt.
3141 * -system-freetype .... Use libfreetype from the operating system.
3142 See http://www.freetype.org/
3144 -qconfig local ...... Use src/corelib/global/qconfig-local.h rather than the
3145 default ($CFG_QCONFIG).
3147 -no-opengl .......... Do not support OpenGL.
3148 -opengl <api> ....... Enable OpenGL support
3149 With no parameter, this will attempt to auto-detect
3150 OpenGL ES 2, or regular desktop OpenGL.
3151 Use es2 for <api> to override auto-detection.
3153 $GBN -no-glib ........... Do not compile Glib support.
3154 $GBY -glib .............. Compile Glib support.
3157 if [ "$XPLATFORM_MAEMO" = "yes" ]; then
3160 $X2N -no-xinput2......... Do not compile XInput2 support.
3161 $X2Y -xinput2............ Compile XInput2 support.
3167 if [ "$BUILD_ON_MAC" = "yes" ]; then
3172 -Fstring ........... Add an explicit framework path.
3173 -fw string ......... Add an explicit framework.
3175 * -framework ......... Build Qt as a series of frameworks and
3176 link tools against those frameworks.
3177 -no-framework ...... Do not build Qt as a series of frameworks.
3179 -sdk <sdk> ......... Build Qt using Apple provided SDK <sdk>. This option requires gcc 4.
3180 To use a different SDK with gcc 3.3, set the SDKROOT environment variable.
3182 -harfbuzz .......... Use HarfBuzz to do text layout instead of Core Text when possible.
3183 * -no-harfbuzz ....... Disable HarfBuzz on Mac. It can still be enabled by setting
3184 QT_ENABLE_HARFBUZZ environment variable.
3189 [ "x$ERROR" = "xyes" ] && exit 1
3194 # -----------------------------------------------------------------------------
3195 # LICENSING, INTERACTIVE PART
3196 # -----------------------------------------------------------------------------
3199 echo "This is the Qt ${EditionString} Edition."
3202 if [ "$Edition" = "OpenSource" ]; then
3204 echo "You are licensed to use this software under the terms of"
3205 echo "the Lesser GNU General Public License (LGPL) versions 2.1."
3206 if [ -f "$relpath/LICENSE.GPL3" ]; then
3207 echo "You are also licensed to use this software under the terms of"
3208 echo "the GNU General Public License (GPL) versions 3."
3214 if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
3215 echo "You have already accepted the terms of the $LicenseType license."
3218 if [ -f "$relpath/LICENSE.GPL3" ]; then
3219 echo "Type '3' to view the GNU General Public License version 3."
3221 echo "Type 'L' to view the Lesser GNU General Public License version 2.1."
3222 echo "Type 'yes' to accept this license offer."
3223 echo "Type 'no' to decline this license offer."
3225 echo $ECHO_N "Do you accept the terms of $affix license? $ECHO_C"
3229 if [ "$acceptance" = "yes" ] || [ "$acceptance" = "y" ]; then
3231 elif [ "$acceptance" = "no" ]; then
3232 echo "You are not licensed to use this software."
3235 elif [ "$acceptance" = "3" ]; then
3236 more "$relpath/LICENSE.GPL3"
3237 elif [ "$acceptance" = "L" ]; then
3238 more "$relpath/LICENSE.LGPL"
3241 elif [ "$Edition" = "Preview" ]; then
3242 TheLicense=`head -n 1 "$relpath/LICENSE.PREVIEW.COMMERCIAL"`
3245 if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
3246 echo "You have already accepted the terms of the $LicenseType license."
3249 echo "You are licensed to use this software under the terms of"
3250 echo "the $TheLicense"
3252 echo "Type '?' to read the Preview License."
3253 echo "Type 'yes' to accept this license offer."
3254 echo "Type 'no' to decline this license offer."
3256 echo $ECHO_N "Do you accept the terms of the license? $ECHO_C"
3260 if [ "$acceptance" = "yes" ]; then
3262 elif [ "$acceptance" = "no" ] ;then
3263 echo "You are not licensed to use this software."
3266 elif [ "$acceptance" = "?" ]; then
3267 more "$relpath/LICENSE.PREVIEW.COMMERCIAL"
3270 elif [ "$Edition" != "OpenSource" ]; then
3271 if [ -n "$ExpiryDate" ]; then
3272 ExpiryDate=`echo $ExpiryDate | sed -e "s,-,,g" | tr -d "\n\r"`
3273 [ -z "$ExpiryDate" ] && ExpiryDate="0"
3274 Today=`date +%Y%m%d`
3275 if [ "$Today" -gt "$ExpiryDate" ]; then
3276 case "$LicenseType" in
3277 Commercial|Academic|Educational)
3278 if [ "$QT_PACKAGEDATE" -gt "$ExpiryDate" ]; then
3280 echo "NOTICE NOTICE NOTICE NOTICE"
3282 echo " Your support and upgrade period has expired."
3284 echo " You are no longer licensed to use this version of Qt."
3285 echo " Please contact qt-info@nokia.com to renew your support"
3286 echo " and upgrades for this license."
3288 echo "NOTICE NOTICE NOTICE NOTICE"
3293 echo "WARNING WARNING WARNING WARNING"
3295 echo " Your support and upgrade period has expired."
3297 echo " You may continue to use your last licensed release"
3298 echo " of Qt under the terms of your existing license"
3299 echo " agreement. But you are not entitled to technical"
3300 echo " support, nor are you entitled to use any more recent"
3301 echo " Qt releases."
3303 echo " Please contact qt-info@nokia.com to renew your"
3304 echo " support and upgrades for this license."
3306 echo "WARNING WARNING WARNING WARNING"
3313 echo "NOTICE NOTICE NOTICE NOTICE"
3315 echo " Your Evaluation license has expired."
3317 echo " You are no longer licensed to use this software. Please"
3318 echo " contact qt-info@nokia.com to purchase license, or install"
3319 echo " the Qt Open Source Edition if you intend to develop free"
3322 echo "NOTICE NOTICE NOTICE NOTICE"
3329 TheLicense=`head -n 1 "$outpath/LICENSE"`
3331 if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
3332 echo "You have already accepted the terms of the $TheLicense."
3335 echo "You are licensed to use this software under the terms of"
3336 echo "the $TheLicense."
3338 echo "Type '?' to view the $TheLicense."
3339 echo "Type 'yes' to accept this license offer."
3340 echo "Type 'no' to decline this license offer."
3342 echo $ECHO_N "Do you accept the terms of the $TheLicense? $ECHO_C"
3346 if [ "$acceptance" = "yes" ]; then
3348 elif [ "$acceptance" = "no" ]; then
3349 echo "You are not licensed to use this software."
3352 else [ "$acceptance" = "?" ]
3353 more "$outpath/LICENSE"
3358 # this should be moved somewhere else
3361 AIX_VERSION=`uname -v`
3362 if [ "$AIX_VERSION" -lt "5" ]; then
3363 QMakeVar add QMAKE_LIBS_X11 -lbind
3370 #-------------------------------------------------------------------------------
3371 # generate qconfig.cpp
3372 #-------------------------------------------------------------------------------
3373 [ -d "$outpath/src/corelib/global" ] || mkdir -p "$outpath/src/corelib/global"
3375 cat > "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3377 static const char qt_configure_licensee_str [256 + 12] = "qt_lcnsuser=$Licensee";
3378 static const char qt_configure_licensed_products_str [256 + 12] = "qt_lcnsprod=$Edition";
3380 /* Installation date */
3381 static const char qt_configure_installation [12+11] = "qt_instdate=`date +%Y-%m-%d`";
3383 /* Installation Info */
3384 static const char qt_configure_prefix_path_strs[][256 + 12] = {
3385 "qt_prfxpath=$QT_INSTALL_PREFIX",
3386 "qt_docspath=$QT_INSTALL_DOCS",
3387 "qt_hdrspath=$QT_INSTALL_HEADERS",
3388 "qt_libspath=$QT_INSTALL_LIBS",
3389 "qt_binspath=$QT_INSTALL_BINS",
3390 "qt_plugpath=$QT_INSTALL_PLUGINS",
3391 "qt_impspath=$QT_INSTALL_IMPORTS",
3392 "qt_datapath=$QT_INSTALL_DATA",
3393 "qt_trnspath=$QT_INSTALL_TRANSLATIONS",
3394 "qt_xmplpath=$QT_INSTALL_EXAMPLES",
3395 "qt_tstspath=$QT_INSTALL_TESTS",
3396 #ifdef QT_BUILD_QMAKE
3397 "qt_ssrtpath=$CFG_SYSROOT",
3398 "qt_hpfxpath=$QT_HOST_PREFIX",
3399 "qt_hbinpath=$QT_HOST_BINS",
3400 "qt_hdatpath=$QT_HOST_DATA",
3403 static const char qt_configure_settings_path_str[256 + 12] = "qt_stngpath=$QT_INSTALL_SETTINGS";
3406 cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3408 /* strlen( "qt_lcnsxxxx" ) == 12 */
3409 #define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;
3410 #define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;
3412 #define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;
3415 # avoid unecessary rebuilds by copying only if qconfig.cpp has changed
3416 if cmp -s "$outpath/src/corelib/global/qconfig.cpp" "$outpath/src/corelib/global/qconfig.cpp.new"; then
3417 rm -f "$outpath/src/corelib/global/qconfig.cpp.new"
3419 [ -f "$outpath/src/corelib/global/qconfig.cpp" ] && chmod +w "$outpath/src/corelib/global/qconfig.cpp"
3420 mv "$outpath/src/corelib/global/qconfig.cpp.new" "$outpath/src/corelib/global/qconfig.cpp"
3421 chmod -w "$outpath/src/corelib/global/qconfig.cpp"
3424 # -----------------------------------------------------------------------------
3425 if [ "$LicenseType" = "Evaluation" ]; then
3426 EVALKEY=qt_qevalkey=$LicenseKeyExt
3427 elif echo "$DEFINES" | grep QT_EVAL >/dev/null 2>&1; then
3428 EVALKEY=qt_qevalkey=
3431 if [ -n "$EVALKEY" ]; then
3432 rm -f "$outpath/src/corelib/global/qconfig_eval.cpp"
3433 cat > "$outpath/src/corelib/global/qconfig_eval.cpp" <<EOF
3434 /* Evaluation license key */
3435 static const volatile char qt_eval_key_data [512 + 12] = "$EVALKEY";
3437 chmod -w "$outpath/src/corelib/global/qconfig_eval.cpp"
3441 # -----------------------------------------------------------------------------
3443 # -----------------------------------------------------------------------------
3446 if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt" ]; then
3448 [ "$CFG_DEV" = "yes" ] && SYNCQT_OPTS="$SYNCQT_OPTS -check-includes"
3449 if [ "$OPT_SHADOW" = "yes" ]; then
3450 "$outpath/bin/syncqt" $SYNCQT_OPTS "$relpath" || exit 1
3451 elif [ "$CFG_DEV" = "yes" ] || [ ! -d $relpath/include ] || [ -d $relpath/.git ]; then
3452 QTDIR="$relpath" perl "$outpath/bin/syncqt" $SYNCQT_OPTS || exit 1
3456 # $1: input variable name (awk regexp)
3457 # $2: optional output variable name
3458 # $3: optional value transformation (sed command)
3459 # relies on $QMAKESPEC, $COMPILER_CONF and $mkfile being set correctly, as the latter
3460 # is where the resulting variable is written to
3461 setBootstrapVariable()
3463 getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile"
3467 if true; then ###[ '!' -f "$outpath/bin/qmake" ];
3468 echo "Creating qmake. Please wait..."
3471 QCONFIG_H="$outpath/src/corelib/global/qconfig.h"
3472 QMAKE_QCONFIG_H="${QCONFIG_H}.qmake"
3473 if [ -f "$QCONFIG_H" ]; then
3474 OLD_QCONFIG_H=$QCONFIG_H
3475 mv -f "$OLD_QCONFIG_H" "${OLD_QCONFIG_H}.old"
3478 # create temporary qconfig.h for compiling qmake, if it doesn't exist
3479 # when building qmake, we use #defines for the install paths,
3480 # however they are real functions in the library
3481 if [ '!' -f "$QMAKE_QCONFIG_H" ]; then
3482 mkdir -p "$outpath/src/corelib/global"
3483 [ -f "$QCONFIG_H" ] && chmod +w "$QCONFIG_H"
3484 echo "/* All features enabled while building qmake */" >"$QMAKE_QCONFIG_H"
3487 mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
3489 #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
3490 rm -rf mkspecs/default mkspecs/default-host
3491 ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
3492 ln -s `echo $QMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default-host
3493 mkdir -p "$outpath/qmake" || exit
3495 for mkfile in GNUmakefile Makefile; do
3498 in_mkfile="${mkfile}.in"
3499 if [ "$mkfile" = "Makefile" ]; then
3500 # if which qmake >/dev/null 2>&1 && [ -f qmake/qmake.pro ]; then
3501 # (cd qmake && qmake) >/dev/null 2>&1 && continue
3503 in_mkfile="${mkfile}.unix"
3505 in_mkfile="$relpath/qmake/$in_mkfile"
3506 mkfile="$outpath/qmake/$mkfile"
3507 if [ -f "$mkfile" ]; then
3508 [ "$CFG_DEV" = "yes" ] && "$WHICH" chflags >/dev/null 2>&1 && chflags nouchg "$mkfile"
3511 [ -f "$in_mkfile" ] || continue
3513 echo "########################################################################" > "$mkfile"
3514 echo "## This file was autogenerated by configure, all changes will be lost ##" >> "$mkfile"
3515 echo "########################################################################" >> "$mkfile"
3518 EXTRA_CFLAGS="\$(QMAKE_CFLAGS)"
3519 EXTRA_CXXFLAGS="\$(QMAKE_CXXFLAGS)"
3520 EXTRA_LFLAGS="\$(QMAKE_LFLAGS)"
3522 if [ "$PLATFORM" = "irix-cc" ] || [ "$PLATFORM" = "irix-cc-64" ]; then
3523 EXTRA_LFLAGS="$EXTRA_LFLAGS -lm"
3526 [ "$CFG_SILENT" = "yes" ] && CC_TRANSFORM='s,^,\@,' || CC_TRANSFORM=
3527 setBootstrapVariable QMAKE_CC CC "$CC_TRANSFORM"
3528 setBootstrapVariable QMAKE_CXX CXX "$CC_TRANSFORM"
3529 setBootstrapVariable QMAKE_CFLAGS
3530 setBootstrapVariable QMAKE_CXXFLAGS
3531 setBootstrapVariable QMAKE_LFLAGS
3533 if [ $QT_EDITION = "QT_EDITION_OPENSOURCE" ]; then
3534 EXTRA_CFLAGS="$EXTRA_CFLAGS -DQMAKE_OPENSOURCE_EDITION"
3535 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -DQMAKE_OPENSOURCE_EDITION"
3537 if [ "$CFG_RELEASE_QMAKE" = "yes" ]; then
3538 setBootstrapVariable QMAKE_CFLAGS_RELEASE
3539 setBootstrapVariable QMAKE_CXXFLAGS_RELEASE
3540 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
3541 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_RELEASE)"
3542 elif [ "$CFG_DEBUG" = "yes" ]; then
3543 setBootstrapVariable QMAKE_CFLAGS_DEBUG
3544 setBootstrapVariable QMAKE_CXXFLAGS_DEBUG
3545 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_DEBUG)"
3546 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_DEBUG)"
3549 if [ -n "$RPATH_FLAGS" ] && [ -n "`getQMakeConf 'QMAKE_(LFLAGS_)?RPATH'`" ]; then
3550 setBootstrapVariable "QMAKE_(LFLAGS_)?RPATH" QMAKE_LFLAGS_RPATH
3551 for rpath in $RPATH_FLAGS; do
3552 EXTRA_LFLAGS="\$(QMAKE_LFLAGS_RPATH)\"$rpath\" $EXTRA_LFLAGS"
3555 if [ "$BUILD_ON_MAC" = "yes" ]; then
3556 echo "export MACOSX_DEPLOYMENT_TARGET = 10.6" >> "$mkfile"
3557 echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
3558 echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"
3559 EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
3560 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(CARBON_CFLAGS)"
3561 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
3562 EXTRA_OBJS="qsettings_mac.o qcore_mac.o"
3563 EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\""
3564 if [ '!' -z "$CFG_SDK" ]; then
3565 echo "SDK_LFLAGS =-Wl,-syslibroot,$CFG_SDK" >>"$mkfile"
3566 echo "SDK_CFLAGS =-isysroot $CFG_SDK" >>"$mkfile"
3567 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(SDK_CFLAGS)"
3568 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(SDK_CFLAGS)"
3569 EXTRA_LFLAGS="$EXTRA_LFLAGS \$(SDK_LFLAGS)"
3572 if [ '!' -z "$D_FLAGS" ]; then
3573 EXTRA_CFLAGS="$EXTRA_CFLAGS $D_FLAGS"
3575 QMAKE_BIN_DIR="$QT_INSTALL_BINS"
3576 [ -z "$QMAKE_BIN_DIR" ] && QMAKE_BIN_DIR="${QT_INSTALL_PREFIX}/bin"
3577 QMAKE_DATA_DIR="$QT_INSTALL_DATA"
3578 [ -z "$QMAKE_DATA_DIR" ] && QMAKE_DATA_DIR="${QT_INSTALL_PREFIX}"
3580 adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`
3581 adjoutpath=`echo "$outpath" | sed 's/ /\\\\\\\\ /g'`
3582 adjqmakespec=`echo "$QMAKESPEC" | sed 's/ /\\\\\\\\ /g'`
3583 sed -e "s,@SOURCE_PATH@,$adjrelpath,g" -e "s,@BUILD_PATH@,$adjoutpath,g" \
3584 -e "s,@QMAKE_CFLAGS@,$EXTRA_CFLAGS,g" -e "s,@QMAKE_LFLAGS@,$EXTRA_LFLAGS,g" \
3585 -e "s,@QMAKE_CXXFLAGS@,$EXTRA_CXXFLAGS,g" \
3586 -e "s,@QT_INSTALL_BINS@,\$(INSTALL_ROOT)$QMAKE_BIN_DIR,g" \
3587 -e "s,@QT_INSTALL_DATA@,\$(INSTALL_ROOT)$QMAKE_DATA_DIR,g" \
3588 -e "s,@QMAKE_QTOBJS@,$EXTRA_OBJS,g" -e "s,@QMAKE_QTSRCS@,$EXTRA_SRCS,g" \
3589 -e "s,@QMAKESPEC@,$adjqmakespec,g" -e "s,@QT_VERSION@,$QT_VERSION,g" "$in_mkfile" >>"$mkfile"
3591 if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
3592 (cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
3593 sed "s,^.*/\([^/]*.o\):,\1:,g" "$mkfile" >"$mkfile.tmp"
3594 sed "s,$outpath,$adjoutpath,g" "$mkfile.tmp" >"$mkfile"
3599 QMAKE_BUILD_ERROR=no
3600 (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes
3601 [ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake
3602 [ '!' -z "$OLD_QCONFIG_H" ] && mv -f "${OLD_QCONFIG_H}.old" "$OLD_QCONFIG_H" #put back qconfig.h
3603 [ "$QMAKE_BUILD_ERROR" = "yes" ] && exit 2
3606 #-------------------------------------------------------------------------------
3608 #-------------------------------------------------------------------------------
3609 if [ -z "$PKG_CONFIG" ]; then
3610 # See if PKG_CONFIG is set in the mkspec:
3611 PKG_CONFIG=`getXQMakeConf PKG_CONFIG`
3613 if [ -z "$PKG_CONFIG" ]; then
3614 PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
3617 if [ "$CFG_PKGCONFIG" = "no" ]; then
3619 elif [ "$CFG_PKGCONFIG" = "force" ]; then
3621 echo >&2 "You have asked to use pkg-config. Please make sure you have"
3622 echo >&2 "a correctly setup pkg-config environment!"
3624 elif [ -n "$PKG_CONFIG" ]; then
3625 # found a pkg-config
3626 if [ "$QT_CROSS_COMPILE" = "yes" ]; then
3627 # when xcompiling, check environment to see if it's actually usable
3628 if [ -z "$PKG_CONFIG_LIBDIR" ]; then
3629 if [ -n "$CFG_SYSROOT" ] && [ -d "$CFG_SYSROOT/usr/lib/pkgconfig" ]; then
3630 PKG_CONFIG_LIBDIR=$CFG_SYSROOT/usr/lib/pkgconfig:$CFG_SYSROOT/usr/share/pkgconfig
3631 if [ -n "$GCC_MACHINE_DUMP" ]; then
3632 PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR:$CFG_SYSROOT/usr/lib/$GCC_MACHINE_DUMP/pkgconfig
3634 export PKG_CONFIG_LIBDIR
3635 echo >&2 "Note: PKG_CONFIG_LIBDIR automatically set to $PKG_CONFIG_LIBDIR"
3636 elif [ "$CFG_PKGCONFIG" = "yes" ]; then
3637 echo >&2 "Error: PKG_CONFIG_LIBDIR has not been set. This could mean"
3638 echo >&2 "the host's .pc files will be used (even if you set PKG_CONFIG_PATH)."
3639 echo >&2 "Set this variable to the directory that contains target .pc files"
3640 echo >&2 "for pkg-config to function correctly when cross-compiling or"
3641 echo >&2 "use -force-pkg-config to override this test."
3645 echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set."
3648 if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
3649 if [ -n "$CFG_SYSROOT" ]; then
3650 PKG_CONFIG_SYSROOT_DIR=$CFG_SYSROOT
3651 export PKG_CONFIG_SYSROOT_DIR
3652 echo >&2 "Note: PKG_CONFIG_SYSROOT_DIR automatically set to $PKG_CONFIG_SYSROOT_DIR"
3653 elif [ "$CFG_PKGCONFIG" = "yes" ]; then
3654 echo >&2 "Error: PKG_CONFIG_SYSROOT_DIR has not been set. Set this variable"
3655 echo >&2 "to your sysroot for pkg-config to function correctly when cross-compiling"
3656 echo >&2 "or use -force-pkg-config to override this test."
3660 echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set."
3664 elif [ "$CFG_PKGCONFIG" = "yes" ]; then
3665 echo >&2 "Could not detect pkg-config from mkspec or PATH."
3669 if [ -z "$PKG_CONFIG" ]; then
3670 QT_CONFIG="$QT_CONFIG no-pkg-config"
3673 #-------------------------------------------------------------------------------
3674 # write out device config before we run the test.
3675 #-------------------------------------------------------------------------------
3676 DEVICE_VARS_OUTFILE="$outpath/mkspecs/qdevice.pri"
3677 if cmp -s "$DEVICE_VARS_FILE" "$DEVICE_VARS_OUTFILE"; then
3678 rm -f "$DEVICE_VARS_FILE"
3680 mv -f $DEVICE_VARS_FILE "$DEVICE_VARS_OUTFILE"
3681 DEVICE_VARS_FILE="$DEVICE_VARS_OUTFILE"
3684 #-------------------------------------------------------------------------------
3685 # tests that need qmake
3686 #-------------------------------------------------------------------------------
3688 #-------------------------------------------------------------------------------
3689 # determine the target and host architectures
3690 #-------------------------------------------------------------------------------
3692 # Use config.tests/arch/arch.pro to has the compiler tell us what the target architecture is
3693 OUTFILE=$outpath/arch.result
3694 "$unixtests/arch.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath" "$OUTFILE" "CFG"
3695 if [ $? -eq 0 ]; then
3696 eval `cat "$OUTFILE"`
3699 echo "Could not determine the target architecture!"
3700 echo "Turn on verbose messaging (-v) to see the final report."
3702 rm -f "$OUTFILE" 2>/dev/null
3703 [ -z "$CFG_ARCH" ] && CFG_ARCH="unknown"
3705 if [ "$QMAKESPEC" != "$XQMAKESPEC" ]; then
3706 # Do the same test again, using the host compiler
3707 SYSROOT_FLAG= "$unixtests/arch.test" "$QMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath" "$OUTFILE" "CFG_HOST"
3708 if [ $? -eq 0 ]; then
3709 eval `cat "$OUTFILE"`
3712 echo "Could not determine the host architecture!"
3713 echo "Turn on verbose messaging (-v) to see the final report."
3715 rm -f "$OUTFILE" 2>/dev/null
3716 [ -z "$CFG_HOST_ARCH" ] && CFG_HOST_ARCH="unknown"
3718 # not cross compiling, host == target
3719 CFG_HOST_ARCH="$CFG_ARCH"
3720 CFG_HOST_CPUFEATURES="$CFG_CPUFEATURES"
3724 if [ "$OPT_VERBOSE" = "yes" ]; then
3725 echo "System architecture: '$CFG_ARCH'"
3726 echo "Host architecture: '$CFG_HOST_ARCH'"
3729 #-------------------------------------------------------------------------------
3730 # functionality tests
3731 #-------------------------------------------------------------------------------
3733 # Detect C++11 support
3734 if [ "$CFG_CXX11" != "no" ]; then
3735 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/c++11 "C++11" $L_FLAGS $I_FLAGS $l_FLAGS; then
3737 elif [ "$CFG_CXX11" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
3738 echo "C++11 support cannot be enabled due to functionality tests!"
3739 echo " Turn on verbose messaging (-v) to $0 to see the final report."
3740 echo " If you believe this message is in error you may use the continue"
3741 echo " switch (-continue) to $0 to continue."
3748 # detect availability of float math.h functions
3749 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/floatmath "floatmath" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
3750 CFG_USE_FLOATMATH=yes
3752 CFG_USE_FLOATMATH=no
3755 # detect sse2 support
3756 if [ "${CFG_SSE2}" = "auto" ]; then
3757 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/common/sse2 "sse2" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
3764 # detect sse3 support
3765 if [ "${CFG_SSE3}" = "auto" ]; then
3766 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/common/sse3 "sse3" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
3773 # detect ssse3 support
3774 if [ "${CFG_SSSE3}" = "auto" ]; then
3775 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/common/ssse3 "ssse3" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
3782 # detect sse4.1 support
3783 if [ "${CFG_SSE4_1}" = "auto" ]; then
3784 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/common/sse4_1 "sse4_1" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
3791 # detect sse4.2 support
3792 if [ "${CFG_SSE4_2}" = "auto" ]; then
3793 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/common/sse4_2 "sse4_2" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
3800 # detect avx support
3801 if [ "${CFG_AVX}" = "auto" ]; then
3802 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/common/avx "avx" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
3803 case "$XQMAKESPEC" in
3805 # Some clang versions produce internal compiler errors compiling Qt AVX code
3806 case `$TEST_COMPILER --version` in
3807 Apple\ clang\ version\ 2*|Apple\ clang\ version\ 3.0*)
3809 if [ "$OPT_VERBOSE" = "yes" ]; then
3810 echo 'AVX support disabled for blacklisted clang compiler'
3827 # detect avx2 support
3828 if [ "${CFG_AVX}" = "no" ]; then
3831 if [ "${CFG_AVX2}" = "auto" ]; then
3832 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/common/avx2 "avx2" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
3839 # check iWMMXt support
3840 if [ "$CFG_IWMMXT" = "yes" ]; then
3841 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS
3842 if [ $? != "0" ]; then
3843 echo "The iWMMXt functionality test failed!"
3844 echo " Please make sure your compiler supports iWMMXt intrinsics!"
3849 # detect neon support
3850 if [ "$CFG_ARCH" = "arm" ] && [ "${CFG_NEON}" = "auto" ]; then
3851 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/neon "neon" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
3856 elif [ "$CFG_ARCH" != "arm" ]; then
3860 # detect mips_dsp support
3861 if [ "${CFG_ARCH}" = "mips" ] && [ "${CFG_MIPS_DSP}" = "yes" ]; then
3867 # detect mips_dspr2 support
3868 if [ "${CFG_ARCH}" = "mips" ] && [ "${CFG_MIPS_DSPR2}" = "yes" ]; then
3874 [ "$XPLATFORM_MINGW" = "yes" ] && QMakeVar add styles "windowsxp windowsvista"
3877 if [ "$CFG_ZLIB" = "no" ]; then
3878 # Note: Qt no longer support builds without zlib
3879 # So we force a "no" to be "auto" here.
3880 # If you REALLY really need no zlib support, you can still disable
3881 # it by doing the following:
3882 # add "no-zlib" to mkspecs/qconfig.pri
3883 # #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
3885 # There's no guarantee that Qt will build under those conditions
3890 if [ "$CFG_ZLIB" = "auto" ]; then
3891 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/zlib "zlib" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
3898 if [ "$CFG_LARGEFILE" = "auto" ]; then
3899 #Large files should be enabled for all Linux systems
3903 if [ "$CFG_GUI" = "no" ]; then
3904 QPA_PLATFORM_GUARD=no
3907 # detect how jpeg should be built
3908 if [ "$CFG_JPEG" = "auto" ]; then
3909 if [ "$CFG_SHARED" = "yes" ]; then
3916 if [ "$CFG_LIBJPEG" = "auto" ]; then
3917 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libjpeg "libjpeg" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
3924 # detect how gif should be built
3925 if [ "$CFG_GIF" = "auto" ]; then
3926 if [ "$CFG_SHARED" = "yes" ]; then
3934 if [ "$CFG_LIBPNG" = "auto" ]; then
3935 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libpng "libpng" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
3942 # detect accessibility
3943 if [ "$CFG_ACCESSIBILITY" = "auto" ]; then
3944 CFG_ACCESSIBILITY=yes
3947 if [ "$CFG_EGLFS" = "yes" ]; then
3948 if [ "$CFG_EGL" = "no" ]; then
3949 echo "The EGLFS plugin requires EGL support and cannot be built"
3952 if [ "$CFG_OPENGL" != "es2" ]; then
3953 echo "The EGLFS plugin requires OpenGL ES 2 support and cannot be built"
3960 # auto-detect SQL-modules support
3961 for _SQLDR in $CFG_SQL_AVAILABLE; do
3964 if [ "$CFG_SQL_mysql" != "no" ]; then
3965 [ -z "$CFG_MYSQL_CONFIG" ] && CFG_MYSQL_CONFIG=`"$WHICH" mysql_config`
3966 if [ -x "$CFG_MYSQL_CONFIG" ]; then
3967 QT_CFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --include 2>/dev/null`
3968 QT_LFLAGS_MYSQL_R=`$CFG_MYSQL_CONFIG --libs_r 2>/dev/null`
3969 QT_LFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --libs 2>/dev/null`
3970 QT_MYSQL_VERSION=`$CFG_MYSQL_CONFIG --version 2>/dev/null`
3971 QT_MYSQL_VERSION_MAJOR=`echo $QT_MYSQL_VERSION | cut -d . -f 1`
3973 if [ -n "$QT_MYSQL_VERSION" ] && [ "$QT_MYSQL_VERSION_MAJOR" -lt 4 ]; then
3974 if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
3975 echo "This version of MySql is not supported ($QT_MYSQL_VERSION)."
3976 echo " You need MySql 4 or higher."
3977 echo " If you believe this message is in error you may use the continue"
3978 echo " switch (-continue) to $0 to continue."
3983 QT_LFLAGS_MYSQL_R=""
3987 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mysql_r "MySQL (thread-safe)" $QT_LFLAGS_MYSQL_R $L_FLAGS $QT_CFLAGS_MYSQL $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
3988 QMakeVar add CONFIG use_libmysqlclient_r
3989 if [ "$CFG_SQL_mysql" = "auto" ]; then
3990 CFG_SQL_mysql=plugin
3992 QT_LFLAGS_MYSQL="$QT_LFLAGS_MYSQL_R"
3993 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mysql "MySQL (thread-unsafe)" $QT_LFLAGS_MYSQL $L_FLAGS $QT_CFLAGS_MYSQL $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
3994 if [ "$CFG_SQL_mysql" = "auto" ]; then
3995 CFG_SQL_mysql=plugin
3998 if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
3999 echo "MySQL support cannot be enabled due to functionality tests!"
4000 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4001 echo " If you believe this message is in error you may use the continue"
4002 echo " switch (-continue) to $0 to continue."
4007 QT_LFLAGS_MYSQL_R=""
4015 if [ "$CFG_SQL_psql" != "no" ]; then
4016 # Be careful not to use native pg_config when cross building.
4017 if [ "$XPLATFORM_MINGW" != "yes" ] && "$WHICH" pg_config >/dev/null 2>&1; then
4018 QT_CFLAGS_PSQL=`pg_config --includedir 2>/dev/null`
4019 QT_LFLAGS_PSQL=`pg_config --libdir 2>/dev/null`
4021 [ -z "$QT_CFLAGS_PSQL" ] || QT_CFLAGS_PSQL="-I$QT_CFLAGS_PSQL"
4022 [ -z "$QT_LFLAGS_PSQL" ] || QT_LFLAGS_PSQL="-L$QT_LFLAGS_PSQL"
4023 # But, respect PSQL_LIBS if set
4024 [ -z "$PSQL_LIBS" ] || QT_LFLAGS_PSQL="$PSQL_LIBS"
4025 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/psql "PostgreSQL" $QT_LFLAGS_PSQL $L_FLAGS $QT_CFLAGS_PSQL $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4026 if [ "$CFG_SQL_psql" = "auto" ]; then
4030 if [ "$CFG_SQL_psql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4031 echo "PostgreSQL support cannot be enabled due to functionality tests!"
4032 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4033 echo " If you believe this message is in error you may use the continue"
4034 echo " switch (-continue) to $0 to continue."
4045 if [ "$CFG_SQL_odbc" != "no" ]; then
4046 if ( [ "$BUILD_ON_MAC" != "yes" ] || [ "$XPLATFORM_MINGW" = "yes" ] ) && "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/odbc "ODBC" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4047 if [ "$CFG_SQL_odbc" = "auto" ]; then
4051 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iodbc "iODBC" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4052 QT_LFLAGS_ODBC="-liodbc"
4053 if [ "$CFG_SQL_odbc" = "auto" ]; then
4057 if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4058 echo "ODBC support cannot be enabled due to functionality tests!"
4059 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4060 echo " If you believe this message is in error you may use the continue"
4061 echo " switch (-continue) to $0 to continue."
4071 if [ "$CFG_SQL_oci" != "no" ]; then
4072 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/oci "OCI" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4073 if [ "$CFG_SQL_oci" = "auto" ]; then
4077 if [ "$CFG_SQL_oci" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4078 echo "Oracle (OCI) support cannot be enabled due to functionality tests!"
4079 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4080 echo " If you believe this message is in error you may use the continue"
4081 echo " switch (-continue) to $0 to continue."
4090 if [ "$CFG_SQL_tds" != "no" ]; then
4091 [ -z "$SYBASE" ] || QT_LFLAGS_TDS="-L$SYBASE/lib"
4092 [ -z "$SYBASE_LIBS" ] || QT_LFLAGS_TDS="$QT_LFLAGS_TDS $SYBASE_LIBS"
4093 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tds "TDS" $QT_LFLAGS_TDS $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4094 if [ "$CFG_SQL_tds" = "auto" ]; then
4098 if [ "$CFG_SQL_tds" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4099 echo "TDS support cannot be enabled due to functionality tests!"
4100 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4101 echo " If you believe this message is in error you may use the continue"
4102 echo " switch (-continue) to $0 to continue."
4111 if [ "$CFG_SQL_db2" != "no" ]; then
4112 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/db2 "DB2" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4113 if [ "$CFG_SQL_db2" = "auto" ]; then
4117 if [ "$CFG_SQL_db2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4118 echo "ODBC support cannot be enabled due to functionality tests!"
4119 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4120 echo " If you believe this message is in error you may use the continue"
4121 echo " switch (-continue) to $0 to continue."
4130 if [ "$CFG_SQL_ibase" != "no" ]; then
4131 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ibase "InterBase" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4132 if [ "$CFG_SQL_ibase" = "auto" ]; then
4133 CFG_SQL_ibase=plugin
4136 if [ "$CFG_SQL_ibase" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4137 echo "InterBase support cannot be enabled due to functionality tests!"
4138 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4139 echo " If you believe this message is in error you may use the continue"
4140 echo " switch (-continue) to $0 to continue."
4149 if [ "$CFG_SQL_sqlite2" != "no" ]; then
4150 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sqlite2 "SQLite2" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4151 if [ "$CFG_SQL_sqlite2" = "auto" ]; then
4152 CFG_SQL_sqlite2=plugin
4155 if [ "$CFG_SQL_sqlite2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4156 echo "SQLite2 support cannot be enabled due to functionality tests!"
4157 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4158 echo " If you believe this message is in error you may use the continue"
4159 echo " switch (-continue) to $0 to continue."
4168 if [ "$CFG_SQL_sqlite" != "no" ]; then
4169 SQLITE_AUTODETECT_FAILED="no"
4170 if [ "$CFG_SQLITE" = "system" ]; then
4171 if [ -n "$PKG_CONFIG" ]; then
4172 QT_CFLAGS_SQLITE=`$PKG_CONFIG --cflags sqlite3 2>/dev/null`
4173 QT_LFLAGS_SQLITE=`$PKG_CONFIG --libs sqlite3 2>/dev/null`
4175 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sqlite "SQLite" $QT_LFLAGS_SQLITE $L_FLAGS $QT_CFLAGS_SQLITE $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4176 if [ "$CFG_SQL_sqlite" = "auto" ]; then
4177 CFG_SQL_sqlite=plugin
4179 QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
4181 SQLITE_AUTODETECT_FAILED="yes"
4184 elif [ -f "$relpath/src/3rdparty/sqlite/sqlite3.h" ]; then
4185 if [ "$CFG_SQL_sqlite" = "auto" ]; then
4186 CFG_SQL_sqlite=plugin
4189 SQLITE_AUTODETECT_FAILED="yes"
4193 if [ "$SQLITE_AUTODETECT_FAILED" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4194 echo "SQLite support cannot be enabled due to functionality tests!"
4195 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4196 echo " If you believe this message is in error you may use the continue"
4197 echo " switch (-continue) to $0 to continue."
4203 if [ "$OPT_VERBOSE" = "yes" ]; then
4204 echo "unknown SQL driver: $_SQLDR"
4210 # auto-detect NIS support
4211 if [ "$CFG_NIS" != "no" ]; then
4212 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/nis "NIS" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4215 if [ "$CFG_NIS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4216 echo "NIS support cannot be enabled due to functionality tests!"
4217 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4218 echo " If you believe this message is in error you may use the continue"
4219 echo " switch (-continue) to $0 to continue."
4227 # auto-detect CUPS support
4228 if [ "$CFG_CUPS" != "no" ]; then
4229 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/cups "Cups" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4232 if [ "$CFG_CUPS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4233 echo "Cups support cannot be enabled due to functionality tests!"
4234 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4235 echo " If you believe this message is in error you may use the continue"
4236 echo " switch (-continue) to $0 to continue."
4244 # auto-detect iconv(3) support
4245 if [ "$CFG_ICONV" != "no" ]; then
4246 if [ "$XPLATFORM_MINGW" = "yes" ]; then
4248 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/iconv" "POSIX iconv" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4250 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/sun-libiconv" "SUN libiconv" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4252 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/gnu-libiconv" "GNU libiconv" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4255 if [ "$CFG_ICONV" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4256 echo "Iconv support cannot be enabled due to functionality tests!"
4257 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4258 echo " If you believe this message is in error you may use the continue"
4259 echo " switch (-continue) to $0 to continue."
4267 # auto-detect libdbus-1 support
4268 if [ "$CFG_DBUS" != "no" ]; then
4269 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then
4270 QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null`
4271 QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null`
4273 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/dbus "D-Bus" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QT_CFLAGS_DBUS $QT_LIBS_DBUS $MAC_CONFIG_TEST_COMMANDLINE; then
4274 [ "$CFG_DBUS" = "auto" ] && CFG_DBUS=yes
4275 QMakeVar set QT_CFLAGS_DBUS "$QT_CFLAGS_DBUS"
4276 QMakeVar set QT_LIBS_DBUS "$QT_LIBS_DBUS"
4278 if [ "$CFG_DBUS" = "auto" ]; then
4280 elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4281 # CFG_DBUS is "yes" or "linked" here
4283 echo "The QtDBus module cannot be enabled because libdbus-1 version $MIN_DBUS_1_VERSION was not found."
4284 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4285 echo " If you believe this message is in error you may use the continue"
4286 echo " switch (-continue) to $0 to continue."
4292 # auto-detect Glib support
4293 if [ "$CFG_GLIB" != "no" ]; then
4294 if [ -n "$PKG_CONFIG" ]; then
4295 QT_CFLAGS_GLIB=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0 2>/dev/null`
4296 QT_LIBS_GLIB=`$PKG_CONFIG --libs glib-2.0 gthread-2.0 2>/dev/null`
4298 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/glib "Glib" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QT_CFLAGS_GLIB $QT_LIBS_GLIB; then
4300 QMakeVar set QT_CFLAGS_GLIB "$QT_CFLAGS_GLIB"
4301 QMakeVar set QT_LIBS_GLIB "$QT_LIBS_GLIB"
4303 if [ "$CFG_GLIB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4304 echo "Glib support cannot be enabled due to functionality tests!"
4305 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4306 echo " If you believe this message is in error you may use the continue"
4307 echo " switch (-continue) to $0 to continue."
4315 # auto-detect GTK style support
4316 if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then
4317 if [ -n "$PKG_CONFIG" ]; then
4318 QT_CFLAGS_QGTKSTYLE=`$PKG_CONFIG --cflags gtk+-2.0 ">=" 2.10 atk 2>/dev/null`
4319 QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
4321 if [ -n "$QT_CFLAGS_QGTKSTYLE" ] ; then
4323 QT_CONFIG="$QT_CONFIG gtkstyle"
4324 QMakeVar set QT_CFLAGS_QGTKSTYLE "$QT_CFLAGS_QGTKSTYLE"
4325 QMakeVar set QT_LIBS_QGTKSTYLE "$QT_LIBS_QGTKSTYLE"
4327 if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4328 echo "Gtk theme support cannot be enabled due to functionality tests!"
4329 echo " Turn on verbose messaging (-v) to $0 to see the fin al report."
4330 echo " If you believe this message is in error you may use the continue"
4331 echo " switch (-continue) to $0 to continue."
4337 elif [ "$CFG_GLIB" = "no" ]; then
4342 if [ "$CFG_GLIB" = "yes" -a "$CFG_GSTREAMER" != "no" ]; then
4343 if [ -n "$PKG_CONFIG" ]; then
4344 QT_CFLAGS_GSTREAMER=`$PKG_CONFIG --cflags gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
4345 QT_LIBS_GSTREAMER=`$PKG_CONFIG --libs gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
4347 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/gstreamer "GStreamer" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QT_CFLAGS_GSTREAMER $QT_LIBS_GSTREAMER; then
4349 QMakeVar set QT_CFLAGS_GSTREAMER "$QT_CFLAGS_GSTREAMER"
4350 QMakeVar set QT_LIBS_GSTREAMER "$QT_LIBS_GSTREAMER"
4352 if [ "$CFG_GSTREAMER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4353 echo "Gstreamer support cannot be enabled due to functionality tests!"
4354 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4355 echo " If you believe this message is in error you may use the continue"
4356 echo " switch (-continue) to $0 to continue."
4362 elif [ "$CFG_GLIB" = "no" ]; then
4366 # auto-detect libicu support
4367 if [ "$CFG_ICU" != "no" ]; then
4368 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/icu "ICU" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4369 [ "$CFG_ICU" = "auto" ] && CFG_ICU=yes
4371 if [ "$CFG_ICU" = "auto" ]; then
4373 elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4376 echo "The ICU library support cannot be enabled."
4377 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4378 echo " If you believe this message is in error you may use the continue"
4379 echo " switch (-continue) to $0 to continue."
4385 # Auto-detect PulseAudio support
4386 if [ "$CFG_PULSEAUDIO" != "no" ]; then
4387 if [ -n "$PKG_CONFIG" ]; then
4388 QT_CFLAGS_PULSEAUDIO=`$PKG_CONFIG --cflags libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null`
4389 QT_LIBS_PULSEAUDIO=`$PKG_CONFIG --libs libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null`
4391 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/pulseaudio "PulseAudio" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QT_CFLAGS_PULSEAUDIO $QT_LIBS_PULSEAUDIO; then
4393 QMakeVar set QT_CFLAGS_PULSEAUDIO "$QT_CFLAGS_PULSEAUDIO"
4394 QMakeVar set QT_LIBS_PULSEAUDIO "$QT_LIBS_PULSEAUDIO"
4396 if [ "$CFG_PULSEAUDIO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4397 echo "PulseAudio support cannot be enabled due to functionality tests!"
4398 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4399 echo " If you believe this message is in error you may use the continue"
4400 echo " switch (-continue) to $0 to continue."
4409 if [ "$XPLATFORM_MINGW" = "yes" ]; then
4410 # auto-detect OpenGL support (es2 = OpenGL ES 2.x)
4411 if [ "$CFG_GUI" = "no" ]; then
4412 if [ "$CFG_OPENGL" = "auto" ]; then
4415 if [ "$CFG_OPENGL" != "no" ]; then
4416 echo "OpenGL enabled, but GUI disabled."
4417 echo " You might need to either enable the GUI or disable OpenGL"
4421 if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
4422 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4424 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4427 if [ "$CFG_OPENGL" = "yes" ]; then
4428 echo "All the OpenGL functionality tests failed!"
4429 echo " You might need to modify the include and library search paths by editing"
4430 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4431 echo " ${XQMAKESPEC}."
4438 # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
4439 if [ "$CFG_OPENGL" = "desktop" ]; then
4440 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS
4441 if [ $? != "0" ]; then
4442 QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
4449 elif [ "$CFG_OPENGL" = "es2" ]; then
4451 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS
4452 if [ $? != "0" ]; then
4453 echo "The OpenGL ES 2.0 functionality test failed!"
4454 echo " You might need to modify the include and library search paths by editing"
4455 echo " QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in"
4456 echo " ${XQMAKESPEC}."
4459 elif [ "$CFG_OPENGL" = "desktop" ]; then
4460 # Desktop OpenGL support
4461 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS
4462 if [ $? != "0" ]; then
4463 echo "The OpenGL functionality test failed!"
4464 echo " You might need to modify the include and library search paths by editing"
4465 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4466 echo " ${XQMAKESPEC}."
4471 # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
4472 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS
4473 if [ $? != "0" ]; then
4474 QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
4481 fi # X11/MINGW OpenGL
4483 if [ "$BUILD_ON_MAC" = "yes" ]; then
4484 if [ "$CFG_PHONON" != "no" ]; then
4485 # Always enable Phonon (unless it was explicitly disabled)
4489 if [ "$CFG_COREWLAN" = "auto" ]; then
4490 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/corewlan "CoreWlan" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4498 # auto-detect OpenGL support (es2 = OpenGL ES 2.x)
4499 if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
4500 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengldesktop "OpenGL" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4502 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4505 if [ "$CFG_OPENGL" = "yes" ]; then
4506 echo "All the OpenGL functionality tests failed!"
4507 echo " You might need to modify the include and library search paths by editing"
4508 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4509 echo " ${XQMAKESPEC}."
4514 elif [ "$CFG_OPENGL" = "es2" ]; then
4516 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists glesv2 2>/dev/null; then
4517 QMAKE_INCDIR_OPENGL_ES2=`$PKG_CONFIG --cflags-only-I glesv2 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
4518 QMAKE_LIBDIR_OPENGL_ES2=`$PKG_CONFIG --libs-only-L glesv2 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'`
4519 QMAKE_LIBS_OPENGL_ES2=`$PKG_CONFIG --libs glesv2 2>/dev/null`
4520 QMAKE_CFLAGS_OPENGL_ES2=`$PKG_CONFIG --cflags glesv2 2>/dev/null`
4521 QMakeVar set QMAKE_INCDIR_OPENGL_ES2 "$QMAKE_INCDIR_OPENGL_ES2"
4522 QMakeVar set QMAKE_LIBDIR_OPENGL_ES2 "$QMAKE_LIBDIR_OPENGL_ES2"
4523 QMakeVar set QMAKE_LIBS_OPENGL_ES2 "$QMAKE_LIBS_OPENGL_ES2"
4526 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2
4527 if [ $? != "0" ]; then
4528 echo "The OpenGL ES 2.0 functionality test failed!"
4529 echo " You might need to modify the include and library search paths by editing"
4530 echo " QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in"
4531 echo " ${XQMAKESPEC}."
4534 elif [ "$CFG_OPENGL" = "desktop" ]; then
4535 # Desktop OpenGL support
4536 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengldesktop "OpenGL" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS
4537 if [ $? != "0" ]; then
4538 echo "The OpenGL functionality test failed!"
4539 echo " You might need to modify the include and library search paths by editing"
4540 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4541 echo " ${XQMAKESPEC}."
4546 # auto-detect FontConfig support
4547 if [ "$CFG_FONTCONFIG" != "no" ]; then
4548 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig --exists freetype2 2>/dev/null; then
4549 QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig --cflags freetype2 2>/dev/null`
4550 QT_LIBS_FONTCONFIG=`$PKG_CONFIG --libs fontconfig --libs freetype2 2>/dev/null`
4552 QT_CFLAGS_FONTCONFIG=
4553 QT_LIBS_FONTCONFIG="-lfreetype -lfontconfig"
4555 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/fontconfig "FontConfig" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QT_CFLAGS_FONTCONFIG $QT_LIBS_FONTCONFIG; then
4556 QT_CONFIG="$QT_CONFIG fontconfig"
4557 QMakeVar set QMAKE_CFLAGS_FONTCONFIG "$QT_CFLAGS_FONTCONFIG"
4558 QMakeVar set QMAKE_LIBS_FONTCONFIG "$QT_LIBS_FONTCONFIG"
4560 CFG_LIBFREETYPE=system
4567 # Save these for a check later
4568 ORIG_CFG_XCB="$CFG_XCB"
4569 ORIG_CFG_EGLFS="$CFG_EGLFS"
4570 ORIG_CFG_DIRECTFB="$CFG_DIRECTFB"
4572 if [ "$CFG_LIBUDEV" != "no" ]; then
4573 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then
4574 QMAKE_INCDIR_LIBUDEV=`$PKG_CONFIG --cflags-only-I libudev 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
4575 QMAKE_LIBS_LIBUDEV=`$PKG_CONFIG --libs libudev 2>/dev/null`
4576 QMakeVar set QMAKE_INCDIR_LIBUDEV "$QMAKE_INCDIR_LIBUDEV"
4577 QMakeVar set QMAKE_LIBS_LIBUDEV "$QMAKE_LIBS_LIBUDEV"
4579 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libudev "libudev" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QMAKE_INCDIR_LIBUDEV $QMAKE_LIBS_LIBUDEV; then
4581 QT_CONFIG="$QT_CONFIG libudev"
4582 elif [ "$CFG_LIBUDEV" = "yes" ]; then
4583 echo "The libudev functionality test failed!"
4587 QMakeVar add DEFINES QT_NO_LIBUDEV
4591 if [ "$CFG_EVDEV" != "no" ]; then
4592 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/evdev "evdev" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4594 QT_CONFIG="$QT_CONFIG evdev"
4595 elif [ "$CFG_EVDEV" = "yes" ]; then
4596 echo "The evdev functionality test failed!"
4600 QMakeVar add DEFINES QT_NO_EVDEV
4604 # Check we actually have X11 :-)
4605 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xlib "XLib" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4606 QT_CONFIG="$QT_CONFIG xlib"
4609 # auto-detect Xrender support
4610 if [ "$CFG_XRENDER" != "no" ]; then
4611 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xrender "Xrender" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4613 QT_CONFIG="$QT_CONFIG xrender"
4615 if [ "$CFG_XRENDER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4616 echo "Xrender support cannot be enabled due to functionality tests!"
4617 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4618 echo " If you believe this message is in error you may use the continue"
4619 echo " switch (-continue) to $0 to continue."
4627 if [ "$CFG_XCB" != "no" ]; then
4628 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xcb >= 1.5" 2>/dev/null; then
4629 QMAKE_CFLAGS_XCB="`$PKG_CONFIG --cflags xcb 2>/dev/null`"
4630 QMAKE_LIBS_XCB="`$PKG_CONFIG --libs xcb 2>/dev/null`"
4632 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qpa/xcb "xcb" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
4634 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qpa/xcb-render "xcb-render" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
4635 QT_CONFIG="$QT_CONFIG xcb-render"
4638 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qpa/xcb-poll-for-queued-event "xcb-poll-for-queued-event" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
4640 QT_CONFIG="$QT_CONFIG xcb-poll-for-queued-event"
4643 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qpa/xcb-xlib "xcb-xlib" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
4644 QT_CONFIG="$QT_CONFIG xcb-xlib"
4647 if [ "$XPLATFORM_MAEMO" = "yes" ]; then
4648 # auto-detect XInput2/Xinput support
4649 if [ "$CFG_XINPUT2" != "no" ]; then
4650 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xinput2 "XInput2" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4654 if [ "$CFG_XINPUT2" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4655 echo "XInput2 support cannot be enabled due to functionality tests!"
4656 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4657 echo " If you believe this message is in error you may use the continue"
4658 echo " switch (-continue) to $0 to continue."
4667 if [ "$CFG_XCB" = "yes" ]; then
4668 echo "The XCB test failed!"
4669 echo " You might need to install dependency packages."
4670 echo " See src/plugins/platforms/xcb/README."
4674 QMakeVar add DEFINES QT_NO_XCB
4678 if [ "$CFG_DIRECTFB" != "no" ]; then
4679 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists directfb 2>/dev/null; then
4680 QMAKE_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
4681 QMAKE_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
4682 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/directfb" "DirectFB" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QMAKE_CFLAGS_DIRECTFB $QMAKE_LIBS_DIRECTFB; then
4684 elif [ "$CFG_DIRECTFB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4685 echo " DirectFB support cannot be enabled due to functionality tests!"
4686 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4687 echo " If you believe this message is in error you may use the continue"
4688 echo " switch (-continue) to $0 to continue."
4698 # Detect libxkbcommon
4699 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists xkbcommon 2>/dev/null; then
4700 QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`"
4701 QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon 2>/dev/null`"
4702 QMAKE_CFLAGS_XCB="$QMAKE_CFLAGS_XCB $QMAKE_CFLAGS_XKBCOMMON"
4703 QMAKE_LIBS_XCB="$QMAKE_LIBS_XCB $QMAKE_LIBS_XKBCOMMON"
4705 QMAKE_DEFINES_XCB=QT_NO_XCB_XKB
4709 if [ "$CFG_EGL" != "no" ] && [ "$CFG_OPENGL" != "desktop" ]; then
4710 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists egl 2>/dev/null; then
4711 QMAKE_INCDIR_EGL=`$PKG_CONFIG --cflags-only-I egl 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
4712 QMAKE_LIBS_EGL=`$PKG_CONFIG --libs egl 2>/dev/null`
4713 QMAKE_CFLAGS_EGL=`$PKG_CONFIG --cflags egl 2>/dev/null`
4714 QMakeVar set QMAKE_INCDIR_EGL "$QMAKE_INCDIR_EGL"
4715 QMakeVar set QMAKE_LIBS_EGL "$QMAKE_LIBS_EGL"
4716 fi # detect EGL support
4717 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/qpa/egl" "EGL" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QMAKE_CFLAGS_EGL $QMAKE_LIBS_EGL; then
4719 elif [ "$CFG_EGL" = "yes" ]; then
4720 echo " The EGL functionality test failed; EGL is required by some QPA plugins to manage contexts & surfaces."
4721 echo " You might need to modify the include and library search paths by editing"
4722 echo " QMAKE_INCDIR_EGL, QMAKE_LIBDIR_EGL and QMAKE_LIBS_EGL in ${XQMAKESPEC}."
4727 elif [ "$CFG_OPENGL" = "desktop" ]; then
4728 if [ "$CFG_EGL" = "yes" ]; then
4729 echo "EGL support was requested but Qt is being configured for desktop OpenGL."
4730 echo "Either disable EGL support or enable OpenGL ES support."
4736 if [ "$CFG_EGLFS" != "no" ]; then
4737 if [ "$CFG_OPENGL" = "es2" ] && [ "$CFG_EVDEV" = "yes" ]; then
4738 CFG_EGLFS="$CFG_EGL"
4744 # Determine the default QPA platform
4745 if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then
4747 QT_QPA_DEFAULT_PLATFORM=`getXQMakeConf QT_QPA_DEFAULT_PLATFORM`
4748 if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then
4749 if [ "$XPLATFORM_MINGW" = "yes" ]; then
4750 QT_QPA_DEFAULT_PLATFORM="windows"
4751 elif [ "$BUILD_ON_MAC" = "yes" ]; then
4752 QT_QPA_DEFAULT_PLATFORM="cocoa"
4753 elif [ "$UNAME_SYSTEM" = "QNX" ]; then
4754 QT_QPA_DEFAULT_PLATFORM="qnx"
4756 QT_QPA_DEFAULT_PLATFORM="xcb"
4761 if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then
4762 QMakeVar set QMAKE_CFLAGS_XCB "$QMAKE_CFLAGS_XCB"
4763 QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB"
4764 QMakeVar set QMAKE_DEFINES_XCB "$QMAKE_DEFINES_XCB"
4766 if [ "$CFG_DIRECTFB" = "yes" ]; then
4767 QT_CONFIG="$QT_CONFIG directfb"
4768 QMakeVar set QMAKE_CFLAGS_DIRECTFB "$QMAKE_CFLAGS_DIRECTFB"
4769 QMakeVar set QMAKE_LIBS_DIRECTFB "$QMAKE_LIBS_DIRECTFB"
4772 if [ "$BUILD_ON_MAC" = "yes" ]; then
4773 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4774 QT_CONFIG="$QT_CONFIG coreservices"
4776 QMakeVar add DEFINES QT_NO_CORESERVICES
4780 if [ "$BUILD_ON_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ] && [ "$XPLATFORM_QNX" = "no" ]; then
4781 if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ]; then
4782 if [ "$QPA_PLATFORM_GUARD" = "yes" ] &&
4783 ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] ); then
4784 echo "No QPA platform plugin enabled!"
4785 echo " If you really want to build without a QPA platform plugin you must pass"
4786 echo " -no-qpa-platform-guard to configure. Doing this will"
4787 echo " produce a Qt that can not run GUI applications."
4788 echo " The dependencies needed for xcb to build are listed in"
4789 echo " src/plugins/platforms/xcb/README"
4795 [ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_PHONON" != "no" ] && CFG_PHONON="yes"
4798 [ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_LIBFREETYPE" = "auto" ] && CFG_LIBFREETYPE=no
4799 if [ "$CFG_LIBFREETYPE" = "auto" ]; then
4800 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/freetype "FreeType" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4801 CFG_LIBFREETYPE=system
4807 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS &&
4808 [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4809 echo "STL functionality check failed! Cannot build Qt with this STL library."
4810 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4815 # detect POSIX clock_gettime()
4816 if [ "$CFG_CLOCK_GETTIME" = "auto" ]; then
4817 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/clock-gettime "POSIX clock_gettime()" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4818 CFG_CLOCK_GETTIME=yes
4820 CFG_CLOCK_GETTIME=no
4824 # detect POSIX monotonic clocks
4825 if [ "$CFG_CLOCK_GETTIME" = "yes" ] && [ "$CFG_CLOCK_MONOTONIC" = "auto" ]; then
4826 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/clock-monotonic "POSIX Monotonic Clock" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4827 CFG_CLOCK_MONOTONIC=yes
4829 CFG_CLOCK_MONOTONIC=no
4831 elif [ "$CFG_CLOCK_GETTIME" = "no" ]; then
4832 CFG_CLOCK_MONOTONIC=no
4836 if [ "$CFG_MREMAP" = "auto" ]; then
4837 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mremap "mremap" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4844 # find if the platform provides getaddrinfo (ipv6 dns lookups)
4845 if [ "$CFG_GETADDRINFO" != "no" ]; then
4846 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getaddrinfo "getaddrinfo" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4849 if [ "$CFG_GETADDRINFO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4850 echo "getaddrinfo support cannot be enabled due to functionality tests!"
4851 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4852 echo " If you believe this message is in error you may use the continue"
4853 echo " switch (-continue) to $0 to continue."
4861 # find if the platform provides inotify
4862 if [ "$CFG_INOTIFY" != "no" ]; then
4863 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/inotify "inotify" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4866 if [ "$CFG_INOTIFY" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4867 echo "inotify support cannot be enabled due to functionality tests!"
4868 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4869 echo " If you believe this message is in error you may use the continue"
4870 echo " switch (-continue) to $0 to continue."
4878 # find if the platform provides if_nametoindex (ipv6 interface name support)
4879 if [ "$CFG_IPV6IFNAME" != "no" ]; then
4880 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6ifname "IPv6 interface name" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4883 if [ "$CFG_IPV6IFNAME" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4884 echo "IPv6 interface name support cannot be enabled due to functionality tests!"
4885 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4886 echo " If you believe this message is in error you may use the continue"
4887 echo " switch (-continue) to $0 to continue."
4895 # find if the platform provides getifaddrs (network interface enumeration)
4896 if [ "$CFG_GETIFADDRS" != "no" ]; then
4897 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getifaddrs "getifaddrs" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4900 if [ "$CFG_GETIFADDRS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4901 echo "getifaddrs support cannot be enabled due to functionality tests!"
4902 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4903 echo " If you believe this message is in error you may use the continue"
4904 echo " switch (-continue) to $0 to continue."
4913 if [ "$CFG_OPENSSL" != "no" ]; then
4914 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/openssl "OpenSSL" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4915 if [ "$CFG_OPENSSL" = "auto" ]; then
4919 if ( [ "$CFG_OPENSSL" = "yes" ] || [ "$CFG_OPENSSL" = "linked" ] ) && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4920 echo "OpenSSL support cannot be enabled due to functionality tests!"
4921 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4922 echo " If you believe this message is in error you may use the continue"
4923 echo " switch (-continue) to $0 to continue."
4932 if [ "$CFG_PCRE" != "qt" ]; then
4933 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/pcre "PCRE" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4936 if [ "$CFG_PCRE" = "system" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4937 echo "PCRE support cannot be enabled due to functionality tests!"
4938 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4939 echo " If you believe this message is in error you may use the continue"
4940 echo " switch (-continue) to $0 to continue."
4948 # detect OpenVG support
4949 if [ "$CFG_OPENVG" != "no" ]; then
4950 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $CONFIG_ARG; then
4951 if [ "$CFG_OPENVG" = "auto" ]; then
4954 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG openvg_on_opengl" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $CONFIG_ARG; then
4955 if [ "$CFG_OPENVG" = "auto" ]; then
4958 CFG_OPENVG_ON_OPENGL=yes
4959 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG lower_case_includes" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG (lc includes)" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $CONFIG_ARG; then
4960 if [ "$CFG_OPENVG" = "auto" ]; then
4963 CFG_OPENVG_LC_INCLUDES=yes
4964 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG openvg_on_opengl lower_case_includes" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG (lc includes)" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $CONFIG_ARG; then
4965 if [ "$CFG_OPENVG" = "auto" ]; then
4968 CFG_OPENVG_LC_INCLUDES=yes
4969 CFG_OPENVG_ON_OPENGL=yes
4971 if [ "$CFG_OPENVG" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4972 echo "$CFG_OPENVG was specified for OpenVG but cannot be enabled due to functionality tests!"
4973 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4974 echo " If you believe this message is in error you may use the continue"
4975 echo " switch (-continue) to $0 to continue."
4981 if [ "$CFG_OPENVG" = "yes" ] && "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/shivavg" "ShivaVG" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $CONFIG_ARG; then
4982 CFG_OPENVG_SHIVA=yes
4986 if [ "$CFG_ALSA" = "auto" ]; then
4987 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/alsa "alsa" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS; then
4994 if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
4995 if [ "$CFG_ARCH" = "arm" ]; then
4996 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/javascriptcore-jit "javascriptcore-jit" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS
4997 if [ $? != "0" ]; then
4998 CFG_JAVASCRIPTCORE_JIT=no
5001 case "$XPLATFORM" in
5003 CFG_JAVASCRIPTCORE_JIT=no
5009 if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ]; then
5010 QMakeVar set JAVASCRIPTCORE_JIT yes
5011 elif [ "$CFG_JAVASCRIPTCORE_JIT" = "no" ]; then
5012 QMakeVar set JAVASCRIPTCORE_JIT no
5015 if [ "$CFG_AUDIO_BACKEND" = "auto" ]; then
5016 CFG_AUDIO_BACKEND=yes
5019 if [ "$CFG_LARGEFILE" != "yes" ] && [ "$XPLATFORM_MINGW" = "yes" ]; then
5020 echo "Warning: largefile support cannot be disabled for win32."
5024 #-------------------------------------------------------------------------------
5025 # ask for all that hasn't been auto-detected or specified in the arguments
5026 #-------------------------------------------------------------------------------
5028 [ "$CFG_CXX11" = "yes" ] && QT_CONFIG="$QT_CONFIG c++11"
5031 if [ "$CFG_PHONON_BACKEND" = "yes" ]; then
5032 QT_CONFIG="$QT_CONFIG phonon-backend"
5035 # disable accessibility
5036 if [ "$CFG_ACCESSIBILITY" = "no" ]; then
5037 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ACCESSIBILITY"
5039 QT_CONFIG="$QT_CONFIG accessibility"
5043 if [ "$CFG_EGL" = "yes" ]; then
5044 QT_CONFIG="$QT_CONFIG egl"
5046 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL"
5050 if [ "$CFG_EGLFS" = "yes" ]; then
5051 QT_CONFIG="$QT_CONFIG eglfs"
5053 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGLFS"
5057 if [ "$CFG_OPENVG" = "no" ]; then
5058 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENVG"
5060 QT_CONFIG="$QT_CONFIG openvg"
5061 if [ "$CFG_OPENVG_LC_INCLUDES" = "yes" ]; then
5062 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LOWER_CASE_VG_INCLUDES"
5064 if [ "$CFG_OPENVG_ON_OPENGL" = "yes" ]; then
5065 QT_CONFIG="$QT_CONFIG openvg_on_opengl"
5067 if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
5068 QT_CONFIG="$QT_CONFIG shivavg"
5069 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SHIVAVG"
5074 if [ "$CFG_OPENGL" = "no" ]; then
5075 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENGL"
5077 QT_CONFIG="$QT_CONFIG opengl"
5080 if [ "$CFG_OPENGL" = "es2" ]; then
5081 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES"
5084 if [ "$CFG_OPENGL" = "es2" ]; then
5085 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_2"
5086 QT_CONFIG="$QT_CONFIG opengles2"
5089 # safe execution environment
5090 if [ "$CFG_SXE" != "no" ]; then
5091 QT_CONFIG="$QT_CONFIG sxe"
5094 # build up the variables for output
5095 if [ "$CFG_DEBUG" = "yes" ]; then
5096 QMAKE_OUTDIR="${QMAKE_OUTDIR}debug"
5097 elif [ "$CFG_DEBUG" = "no" ]; then
5098 QMAKE_OUTDIR="${QMAKE_OUTDIR}release"
5100 if [ "$CFG_SHARED" = "yes" ]; then
5101 QMAKE_OUTDIR="${QMAKE_OUTDIR}-shared"
5102 QMAKE_CONFIG="$QMAKE_CONFIG shared dll"
5103 elif [ "$CFG_SHARED" = "no" ]; then
5104 QMAKE_OUTDIR="${QMAKE_OUTDIR}-static"
5105 QMAKE_CONFIG="$QMAKE_CONFIG static"
5108 #FIXME: qpa is implicit this should all be removed
5109 QMAKE_CONFIG="$QMAKE_CONFIG qpa"
5110 QT_CONFIG="$QT_CONFIG qpa"
5111 QTCONFIG_CONFIG="$QTCONFIG_CONFIG qpa"
5112 rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
5114 if [ "$XPLATFORM_MINGW" != "yes" ]; then
5115 # Do not set this here for Windows. Let qmake do it so
5116 # debug and release precompiled headers are kept separate.
5117 QMakeVar set PRECOMPILED_DIR ".pch/$QMAKE_OUTDIR"
5119 QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR"
5120 QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR"
5121 QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR"
5122 QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR"
5123 if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
5124 QMAKE_CONFIG="$QMAKE_CONFIG largefile"
5126 if [ "$CFG_USE_GNUMAKE" = "yes" ]; then
5127 QMAKE_CONFIG="$QMAKE_CONFIG GNUmake"
5129 [ "$CFG_REDUCE_EXPORTS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_exports"
5130 [ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
5131 [ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
5132 if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
5133 QMakeVar add QMAKE_CFLAGS -g
5134 QMakeVar add QMAKE_CXXFLAGS -g
5135 QT_CONFIG="$QT_CONFIG separate_debug_info"
5137 if [ "$CFG_SEPARATE_DEBUG_INFO_NOCOPY" = "yes" ] ; then
5138 QT_CONFIG="$QT_CONFIG separate_debug_info_nocopy"
5140 [ "$CFG_SSE2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse2"
5141 [ "$CFG_SSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse3"
5142 [ "$CFG_SSSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG ssse3"
5143 [ "$CFG_SSE4_1" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_1"
5144 [ "$CFG_SSE4_2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_2"
5145 [ "$CFG_AVX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx"
5146 [ "$CFG_AVX2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx2"
5147 [ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
5148 [ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon"
5149 if [ "$CFG_ARCH" = "mips" ]; then
5150 [ "$CFG_MIPS_DSP" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mips_dsp"
5151 [ "$CFG_MIPS_DSPR2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mips_dspr2"
5153 if [ "$CFG_CLOCK_GETTIME" = "yes" ]; then
5154 QT_CONFIG="$QT_CONFIG clock-gettime"
5156 if [ "$CFG_CLOCK_MONOTONIC" = "yes" ]; then
5157 QT_CONFIG="$QT_CONFIG clock-monotonic"
5159 if [ "$CFG_MREMAP" = "yes" ]; then
5160 QT_CONFIG="$QT_CONFIG mremap"
5162 if [ "$CFG_GETADDRINFO" = "yes" ]; then
5163 QT_CONFIG="$QT_CONFIG getaddrinfo"
5165 if [ "$CFG_IPV6IFNAME" = "yes" ]; then
5166 QT_CONFIG="$QT_CONFIG ipv6ifname"
5168 if [ "$CFG_GETIFADDRS" = "yes" ]; then
5169 QT_CONFIG="$QT_CONFIG getifaddrs"
5171 if [ "$CFG_INOTIFY" = "yes" ]; then
5172 QT_CONFIG="$QT_CONFIG inotify"
5174 if [ "$CFG_LIBJPEG" = "no" ]; then
5176 elif [ "$CFG_LIBJPEG" = "system" ]; then
5177 QT_CONFIG="$QT_CONFIG system-jpeg"
5179 if [ "$CFG_JPEG" = "no" ]; then
5180 QT_CONFIG="$QT_CONFIG no-jpeg"
5181 elif [ "$CFG_JPEG" = "yes" ]; then
5182 QT_CONFIG="$QT_CONFIG jpeg"
5184 if [ "$CFG_LIBPNG" = "no" ]; then
5187 if [ "$CFG_LIBPNG" = "system" ]; then
5188 QT_CONFIG="$QT_CONFIG system-png"
5190 if [ "$CFG_PNG" = "no" ]; then
5191 QT_CONFIG="$QT_CONFIG no-png"
5192 elif [ "$CFG_PNG" = "yes" ]; then
5193 QT_CONFIG="$QT_CONFIG png"
5195 if [ "$CFG_GIF" = "no" ]; then
5196 QT_CONFIG="$QT_CONFIG no-gif"
5197 elif [ "$CFG_GIF" = "yes" ]; then
5198 QT_CONFIG="$QT_CONFIG gif"
5200 if [ "$CFG_LIBFREETYPE" = "no" ]; then
5201 QT_CONFIG="$QT_CONFIG no-freetype"
5202 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FREETYPE"
5203 elif [ "$CFG_LIBFREETYPE" = "system" ]; then
5204 QT_CONFIG="$QT_CONFIG system-freetype"
5206 QT_CONFIG="$QT_CONFIG freetype"
5208 if [ "$CFG_GUI" = "auto" ]; then
5211 if [ "$CFG_GUI" = "no" ]; then
5212 QT_CONFIG="$QT_CONFIG no-gui"
5215 if [ "$CFG_WIDGETS" = "no" ]; then
5216 QT_CONFIG="$QT_CONFIG no-widgets"
5217 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WIDGETS"
5220 if [ "x$BUILD_ON_MAC" = "xyes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
5221 #On Mac we implicitly link against libz, so we
5222 #never use the 3rdparty stuff.
5223 [ "$CFG_ZLIB" = "yes" ] && CFG_ZLIB="system"
5225 if [ "$CFG_ZLIB" = "yes" ]; then
5226 QT_CONFIG="$QT_CONFIG zlib"
5227 elif [ "$CFG_ZLIB" = "system" ]; then
5228 QT_CONFIG="$QT_CONFIG system-zlib"
5231 [ "$CFG_NIS" = "yes" ] && QT_CONFIG="$QT_CONFIG nis"
5232 [ "$CFG_CUPS" = "yes" ] && QT_CONFIG="$QT_CONFIG cups"
5233 [ "$CFG_ICONV" = "yes" ] && QT_CONFIG="$QT_CONFIG iconv"
5234 [ "$CFG_ICONV" = "sun" ] && QT_CONFIG="$QT_CONFIG sun-libiconv"
5235 [ "$CFG_ICONV" = "gnu" ] && QT_CONFIG="$QT_CONFIG gnu-libiconv"
5236 [ "$CFG_GLIB" = "yes" ] && QT_CONFIG="$QT_CONFIG glib"
5237 [ "$CFG_GSTREAMER" = "yes" ] && QT_CONFIG="$QT_CONFIG gstreamer"
5238 [ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus"
5239 [ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked"
5240 [ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl"
5241 [ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked"
5242 [ "$CFG_MAC_HARFBUZZ" = "yes" ] && QT_CONFIG="$QT_CONFIG harfbuzz"
5243 [ "$CFG_XCB" = "yes" ] && QT_CONFIG="$QT_CONFIG xcb"
5244 [ "$CFG_XINPUT2" = "yes" ] && QT_CONFIG="$QT_CONFIG xinput2"
5246 [ '!' -z "$DEFINES" ] && QMakeVar add DEFINES "$DEFINES"
5247 [ '!' -z "$L_FLAGS" ] && QMakeVar add QMAKE_LIBDIR_FLAGS "$L_FLAGS"
5248 [ '!' -z "$l_FLAGS" ] && QMakeVar add LIBS "$l_FLAGS"
5250 if [ "$PLATFORM_MAC" = "yes" ] && [ "$QT_CROSS_COMPILE" = "no" ]; then
5251 if [ "$CFG_RPATH" = "yes" ]; then
5252 QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname"
5253 # set the default rpath to the library installation directory
5254 RPATH_FLAGS="\"$QT_INSTALL_LIBS\" $RPATH_FLAGS"
5256 elif [ -z "`getXQMakeConf 'QMAKE_(LFLAGS_)?RPATH'`" ]; then
5257 if [ -n "$RPATH_FLAGS" ]; then
5259 echo "ERROR: -R cannot be used on this platform as \$QMAKE_LFLAGS_RPATH is"
5263 elif [ "$CFG_RPATH" = "yes" ]; then
5264 RPATH_MESSAGE=" NOTE: This platform does not support runtime library paths, using -no-rpath."
5268 if [ "$CFG_RPATH" = "yes" ]; then
5269 # set the default rpath to the library installation directory
5270 RPATH_FLAGS="\"$QT_INSTALL_LIBS\" $RPATH_FLAGS"
5272 if [ -n "$RPATH_FLAGS" ]; then
5273 # add the user defined rpaths
5274 QMakeVar add QMAKE_RPATHDIR "$RPATH_FLAGS"
5278 if [ '!' -z "$I_FLAGS" ]; then
5279 # add the user define include paths
5280 QMakeVar add QMAKE_CFLAGS "$I_FLAGS"
5281 QMakeVar add QMAKE_CXXFLAGS "$I_FLAGS"
5284 if [ '!' -z "$W_FLAGS" ]; then
5285 # add the user defined warning flags
5286 QMakeVar add QMAKE_CFLAGS_WARN_ON "$W_FLAGS"
5287 QMakeVar add QMAKE_CXXFLAGS_WARN_ON "$W_FLAGS"
5288 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_WARN_ON "$W_FLAGS"
5291 if [ "$XPLATFORM_MINGW" = "yes" ]; then
5292 # mkspecs/features/win32/default_pre.prf sets "no-rtti".
5293 # Follow default behavior of configure.exe by overriding with "rtti".
5294 QTCONFIG_CONFIG="$QTCONFIG_CONFIG rtti"
5297 if [ "$CFG_ALSA" = "yes" ]; then
5298 QT_CONFIG="$QT_CONFIG alsa"
5301 if [ "$CFG_PULSEAUDIO" = "yes" ]; then
5302 QT_CONFIG="$QT_CONFIG pulseaudio"
5305 if [ "$CFG_COREWLAN" = "yes" ]; then
5306 QT_CONFIG="$QT_CONFIG corewlan"
5309 if [ "$CFG_ICU" = "yes" ]; then
5310 QT_CONFIG="$QT_CONFIG icu"
5313 if [ "$CFG_FORCE_ASSERTS" = "yes" ]; then
5314 QT_CONFIG="$QT_CONFIG force_asserts"
5317 if [ "$CFG_PCRE" = "qt" ]; then
5318 QMAKE_CONFIG="$QMAKE_CONFIG pcre"
5322 # Some Qt modules are too advanced in C++ for some old compilers
5323 # Detect here the platforms where they are known to work.
5325 # See Qt documentation for more information on which features are
5326 # supported and on which compilers.
5328 canBuildQtConcurrent="yes"
5329 canUseV8Snapshot="yes"
5331 case "$XPLATFORM" in
5333 # PA-RISC's assembly is too limited
5334 # gcc 3.4 on that platform can't build QtXmlPatterns
5335 # the assembly it generates cannot be compiled
5337 # Check gcc's version
5338 case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
5342 canBuildQtXmlPatterns="no"
5346 canBuildQtXmlPatterns="no"
5350 unsupported/vxworks-*-g++*)
5353 unsupported/vxworks-*-dcc*)
5355 canBuildQtXmlPatterns="no"
5358 # Check gcc's version
5359 case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
5367 canBuildQtXmlPatterns="no"
5372 # Check the compiler version
5373 case `${QMAKE_CONF_COMPILER} -V 2>&1 | awk '{print $4}'` in
5376 canBuildQtXmlPatterns="no"
5377 canBuildQtConcurrent="no"
5381 canBuildQtConcurrent="no"
5387 canBuildQtXmlPatterns="no"
5388 canBuildQtConcurrent="no"
5394 # Get the xlC version
5395 cat > xlcver.c <<EOF
5399 printf("%d.%d\n", __xlC__ >> 8, __xlC__ & 0xFF);
5404 if ${QMAKE_CONF_COMPILER} -o xlcver xlcver.c >/dev/null 2>/dev/null; then
5405 xlcver=`./xlcver 2>/dev/null`
5408 if [ "$OPT_VERBOSE" = "yes" ]; then
5409 if [ -n "$xlcver" ]; then
5410 echo Found IBM xlC version: $xlcver.
5412 echo Could not determine IBM xlC version, assuming oldest supported.
5419 canBuildQtXmlPatterns="no"
5420 canBuildQtConcurrent="no"
5424 canBuildQtConcurrent="no"
5430 canBuildQtConcurrent="no"
5434 if [ "$CFG_GUI" = "no" ]; then
5435 # WebKit requires QtGui
5439 if [ "$CFG_SHARED" = "no" ]; then
5441 echo "WARNING: Using static linking will disable the WebKit module."
5446 CFG_CONCURRENT="yes"
5447 if [ "$canBuildQtConcurrent" = "no" ]; then
5448 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CONCURRENT"
5451 QT_CONFIG="$QT_CONFIG concurrent"
5455 if [ "$CFG_AUDIO_BACKEND" = "yes" ]; then
5456 QT_CONFIG="$QT_CONFIG audio-backend"
5460 if [ "$CFG_WEBKIT" = "debug" ]; then
5461 QMAKE_CONFIG="$QMAKE_CONFIG webkit-debug"
5465 QT_CONFIG="$QT_CONFIG v8"
5466 # Detect snapshot support
5467 if [ "$CFG_ARCH" != "$CFG_HOST_ARCH" ]; then
5468 case "$CFG_HOST_ARCH,$CFG_ARCH" in
5471 *) canUseV8Snapshot="no"
5475 if [ -n "$_SBOX_DIR" -a "$CFG_ARCH" = "arm" ]; then
5476 # QEMU crashes when building inside Scratchbox with an ARM target
5477 canUseV8Snapshot="no"
5480 if [ "$CFG_V8SNAPSHOT" = "auto" ]; then
5481 CFG_V8SNAPSHOT="$canUseV8Snapshot"
5483 if [ "$CFG_V8SNAPSHOT" = "yes" -a "$canUseV8Snapshot" = "no" ]; then
5484 echo "Error: V8 snapshot was requested, but is not supported on this platform."
5487 if [ "$CFG_V8SNAPSHOT" = "yes" ]; then
5488 QT_CONFIG="$QT_CONFIG v8snapshot"
5492 if [ "$CFG_QML_DEBUG" = "no" ]; then
5493 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QML_NO_DEBUGGER"
5496 case "$QMAKE_CONF_COMPILER" in
5499 COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
5501 case "$COMPILER_VERSION" in
5503 QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
5504 QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
5505 QT_GCC_PATCH_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
5508 QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\1,'`
5509 QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\2,'`
5510 QT_GCC_PATCH_VERSION=0
5520 #-------------------------------------------------------------------------------
5521 # part of configuration information goes into qconfig.h
5522 #-------------------------------------------------------------------------------
5524 case "$CFG_QCONFIG" in
5526 echo "/* Everything */" >"$outpath/src/corelib/global/qconfig.h.new"
5529 tmpconfig="$outpath/src/corelib/global/qconfig.h.new"
5530 echo "#ifndef QT_BOOTSTRAPPED" >"$tmpconfig"
5531 if [ -f "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" ]; then
5532 cat "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" >>"$tmpconfig"
5533 elif [ -f `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` ]; then
5534 cat `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` >>"$tmpconfig"
5536 echo "#endif" >>"$tmpconfig"
5540 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
5544 # define QT_EDITION $QT_EDITION
5548 echo '/* Compile time features */' >>"$outpath/src/corelib/global/qconfig.h.new"
5549 [ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\"" >>"$outpath/src/corelib/global/qconfig.h.new"
5551 if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
5552 echo "#define QT_LARGEFILE_SUPPORT 64" >>"$outpath/src/corelib/global/qconfig.h.new"
5555 if [ "$CFG_FRAMEWORK" = "yes" ]; then
5556 echo "#define QT_MAC_FRAMEWORK_BUILD" >>"$outpath/src/corelib/global/qconfig.h.new"
5559 if [ "$BUILD_ON_MAC" = "yes" ]; then
5560 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
5561 #if defined(__LP64__)
5562 # define QT_POINTER_SIZE 8
5564 # define QT_POINTER_SIZE 4
5568 "$unixtests/ptrsize.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5569 echo "#define QT_POINTER_SIZE $?" >>"$outpath/src/corelib/global/qconfig.h.new"
5572 #REDUCE_RELOCATIONS is a elf/unix only thing, so not in windows configure.exe
5573 if [ "$CFG_REDUCE_RELOCATIONS" = "yes" ]; then
5574 echo "#define QT_REDUCE_RELOCATIONS" >>"$outpath/src/corelib/global/qconfig.h.new"
5578 echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
5580 if [ "$CFG_DEV" = "yes" ]; then
5581 echo "#define QT_BUILD_INTERNAL" >>"$outpath/src/corelib/global/qconfig.h.new"
5584 # Add QPA to config.h
5585 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_WS_QPA QT_NO_QWS_QPF QT_NO_QWS_QPF2"
5587 if [ "${CFG_USE_FLOATMATH}" = "yes" ]; then
5588 QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_USE_MATH_H_FLOATS"
5591 # Add turned on SQL drivers
5592 for DRIVER in $CFG_SQL_AVAILABLE; do
5593 eval "VAL=\$CFG_SQL_$DRIVER"
5596 ONDRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5597 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SQL_$ONDRIVER"
5598 SQL_DRIVERS="$SQL_DRIVERS $DRIVER"
5601 SQL_PLUGINS="$SQL_PLUGINS $DRIVER"
5607 QMakeVar set sql-drivers "$SQL_DRIVERS"
5608 QMakeVar set sql-plugins "$SQL_PLUGINS"
5610 # Add other configuration options to the qconfig.h file
5611 [ "$CFG_GIF" = "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_BUILTIN_GIF_READER=1"
5612 [ "$CFG_PNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_PNG"
5613 [ "$CFG_JPEG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_JPEG"
5614 [ "$CFG_ZLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB"
5615 [ "$CFG_SXE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE"
5616 [ "$CFG_DBUS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS"
5618 # X11/Unix/Mac only configs
5619 [ "$CFG_CUPS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CUPS"
5620 [ "$CFG_ICONV" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICONV"
5621 [ "$CFG_GLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLIB"
5622 [ "$CFG_GSTREAMER" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GSTREAMER"
5623 [ "$CFG_QGTKSTYLE" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_GTK"
5624 [ "$CFG_CLOCK_MONOTONIC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CLOCK_MONOTONIC"
5625 [ "$CFG_MREMAP" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MREMAP"
5626 [ "$CFG_GETADDRINFO" = "no" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETADDRINFO"
5627 [ "$CFG_IPV6IFNAME" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6IFNAME"
5628 [ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS"
5629 [ "$CFG_INOTIFY" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY"
5630 [ "$CFG_NIS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS"
5631 [ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL QT_NO_SSL"
5632 [ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL"
5634 [ "$CFG_SM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SESSIONMANAGER"
5635 [ "$CFG_XCURSOR" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XCURSOR"
5636 [ "$CFG_XFIXES" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XFIXES"
5637 [ "$CFG_FONTCONFIG" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FONTCONFIG"
5638 [ "$CFG_XINERAMA" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINERAMA"
5639 [ "$CFG_XKB" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XKB"
5640 [ "$CFG_XRANDR" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRANDR"
5641 [ "$CFG_XRENDER" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRENDER"
5642 [ "$CFG_MITSHM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MITSHM"
5643 [ "$CFG_XSHAPE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE"
5644 [ "$CFG_XVIDEO" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XVIDEO"
5645 [ "$CFG_XSYNC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC"
5646 [ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET"
5648 [ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR"
5649 [ "$CFG_XINERAMA" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINERAMA"
5650 [ "$CFG_XFIXES" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XFIXES"
5651 [ "$CFG_XRANDR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XRANDR"
5652 [ "$CFG_XINPUT" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINPUT"
5653 [ "$CFG_ALSA" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ALSA"
5654 [ "$CFG_PULSEAUDIO" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PULSEAUDIO"
5655 [ "$CFG_COREWLAN" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_COREWLAN"
5657 # sort QCONFIG_FLAGS for neatness if we can
5658 [ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq`
5659 QCONFIG_FLAGS=`echo $QCONFIG_FLAGS`
5661 if [ -n "$QCONFIG_FLAGS" ]; then
5662 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
5663 #ifndef QT_BOOTSTRAPPED
5666 for cfg in $QCONFIG_FLAGS; do
5667 cfgd=`echo $cfg | sed 's/=.*$//'` # trim pushed 'Foo=Bar' defines
5668 cfg=`echo $cfg | sed 's/=/ /'` # turn first '=' into a space
5669 # figure out define logic, so we can output the correct
5670 # ifdefs to override the global defines in a project
5672 if [ true ] && echo "$cfgd" | grep 'QT_NO_' >/dev/null 2>&1; then
5673 # QT_NO_option can be forcefully turned on by QT_option
5674 cfgdNeg=`echo $cfgd | sed "s,QT_NO_,QT_,"`
5675 elif [ true ] && echo "$cfgd" | grep 'QT_' >/dev/null 2>&1; then
5676 # QT_option can be forcefully turned off by QT_NO_option
5677 cfgdNeg=`echo $cfgd | sed "s,QT_,QT_NO_,"`
5680 if [ -z $cfgdNeg ]; then
5681 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
5688 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
5689 #if defined($cfgd) && defined($cfgdNeg)
5691 #elif !defined($cfgd) && !defined($cfgdNeg)
5698 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
5699 #endif // QT_BOOTSTRAPPED
5704 if [ "$CFG_REDUCE_EXPORTS" = "yes" ]; then
5705 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
5706 #define QT_VISIBILITY_AVAILABLE
5711 if [ -n "$QT_LIBINFIX" ]; then
5712 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
5713 #define QT_LIBINFIX "$QT_LIBINFIX"
5718 echo "#define QT_QPA_DEFAULT_PLATFORM_NAME \"$QT_QPA_DEFAULT_PLATFORM\"" >>"$outpath/src/corelib/global/qconfig.h.new"
5720 # avoid unecessary rebuilds by copying only if qconfig.h has changed
5721 if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
5722 rm -f "$outpath/src/corelib/global/qconfig.h.new"
5724 [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h"
5725 mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
5726 chmod -w "$outpath/src/corelib/global/qconfig.h"
5727 if [ ! -f "$outpath/include/QtCore/qconfig.h" ]; then
5728 ln -s "$outpath/src/corelib/global/qconfig.h" "$outpath/include/QtCore/qconfig.h"
5732 #-------------------------------------------------------------------------------
5733 # save configuration into qconfig.pri
5734 #-------------------------------------------------------------------------------
5735 QTCONFIG="$outpath/mkspecs/qconfig.pri"
5736 QTCONFIG_CONFIG="$QTCONFIG_CONFIG no_mocdepend"
5737 [ -f "$QTCONFIG.tmp" ] && rm -f "$QTCONFIG.tmp"
5738 if [ "$CFG_DEBUG" = "yes" ]; then
5739 QTCONFIG_CONFIG="$QTCONFIG_CONFIG debug"
5740 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
5741 QT_CONFIG="$QT_CONFIG release"
5743 QT_CONFIG="$QT_CONFIG debug"
5744 elif [ "$CFG_DEBUG" = "no" ]; then
5745 QTCONFIG_CONFIG="$QTCONFIG_CONFIG release"
5746 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
5747 QT_CONFIG="$QT_CONFIG debug"
5749 QT_CONFIG="$QT_CONFIG release"
5751 if [ "$CFG_FRAMEWORK" = "no" ]; then
5752 QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_no_framework"
5754 QT_CONFIG="$QT_CONFIG qt_framework"
5755 QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_framework"
5757 if [ "$CFG_DEV" = "yes" ]; then
5758 QT_CONFIG="$QT_CONFIG private_tests"
5761 cat >>"$QTCONFIG.tmp" <<EOF
5763 CONFIG += $QTCONFIG_CONFIG
5765 QT_HOST_ARCH = $CFG_HOST_ARCH
5766 QT_CPU_FEATURES = $CFG_CPUFEATURES
5767 QT_HOST_CPU_FEATURES = $CFG_HOST_CPUFEATURES
5768 QT_EDITION = $Edition
5769 QT_CONFIG += $QT_CONFIG
5772 QT_VERSION = $QT_VERSION
5773 QT_MAJOR_VERSION = $QT_MAJOR_VERSION
5774 QT_MINOR_VERSION = $QT_MINOR_VERSION
5775 QT_PATCH_VERSION = $QT_PATCH_VERSION
5778 QT_LIBINFIX = $QT_LIBINFIX
5779 QT_NAMESPACE = $QT_NAMESPACE
5783 if [ -n "$PKG_CONFIG_SYSROOT_DIR" ] || [ -n "$PKG_CONFIG_LIBDIR" ]; then
5784 echo "# pkgconfig" >> "$QTCONFIG.tmp"
5785 echo "PKG_CONFIG_SYSROOT_DIR = $PKG_CONFIG_SYSROOT_DIR" >> "$QTCONFIG.tmp"
5786 echo "PKG_CONFIG_LIBDIR = $PKG_CONFIG_LIBDIR" >> "$QTCONFIG.tmp"
5787 echo >> "$QTCONFIG.tmp"
5790 if [ -n "$CFG_SYSROOT" ]; then
5791 echo "# sysroot" >>"$QTCONFIG.tmp"
5792 echo `basename "$XQMAKESPEC"` \{ >>"$QTCONFIG.tmp"
5793 echo " QMAKE_CFLAGS += --sysroot=\$\$[QT_SYSROOT]" >>"$QTCONFIG.tmp"
5794 echo " QMAKE_CXXFLAGS += --sysroot=\$\$[QT_SYSROOT]" >>"$QTCONFIG.tmp"
5795 echo " QMAKE_LFLAGS += --sysroot=\$\$[QT_SYSROOT]" >>"$QTCONFIG.tmp"
5796 echo "}" >> "$QTCONFIG.tmp"
5797 echo >> "$QTCONFIG.tmp"
5799 if [ -n "$RPATH_FLAGS" ]; then
5800 echo "QMAKE_RPATHDIR += $RPATH_FLAGS" >> "$QTCONFIG.tmp"
5802 if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
5803 echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION" >> "$QTCONFIG.tmp"
5804 echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION" >> "$QTCONFIG.tmp"
5805 echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION" >> "$QTCONFIG.tmp"
5808 if [ -n "$QMAKE_INCDIR_OPENGL_ES2" ]; then
5809 echo "#Qt opengl include path" >> "$QTCONFIG.tmp"
5810 echo "QMAKE_INCDIR_OPENGL_ES2 = \"$QMAKE_INCDIR_OPENGL_ES2\"" >> "$QTCONFIG.tmp"
5813 # replace qconfig.pri if it differs from the newly created temp file
5814 if cmp -s "$QTCONFIG.tmp" "$QTCONFIG"; then
5815 rm -f "$QTCONFIG.tmp"
5817 mv -f "$QTCONFIG.tmp" "$QTCONFIG"
5820 #-------------------------------------------------------------------------------
5821 # save configuration into qmodule.pri
5822 #-------------------------------------------------------------------------------
5823 QTMODULE="$outpath/mkspecs/qmodule.pri"
5825 echo "CONFIG += $QMAKE_CONFIG create_prl link_prl" >> "$QTMODULE.tmp"
5827 # Ensure we can link to uninistalled libraries
5828 if [ "$BUILD_ON_MAC" != "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ] && linkerSupportsFlag -rpath-link "$outpath/lib"; then
5829 echo "QMAKE_LFLAGS = -Wl,-rpath-link,\$\$QT_BUILD_TREE/lib \$\$QMAKE_LFLAGS" >> "$QTMODULE.tmp"
5831 if [ -n "$QT_CFLAGS_PSQL" ]; then
5832 echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$QTMODULE.tmp"
5834 if [ -n "$QT_LFLAGS_PSQL" ]; then
5835 echo "QT_LFLAGS_PSQL = $QT_LFLAGS_PSQL" >> "$QTMODULE.tmp"
5837 if [ -n "$QT_CFLAGS_MYSQL" ]; then
5838 echo "QT_CFLAGS_MYSQL = $QT_CFLAGS_MYSQL" >> "$QTMODULE.tmp"
5840 if [ -n "$QT_LFLAGS_MYSQL" ]; then
5841 echo "QT_LFLAGS_MYSQL = $QT_LFLAGS_MYSQL" >> "$QTMODULE.tmp"
5843 if [ -n "$QT_CFLAGS_SQLITE" ]; then
5844 echo "QT_CFLAGS_SQLITE = $QT_CFLAGS_SQLITE" >> "$QTMODULE.tmp"
5846 if [ -n "$QT_LFLAGS_SQLITE" ]; then
5847 echo "QT_LFLAGS_SQLITE = $QT_LFLAGS_SQLITE" >> "$QTMODULE.tmp"
5849 if [ -n "$QT_LFLAGS_ODBC" ]; then
5850 echo "QT_LFLAGS_ODBC = $QT_LFLAGS_ODBC" >> "$QTMODULE.tmp"
5852 if [ -n "$QT_LFLAGS_TDS" ]; then
5853 echo "QT_LFLAGS_TDS = $QT_LFLAGS_TDS" >> "$QTMODULE.tmp"
5856 if [ "$QT_EDITION" != "QT_EDITION_OPENSOURCE" ]; then
5857 echo "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" >> "$QTMODULE.tmp"
5860 #dump in the OPENSSL_LIBS info
5861 if [ '!' -z "$OPENSSL_LIBS" ]; then
5862 echo "OPENSSL_LIBS = $OPENSSL_LIBS" >> "$QTMODULE.tmp"
5863 elif [ "$CFG_OPENSSL" = "linked" ]; then
5864 echo "OPENSSL_LIBS = -lssl -lcrypto" >> "$QTMODULE.tmp"
5867 #dump in the SDK info
5868 if [ '!' -z "$CFG_SDK" ]; then
5869 echo "QMAKE_MAC_SDK = $CFG_SDK" >> "$QTMODULE.tmp"
5873 cat "$QMAKE_VARS_FILE" >> "$QTMODULE.tmp"
5874 rm -f "$QMAKE_VARS_FILE" 2>/dev/null
5876 # replace qmodule.pri if it differs from the newly created temp file
5877 if cmp -s "$QTMODULE.tmp" "$QTMODULE"; then
5878 rm -f "$QTMODULE.tmp"
5880 mv -f "$QTMODULE.tmp" "$QTMODULE"
5883 #-------------------------------------------------------------------------------
5884 # save configuration into .qmake.cache
5885 #-------------------------------------------------------------------------------
5887 CACHEFILE="$outpath/.qmake.cache"
5888 [ -f "$CACHEFILE.tmp" ] && rm -f "$CACHEFILE.tmp"
5889 cat >>"$CACHEFILE.tmp" <<EOF
5891 QT_SOURCE_TREE = \$\$quote($relpath)
5892 QT_BUILD_TREE = \$\$quote($outpath)
5893 QT_BUILD_PARTS = $CFG_BUILD_PARTS
5895 #local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR
5896 QMAKE_INCDIR_QT = \$\$QT_BUILD_TREE/include
5897 QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib
5899 include(\$\$PWD/mkspecs/qmodule.pri)
5900 CONFIG += dylib depend_includepath fix_output_dirs no_private_qt_headers_warning QTDIR_build
5904 #dump the qmake spec
5905 if [ -d "$outpath/mkspecs/$XPLATFORM" ]; then
5906 echo "XQMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$XPLATFORM" >> "$CACHEFILE.tmp"
5908 echo "XQMAKESPEC = $XPLATFORM" >> "$CACHEFILE.tmp"
5910 if [ -d "$outpath/mkspecs/$PLATFORM" ]; then
5911 echo "QMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$PLATFORM" >> "$CACHEFILE.tmp"
5913 echo "QMAKESPEC = $PLATFORM" >> "$CACHEFILE.tmp"
5916 # replace .qmake.cache if it differs from the newly created temp file
5917 if cmp -s "$CACHEFILE.tmp" "$CACHEFILE"; then
5918 rm -f "$CACHEFILE.tmp"
5920 mv -f "$CACHEFILE.tmp" "$CACHEFILE"
5923 #-------------------------------------------------------------------------------
5924 # give feedback on configuration
5925 #-------------------------------------------------------------------------------
5926 exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary
5929 if [ "$XPLATFORM" = "$PLATFORM" ]; then
5930 echo "Build type: $PLATFORM"
5932 echo "Building on: $PLATFORM"
5933 echo "Building for: $XPLATFORM"
5936 # the missing space before $CFG_FEATURES is intentional
5937 echo "Architecture: $CFG_ARCH, features:$CFG_CPUFEATURES"
5938 echo "Host architecture: $CFG_HOST_ARCH, features:$CFG_HOST_CPUFEATURES"
5940 if [ -n "$PLATFORM_NOTES" ]; then
5941 echo "Platform notes:"
5942 echo "$PLATFORM_NOTES"
5947 if [ "$OPT_VERBOSE" = "yes" ]; then
5948 echo $ECHO_N "qmake vars .......... $ECHO_C"
5949 cat "$QMAKE_VARS_FILE" | tr '\n' ' '
5950 echo "qmake switches ......... $QMAKE_SWITCHES"
5953 echo "Build .................. $CFG_BUILD_PARTS"
5954 echo "Configuration .......... $QMAKE_CONFIG $QT_CONFIG"
5955 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
5956 echo "Debug .................. yes (combined)"
5957 if [ "$CFG_DEBUG" = "yes" ]; then
5958 echo "Default Link ........... debug"
5960 echo "Default Link ........... release"
5963 echo "Debug .................. $CFG_DEBUG"
5965 echo "C++11 support .......... $CFG_CXX11"
5966 if [ -n "$PKG_CONFIG" ]; then
5967 echo "pkg-config ............. yes"
5969 echo "pkg-config ............. no"
5971 [ "$CFG_DBUS" = "no" ] && echo "QtDBus module .......... no"
5972 [ "$CFG_DBUS" = "yes" ] && echo "QtDBus module .......... yes (run-time)"
5973 [ "$CFG_DBUS" = "linked" ] && echo "QtDBus module .......... yes (linked)"
5974 echo "QtConcurrent code ...... $CFG_CONCURRENT"
5975 echo "QtGui module ........... $CFG_GUI"
5976 echo "QtWidgets module ....... $CFG_WIDGETS"
5977 if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
5978 echo "JavaScriptCore JIT ..... To be decided by JavaScriptCore"
5980 echo "JavaScriptCore JIT ..... $CFG_JAVASCRIPTCORE_JIT"
5982 echo "QML debugging .......... $CFG_QML_DEBUG"
5983 echo "PCH support ............ $CFG_PRECOMPILE"
5984 if [ "$CFG_ARCH" = "i386" -o "$CFG_ARCH" = "x86_64" ]; then
5985 echo "SSE2/SSE3/SSSE3......... ${CFG_SSE2}/${CFG_SSE3}/${CFG_SSSE3}"
5986 echo "SSE4.1/SSE4.2........... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}"
5987 echo "AVX/AVX2................ ${CFG_AVX}/${CFG_AVX2}"
5988 elif [ "$CFG_ARCH" = "arm" ]; then
5989 echo "iWMMXt support ......... ${CFG_IWMMXT}"
5990 echo "NEON support ........... ${CFG_NEON}"
5992 if [ "$CFG_ARCH" = "mips" ]; then
5993 echo "MIPS_DSP/MIPS_DSPR2..... ${CFG_MIPS_DSP}/${CFG_MIPS_DSPR2}"
5995 echo "IPv6 ifname support .... $CFG_IPV6IFNAME"
5996 echo "getaddrinfo support .... $CFG_GETADDRINFO"
5997 echo "getifaddrs support ..... $CFG_GETIFADDRS"
5998 echo "Accessibility .......... $CFG_ACCESSIBILITY"
5999 echo "NIS support ............ $CFG_NIS"
6000 echo "CUPS support ........... $CFG_CUPS"
6001 echo "Iconv support .......... $CFG_ICONV"
6002 echo "Glib support ........... $CFG_GLIB"
6003 echo "GStreamer support ...... $CFG_GSTREAMER"
6004 echo "PulseAudio support ..... $CFG_PULSEAUDIO"
6005 echo "Large File support ..... $CFG_LARGEFILE"
6006 echo "GIF support ............ $CFG_GIF"
6007 if [ "$CFG_JPEG" = "no" ]; then
6008 echo "JPEG support ........... $CFG_JPEG"
6010 echo "JPEG support ........... $CFG_JPEG ($CFG_LIBJPEG)"
6012 if [ "$CFG_PNG" = "no" ]; then
6013 echo "PNG support ............ $CFG_PNG"
6015 echo "PNG support ............ $CFG_PNG ($CFG_LIBPNG)"
6017 echo "zlib support ........... $CFG_ZLIB"
6018 echo "Session management ..... $CFG_SM"
6019 echo "libudev support ........ $CFG_LIBUDEV"
6021 if [ "$CFG_OPENGL" = "desktop" ]; then
6022 echo "OpenGL support ......... yes (Desktop OpenGL)"
6023 elif [ "$CFG_OPENGL" = "es2" ]; then
6024 echo "OpenGL support ......... yes (OpenGL ES 2.x)"
6026 echo "OpenGL support ......... no"
6029 if [ "$CFG_OPENVG" ]; then
6030 if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
6031 echo "OpenVG support ......... ShivaVG"
6033 echo "OpenVG support ......... $CFG_OPENVG"
6037 echo "XShape support ......... $CFG_XSHAPE"
6038 echo "XVideo support ......... $CFG_XVIDEO"
6039 echo "XSync support .......... $CFG_XSYNC"
6040 echo "Xinerama support ....... $CFG_XINERAMA"
6041 echo "Xcursor support ........ $CFG_XCURSOR"
6042 echo "Xfixes support ......... $CFG_XFIXES"
6043 echo "Xrandr support ......... $CFG_XRANDR"
6044 echo "Xi support ............. $CFG_XINPUT"
6045 echo "MIT-SHM support ........ $CFG_MITSHM"
6046 echo "FontConfig support ..... $CFG_FONTCONFIG"
6047 echo "XKB Support ............ $CFG_XKB"
6048 echo "immodule support ....... $CFG_IM"
6049 echo "GTK theme support ...... $CFG_QGTKSTYLE"
6051 [ "$CFG_SQL_mysql" != "no" ] && echo "MySQL support .......... $CFG_SQL_mysql"
6052 [ "$CFG_SQL_psql" != "no" ] && echo "PostgreSQL support ..... $CFG_SQL_psql"
6053 [ "$CFG_SQL_odbc" != "no" ] && echo "ODBC support ........... $CFG_SQL_odbc"
6054 [ "$CFG_SQL_oci" != "no" ] && echo "OCI support ............ $CFG_SQL_oci"
6055 [ "$CFG_SQL_tds" != "no" ] && echo "TDS support ............ $CFG_SQL_tds"
6056 [ "$CFG_SQL_db2" != "no" ] && echo "DB2 support ............ $CFG_SQL_db2"
6057 [ "$CFG_SQL_ibase" != "no" ] && echo "InterBase support ...... $CFG_SQL_ibase"
6058 [ "$CFG_SQL_sqlite2" != "no" ] && echo "SQLite 2 support ....... $CFG_SQL_sqlite2"
6059 [ "$CFG_SQL_sqlite" != "no" ] && echo "SQLite support ......... $CFG_SQL_sqlite ($CFG_SQLITE)"
6062 if [ "$CFG_OPENSSL" = "yes" ]; then
6063 OPENSSL_LINKAGE="(run-time)"
6064 elif [ "$CFG_OPENSSL" = "linked" ]; then
6065 OPENSSL_LINKAGE="(linked)"
6067 echo "OpenSSL support ........ $CFG_OPENSSL $OPENSSL_LINKAGE"
6068 echo "Alsa support ........... $CFG_ALSA"
6069 if [ "$BUILD_ON_MAC" = "yes" ]; then
6070 echo "CoreWlan support ....... $CFG_COREWLAN"
6072 echo "libICU support ......... $CFG_ICU"
6073 echo "PCRE support ........... $CFG_PCRE"
6074 if [ "$CFG_XCB_LIMITED" = "yes" ] && [ "$CFG_XCB" = "yes" ]; then
6075 echo "Xcb support ............ limited (old version)"
6077 echo "Xcb support ............ $CFG_XCB"
6079 echo "Xrender support ........ $CFG_XRENDER"
6080 if [ "$XPLATFORM_MAEMO" = "yes" ] && [ "$CFG_XCB" = "yes" ]; then
6081 echo "XInput2 support ........ $CFG_XINPUT2"
6083 echo "EGLFS support .......... $CFG_EGLFS"
6084 echo "DirectFB support ....... $CFG_DIRECTFB"
6087 # complain about not being able to use dynamic plugins if we are using a static build
6088 if [ "$CFG_SHARED" = "no" ]; then
6090 echo "WARNING: Using static linking will disable the use of dynamically"
6091 echo "loaded plugins. Make sure to import all needed static plugins,"
6092 echo "or compile needed modules into the library."
6095 if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
6097 echo "NOTE: When linking against OpenSSL, you can override the default"
6098 echo "library names through OPENSSL_LIBS."
6100 echo " OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
6104 exec 1>&3 3>&- # restore stdout
6105 cat $outpath/config.summary # display config feedback to user
6107 if [ "$BUILD_ON_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "no" ]; then
6109 echo "Error: debug-only framework builds are not supported. Configure with -no-framework"
6110 echo "if you want a pure debug build."
6115 sepath=`echo "$relpath" | sed -e 's/\\./\\\\./g'`
6120 #-------------------------------------------------------------------------------
6121 # build makefiles based on the configuration
6122 #-------------------------------------------------------------------------------
6124 if [ "$CFG_NOPROCESS" != "yes" ]; then
6125 echo "Creating makefiles. Please wait..."
6126 "$outpath/bin/qmake" -r ${OPT_FAST+CONFIG+=fast} "$relpath"
6129 if [ "$OPT_FAST" = "yes" ]; then
6131 for part in $CFG_BUILD_PARTS; do
6133 examples|tests) PART_ROOTS="$PART_ROOTS $part" ;;
6136 if [ "x$PART_ROOTS" != "x" ]; then
6138 echo "Creating stub makefiles. Please wait..."
6139 QMAKE="$outpath/bin/qmake"
6140 [ "$CFG_DEBUG_RELEASE" = "no" ] && first_tgt="first_target: first" || first_tgt=
6141 (cd "$relpath" && find $PART_ROOTS -name '*.pro') | grep -v /testdata/ | while read p; do
6143 test -f "$outpath/$d/Makefile" && continue
6144 echo " for $relpath/$p"
6146 mkdir -p "$outpath/$d" || exit
6147 cat > "$outpath/$d/Makefile" <<EOF || exit
6148 # $outpath/$d/Makefile: generated by configure
6150 # WARNING: This makefile will be replaced with a real makefile.
6151 # All changes made to this file will be lost.
6156 all clean install qmake first Makefile: FORCE
6157 \$(QMAKE) $QMAKE_SWITCHES "$relpath/$p"
6167 #-------------------------------------------------------------------------------
6168 # check for platforms that we don't yet know about
6169 #-------------------------------------------------------------------------------
6170 if [ "$CFG_ARCH" = "unknown" ]; then
6173 NOTICE: configure was unable to determine the architecture
6174 for the $XQMAKESPEC target.
6176 Qt will not use a specialized implementation for any atomic
6177 operations. Instead a generic implemention based on either GCC
6178 intrinsics or C++11 std::atomic<T> will be used (when
6179 available). The generic implementations are generally as fast
6180 as and always as safe as a specialized implementation.
6182 If no generic implementation is available, Qt will use a
6183 fallback UNIX implementation which uses a single
6184 pthread_mutex_t to protect all atomic operations. This
6185 implementation is the slow (but safe) fallback implementation
6186 for architectures Qt does not yet support.
6190 #-------------------------------------------------------------------------------
6191 # check if the user passed the -no-zlib option, which is no longer supported
6192 #-------------------------------------------------------------------------------
6193 if [ -n "$ZLIB_FORCED" ]; then
6194 which_zlib="supplied"
6195 if [ "$CFG_ZLIB" = "system" ]; then
6201 NOTICE: The -no-zlib option was supplied but is no longer
6204 Qt now requires zlib support in all builds, so the -no-zlib
6205 option was ignored. Qt will be built using the $which_zlib
6210 #-------------------------------------------------------------------------------
6211 # check if the user passed the obsoleted -wayland or -no-wayland flag
6212 #-------------------------------------------------------------------------------
6213 if [ "$CFG_OBSOLETE_WAYLAND" = "yes" ]; then
6216 NOTICE: The -wayland and -no-wayland flags are now obsolete
6218 All configuring of QtWayland plugin and QtCompositor happens in the module
6222 #-------------------------------------------------------------------------------
6223 # check if the user passed the obsoleted -arch or -host-arch options
6224 #-------------------------------------------------------------------------------
6225 if [ "$OPT_OBSOLETE_HOST_ARG" = "yes" ]; then
6228 NOTICE: The -arch and -host-arch options are obsolete.
6230 Qt now detects the target and host architectures based on compiler
6231 output. Qt will be built using $CFG_ARCH for the target architecture
6232 and $CFG_HOST_ARCH for the host architecture (note that these two
6233 will be the same unless you are cross-compiling).
6237 #-------------------------------------------------------------------------------
6238 # finally save the executed command to another script
6239 #-------------------------------------------------------------------------------
6240 if [ `basename $0` != "config.status" ]; then
6241 CONFIG_STATUS="$relpath/$relconf $OPT_CMDLINE"
6243 # add the system variables
6244 for varname in $SYSTEM_VARIABLES; do
6246 'if [ -n "\$'${varname}'" ]; then
6247 CONFIG_STATUS="'${varname}'='"'\\\$${varname}'"' \$CONFIG_STATUS"
6252 echo "$CONFIG_STATUS" | grep '\-confirm\-license' >/dev/null 2>&1 || CONFIG_STATUS="$CONFIG_STATUS -confirm-license"
6254 [ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
6255 echo "#!/bin/sh" > "$outpath/config.status"
6256 [ -n "$PKG_CONFIG_SYSROOT_DIR" ] && \
6257 echo "export PKG_CONFIG_SYSROOT_DIR=$PKG_CONFIG_SYSROOT_DIR" >> "$outpath/config.status"
6258 [ -n "$PKG_CONFIG_LIBDIR" ] && \
6259 echo "export PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR" >> "$outpath/config.status"
6260 echo "if [ \"\$#\" -gt 0 ]; then" >> "$outpath/config.status"
6261 echo " $CONFIG_STATUS \"\$@\"" >> "$outpath/config.status"
6262 echo "else" >> "$outpath/config.status"
6263 echo " $CONFIG_STATUS" >> "$outpath/config.status"
6264 echo "fi" >> "$outpath/config.status"
6265 chmod +x "$outpath/config.status"
6268 if [ -n "$RPATH_MESSAGE" ]; then
6270 echo "$RPATH_MESSAGE"
6273 MAKE=`basename "$MAKE"`
6275 echo Qt is now configured for building. Just run \'$MAKE\'.
6276 if [ "$relpath" = "$QT_INSTALL_PREFIX" ]; then
6277 echo Once everything is built, Qt is installed.
6278 echo You should not run \'$MAKE install\'.
6280 echo Once everything is built, you must run \'$MAKE install\'.
6281 echo Qt will be installed into $QT_INSTALL_PREFIX
6284 echo To reconfigure, run \'$MAKE confclean\' and \'configure\'.