Exclude the autotools subdirectory when importing from WebKit trunk.
[qt-netbsd.git] / configure
blobf0b7f90e35b5e7d2c6cdf0d3151b21b6c1b759b9
1 #!/bin/sh
3 # Configures to build the Qt library
5 # Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
6 # Contact: Qt Software Information (qt-info@nokia.com)
8 # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
9 # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12 #-------------------------------------------------------------------------------
13 # script initialization
14 #-------------------------------------------------------------------------------
16 # the name of this script
17 relconf=`basename $0`
18 # the directory of this script is the "source tree"
19 relpath=`dirname $0`
20 relpath=`(cd "$relpath"; /bin/pwd)`
21 # the current directory is the "build tree" or "object tree"
22 outpath=`/bin/pwd`
24 #license file location
25 LICENSE_FILE="$QT_LICENSE_FILE"
26 [ -z "$LICENSE_FILE" ] && LICENSE_FILE="$HOME/.qt-license"
27 if [ -f "$LICENSE_FILE" ]; then
28 tr -d '\r' <"$LICENSE_FILE" >"${LICENSE_FILE}.tmp"
29 diff "${LICENSE_FILE}.tmp" "${LICENSE_FILE}" >/dev/null 2>&1 || LICENSE_FILE="${LICENSE_FILE}.tmp"
32 # later cache the command line in config.status
33 OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"`
35 # initialize global variables
36 QMAKE_SWITCHES=
37 QMAKE_VARS=
38 QMAKE_CONFIG=
39 QTCONFIG_CONFIG=
40 QT_CONFIG=
41 SUPPORTED=
42 QMAKE_VARS_FILE=.qmake.vars
44 :> "$QMAKE_VARS_FILE"
46 #-------------------------------------------------------------------------------
47 # utility functions
48 #-------------------------------------------------------------------------------
50 # Adds a new qmake variable to the cache
51 # Usage: QMakeVar mode varname contents
52 # where mode is one of: set, add, del
53 QMakeVar()
55 case "$1" in
56 set)
57 eq="="
59 add)
60 eq="+="
62 del)
63 eq="-="
66 echo >&2 "BUG: wrong command to QMakeVar: $1"
68 esac
70 echo "$2" "$eq" "$3" >> "$QMAKE_VARS_FILE"
73 # relies on $QMAKESPEC being set correctly. parses include statements in
74 # qmake.conf and prints out the expanded file
75 getQMakeConf()
77 tmpSPEC="$QMAKESPEC"
78 if [ -n "$1" ]; then
79 tmpSPEC="$1"
81 $AWK -v "QMAKESPEC=$tmpSPEC" '
82 /^include\(.+\)$/{
83 fname = QMAKESPEC "/" substr($0, 9, length($0) - 9)
84 while ((getline line < fname) > 0)
85 print line
86 close(fname)
87 next
89 { print }' "$tmpSPEC/qmake.conf"
92 #-------------------------------------------------------------------------------
93 # operating system detection
94 #-------------------------------------------------------------------------------
96 # need that throughout the script
97 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
98 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
99 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
100 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
103 #-------------------------------------------------------------------------------
104 # window system detection
105 #-------------------------------------------------------------------------------
107 PLATFORM_X11=no
108 PLATFORM_MAC=no
109 PLATFORM_QWS=no
111 if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ] && [ -d /System/Library/Frameworks/Carbon.framework ]; then
112 # Qt/Mac
113 # ~ the Carbon SDK exists
114 # ~ src/gui/base/qapplication_mac.cpp is present
115 # ~ this is the internal edition and Qt/Mac sources exist
116 PLATFORM_MAC=maybe
117 elif [ -f "$relpath"/src/gui/kernel/qapplication_qws.cpp ]; then
118 # Qt Embedded
119 # ~ src/gui/base/qapplication_qws.cpp is present
120 # ~ this is the free or commercial edition
121 # ~ this is the internal edition and Qt Embedded is explicitly enabled
122 PLATFORM_QWS=maybe
125 #-----------------------------------------------------------------------------
126 # Qt version detection
127 #-----------------------------------------------------------------------------
128 QT_VERSION=`grep '^# *define *QT_VERSION_STR' "$relpath"/src/corelib/global/qglobal.h`
129 QT_MAJOR_VERSION=
130 QT_MINOR_VERSION=0
131 QT_PATCH_VERSION=0
132 if [ -n "$QT_VERSION" ]; then
133 QT_VERSION=`echo $QT_VERSION | sed 's,^# *define *QT_VERSION_STR *"*\([^ ]*\)"$,\1,'`
134 MAJOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
135 if [ -n "$MAJOR" ]; then
136 MINOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
137 PATCH=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
138 QT_MAJOR_VERSION="$MAJOR"
139 [ -z "$MINOR" ] || QT_MINOR_VERSION="$MINOR"
140 [ -z "$PATCH" ] || QT_PATCH_VERSION="$PATCH"
143 if [ -z "$QT_MAJOR_VERSION" ]; then
144 echo "Cannot process version from qglobal.h: $QT_VERSION"
145 echo "Cannot proceed."
146 exit 1
149 QT_PACKAGEDATE=`grep '^# *define *QT_PACKAGEDATE_STR' "$relpath"/src/corelib/global/qglobal.h | sed -e 's,^# *define *QT_PACKAGEDATE_STR *"\([^ ]*\)"$,\1,' -e s,-,,g`
150 if [ -z "$QT_PACKAGEDATE" ]; then
151 echo "Unable to determine package date from qglobal.h: '$QT_PACKAGEDATE'"
152 echo "Cannot proceed"
153 exit 1
156 #-------------------------------------------------------------------------------
157 # check the license
158 #-------------------------------------------------------------------------------
159 COMMERCIAL_USER=ask
160 CFG_DEV=no
161 CFG_NOKIA=no
162 CFG_EMBEDDED=no
163 EditionString=Commercial
165 earlyArgParse()
167 # parse the arguments, setting things to "yes" or "no"
168 while [ "$#" -gt 0 ]; do
169 CURRENT_OPT="$1"
170 UNKNOWN_ARG=no
171 case "$1" in
172 #Autoconf style options
173 --enable-*)
174 VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
175 VAL=yes
177 --disable-*)
178 VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
179 VAL=no
181 --*=*)
182 VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
183 VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
185 --no-*)
186 VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
187 VAL=no
189 -embedded)
190 VAR=embedded
191 # this option may or may not be followed by an argument
192 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
193 VAL=auto
194 else
195 shift;
196 VAL=$1
199 h|help|--help|-help)
200 if [ "$VAL" = "yes" ]; then
201 OPT_HELP="$VAL"
202 COMMERCIAL_USER="yes" #doesn't matter we will display the help
203 else
204 UNKNOWN_OPT=yes
205 COMMERCIAL_USER="yes" #doesn't matter we will display the help
208 --*)
209 VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
210 VAL=yes
213 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
214 VAL="unknown"
217 UNKNOWN_ARG=yes
219 esac
220 if [ "$UNKNOWN_ARG" = "yes" ]; then
221 shift
222 continue
224 shift
226 UNKNOWN_OPT=no
227 case "$VAR" in
228 embedded)
229 CFG_EMBEDDED="$VAL"
230 if [ "$PLATFORM_QWS" != "no" ]; then
231 if [ "$PLATFORM_QWS" = "maybe" ]; then
232 PLATFORM_X11=no
233 PLATFORM_MAC=no
234 PLATFORM_QWS=yes
236 else
237 echo "No license exists to enable Qt for Embedded Linux. Disabling."
238 CFG_EMBEDDED=no
241 developer-build)
242 CFG_DEV="yes"
244 nokia-developer)
245 CFG_DEV="yes"
246 CFG_NOKIA="yes"
247 COMMERCIAL_USER="no"
249 commercial)
250 COMMERCIAL_USER="yes"
252 opensource)
253 COMMERCIAL_USER="no"
256 UNKNOWN_OPT=yes
258 esac
259 done
262 earlyArgParse "$@"
264 if [ "$COMMERCIAL_USER" = "ask" ]; then
265 while true; do
266 echo "Which edition of Qt do you want to use ?"
267 echo
268 echo "Type 'c' if you want to use the Commercial Edition."
269 echo "Type 'o' if you want to use the Open Source Edition."
270 echo
271 read commercial
272 echo
273 if [ "$commercial" = "c" ]; then
274 COMMERCIAL_USER="yes"
275 break
276 else [ "$commercial" = "o" ];
277 COMMERCIAL_USER="no"
278 break
280 done
283 if [ "$CFG_NOKIA" = "yes" ]; then
284 Licensee="Nokia"
285 Edition="NokiaInternalBuild"
286 EditionString="Nokia Internal Build"
287 QT_EDITION="QT_EDITION_OPENSOURCE"
288 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
289 elif [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then
290 # Commercial preview release
291 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
292 Licensee="Preview"
293 Edition="Preview"
294 QT_EDITION="QT_EDITION_DESKTOP"
295 LicenseType="Technology Preview"
296 elif [ $COMMERCIAL_USER = "yes" ]; then
297 # one of commercial editions
298 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
299 [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=yes
301 # read in the license file
302 if [ -f "$LICENSE_FILE" ]; then
303 . "$LICENSE_FILE" >/dev/null 2>&1
304 if [ -z "$LicenseKeyExt" ]; then
305 echo
306 echo "You are using an old license file."
307 echo
308 echo "Please install the license file supplied by Qt Software,"
309 echo "or install the Qt Open Source Edition if you intend to"
310 echo "develop free software."
311 exit 1
313 if [ -z "$Licensee" ]; then
314 echo
315 echo "Invalid license key. Please check the license key."
316 exit 1
318 else
319 if [ -z "$LicenseKeyExt" ]; then
320 echo
321 if echo '\c' | grep '\c' >/dev/null; then
322 echo -n "Please enter your license key: "
323 else
324 echo "Please enter your license key: \c"
326 read LicenseKeyExt
327 Licensee="Unknown user"
331 # Key verification
332 echo "$LicenseKeyExt" | grep ".....*-....*-....*-....*-.....*-.....*-...." >/dev/null 2>&1 \
333 && LicenseValid="yes" \
334 || LicenseValid="no"
335 if [ "$LicenseValid" != "yes" ]; then
336 echo
337 echo "Invalid license key. Please check the license key."
338 exit 1
340 ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1`
341 PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d - | cut -b 1`
342 LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -`
343 LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1`
345 # determine which edition we are licensed to use
346 case "$LicenseTypeCode" in
347 F4M)
348 LicenseType="Commercial"
349 case $ProductCode in
351 Edition="Universal"
352 QT_EDITION="QT_EDITION_UNIVERSAL"
355 Edition="FullFramework"
356 EditionString="Full Framework"
357 QT_EDITION="QT_EDITION_DESKTOP"
360 Edition="GUIFramework"
361 EditionString="GUI Framework"
362 QT_EDITION="QT_EDITION_DESKTOPLIGHT"
364 esac
366 Z4M|R4M|Q4M)
367 LicenseType="Evaluation"
368 case $ProductCode in
370 Edition="Evaluation"
371 QT_EDITION="QT_EDITION_EVALUATION"
373 esac
375 esac
376 if [ -z "$LicenseType" -o -z "$Edition" -o -z "$QT_EDITION" ]; then
377 echo
378 echo "Invalid license key. Please check the license key."
379 exit 1
382 # verify that we are licensed to use Qt on this platform
383 LICENSE_EXTENSION=
384 if [ "$PlatformCode" = "X" ]; then
385 # Qt All-OS
386 LICENSE_EXTENSION="-ALLOS"
387 elif [ "$PLATFORM_QWS" = "yes" ]; then
388 case $PlatformCode in
389 2|4|8|A|B|E|G|J|K|P|Q|S|U|V|W)
390 # Qt for Embedded Linux
391 LICENSE_EXTENSION="-EMBEDDED"
394 echo
395 echo "You are not licensed for Qt for Embedded Linux."
396 echo
397 echo "Please contact sales@trolltech.com to upgrade your license"
398 echo "to include Qt for Embedded Linux, or install the"
399 echo "Qt Open Source Edition if you intend to develop free software."
400 exit 1
402 esac
403 elif [ "$PLATFORM_MAC" = "yes" ]; then
404 case $PlatformCode in
405 2|4|5|7|9|B|C|E|F|G|L|M|U|W|Y)
406 # Qt/Mac
407 LICENSE_EXTENSION="-DESKTOP"
409 3|6|8|A|D|H|J|K|P|Q|S|V)
410 # Embedded no-deploy
411 LICENSE_EXTENSION="-EMBEDDED"
414 echo
415 echo "You are not licensed for the Qt/Mac platform."
416 echo
417 echo "Please contact sales@trolltech.com to upgrade your license"
418 echo "to include the Qt/Mac platform."
419 exit 1
421 esac
422 else
423 case $PlatformCode in
424 2|3|4|5|7|D|E|F|J|M|Q|S|T|V|Z)
425 # Qt/X11
426 LICENSE_EXTENSION="-DESKTOP"
428 6|8|9|A|B|C|G|H|K|P|U|W)
429 # Embedded no-deploy
430 LICENSE_EXTENSION="-EMBEDDED"
433 echo
434 echo "You are not licensed for the Qt/X11 platform."
435 echo
436 echo "Please contact sales@trolltech.com to upgrade your license to"
437 echo "include the Qt/X11 platform, or install the Qt Open Source Edition"
438 echo "if you intend to develop free software."
439 exit 1
441 esac
444 if test -r "$relpath/.LICENSE"; then
445 # Generic, non-final license
446 LICENSE_EXTENSION=""
447 line=`sed 'y/a-z/A-Z/;q' "$relpath"/.LICENSE`
448 case "$line" in
449 *BETA*)
450 Edition=Beta
452 *TECHNOLOGY?PREVIEW*)
453 Edition=Preview
455 *EVALUATION*)
456 Edition=Evaluation
459 echo >&2 "Invalid license files; cannot continue"
460 exit 1
462 esac
463 Licensee="$Edition"
464 EditionString="$Edition"
465 QT_EDITION="QT_EDITION_DESKTOP"
468 case "$LicenseFeatureCode" in
469 G|L)
470 # US
471 case "$LicenseType" in
472 Commercial)
473 cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-US" "$outpath/LICENSE"
475 Evaluation)
476 cp -f "$relpath/.LICENSE-EVALUATION-US" "$outpath/LICENSE"
478 esac
480 2|5)
481 # non-US
482 case "$LicenseType" in
483 Commercial)
484 cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}" "$outpath/LICENSE"
486 Evaluation)
487 cp -f "$relpath/.LICENSE-EVALUATION" "$outpath/LICENSE"
489 esac
492 echo
493 echo "Invalid license key. Please check the license key."
494 exit 1
496 esac
497 if [ '!' -f "$outpath/LICENSE" ]; then
498 echo "The LICENSE, LICENSE.GPL3 LICENSE.LGPL file shipped with"
499 echo "this software has disappeared."
500 echo
501 echo "Sorry, you are not licensed to use this software."
502 echo "Try re-installing."
503 echo
504 exit 1
506 elif [ $COMMERCIAL_USER = "no" ]; then
507 # Open Source edition - may only be used under the terms of the GPL or LGPL.
508 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
509 Licensee="Open Source"
510 Edition="OpenSource"
511 EditionString="Open Source"
512 QT_EDITION="QT_EDITION_OPENSOURCE"
515 #-------------------------------------------------------------------------------
516 # initalize variables
517 #-------------------------------------------------------------------------------
519 SYSTEM_VARIABLES="CC CXX CFLAGS CXXFLAGS LDFLAGS"
520 for varname in $SYSTEM_VARIABLES; do
521 qmakevarname="${varname}"
522 # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
523 if [ "${varname}" = "LDFLAGS" ]; then
524 qmakevarname="LFLAGS"
526 cmd=`echo \
527 'if [ -n "\$'${varname}'" ]; then
528 QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}'"
529 fi'`
530 eval "$cmd"
531 done
532 # Use CC/CXX to run config.tests
533 mkdir -p "$outpath/config.tests"
534 rm -f "$outpath/config.tests/.qmake.cache"
535 cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
537 QMakeVar add styles "cde mac motif plastique cleanlooks windows"
538 QMakeVar add decorations "default windows styled"
539 QMakeVar add gfx-drivers "linuxfb"
540 QMakeVar add kbd-drivers "tty"
541 QMakeVar add mouse-drivers "pc linuxtp"
543 if [ "$CFG_DEV" = "yes" ]; then
544 QMakeVar add kbd-drivers "um"
547 # QTDIR may be set and point to an old or system-wide Qt installation
548 unset QTDIR
550 # the minimum version of libdbus-1 that we require:
551 MIN_DBUS_1_VERSION=0.62
553 # initalize internal variables
554 CFG_CONFIGURE_EXIT_ON_ERROR=yes
555 CFG_PROFILE=no
556 CFG_EXCEPTIONS=unspecified
557 CFG_SCRIPTTOOLS=auto # (yes|no|auto)
558 CFG_XMLPATTERNS=auto # (yes|no|auto)
559 CFG_INCREMENTAL=auto
560 CFG_QCONFIG=full
561 CFG_DEBUG=auto
562 CFG_MYSQL_CONFIG=
563 CFG_DEBUG_RELEASE=no
564 CFG_SHARED=yes
565 CFG_SM=auto
566 CFG_XSHAPE=auto
567 CFG_XINERAMA=runtime
568 CFG_XFIXES=runtime
569 CFG_ZLIB=auto
570 CFG_SQLITE=qt
571 CFG_GIF=auto
572 CFG_TIFF=auto
573 CFG_LIBTIFF=auto
574 CFG_PNG=yes
575 CFG_LIBPNG=auto
576 CFG_JPEG=auto
577 CFG_LIBJPEG=auto
578 CFG_MNG=auto
579 CFG_LIBMNG=auto
580 CFG_XCURSOR=runtime
581 CFG_XRANDR=runtime
582 CFG_XRENDER=auto
583 CFG_MITSHM=auto
584 CFG_OPENGL=auto
585 CFG_SSE=auto
586 CFG_FONTCONFIG=auto
587 CFG_QWS_FREETYPE=auto
588 CFG_LIBFREETYPE=auto
589 CFG_SQL_AVAILABLE=
590 QT_DEFAULT_BUILD_PARTS="libs tools examples demos docs translations"
591 CFG_BUILD_PARTS=""
592 CFG_NOBUILD_PARTS=""
593 CFG_RELEASE_QMAKE=no
594 CFG_PHONON=auto
595 CFG_PHONON_BACKEND=yes
596 CFG_SVG=yes
597 CFG_WEBKIT=auto # (yes|no|auto)
599 CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen"
600 CFG_GFX_ON="linuxfb multiscreen"
601 CFG_GFX_PLUGIN_AVAILABLE=
602 CFG_GFX_PLUGIN=
603 CFG_GFX_OFF=
604 CFG_KBD_AVAILABLE="tty usb sl5000 yopy vr41xx qvfb"
605 CFG_KBD_ON="tty" #default, see QMakeVar above
606 CFG_MOUSE_AVAILABLE="pc bus linuxtp yopy vr41xx tslib qvfb"
607 CFG_MOUSE_ON="pc linuxtp" #default, see QMakeVar above
609 CFG_ARCH=
610 CFG_HOST_ARCH=
611 CFG_KBD_PLUGIN_AVAILABLE=
612 CFG_KBD_PLUGIN=
613 CFG_KBD_OFF=
614 CFG_MOUSE_PLUGIN_AVAILABLE=
615 CFG_MOUSE_PLUGIN=
616 CFG_MOUSE_OFF=
617 CFG_USE_GNUMAKE=no
618 CFG_IM=yes
619 CFG_DECORATION_AVAILABLE="styled windows default"
620 CFG_DECORATION_ON="${CFG_DECORATION_AVAILABLE}" # all on by default
621 CFG_DECORATION_PLUGIN_AVAILABLE=
622 CFG_DECORATION_PLUGIN=
623 CFG_XINPUT=runtime
624 CFG_XKB=auto
625 CFG_NIS=auto
626 CFG_CUPS=auto
627 CFG_ICONV=auto
628 CFG_DBUS=auto
629 CFG_GLIB=auto
630 CFG_GSTREAMER=auto
631 CFG_QGTKSTYLE=auto
632 CFG_LARGEFILE=auto
633 CFG_OPENSSL=auto
634 CFG_PTMALLOC=no
635 CFG_STL=auto
636 CFG_PRECOMPILE=auto
637 CFG_SEPARATE_DEBUG_INFO=auto
638 CFG_REDUCE_EXPORTS=auto
639 CFG_MMX=auto
640 CFG_3DNOW=auto
641 CFG_SSE=auto
642 CFG_SSE2=auto
643 CFG_REDUCE_RELOCATIONS=no
644 CFG_IPV6=auto
645 CFG_NAS=no
646 CFG_QWS_DEPTHS=all
647 CFG_USER_BUILD_KEY=
648 CFG_ACCESSIBILITY=auto
649 CFG_QT3SUPPORT=yes
650 CFG_ENDIAN=auto
651 CFG_HOST_ENDIAN=auto
652 CFG_DOUBLEFORMAT=auto
653 CFG_ARMFPA=auto
654 CFG_IWMMXT=no
655 CFG_CLOCK_GETTIME=auto
656 CFG_CLOCK_MONOTONIC=auto
657 CFG_MREMAP=auto
658 CFG_GETADDRINFO=auto
659 CFG_IPV6IFNAME=auto
660 CFG_GETIFADDRS=auto
661 CFG_INOTIFY=auto
662 CFG_RPATH=yes
663 CFG_FRAMEWORK=auto
664 CFG_MAC_ARCHS=
665 CFG_MAC_DWARF2=auto
666 CFG_MAC_XARCH=auto
667 CFG_MAC_CARBON=yes
668 CFG_MAC_COCOA=auto
669 COMMANDLINE_MAC_COCOA=no
670 CFG_SXE=no
671 CFG_PREFIX_INSTALL=yes
672 CFG_SDK=
673 D_FLAGS=
674 I_FLAGS=
675 L_FLAGS=
676 RPATH_FLAGS=
677 l_FLAGS=
678 QCONFIG_FLAGS=
679 XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++"
680 PLATFORM=$QMAKESPEC
681 QT_CROSS_COMPILE=no
682 OPT_CONFIRM_LICENSE=no
683 OPT_SHADOW=maybe
684 OPT_FAST=auto
685 OPT_VERBOSE=no
686 OPT_HELP=
687 CFG_SILENT=no
688 CFG_GRAPHICS_SYSTEM=default
690 # initalize variables used for installation
691 QT_INSTALL_PREFIX=
692 QT_INSTALL_DOCS=
693 QT_INSTALL_HEADERS=
694 QT_INSTALL_LIBS=
695 QT_INSTALL_BINS=
696 QT_INSTALL_PLUGINS=
697 QT_INSTALL_DATA=
698 QT_INSTALL_TRANSLATIONS=
699 QT_INSTALL_SETTINGS=
700 QT_INSTALL_EXAMPLES=
701 QT_INSTALL_DEMOS=
702 QT_HOST_PREFIX=
704 #flags for SQL drivers
705 QT_CFLAGS_PSQL=
706 QT_LFLAGS_PSQL=
707 QT_CFLAGS_MYSQL=
708 QT_LFLAGS_MYSQL=
709 QT_LFLAGS_MYSQL_R=
710 QT_CFLAGS_SQLITE=
711 QT_LFLAGS_SQLITE=
713 # flags for libdbus-1
714 QT_CFLAGS_DBUS=
715 QT_LIBS_DBUS=
717 # flags for Glib (X11 only)
718 QT_CFLAGS_GLIB=
719 QT_LIBS_GLIB=
721 # flags for GStreamer (X11 only)
722 QT_CFLAGS_GSTREAMER=
723 QT_LIBS_GSTREAMER=
725 #-------------------------------------------------------------------------------
726 # check SQL drivers, mouse drivers and decorations available in this package
727 #-------------------------------------------------------------------------------
729 # opensource version removes some drivers, so force them to be off
730 CFG_SQL_tds=no
731 CFG_SQL_oci=no
732 CFG_SQL_db2=no
734 CFG_SQL_AVAILABLE=
735 if [ -d "$relpath/src/plugins/sqldrivers" ]; then
736 for a in "$relpath/src/plugins/sqldrivers/"*; do
737 if [ -d "$a" ]; then
738 base_a=`basename $a`
739 CFG_SQL_AVAILABLE="${CFG_SQL_AVAILABLE} ${base_a}"
740 eval "CFG_SQL_${base_a}=auto"
742 done
745 CFG_DECORATION_PLUGIN_AVAILABLE=
746 if [ -d "$relpath/src/plugins/decorations" ]; then
747 for a in "$relpath/src/plugins/decorations/"*; do
748 if [ -d "$a" ]; then
749 base_a=`basename $a`
750 CFG_DECORATION_PLUGIN_AVAILABLE="${CFG_DECORATION_PLUGIN_AVAILABLE} ${base_a}"
752 done
755 CFG_KBD_PLUGIN_AVAILABLE=
756 if [ -d "$relpath/src/plugins/kbddrivers" ]; then
757 for a in "$relpath/src/plugins/kbddrivers/"*; do
758 if [ -d "$a" ]; then
759 base_a=`basename $a`
760 CFG_KBD_PLUGIN_AVAILABLE="${CFG_KBD_PLUGIN_AVAILABLE} ${base_a}"
762 done
765 CFG_MOUSE_PLUGIN_AVAILABLE=
766 if [ -d "$relpath/src/plugins/mousedrivers" ]; then
767 for a in "$relpath/src/plugins/mousedrivers/"*; do
768 if [ -d "$a" ]; then
769 base_a=`basename $a`
770 CFG_MOUSE_PLUGIN_AVAILABLE="${CFG_MOUSE_PLUGIN_AVAILABLE} ${base_a}"
772 done
775 CFG_GFX_PLUGIN_AVAILABLE=
776 if [ -d "$relpath/src/plugins/gfxdrivers" ]; then
777 for a in "$relpath/src/plugins/gfxdrivers/"*; do
778 if [ -d "$a" ]; then
779 base_a=`basename $a`
780 CFG_GFX_PLUGIN_AVAILABLE="${CFG_GFX_PLUGIN_AVAILABLE} ${base_a}"
782 done
783 CFG_GFX_OFF="$CFG_GFX_AVAILABLE" # assume all off
786 #-------------------------------------------------------------------------------
787 # parse command line arguments
788 #-------------------------------------------------------------------------------
790 # parse the arguments, setting things to "yes" or "no"
791 while [ "$#" -gt 0 ]; do
792 CURRENT_OPT="$1"
793 UNKNOWN_ARG=no
794 case "$1" in
795 #Autoconf style options
796 --enable-*)
797 VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
798 VAL=yes
800 --disable-*)
801 VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
802 VAL=no
804 --*=*)
805 VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
806 VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
808 --no-*)
809 VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
810 VAL=no
812 --*)
813 VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
814 VAL=yes
816 #Qt plugin options
817 -no-*-*|-plugin-*-*|-qt-*-*)
818 VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
819 VAL=`echo $1 | sed "s,^-\([^-]*\).*,\1,"`
821 #Qt style no options
822 -no-*)
823 VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"`
824 VAL=no
826 #Qt style yes options
827 -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-svg|-webkit|-scripttools|-rpath|-force-pkg-config)
828 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
829 VAL=yes
831 #Qt style options that pass an argument
832 -qconfig)
833 if [ "$PLATFORM_QWS" = "yes" ]; then
834 CFG_QCONFIG="$VAL"
835 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
836 shift
837 VAL=$1
838 else
839 UNKNOWN_ARG=yes
842 -prefix|-docdir|-headerdir|-plugindir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config)
843 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
844 shift
845 VAL="$1"
847 #Qt style complex options in one command
848 -enable-*|-disable-*)
849 VAR=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
850 VAL=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
852 #Qt Builtin/System style options
853 -no-*|-system-*|-qt-*)
854 VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
855 VAL=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
857 #Options that cannot be generalized
858 -k|-continue)
859 VAR=fatal_error
860 VAL=no
862 -embedded)
863 VAR=embedded
864 # this option may or may not be followed by an argument
865 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
866 VAL=auto
867 else
868 shift;
869 VAL=$1
872 -opengl)
873 VAR=opengl
874 # this option may or may not be followed by an argument
875 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
876 VAL=yes
877 else
878 shift;
879 VAL=$1
882 -hostprefix)
883 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
884 # this option may or may not be followed by an argument
885 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
886 VAL=$outpath
887 else
888 shift;
889 VAL=$1
892 -host-*-endian)
893 VAR=host_endian
894 VAL=`echo $1 | sed "s,^-.*-\(.*\)-.*,\1,"`
896 -*-endian)
897 VAR=endian
898 VAL=`echo $1 | sed "s,^-\(.*\)-.*,\1,"`
900 -qtnamespace)
901 VAR="qtnamespace"
902 shift
903 VAL="$1"
905 -graphicssystem)
906 VAR="graphicssystem"
907 shift
908 VAL=$1
910 -qtlibinfix)
911 VAR="qtlibinfix"
912 shift
913 VAL="$1"
915 -D?*|-D)
916 VAR="add_define"
917 if [ "$1" = "-D" ]; then
918 shift
919 VAL="$1"
920 else
921 VAL=`echo $1 | sed 's,-D,,'`
924 -I?*|-I)
925 VAR="add_ipath"
926 if [ "$1" = "-I" ]; then
927 shift
928 VAL="$1"
929 else
930 VAL=`echo $1 | sed 's,-I,,'`
933 -L?*|-L)
934 VAR="add_lpath"
935 if [ "$1" = "-L" ]; then
936 shift
937 VAL="$1"
938 else
939 VAL=`echo $1 | sed 's,-L,,'`
942 -R?*|-R)
943 VAR="add_rpath"
944 if [ "$1" = "-R" ]; then
945 shift
946 VAL="$1"
947 else
948 VAL=`echo $1 | sed 's,-R,,'`
951 -l?*)
952 VAR="add_link"
953 VAL=`echo $1 | sed 's,-l,,'`
955 -F?*|-F)
956 VAR="add_fpath"
957 if [ "$1" = "-F" ]; then
958 shift
959 VAL="$1"
960 else
961 VAL=`echo $1 | sed 's,-F,,'`
964 -fw?*|-fw)
965 VAR="add_framework"
966 if [ "$1" = "-fw" ]; then
967 shift
968 VAL="$1"
969 else
970 VAL=`echo $1 | sed 's,-fw,,'`
974 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
975 VAL="unknown"
978 UNKNOWN_ARG=yes
980 esac
981 if [ "$UNKNOWN_ARG" = "yes" ]; then
982 echo "$1: unknown argument"
983 OPT_HELP=yes
984 ERROR=yes
985 shift
986 continue
988 shift
990 UNKNOWN_OPT=no
991 case "$VAR" in
992 qt3support)
993 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
994 CFG_QT3SUPPORT="$VAL"
995 else
996 UNKNOWN_OPT=yes
999 accessibility)
1000 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1001 CFG_ACCESSIBILITY="$VAL"
1002 else
1003 UNKNOWN_OPT=yes
1006 license)
1007 LICENSE_FILE="$VAL"
1009 gnumake)
1010 CFG_USE_GNUMAKE="$VAL"
1012 mysql_config)
1013 CFG_MYSQL_CONFIG="$VAL"
1015 prefix)
1016 QT_INSTALL_PREFIX="$VAL"
1018 hostprefix)
1019 QT_HOST_PREFIX="$VAL"
1021 force-pkg-config)
1022 QT_FORCE_PKGCONFIG=yes
1024 docdir)
1025 QT_INSTALL_DOCS="$VAL"
1027 headerdir)
1028 QT_INSTALL_HEADERS="$VAL"
1030 plugindir)
1031 QT_INSTALL_PLUGINS="$VAL"
1033 datadir)
1034 QT_INSTALL_DATA="$VAL"
1036 libdir)
1037 QT_INSTALL_LIBS="$VAL"
1039 qtnamespace)
1040 QT_NAMESPACE="$VAL"
1042 qtlibinfix)
1043 QT_LIBINFIX="$VAL"
1045 translationdir)
1046 QT_INSTALL_TRANSLATIONS="$VAL"
1048 sysconfdir|settingsdir)
1049 QT_INSTALL_SETTINGS="$VAL"
1051 examplesdir)
1052 QT_INSTALL_EXAMPLES="$VAL"
1054 demosdir)
1055 QT_INSTALL_DEMOS="$VAL"
1057 qconfig)
1058 CFG_QCONFIG="$VAL"
1060 bindir)
1061 QT_INSTALL_BINS="$VAL"
1063 buildkey)
1064 CFG_USER_BUILD_KEY="$VAL"
1066 sxe)
1067 CFG_SXE="$VAL"
1069 embedded)
1070 CFG_EMBEDDED="$VAL"
1071 if [ "$PLATFORM_QWS" != "no" ]; then
1072 if [ "$PLATFORM_QWS" = "maybe" ]; then
1073 PLATFORM_X11=no
1074 PLATFORM_MAC=no
1075 PLATFORM_QWS=yes
1077 else
1078 echo "No license exists to enable Qt for Embedded Linux. Disabling."
1079 CFG_EMBEDDED=no
1082 sse)
1083 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1084 CFG_SSE="$VAL"
1085 else
1086 UNKNOWN_OPT=yes
1089 endian)
1090 if [ "$VAL" = "little" ]; then
1091 CFG_ENDIAN="Q_LITTLE_ENDIAN"
1092 elif [ "$VAL" = "big" ]; then
1093 CFG_ENDIAN="Q_BIG_ENDIAN"
1094 else
1095 UNKNOWN_OPT=yes
1098 host_endian)
1099 if [ "$VAL" = "little" ]; then
1100 CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
1101 elif [ "$VAL" = "big" ]; then
1102 CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
1103 else
1104 UNKNOWN_OPT=yes
1107 armfpa)
1108 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1109 CFG_ARMFPA="$VAL"
1110 else
1111 UNKNOWN_OPT=yes
1114 depths)
1115 CFG_QWS_DEPTHS="$VAL"
1117 opengl)
1118 if [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
1119 [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
1120 [ "$VAL" = "es1cl" ] || [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then
1121 CFG_OPENGL="$VAL"
1122 else
1123 UNKNOWN_OPT=yes
1126 graphicssystem)
1127 if [ "$PLATFORM_QWS" = "yes" ]; then
1128 echo "Error: Graphics System plugins are not supported on QWS."
1129 echo " On QWS, the graphics system API is part of the QScreen plugin architecture "
1130 echo " rather than existing as a separate plugin."
1131 echo ""
1132 UNKNOWN_OPT=yes
1133 else
1134 if [ "$VAL" = "opengl" ]; then
1135 CFG_GRAPHICS_SYSTEM="opengl"
1136 elif [ "$VAL" = "raster" ]; then
1137 CFG_GRAPHICS_SYSTEM="raster"
1138 else
1139 UNKNOWN_OPT=yes
1144 qvfb) # left for commandline compatibility, not documented
1145 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1146 if [ "$VAL" = "yes" ]; then
1147 QMakeVar add gfx-drivers qvfb
1148 QMakeVar add kbd-drivers qvfb
1149 QMakeVar add mouse-drivers qvfb
1150 CFG_GFX_ON="$CFG_GFX_ON qvfb"
1151 CFG_KBD_ON="$CFG_KBD_ON qvfb"
1152 CFG_MOUSE_ON="$CFG_MOUSE_ON qvfb"
1154 else
1155 UNKNOWN_OPT=yes
1158 nomake)
1159 CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL"
1161 make)
1162 CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL"
1164 x11)
1165 if [ "$PLATFORM_MAC" = "yes" ]; then
1166 PLATFORM_MAC=no
1167 elif [ "$PLATFORM_QWS" = "yes" ]; then
1168 PLATFORM_QWS=no
1170 if [ "$CFG_FRAMEWORK" = "auto" ]; then
1171 CFG_FRAMEWORK=no
1173 PLATFORM_X11=yes
1175 sdk)
1176 if [ "$PLATFORM_MAC" = "yes" ]; then
1177 CFG_SDK="$VAL"
1178 else
1179 UNKNOWN_OPT=yes
1182 dwarf2)
1183 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1184 CFG_MAC_DWARF2="$VAL"
1185 else
1186 UNKNOWN_OPT=yes
1189 arch)
1190 if [ "$PLATFORM_MAC" = "yes" ]; then
1191 CFG_MAC_ARCHS="$CFG_MAC_ARCHS $VAL"
1192 else
1193 CFG_ARCH=$VAL
1196 host-arch)
1197 CFG_HOST_ARCH=$VAL
1199 universal)
1200 if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1201 CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86 ppc"
1202 else
1203 UNKNOWN_OPT=yes
1206 cocoa)
1207 if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1208 CFG_MAC_COCOA="$VAL"
1209 COMMANDLINE_MAC_COCOA="$VAL"
1210 else
1211 UNKNOWN_OPT=yes
1214 framework)
1215 if [ "$PLATFORM_MAC" = "yes" ]; then
1216 CFG_FRAMEWORK="$VAL"
1217 else
1218 UNKNOWN_OPT=yes
1221 profile)
1222 if [ "$VAL" = "yes" ]; then
1223 CFG_PROFILE=yes
1224 QMakeVar add QMAKE_CFLAGS -pg
1225 QMakeVar add QMAKE_CXXFLAGS -pg
1226 QMakeVar add QMAKE_LFLAGS -pg
1227 QMAKE_VARS="$QMAKE_VARS CONFIG+=nostrip"
1228 else
1229 UNKNOWN_OPT=yes
1232 exceptions|g++-exceptions)
1233 if [ "$VAL" = "no" ]; then
1234 CFG_EXCEPTIONS=no
1235 elif [ "$VAL" = "yes" ]; then
1236 CFG_EXCEPTIONS=yes
1237 else
1238 UNKNOWN_OPT=yes
1241 platform)
1242 PLATFORM="$VAL"
1243 # keep compatibility with old platform names
1244 case $PLATFORM in
1245 aix-64)
1246 PLATFORM=aix-xlc-64
1248 hpux-o64)
1249 PLATFORM=hpux-acc-o64
1251 hpux-n64)
1252 PLATFORM=hpux-acc-64
1254 hpux-acc-n64)
1255 PLATFORM=hpux-acc-64
1257 irix-n32)
1258 PLATFORM=irix-cc
1260 irix-64)
1261 PLATFORM=irix-cc-64
1263 irix-cc-n64)
1264 PLATFORM=irix-cc-64
1266 reliant-64)
1267 PLATFORM=reliant-cds-64
1269 solaris-64)
1270 PLATFORM=solaris-cc-64
1272 solaris-64)
1273 PLATFORM=solaris-cc-64
1275 openunix-cc)
1276 PLATFORM=unixware-cc
1278 openunix-g++)
1279 PLATFORM=unixware-g++
1281 unixware7-cc)
1282 PLATFORM=unixware-cc
1284 unixware7-g++)
1285 PLATFORM=unixware-g++
1287 macx-g++-64)
1288 PLATFORM=macx-g++
1289 NATIVE_64_ARCH=
1290 case `uname -p` in
1291 i386) NATIVE_64_ARCH="x86_64" ;;
1292 powerpc) NATIVE_64_ARCH="ppc64" ;;
1293 *) echo "WARNING: Can't detect CPU architecture for macx-g++-64" ;;
1294 esac
1295 if [ ! -z "$NATIVE_64_ARCH" ]; then
1296 QTCONFIG_CONFIG="$QTCONFIG_CONFIG $NATIVE_64_ARCH"
1297 CFG_MAC_ARCHS="$CFG_MAC_ARCHS $NATIVE_64_ARCH"
1300 esac
1302 xplatform)
1303 XPLATFORM="$VAL"
1305 debug-and-release)
1306 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1307 CFG_DEBUG_RELEASE="$VAL"
1308 else
1309 UNKNOWN_OPT=yes
1312 optimized-qmake)
1313 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1314 CFG_RELEASE_QMAKE="$VAL"
1315 else
1316 UNKNOWN_OPT=yes
1319 release)
1320 if [ "$VAL" = "yes" ]; then
1321 CFG_DEBUG=no
1322 elif [ "$VAL" = "no" ]; then
1323 CFG_DEBUG=yes
1324 else
1325 UNKNOWN_OPT=yes
1328 prefix-install)
1329 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1330 CFG_PREFIX_INSTALL="$VAL"
1331 else
1332 UNKNOWN_OPT=yes
1335 debug)
1336 CFG_DEBUG="$VAL"
1338 developer-build|commercial|opensource|nokia-developer)
1339 # These switches have been dealt with already
1341 static)
1342 if [ "$VAL" = "yes" ]; then
1343 CFG_SHARED=no
1344 elif [ "$VAL" = "no" ]; then
1345 CFG_SHARED=yes
1346 else
1347 UNKNOWN_OPT=yes
1350 incremental)
1351 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1352 CFG_INCREMENTAL="$VAL"
1353 else
1354 UNKNOWN_OPT=yes
1357 fatal_error)
1358 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1359 CFG_CONFIGURE_EXIT_ON_ERROR="$VAL"
1360 else
1361 UNKNOWN_OPT=yes
1364 feature-*)
1365 if [ "$PLATFORM_QWS" = "yes" ]; then
1366 FEATURE=`echo $VAR | sed "s,^[^-]*-\([^-]*\),\1," | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
1367 if [ "$VAL" = "no" ]; then
1368 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE"
1369 elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then
1370 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_$FEATURE"
1371 else
1372 UNKNOWN_OPT=yes
1374 else
1375 UNKNOWN_OPT=yes
1378 shared)
1379 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1380 CFG_SHARED="$VAL"
1381 else
1382 UNKNOWN_OPT=yes
1385 gif)
1386 [ "$VAL" = "qt" ] && VAL=yes
1387 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1388 CFG_GIF="$VAL"
1389 else
1390 UNKNOWN_OPT=yes
1394 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1395 CFG_SM="$VAL"
1396 else
1397 UNKNOWN_OPT=yes
1401 xinerama)
1402 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1403 CFG_XINERAMA="$VAL"
1404 else
1405 UNKNOWN_OPT=yes
1408 xshape)
1409 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1410 CFG_XSHAPE="$VAL"
1411 else
1412 UNKNOWN_OPT=yes
1415 xinput)
1416 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1417 CFG_XINPUT="$VAL"
1418 else
1419 UNKNOWN_OPT=yes
1422 stl)
1423 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1424 CFG_STL="$VAL"
1425 else
1426 UNKNOWN_OPT=yes
1429 pch)
1430 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1431 CFG_PRECOMPILE="$VAL"
1432 else
1433 UNKNOWN_OPT=yes
1436 separate-debug-info)
1437 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1438 CFG_SEPARATE_DEBUG_INFO="$VAL"
1439 else
1440 UNKNOWN_OPT=yes
1443 reduce-exports)
1444 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1445 CFG_REDUCE_EXPORTS="$VAL"
1446 else
1447 UNKNOWN_OPT=yes
1450 mmx)
1451 if [ "$VAL" = "no" ]; then
1452 CFG_MMX="$VAL"
1453 else
1454 UNKNOWN_OPT=yes
1457 3dnow)
1458 if [ "$VAL" = "no" ]; then
1459 CFG_3DNOW="$VAL"
1460 else
1461 UNKNOWN_OPT=yes
1464 sse)
1465 if [ "$VAL" = "no" ]; then
1466 CFG_SSE="$VAL"
1467 else
1468 UNKNOWN_OPT=yes
1471 sse2)
1472 if [ "$VAL" = "no" ]; then
1473 CFG_SSE2="$VAL"
1474 else
1475 UNKNOWN_OPT=yes
1478 iwmmxt)
1479 CFG_IWMMXT="yes"
1481 reduce-relocations)
1482 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1483 CFG_REDUCE_RELOCATIONS="$VAL"
1484 else
1485 UNKNOWN_OPT=yes
1488 freetype)
1489 [ "$VAL" = "qt" ] && VAL=yes
1490 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1491 CFG_QWS_FREETYPE="$VAL"
1492 else
1493 UNKNOWN_OPT=yes
1496 zlib)
1497 [ "$VAL" = "qt" ] && VAL=yes
1498 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1499 CFG_ZLIB="$VAL"
1500 else
1501 UNKNOWN_OPT=yes
1503 # No longer supported:
1504 #[ "$VAL" = "no" ] && CFG_LIBPNG=no
1506 sqlite)
1507 if [ "$VAL" = "system" ]; then
1508 CFG_SQLITE=system
1509 else
1510 UNKNOWN_OPT=yes
1513 libpng)
1514 [ "$VAL" = "yes" ] && VAL=qt
1515 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1516 CFG_LIBPNG="$VAL"
1517 else
1518 UNKNOWN_OPT=yes
1521 libjpeg)
1522 [ "$VAL" = "yes" ] && VAL=qt
1523 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1524 CFG_LIBJPEG="$VAL"
1525 else
1526 UNKNOWN_OPT=yes
1529 libmng)
1530 [ "$VAL" = "yes" ] && VAL=qt
1531 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1532 CFG_LIBMNG="$VAL"
1533 else
1534 UNKNOWN_OPT=yes
1537 libtiff)
1538 [ "$VAL" = "yes" ] && VAL=qt
1539 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1540 CFG_LIBTIFF="$VAL"
1541 else
1542 UNKNOWN_OPT=yes
1545 nas-sound)
1546 if [ "$VAL" = "system" ] || [ "$VAL" = "no" ]; then
1547 CFG_NAS="$VAL"
1548 else
1549 UNKNOWN_OPT=yes
1552 xcursor)
1553 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1554 CFG_XCURSOR="$VAL"
1555 else
1556 UNKNOWN_OPT=yes
1559 xfixes)
1560 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1561 CFG_XFIXES="$VAL"
1562 else
1563 UNKNOWN_OPT=yes
1566 xrandr)
1567 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1568 CFG_XRANDR="$VAL"
1569 else
1570 UNKNOWN_OPT=yes
1573 xrender)
1574 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1575 CFG_XRENDER="$VAL"
1576 else
1577 UNKNOWN_OPT=yes
1580 mitshm)
1581 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1582 CFG_MITSHM="$VAL"
1583 else
1584 UNKNOWN_OPT=yes
1587 fontconfig)
1588 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1589 CFG_FONTCONFIG="$VAL"
1590 else
1591 UNKNOWN_OPT=yes
1594 xkb)
1595 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1596 CFG_XKB="$VAL"
1597 else
1598 UNKNOWN_OPT=yes
1601 cups)
1602 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1603 CFG_CUPS="$VAL"
1604 else
1605 UNKNOWN_OPT=yes
1608 iconv)
1609 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1610 CFG_ICONV="$VAL"
1611 else
1612 UNKNOWN_OPT=yes
1615 glib)
1616 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1617 CFG_GLIB="$VAL"
1618 else
1619 UNKNOWN_OPT=yes
1622 gstreamer)
1623 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1624 CFG_GSTREAMER="$VAL"
1625 else
1626 UNKNOWN_OPT=yes
1629 gtkstyle)
1630 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1631 CFG_QGTKSTYLE="$VAL"
1632 else
1633 UNKNOWN_OPT=yes
1636 qdbus|dbus)
1637 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ]; then
1638 CFG_DBUS="$VAL"
1639 elif [ "$VAL" = "runtime" ]; then
1640 CFG_DBUS="yes"
1641 else
1642 UNKNOWN_OPT=yes
1645 dbus-linked)
1646 if [ "$VAL" = "yes" ]; then
1647 CFG_DBUS="linked"
1648 else
1649 UNKNOWN_OPT=yes
1652 nis)
1653 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1654 CFG_NIS="$VAL"
1655 else
1656 UNKNOWN_OPT=yes
1659 largefile)
1660 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1661 CFG_LARGEFILE="$VAL"
1662 else
1663 UNKNOWN_OPT=yes
1666 openssl)
1667 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1668 CFG_OPENSSL="$VAL"
1669 else
1670 UNKNOWN_OPT=yes
1673 openssl-linked)
1674 if [ "$VAL" = "yes" ]; then
1675 CFG_OPENSSL="linked"
1676 else
1677 UNKNOWN_OPT=yes
1680 ptmalloc)
1681 if [ "$VAL" = "yes" ]; then
1682 CFG_PTMALLOC="yes"
1683 else
1684 UNKNOWN_OPT=yes
1688 xmlpatterns)
1689 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1690 CFG_XMLPATTERNS="yes"
1691 else
1692 if [ "$VAL" = "no" ]; then
1693 CFG_XMLPATTERNS="no"
1694 else
1695 UNKNOWN_OPT=yes
1699 scripttools)
1700 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1701 CFG_SCRIPTTOOLS="yes"
1702 else
1703 if [ "$VAL" = "no" ]; then
1704 CFG_SCRIPTTOOLS="no"
1705 else
1706 UNKNOWN_OPT=yes
1710 svg)
1711 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1712 CFG_SVG="yes"
1713 else
1714 if [ "$VAL" = "no" ]; then
1715 CFG_SVG="no"
1716 else
1717 UNKNOWN_OPT=yes
1721 webkit)
1722 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1723 CFG_WEBKIT="yes"
1724 else
1725 if [ "$VAL" = "no" ]; then
1726 CFG_WEBKIT="no"
1727 else
1728 UNKNOWN_OPT=yes
1732 confirm-license)
1733 if [ "$VAL" = "yes" ]; then
1734 OPT_CONFIRM_LICENSE="$VAL"
1735 else
1736 UNKNOWN_OPT=yes
1739 h|help)
1740 if [ "$VAL" = "yes" ]; then
1741 OPT_HELP="$VAL"
1742 else
1743 UNKNOWN_OPT=yes
1746 sql-*|gfx-*|decoration-*|kbd-*|mouse-*)
1747 # if Qt style options were used, $VAL can be "no", "qt", or "plugin"
1748 # if autoconf style options were used, $VAL can be "yes" or "no"
1749 [ "$VAL" = "yes" ] && VAL=qt
1750 # now $VAL should be "no", "qt", or "plugin"... double-check
1751 if [ "$VAL" != "no" ] && [ "$VAL" != "qt" ] && [ "$VAL" != "plugin" ]; then
1752 UNKNOWN_OPT=yes
1754 # now $VAL is "no", "qt", or "plugin"
1755 OPT="$VAL"
1756 VAL=`echo $VAR | sed "s,^[^-]*-\([^-]*\).*,\1,"`
1757 VAR=`echo $VAR | sed "s,^\([^-]*\).*,\1,"`
1759 # Grab the available values
1760 case "$VAR" in
1761 sql)
1762 avail="$CFG_SQL_AVAILABLE"
1764 gfx)
1765 avail="$CFG_GFX_AVAILABLE"
1766 if [ "$OPT" = "plugin" ]; then
1767 avail="$CFG_GFX_PLUGIN_AVAILABLE"
1770 decoration)
1771 avail="$CFG_DECORATION_AVAILABLE"
1772 if [ "$OPT" = "plugin" ]; then
1773 avail="$CFG_DECORATION_PLUGIN_AVAILABLE"
1776 kbd)
1777 avail="$CFG_KBD_AVAILABLE"
1778 if [ "$OPT" = "plugin" ]; then
1779 avail="$CFG_KBD_PLUGIN_AVAILABLE"
1782 mouse)
1783 avail="$CFG_MOUSE_AVAILABLE"
1784 if [ "$OPT" = "plugin" ]; then
1785 avail="$CFG_MOUSE_PLUGIN_AVAILABLE"
1789 avail=""
1790 echo "BUG: Unhandled type $VAR used in $CURRENT_OPT"
1792 esac
1794 # Check that that user's value is available.
1795 found=no
1796 for d in $avail; do
1797 if [ "$VAL" = "$d" ]; then
1798 found=yes
1799 break
1801 done
1802 [ "$found" = yes ] || ERROR=yes
1804 if [ "$VAR" = "sql" ]; then
1805 # set the CFG_SQL_driver
1806 eval "CFG_SQL_$VAL=\$OPT"
1807 continue
1810 if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then
1811 if [ "$OPT" = "plugin" ]; then
1812 [ "$VAR" = "decoration" ] && QMakeVar del "${VAR}s" "$VAL"
1813 [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"` && CFG_DECORATION_PLUGIN="$CFG_DECORATION_PLUGIN ${VAL}"
1814 [ "$VAR" = "kbd" ] && QMakeVar del "${VAR}s" "$VAL"
1815 [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_KBD_PLUGIN="$CFG_KBD_PLUGIN ${VAL}"
1816 [ "$VAR" = "mouse" ] && QMakeVar del "${VAR}s" "$VAL"
1817 [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_MOUSE_PLUGIN="$CFG_MOUSE_PLUGIN ${VAL}"
1818 [ "$VAR" = "gfx" ] && QMakeVar del "${VAR}s" "$VAL"
1819 [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"` && CFG_GFX_PLUGIN="${CFG_GFX_PLUGIN} ${VAL}"
1820 VAR="${VAR}-${OPT}"
1821 else
1822 if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "decoration" ] || [ "$VAR" = "mouse" ]; then
1823 [ "$VAR" = "gfx" ] && CFG_GFX_ON="$CFG_GFX_ON $VAL"
1824 [ "$VAR" = "kbd" ] && CFG_KBD_ON="$CFG_KBD_ON $VAL"
1825 [ "$VAR" = "decoration" ] && CFG_DECORATION_ON="$CFG_DECORATION_ON $VAL"
1826 [ "$VAR" = "mouse" ] && CFG_MOUSE_ON="$CFG_MOUSE_ON $VAL"
1827 VAR="${VAR}-driver"
1830 QMakeVar add "${VAR}s" "${VAL}"
1831 elif [ "$OPT" = "no" ]; then
1832 PLUG_VAR="${VAR}-plugin"
1833 if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "mouse" ]; then
1834 IN_VAR="${VAR}-driver"
1835 else
1836 IN_VAR="${VAR}"
1838 [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"`
1839 [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"`
1840 [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"`
1841 [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"`
1842 QMakeVar del "${IN_VAR}s" "$VAL"
1843 QMakeVar del "${PLUG_VAR}s" "$VAL"
1845 if [ "$ERROR" = "yes" ]; then
1846 echo "$CURRENT_OPT: unknown argument"
1847 OPT_HELP=yes
1850 v|verbose)
1851 if [ "$VAL" = "yes" ]; then
1852 if [ "$OPT_VERBOSE" = "$VAL" ]; then # takes two verboses to turn on qmake debugs
1853 QMAKE_SWITCHES="$QMAKE_SWITCHES -d"
1854 else
1855 OPT_VERBOSE=yes
1857 elif [ "$VAL" = "no" ]; then
1858 if [ "$OPT_VERBOSE" = "$VAL" ] && echo "$QMAKE_SWITCHES" | grep ' -d' >/dev/null 2>&1; then
1859 QMAKE_SWITCHES=`echo $QMAKE_SWITCHES | sed "s, -d,,"`
1860 else
1861 OPT_VERBOSE=no
1863 else
1864 UNKNOWN_OPT=yes
1867 fast)
1868 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1869 OPT_FAST="$VAL"
1870 else
1871 UNKNOWN_OPT=yes
1874 rpath)
1875 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1876 CFG_RPATH="$VAL"
1877 else
1878 UNKNOWN_OPT=yes
1881 add_define)
1882 D_FLAGS="$D_FLAGS \"$VAL\""
1884 add_ipath)
1885 I_FLAGS="$I_FLAGS -I\"${VAL}\""
1887 add_lpath)
1888 L_FLAGS="$L_FLAGS -L\"${VAL}\""
1890 add_rpath)
1891 RPATH_FLAGS="$RPATH_FLAGS \"${VAL}\""
1893 add_link)
1894 l_FLAGS="$l_FLAGS -l\"${VAL}\""
1896 add_fpath)
1897 if [ "$PLATFORM_MAC" = "yes" ]; then
1898 L_FLAGS="$L_FLAGS -F\"${VAL}\""
1899 I_FLAGS="$I_FLAGS -F\"${VAL}\""
1900 else
1901 UNKNOWN_OPT=yes
1904 add_framework)
1905 if [ "$PLATFORM_MAC" = "yes" ]; then
1906 l_FLAGS="$l_FLAGS -framework \"${VAL}\""
1907 else
1908 UNKNOWN_OPT=yes
1911 silent)
1912 CFG_SILENT="$VAL"
1914 phonon)
1915 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1916 CFG_PHONON="$VAL"
1917 else
1918 UNKNOWN_OPT=yes
1921 phonon-backend)
1922 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1923 CFG_PHONON_BACKEND="$VAL"
1924 else
1925 UNKNOWN_OPT=yes
1929 UNKNOWN_OPT=yes
1931 esac
1932 if [ "$UNKNOWN_OPT" = "yes" ]; then
1933 echo "${CURRENT_OPT}: invalid command-line switch"
1934 OPT_HELP=yes
1935 ERROR=yes
1937 done
1939 if [ "$CFG_QCONFIG" != "full" ] && [ "$CFG_QT3SUPPORT" = "yes" ]; then
1940 echo "Warning: '-qconfig $CFG_QCONFIG' will disable the qt3support library."
1941 CFG_QT3SUPPORT="no"
1944 # update QT_CONFIG to show our current predefined configuration
1945 case "$CFG_QCONFIG" in
1946 minimal|small|medium|large|full)
1947 # these are a sequence of increasing functionality
1948 for c in minimal small medium large full; do
1949 QT_CONFIG="$QT_CONFIG $c-config"
1950 [ "$CFG_QCONFIG" = $c ] && break
1951 done
1954 # not known to be sufficient for anything
1955 if [ '!' -f "$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" ]; then
1956 echo >&2 "Error: configuration file not found:"
1957 echo >&2 " $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h"
1958 OPT_HELP=yes
1960 esac
1962 #-------------------------------------------------------------------------------
1963 # build tree initialization
1964 #-------------------------------------------------------------------------------
1966 # where to find which..
1967 unixtests="$relpath/config.tests/unix"
1968 mactests="$relpath/config.tests/mac"
1969 WHICH="$unixtests/which.test"
1971 PERL=`$WHICH perl 2>/dev/null`
1973 # find out which awk we want to use, prefer gawk, then nawk, then regular awk
1974 AWK=
1975 for e in gawk nawk awk; do
1976 if "$WHICH" $e >/dev/null 2>&1 && ( $e -f /dev/null /dev/null ) >/dev/null 2>&1; then
1977 AWK=$e
1978 break
1980 done
1982 ### skip this if the user just needs help...
1983 if [ "$OPT_HELP" != "yes" ]; then
1985 # is this a shadow build?
1986 if [ "$OPT_SHADOW" = "maybe" ]; then
1987 OPT_SHADOW=no
1988 if [ "$relpath" != "$outpath" ] && [ '!' -f "$outpath/configure" ]; then
1989 if [ -h "$outpath" ]; then
1990 [ "$relpath" -ef "$outpath" ] || OPT_SHADOW=yes
1991 else
1992 OPT_SHADOW=yes
1996 if [ "$OPT_SHADOW" = "yes" ]; then
1997 if [ -f "$relpath/.qmake.cache" -o -f "$relpath/src/corelib/global/qconfig.h" ]; then
1998 echo >&2 "You cannot make a shadow build from a source tree containing a previous build."
1999 echo >&2 "Cannot proceed."
2000 exit 1
2002 [ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
2005 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2006 echo
2007 echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux"
2008 echo "By default, Qt is built in release mode with separate debug information, so"
2009 echo "-debug-and-release is not necessary anymore"
2010 echo
2013 # detect build style
2014 if [ "$CFG_DEBUG" = "auto" ]; then
2015 if [ "$PLATFORM_MAC" = "yes" ]; then
2016 CFG_DEBUG_RELEASE=yes
2017 CFG_DEBUG=yes
2018 elif [ "$CFG_DEV" = "yes" ]; then
2019 CFG_DEBUG_RELEASE=no
2020 CFG_DEBUG=yes
2021 else
2022 CFG_DEBUG_RELEASE=no
2023 CFG_DEBUG=no
2026 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2027 QMAKE_CONFIG="$QMAKE_CONFIG build_all"
2030 if [ "$CFG_SILENT" = "yes" ]; then
2031 QMAKE_CONFIG="$QMAKE_CONFIG silent"
2034 # if the source tree is different from the build tree,
2035 # symlink or copy part of the sources
2036 if [ "$OPT_SHADOW" = "yes" ]; then
2037 echo "Preparing build tree..."
2039 if [ -z "$PERL" ]; then
2040 echo
2041 echo "You need perl in your PATH to make a shadow build."
2042 echo "Cannot proceed."
2043 exit 1
2046 [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
2048 # symlink the qmake directory
2049 find "$relpath/qmake" | while read a; do
2050 my_a=`echo "$a" | sed "s,^${relpath}/,${outpath}/,"`
2051 if [ '!' -f "$my_a" ]; then
2052 if [ -d "$a" ]; then
2053 # directories are created...
2054 mkdir -p "$my_a"
2055 else
2056 a_dir=`dirname "$my_a"`
2057 [ -d "$a_dir" ] || mkdir -p "$a_dir"
2058 # ... and files are symlinked
2059 case `basename "$a"` in
2060 *.o|*.d|GNUmakefile*|qmake)
2063 rm -f "$my_a"
2064 ln -s "$a" "$my_a"
2066 esac
2069 done
2071 # make a syncqt script that can be used in the shadow
2072 rm -f "$outpath/bin/syncqt"
2073 if [ -x "$relpath/bin/syncqt" ]; then
2074 mkdir -p "$outpath/bin"
2075 echo "#!/bin/sh" >"$outpath/bin/syncqt"
2076 echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/syncqt"
2077 echo "perl \"$relpath/bin/syncqt\" -outdir \"$outpath\" $*" >>"$outpath/bin/syncqt"
2078 chmod 755 "$outpath/bin/syncqt"
2081 # symlink the mkspecs directory
2082 mkdir -p "$outpath/mkspecs"
2083 rm -f "$outpath"/mkspecs/*
2084 ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
2085 rm -f "$outpath/mkspecs/default"
2087 # symlink the doc directory
2088 rm -rf "$outpath/doc"
2089 ln -s "$relpath/doc" "$outpath/doc"
2091 # make sure q3porting.xml can be found
2092 mkdir -p "$outpath/tools/porting/src"
2093 rm -f "$outpath/tools/porting/src/q3porting.xml"
2094 ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src"
2097 # symlink files from src/gui/embedded neccessary to build qvfb
2098 if [ "$CFG_DEV" = "yes" ]; then
2099 for f in qvfbhdr.h qlock_p.h qlock.cpp qwssignalhandler_p.h qwssignalhandler.cpp; do
2100 dest="${relpath}/tools/qvfb/${f}"
2101 rm -f "$dest"
2102 ln -s "${relpath}/src/gui/embedded/${f}" "${dest}"
2103 done
2106 # symlink fonts to be able to run application from build directory
2107 if [ "$PLATFORM_QWS" = "yes" ] && [ ! -e "${outpath}/lib/fonts" ]; then
2108 if [ "$PLATFORM" = "$XPLATFORM" ]; then
2109 mkdir -p "${outpath}/lib"
2110 ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
2114 if [ "$OPT_FAST" = "auto" ]; then
2115 if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then
2116 OPT_FAST=yes
2117 else
2118 OPT_FAST=no
2122 # find a make command
2123 if [ -z "$MAKE" ]; then
2124 MAKE=
2125 for mk in gmake make; do
2126 if "$WHICH" $mk >/dev/null 2>&1; then
2127 MAKE=`$WHICH $mk`
2128 break
2130 done
2131 if [ -z "$MAKE" ]; then
2132 echo >&2 "You don't seem to have 'make' or 'gmake' in your PATH."
2133 echo >&2 "Cannot proceed."
2134 exit 1
2138 fi ### help
2140 #-------------------------------------------------------------------------------
2141 # auto-detect all that hasn't been specified in the arguments
2142 #-------------------------------------------------------------------------------
2144 [ "$PLATFORM_QWS" = "yes" -a "$CFG_EMBEDDED" = "no" ] && CFG_EMBEDDED=auto
2145 if [ "$CFG_EMBEDDED" != "no" ]; then
2146 case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2147 Darwin:*)
2148 [ -z "$PLATFORM" ] && PLATFORM=qws/macx-generic-g++
2149 if [ -z "$XPLATFORM" ]; then
2150 [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2151 XPLATFORM="qws/macx-$CFG_EMBEDDED-g++"
2154 FreeBSD:*)
2155 [ -z "$PLATFORM" ] && PLATFORM=qws/freebsd-generic-g++
2156 if [ -z "$XPLATFORM" ]; then
2157 [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2158 XPLATFORM="qws/freebsd-$CFG_EMBEDDED-g++"
2161 SunOS:5*)
2162 [ -z "$PLATFORM" ] && PLATFORM=qws/solaris-generic-g++
2163 if [ -z "$XPLATFORM" ]; then
2164 [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2165 XPLATFORM="qws/solaris-$CFG_EMBEDDED-g++"
2168 Linux:*)
2169 if [ -z "$PLATFORM" ]; then
2170 case "$UNAME_MACHINE" in
2171 *86)
2172 PLATFORM=qws/linux-x86-g++
2174 *86_64)
2175 PLATFORM=qws/linux-x86_64-g++
2177 *ppc)
2178 PLATFORM=qws/linux-ppc-g++
2181 PLATFORM=qws/linux-generic-g++
2183 esac
2185 if [ -z "$XPLATFORM" ]; then
2186 if [ "$CFG_EMBEDDED" = "auto" ]; then
2187 if [ -n "$CFG_ARCH" ]; then
2188 CFG_EMBEDDED=$CFG_ARCH
2189 else
2190 case "$UNAME_MACHINE" in
2191 *86)
2192 CFG_EMBEDDED=x86
2194 *86_64)
2195 CFG_EMBEDDED=x86_64
2197 *ppc)
2198 CFG_EMBEDDED=ppc
2201 CFG_EMBEDDED=generic
2203 esac
2206 XPLATFORM="qws/linux-$CFG_EMBEDDED-g++"
2209 CYGWIN*:*)
2210 CFG_EMBEDDED=x86
2213 echo "Qt for Embedded Linux is not supported on this platform. Disabling."
2214 CFG_EMBEDDED=no
2215 PLATFORM_QWS=no
2217 esac
2219 if [ -z "$PLATFORM" ]; then
2220 PLATFORM_NOTES=
2221 case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2222 Darwin:*)
2223 if [ "$PLATFORM_MAC" = "yes" ]; then
2224 PLATFORM=macx-g++
2225 # PLATFORM=macx-xcode
2226 else
2227 PLATFORM=darwin-g++
2230 AIX:*)
2231 #PLATFORM=aix-g++
2232 #PLATFORM=aix-g++-64
2233 PLATFORM=aix-xlc
2234 #PLATFORM=aix-xlc-64
2235 PLATFORM_NOTES="
2236 - Also available for AIX: aix-g++ aix-g++-64 aix-xlc-64
2239 GNU:*)
2240 PLATFORM=hurd-g++
2242 dgux:*)
2243 PLATFORM=dgux-g++
2245 # DYNIX/ptx:4*)
2246 # PLATFORM=dynix-g++
2247 # ;;
2248 ULTRIX:*)
2249 PLATFORM=ultrix-g++
2251 FreeBSD:*)
2252 PLATFORM=freebsd-g++
2253 PLATFORM_NOTES="
2254 - Also available for FreeBSD: freebsd-icc
2257 OpenBSD:*)
2258 PLATFORM=openbsd-g++
2260 NetBSD:*)
2261 PLATFORM=netbsd-g++
2263 BSD/OS:*|BSD/386:*)
2264 PLATFORM=bsdi-g++
2266 IRIX*:*)
2267 #PLATFORM=irix-g++
2268 PLATFORM=irix-cc
2269 #PLATFORM=irix-cc-64
2270 PLATFORM_NOTES="
2271 - Also available for IRIX: irix-g++ irix-cc-64
2274 HP-UX:*)
2275 case "$UNAME_MACHINE" in
2276 ia64)
2277 #PLATFORM=hpuxi-acc-32
2278 PLATFORM=hpuxi-acc-64
2279 PLATFORM_NOTES="
2280 - Also available for HP-UXi: hpuxi-acc-32
2284 #PLATFORM=hpux-g++
2285 PLATFORM=hpux-acc
2286 #PLATFORM=hpux-acc-64
2287 #PLATFORM=hpux-cc
2288 #PLATFORM=hpux-acc-o64
2289 PLATFORM_NOTES="
2290 - Also available for HP-UX: hpux-g++ hpux-acc-64 hpux-acc-o64
2293 esac
2295 OSF1:*)
2296 #PLATFORM=tru64-g++
2297 PLATFORM=tru64-cxx
2298 PLATFORM_NOTES="
2299 - Also available for Tru64: tru64-g++
2302 Linux:*)
2303 case "$UNAME_MACHINE" in
2304 x86_64|s390x|ppc64)
2305 PLATFORM=linux-g++-64
2308 PLATFORM=linux-g++
2310 esac
2311 PLATFORM_NOTES="
2312 - Also available for Linux: linux-kcc linux-icc linux-cxx
2315 SunOS:5*)
2316 #PLATFORM=solaris-g++
2317 PLATFORM=solaris-cc
2318 #PLATFORM=solaris-cc64
2319 PLATFORM_NOTES="
2320 - Also available for Solaris: solaris-g++ solaris-cc-64
2323 ReliantUNIX-*:*|SINIX-*:*)
2324 PLATFORM=reliant-cds
2325 #PLATFORM=reliant-cds-64
2326 PLATFORM_NOTES="
2327 - Also available for Reliant UNIX: reliant-cds-64
2330 CYGWIN*:*)
2331 PLATFORM=cygwin-g++
2333 LynxOS*:*)
2334 PLATFORM=lynxos-g++
2336 OpenUNIX:*)
2337 #PLATFORM=unixware-g++
2338 PLATFORM=unixware-cc
2339 PLATFORM_NOTES="
2340 - Also available for OpenUNIX: unixware-g++
2343 UnixWare:*)
2344 #PLATFORM=unixware-g++
2345 PLATFORM=unixware-cc
2346 PLATFORM_NOTES="
2347 - Also available for UnixWare: unixware-g++
2350 SCO_SV:*)
2351 #PLATFORM=sco-g++
2352 PLATFORM=sco-cc
2353 PLATFORM_NOTES="
2354 - Also available for SCO OpenServer: sco-g++
2357 UNIX_SV:*)
2358 PLATFORM=unixware-g++
2361 if [ "$OPT_HELP" != "yes" ]; then
2362 echo
2363 for p in $PLATFORMS; do
2364 echo " $relconf $* -platform $p"
2365 done
2366 echo >&2
2367 echo " The build script does not currently recognize all" >&2
2368 echo " platforms supported by Qt." >&2
2369 echo " Rerun this script with a -platform option listed to" >&2
2370 echo " set the system/compiler combination you use." >&2
2371 echo >&2
2372 exit 2
2374 esac
2377 if [ "$PLATFORM_QWS" = "yes" ]; then
2378 CFG_SM=no
2379 PLATFORMS=`find "$relpath/mkspecs/qws" | sed "s,$relpath/mkspecs/qws/,,"`
2380 else
2381 PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mkspecs/qws/,,"`
2384 [ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
2385 if [ -d "$PLATFORM" ]; then
2386 QMAKESPEC="$PLATFORM"
2387 else
2388 QMAKESPEC="$relpath/mkspecs/${PLATFORM}"
2390 if [ -d "$XPLATFORM" ]; then
2391 XQMAKESPEC="$XPLATFORM"
2392 else
2393 XQMAKESPEC="$relpath/mkspecs/${XPLATFORM}"
2395 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2396 QT_CROSS_COMPILE=yes
2397 QMAKE_CONFIG="$QMAKE_CONFIG cross_compile"
2400 if [ "$PLATFORM_MAC" = "yes" ]; then
2401 if [ `basename $QMAKESPEC` = "macx-xcode" ] || [ `basename $XQMAKESPEC` = "macx-xcode" ]; then
2402 echo >&2
2403 echo " Platform 'macx-xcode' should not be used when building Qt/Mac." >&2
2404 echo " Please build Qt/Mac with 'macx-g++', then if you would like to" >&2
2405 echo " use mac-xcode on your application code it can link to a Qt/Mac" >&2
2406 echo " built with 'macx-g++'" >&2
2407 echo >&2
2408 exit 2
2412 # check specified platforms are supported
2413 if [ '!' -d "$QMAKESPEC" ]; then
2414 echo
2415 echo " The specified system/compiler is not supported:"
2416 echo
2417 echo " $QMAKESPEC"
2418 echo
2419 echo " Please see the README file for a complete list."
2420 echo
2421 exit 2
2423 if [ '!' -d "$XQMAKESPEC" ]; then
2424 echo
2425 echo " The specified system/compiler is not supported:"
2426 echo
2427 echo " $XQMAKESPEC"
2428 echo
2429 echo " Please see the README file for a complete list."
2430 echo
2431 exit 2
2433 if [ '!' -f "${XQMAKESPEC}/qplatformdefs.h" ]; then
2434 echo
2435 echo " The specified system/compiler port is not complete:"
2436 echo
2437 echo " $XQMAKESPEC/qplatformdefs.h"
2438 echo
2439 echo " Please contact qt-bugs@trolltech.com."
2440 echo
2441 exit 2
2444 # now look at the configs and figure out what platform we are config'd for
2445 [ "$CFG_EMBEDDED" = "no" ] \
2446 && [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ] \
2447 && PLATFORM_X11=yes
2448 ### echo "$XQMAKESPEC" | grep mkspecs/qws >/dev/null 2>&1 && PLATFORM_QWS=yes
2450 if [ "$UNAME_SYSTEM" = "SunOS" ]; then
2451 # Solaris 2.5 and 2.6 have libposix4, which was renamed to librt for Solaris 7 and up
2452 if echo $UNAME_RELEASE | grep "^5\.[5|6]" >/dev/null 2>&1; then
2453 sed -e "s,-lrt,-lposix4," "$XQMAKESPEC/qmake.conf" > "$XQMAKESPEC/qmake.conf.new"
2454 mv "$XQMAKESPEC/qmake.conf.new" "$XQMAKESPEC/qmake.conf"
2458 #-------------------------------------------------------------------------------
2459 # determine the system architecture
2460 #-------------------------------------------------------------------------------
2461 if [ "$OPT_VERBOSE" = "yes" ]; then
2462 echo "Determining system architecture... ($UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE)"
2465 if [ "$CFG_EMBEDDED" != "no" -a "$CFG_EMBEDDED" != "auto" ] && [ -n "$CFG_ARCH" ]; then
2466 if [ "$CFG_ARCH" != "$CFG_EMBEDDED" ]; then
2467 echo ""
2468 echo "You have specified a target architecture with -embedded and -arch."
2469 echo "The two architectures you have specified are different, so we can"
2470 echo "not proceed. Either set both to be the same, or only use -embedded."
2471 echo ""
2472 exit 1
2476 if [ -z "${CFG_HOST_ARCH}" ]; then
2477 case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in
2478 IRIX*:*:*)
2479 CFG_HOST_ARCH=`uname -p`
2480 if [ "$OPT_VERBOSE" = "yes" ]; then
2481 echo " SGI ($CFG_HOST_ARCH)"
2484 SunOS:5*:*)
2485 case "$UNAME_MACHINE" in
2486 sun4u*|sun4v*)
2487 if [ "$OPT_VERBOSE" = "yes" ]; then
2488 echo " Sun SPARC (sparc)"
2490 CFG_HOST_ARCH=sparc
2492 i86pc)
2493 case "$PLATFORM" in
2494 *-64)
2495 if [ "$OPT_VERBOSE" = "yes" ]; then
2496 echo " 64-bit AMD 80x86 (x86_64)"
2498 CFG_HOST_ARCH=x86_64
2501 if [ "$OPT_VERBOSE" = "yes" ]; then
2502 echo " 32-bit Intel 80x86 (i386)"
2504 CFG_HOST_ARCH=i386
2506 esac
2507 esac
2509 Darwin:*:*)
2510 case "$UNAME_MACHINE" in
2511 Power?Macintosh)
2512 if [ "$OPT_VERBOSE" = "yes" ]; then
2513 echo " 32-bit Apple PowerPC (powerpc)"
2516 x86)
2517 if [ "$OPT_VERBOSE" = "yes" ]; then
2518 echo " 32-bit Intel 80x86 (i386)"
2521 esac
2522 CFG_HOST_ARCH=macosx
2524 AIX:*:00????????00)
2525 if [ "$OPT_VERBOSE" = "yes" ]; then
2526 echo " 64-bit IBM PowerPC (powerpc)"
2528 CFG_HOST_ARCH=powerpc
2530 HP-UX:*:9000*)
2531 if [ "$OPT_VERBOSE" = "yes" ]; then
2532 echo " HP PA-RISC (parisc)"
2534 CFG_HOST_ARCH=parisc
2536 *:*:i?86)
2537 if [ "$OPT_VERBOSE" = "yes" ]; then
2538 echo " 32-bit Intel 80x86 (i386)"
2540 CFG_HOST_ARCH=i386
2542 *:*:x86_64|*:*:amd64)
2543 if [ "$PLATFORM" = "linux-g++-32" -o "$PLATFORM" = "linux-icc-32" ]; then
2544 if [ "$OPT_VERBOSE" = "yes" ]; then
2545 echo " 32 bit on 64-bit AMD 80x86 (i386)"
2547 CFG_HOST_ARCH=i386
2548 else
2549 if [ "$OPT_VERBOSE" = "yes" ]; then
2550 echo " 64-bit AMD 80x86 (x86_64)"
2552 CFG_HOST_ARCH=x86_64
2555 *:*:ppc)
2556 if [ "$OPT_VERBOSE" = "yes" ]; then
2557 echo " 32-bit PowerPC (powerpc)"
2559 CFG_HOST_ARCH=powerpc
2561 *:*:ppc64)
2562 if [ "$OPT_VERBOSE" = "yes" ]; then
2563 echo " 64-bit PowerPC (powerpc)"
2565 CFG_HOST_ARCH=powerpc
2567 *:*:s390*)
2568 if [ "$OPT_VERBOSE" = "yes" ]; then
2569 echo " IBM S/390 (s390)"
2571 CFG_HOST_ARCH=s390
2573 *:*:arm*)
2574 if [ "$OPT_VERBOSE" = "yes" ]; then
2575 echo " ARM (arm)"
2577 CFG_HOST_ARCH=arm
2579 Linux:*:sparc*)
2580 if [ "$OPT_VERBOSE" = "yes" ]; then
2581 echo " Linux on SPARC"
2583 CFG_HOST_ARCH=sparc
2585 *:*:*)
2586 if [ "$OPT_VERBOSE" = "yes" ]; then
2587 echo " Trying '$UNAME_MACHINE'..."
2589 CFG_HOST_ARCH="$UNAME_MACHINE"
2591 esac
2594 if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
2595 if [ -n "$CFG_ARCH" ]; then
2596 CFG_EMBEDDED=$CFG_ARCH
2599 case "$CFG_EMBEDDED" in
2600 x86)
2601 CFG_ARCH=i386
2603 x86_64)
2604 CFG_ARCH=x86_64
2606 ipaq|sharp)
2607 CFG_ARCH=arm
2609 dm7000)
2610 CFG_ARCH=powerpc
2612 dm800)
2613 CFG_ARCH=mips
2615 sh4al)
2616 CFG_ARCH=sh4a
2619 CFG_ARCH="$CFG_EMBEDDED"
2621 esac
2622 elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
2623 CFG_ARCH=$CFG_HOST_ARCH
2626 if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then
2627 if [ "$OPT_VERBOSE" = "yes" ]; then
2628 echo " '$CFG_ARCH' is supported"
2630 else
2631 if [ "$OPT_VERBOSE" = "yes" ]; then
2632 echo " '$CFG_ARCH' is unsupported, using 'generic'"
2634 CFG_ARCH=generic
2636 if [ "$CFG_HOST_ARCH" != "$CFG_ARCH" ]; then
2637 if [ -d "$relpath/src/corelib/arch/$CFG_HOST_ARCH" ]; then
2638 if [ "$OPT_VERBOSE" = "yes" ]; then
2639 echo " '$CFG_HOST_ARCH' is supported"
2641 else
2642 if [ "$OPT_VERBOSE" = "yes" ]; then
2643 echo " '$CFG_HOST_ARCH' is unsupported, using 'generic'"
2645 CFG_HOST_ARCH=generic
2649 if [ "$OPT_VERBOSE" = "yes" ]; then
2650 echo "System architecture: '$CFG_ARCH'"
2651 if [ "$PLATFORM_QWS" = "yes" ]; then
2652 echo "Host architecture: '$CFG_HOST_ARCH'"
2656 #-------------------------------------------------------------------------------
2657 # tests that don't need qmake (must be run before displaying help)
2658 #-------------------------------------------------------------------------------
2660 if [ -z "$PKG_CONFIG" ]; then
2661 # See if PKG_CONFIG is set in the mkspec:
2662 PKG_CONFIG=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%PKG_CONFIG[^_].*=%%p' | tr '\n' ' '`
2664 if [ -z "$PKG_CONFIG" ]; then
2665 PKG_CONFIG=`$WHICH pkg-config 2>/dev/null`
2668 # Work out if we can use pkg-config
2669 if [ "$QT_CROSS_COMPILE" = "yes" ]; then
2670 if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then
2671 echo >&2 ""
2672 echo >&2 "You have asked to use pkg-config and are cross-compiling."
2673 echo >&2 "Please make sure you have a correctly set-up pkg-config"
2674 echo >&2 "environment!"
2675 echo >&2 ""
2676 if [ -z "$PKG_CONFIG_PATH" ]; then
2677 echo >&2 ""
2678 echo >&2 "Warning: PKG_CONFIG_PATH has not been set. This could mean"
2679 echo >&2 "the host compiler's .pc files will be used. This is probably"
2680 echo >&2 "not what you want."
2681 echo >&2 ""
2682 elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
2683 echo >&2 ""
2684 echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not"
2685 echo >&2 "been set. This means your toolchain's .pc files must contain"
2686 echo >&2 "the paths to the toolchain's libraries & headers. If configure"
2687 echo >&2 "tests are failing, please check these files."
2688 echo >&2 ""
2690 else
2691 PKG_CONFIG=""
2695 # check -arch arguments for validity.
2696 if [ "$PLATFORM_MAC" = "yes" ]; then
2697 ALLOWED="x86 ppc x86_64 ppc64"
2698 for i in $CFG_MAC_ARCHS
2700 if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then
2701 echo "Unknown architecture: \"$i\". Supported architechtures: x86 ppc x86_64 ppc64";
2702 exit 2;
2704 done
2707 # find the default framework value
2708 if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
2709 if [ "$CFG_FRAMEWORK" = "auto" ]; then
2710 CFG_FRAMEWORK="$CFG_SHARED"
2711 elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
2712 echo
2713 echo "WARNING: Using static linking will disable the use of Mac frameworks."
2714 echo
2715 CFG_FRAMEWORK="no"
2717 else
2718 CFG_FRAMEWORK=no
2721 QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
2722 TEST_COMPILER="$CC"
2723 [ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
2725 # auto-detect precompiled header support
2726 if [ "$CFG_PRECOMPILE" = "auto" ]; then
2727 if [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
2728 CFG_PRECOMPILE=no
2729 elif "$unixtests/precomp.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2730 CFG_PRECOMPILE=no
2731 else
2732 CFG_PRECOMPILE=yes
2734 elif [ "$CFG_PRECOMPILE" = "yes" ] && [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
2735 echo
2736 echo "WARNING: Using universal binaries disables precompiled headers."
2737 echo
2738 CFG_PRECOMPILE=no
2741 #auto-detect DWARF2 on the mac
2742 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" == "auto" ]; then
2743 if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
2744 CFG_MAC_DWARF2=no
2745 else
2746 CFG_MAC_DWARF2=yes
2750 # auto-detect support for -Xarch on the mac
2751 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" == "auto" ]; then
2752 if "$mactests/xarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
2753 CFG_MAC_XARCH=no
2754 else
2755 CFG_MAC_XARCH=yes
2759 # don't autodetect support for separate debug info on objcopy when
2760 # cross-compiling as lots of toolchains seems to have problems with this
2761 if [ "$QT_CROSS_COMPILE" = "yes" ] && [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
2762 CFG_SEPARATE_DEBUG_INFO="no"
2765 # auto-detect support for separate debug info in objcopy
2766 if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
2767 TEST_COMPILER_CFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CFLAGS[^_].*=%%p' | tr '\n' ' '`
2768 TEST_COMPILER_CXXFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CXXFLAGS[^_].*=%%p' | tr '\n' ' '`
2769 TEST_OBJCOPY=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_OBJCOPY" | sed "s%.* *= *\(.*\)$%\1%" | tail -1`
2770 COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
2771 COMPILER_WITH_FLAGS=`echo "$COMPILER_WITH_FLAGS" | sed -e "s%\\$\\$QMAKE_CFLAGS%$TEST_COMPILER_CFLAGS%g"`
2772 if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$TEST_OBJCOPY" "$OPT_VERBOSE"; then
2773 CFG_SEPARATE_DEBUG_INFO=no
2774 else
2775 case "$PLATFORM" in
2776 hpux-*)
2777 # binutils on HP-UX is buggy; default to no.
2778 CFG_SEPARATE_DEBUG_INFO=no
2781 CFG_SEPARATE_DEBUG_INFO=yes
2783 esac
2787 # auto-detect -fvisibility support
2788 if [ "$CFG_REDUCE_EXPORTS" = "auto" ]; then
2789 if "$unixtests/fvisibility.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2790 CFG_REDUCE_EXPORTS=no
2791 else
2792 CFG_REDUCE_EXPORTS=yes
2796 # detect the availability of the -Bsymbolic-functions linker optimization
2797 if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then
2798 if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2799 CFG_REDUCE_RELOCATIONS=no
2800 else
2801 CFG_REDUCE_RELOCATIONS=yes
2805 # auto-detect GNU make support
2806 if [ "$CFG_USE_GNUMAKE" = "auto" ] && "$MAKE" -v | grep "GNU Make" >/dev/null 2>&1; then
2807 CFG_USE_GNUMAKE=yes
2810 # If -opengl wasn't specified, don't try to auto-detect
2811 if [ "$PLATFORM_QWS" = "yes" ] && [ "$CFG_OPENGL" = "auto" ]; then
2812 CFG_OPENGL=no
2815 # mac
2816 if [ "$PLATFORM_MAC" = "yes" ]; then
2817 if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
2818 CFG_OPENGL=desktop
2822 # find the default framework value
2823 if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
2824 if [ "$CFG_FRAMEWORK" = "auto" ]; then
2825 CFG_FRAMEWORK="$CFG_SHARED"
2826 elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
2827 echo
2828 echo "WARNING: Using static linking will disable the use of Mac frameworks."
2829 echo
2830 CFG_FRAMEWORK="no"
2832 else
2833 CFG_FRAMEWORK=no
2836 # x11 tests are done after qmake is built
2839 #setup the build parts
2840 if [ -z "$CFG_BUILD_PARTS" ]; then
2841 CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
2843 # don't build tools by default when cross-compiling
2844 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2845 CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, tools,,g"`
2848 for nobuild in $CFG_NOBUILD_PARTS; do
2849 CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, $nobuild,,g"`
2850 done
2851 if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then
2852 # echo
2853 # echo "WARNING: libs is a required part of the build."
2854 # echo
2855 CFG_BUILD_PARTS="$CFG_BUILD_PARTS libs"
2858 #-------------------------------------------------------------------------------
2859 # post process QT_INSTALL_* variables
2860 #-------------------------------------------------------------------------------
2862 #prefix
2863 if [ -z "$QT_INSTALL_PREFIX" ]; then
2864 if [ "$CFG_DEV" = "yes" ]; then
2865 QT_INSTALL_PREFIX="$outpath" # At Trolltech, we use sandboxed builds by default
2866 elif [ "$PLATFORM_QWS" = "yes" ]; then
2867 QT_INSTALL_PREFIX="/usr/local/Trolltech/QtEmbedded-${QT_VERSION}"
2868 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2869 QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}"
2871 else
2872 QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION
2875 QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
2877 #docs
2878 if [ -z "$QT_INSTALL_DOCS" ]; then #default
2879 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2880 if [ "$PLATFORM_MAC" = "yes" ]; then
2881 QT_INSTALL_DOCS="/Developer/Documentation/Qt"
2884 [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
2887 QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
2889 #headers
2890 if [ -z "$QT_INSTALL_HEADERS" ]; then #default
2891 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2892 if [ "$PLATFORM_MAC" = "yes" ]; then
2893 if [ "$CFG_FRAMEWORK" = "yes" ]; then
2894 QT_INSTALL_HEADERS=
2898 [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
2901 QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"`
2903 #libs
2904 if [ -z "$QT_INSTALL_LIBS" ]; then #default
2905 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2906 if [ "$PLATFORM_MAC" = "yes" ]; then
2907 if [ "$CFG_FRAMEWORK" = "yes" ]; then
2908 QT_INSTALL_LIBS="/Libraries/Frameworks"
2912 [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback
2914 QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
2916 #bins
2917 if [ -z "$QT_INSTALL_BINS" ]; then #default
2918 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2919 if [ "$PLATFORM_MAC" = "yes" ]; then
2920 QT_INSTALL_BINS="/Developer/Applications/Qt"
2923 [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
2926 QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
2928 #plugins
2929 if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
2930 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2931 if [ "$PLATFORM_MAC" = "yes" ]; then
2932 QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins"
2935 [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
2937 QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
2939 #data
2940 if [ -z "$QT_INSTALL_DATA" ]; then #default
2941 QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
2943 QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
2945 #translations
2946 if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
2947 QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
2949 QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
2951 #settings
2952 if [ -z "$QT_INSTALL_SETTINGS" ]; then #default
2953 if [ "$PLATFORM_MAC" = "yes" ]; then
2954 QT_INSTALL_SETTINGS=/Library/Preferences/Qt
2955 else
2956 QT_INSTALL_SETTINGS=/etc/xdg
2959 QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"`
2961 #examples
2962 if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default
2963 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2964 if [ "$PLATFORM_MAC" = "yes" ]; then
2965 QT_INSTALL_EXAMPLES="/Developer/Examples/Qt"
2968 [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback
2970 QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"`
2972 #demos
2973 if [ -z "$QT_INSTALL_DEMOS" ]; then #default
2974 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2975 if [ "$PLATFORM_MAC" = "yes" ]; then
2976 QT_INSTALL_DEMOS="/Developer/Examples/Qt/Demos"
2979 [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos"
2981 QT_INSTALL_DEMOS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DEMOS"`
2983 #-------------------------------------------------------------------------------
2984 # help - interactive parts of the script _after_ this section please
2985 #-------------------------------------------------------------------------------
2987 # next, emit a usage message if something failed.
2988 if [ "$OPT_HELP" = "yes" ]; then
2989 [ "x$ERROR" = "xyes" ] && echo
2990 if [ "$CFG_NIS" = "no" ]; then
2991 NSY=" "
2992 NSN="*"
2993 else
2994 NSY="*"
2995 NSN=" "
2997 if [ "$CFG_CUPS" = "no" ]; then
2998 CUY=" "
2999 CUN="*"
3000 else
3001 CUY="*"
3002 CUN=" "
3004 if [ "$CFG_ICONV" = "no" ]; then
3005 CIY=" "
3006 CIN="*"
3007 else
3008 CIY="*"
3009 CIN=" "
3011 if [ "$CFG_LARGEFILE" = "no" ]; then
3012 LFSY=" "
3013 LFSN="*"
3014 else
3015 LFSY="*"
3016 LFSN=" "
3018 if [ "$CFG_STL" = "auto" ] || [ "$CFG_STL" = "yes" ]; then
3019 SHY="*"
3020 SHN=" "
3021 else
3022 SHY=" "
3023 SHN="*"
3025 if [ "$CFG_IPV6" = "auto" ]; then
3026 I6Y="*"
3027 I6N=" "
3029 if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then
3030 PHY=" "
3031 PHN="*"
3032 else
3033 PHY="*"
3034 PHN=" "
3037 cat <<EOF
3038 Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
3039 [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-datadir <dir>]
3040 [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>]
3041 [-demosdir <dir>] [-buildkey <key>] [-release] [-debug]
3042 [-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
3043 [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]
3044 [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>]
3045 [-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support] [-qt3support]
3046 [-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
3047 [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff]
3048 [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng]
3049 [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>]
3050 [-no-make <part>] [-R <string>] [-l <string>] [-no-rpath] [-rpath] [-continue]
3051 [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
3052 [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked]
3053 [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]
3054 [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info] [-armfpa]
3055 [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns]
3056 [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend]
3057 [-no-openssl] [-openssl] [-openssl-linked]
3058 [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit]
3059 [-no-scripttools] [-scripttools]
3061 [additional platform specific options (see below)]
3064 Installation options:
3066 These are optional, but you may specify install directories.
3068 -prefix <dir> ...... This will install everything relative to <dir>
3069 (default $QT_INSTALL_PREFIX)
3071 if [ "$PLATFORM_QWS" = "yes" ]; then
3072 cat <<EOF
3074 -hostprefix [dir] .. Tools and libraries needed when developing
3075 applications are installed in [dir]. If [dir] is
3076 not given, the current build directory will be used.
3079 cat <<EOF
3081 * -prefix-install .... Force a sandboxed "local" installation of
3082 Qt. This will install into
3083 $QT_INSTALL_PREFIX, if this option is
3084 disabled then some platforms will attempt a
3085 "system" install by placing default values to
3086 be placed in a system location other than
3087 PREFIX.
3089 You may use these to separate different parts of the install:
3091 -bindir <dir> ......... Executables will be installed to <dir>
3092 (default PREFIX/bin)
3093 -libdir <dir> ......... Libraries will be installed to <dir>
3094 (default PREFIX/lib)
3095 -docdir <dir> ......... Documentation will be installed to <dir>
3096 (default PREFIX/doc)
3097 -headerdir <dir> ...... Headers will be installed to <dir>
3098 (default PREFIX/include)
3099 -plugindir <dir> ...... Plugins will be installed to <dir>
3100 (default PREFIX/plugins)
3101 -datadir <dir> ........ Data used by Qt programs will be installed to <dir>
3102 (default PREFIX)
3103 -translationdir <dir> . Translations of Qt programs will be installed to <dir>
3104 (default PREFIX/translations)
3105 -sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>
3106 (default PREFIX/etc/settings)
3107 -examplesdir <dir> .... Examples will be installed to <dir>
3108 (default PREFIX/examples)
3109 -demosdir <dir> ....... Demos will be installed to <dir>
3110 (default PREFIX/demos)
3112 You may use these options to turn on strict plugin loading.
3114 -buildkey <key> .... Build the Qt library and plugins using the specified
3115 <key>. When the library loads plugins, it will only
3116 load those that have a matching key.
3118 Configure options:
3120 The defaults (*) are usually acceptable. A plus (+) denotes a default value
3121 that needs to be evaluated. If the evaluation succeeds, the feature is
3122 included. Here is a short explanation of each option:
3124 * -release ........... Compile and link Qt with debugging turned off.
3125 -debug ............. Compile and link Qt with debugging turned on.
3126 -debug-and-release . Compile and link two versions of Qt, with and without
3127 debugging turned on (Mac only).
3129 -developer-build.... Compile and link Qt with Qt developer options (including auto-tests exporting)
3131 -opensource......... Compile and link the Open-Source Edition of Qt.
3132 -commercial......... Compile and link the Commercial Edition of Qt.
3135 * -shared ............ Create and use shared Qt libraries.
3136 -static ............ Create and use static Qt libraries.
3138 * -no-fast ........... Configure Qt normally by generating Makefiles for all
3139 project files.
3140 -fast .............. Configure Qt quickly by generating Makefiles only for
3141 library and subdirectory targets. All other Makefiles
3142 are created as wrappers, which will in turn run qmake.
3144 -no-largefile ...... Disables large file support.
3145 + -largefile ......... Enables Qt to access files larger than 4 GB.
3148 if [ "$PLATFORM_QWS" = "yes" ]; then
3149 EXCN="*"
3150 EXCY=" "
3151 else
3152 EXCN=" "
3153 EXCY="*"
3155 if [ "$CFG_DBUS" = "no" ]; then
3156 DBY=" "
3157 DBN="+"
3158 else
3159 DBY="+"
3160 DBN=" "
3163 cat << EOF
3164 $EXCN -no-exceptions ..... Disable exceptions on compilers that support it.
3165 $EXCY -exceptions ........ Enable exceptions on compilers that support it.
3167 -no-accessibility .. Do not compile Accessibility support.
3168 * -accessibility ..... Compile Accessibility support.
3170 $SHN -no-stl ............ Do not compile STL support.
3171 $SHY -stl ............... Compile STL support.
3173 -no-sql-<driver> ... Disable SQL <driver> entirely.
3174 -qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default
3175 none are turned on.
3176 -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to
3177 at run time.
3179 Possible values for <driver>:
3180 [ $CFG_SQL_AVAILABLE ]
3182 -system-sqlite ..... Use sqlite from the operating system.
3184 -no-qt3support ..... Disables the Qt 3 support functionality.
3185 * -qt3support ........ Enables the Qt 3 support functionality.
3187 -no-xmlpatterns .... Do not build the QtXmlPatterns module.
3188 + -xmlpatterns ....... Build the QtXmlPatterns module.
3189 QtXmlPatterns is built if a decent C++ compiler
3190 is used and exceptions are enabled.
3192 -no-phonon ......... Do not build the Phonon module.
3193 + -phonon ............ Build the Phonon module.
3194 Phonon is built if a decent C++ compiler is used.
3195 -no-phonon-backend.. Do not build the platform phonon plugin.
3196 + -phonon-backend..... Build the platform phonon plugin.
3198 -no-svg ............ Do not build the SVG module.
3199 + -svg ............... Build the SVG module.
3201 -no-webkit ......... Do not build the WebKit module.
3202 + -webkit ............ Build the WebKit module.
3203 WebKit is built if a decent C++ compiler is used.
3205 -no-scripttools .... Do not build the QtScriptTools module.
3206 + -scripttools ....... Build the QtScriptTools module.
3208 -platform target ... The operating system and compiler you are building
3209 on ($PLATFORM).
3211 See the README file for a list of supported
3212 operating systems and compilers.
3214 if [ "${PLATFORM_QWS}" != "yes" ]; then
3215 cat << EOF
3216 -graphicssystem <sys> Sets an alternate graphics system. Available options are:
3217 raster - Software rasterizer
3218 opengl - Rendering via OpenGL, Experimental!
3221 cat << EOF
3223 -no-mmx ............ Do not compile with use of MMX instructions.
3224 -no-3dnow .......... Do not compile with use of 3DNOW instructions.
3225 -no-sse ............ Do not compile with use of SSE instructions.
3226 -no-sse2 ........... Do not compile with use of SSE2 instructions.
3228 -qtnamespace <name> Wraps all Qt library code in 'namespace <name> {...}'.
3229 -qtlibinfix <infix> Renames all libQt*.so to libQt*<infix>.so.
3231 -D <string> ........ Add an explicit define to the preprocessor.
3232 -I <string> ........ Add an explicit include path.
3233 -L <string> ........ Add an explicit library path.
3235 -help, -h .......... Display this information.
3237 Third Party Libraries:
3239 -qt-zlib ........... Use the zlib bundled with Qt.
3240 + -system-zlib ....... Use zlib from the operating system.
3241 See http://www.gzip.org/zlib
3243 -no-gif ............ Do not compile the plugin for GIF reading support.
3244 * -qt-gif ............ Compile the plugin for GIF reading support.
3245 See also src/plugins/imageformats/gif/qgifhandler.h
3247 -no-libtiff ........ Do not compile the plugin for TIFF support.
3248 -qt-libtiff ........ Use the libtiff bundled with Qt.
3249 + -system-libtiff .... Use libtiff from the operating system.
3250 See http://www.libtiff.org
3252 -no-libpng ......... Do not compile in PNG support.
3253 -qt-libpng ......... Use the libpng bundled with Qt.
3254 + -system-libpng ..... Use libpng from the operating system.
3255 See http://www.libpng.org/pub/png
3257 -no-libmng ......... Do not compile the plugin for MNG support.
3258 -qt-libmng ......... Use the libmng bundled with Qt.
3259 + -system-libmng ..... Use libmng from the operating system.
3260 See http://www.libmng.com
3262 -no-libjpeg ........ Do not compile the plugin for JPEG support.
3263 -qt-libjpeg ........ Use the libjpeg bundled with Qt.
3264 + -system-libjpeg .... Use libjpeg from the operating system.
3265 See http://www.ijg.org
3267 -no-openssl ........ Do not compile support for OpenSSL.
3268 + -openssl ........... Enable run-time OpenSSL support.
3269 -openssl-linked .... Enabled linked OpenSSL support.
3271 -ptmalloc .......... Override the system memory allocator with ptmalloc.
3272 (Experimental.)
3274 Additional options:
3276 -make <part> ....... Add part to the list of parts to be built at make time.
3277 ($QT_DEFAULT_BUILD_PARTS)
3278 -nomake <part> ..... Exclude part from the list of parts to be built.
3280 -R <string> ........ Add an explicit runtime library path to the Qt
3281 libraries.
3282 -l <string> ........ Add an explicit library.
3284 -no-rpath .......... Do not use the library install path as a runtime
3285 library path.
3286 + -rpath ............. Link Qt libraries and executables using the library
3287 install path as a runtime library path. Equivalent
3288 to -R install_libpath
3290 -continue .......... Continue as far as possible if an error occurs.
3292 -verbose, -v ....... Print verbose information about each step of the
3293 configure process.
3295 -silent ............ Reduce the build output so that warnings and errors
3296 can be seen more easily.
3298 * -no-optimized-qmake ... Do not build qmake optimized.
3299 -optimized-qmake ...... Build qmake optimized.
3301 $NSN -no-nis ............ Do not compile NIS support.
3302 $NSY -nis ............... Compile NIS support.
3304 $CUN -no-cups ........... Do not compile CUPS support.
3305 $CUY -cups .............. Compile CUPS support.
3306 Requires cups/cups.h and libcups.so.2.
3308 $CIN -no-iconv .......... Do not compile support for iconv(3).
3309 $CIY -iconv ............. Compile support for iconv(3).
3311 $PHN -no-pch ............ Do not use precompiled header support.
3312 $PHY -pch ............... Use precompiled header support.
3314 $DBN -no-dbus ........... Do not compile the QtDBus module.
3315 $DBY -dbus .............. Compile the QtDBus module and dynamically load libdbus-1.
3316 -dbus-linked ....... Compile the QtDBus module and link to libdbus-1.
3318 -reduce-relocations ..... Reduce relocations in the libraries through extra
3319 linker optimizations (Qt/X11 and Qt for Embedded Linux only;
3320 experimental; needs GNU ld >= 2.18).
3323 if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
3324 if [ "$QT_CROSS_COMPILE" = "yes" ]; then
3325 SBY=""
3326 SBN="*"
3327 else
3328 SBY="*"
3329 SBN=" "
3331 elif [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
3332 SBY="*"
3333 SBN=" "
3334 else
3335 SBY=" "
3336 SBN="*"
3339 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
3341 cat << EOF
3343 $SBN -no-separate-debug-info . Do not store debug information in a separate file.
3344 $SBY -separate-debug-info .... Strip debug information into a separate .debug file.
3348 fi # X11/QWS
3350 if [ "$PLATFORM_X11" = "yes" ]; then
3351 if [ "$CFG_SM" = "no" ]; then
3352 SMY=" "
3353 SMN="*"
3354 else
3355 SMY="*"
3356 SMN=" "
3358 if [ "$CFG_XSHAPE" = "no" ]; then
3359 SHY=" "
3360 SHN="*"
3361 else
3362 SHY="*"
3363 SHN=" "
3365 if [ "$CFG_XINERAMA" = "no" ]; then
3366 XAY=" "
3367 XAN="*"
3368 else
3369 XAY="*"
3370 XAN=" "
3372 if [ "$CFG_FONTCONFIG" = "no" ]; then
3373 FCGY=" "
3374 FCGN="*"
3375 else
3376 FCGY="*"
3377 FCGN=" "
3379 if [ "$CFG_XCURSOR" = "no" ]; then
3380 XCY=" "
3381 XCN="*"
3382 else
3383 XCY="*"
3384 XCN=" "
3386 if [ "$CFG_XFIXES" = "no" ]; then
3387 XFY=" "
3388 XFN="*"
3389 else
3390 XFY="*"
3391 XFN=" "
3393 if [ "$CFG_XRANDR" = "no" ]; then
3394 XZY=" "
3395 XZN="*"
3396 else
3397 XZY="*"
3398 XZN=" "
3400 if [ "$CFG_XRENDER" = "no" ]; then
3401 XRY=" "
3402 XRN="*"
3403 else
3404 XRY="*"
3405 XRN=" "
3407 if [ "$CFG_MITSHM" = "no" ]; then
3408 XMY=" "
3409 XMN="*"
3410 else
3411 XMY="*"
3412 XMN=" "
3414 if [ "$CFG_XINPUT" = "no" ]; then
3415 XIY=" "
3416 XIN="*"
3417 else
3418 XIY="*"
3419 XIN=" "
3421 if [ "$CFG_XKB" = "no" ]; then
3422 XKY=" "
3423 XKN="*"
3424 else
3425 XKY="*"
3426 XKN=" "
3428 if [ "$CFG_IM" = "no" ]; then
3429 IMY=" "
3430 IMN="*"
3431 else
3432 IMY="*"
3433 IMN=" "
3435 cat << EOF
3437 Qt/X11 only:
3439 -no-gtkstyle ....... Do not build the GTK theme integration.
3440 + -gtkstyle .......... Build the GTK theme integration.
3442 * -no-nas-sound ...... Do not compile in NAS sound support.
3443 -system-nas-sound .. Use NAS libaudio from the operating system.
3444 See http://radscan.com/nas.html
3446 -no-opengl ......... Do not support OpenGL.
3447 + -opengl <api> ...... Enable OpenGL support.
3448 With no parameter, this will auto-detect the "best"
3449 OpenGL API to use. If desktop OpenGL is avaliable, it
3450 will be used. Use desktop, es1, es1cl or es2 for <api>
3451 to force the use of the Desktop (OpenGL 1.x or 2.x),
3452 OpenGL ES 1.x Common profile, 1.x Common Lite profile
3453 or 2.x APIs instead. On X11, the EGL API will be used
3454 to manage GL contexts in the case of OpenGL ES.
3456 $SMN -no-sm ............. Do not support X Session Management.
3457 $SMY -sm ................ Support X Session Management, links in -lSM -lICE.
3459 $SHN -no-xshape ......... Do not compile XShape support.
3460 $SHY -xshape ............ Compile XShape support.
3461 Requires X11/extensions/shape.h.
3463 $XAN -no-xinerama ....... Do not compile Xinerama (multihead) support.
3464 $XAY -xinerama .......... Compile Xinerama support.
3465 Requires X11/extensions/Xinerama.h and libXinerama.
3466 By default, Xinerama support will be compiled if
3467 available and the shared libraries are dynamically
3468 loaded at runtime.
3470 $XCN -no-xcursor ........ Do not compile Xcursor support.
3471 $XCY -xcursor ........... Compile Xcursor support.
3472 Requires X11/Xcursor/Xcursor.h and libXcursor.
3473 By default, Xcursor support will be compiled if
3474 available and the shared libraries are dynamically
3475 loaded at runtime.
3477 $XFN -no-xfixes ......... Do not compile Xfixes support.
3478 $XFY -xfixes ............ Compile Xfixes support.
3479 Requires X11/extensions/Xfixes.h and libXfixes.
3480 By default, Xfixes support will be compiled if
3481 available and the shared libraries are dynamically
3482 loaded at runtime.
3484 $XZN -no-xrandr ......... Do not compile Xrandr (resize and rotate) support.
3485 $XZY -xrandr ............ Compile Xrandr support.
3486 Requires X11/extensions/Xrandr.h and libXrandr.
3488 $XRN -no-xrender ........ Do not compile Xrender support.
3489 $XRY -xrender ........... Compile Xrender support.
3490 Requires X11/extensions/Xrender.h and libXrender.
3492 $XMN -no-mitshm ......... Do not compile MIT-SHM support.
3493 $XMY -mitshm ............ Compile MIT-SHM support.
3494 Requires sys/ipc.h, sys/shm.h and X11/extensions/XShm.h
3496 $FCGN -no-fontconfig ..... Do not compile FontConfig (anti-aliased font) support.
3497 $FCGY -fontconfig ........ Compile FontConfig support.
3498 Requires fontconfig/fontconfig.h, libfontconfig,
3499 freetype.h and libfreetype.
3501 $XIN -no-xinput.......... Do not compile Xinput support.
3502 $XIY -xinput ............ Compile Xinput support. This also enabled tablet support
3503 which requires IRIX with wacom.h and libXi or
3504 XFree86 with X11/extensions/XInput.h and libXi.
3506 $XKN -no-xkb ............ Do not compile XKB (X KeyBoard extension) support.
3507 $XKY -xkb ............... Compile XKB support.
3512 if [ "$PLATFORM_MAC" = "yes" ]; then
3513 cat << EOF
3515 Qt/Mac only:
3517 -Fstring ........... Add an explicit framework path.
3518 -fw string ......... Add an explicit framework.
3520 -cocoa ............. Build the Cocoa version of Qt. Note that -no-framework
3521 and -static is not supported with -cocoa. Specifying
3522 this option creates Qt binaries that requires Mac OS X
3523 10.5 or higher.
3525 * -framework ......... Build Qt as a series of frameworks and
3526 link tools against those frameworks.
3527 -no-framework ...... Do not build Qt as a series of frameworks.
3529 * -dwarf2 ............ Enable dwarf2 debugging symbols.
3530 -no-dwarf2 ......... Disable dwarf2 debugging symbols.
3532 -universal ......... Equivalent to -arch "ppc x86"
3534 -arch <arch> ....... Build Qt for <arch>
3535 Example values for <arch>: x86 ppc x86_64 ppc64
3536 Multiple -arch arguments can be specified, 64-bit archs
3537 will be built with the Cocoa framework.
3539 -sdk <sdk> ......... Build Qt using Apple provided SDK <sdk>. This option requires gcc 4.
3540 To use a different SDK with gcc 3.3, set the SDKROOT environment variable.
3545 if [ "$PLATFORM_QWS" = "yes" ]; then
3546 cat << EOF
3548 Qt for Embedded Linux only:
3550 -xplatform target ... The target platform when cross-compiling.
3552 -no-feature-<feature> Do not compile in <feature>.
3553 -feature-<feature> .. Compile in <feature>. The available features
3554 are described in src/corelib/global/qfeatures.txt
3556 -embedded <arch> .... This will enable the embedded build, you must have a
3557 proper license for this switch to work.
3558 Example values for <arch>: arm mips x86 generic
3560 -armfpa ............. Target platform is uses the ARM-FPA floating point format.
3561 -no-armfpa .......... Target platform does not use the ARM-FPA floating point format.
3563 The floating point format is usually autodetected by configure. Use this
3564 to override the detected value.
3566 -little-endian ...... Target platform is little endian (LSB first).
3567 -big-endian ......... Target platform is big endian (MSB first).
3569 -host-little-endian . Host platform is little endian (LSB first).
3570 -host-big-endian .... Host platform is big endian (MSB first).
3572 You only need to specify the endianness when
3573 cross-compiling, otherwise the host
3574 endianness will be used.
3576 -no-freetype ........ Do not compile in Freetype2 support.
3577 -qt-freetype ........ Use the libfreetype bundled with Qt.
3578 * -system-freetype .... Use libfreetype from the operating system.
3579 See http://www.freetype.org/
3581 -qconfig local ...... Use src/corelib/global/qconfig-local.h rather than the
3582 default ($CFG_QCONFIG).
3584 -depths <list> ...... Comma-separated list of supported bit-per-pixel
3585 depths, from: 1, 4, 8, 12, 15, 16, 18, 24, 32 and 'all'.
3587 -qt-decoration-<style> ....Enable a decoration <style> in the QtGui library,
3588 by default all available decorations are on.
3589 Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
3590 -plugin-decoration-<style> Enable decoration <style> as a plugin to be
3591 linked to at run time.
3592 Possible values for <style>: [ $CFG_DECORATION_PLUGIN_AVAILABLE ]
3593 -no-decoration-<style> ....Disable decoration <style> entirely.
3594 Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
3596 -no-opengl .......... Do not support OpenGL.
3597 -opengl <api> ....... Enable OpenGL ES support
3598 With no parameter, this will attempt to auto-detect OpenGL ES 1.x
3599 or 2.x. Use es1, es1cl or es2 for <api> to override auto-detection.
3601 NOTE: A QGLScreen driver for the hardware is required to support
3602 OpenGL ES on Qt for Embedded Linux.
3604 -qt-gfx-<driver> ... Enable a graphics <driver> in the QtGui library.
3605 Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
3606 -plugin-gfx-<driver> Enable graphics <driver> as a plugin to be
3607 linked to at run time.
3608 Possible values for <driver>: [ $CFG_GFX_PLUGIN_AVAILABLE ]
3609 -no-gfx-<driver> ... Disable graphics <driver> entirely.
3610 Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
3612 -qt-kbd-<driver> ... Enable a keyboard <driver> in the QtGui library.
3613 Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
3615 -plugin-kbd-<driver> Enable keyboard <driver> as a plugin to be linked to
3616 at runtime.
3617 Possible values for <driver>: [ $CFG_KBD_PLUGIN_AVAILABLE ]
3619 -no-kbd-<driver> ... Disable keyboard <driver> entirely.
3620 Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
3622 -qt-mouse-<driver> ... Enable a mouse <driver> in the QtGui library.
3623 Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
3624 -plugin-mouse-<driver> Enable mouse <driver> as a plugin to be linked to
3625 at runtime.
3626 Possible values for <driver>: [ $CFG_MOUSE_PLUGIN_AVAILABLE ]
3627 -no-mouse-<driver> ... Disable mouse <driver> entirely.
3628 Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
3630 -iwmmxt ............ Compile using the iWMMXt instruction set
3631 (available on some XScale CPUs).
3637 if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
3638 if [ "$CFG_GLIB" = "no" ]; then
3639 GBY=" "
3640 GBN="+"
3641 else
3642 GBY="+"
3643 GBN=" "
3645 cat << EOF
3646 $GBN -no-glib ........... Do not compile Glib support.
3647 $GBY -glib .............. Compile Glib support.
3652 [ "x$ERROR" = "xyes" ] && exit 1
3653 exit 0
3654 fi # Help
3657 # -----------------------------------------------------------------------------
3658 # LICENSING, INTERACTIVE PART
3659 # -----------------------------------------------------------------------------
3661 if [ "$PLATFORM_QWS" = "yes" ]; then
3662 Platform="Qt for Embedded Linux"
3663 elif [ "$PLATFORM_MAC" = "yes" ]; then
3664 Platform="Qt/Mac"
3665 else
3666 PLATFORM_X11=yes
3667 Platform="Qt/X11"
3670 echo
3671 echo "This is the $Platform ${EditionString} Edition."
3672 echo
3674 if [ "$Edition" = "NokiaInternalBuild" ]; then
3675 echo "Detected -nokia-developer option"
3676 echo "Nokia employees and agents are allowed to use this software under"
3677 echo "the authority of Nokia Corporation and/or its subsidiary(-ies)"
3678 elif [ "$Edition" = "OpenSource" ]; then
3679 while true; do
3680 echo "You are licensed to use this software under the terms of"
3681 echo "the GNU General Public License (GPL) versions 3."
3682 echo "You are also licensed to use this software under the terms of"
3683 echo "the Lesser GNU General Public License (LGPL) versions 2.1."
3684 echo
3685 affix="either"
3686 if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
3687 echo "You have already accepted the terms of the $LicenseType license."
3688 acceptance=yes
3689 else
3690 echo "Type '3' to view the GNU General Public License version 3."
3691 echo "Type 'L' to view the Lesser GNU General Public License version 2.1."
3692 echo "Type 'yes' to accept this license offer."
3693 echo "Type 'no' to decline this license offer."
3694 echo
3695 if echo '\c' | grep '\c' >/dev/null; then
3696 echo -n "Do you accept the terms of $affix license? "
3697 else
3698 echo "Do you accept the terms of $affix license? \c"
3700 read acceptance
3702 echo
3703 if [ "$acceptance" = "yes" ]; then
3704 break
3705 elif [ "$acceptance" = "no" ]; then
3706 echo "You are not licensed to use this software."
3707 echo
3708 exit 1
3709 elif [ "$acceptance" = "3" ]; then
3710 more "$relpath/LICENSE.GPL3"
3711 elif [ "$acceptance" = "L" ]; then
3712 more "$relpath/LICENSE.LGPL"
3714 done
3715 elif [ "$Edition" = "Preview" ]; then
3716 TheLicense=`head -n 1 "$relpath/LICENSE.PREVIEW.COMMERCIAL"`
3717 while true; do
3719 if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
3720 echo "You have already accepted the terms of the $LicenseType license."
3721 acceptance=yes
3722 else
3723 echo "You are licensed to use this software under the terms of"
3724 echo "the $TheLicense"
3725 echo
3726 echo "Type '?' to read the Preview License."
3727 echo "Type 'yes' to accept this license offer."
3728 echo "Type 'no' to decline this license offer."
3729 echo
3730 if echo '\c' | grep '\c' >/dev/null; then
3731 echo -n "Do you accept the terms of the license? "
3732 else
3733 echo "Do you accept the terms of the license? \c"
3735 read acceptance
3737 echo
3738 if [ "$acceptance" = "yes" ]; then
3739 break
3740 elif [ "$acceptance" = "no" ] ;then
3741 echo "You are not licensed to use this software."
3742 echo
3743 exit 0
3744 elif [ "$acceptance" = "?" ]; then
3745 more "$relpath/LICENSE.PREVIEW.COMMERCIAL"
3747 done
3748 elif [ "$Edition" != "OpenSource" ]; then
3749 if [ -n "$ExpiryDate" ]; then
3750 ExpiryDate=`echo $ExpiryDate | sed -e "s,-,,g" | tr -d "\n\r"`
3751 [ -z "$ExpiryDate" ] && ExpiryDate="0"
3752 Today=`date +%Y%m%d`
3753 if [ "$Today" -gt "$ExpiryDate" ]; then
3754 case "$LicenseType" in
3755 Commercial|Academic|Educational)
3756 if [ "$QT_PACKAGEDATE" -gt "$ExpiryDate" ]; then
3757 echo
3758 echo "NOTICE NOTICE NOTICE NOTICE"
3759 echo
3760 echo " Your support and upgrade period has expired."
3761 echo
3762 echo " You are no longer licensed to use this version of Qt."
3763 echo " Please contact sales@trolltech.com to renew your support"
3764 echo " and upgrades for this license."
3765 echo
3766 echo "NOTICE NOTICE NOTICE NOTICE"
3767 echo
3768 exit 1
3769 else
3770 echo
3771 echo "WARNING WARNING WARNING WARNING"
3772 echo
3773 echo " Your support and upgrade period has expired."
3774 echo
3775 echo " You may continue to use your last licensed release"
3776 echo " of Qt under the terms of your existing license"
3777 echo " agreement. But you are not entitled to technical"
3778 echo " support, nor are you entitled to use any more recent"
3779 echo " Qt releases."
3780 echo
3781 echo " Please contact sales@trolltech.com to renew your"
3782 echo " support and upgrades for this license."
3783 echo
3784 echo "WARNING WARNING WARNING WARNING"
3785 echo
3786 sleep 3
3789 Evaluation|*)
3790 echo
3791 echo "NOTICE NOTICE NOTICE NOTICE"
3792 echo
3793 echo " Your Evaluation license has expired."
3794 echo
3795 echo " You are no longer licensed to use this software. Please"
3796 echo " contact sales@trolltech.com to purchase license, or install"
3797 echo " the Qt Open Source Edition if you intend to develop free"
3798 echo " software."
3799 echo
3800 echo "NOTICE NOTICE NOTICE NOTICE"
3801 echo
3802 exit 1
3804 esac
3807 TheLicense=`head -n 1 "$outpath/LICENSE"`
3808 while true; do
3809 if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
3810 echo "You have already accepted the terms of the $TheLicense."
3811 acceptance=yes
3812 else
3813 echo "You are licensed to use this software under the terms of"
3814 echo "the $TheLicense."
3815 echo
3816 echo "Type '?' to view the $TheLicense."
3817 echo "Type 'yes' to accept this license offer."
3818 echo "Type 'no' to decline this license offer."
3819 echo
3820 if echo '\c' | grep '\c' >/dev/null; then
3821 echo -n "Do you accept the terms of the $TheLicense? "
3822 else
3823 echo "Do you accept the terms of the $TheLicense? \c"
3825 read acceptance
3827 echo
3828 if [ "$acceptance" = "yes" ]; then
3829 break
3830 elif [ "$acceptance" = "no" ]; then
3831 echo "You are not licensed to use this software."
3832 echo
3833 exit 1
3834 else [ "$acceptance" = "?" ]
3835 more "$outpath/LICENSE"
3837 done
3840 # this should be moved somewhere else
3841 case "$PLATFORM" in
3842 aix-*)
3843 AIX_VERSION=`uname -v`
3844 if [ "$AIX_VERSION" -lt "5" ]; then
3845 QMakeVar add QMAKE_LIBS_X11 -lbind
3850 esac
3852 #-------------------------------------------------------------------------------
3853 # generate qconfig.cpp
3854 #-------------------------------------------------------------------------------
3855 [ -d "$outpath/src/corelib/global" ] || mkdir -p "$outpath/src/corelib/global"
3857 LICENSE_USER_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_lcnsuser=$Licensee"`
3858 LICENSE_PRODUCTS_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_lcnsprod=$Edition"`
3859 PREFIX_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_prfxpath=$QT_INSTALL_PREFIX"`
3860 DOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_INSTALL_DOCS"`
3861 HEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_INSTALL_HEADERS"`
3862 LIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_INSTALL_LIBS"`
3863 BINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_INSTALL_BINS"`
3864 PLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_INSTALL_PLUGINS"`
3865 DATA_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_datapath=$QT_INSTALL_DATA"`
3866 TRANSLATIONS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_trnspath=$QT_INSTALL_TRANSLATIONS"`
3867 SETTINGS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_stngpath=$QT_INSTALL_SETTINGS"`
3868 EXAMPLES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_xmplpath=$QT_INSTALL_EXAMPLES"`
3869 DEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INSTALL_DEMOS"`
3871 cat > "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3872 /* License Info */
3873 static const char qt_configure_licensee_str [256 + 12] = "$LICENSE_USER_STR";
3874 static const char qt_configure_licensed_products_str [256 + 12] = "$LICENSE_PRODUCTS_STR";
3877 if [ ! -z "$QT_HOST_PREFIX" ]; then
3878 HOSTPREFIX_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_prfxpath=$QT_HOST_PREFIX"`
3879 HOSTDOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_HOST_PREFIX/doc"`
3880 HOSTHEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_HOST_PREFIX/include"`
3881 HOSTLIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_HOST_PREFIX/lib"`
3882 HOSTBINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_HOST_PREFIX/bin"`
3883 HOSTPLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_HOST_PREFIX/plugins"`
3884 HOSTDATA_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_datapath=$QT_HOST_PREFIX"`
3885 HOSTTRANSLATIONS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_trnspath=$QT_HOST_PREFIX/translations"`
3886 HOSTSETTINGS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_stngpath=$QT_INSTALL_SETTINGS"`
3887 HOSTEXAMPLES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_xmplpath=$QT_INSTALL_EXAMPLES"`
3888 HOSTDEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INSTALL_DEMOS"`
3890 cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3892 #if defined(QT_BOOTSTRAPPED) || defined(QT_BUILD_QMAKE)
3893 /* Installation Info */
3894 static const char qt_configure_prefix_path_str [256 + 12] = "$HOSTPREFIX_PATH_STR";
3895 static const char qt_configure_documentation_path_str[256 + 12] = "$HOSTDOCUMENTATION_PATH_STR";
3896 static const char qt_configure_headers_path_str [256 + 12] = "$HOSTHEADERS_PATH_STR";
3897 static const char qt_configure_libraries_path_str [256 + 12] = "$HOSTLIBRARIES_PATH_STR";
3898 static const char qt_configure_binaries_path_str [256 + 12] = "$HOSTBINARIES_PATH_STR";
3899 static const char qt_configure_plugins_path_str [256 + 12] = "$HOSTPLUGINS_PATH_STR";
3900 static const char qt_configure_data_path_str [256 + 12] = "$HOSTDATA_PATH_STR";
3901 static const char qt_configure_translations_path_str [256 + 12] = "$HOSTTRANSLATIONS_PATH_STR";
3902 static const char qt_configure_settings_path_str [256 + 12] = "$HOSTSETTINGS_PATH_STR";
3903 static const char qt_configure_examples_path_str [256 + 12] = "$HOSTEXAMPLES_PATH_STR";
3904 static const char qt_configure_demos_path_str [256 + 12] = "$HOSTDEMOS_PATH_STR";
3905 #else // QT_BOOTSTRAPPED
3909 cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3910 /* Installation Info */
3911 static const char qt_configure_prefix_path_str [256 + 12] = "$PREFIX_PATH_STR";
3912 static const char qt_configure_documentation_path_str[256 + 12] = "$DOCUMENTATION_PATH_STR";
3913 static const char qt_configure_headers_path_str [256 + 12] = "$HEADERS_PATH_STR";
3914 static const char qt_configure_libraries_path_str [256 + 12] = "$LIBRARIES_PATH_STR";
3915 static const char qt_configure_binaries_path_str [256 + 12] = "$BINARIES_PATH_STR";
3916 static const char qt_configure_plugins_path_str [256 + 12] = "$PLUGINS_PATH_STR";
3917 static const char qt_configure_data_path_str [256 + 12] = "$DATA_PATH_STR";
3918 static const char qt_configure_translations_path_str [256 + 12] = "$TRANSLATIONS_PATH_STR";
3919 static const char qt_configure_settings_path_str [256 + 12] = "$SETTINGS_PATH_STR";
3920 static const char qt_configure_examples_path_str [256 + 12] = "$EXAMPLES_PATH_STR";
3921 static const char qt_configure_demos_path_str [256 + 12] = "$DEMOS_PATH_STR";
3924 if [ ! -z "$QT_HOST_PREFIX" ]; then
3925 cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3926 #endif // QT_BOOTSTRAPPED
3931 cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3932 /* strlen( "qt_lcnsxxxx" ) == 12 */
3933 #define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;
3934 #define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;
3935 #define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12;
3936 #define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;
3937 #define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;
3938 #define QT_CONFIGURE_LIBRARIES_PATH qt_configure_libraries_path_str + 12;
3939 #define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12;
3940 #define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;
3941 #define QT_CONFIGURE_DATA_PATH qt_configure_data_path_str + 12;
3942 #define QT_CONFIGURE_TRANSLATIONS_PATH qt_configure_translations_path_str + 12;
3943 #define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;
3944 #define QT_CONFIGURE_EXAMPLES_PATH qt_configure_examples_path_str + 12;
3945 #define QT_CONFIGURE_DEMOS_PATH qt_configure_demos_path_str + 12;
3948 # avoid unecessary rebuilds by copying only if qconfig.cpp has changed
3949 if cmp -s "$outpath/src/corelib/global/qconfig.cpp" "$outpath/src/corelib/global/qconfig.cpp.new"; then
3950 rm -f "$outpath/src/corelib/global/qconfig.cpp.new"
3951 else
3952 [ -f "$outpath/src/corelib/global/qconfig.cpp" ] && chmod +w "$outpath/src/corelib/global/qconfig.cpp"
3953 mv "$outpath/src/corelib/global/qconfig.cpp.new" "$outpath/src/corelib/global/qconfig.cpp"
3954 chmod -w "$outpath/src/corelib/global/qconfig.cpp"
3957 # -----------------------------------------------------------------------------
3958 # build qmake
3959 # -----------------------------------------------------------------------------
3961 # symlink includes
3962 if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt" ]; then
3963 SYNCQT_OPTS=
3964 [ "$CFG_DEV" = "yes" ] && SYNCQT_OPTS="$SYNCQT_OPTS -check-includes"
3965 if [ "$OPT_SHADOW" = "yes" ]; then
3966 "$outpath/bin/syncqt" $SYNCQT_OPTS
3967 elif [ "$CFG_DEV" = "yes" ]; then
3968 QTDIR="$relpath" perl "$outpath/bin/syncqt" $SYNCQT_OPTS
3972 # $1: variable name
3973 # $2: optional transformation
3974 # relies on $QMAKESPEC, $COMPILER_CONF and $mkfile being set correctly, as the latter
3975 # is where the resulting variable is written to
3976 setBootstrapVariable()
3978 variableRegExp="^$1[^_A-Z0-9]"
3979 getQMakeConf | grep "$variableRegExp" | ( [ -n "$2" ] && sed "$2" ; [ -z "$2" ] && cat ) | $AWK '
3981 varLength = index($0, "=") - 1
3982 valStart = varLength + 2
3983 if (substr($0, varLength, 1) == "+") {
3984 varLength = varLength - 1
3985 valStart = valStart + 1
3987 var = substr($0, 0, varLength)
3988 gsub("[ \t]+", "", var)
3989 val = substr($0, valStart)
3990 printf "%s_%s = %s\n", var, NR, val
3992 END {
3993 if (length(var) > 0) {
3994 printf "%s =", var
3995 for (i = 1; i <= NR; ++i)
3996 printf " $(%s_%s)", var, i
3997 printf "\n"
3999 }' >> "$mkfile"
4002 # build qmake
4003 if true; then ###[ '!' -f "$outpath/bin/qmake" ];
4004 echo "Creating qmake. Please wait..."
4006 OLD_QCONFIG_H=
4007 QCONFIG_H="$outpath/src/corelib/global/qconfig.h"
4008 QMAKE_QCONFIG_H="${QCONFIG_H}.qmake"
4009 if [ -f "$QCONFIG_H" ]; then
4010 OLD_QCONFIG_H=$QCONFIG_H
4011 mv -f "$OLD_QCONFIG_H" "${OLD_QCONFIG_H}.old"
4014 # create temporary qconfig.h for compiling qmake, if it doesn't exist
4015 # when building qmake, we use #defines for the install paths,
4016 # however they are real functions in the library
4017 if [ '!' -f "$QMAKE_QCONFIG_H" ]; then
4018 mkdir -p "$outpath/src/corelib/global"
4019 [ -f "$QCONFIG_H" ] && chmod +w "$QCONFIG_H"
4020 echo "/* All features enabled while building qmake */" >"$QMAKE_QCONFIG_H"
4023 mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
4024 for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
4025 if [ '!' -f "$conf" ]; then
4026 ln -s "$QCONFIG_H" "$conf"
4028 done
4030 #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
4031 rm -f mkspecs/default
4032 ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
4033 # fix makefiles
4034 for mkfile in GNUmakefile Makefile; do
4035 EXTRA_LFLAGS=
4036 EXTRA_CFLAGS=
4037 in_mkfile="${mkfile}.in"
4038 if [ "$mkfile" = "Makefile" ]; then
4039 # if which qmake >/dev/null 2>&1 && [ -f qmake/qmake.pro ]; then
4040 # (cd qmake && qmake) >/dev/null 2>&1 && continue
4041 # fi
4042 in_mkfile="${mkfile}.unix"
4044 in_mkfile="$relpath/qmake/$in_mkfile"
4045 mkfile="$outpath/qmake/$mkfile"
4046 if [ -f "$mkfile" ]; then
4047 [ "$CFG_DEV" = "yes" ] && "$WHICH" chflags >/dev/null 2>&1 && chflags nouchg "$mkfile"
4048 rm -f "$mkfile"
4050 [ -f "$in_mkfile" ] || continue
4052 echo "########################################################################" >$mkfile
4053 echo "## This file was autogenerated by configure, all changes will be lost ##" >>$mkfile
4054 echo "########################################################################" >>$mkfile
4055 EXTRA_OBJS=
4056 EXTRA_SRCS=
4057 EXTRA_CFLAGS="\$(QMAKE_CFLAGS)"
4058 EXTRA_CXXFLAGS="\$(QMAKE_CXXFLAGS)"
4059 EXTRA_LFLAGS="\$(QMAKE_LFLAGS)"
4061 if [ "$PLATFORM" = "irix-cc" ] || [ "$PLATFORM" = "irix-cc-64" ]; then
4062 EXTRA_LFLAGS="$EXTRA_LFLAGS -lm"
4065 [ -n "$CC" ] && echo "CC = $CC" >>$mkfile
4066 [ -n "$CXX" ] && echo "CXX = $CXX" >>$mkfile
4067 if [ "$CFG_SILENT" = "yes" ]; then
4068 [ -z "$CC" ] && setBootstrapVariable QMAKE_CC 's,QMAKE_CC.*=,CC=\@,'
4069 [ -z "$CXX" ] && setBootstrapVariable QMAKE_CXX 's,QMAKE_CXX.*=,CXX=\@,'
4070 else
4071 [ -z "$CC" ] && setBootstrapVariable QMAKE_CC 's,QMAKE_CC,CC,'
4072 [ -z "$CXX" ] && setBootstrapVariable QMAKE_CXX 's,QMAKE_CXX,CXX,'
4074 setBootstrapVariable QMAKE_CFLAGS
4075 setBootstrapVariable QMAKE_CXXFLAGS 's,\$\$QMAKE_CFLAGS,\$(QMAKE_CFLAGS),'
4076 setBootstrapVariable QMAKE_LFLAGS
4078 if [ $QT_EDITION = "QT_EDITION_OPENSOURCE" ]; then
4079 EXTRA_CFLAGS="$EXTRA_CFLAGS -DQMAKE_OPENSOURCE_EDITION"
4080 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -DQMAKE_OPENSOURCE_EDITION"
4082 if [ "$CFG_RELEASE_QMAKE" = "yes" ]; then
4083 setBootstrapVariable QMAKE_CFLAGS_RELEASE
4084 setBootstrapVariable QMAKE_CXXFLAGS_RELEASE 's,\$\$QMAKE_CFLAGS_RELEASE,\$(QMAKE_CFLAGS_RELEASE),'
4085 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
4086 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_RELEASE)"
4087 elif [ "$CFG_DEBUG" = "yes" ]; then
4088 setBootstrapVariable QMAKE_CFLAGS_DEBUG
4089 setBootstrapVariable QMAKE_CXXFLAGS_DEBUG 's,\$\$QMAKE_CFLAGS_DEBUG,\$(QMAKE_CFLAGS_DEBUG),'
4090 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_DEBUG)"
4091 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_DEBUG)"
4094 if [ '!' -z "$RPATH_FLAGS" ] && [ '!' -z "`getQMakeConf \"$QMAKESPEC\" | grep QMAKE_RPATH | awk '{print $3;}'`" ]; then
4095 setBootstrapVariable QMAKE_RPATH 's,\$\$LITERAL_WHITESPACE, ,'
4096 for rpath in $RPATH_FLAGS; do
4097 EXTRA_LFLAGS="\$(QMAKE_RPATH)\"$rpath\" $EXTRA_LFLAGS"
4098 done
4100 if [ "$PLATFORM_MAC" = "yes" ]; then
4101 if [ "$PLATFORM" = "macx-icc" ]; then
4102 echo "export MACOSX_DEPLOYMENT_TARGET = 10.4" >>"$mkfile"
4103 else
4104 echo "export MACOSX_DEPLOYMENT_TARGET = 10.3" >>"$mkfile"
4106 echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
4107 echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"
4108 EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
4109 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(CARBON_CFLAGS)"
4110 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
4111 EXTRA_OBJS="qsettings_mac.o qcore_mac.o"
4112 EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\""
4113 if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then
4114 X86_CFLAGS="-arch i386"
4115 X86_LFLAGS="-arch i386"
4116 EXTRA_CFLAGS="$X86_CFLAGS $EXTRA_CFLAGS"
4117 EXTRA_CXXFLAGS="$X86_CFLAGS $EXTRA_CXXFLAGS"
4118 EXTRA_LFLAGS="$EXTRA_LFLAGS $X86_LFLAGS"
4120 if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then
4121 PPC_CFLAGS="-arch ppc"
4122 PPC_LFLAGS="-arch ppc"
4123 EXTRA_CFLAGS="$PPC_CFLAGS $EXTRA_CFLAGS"
4124 EXTRA_CXXFLAGS="$PPC_CFLAGS $EXTRA_CXXFLAGS"
4125 EXTRA_LFLAGS="$EXTRA_LFLAGS $PPC_LFLAGS"
4127 if [ '!' -z "$CFG_SDK" ]; then
4128 echo "SDK_LFLAGS =-Wl,-syslibroot,$CFG_SDK" >>"$mkfile"
4129 echo "SDK_CFLAGS =-isysroot $CFG_SDK" >>"$mkfile"
4130 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(SDK_CFLAGS)"
4131 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(SDK_CFLAGS)"
4132 EXTRA_LFLAGS="$EXTRA_LFLAGS \$(SDK_LFLAGS)"
4135 [ "$CFG_EMBEDDED" != "no" ] && EXTRA_CFLAGS="$EXTRA_CFLAGS -DQWS"
4136 if [ '!' -z "$D_FLAGS" ]; then
4137 for DEF in $D_FLAGS; do
4138 EXTRA_CFLAGS="$EXTRA_CFLAGS \"-D${DEF}\""
4139 done
4141 QMAKE_BIN_DIR="$QT_INSTALL_BINS"
4142 [ -z "$QMAKE_BIN_DIR" ] && QMAKE_BIN_DIR="${QT_INSTALL_PREFIX}/bin"
4143 QMAKE_DATA_DIR="$QT_INSTALL_DATA"
4144 [ -z "$QMAKE_DATA_DIR" ] && QMAKE_DATA_DIR="${QT_INSTALL_PREFIX}"
4145 echo >>"$mkfile"
4146 adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`
4147 adjoutpath=`echo "$outpath" | sed 's/ /\\\\\\\\ /g'`
4148 sed -e "s,@SOURCE_PATH@,$adjrelpath,g" -e "s,@BUILD_PATH@,$adjoutpath,g" \
4149 -e "s,@QMAKE_CFLAGS@,$EXTRA_CFLAGS,g" -e "s,@QMAKE_LFLAGS@,$EXTRA_LFLAGS,g" \
4150 -e "s,@QMAKE_CXXFLAGS@,$EXTRA_CXXFLAGS,g" \
4151 -e "s,@QT_INSTALL_BINS@,\$(INSTALL_ROOT)$QMAKE_BIN_DIR,g" \
4152 -e "s,@QT_INSTALL_DATA@,\$(INSTALL_ROOT)$QMAKE_DATA_DIR,g" \
4153 -e "s,@QMAKE_QTOBJS@,$EXTRA_OBJS,g" -e "s,@QMAKE_QTSRCS@,$EXTRA_SRCS,g" \
4154 -e "s,@QMAKESPEC@,$QMAKESPEC,g" "$in_mkfile" >>"$mkfile"
4156 if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
4157 (cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
4158 sed "s,^.*/\([^/]*.o\):,\1:,g" "$mkfile" >"${mkfile}.tmp"
4159 mv "${mkfile}.tmp" "${mkfile}"
4161 done
4163 QMAKE_BUILD_ERROR=no
4164 (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes
4165 [ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake
4166 [ '!' -z "$OLD_QCONFIG_H" ] && mv -f "${OLD_QCONFIG_H}.old" "$OLD_QCONFIG_H" #put back qconfig.h
4167 [ "$QMAKE_BUILD_ERROR" = "yes" ] && exit 2
4168 fi # Build qmake
4170 #-------------------------------------------------------------------------------
4171 # tests that need qmake
4172 #-------------------------------------------------------------------------------
4174 # detect availability of float math.h functions
4175 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/floatmath "floatmath" $L_FLAGS $I_FLAGS $l_FLAGS; then
4176 CFG_USE_FLOATMATH=yes
4177 else
4178 CFG_USE_FLOATMATH=no
4181 # detect mmx support
4182 if [ "${CFG_MMX}" = "auto" ]; then
4183 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mmx "mmx" $L_FLAGS $I_FLAGS $l_FLAGS "-mmmx"; then
4184 CFG_MMX=yes
4185 else
4186 CFG_MMX=no
4190 # detect 3dnow support
4191 if [ "${CFG_3DNOW}" = "auto" ]; then
4192 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/3dnow "3dnow" $L_FLAGS $I_FLAGS $l_FLAGS "-m3dnow"; then
4193 CFG_3DNOW=yes
4194 else
4195 CFG_3DNOW=no
4199 # detect sse support
4200 if [ "${CFG_SSE}" = "auto" ]; then
4201 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse "sse" $L_FLAGS $I_FLAGS $l_FLAGS "-msse"; then
4202 CFG_SSE=yes
4203 else
4204 CFG_SSE=no
4208 # detect sse2 support
4209 if [ "${CFG_SSE2}" = "auto" ]; then
4210 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse2 "sse2" $L_FLAGS $I_FLAGS $l_FLAGS "-msse2"; then
4211 CFG_SSE2=yes
4212 else
4213 CFG_SSE2=no
4217 # check iWMMXt support
4218 if [ "$CFG_IWMMXT" = "yes" ]; then
4219 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $l_FLAGS "-mcpu=iwmmxt"; then
4220 echo "The iWMMXt functionality test failed!"
4221 echo " Please make sure your compiler supports iWMMXt intrinsics!"
4222 exit 1
4226 # detect zlib
4227 if [ "$CFG_ZLIB" = "no" ]; then
4228 # Note: Qt no longer support builds without zlib
4229 # So we force a "no" to be "auto" here.
4230 # If you REALLY really need no zlib support, you can still disable
4231 # it by doing the following:
4232 # add "no-zlib" to mkspecs/qconfig.pri
4233 # #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
4235 # There's no guarantee that Qt will build under those conditions
4237 CFG_ZLIB=auto
4238 ZLIB_FORCED=yes
4240 if [ "$CFG_ZLIB" = "auto" ]; then
4241 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/zlib "zlib" $L_FLAGS $I_FLAGS $l_FLAGS; then
4242 CFG_ZLIB=system
4243 else
4244 CFG_ZLIB=yes
4248 # detect how jpeg should be built
4249 if [ "$CFG_JPEG" = "auto" ]; then
4250 if [ "$CFG_SHARED" = "yes" ]; then
4251 CFG_JPEG=plugin
4252 else
4253 CFG_JPEG=yes
4256 # detect jpeg
4257 if [ "$CFG_LIBJPEG" = "auto" ]; then
4258 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libjpeg "libjpeg" $L_FLAGS $I_FLAGS $l_FLAGS; then
4259 CFG_LIBJPEG=system
4260 else
4261 CFG_LIBJPEG=qt
4265 # detect how gif should be built
4266 if [ "$CFG_GIF" = "auto" ]; then
4267 if [ "$CFG_SHARED" = "yes" ]; then
4268 CFG_GIF=plugin
4269 else
4270 CFG_GIF=yes
4274 # detect how tiff should be built
4275 if [ "$CFG_TIFF" = "auto" ]; then
4276 if [ "$CFG_SHARED" = "yes" ]; then
4277 CFG_TIFF=plugin
4278 else
4279 CFG_TIFF=yes
4283 # detect tiff
4284 if [ "$CFG_LIBTIFF" = "auto" ]; then
4285 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libtiff "libtiff" $L_FLAGS $I_FLAGS $l_FLAGS; then
4286 CFG_LIBTIFF=system
4287 else
4288 CFG_LIBTIFF=qt
4292 # detect how mng should be built
4293 if [ "$CFG_MNG" = "auto" ]; then
4294 if [ "$CFG_SHARED" = "yes" ]; then
4295 CFG_MNG=plugin
4296 else
4297 CFG_MNG=yes
4300 # detect mng
4301 if [ "$CFG_LIBMNG" = "auto" ]; then
4302 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libmng "libmng" $L_FLAGS $I_FLAGS $l_FLAGS; then
4303 CFG_LIBMNG=system
4304 else
4305 CFG_LIBMNG=qt
4309 # detect png
4310 if [ "$CFG_LIBPNG" = "auto" ]; then
4311 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libpng "libpng" $L_FLAGS $I_FLAGS $l_FLAGS; then
4312 CFG_LIBPNG=system
4313 else
4314 CFG_LIBPNG=qt
4318 # detect accessibility
4319 if [ "$CFG_ACCESSIBILITY" = "auto" ]; then
4320 CFG_ACCESSIBILITY=yes
4323 # auto-detect SQL-modules support
4324 for _SQLDR in $CFG_SQL_AVAILABLE; do
4325 case $_SQLDR in
4326 mysql)
4327 if [ "$CFG_SQL_mysql" != "no" ]; then
4328 [ -z "$CFG_MYSQL_CONFIG" ] && CFG_MYSQL_CONFIG=`$WHICH mysql_config`
4329 if [ -x "$CFG_MYSQL_CONFIG" ]; then
4330 QT_CFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --include 2>/dev/null`
4331 QT_LFLAGS_MYSQL_R=`$CFG_MYSQL_CONFIG --libs_r 2>/dev/null`
4332 QT_LFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --libs 2>/dev/null`
4333 QT_MYSQL_VERSION=`$CFG_MYSQL_CONFIG --version 2>/dev/null`
4334 QT_MYSQL_VERSION_MAJOR=`echo $QT_MYSQL_VERSION | cut -d . -f 1`
4336 if [ -n "$QT_MYSQL_VERSION" ] && [ "$QT_MYSQL_VERSION_MAJOR" -lt 4 ]; then
4337 if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4338 echo "This version of MySql is not supported ($QT_MYSQL_VERSION)."
4339 echo " You need MySql 4 or higher."
4340 echo " If you believe this message is in error you may use the continue"
4341 echo " switch (-continue) to $0 to continue."
4342 exit 101
4343 else
4344 CFG_SQL_mysql="no"
4345 QT_LFLAGS_MYSQL=""
4346 QT_LFLAGS_MYSQL_R=""
4347 QT_CFLAGS_MYSQL=""
4349 else
4350 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mysql_r "MySQL (thread-safe)" $QT_LFLAGS_MYSQL_R $L_FLAGS $QT_CFLAGS_MYSQL $I_FLAGS $l_FLAGS; then
4351 QMakeVar add CONFIG use_libmysqlclient_r
4352 if [ "$CFG_SQL_mysql" = "auto" ]; then
4353 CFG_SQL_mysql=plugin
4355 QT_LFLAGS_MYSQL="$QT_LFLAGS_MYSQL_R"
4356 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mysql "MySQL (thread-unsafe)" $QT_LFLAGS_MYSQL $L_FLAGS $QT_CFLAGS_MYSQL $I_FLAGS $l_FLAGS; then
4357 if [ "$CFG_SQL_mysql" = "auto" ]; then
4358 CFG_SQL_mysql=plugin
4360 else
4361 if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4362 echo "MySQL support cannot be enabled due to functionality tests!"
4363 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4364 echo " If you believe this message is in error you may use the continue"
4365 echo " switch (-continue) to $0 to continue."
4366 exit 101
4367 else
4368 CFG_SQL_mysql=no
4369 QT_LFLAGS_MYSQL=""
4370 QT_LFLAGS_MYSQL_R=""
4371 QT_CFLAGS_MYSQL=""
4377 psql)
4378 if [ "$CFG_SQL_psql" != "no" ]; then
4379 if "$WHICH" pg_config >/dev/null 2>&1; then
4380 QT_CFLAGS_PSQL=`pg_config --includedir 2>/dev/null`
4381 QT_LFLAGS_PSQL=`pg_config --libdir 2>/dev/null`
4383 [ -z "$QT_CFLAGS_PSQL" ] || QT_CFLAGS_PSQL="-I$QT_CFLAGS_PSQL"
4384 [ -z "$QT_LFLAGS_PSQL" ] || QT_LFLAGS_PSQL="-L$QT_LFLAGS_PSQL"
4385 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/psql "PostgreSQL" $QT_LFLAGS_PSQL $L_FLAGS $QT_CFLAGS_PSQL $I_FLAGS $l_FLAGS; then
4386 if [ "$CFG_SQL_psql" = "auto" ]; then
4387 CFG_SQL_psql=plugin
4389 else
4390 if [ "$CFG_SQL_psql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4391 echo "PostgreSQL support cannot be enabled due to functionality tests!"
4392 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4393 echo " If you believe this message is in error you may use the continue"
4394 echo " switch (-continue) to $0 to continue."
4395 exit 101
4396 else
4397 CFG_SQL_psql=no
4398 QT_CFLAGS_PSQL=""
4399 QT_LFLAGS_PSQL=""
4404 odbc)
4405 if [ "$CFG_SQL_odbc" != "no" ]; then
4406 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/odbc "ODBC" $L_FLAGS $I_FLAGS $l_FLAGS; then
4407 if [ "$CFG_SQL_odbc" = "auto" ]; then
4408 CFG_SQL_odbc=plugin
4410 else
4411 if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4412 echo "ODBC support cannot be enabled due to functionality tests!"
4413 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4414 echo " If you believe this message is in error you may use the continue"
4415 echo " switch (-continue) to $0 to continue."
4416 exit 101
4417 else
4418 CFG_SQL_odbc=no
4423 oci)
4424 if [ "$CFG_SQL_oci" != "no" ]; then
4425 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/oci "OCI" $L_FLAGS $I_FLAGS $l_FLAGS; then
4426 if [ "$CFG_SQL_oci" = "auto" ]; then
4427 CFG_SQL_oci=plugin
4429 else
4430 if [ "$CFG_SQL_oci" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4431 echo "Oracle (OCI) support cannot be enabled due to functionality tests!"
4432 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4433 echo " If you believe this message is in error you may use the continue"
4434 echo " switch (-continue) to $0 to continue."
4435 exit 101
4436 else
4437 CFG_SQL_oci=no
4442 tds)
4443 if [ "$CFG_SQL_tds" != "no" ]; then
4444 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tds "TDS" $L_FLAGS $I_FLAGS $l_FLAGS; then
4445 if [ "$CFG_SQL_tds" = "auto" ]; then
4446 CFG_SQL_tds=plugin
4448 else
4449 if [ "$CFG_SQL_tds" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4450 echo "TDS support cannot be enabled due to functionality tests!"
4451 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4452 echo " If you believe this message is in error you may use the continue"
4453 echo " switch (-continue) to $0 to continue."
4454 exit 101
4455 else
4456 CFG_SQL_tds=no
4461 db2)
4462 if [ "$CFG_SQL_db2" != "no" ]; then
4463 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/db2 "DB2" $L_FLAGS $I_FLAGS $l_FLAGS; then
4464 if [ "$CFG_SQL_db2" = "auto" ]; then
4465 CFG_SQL_db2=plugin
4467 else
4468 if [ "$CFG_SQL_db2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4469 echo "ODBC support cannot be enabled due to functionality tests!"
4470 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4471 echo " If you believe this message is in error you may use the continue"
4472 echo " switch (-continue) to $0 to continue."
4473 exit 101
4474 else
4475 CFG_SQL_db2=no
4480 ibase)
4481 if [ "$CFG_SQL_ibase" != "no" ]; then
4482 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ibase "InterBase" $L_FLAGS $I_FLAGS $l_FLAGS; then
4483 if [ "$CFG_SQL_ibase" = "auto" ]; then
4484 CFG_SQL_ibase=plugin
4486 else
4487 if [ "$CFG_SQL_ibase" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4488 echo "InterBase support cannot be enabled due to functionality tests!"
4489 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4490 echo " If you believe this message is in error you may use the continue"
4491 echo " switch (-continue) to $0 to continue."
4492 exit 101
4493 else
4494 CFG_SQL_ibase=no
4499 sqlite2)
4500 if [ "$CFG_SQL_sqlite2" != "no" ]; then
4501 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sqlite2 "SQLite2" $L_FLAGS $I_FLAGS $l_FLAGS; then
4502 if [ "$CFG_SQL_sqlite2" = "auto" ]; then
4503 CFG_SQL_sqlite2=plugin
4505 else
4506 if [ "$CFG_SQL_sqlite2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4507 echo "SQLite2 support cannot be enabled due to functionality tests!"
4508 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4509 echo " If you believe this message is in error you may use the continue"
4510 echo " switch (-continue) to $0 to continue."
4511 exit 101
4512 else
4513 CFG_SQL_sqlite2=no
4518 sqlite)
4519 if [ "$CFG_SQL_sqlite" != "no" ]; then
4520 SQLITE_AUTODETECT_FAILED="no"
4521 if [ "$CFG_SQLITE" = "system" ]; then
4522 if [ -n "$PKG_CONFIG" ]; then
4523 QT_CFLAGS_SQLITE=`$PKG_CONFIG --cflags sqlite3 2>/dev/null`
4524 QT_LFLAGS_SQLITE=`$PKG_CONFIG --libs sqlite3 2>/dev/null`
4526 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sqlite "SQLite" $QT_LFLAGS_SQLITE $L_FLAGS $QT_CFLAGS_SQLITE $I_FLAGS $l_FLAGS; then
4527 if [ "$CFG_SQL_sqlite" = "auto" ]; then
4528 CFG_SQL_sqlite=plugin
4530 QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
4531 else
4532 SQLITE_AUTODETECT_FAILED="yes"
4533 CFG_SQL_sqlite=no
4535 elif [ -f "$relpath/src/3rdparty/sqlite/sqlite3.h" ]; then
4536 if [ "$CFG_SQL_sqlite" = "auto" ]; then
4537 CFG_SQL_sqlite=plugin
4539 else
4540 SQLITE_AUTODETECT_FAILED="yes"
4541 CFG_SQL_sqlite=no
4544 if [ "$SQLITE_AUTODETECT_FAILED" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4545 echo "SQLite support cannot be enabled due to functionality tests!"
4546 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4547 echo " If you believe this message is in error you may use the continue"
4548 echo " switch (-continue) to $0 to continue."
4549 exit 101
4554 if [ "$OPT_VERBOSE" = "yes" ]; then
4555 echo "unknown SQL driver: $_SQLDR"
4558 esac
4559 done
4561 # auto-detect NIS support
4562 if [ "$CFG_NIS" != "no" ]; then
4563 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/nis "NIS" $L_FLAGS $I_FLAGS $l_FLAGS; then
4564 CFG_NIS=yes
4565 else
4566 if [ "$CFG_NIS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4567 echo "NIS support cannot be enabled due to functionality tests!"
4568 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4569 echo " If you believe this message is in error you may use the continue"
4570 echo " switch (-continue) to $0 to continue."
4571 exit 101
4572 else
4573 CFG_NIS=no
4578 # auto-detect CUPS support
4579 if [ "$CFG_CUPS" != "no" ]; then
4580 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/cups "Cups" $L_FLAGS $I_FLAGS $l_FLAGS; then
4581 CFG_CUPS=yes
4582 else
4583 if [ "$CFG_CUPS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4584 echo "Cups support cannot be enabled due to functionality tests!"
4585 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4586 echo " If you believe this message is in error you may use the continue"
4587 echo " switch (-continue) to $0 to continue."
4588 exit 101
4589 else
4590 CFG_CUPS=no
4595 # auto-detect iconv(3) support
4596 if [ "$CFG_ICONV" != "no" ]; then
4597 if [ "$PLATFORM_QWS" = "yes" ]; then
4598 CFG_ICONV=no
4599 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/iconv" "POSIX iconv" $L_FLAGS $I_FLAGS $l_FLAGS; then
4600 CFG_ICONV=yes
4601 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/gnu-libiconv" "GNU libiconv" $L_FLAGS $I_FLAGS $l_FLAGS; then
4602 CFG_ICONV=gnu
4603 else
4604 if [ "$CFG_ICONV" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4605 echo "Iconv support cannot be enabled due to functionality tests!"
4606 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4607 echo " If you believe this message is in error you may use the continue"
4608 echo " switch (-continue) to $0 to continue."
4609 exit 101
4610 else
4611 CFG_ICONV=no
4616 # auto-detect libdbus-1 support
4617 if [ "$CFG_DBUS" != "no" ]; then
4618 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then
4619 QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null`
4620 QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null`
4622 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/dbus "D-Bus" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_DBUS $QT_LIBS_DBUS; then
4623 [ "$CFG_DBUS" = "auto" ] && CFG_DBUS=yes
4624 QMakeVar set QT_CFLAGS_DBUS "$QT_CFLAGS_DBUS"
4625 QMakeVar set QT_LIBS_DBUS "$QT_LIBS_DBUS"
4626 else
4627 if [ "$CFG_DBUS" = "auto" ]; then
4628 CFG_DBUS=no
4629 elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4630 # CFG_DBUS is "yes" or "linked" here
4632 echo "The QtDBus module cannot be enabled because libdbus-1 version $MIN_DBUS_1_VERSION was not found."
4633 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4634 echo " If you believe this message is in error you may use the continue"
4635 echo " switch (-continue) to $0 to continue."
4636 exit 101
4641 # Generate a CRC of the namespace for using in constants for the Carbon port.
4642 # This should mean that you really *can* load two Qt's and have our custom
4643 # Carbon events work.
4644 if [ "$PLATFORM_MAC" = "yes" -a ! -z "$QT_NAMESPACE" ]; then
4645 QT_NAMESPACE_MAC_CRC=`"$mactests/crc.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/crc $QT_NAMESPACE $L_FLAGS $I_FLAGS $l_FLAGS`
4648 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
4649 # auto-detect Glib support
4650 if [ "$CFG_GLIB" != "no" ]; then
4651 if [ -n "$PKG_CONFIG" ]; then
4652 QT_CFLAGS_GLIB=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0 2>/dev/null`
4653 QT_LIBS_GLIB=`$PKG_CONFIG --libs glib-2.0 gthread-2.0 2>/dev/null`
4655 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/glib "Glib" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_GLIB $QT_LIBS_GLIB $X11TESTS_FLAGS; then
4656 CFG_GLIB=yes
4657 QMakeVar set QT_CFLAGS_GLIB "$QT_CFLAGS_GLIB"
4658 QMakeVar set QT_LIBS_GLIB "$QT_LIBS_GLIB"
4659 else
4660 if [ "$CFG_GLIB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4661 echo "Glib support cannot be enabled due to functionality tests!"
4662 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4663 echo " If you believe this message is in error you may use the continue"
4664 echo " switch (-continue) to $0 to continue."
4665 exit 101
4666 else
4667 CFG_GLIB=no
4672 if [ "$CFG_PHONON" != "no" ]; then
4673 if [ "$CFG_PHONON_BACKEND" != "no" ]; then
4674 if [ "$CFG_GLIB" = "yes" -a "$CFG_GSTREAMER" != "no" ]; then
4675 if [ -n "$PKG_CONFIG" ]; then
4676 QT_CFLAGS_GSTREAMER=`$PKG_CONFIG --cflags gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
4677 QT_LIBS_GSTREAMER=`$PKG_CONFIG --libs gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
4679 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/gstreamer "GStreamer" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_GSTREAMER $QT_LIBS_GSTREAMER $X11TESTS_FLAGS; then
4680 CFG_GSTREAMER=yes
4681 QMakeVar set QT_CFLAGS_GSTREAMER "$QT_CFLAGS_GSTREAMER"
4682 QMakeVar set QT_LIBS_GSTREAMER "$QT_LIBS_GSTREAMER"
4683 else
4684 if [ "$CFG_GSTREAMER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4685 echo "Gstreamer 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."
4689 exit 101
4690 else
4691 CFG_GSTREAMER=no
4694 elif [ "$CFG_GLIB" = "no" ]; then
4695 CFG_GSTREAMER=no
4698 if [ "$CFG_GSTREAMER" = "yes" ]; then
4699 CFG_PHONON=yes
4700 else
4701 if [ "$CFG_PHONON" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4702 echo "Phonon support cannot be enabled due to functionality tests!"
4703 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4704 echo " If you believe this message is in error you may use the continue"
4705 echo " switch (-continue) to $0 to continue."
4706 exit 101
4707 else
4708 CFG_PHONON=no
4711 else
4712 CFG_PHONON=yes
4715 fi # X11/QWS
4717 # x11
4718 if [ "$PLATFORM_X11" = "yes" ]; then
4719 x11tests="$relpath/config.tests/x11"
4720 X11TESTS_FLAGS=
4722 # work around broken X11 headers when using GCC 2.95 or later
4723 NOTYPE=no
4724 "$x11tests/notype.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath" && NOTYPE=yes
4725 if [ $NOTYPE = "yes" ]; then
4726 QMakeVar add QMAKE_CXXFLAGS -fpermissive
4727 X11TESTS_FLAGS="$X11TESTS_FLAGS -fpermissive"
4730 # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x)
4731 if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
4732 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4733 CFG_OPENGL=desktop
4734 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
4735 CFG_OPENGL=es2
4736 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
4737 CFG_OPENGL=es1
4738 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then
4739 CFG_OPENGL=es1cl
4740 else
4741 if [ "$CFG_OPENGL" = "yes" ]; then
4742 echo "All the OpenGL functionality tests failed!"
4743 echo " You might need to modify the include and library search paths by editing"
4744 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4745 echo " ${XQMAKESPEC}."
4746 exit 1
4748 CFG_OPENGL=no
4750 case "$PLATFORM" in
4751 hpux*)
4752 # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
4753 if [ "$CFG_OPENGL" = "desktop" ]; then
4754 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4755 QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
4761 esac
4762 elif [ "$CFG_OPENGL" = "es1cl" ]; then
4763 # OpenGL ES 1.x common lite
4764 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then
4765 echo "The OpenGL ES 1.x Common Lite Profile functionality test failed!"
4766 echo " You might need to modify the include and library search paths by editing"
4767 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4768 echo " ${XQMAKESPEC}."
4769 exit 1
4771 elif [ "$CFG_OPENGL" = "es1" ]; then
4772 # OpenGL ES 1.x
4773 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
4774 echo "The OpenGL ES 1.x functionality test failed!"
4775 echo " You might need to modify the include and library search paths by editing"
4776 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4777 echo " ${XQMAKESPEC}."
4778 exit 1
4780 elif [ "$CFG_OPENGL" = "es2" ]; then
4781 #OpenGL ES 2.x
4782 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
4783 echo "The OpenGL ES 2.0 functionality test failed!"
4784 echo " You might need to modify the include and library search paths by editing"
4785 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4786 echo " ${XQMAKESPEC}."
4787 exit 1
4789 elif [ "$CFG_OPENGL" = "desktop" ]; then
4790 # Desktop OpenGL support
4791 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4792 echo "The OpenGL functionality test failed!"
4793 echo " You might need to modify the include and library search paths by editing"
4794 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4795 echo " ${XQMAKESPEC}."
4796 exit 1
4798 case "$PLATFORM" in
4799 hpux*)
4800 # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
4801 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4802 QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
4807 esac
4810 # if opengl is disabled and the user specified graphicssystem gl, disable it...
4811 if [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && [ "$CFG_OPENGL" = "no" ]; then
4812 echo "OpenGL Graphics System is disabled due to missing OpenGL support..."
4813 CFG_GRAPHICS_SYSTEM=default
4816 # auto-detect Xcursor support
4817 if [ "$CFG_XCURSOR" != "no" ]; then
4818 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xcursor "Xcursor" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4819 if [ "$CFG_XCURSOR" != "runtime" ]; then
4820 CFG_XCURSOR=yes;
4822 else
4823 if [ "$CFG_XCURSOR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4824 echo "Xcursor support cannot be enabled due to functionality tests!"
4825 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4826 echo " If you believe this message is in error you may use the continue"
4827 echo " switch (-continue) to $0 to continue."
4828 exit 101
4829 else
4830 CFG_XCURSOR=no
4835 # auto-detect Xfixes support
4836 if [ "$CFG_XFIXES" != "no" ]; then
4837 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xfixes "Xfixes" $L_FLAGS $I_FLAGS $X11TESTS_FLAGS; then
4838 if [ "$CFG_XFIXES" != "runtime" ]; then
4839 CFG_XFIXES=yes;
4841 else
4842 if [ "$CFG_XFIXES" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4843 echo "Xfixes support cannot be enabled due to functionality tests!"
4844 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4845 echo " If you believe this message is in error you may use the continue"
4846 echo " switch (-continue) to $0 to continue."
4847 exit 101
4848 else
4849 CFG_XFIXES=no
4854 # auto-detect Xrandr support (resize and rotate extension)
4855 if [ "$CFG_XRANDR" != "no" ]; then
4856 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xrandr "Xrandr" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4857 if [ "$CFG_XRANDR" != "runtime" ]; then
4858 CFG_XRANDR=yes
4860 else
4861 if [ "$CFG_XRANDR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4862 echo "Xrandr support cannot be enabled due to functionality tests!"
4863 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4864 echo " If you believe this message is in error you may use the continue"
4865 echo " switch (-continue) to $0 to continue."
4866 exit 101
4867 else
4868 CFG_XRANDR=no
4873 # auto-detect Xrender support
4874 if [ "$CFG_XRENDER" != "no" ]; then
4875 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xrender "Xrender" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4876 CFG_XRENDER=yes
4877 else
4878 if [ "$CFG_XRENDER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4879 echo "Xrender support cannot be enabled due to functionality tests!"
4880 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4881 echo " If you believe this message is in error you may use the continue"
4882 echo " switch (-continue) to $0 to continue."
4883 exit 101
4884 else
4885 CFG_XRENDER=no
4890 # auto-detect MIT-SHM support
4891 if [ "$CFG_MITSHM" != "no" ]; then
4892 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/mitshm "mitshm" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4893 CFG_MITSHM=yes
4894 else
4895 if [ "$CFG_MITSHM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4896 echo "MITSHM support cannot be enabled due to functionality tests!"
4897 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4898 echo " If you believe this message is in error you may use the continue"
4899 echo " switch (-continue) to $0 to continue."
4900 exit 101
4901 else
4902 CFG_MITSHM=no
4907 # auto-detect FontConfig support
4908 if [ "$CFG_FONTCONFIG" != "no" ]; then
4909 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig 2>/dev/null; then
4910 QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig 2>/dev/null`
4911 QT_LIBS_FONTCONFIG=`$PKG_CONFIG --libs fontconfig 2>/dev/null`
4912 else
4913 QT_CFLAGS_FONTCONFIG=
4914 QT_LIBS_FONTCONFIG="-lfreetype -lfontconfig"
4916 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/fontconfig "FontConfig" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS $QT_CFLAGS_FONTCONFIG $QT_LIBS_FONTCONFIG; then
4917 CFG_FONTCONFIG=yes
4918 QMakeVar set QMAKE_CFLAGS_X11 "$QT_CFLAGS_FONTCONFIG \$\$QMAKE_CFLAGS_X11"
4919 QMakeVar set QMAKE_LIBS_X11 "$QT_LIBS_FONTCONFIG \$\$QMAKE_LIBS_X11"
4920 CFG_LIBFREETYPE=system
4921 else
4922 if [ "$CFG_FONTCONFIG" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4923 echo "FontConfig support cannot be enabled due to functionality tests!"
4924 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4925 echo " If you believe this message is in error you may use the continue"
4926 echo " switch (-continue) to $0 to continue."
4927 exit 101
4928 else
4929 CFG_FONTCONFIG=no
4934 # auto-detect Session Management support
4935 if [ "$CFG_SM" = "auto" ]; then
4936 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/sm "Session Management" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4937 CFG_SM=yes
4938 else
4939 if [ "$CFG_SM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4940 echo "Session Management support cannot be enabled due to functionality tests!"
4941 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4942 echo " If you believe this message is in error you may use the continue"
4943 echo " switch (-continue) to $0 to continue."
4944 exit 101
4945 else
4946 CFG_SM=no
4951 # auto-detect SHAPE support
4952 if [ "$CFG_XSHAPE" != "no" ]; then
4953 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xshape "XShape" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4954 CFG_XSHAPE=yes
4955 else
4956 if [ "$CFG_XSHAPE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4957 echo "XShape support cannot be enabled due to functionality tests!"
4958 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4959 echo " If you believe this message is in error you may use the continue"
4960 echo " switch (-continue) to $0 to continue."
4961 exit 101
4962 else
4963 CFG_XSHAPE=no
4968 # auto-detect Xinerama support
4969 if [ "$CFG_XINERAMA" != "no" ]; then
4970 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xinerama "Xinerama" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4971 if [ "$CFG_XINERAMA" != "runtime" ]; then
4972 CFG_XINERAMA=yes
4974 else
4975 if [ "$CFG_XINERAMA" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4976 echo "Xinerama support cannot be enabled due to functionality tests!"
4977 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4978 echo " If you believe this message is in error you may use the continue"
4979 echo " switch (-continue) to $0 to continue."
4980 exit 101
4981 else
4982 CFG_XINERAMA=no
4987 # auto-detect Xinput support
4988 if [ "$CFG_XINPUT" != "no" ]; then
4989 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xinput "XInput" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4990 if [ "$CFG_XINPUT" != "runtime" ]; then
4991 CFG_XINPUT=yes
4993 else
4994 if [ "$CFG_XINPUT" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4995 echo "Tablet and Xinput support cannot be enabled due to functionality tests!"
4996 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4997 echo " If you believe this message is in error you may use the continue"
4998 echo " switch (-continue) to $0 to continue."
4999 exit 101
5000 else
5001 CFG_XINPUT=no
5006 # auto-detect XKB support
5007 if [ "$CFG_XKB" != "no" ]; then
5008 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xkb "XKB" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
5009 CFG_XKB=yes
5010 else
5011 if [ "$CFG_XKB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5012 echo "XKB support cannot be enabled due to functionality tests!"
5013 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5014 echo " If you believe this message is in error you may use the continue"
5015 echo " switch (-continue) to $0 to continue."
5016 exit 101
5017 else
5018 CFG_XKB=no
5023 if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then
5024 if [ -n "$PKG_CONFIG" ]; then
5025 QT_CFLAGS_QGTKSTYLE=`$PKG_CONFIG --cflags gtk+-2.0 ">=" 2.10 atk 2>/dev/null`
5026 QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
5028 if [ -n "$QT_CFLAGS_QGTKSTYLE" ] ; then
5029 CFG_QGTKSTYLE=yes
5030 QMakeVar set QT_CFLAGS_QGTKSTYLE "$QT_CFLAGS_QGTKSTYLE"
5031 QMakeVar set QT_LIBS_QGTKSTYLE "$QT_LIBS_QGTKSTYLE"
5032 else
5033 if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5034 echo "Gtk theme support cannot be enabled due to functionality tests!"
5035 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5036 echo " If you believe this message is in error you may use the continue"
5037 echo " switch (-continue) to $0 to continue."
5038 exit 101
5039 else
5040 CFG_QGTKSTYLE=no
5043 elif [ "$CFG_GLIB" = "no" ]; then
5044 CFG_QGTKSTYLE=no
5046 fi # X11
5049 if [ "$PLATFORM_MAC" = "yes" ]; then
5050 if [ "$CFG_PHONON" != "no" ]; then
5051 # Always enable Phonon (unless it was explicitly disabled)
5052 CFG_PHONON=yes
5056 # QWS
5057 if [ "$PLATFORM_QWS" = "yes" ]; then
5059 # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x)
5060 if [ "$CFG_OPENGL" = "yes" ]; then
5061 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
5062 CFG_OPENGL=es2
5063 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
5064 CFG_OPENGL=es1
5065 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then
5066 CFG_OPENGL=es1cl
5067 else
5068 echo "All the OpenGL ES functionality tests failed!"
5069 echo " You might need to modify the include and library search paths by editing"
5070 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5071 echo " ${XQMAKESPEC}."
5072 exit 1
5074 elif [ "$CFG_OPENGL" = "es1" ]; then
5075 # OpenGL ES 1.x
5076 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
5077 echo "The OpenGL ES 1.x functionality test failed!"
5078 echo " You might need to modify the include and library search paths by editing"
5079 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5080 echo " ${XQMAKESPEC}."
5081 exit 1
5083 elif [ "$CFG_OPENGL" = "es2" ]; then
5084 #OpenGL ES 2.x
5085 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
5086 echo "The OpenGL ES 2.0 functionality test failed!"
5087 echo " You might need to modify the include and library search paths by editing"
5088 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5089 echo " ${XQMAKESPEC}."
5090 exit 1
5092 elif [ "$CFG_OPENGL" = "desktop" ]; then
5093 # Desktop OpenGL support
5094 echo "Desktop OpenGL support is not avaliable on Qt for Embedded Linux"
5095 exit 1
5098 # screen drivers
5099 for screen in ${CFG_GFX_ON} ${CFG_GFX_PLUGIN}; do
5100 if [ "${screen}" = "ahi" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5101 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/ahi "Ahi" $L_FLAGS $I_FLAGS $l_FLAGS; then
5102 echo "The Ahi screen driver functionality test failed!"
5103 echo " You might need to modify the include and library search paths by editing"
5104 echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
5105 echo " ${XQMAKESPEC}."
5106 exit 1
5110 if [ "${screen}" = "svgalib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5111 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/svgalib "SVGAlib" $L_FLAGS $I_FLAGS $l_FLAGS; then
5112 echo "The SVGAlib screen driver functionality test failed!"
5113 echo " You might need to modify the include and library search paths by editing"
5114 echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
5115 echo " ${XQMAKESPEC}."
5116 exit 1
5120 if [ "${screen}" = "directfb" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5121 if [ -n "$PKG_CONFIG" ]; then
5122 if $PKG_CONFIG --exists directfb 2>/dev/null; then
5123 QT_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
5124 QT_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
5125 elif directfb-config --version >/dev/null 2>&1; then
5126 QT_CFLAGS_DIRECTFB=`directfb-config --cflags 2>/dev/null`
5127 QT_LIBS_DIRECTFB=`directfb-config --libs 2>/dev/null`
5131 # QMake variables set here override those in the mkspec. Therefore we only set the variables here if they are not zero.
5132 if [ -n "$QT_CFLAGS_DIRECTFB" ] || [ -n "$QT_LIBS_DIRECTFB" ]; then
5133 QMakeVar set QT_CFLAGS_DIRECTFB "$QT_CFLAGS_DIRECTFB"
5134 QMakeVar set QT_LIBS_DIRECTFB "$QT_LIBS_DIRECTFB"
5137 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/directfb "DirectFB" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_DIRECTFB $QT_LIBS_DIRECTFB; then
5138 echo "The DirectFB screen driver functionality test failed!"
5139 echo " You might need to modify the include and library search paths by editing"
5140 echo " QT_CFLAGS_DIRECTFB and QT_LIBS_DIRECTFB in"
5141 echo " ${XQMAKESPEC}."
5142 exit 1
5146 done
5148 # mouse drivers
5149 for mouse in ${CFG_MOUSE_ON} ${CFG_MOUSE_PLUGIN}; do
5150 if [ "${mouse}" = "tslib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5151 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tslib "tslib" $L_FLAGS $I_FLAGS $l_FLAGS; then
5152 echo "The tslib functionality test failed!"
5153 echo " You might need to modify the include and library search paths by editing"
5154 echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
5155 echo " ${XQMAKESPEC}."
5156 exit 1
5159 done
5161 CFG_QGTKSTYLE=no
5163 # sound
5164 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/sound "sound" $L_FLAGS $I_FLAGS $l_FLAGS; then
5165 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SOUND"
5168 fi # QWS
5170 # freetype support
5171 [ "x$CFG_EMBEDDED" != "xno" ] && CFG_LIBFREETYPE="$CFG_QWS_FREETYPE"
5172 [ "x$PLATFORM_MAC" = "xyes" ] && CFG_LIBFREETYPE=no
5173 if [ "$CFG_LIBFREETYPE" = "auto" ]; then
5174 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/freetype "FreeType" $L_FLAGS $I_FLAGS $l_FLAGS ; then
5175 CFG_LIBFREETYPE=system
5176 else
5177 CFG_LIBFREETYPE=yes
5181 if [ "$CFG_ENDIAN" = "auto" ]; then
5182 if [ "$PLATFORM_MAC" = "yes" ]; then
5183 true #leave as auto
5184 else
5185 "$unixtests/endian.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5186 F="$?"
5187 if [ "$F" -eq 0 ]; then
5188 CFG_ENDIAN="Q_LITTLE_ENDIAN"
5189 elif [ "$F" -eq 1 ]; then
5190 CFG_ENDIAN="Q_BIG_ENDIAN"
5191 else
5192 echo
5193 echo "The target system byte order could not be detected!"
5194 echo "Turn on verbose messaging (-v) to see the final report."
5195 echo "You can use the -little-endian or -big-endian switch to"
5196 echo "$0 to continue."
5197 exit 101
5202 if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
5203 if [ "$PLATFORM_MAC" = "yes" ]; then
5204 true #leave as auto
5205 else
5206 "$unixtests/endian.test" "$QMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5207 F="$?"
5208 if [ "$F" -eq 0 ]; then
5209 CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
5210 elif [ "$F" -eq 1 ]; then
5211 CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
5212 else
5213 echo
5214 echo "The host system byte order could not be detected!"
5215 echo "Turn on verbose messaging (-v) to see the final report."
5216 echo "You can use the -host-little-endian or -host-big-endian switch to"
5217 echo "$0 to continue."
5218 exit 101
5223 if [ "$CFG_ARMFPA" != "auto" ]; then
5224 if [ "$CFG_ARMFPA" = "yes" ]; then
5225 if [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
5226 CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
5227 else
5228 CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
5230 else
5231 CFG_DOUBLEFORMAT="normal"
5236 if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then
5237 if [ "$PLATFORM_QWS" != "yes" ]; then
5238 CFG_DOUBLEFORMAT=normal
5239 else
5240 "$unixtests/doubleformat.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5241 F="$?"
5242 if [ "$F" -eq 10 ] && [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
5243 CFG_DOUBLEFORMAT=normal
5244 elif [ "$F" -eq 11 ] && [ "$CFG_ENDIAN" = "Q_BIG_ENDIAN" ]; then
5245 CFG_DOUBLEFORMAT=normal
5246 elif [ "$F" -eq 10 ]; then
5247 CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE"
5248 elif [ "$F" -eq 11 ]; then
5249 CFG_DOUBLEFORMAT="Q_DOUBLE_BIG"
5250 elif [ "$F" -eq 12 ]; then
5251 CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
5252 CFG_ARMFPA="yes"
5253 elif [ "$F" -eq 13 ]; then
5254 CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
5255 CFG_ARMFPA="yes"
5256 else
5257 echo
5258 echo "The system floating point format could not be detected."
5259 echo "This may cause data to be generated in a wrong format"
5260 echo "Turn on verbose messaging (-v) to see the final report."
5261 # we do not fail on this since this is a new test, and if it fails,
5262 # the old behavior should be correct in most cases
5263 CFG_DOUBLEFORMAT=normal
5268 HAVE_STL=no
5269 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then
5270 HAVE_STL=yes
5273 if [ "$CFG_STL" != "no" ]; then
5274 if [ "$HAVE_STL" = "yes" ]; then
5275 CFG_STL=yes
5276 else
5277 if [ "$CFG_STL" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5278 echo "STL support cannot be enabled due to functionality tests!"
5279 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5280 echo " If you believe this message is in error you may use the continue"
5281 echo " switch (-continue) to $0 to continue."
5282 exit 101
5283 else
5284 CFG_STL=no
5289 # find if the platform supports IPv6
5290 if [ "$CFG_IPV6" != "no" ]; then
5291 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6 "IPv6" $L_FLAGS $I_FLAGS $l_FLAGS; then
5292 CFG_IPV6=yes
5293 else
5294 if [ "$CFG_IPV6" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5295 echo "IPv6 support cannot be enabled due to functionality tests!"
5296 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5297 echo " If you believe this message is in error you may use the continue"
5298 echo " switch (-continue) to $0 to continue."
5299 exit 101
5300 else
5301 CFG_IPV6=no
5306 # detect POSIX clock_gettime()
5307 if [ "$CFG_CLOCK_GETTIME" = "auto" ]; then
5308 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/clock-gettime "POSIX clock_gettime()" $L_FLAGS $I_FLAGS $l_FLAGS; then
5309 CFG_CLOCK_GETTIME=yes
5310 else
5311 CFG_CLOCK_GETTIME=no
5315 # detect POSIX monotonic clocks
5316 if [ "$CFG_CLOCK_GETTIME" = "yes" ] && [ "$CFG_CLOCK_MONOTONIC" = "auto" ]; then
5317 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/clock-monotonic "POSIX Monotonic Clock" $L_FLAGS $I_FLAGS $l_FLAGS; then
5318 CFG_CLOCK_MONOTONIC=yes
5319 else
5320 CFG_CLOCK_MONOTONIC=no
5322 elif [ "$CFG_CLOCK_GETTIME" = "no" ]; then
5323 CFG_CLOCK_MONOTONIC=no
5326 # detect mremap
5327 if [ "$CFG_MREMAP" = "auto" ]; then
5328 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mremap "mremap" $L_FLAGS $I_FLAGS $l_FLAGS; then
5329 CFG_MREMAP=yes
5330 else
5331 CFG_MREMAP=no
5335 # find if the platform provides getaddrinfo (ipv6 dns lookups)
5336 if [ "$CFG_GETADDRINFO" != "no" ]; then
5337 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getaddrinfo "getaddrinfo" $L_FLAGS $I_FLAGS $l_FLAGS; then
5338 CFG_GETADDRINFO=yes
5339 else
5340 if [ "$CFG_GETADDRINFO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5341 echo "getaddrinfo support cannot be enabled due to functionality tests!"
5342 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5343 echo " If you believe this message is in error you may use the continue"
5344 echo " switch (-continue) to $0 to continue."
5345 exit 101
5346 else
5347 CFG_GETADDRINFO=no
5352 # find if the platform provides inotify
5353 if [ "$CFG_INOTIFY" != "no" ]; then
5354 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/inotify "inotify" $L_FLAGS $I_FLAGS $l_FLAGS; then
5355 CFG_INOTIFY=yes
5356 else
5357 if [ "$CFG_INOTIFY" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5358 echo "inotify support cannot be enabled due to functionality tests!"
5359 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5360 echo " If you believe this message is in error you may use the continue"
5361 echo " switch (-continue) to $0 to continue."
5362 exit 101
5363 else
5364 CFG_INOTIFY=no
5369 # find if the platform provides if_nametoindex (ipv6 interface name support)
5370 if [ "$CFG_IPV6IFNAME" != "no" ]; then
5371 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6ifname "IPv6 interface name" $L_FLAGS $I_FLAGS $l_FLAGS; then
5372 CFG_IPV6IFNAME=yes
5373 else
5374 if [ "$CFG_IPV6IFNAME" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5375 echo "IPv6 interface name support cannot be enabled due to functionality tests!"
5376 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5377 echo " If you believe this message is in error you may use the continue"
5378 echo " switch (-continue) to $0 to continue."
5379 exit 101
5380 else
5381 CFG_IPV6IFNAME=no
5386 # find if the platform provides getifaddrs (network interface enumeration)
5387 if [ "$CFG_GETIFADDRS" != "no" ]; then
5388 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getifaddrs "getifaddrs" $L_FLAGS $I_FLAGS $l_FLAGS; then
5389 CFG_GETIFADDRS=yes
5390 else
5391 if [ "$CFG_GETIFADDRS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5392 echo "getifaddrs support cannot be enabled due to functionality tests!"
5393 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5394 echo " If you believe this message is in error you may use the continue"
5395 echo " switch (-continue) to $0 to continue."
5396 exit 101
5397 else
5398 CFG_GETIFADDRS=no
5403 # find if the platform supports X/Open Large File compilation environment
5404 if [ "$CFG_LARGEFILE" != "no" ]; then
5405 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/largefile "X/Open Large File" $L_FLAGS $I_FLAGS $l_FLAGS; then
5406 CFG_LARGEFILE=yes
5407 else
5408 if [ "$CFG_LARGEFILE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5409 echo "X/Open Large File support cannot be enabled due to functionality tests!"
5410 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5411 echo " If you believe this message is in error you may use the continue"
5412 echo " switch (-continue) to $0 to continue."
5413 exit 101
5414 else
5415 CFG_LARGEFILE=no
5420 # detect OpenSSL
5421 if [ "$CFG_OPENSSL" != "no" ]; then
5422 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/openssl "OpenSSL" $L_FLAGS $I_FLAGS $l_FLAGS; then
5423 if [ "$CFG_OPENSSL" = "auto" ]; then
5424 CFG_OPENSSL=yes
5426 else
5427 if ( [ "$CFG_OPENSSL" = "yes" ] || [ "$CFG_OPENSSL" = "linked" ] ) && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5428 echo "OpenSSL support cannot be enabled due to functionality tests!"
5429 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5430 echo " If you believe this message is in error you may use the continue"
5431 echo " switch (-continue) to $0 to continue."
5432 exit 101
5433 else
5434 CFG_OPENSSL=no
5439 if [ "$CFG_PTMALLOC" != "no" ]; then
5440 # build ptmalloc, copy .a file to lib/
5441 echo "Building ptmalloc. Please wait..."
5442 (cd "$relpath/src/3rdparty/ptmalloc/"; "$MAKE" "clean" ; "$MAKE" "posix"
5443 mkdir "$outpath/lib/" ; cp "libptmalloc3.a" "$outpath/lib/")
5445 QMakeVar add QMAKE_LFLAGS "$outpath/lib/libptmalloc3.a"
5448 #-------------------------------------------------------------------------------
5449 # ask for all that hasn't been auto-detected or specified in the arguments
5450 #-------------------------------------------------------------------------------
5452 ### fix this: user input should be validated in a loop
5453 if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PLATFORM_QWS" = "yes" ]; then
5454 echo
5455 echo "Choose pixel-depths to support:"
5456 echo
5457 echo " 1. 1bpp, black/white"
5458 echo " 4. 4bpp, grayscale"
5459 echo " 8. 8bpp, paletted"
5460 echo " 12. 12bpp, rgb 4-4-4"
5461 echo " 15. 15bpp, rgb 5-5-5"
5462 echo " 16. 16bpp, rgb 5-6-5"
5463 echo " 18. 18bpp, rgb 6-6-6"
5464 echo " 24. 24bpp, rgb 8-8-8"
5465 echo " 32. 32bpp, argb 8-8-8-8 and rgb 8-8-8"
5466 echo " all. All supported depths"
5467 echo
5468 echo "Your choices (default 8,16,32):"
5469 read CFG_QWS_DEPTHS
5470 if [ -z "$CFG_QWS_DEPTHS" ] || [ "$CFG_QWS_DEPTHS" = "yes" ]; then
5471 CFG_QWS_DEPTHS=8,16,32
5474 if [ -n "$CFG_QWS_DEPTHS" -a "$PLATFORM_QWS" = "yes" ]; then
5475 if [ "$CFG_QWS_DEPTHS" = "all" ]; then
5476 CFG_QWS_DEPTHS="1 4 8 12 15 16 18 24 32 generic"
5478 for D in `echo "$CFG_QWS_DEPTHS" | sed -e 's/,/ /g'`; do
5479 case $D in
5480 1|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";;
5481 generic) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_GENERIC";;
5482 esac
5483 done
5486 # enable dwarf2 support on Mac
5487 if [ "$CFG_MAC_DWARF2" = "yes" ]; then
5488 QT_CONFIG="$QT_CONFIG dwarf2"
5491 # Set the default arch. Select 32-bit/carbon if nothing else has
5492 # been specified on the configure line.
5493 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_ARCHS" == "" ]; then
5494 source "$mactests/defaultarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests"
5496 if [ "$QT_MAC_DEFUALT_ARCH" == "x86_64" ]; then
5497 CFG_MAC_ARCHS=" x86"
5498 elif [ "$QT_MAC_DEFUALT_ARCH" == "ppc64" ]; then
5499 CFG_MAC_ARCHS=" ppc"
5500 else
5501 CFG_MAC_ARCHS=" $QT_MAC_DEFUALT_ARCH"
5504 [ "$OPT_VERBOSE" == "yes" ] && echo "Setting Mac architechture to$CFG_MAC_ARCHS."
5507 # enable cocoa and/or carbon on Mac
5508 if [ "$CFG_MAC_COCOA" = "yes" ]; then
5509 # -cocoa on the command line disables carbon completely (i.e. use cocoa for 32-bit as well)
5510 CFG_MAC_CARBON="no"
5511 else
5512 # check which archs are in use, enable cocoa if we find a 64-bit one
5513 if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then
5514 CFG_MAC_COCOA="yes";
5515 CFG_MAC_CARBON="no";
5516 if echo "$CFG_MAC_ARCHS" | grep -w ppc > /dev/null 2>&1; then
5517 CFG_MAC_CARBON="yes";
5519 if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then
5520 CFG_MAC_CARBON="yes";
5522 else
5523 # no 64-bit archs found.
5524 CFG_MAC_COCOA="no"
5528 # set the global Mac deployment target. This is overridden on an arch-by-arch basis
5529 # in some cases, see code further down
5530 case "$PLATFORM,$CFG_MAC_COCOA" in
5531 macx*,yes)
5532 # Cocoa
5533 QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.5
5534 CFG_QT3SUPPORT="no"
5536 macx-icc,*)
5537 # Intel CC, Carbon
5538 QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.4
5540 macx*,no)
5541 # gcc, Carbon
5542 QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.3
5544 esac
5546 # enable Qt 3 support functionality
5547 if [ "$CFG_QT3SUPPORT" = "yes" ]; then
5548 QT_CONFIG="$QT_CONFIG qt3support"
5551 # enable Phonon
5552 if [ "$CFG_PHONON" = "yes" ]; then
5553 QT_CONFIG="$QT_CONFIG phonon"
5554 if [ "$CFG_PHONON_BACKEND" = "yes" ]; then
5555 QT_CONFIG="$QT_CONFIG phonon-backend"
5557 else
5558 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PHONON"
5561 # disable accessibility
5562 if [ "$CFG_ACCESSIBILITY" = "no" ]; then
5563 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ACCESSIBILITY"
5564 else
5565 QT_CONFIG="$QT_CONFIG accessibility"
5568 # enable opengl
5569 if [ "$CFG_OPENGL" = "no" ]; then
5570 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENGL"
5571 else
5572 QT_CONFIG="$QT_CONFIG opengl"
5575 if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es1cl" ] || [ "$CFG_OPENGL" = "es2" ]; then
5576 if [ "$PLATFORM_QWS" = "yes" ]; then
5577 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_BACKINGSTORE_SUBSURFACES"
5578 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_USE_EGLWINDOWSURFACE"
5580 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES"
5583 if [ "$CFG_OPENGL" = "es1" ]; then
5584 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1"
5585 QT_CONFIG="$QT_CONFIG opengles1"
5588 if [ "$CFG_OPENGL" = "es1cl" ]; then
5589 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1_CL"
5590 QT_CONFIG="$QT_CONFIG opengles1cl"
5593 if [ "$CFG_OPENGL" = "es2" ]; then
5594 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_2"
5595 QT_CONFIG="$QT_CONFIG opengles2"
5598 # safe execution environment
5599 if [ "$CFG_SXE" != "no" ]; then
5600 QT_CONFIG="$QT_CONFIG sxe"
5603 # build up the variables for output
5604 if [ "$CFG_DEBUG" = "yes" ]; then
5605 QMAKE_OUTDIR="${QMAKE_OUTDIR}debug"
5606 QMAKE_CONFIG="$QMAKE_CONFIG debug"
5607 elif [ "$CFG_DEBUG" = "no" ]; then
5608 QMAKE_OUTDIR="${QMAKE_OUTDIR}release"
5609 QMAKE_CONFIG="$QMAKE_CONFIG release"
5611 if [ "$CFG_SHARED" = "yes" ]; then
5612 QMAKE_OUTDIR="${QMAKE_OUTDIR}-shared"
5613 QMAKE_CONFIG="$QMAKE_CONFIG shared dll"
5614 elif [ "$CFG_SHARED" = "no" ]; then
5615 QMAKE_OUTDIR="${QMAKE_OUTDIR}-static"
5616 QMAKE_CONFIG="$QMAKE_CONFIG static"
5618 if [ "$PLATFORM_QWS" = "yes" ]; then
5619 QMAKE_OUTDIR="${QMAKE_OUTDIR}-emb-$CFG_EMBEDDED"
5620 QMAKE_CONFIG="$QMAKE_CONFIG embedded"
5621 QT_CONFIG="$QT_CONFIG embedded"
5622 rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
5624 QMakeVar set PRECOMPILED_DIR ".pch/$QMAKE_OUTDIR"
5625 QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR"
5626 QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR"
5627 QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR"
5628 QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR"
5629 if [ "$CFG_LARGEFILE" = "yes" ]; then
5630 QMAKE_CONFIG="$QMAKE_CONFIG largefile"
5632 if [ "$CFG_STL" = "no" ]; then
5633 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STL"
5634 else
5635 QMAKE_CONFIG="$QMAKE_CONFIG stl"
5637 if [ "$CFG_USE_GNUMAKE" = "yes" ]; then
5638 QMAKE_CONFIG="$QMAKE_CONFIG GNUmake"
5640 [ "$CFG_REDUCE_EXPORTS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_exports"
5641 [ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
5642 [ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
5643 if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
5644 QMakeVar add QMAKE_CFLAGS -g
5645 QMakeVar add QMAKE_CXXFLAGS -g
5646 QMAKE_CONFIG="$QMAKE_CONFIG separate_debug_info"
5648 [ "$CFG_MMX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mmx"
5649 [ "$CFG_3DNOW" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG 3dnow"
5650 [ "$CFG_SSE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse"
5651 [ "$CFG_SSE2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse2"
5652 [ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
5653 [ "$PLATFORM_MAC" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG $CFG_MAC_ARCHS"
5654 if [ "$CFG_IPV6" = "yes" ]; then
5655 QT_CONFIG="$QT_CONFIG ipv6"
5657 if [ "$CFG_CLOCK_GETTIME" = "yes" ]; then
5658 QT_CONFIG="$QT_CONFIG clock-gettime"
5660 if [ "$CFG_CLOCK_MONOTONIC" = "yes" ]; then
5661 QT_CONFIG="$QT_CONFIG clock-monotonic"
5663 if [ "$CFG_MREMAP" = "yes" ]; then
5664 QT_CONFIG="$QT_CONFIG mremap"
5666 if [ "$CFG_GETADDRINFO" = "yes" ]; then
5667 QT_CONFIG="$QT_CONFIG getaddrinfo"
5669 if [ "$CFG_IPV6IFNAME" = "yes" ]; then
5670 QT_CONFIG="$QT_CONFIG ipv6ifname"
5672 if [ "$CFG_GETIFADDRS" = "yes" ]; then
5673 QT_CONFIG="$QT_CONFIG getifaddrs"
5675 if [ "$CFG_INOTIFY" = "yes" ]; then
5676 QT_CONFIG="$QT_CONFIG inotify"
5678 if [ "$CFG_LIBJPEG" = "system" ]; then
5679 QT_CONFIG="$QT_CONFIG system-jpeg"
5681 if [ "$CFG_JPEG" = "no" ]; then
5682 QT_CONFIG="$QT_CONFIG no-jpeg"
5683 elif [ "$CFG_JPEG" = "yes" ]; then
5684 QT_CONFIG="$QT_CONFIG jpeg"
5686 if [ "$CFG_LIBMNG" = "system" ]; then
5687 QT_CONFIG="$QT_CONFIG system-mng"
5689 if [ "$CFG_MNG" = "no" ]; then
5690 QT_CONFIG="$QT_CONFIG no-mng"
5691 elif [ "$CFG_MNG" = "yes" ]; then
5692 QT_CONFIG="$QT_CONFIG mng"
5694 if [ "$CFG_LIBPNG" = "no" ]; then
5695 CFG_PNG="no"
5697 if [ "$CFG_LIBPNG" = "system" ]; then
5698 QT_CONFIG="$QT_CONFIG system-png"
5700 if [ "$CFG_PNG" = "no" ]; then
5701 QT_CONFIG="$QT_CONFIG no-png"
5702 elif [ "$CFG_PNG" = "yes" ]; then
5703 QT_CONFIG="$QT_CONFIG png"
5705 if [ "$CFG_GIF" = "no" ]; then
5706 QT_CONFIG="$QT_CONFIG no-gif"
5707 elif [ "$CFG_GIF" = "yes" ]; then
5708 QT_CONFIG="$QT_CONFIG gif"
5710 if [ "$CFG_LIBTIFF" = "system" ]; then
5711 QT_CONFIG="$QT_CONFIG system-tiff"
5713 if [ "$CFG_TIFF" = "no" ]; then
5714 QT_CONFIG="$QT_CONFIG no-tiff"
5715 elif [ "$CFG_TIFF" = "yes" ]; then
5716 QT_CONFIG="$QT_CONFIG tiff"
5718 if [ "$CFG_LIBFREETYPE" = "no" ]; then
5719 QT_CONFIG="$QT_CONFIG no-freetype"
5720 elif [ "$CFG_LIBFREETYPE" = "system" ]; then
5721 QT_CONFIG="$QT_CONFIG system-freetype"
5722 else
5723 QT_CONFIG="$QT_CONFIG freetype"
5726 if [ "x$PLATFORM_MAC" = "xyes" ]; then
5727 #On Mac we implicitly link against libz, so we
5728 #never use the 3rdparty stuff.
5729 [ "$CFG_ZLIB" = "yes" ] && CFG_ZLIB="system"
5731 if [ "$CFG_ZLIB" = "yes" ]; then
5732 QT_CONFIG="$QT_CONFIG zlib"
5733 elif [ "$CFG_ZLIB" = "system" ]; then
5734 QT_CONFIG="$QT_CONFIG system-zlib"
5737 [ "$CFG_NIS" = "yes" ] && QT_CONFIG="$QT_CONFIG nis"
5738 [ "$CFG_CUPS" = "yes" ] && QT_CONFIG="$QT_CONFIG cups"
5739 [ "$CFG_ICONV" = "yes" ] && QT_CONFIG="$QT_CONFIG iconv"
5740 [ "$CFG_ICONV" = "gnu" ] && QT_CONFIG="$QT_CONFIG gnu-libiconv"
5741 [ "$CFG_GLIB" = "yes" ] && QT_CONFIG="$QT_CONFIG glib"
5742 [ "$CFG_GSTREAMER" = "yes" ] && QT_CONFIG="$QT_CONFIG gstreamer"
5743 [ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus"
5744 [ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked"
5745 [ "$CFG_NAS" = "system" ] && QT_CONFIG="$QT_CONFIG nas"
5746 [ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl"
5747 [ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked"
5749 if [ "$PLATFORM_X11" = "yes" ]; then
5750 [ "$CFG_SM" = "yes" ] && QT_CONFIG="$QT_CONFIG x11sm"
5752 # for some reason, the following libraries are not always built shared,
5753 # so *every* program/lib (including Qt) has to link against them
5754 if [ "$CFG_XSHAPE" = "yes" ]; then
5755 QT_CONFIG="$QT_CONFIG xshape"
5757 if [ "$CFG_XINERAMA" = "yes" ]; then
5758 QT_CONFIG="$QT_CONFIG xinerama"
5759 QMakeVar set QMAKE_LIBS_X11 '-lXinerama $$QMAKE_LIBS_X11'
5761 if [ "$CFG_XCURSOR" = "yes" ]; then
5762 QT_CONFIG="$QT_CONFIG xcursor"
5763 QMakeVar set QMAKE_LIBS_X11 '-lXcursor $$QMAKE_LIBS_X11'
5765 if [ "$CFG_XFIXES" = "yes" ]; then
5766 QT_CONFIG="$QT_CONFIG xfixes"
5767 QMakeVar set QMAKE_LIBS_X11 '-lXfixes $$QMAKE_LIBS_X11'
5769 if [ "$CFG_XRANDR" = "yes" ]; then
5770 QT_CONFIG="$QT_CONFIG xrandr"
5771 if [ "$CFG_XRENDER" != "yes" ]; then
5772 # libXrandr uses 1 function from libXrender, so we always have to have it :/
5773 QMakeVar set QMAKE_LIBS_X11 '-lXrandr -lXrender $$QMAKE_LIBS_X11'
5774 else
5775 QMakeVar set QMAKE_LIBS_X11 '-lXrandr $$QMAKE_LIBS_X11'
5778 if [ "$CFG_XRENDER" = "yes" ]; then
5779 QT_CONFIG="$QT_CONFIG xrender"
5780 QMakeVar set QMAKE_LIBS_X11 '-lXrender $$QMAKE_LIBS_X11'
5782 if [ "$CFG_MITSHM" = "yes" ]; then
5783 QT_CONFIG="$QT_CONFIG mitshm"
5785 if [ "$CFG_FONTCONFIG" = "yes" ]; then
5786 QT_CONFIG="$QT_CONFIG fontconfig"
5788 if [ "$CFG_XINPUT" = "yes" ]; then
5789 QMakeVar set QMAKE_LIBS_X11 '-lXi $$QMAKE_LIBS_X11'
5791 if [ "$CFG_XINPUT" = "yes" ]; then
5792 QT_CONFIG="$QT_CONFIG xinput tablet"
5794 if [ "$CFG_XKB" = "yes" ]; then
5795 QT_CONFIG="$QT_CONFIG xkb"
5799 [ '!' -z "$D_FLAGS" ] && QMakeVar add DEFINES "$D_FLAGS"
5800 [ '!' -z "$L_FLAGS" ] && QMakeVar add QMAKE_LIBDIR_FLAGS "$L_FLAGS"
5801 [ '!' -z "$l_FLAGS" ] && QMakeVar add LIBS "$l_FLAGS"
5803 if [ "$PLATFORM_MAC" = "yes" ]; then
5804 if [ "$CFG_RPATH" = "yes" ]; then
5805 QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname"
5807 elif [ -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_RPATH | awk '{print $3;}'`" ]; then
5808 if [ -n "$RPATH_FLAGS" ]; then
5809 echo
5810 echo "ERROR: -R cannot be used on this platform as \$QMAKE_RPATH is"
5811 echo " undefined."
5812 echo
5813 exit 1
5814 elif [ "$CFG_RPATH" = "yes" ]; then
5815 RPATH_MESSAGE=" NOTE: This platform does not support runtime library paths, using -no-rpath."
5816 CFG_RPATH=no
5818 else
5819 if [ "$CFG_RPATH" = "yes" ]; then
5820 # set the default rpath to the library installation directory
5821 RPATH_FLAGS="\"$QT_INSTALL_LIBS\" $RPATH_FLAGS"
5823 if [ -n "$RPATH_FLAGS" ]; then
5824 # add the user defined rpaths
5825 QMakeVar add QMAKE_RPATHDIR "$RPATH_FLAGS"
5829 if [ '!' -z "$I_FLAGS" ]; then
5830 # add the user define include paths
5831 QMakeVar add QMAKE_CFLAGS "$I_FLAGS"
5832 QMakeVar add QMAKE_CXXFLAGS "$I_FLAGS"
5835 # turn off exceptions for the compilers that support it
5836 if [ "$PLATFORM_QWS" = "yes" ]; then
5837 COMPILER=`echo $XPLATFORM | cut -f 3- -d-`
5838 else
5839 COMPILER=`echo $PLATFORM | cut -f 2- -d-`
5841 if [ "$CFG_EXCEPTIONS" = "unspecified" -a "$PLATFORM_QWS" = "yes" ]; then
5842 CFG_EXCEPTIONS=no
5845 if [ "$CFG_EXCEPTIONS" != "no" ]; then
5846 QTCONFIG_CONFIG="$QTCONFIG_CONFIG exceptions"
5850 # Some Qt modules are too advanced in C++ for some old compilers
5851 # Detect here the platforms where they are known to work.
5853 # See Qt documentation for more information on which features are
5854 # supported and on which compilers.
5856 canBuildQtXmlPatterns="yes"
5857 canBuildWebKit="$HAVE_STL"
5859 # WebKit requires stdint.h
5860 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stdint "Stdint" $L_FLAGS $I_FLAGS $l_FLAGS
5861 if [ $? != "0" ]; then
5862 canBuildWebKit="no"
5865 case "$XPLATFORM" in
5866 hpux-g++*)
5867 # PA-RISC's assembly is too limited
5868 # gcc 3.4 on that platform can't build QtXmlPatterns
5869 # the assembly it generates cannot be compiled
5871 # Check gcc's version
5872 case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
5875 3.4*)
5876 canBuildQtXmlPatterns="no"
5879 canBuildWebKit="no"
5880 canBuildQtXmlPatterns="no"
5882 esac
5884 *-g++*)
5885 # Check gcc's version
5886 case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
5887 4*|3.4*)
5889 3.3*)
5890 canBuildWebKit="no"
5893 canBuildWebKit="no"
5894 canBuildQtXmlPatterns="no"
5896 esac
5898 solaris-cc*)
5899 # Check the compiler version
5900 case `${QMAKE_CONF_COMPILER} -V 2>&1 | awk '{print $4}'` in
5902 canBuildWebKit="no"
5903 canBuildQtXmlPatterns="no"
5905 esac
5907 hpux-acc*)
5908 canBuildWebKit="no"
5909 canBuildQtXmlPatterns="no"
5911 hpuxi-acc*)
5912 canBuildWebKit="no"
5914 aix-xlc*)
5915 canBuildWebKit="no"
5916 canBuildQtXmlPatterns="no"
5918 irix-cc*)
5919 canBuildWebKit="no"
5921 esac
5923 if [ "$CFG_XMLPATTERNS" = "yes" -a "$CFG_EXCEPTIONS" = "no" ]; then
5924 echo "QtXmlPatterns was requested, but it can't be built due to exceptions being disabled."
5925 exit 1
5927 if [ "$CFG_XMLPATTERNS" = "auto" -a "$CFG_EXCEPTIONS" != "no" ]; then
5928 CFG_XMLPATTERNS="$canBuildQtXmlPatterns"
5929 elif [ "$CFG_EXCEPTIONS" = "no" ]; then
5930 CFG_XMLPATTERNS="no"
5932 if [ "$CFG_XMLPATTERNS" = "yes" ]; then
5933 QT_CONFIG="$QT_CONFIG xmlpatterns"
5934 else
5935 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XMLPATTERNS"
5938 if [ "$CFG_SVG" = "yes" ]; then
5939 QT_CONFIG="$QT_CONFIG svg"
5940 else
5941 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SVG"
5944 if [ "$CFG_WEBKIT" = "auto" ]; then
5945 CFG_WEBKIT="$canBuildWebKit"
5948 if [ "$CFG_WEBKIT" = "yes" ]; then
5949 QT_CONFIG="$QT_CONFIG webkit"
5950 # The reason we set CFG_WEBKIT, is such that the printed overview of what will be enabled, shows correctly.
5951 CFG_WEBKIT="yes"
5952 else
5953 CFG_WEBKIT="no"
5954 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WEBKIT"
5957 if [ "$CFG_SCRIPTTOOLS" = "auto" ]; then
5958 CFG_SCRIPTTOOLS="yes"
5961 if [ "$CFG_SCRIPTTOOLS" = "yes" ]; then
5962 QT_CONFIG="$QT_CONFIG scripttools"
5963 CFG_SCRIPTTOOLS="yes"
5964 else
5965 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPTTOOLS"
5968 if [ "$CFG_EXCEPTIONS" = "no" ]; then
5969 case "$COMPILER" in
5970 g++*)
5971 QMakeVar add QMAKE_CFLAGS -fno-exceptions
5972 QMakeVar add QMAKE_CXXFLAGS -fno-exceptions
5973 QMakeVar add QMAKE_LFLAGS -fno-exceptions
5975 cc*)
5976 case "$PLATFORM" in
5977 irix-cc*)
5978 QMakeVar add QMAKE_CFLAGS -LANG:exceptions=off
5979 QMakeVar add QMAKE_CXXFLAGS -LANG:exceptions=off
5980 QMakeVar add QMAKE_LFLAGS -LANG:exceptions=off
5982 *) ;;
5983 esac
5985 *) ;;
5986 esac
5987 QMAKE_CONFIG="$QMAKE_CONFIG exceptions_off"
5990 # On Mac, set the minimum deployment target using Xarch when that is supported (10.5 and up).
5991 # On 10.4 the deployment version is set to 10.3 globally using the QMAKE_MACOSX_DEPLOYMENT_TARGET env. variable
5992 # "-cocoa" on the command line means Cocoa is used in 32-bit mode also, in this case fall back on
5993 # QMAKE_MACOSX_DEPLOYMENT_TARGET which will be set to 10.5.
5994 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] && [ "$COMMANDLINE_MAC_COCOA" != "yes" ]; then
5995 if echo "$CFG_MAC_ARCHS" | grep '\<x86\>' > /dev/null 2>&1; then
5996 QMakeVar add QMAKE_CFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
5997 QMakeVar add QMAKE_CXXFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
5998 QMakeVar add QMAKE_LFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
5999 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86 "-arch i386 -Xarch_i386 -mmacosx-version-min=10.4"
6001 if echo "$CFG_MAC_ARCHS" | grep '\<ppc\>' > /dev/null 2>&1; then
6002 QMakeVar add QMAKE_CFLAGS "-Xarch_ppc -mmacosx-version-min=10.3"
6003 QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc -mmacosx-version-min=10.3"
6004 QMakeVar add QMAKE_LFLAGS "-Xarch_ppc -mmacosx-version-min=10.3"
6005 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=10.3"
6007 if echo "$CFG_MAC_ARCHS" | grep '\<x86_64\>' > /dev/null 2>&1; then
6008 QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
6009 QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
6010 QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
6011 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5"
6013 if echo "$CFG_MAC_ARCHS" | grep '\<ppc64\>' > /dev/null 2>&1; then
6014 QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
6015 QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
6016 QMakeVar add QMAKE_LFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
6017 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC_64 "-arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5"
6021 #-------------------------------------------------------------------------------
6022 # generate QT_BUILD_KEY
6023 #-------------------------------------------------------------------------------
6025 # some compilers generate binary incompatible code between different versions,
6026 # so we need to generate a build key that is different between these compilers
6027 case "$COMPILER" in
6028 g++*)
6029 # GNU C++
6030 COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
6032 case "$COMPILER_VERSION" in
6033 *.*.*)
6034 QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
6035 QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
6036 QT_GCC_PATCH_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
6038 *.*)
6039 QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\1,'`
6040 QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\2,'`
6041 QT_GCC_PATCH_VERSION=0
6043 esac
6045 case "$COMPILER_VERSION" in
6046 2.95.*)
6047 COMPILER_VERSION="2.95.*"
6049 3.*)
6050 COMPILER_VERSION="3.*"
6052 4.*)
6053 COMPILER_VERSION="4"
6057 esac
6058 [ '!' -z "$COMPILER_VERSION" ] && COMPILER="g++-${COMPILER_VERSION}"
6063 esac
6065 # QT_CONFIG can contain the following:
6067 # Things that affect the Qt API/ABI:
6069 # Options:
6070 # minimal-config small-config medium-config large-config full-config
6072 # Different edition modules:
6073 # network canvas table xml opengl sql
6075 # Options:
6076 # stl
6078 # Things that do not affect the Qt API/ABI:
6079 # system-jpeg no-jpeg jpeg
6080 # system-mng no-mng mng
6081 # system-png no-png png
6082 # system-zlib no-zlib zlib
6083 # system-libtiff no-libtiff
6084 # no-gif gif
6085 # debug release
6086 # dll staticlib
6088 # internal
6089 # nocrosscompiler
6090 # GNUmake
6091 # largefile
6092 # nis
6093 # nas
6094 # tablet
6095 # ipv6
6097 # X11 : x11sm xinerama xcursor xfixes xrandr xrender mitshm fontconfig xkb
6098 # Embedded: embedded freetype
6100 ALL_OPTIONS="stl"
6101 BUILD_CONFIG=
6102 BUILD_OPTIONS=
6104 # determine the build options
6105 for config_option in $QMAKE_CONFIG $QT_CONFIG; do
6106 SKIP="yes"
6107 case "$config_option" in
6108 *-config)
6109 # take the last *-config setting. this is the highest config being used,
6110 # and is the one that we will use for tagging plugins
6111 BUILD_CONFIG="$config_option"
6114 stl)
6115 # these config options affect the Qt API/ABI. they should influence
6116 # the generation of the buildkey, so we don't skip them
6117 SKIP="no"
6120 *) # skip all other options since they don't affect the Qt API/ABI.
6122 esac
6124 if [ "$SKIP" = "no" ]; then
6125 BUILD_OPTIONS="$BUILD_OPTIONS $config_option"
6127 done
6129 # put the options that we are missing into .options
6130 rm -f .options
6131 for opt in `echo $ALL_OPTIONS`; do
6132 SKIP="no"
6133 if echo $BUILD_OPTIONS | grep $opt >/dev/null 2>&1; then
6134 SKIP="yes"
6136 if [ "$SKIP" = "no" ]; then
6137 echo "$opt" >> .options
6139 done
6141 # reconstruct BUILD_OPTIONS with a sorted negative feature list
6142 # (ie. only things that are missing are will be put into the build key)
6143 BUILD_OPTIONS=
6144 if [ -f .options ]; then
6145 for opt in `sort -f .options | uniq`; do
6146 BUILD_OPTIONS="$BUILD_OPTIONS no-$opt"
6147 done
6149 rm -f .options
6151 # QT_NO* defines affect the Qt API (and binary compatibility). they need
6152 # to be included in the build key
6153 for build_option in $D_FLAGS; do
6154 build_option=`echo $build_option | cut -d \" -f 2 -`
6155 case "$build_option" in
6156 QT_NO*)
6157 echo "$build_option" >> .options
6160 # skip all other compiler defines
6162 esac
6163 done
6165 # sort the compile time defines (helps ensure that changes in this configure
6166 # script don't affect the QT_BUILD_KEY generation)
6167 if [ -f .options ]; then
6168 for opt in `sort -f .options | uniq`; do
6169 BUILD_OPTIONS="$BUILD_OPTIONS $opt"
6170 done
6172 rm -f .options
6174 BUILD_OPTIONS="$BUILD_CONFIG $BUILD_OPTIONS"
6175 # extract the operating system from the XPLATFORM
6176 TARGET_OPERATING_SYSTEM=`echo $XPLATFORM | cut -f 2- -d/ | cut -f -1 -d-`
6178 # when cross-compiling, don't include build-host information (build key is target specific)
6179 QT_BUILD_KEY="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
6180 MAC_NEED_TWO_BUILD_KEYS="no"
6181 if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then
6182 QT_BUILD_KEY_CARBON=$QT_BUILD_KEY
6183 TARGET_OPERATING_SYSTEM="$TARGET_OPERATING_SYSTEM-cocoa"
6184 QT_BUILD_KEY_COCOA="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
6185 if [ "$CFG_MAC_CARBON" = "no" ]; then
6186 QT_BUILD_KEY=$QT_BUILD_KEY_COCOA
6187 else
6188 MAC_NEED_TWO_BUILD_KEYS="yes"
6191 # don't break loading plugins build with an older version of Qt
6192 QT_BUILD_KEY_COMPAT=
6193 if [ "$QT_CROSS_COMPILE" = "no" ]; then
6194 # previous versions of Qt used a build key built from the uname
6195 QT_BUILD_KEY_COMPAT="$CFG_USER_BUILD_KEY $UNAME_MACHINE $UNAME_SYSTEM $COMPILER $BUILD_OPTIONS"
6197 # strip out leading/trailing/extra whitespace
6198 QT_BUILD_KEY=`echo $QT_BUILD_KEY | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
6199 QT_BUILD_KEY_COMPAT=`echo $QT_BUILD_KEY_COMPAT | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
6201 #-------------------------------------------------------------------------------
6202 # part of configuration information goes into qconfig.h
6203 #-------------------------------------------------------------------------------
6205 case "$CFG_QCONFIG" in
6206 full)
6207 echo "/* Everything */" >"$outpath/src/corelib/global/qconfig.h.new"
6210 tmpconfig="$outpath/src/corelib/global/qconfig.h.new"
6211 echo "#ifndef QT_BOOTSTRAPPED" >"$tmpconfig"
6212 cat "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" >>"$tmpconfig"
6213 echo "#endif" >>"$tmpconfig"
6215 esac
6217 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6219 /* Qt Edition */
6220 #ifndef QT_EDITION
6221 # define QT_EDITION $QT_EDITION
6222 #endif
6224 /* Machine byte-order */
6225 #define Q_BIG_ENDIAN 4321
6226 #define Q_LITTLE_ENDIAN 1234
6229 if [ "$MAC_NEED_TWO_BUILD_KEYS" = "no" ]; then
6230 echo "#define QT_BUILD_KEY \"$QT_BUILD_KEY\"" \
6231 >> "$outpath/src/corelib/global/qconfig.h.new"
6232 else
6233 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6235 #define QT_BUILD_KEY_CARBON "$QT_BUILD_KEY_CARBON"
6236 #define QT_BUILD_KEY_COCOA "$QT_BUILD_KEY_COCOA"
6240 if [ -n "$QT_BUILD_KEY_COMPAT" ]; then
6241 echo "#define QT_BUILD_KEY_COMPAT \"$QT_BUILD_KEY_COMPAT\"" \
6242 >> "$outpath/src/corelib/global/qconfig.h.new"
6244 echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
6246 echo "#ifdef QT_BOOTSTRAPPED" >>"$outpath/src/corelib/global/qconfig.h.new"
6247 if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
6248 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6249 #if defined(__BIG_ENDIAN__)
6250 # define Q_BYTE_ORDER Q_BIG_ENDIAN
6251 #elif defined(__LITTLE_ENDIAN__)
6252 # define Q_BYTE_ORDER Q_LITTLE_ENDIAN
6253 #else
6254 # error "Unable to determine byte order!"
6255 #endif
6257 else
6258 echo "#define Q_BYTE_ORDER $CFG_HOST_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
6260 echo "#else" >>"$outpath/src/corelib/global/qconfig.h.new"
6261 if [ "$CFG_ENDIAN" = "auto" ]; then
6262 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6263 #if defined(__BIG_ENDIAN__)
6264 # define Q_BYTE_ORDER Q_BIG_ENDIAN
6265 #elif defined(__LITTLE_ENDIAN__)
6266 # define Q_BYTE_ORDER Q_LITTLE_ENDIAN
6267 #else
6268 # error "Unable to determine byte order!"
6269 #endif
6271 else
6272 echo "#define Q_BYTE_ORDER $CFG_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
6274 echo "#endif" >>"$outpath/src/corelib/global/qconfig.h.new"
6276 if [ "$CFG_DOUBLEFORMAT" != "normal" ]; then
6277 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6278 /* Non-IEEE double format */
6279 #define Q_DOUBLE_LITTLE "01234567"
6280 #define Q_DOUBLE_BIG "76543210"
6281 #define Q_DOUBLE_LITTLE_SWAPPED "45670123"
6282 #define Q_DOUBLE_BIG_SWAPPED "32107654"
6283 #define Q_DOUBLE_FORMAT $CFG_DOUBLEFORMAT
6286 if [ "$CFG_ARMFPA" = "yes" ]; then
6287 if [ "$CFG_ARCH" != "$CFG_HOST_ARCH" ]; then
6288 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6289 #ifndef QT_BOOTSTRAPPED
6290 # define QT_ARMFPA
6291 #endif
6293 else
6294 echo "#define QT_ARMFPA" >>"$outpath/src/corelib/global/qconfig.h.new"
6298 CFG_ARCH_STR=`echo $CFG_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6299 CFG_HOST_ARCH_STR=`echo $CFG_HOST_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6300 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6301 /* Machine Architecture */
6302 #ifndef QT_BOOTSTRAPPED
6303 # define QT_ARCH_${CFG_ARCH_STR}
6304 #else
6305 # define QT_ARCH_${CFG_HOST_ARCH_STR}
6306 #endif
6309 echo '/* Compile time features */' >>"$outpath/src/corelib/global/qconfig.h.new"
6310 [ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\"" >>"$outpath/src/corelib/global/qconfig.h.new"
6312 if [ "$CFG_LARGEFILE" = "yes" ]; then
6313 echo "#define QT_LARGEFILE_SUPPORT 64" >>"$outpath/src/corelib/global/qconfig.h.new"
6316 # if both carbon and cocoa are specified, enable the autodetection code.
6317 if [ "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then
6318 echo "#define AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
6319 elif [ "$CFG_MAC_COCOA" = "yes" ]; then
6320 echo "#define QT_MAC_USE_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
6323 if [ "$CFG_FRAMEWORK" = "yes" ]; then
6324 echo "#define QT_MAC_FRAMEWORK_BUILD" >>"$outpath/src/corelib/global/qconfig.h.new"
6327 if [ "$PLATFORM_MAC" = "yes" ]; then
6328 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6329 #if defined(__LP64__)
6330 # define QT_POINTER_SIZE 8
6331 #else
6332 # define QT_POINTER_SIZE 4
6333 #endif
6335 else
6336 "$unixtests/ptrsize.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
6337 echo "#define QT_POINTER_SIZE $?" >>"$outpath/src/corelib/global/qconfig.h.new"
6341 echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
6343 if [ "$CFG_DEV" = "yes" ]; then
6344 echo "#define QT_BUILD_INTERNAL" >>"$outpath/src/corelib/global/qconfig.h.new"
6347 # Embedded compile time options
6348 if [ "$PLATFORM_QWS" = "yes" ]; then
6349 # Add QWS to config.h
6350 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_WS_QWS"
6352 # Add excluded decorations to $QCONFIG_FLAGS
6353 decors=`grep '^decorations -= ' "$QMAKE_VARS_FILE" | ${AWK} '{print $3}'`
6354 for decor in $decors; do
6355 NODECORATION=`echo $decor | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6356 QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_NO_QWS_DECORATION_${NODECORATION}"
6357 done
6359 # Figure which embedded drivers which are turned off
6360 CFG_GFX_OFF="$CFG_GFX_AVAILABLE"
6361 for ADRIVER in $CFG_GFX_ON; do
6362 CFG_GFX_OFF=`echo "${CFG_GFX_OFF} " | sed "s,${ADRIVER} ,,g"`
6363 done
6365 CFG_KBD_OFF="$CFG_KBD_AVAILABLE"
6366 # the um driver is currently not in the available list for external builds
6367 if [ "$CFG_DEV" = "no" ]; then
6368 CFG_KBD_OFF="$CFG_KBD_OFF um"
6370 for ADRIVER in $CFG_KBD_ON; do
6371 CFG_KBD_OFF=`echo "${CFG_KBD_OFF} " | sed "s,${ADRIVER} ,,g"`
6372 done
6374 CFG_MOUSE_OFF="$CFG_MOUSE_AVAILABLE"
6375 for ADRIVER in $CFG_MOUSE_ON; do
6376 CFG_MOUSE_OFF=`echo "${CFG_MOUSE_OFF} " | sed "s,${ADRIVER} ,,g"`
6377 done
6379 for DRIVER in $CFG_GFX_OFF; do
6380 NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6381 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_$NODRIVER"
6382 done
6384 for DRIVER in $CFG_KBD_OFF; do
6385 NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6386 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_KBD_$NODRIVER"
6387 done
6389 for DRIVER in $CFG_MOUSE_OFF; do
6390 NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6391 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_MOUSE_$NODRIVER"
6392 done
6393 fi # QWS
6395 if [ "${CFG_USE_FLOATMATH}" = "yes" ]; then
6396 QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_USE_MATH_H_FLOATS"
6399 # Add turned on SQL drivers
6400 for DRIVER in $CFG_SQL_AVAILABLE; do
6401 eval "VAL=\$CFG_SQL_$DRIVER"
6402 case "$VAL" in
6404 ONDRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6405 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SQL_$ONDRIVER"
6406 SQL_DRIVERS="$SQL_DRIVERS $DRIVER"
6408 plugin)
6409 SQL_PLUGINS="$SQL_PLUGINS $DRIVER"
6411 esac
6412 done
6415 QMakeVar set sql-drivers "$SQL_DRIVERS"
6416 QMakeVar set sql-plugins "$SQL_PLUGINS"
6418 # Add other configuration options to the qconfig.h file
6419 [ "$CFG_GIF" = "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_BUILTIN_GIF_READER=1"
6420 [ "$CFG_TIFF" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_TIFF"
6421 [ "$CFG_PNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_PNG"
6422 [ "$CFG_JPEG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_JPEG"
6423 [ "$CFG_MNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_MNG"
6424 [ "$CFG_ZLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB"
6425 [ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS"
6426 [ "$CFG_IPV6" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6"
6427 [ "$CFG_SXE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE"
6428 [ "$CFG_DBUS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS"
6430 if [ "$PLATFORM_QWS" != "yes" ]; then
6431 [ "$CFG_GRAPHICS_SYSTEM" = "raster" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RASTER"
6432 [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENGL"
6435 # X11/Unix/Mac only configs
6436 [ "$CFG_CUPS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CUPS"
6437 [ "$CFG_ICONV" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICONV"
6438 [ "$CFG_GLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLIB"
6439 [ "$CFG_GSTREAMER" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GSTREAMER"
6440 [ "$CFG_QGTKSTYLE" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_GTK"
6441 [ "$CFG_CLOCK_MONOTONIC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CLOCK_MONOTONIC"
6442 [ "$CFG_MREMAP" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MREMAP"
6443 [ "$CFG_GETADDRINFO" = "no" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETADDRINFO"
6444 [ "$CFG_IPV6IFNAME" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6IFNAME"
6445 [ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS"
6446 [ "$CFG_INOTIFY" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY"
6447 [ "$CFG_NAS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NAS"
6448 [ "$CFG_NIS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS"
6449 [ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL"
6450 [ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL"
6452 [ "$CFG_SM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SESSIONMANAGER"
6453 [ "$CFG_XCURSOR" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XCURSOR"
6454 [ "$CFG_XFIXES" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XFIXES"
6455 [ "$CFG_FONTCONFIG" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FONTCONFIG"
6456 [ "$CFG_XINERAMA" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINERAMA"
6457 [ "$CFG_XKB" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XKB"
6458 [ "$CFG_XRANDR" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRANDR"
6459 [ "$CFG_XRENDER" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRENDER"
6460 [ "$CFG_MITSHM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MITSHM"
6461 [ "$CFG_XSHAPE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE"
6462 [ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET"
6464 [ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR"
6465 [ "$CFG_XINERAMA" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINERAMA"
6466 [ "$CFG_XFIXES" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XFIXES"
6467 [ "$CFG_XRANDR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XRANDR"
6468 [ "$CFG_XINPUT" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINPUT"
6470 # sort QCONFIG_FLAGS for neatness if we can
6471 [ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq`
6472 QCONFIG_FLAGS=`echo $QCONFIG_FLAGS`
6474 if [ -n "$QCONFIG_FLAGS" ]; then
6475 for cfg in $QCONFIG_FLAGS; do
6476 cfgd=`echo $cfg | sed 's/=.*$//'` # trim pushed 'Foo=Bar' defines
6477 cfg=`echo $cfg | sed 's/=/ /'` # turn first '=' into a space
6478 # figure out define logic, so we can output the correct
6479 # ifdefs to override the global defines in a project
6480 cfgdNeg=
6481 if [ true ] && echo "$cfgd" | grep 'QT_NO_' >/dev/null 2>&1; then
6482 # QT_NO_option can be forcefully turned on by QT_option
6483 cfgdNeg=`echo $cfgd | sed "s,QT_NO_,QT_,"`
6484 elif [ true ] && echo "$cfgd" | grep 'QT_' >/dev/null 2>&1; then
6485 # QT_option can be forcefully turned off by QT_NO_option
6486 cfgdNeg=`echo $cfgd | sed "s,QT_,QT_NO_,"`
6489 if [ -z $cfgdNeg ]; then
6490 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
6491 #ifndef $cfgd
6492 # define $cfg
6493 #endif
6496 else
6497 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
6498 #if defined($cfgd) && defined($cfgdNeg)
6499 # undef $cfgd
6500 #elif !defined($cfgd) && !defined($cfgdNeg)
6501 # define $cfg
6502 #endif
6506 done
6509 if [ "$CFG_REDUCE_EXPORTS" = "yes" ]; then
6510 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
6511 #define QT_VISIBILITY_AVAILABLE
6516 # avoid unecessary rebuilds by copying only if qconfig.h has changed
6517 if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
6518 rm -f "$outpath/src/corelib/global/qconfig.h.new"
6519 else
6520 [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h"
6521 mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
6522 chmod -w "$outpath/src/corelib/global/qconfig.h"
6523 for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
6524 if [ '!' -f "$conf" ]; then
6525 ln -s "$outpath/src/corelib/global/qconfig.h" "$conf"
6527 done
6530 #-------------------------------------------------------------------------------
6531 # save configuration into qconfig.pri
6532 #-------------------------------------------------------------------------------
6534 QTCONFIG="$outpath/mkspecs/qconfig.pri"
6535 QTCONFIG_CONFIG="$QTCONFIG_CONFIG no_mocdepend"
6536 [ -f "$QTCONFIG.tmp" ] && rm -f "$QTCONFIG.tmp"
6537 if [ "$CFG_DEBUG" = "yes" ]; then
6538 QTCONFIG_CONFIG="$QTCONFIG_CONFIG debug"
6539 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
6540 QT_CONFIG="$QT_CONFIG release"
6542 QT_CONFIG="$QT_CONFIG debug"
6543 elif [ "$CFG_DEBUG" = "no" ]; then
6544 QTCONFIG_CONFIG="$QTCONFIG_CONFIG release"
6545 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
6546 QT_CONFIG="$QT_CONFIG debug"
6548 QT_CONFIG="$QT_CONFIG release"
6550 if [ "$CFG_STL" = "yes" ]; then
6551 QTCONFIG_CONFIG="$QTCONFIG_CONFIG stl"
6553 if [ "$CFG_FRAMEWORK" = "no" ]; then
6554 QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_no_framework"
6555 else
6556 QT_CONFIG="$QT_CONFIG qt_framework"
6557 QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_framework"
6559 if [ "$PLATFORM_MAC" = "yes" ]; then
6560 QT_CONFIG="$QT_CONFIG $CFG_MAC_ARCHS"
6563 # Make the application arch follow the Qt arch for single arch builds.
6564 # (for multiple-arch builds, set CONFIG manually in the application .pro file)
6565 if [ `echo "$CFG_MAC_ARCHS" | wc -w` -eq 1 ]; then
6566 QTCONFIG_CONFIG="$QTCONFIG_CONFIG $CFG_MAC_ARCHS"
6569 cat >>"$QTCONFIG.tmp" <<EOF
6570 #configuration
6571 CONFIG += $QTCONFIG_CONFIG
6572 QT_ARCH = $CFG_ARCH
6573 QT_EDITION = $Edition
6574 QT_CONFIG += $QT_CONFIG
6576 #versioning
6577 QT_VERSION = $QT_VERSION
6578 QT_MAJOR_VERSION = $QT_MAJOR_VERSION
6579 QT_MINOR_VERSION = $QT_MINOR_VERSION
6580 QT_PATCH_VERSION = $QT_PATCH_VERSION
6582 #namespaces
6583 QT_LIBINFIX = $QT_LIBINFIX
6584 QT_NAMESPACE = $QT_NAMESPACE
6585 QT_NAMESPACE_MAC_CRC = $QT_NAMESPACE_MAC_CRC
6588 if [ "$CFG_RPATH" = "yes" ]; then
6589 echo "QMAKE_RPATHDIR += \"$QT_INSTALL_LIBS\"" >> "$QTCONFIG.tmp"
6591 if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
6592 echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION" >> "$QTCONFIG.tmp"
6593 echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION" >> "$QTCONFIG.tmp"
6594 echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION" >> "$QTCONFIG.tmp"
6596 # replace qconfig.pri if it differs from the newly created temp file
6597 if cmp -s "$QTCONFIG.tmp" "$QTCONFIG"; then
6598 rm -f "$QTCONFIG.tmp"
6599 else
6600 mv -f "$QTCONFIG.tmp" "$QTCONFIG"
6603 #-------------------------------------------------------------------------------
6604 # save configuration into .qmake.cache
6605 #-------------------------------------------------------------------------------
6607 CACHEFILE="$outpath/.qmake.cache"
6608 [ -f "$CACHEFILE.tmp" ] && rm -f "$CACHEFILE.tmp"
6609 cat >>"$CACHEFILE.tmp" <<EOF
6610 CONFIG += $QMAKE_CONFIG dylib create_prl link_prl depend_includepath fix_output_dirs QTDIR_build
6611 QT_SOURCE_TREE = \$\$quote($relpath)
6612 QT_BUILD_TREE = \$\$quote($outpath)
6613 QT_BUILD_PARTS = $CFG_BUILD_PARTS
6614 QMAKE_ABSOLUTE_SOURCE_ROOT = \$\$QT_SOURCE_TREE
6615 QMAKE_MOC_SRC = \$\$QT_BUILD_TREE/src/moc
6617 #local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR
6618 QMAKE_MOC = \$\$QT_BUILD_TREE/bin/moc
6619 QMAKE_UIC = \$\$QT_BUILD_TREE/bin/uic
6620 QMAKE_UIC3 = \$\$QT_BUILD_TREE/bin/uic3
6621 QMAKE_RCC = \$\$QT_BUILD_TREE/bin/rcc
6622 QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp
6623 QMAKE_INCDIR_QT = \$\$QT_BUILD_TREE/include
6624 QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib
6628 if [ -n "$QT_CFLAGS_PSQL" ]; then
6629 echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$CACHEFILE.tmp"
6631 if [ -n "$QT_LFLAGS_PSQL" ]; then
6632 echo "QT_LFLAGS_PSQL = $QT_LFLAGS_PSQL" >> "$CACHEFILE.tmp"
6634 if [ -n "$QT_CFLAGS_MYSQL" ]; then
6635 echo "QT_CFLAGS_MYSQL = $QT_CFLAGS_MYSQL" >> "$CACHEFILE.tmp"
6637 if [ -n "$QT_LFLAGS_MYSQL" ]; then
6638 echo "QT_LFLAGS_MYSQL = $QT_LFLAGS_MYSQL" >> "$CACHEFILE.tmp"
6640 if [ -n "$QT_CFLAGS_SQLITE" ]; then
6641 echo "QT_CFLAGS_SQLITE = $QT_CFLAGS_SQLITE" >> "$CACHEFILE.tmp"
6643 if [ -n "$QT_LFLAGS_SQLITE" ]; then
6644 echo "QT_LFLAGS_SQLITE = $QT_LFLAGS_SQLITE" >> "$CACHEFILE.tmp"
6647 if [ "$QT_EDITION" != "QT_EDITION_OPENSOURCE" ]; then
6648 echo "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" >> "$CACHEFILE.tmp"
6651 #dump in the OPENSSL_LIBS info
6652 if [ '!' -z "$OPENSSL_LIBS" ]; then
6653 echo "OPENSSL_LIBS = $OPENSSL_LIBS" >> "$CACHEFILE.tmp"
6654 elif [ "$CFG_OPENSSL" = "linked" ]; then
6655 echo "OPENSSL_LIBS = -lssl -lcrypto" >> "$CACHEFILE.tmp"
6658 #dump in the SDK info
6659 if [ '!' -z "$CFG_SDK" ]; then
6660 echo "QMAKE_MAC_SDK = $CFG_SDK" >> "$CACHEFILE.tmp"
6663 # mac gcc -Xarch support
6664 if [ "$CFG_MAC_XARCH" = "no" ]; then
6665 echo "QMAKE_MAC_XARCH = no" >> "$CACHEFILE.tmp"
6668 #dump the qmake spec
6669 if [ -d "$outpath/mkspecs/$XPLATFORM" ]; then
6670 echo "QMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$XPLATFORM" >> "$CACHEFILE.tmp"
6671 else
6672 echo "QMAKESPEC = $XPLATFORM" >> "$CACHEFILE.tmp"
6675 # cmdline args
6676 cat "$QMAKE_VARS_FILE" >> "$CACHEFILE.tmp"
6677 rm -f "$QMAKE_VARS_FILE" 2>/dev/null
6679 # incrementals
6680 INCREMENTAL=""
6681 [ "$CFG_INCREMENTAL" = "auto" ] && "$WHICH" p4 >/dev/null 2>&1 && [ "$CFG_DEV" = "yes" ] && CFG_INCREMENTAL="yes"
6682 if [ "$CFG_INCREMENTAL" = "yes" ]; then
6683 find "$relpath" -perm u+w -mtime -3 | grep 'cpp$' | while read f; do
6684 # don't need to worry about generated files
6685 [ -r `echo $f | sed "s,cpp$,ui,"` ] && continue
6686 basename "$f" | grep '^moc_' >/dev/null 2>&1 && continue
6687 # done
6688 INCREMENTAL="$INCREMENTAL `basename \"$f\" | sed 's,.cpp,.o,'`"
6689 done
6690 [ '!' -z "$INCREMENTAL" ] && echo "QMAKE_INCREMENTAL += $INCREMENTAL" >> "$CACHEFILE.tmp"
6691 [ -r "$outpath/.qmake.incremental" ] && echo "include($outpath/.qmake.incremental)" >> "$CACHEFILE.tmp"
6694 # replace .qmake.cache if it differs from the newly created temp file
6695 if cmp -s "$CACHEFILE.tmp" "$CACHEFILE"; then
6696 rm -f "$CACHEFILE.tmp"
6697 else
6698 mv -f "$CACHEFILE.tmp" "$CACHEFILE"
6701 #-------------------------------------------------------------------------------
6702 # give feedback on configuration
6703 #-------------------------------------------------------------------------------
6705 case "$COMPILER" in
6706 g++*)
6707 if [ "$CFG_EXCEPTIONS" != "no" ]; then
6708 cat <<EOF
6710 This target is using the GNU C++ compiler ($PLATFORM).
6712 Recent versions of this compiler automatically include code for
6713 exceptions, which increase both the size of the Qt libraries and
6714 the amount of memory taken by your applications.
6716 You may choose to re-run `basename $0` with the -no-exceptions
6717 option to compile Qt without exceptions. This is completely binary
6718 compatible, and existing applications will continue to work.
6723 cc*)
6724 case "$PLATFORM" in
6725 irix-cc*)
6726 if [ "$CFG_EXCEPTIONS" != "no" ]; then
6727 cat <<EOF
6729 This target is using the MIPSpro C++ compiler ($PLATFORM).
6731 You may choose to re-run `basename $0` with the -no-exceptions
6732 option to compile Qt without exceptions. This will make the
6733 size of the Qt library smaller and reduce the amount of memory
6734 taken by your applications.
6739 *) ;;
6740 esac
6742 *) ;;
6743 esac
6745 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" == "no" ] && [ "$CFG_WEBKIT" = "yes" ] && [ "$CFG_DEBUG_RELEASE" == "yes" ]; then
6746 cat <<EOF
6747 WARNING: DWARF2 debug symbols are not enabled. Linking webkit
6748 in debug mode will run out of memory on systems with 2GB or less.
6749 Install Xcode 2.4.1 or higher to enable DWARF2, or configure with
6750 -no-webkit or -release to skip webkit debug.
6754 echo
6755 if [ "$XPLATFORM" = "$PLATFORM" ]; then
6756 echo "Build type: $PLATFORM"
6757 else
6758 echo "Building on: $PLATFORM"
6759 echo "Building for: $XPLATFORM"
6762 if [ "$PLATFORM_MAC" = "yes" ]; then
6763 echo "Architecture: $CFG_ARCH ($CFG_MAC_ARCHS )"
6764 else
6765 echo "Architecture: $CFG_ARCH"
6768 if [ "$PLATFORM_QWS" = "yes" ]; then
6769 echo "Host architecture: $CFG_HOST_ARCH"
6772 if [ "$PLATFORM_MAC" = "yes" ]; then
6773 if [ "$CFG_MAC_COCOA" = "yes" ]; then
6774 if [ "$CFG_MAC_CARBON" = "yes" ]; then
6775 echo "Using framework: Carbon for 32-bit, Cocoa for 64-bit"
6776 else
6777 echo "Using framework: Cocoa"
6779 else
6780 echo "Using framework: Carbon"
6784 if [ -n "$PLATFORM_NOTES" ]; then
6785 echo "Platform notes:"
6786 echo "$PLATFORM_NOTES"
6787 else
6788 echo
6791 if [ "$OPT_VERBOSE" = "yes" ]; then
6792 if echo '\c' | grep '\c' >/dev/null; then
6793 echo -n "qmake vars .......... "
6794 else
6795 echo "qmake vars .......... \c"
6797 cat "$QMAKE_VARS_FILE" | tr '\n' ' '
6798 echo "qmake switches ...... $QMAKE_SWITCHES"
6801 [ "$CFG_INCREMENTAL" = "yes" ] && [ '!' -z "$INCREMENTAL" ] && echo "Incremental ......... $INCREMENTAL"
6802 echo "Build ............... $CFG_BUILD_PARTS"
6803 echo "Configuration ....... $QMAKE_CONFIG $QT_CONFIG"
6804 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
6805 echo "Debug ............... yes (combined)"
6806 if [ "$CFG_DEBUG" = "yes" ]; then
6807 echo "Default Link ........ debug"
6808 else
6809 echo "Default Link ........ release"
6811 else
6812 echo "Debug ............... $CFG_DEBUG"
6814 echo "Qt 3 compatibility .. $CFG_QT3SUPPORT"
6815 [ "$CFG_DBUS" = "no" ] && echo "QtDBus module ....... no"
6816 [ "$CFG_DBUS" = "yes" ] && echo "QtDBus module ....... yes (run-time)"
6817 [ "$CFG_DBUS" = "linked" ] && echo "QtDBus module ....... yes (linked)"
6818 echo "QtScriptTools module $CFG_SCRIPTTOOLS"
6819 echo "QtXmlPatterns module $CFG_XMLPATTERNS"
6820 echo "Phonon module ....... $CFG_PHONON"
6821 echo "SVG module .......... $CFG_SVG"
6822 echo "WebKit module ....... $CFG_WEBKIT"
6823 echo "STL support ......... $CFG_STL"
6824 echo "PCH support ......... $CFG_PRECOMPILE"
6825 echo "MMX/3DNOW/SSE/SSE2.. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}"
6826 if [ "${CFG_ARCH}" = "arm" ]; then
6827 echo "iWMMXt support ...... ${CFG_IWMMXT}"
6829 [ "${PLATFORM_QWS}" != "yes" ] && echo "Graphics System ..... $CFG_GRAPHICS_SYSTEM"
6830 echo "IPv6 support ........ $CFG_IPV6"
6831 echo "IPv6 ifname support . $CFG_IPV6IFNAME"
6832 echo "getaddrinfo support . $CFG_GETADDRINFO"
6833 echo "getifaddrs support .. $CFG_GETIFADDRS"
6834 echo "Accessibility ....... $CFG_ACCESSIBILITY"
6835 echo "NIS support ......... $CFG_NIS"
6836 echo "CUPS support ........ $CFG_CUPS"
6837 echo "Iconv support ....... $CFG_ICONV"
6838 echo "Glib support ........ $CFG_GLIB"
6839 echo "GStreamer support ... $CFG_GSTREAMER"
6840 echo "Large File support .. $CFG_LARGEFILE"
6841 echo "GIF support ......... $CFG_GIF"
6842 if [ "$CFG_TIFF" = "no" ]; then
6843 echo "TIFF support ........ $CFG_TIFF"
6844 else
6845 echo "TIFF support ........ $CFG_TIFF ($CFG_LIBTIFF)"
6847 if [ "$CFG_JPEG" = "no" ]; then
6848 echo "JPEG support ........ $CFG_JPEG"
6849 else
6850 echo "JPEG support ........ $CFG_JPEG ($CFG_LIBJPEG)"
6852 if [ "$CFG_PNG" = "no" ]; then
6853 echo "PNG support ......... $CFG_PNG"
6854 else
6855 echo "PNG support ......... $CFG_PNG ($CFG_LIBPNG)"
6857 if [ "$CFG_MNG" = "no" ]; then
6858 echo "MNG support ......... $CFG_MNG"
6859 else
6860 echo "MNG support ......... $CFG_MNG ($CFG_LIBMNG)"
6862 echo "zlib support ........ $CFG_ZLIB"
6863 echo "Session management .. $CFG_SM"
6864 if [ "$PLATFORM_QWS" = "yes" ]; then
6865 echo "Embedded support .... $CFG_EMBEDDED"
6866 if [ "$CFG_QWS_FREETYPE" = "auto" ]; then
6867 echo "Freetype2 support ... $CFG_QWS_FREETYPE ($CFG_LIBFREETYPE)"
6868 else
6869 echo "Freetype2 support ... $CFG_QWS_FREETYPE"
6871 # Normalize the decoration output first
6872 CFG_GFX_ON=`echo ${CFG_GFX_ON}`
6873 CFG_GFX_PLUGIN=`echo ${CFG_GFX_PLUGIN}`
6874 echo "Graphics (qt) ....... ${CFG_GFX_ON}"
6875 echo "Graphics (plugin) ... ${CFG_GFX_PLUGIN}"
6876 CFG_DECORATION_ON=`echo ${CFG_DECORATION_ON}`
6877 CFG_DECORATION_PLUGIN=`echo ${CFG_DECORATION_PLUGIN}`
6878 echo "Decorations (qt) .... $CFG_DECORATION_ON"
6879 echo "Decorations (plugin) $CFG_DECORATION_PLUGIN"
6880 CFG_KBD_ON=`echo ${CFG_KBD_ON}`
6881 CFG_KBD_PLUGIN=`echo ${CFG_KBD_PLUGIN}`
6882 echo "Keyboard driver (qt). ${CFG_KBD_ON}"
6883 echo "Keyboard driver (plugin) ${CFG_KBD_PLUGIN}"
6884 CFG_MOUSE_ON=`echo ${CFG_MOUSE_ON}`
6885 CFG_MOUSE_PLUGIN=`echo ${CFG_MOUSE_PLUGIN}`
6886 echo "Mouse driver (qt) ... $CFG_MOUSE_ON"
6887 echo "Mouse driver (plugin) $CFG_MOUSE_PLUGIN"
6889 if [ "$CFG_OPENGL" = "desktop" ]; then
6890 echo "OpenGL support ...... yes (Desktop OpenGL)"
6891 elif [ "$CFG_OPENGL" = "es1" ]; then
6892 echo "OpenGL support ...... yes (OpenGL ES 1.x Common profile)"
6893 elif [ "$CFG_OPENGL" = "es1cl" ]; then
6894 echo "OpenGL support ...... yes (OpenGL ES 1.x Common Lite profile)"
6895 elif [ "$CFG_OPENGL" = "es2" ]; then
6896 echo "OpenGL support ...... yes (OpenGL ES 2.x)"
6897 else
6898 echo "OpenGL support ...... no"
6900 if [ "$PLATFORM_X11" = "yes" ]; then
6901 echo "NAS sound support ... $CFG_NAS"
6902 echo "XShape support ...... $CFG_XSHAPE"
6903 echo "Xinerama support .... $CFG_XINERAMA"
6904 echo "Xcursor support ..... $CFG_XCURSOR"
6905 echo "Xfixes support ...... $CFG_XFIXES"
6906 echo "Xrandr support ...... $CFG_XRANDR"
6907 echo "Xrender support ..... $CFG_XRENDER"
6908 echo "Xi support .......... $CFG_XINPUT"
6909 echo "MIT-SHM support ..... $CFG_MITSHM"
6910 echo "FontConfig support .. $CFG_FONTCONFIG"
6911 echo "XKB Support ......... $CFG_XKB"
6912 echo "immodule support .... $CFG_IM"
6913 echo "GTK theme support ... $CFG_QGTKSTYLE"
6915 [ "$CFG_SQL_mysql" != "no" ] && echo "MySQL support ....... $CFG_SQL_mysql"
6916 [ "$CFG_SQL_psql" != "no" ] && echo "PostgreSQL support .. $CFG_SQL_psql"
6917 [ "$CFG_SQL_odbc" != "no" ] && echo "ODBC support ........ $CFG_SQL_odbc"
6918 [ "$CFG_SQL_oci" != "no" ] && echo "OCI support ......... $CFG_SQL_oci"
6919 [ "$CFG_SQL_tds" != "no" ] && echo "TDS support ......... $CFG_SQL_tds"
6920 [ "$CFG_SQL_db2" != "no" ] && echo "DB2 support ......... $CFG_SQL_db2"
6921 [ "$CFG_SQL_ibase" != "no" ] && echo "InterBase support ... $CFG_SQL_ibase"
6922 [ "$CFG_SQL_sqlite2" != "no" ] && echo "SQLite 2 support .... $CFG_SQL_sqlite2"
6923 [ "$CFG_SQL_sqlite" != "no" ] && echo "SQLite support ...... $CFG_SQL_sqlite ($CFG_SQLITE)"
6925 OPENSSL_LINKAGE=""
6926 if [ "$CFG_OPENSSL" = "yes" ]; then
6927 OPENSSL_LINKAGE="(run-time)"
6928 elif [ "$CFG_OPENSSL" = "linked" ]; then
6929 OPENSSL_LINKAGE="(linked)"
6931 echo "OpenSSL support ..... $CFG_OPENSSL $OPENSSL_LINKAGE"
6933 [ "$CFG_PTMALLOC" != "no" ] && echo "Use ptmalloc ........ $CFG_PTMALLOC"
6935 # complain about not being able to use dynamic plugins if we are using a static build
6936 if [ "$CFG_SHARED" = "no" ]; then
6937 echo
6938 echo "WARNING: Using static linking will disable the use of dynamically"
6939 echo "loaded plugins. Make sure to import all needed static plugins,"
6940 echo "or compile needed modules into the library."
6941 echo
6943 if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
6944 echo
6945 echo "NOTE: When linking against OpenSSL, you can override the default"
6946 echo "library names through OPENSSL_LIBS."
6947 echo "For example:"
6948 echo " ./configure -openssl-linked OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto'"
6949 echo
6951 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "no" ]; then
6952 echo
6953 echo "NOTE: Mac OS X frameworks implicitly build debug and release Qt libraries."
6954 echo
6956 echo
6958 sepath=`echo "$relpath" | sed -e 's/\\./\\\\./g'`
6959 PROCS=1
6960 EXEC=""
6963 #-------------------------------------------------------------------------------
6964 # build makefiles based on the configuration
6965 #-------------------------------------------------------------------------------
6967 echo "Finding project files. Please wait..."
6968 "$outpath/bin/qmake" -prl -r "${relpath}/projects.pro"
6969 if [ -f "${relpath}/projects.pro" ]; then
6970 mkfile="${outpath}/Makefile"
6971 [ -f "$mkfile" ] && chmod +w "$mkfile"
6972 QTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" "${relpath}/projects.pro" -o "$mkfile"
6975 # .projects -> projects to process
6976 # .projects.1 -> qt and moc
6977 # .projects.2 -> subdirs and libs
6978 # .projects.3 -> the rest
6979 rm -f .projects .projects.1 .projects.2 .projects.3
6981 QMAKE_PROJECTS=`find "$relpath/." -name '*.pro' -print | sed 's-/\./-/-'`
6982 if [ -z "$AWK" ]; then
6983 for p in `echo $QMAKE_PROJECTS`; do
6984 echo "$p" >> .projects
6985 done
6986 else
6987 cat >projects.awk <<EOF
6988 BEGIN {
6989 files = 0
6990 target_file = ""
6991 input_file = ""
6993 first = "./.projects.1.tmp"
6994 second = "./.projects.2.tmp"
6995 third = "./.projects.3.tmp"
6998 FNR == 1 {
6999 if ( input_file ) {
7000 if ( ! target_file )
7001 target_file = third
7002 print input_file >target_file
7005 matched_target = 0
7006 template_lib = 0
7007 input_file = FILENAME
7008 target_file = ""
7011 /^(TARGET.*=)/ {
7012 if ( \$3 == "moc" || \$3 ~ /^Qt/ ) {
7013 target_file = first
7014 matched_target = 1
7018 matched_target == 0 && /^(TEMPLATE.*=)/ {
7019 if ( \$3 == "subdirs" )
7020 target_file = second
7021 else if ( \$3 == "lib" )
7022 template_lib = 1
7023 else
7024 target_file = third
7027 matched_target == 0 && template_lib == 1 && /^(CONFIG.*=)/ {
7028 if ( \$0 ~ /plugin/ )
7029 target_file = third
7030 else
7031 target_file = second
7034 END {
7035 if ( input_file ) {
7036 if ( ! target_file )
7037 target_file = third
7038 print input_file >>target_file
7044 rm -f .projects.all
7045 for p in `echo $QMAKE_PROJECTS`; do
7046 echo "$p" >> .projects.all
7047 done
7049 # if you get errors about the length of the command line to awk, change the -l arg
7050 # to split below
7051 split -l 100 .projects.all .projects.all.
7052 for p in .projects.all.*; do
7053 "$AWK" -f projects.awk `cat $p`
7054 [ -f .projects.1.tmp ] && cat .projects.1.tmp >> .projects.1
7055 [ -f .projects.2.tmp ] && cat .projects.2.tmp >> .projects.2
7056 [ -f .projects.3.tmp ] && cat .projects.3.tmp >> .projects.3
7057 rm -f .projects.1.tmp .projects.2.tmp .projects.3.tmp $p
7058 done
7059 rm -f .projects.all* projects.awk
7061 [ -f .projects.1 ] && cat .projects.1 >>.projects
7062 [ -f .projects.2 ] && cat .projects.2 >>.projects
7063 rm -f .projects.1 .projects.2
7064 if [ -f .projects.3 ] && [ "$OPT_FAST" = "no" ]; then
7065 cat .projects.3 >>.projects
7066 rm -f .projects.3
7069 # don't sort Qt and MOC in with the other project files
7070 # also work around a segfaulting uniq(1)
7071 if [ -f .sorted.projects.2 ]; then
7072 sort .sorted.projects.2 > .sorted.projects.2.new
7073 mv -f .sorted.projects.2.new .sorted.projects.2
7074 cat .sorted.projects.2 >> .sorted.projects.1
7076 [ -f .sorted.projects.1 ] && sort .sorted.projects.1 >> .sorted.projects
7077 rm -f .sorted.projects.2 .sorted.projects.1
7079 NORM_PROJECTS=0
7080 FAST_PROJECTS=0
7081 if [ -f .projects ]; then
7082 uniq .projects >.tmp
7083 mv -f .tmp .projects
7084 NORM_PROJECTS=`cat .projects | wc -l | sed -e "s, ,,g"`
7086 if [ -f .projects.3 ]; then
7087 uniq .projects.3 >.tmp
7088 mv -f .tmp .projects.3
7089 FAST_PROJECTS=`cat .projects.3 | wc -l | sed -e "s, ,,g"`
7091 echo " `expr $NORM_PROJECTS + $FAST_PROJECTS` projects found."
7092 echo
7094 PART_ROOTS=
7095 for part in $CFG_BUILD_PARTS; do
7096 case "$part" in
7097 tools) PART_ROOTS="$PART_ROOTS tools" ;;
7098 libs) PART_ROOTS="$PART_ROOTS src" ;;
7099 examples) PART_ROOTS="$PART_ROOTS examples demos" ;;
7100 *) ;;
7101 esac
7102 done
7104 if [ "$CFG_DEV" = "yes" ]; then
7105 PART_ROOTS="$PART_ROOTS tests"
7108 echo "Creating makefiles. Please wait..."
7109 for file in .projects .projects.3; do
7110 [ '!' -f "$file" ] && continue
7111 for a in `cat $file`; do
7112 IN_ROOT=no
7113 for r in $PART_ROOTS; do
7114 if echo "$a" | grep "^$r" >/dev/null 2>&1 || echo "$a" | grep "^$relpath/$r" >/dev/null 2>&1; then
7115 IN_ROOT=yes
7116 break
7118 done
7119 [ "$IN_ROOT" = "no" ] && continue
7121 case $a in
7122 *winmain/winmain.pro) continue ;;
7123 */qmake/qmake.pro) continue ;;
7124 *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*) SPEC=$QMAKESPEC ;;
7125 *) SPEC=$XQMAKESPEC ;;
7126 esac
7127 dir=`dirname $a | sed -e "s;$sepath;.;g"`
7128 test -d "$dir" || mkdir -p "$dir"
7129 OUTDIR="$outpath/$dir"
7130 if [ -f "${OUTDIR}/Makefile" ] && [ "$OPT_FAST" = "yes" ]; then
7131 # fast configure - the makefile exists, skip it
7132 # since the makefile exists, it was generated by qmake, which means we
7133 # can skip it, since qmake has a rule to regenerate the makefile if the .pro
7134 # file changes...
7135 [ "$OPT_VERBOSE" = "yes" ] && echo " skipping $a"
7136 continue;
7138 QMAKE_SPEC_ARGS="-spec $SPEC"
7139 if echo '\c' | grep '\c' >/dev/null; then
7140 echo -n " for $a"
7141 else
7142 echo " for $a\c"
7145 QMAKE="$outpath/bin/qmake"
7146 QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS"
7147 if [ "$file" = ".projects.3" ]; then
7148 if echo '\c' | grep '\c' >/dev/null; then
7149 echo -n " (fast)"
7150 else
7151 echo " (fast)\c"
7153 echo
7155 cat >"${OUTDIR}/Makefile" <<EOF
7156 # ${OUTDIR}/Makefile: generated by configure
7158 # WARNING: This makefile will be replaced with a real makefile.
7159 # All changes made to this file will be lost.
7161 [ "$CFG_DEBUG_RELEASE" = "no" ] && echo "first_target: first" >>${OUTDIR}/Makefile
7163 cat >>"${OUTDIR}/Makefile" <<EOF
7164 QMAKE = "$QMAKE"
7165 all clean install qmake first Makefile: FORCE
7166 \$(QMAKE) $QMAKE_ARGS -o "$OUTDIR" "$a"
7167 cd "$OUTDIR"
7168 \$(MAKE) \$@
7170 FORCE:
7173 else
7174 if [ "$OPT_VERBOSE" = "yes" ]; then
7175 echo " (`basename $SPEC`)"
7176 echo "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
7177 else
7178 echo
7181 [ -f "${OUTDIR}/Makefile" ] && chmod +w "${OUTDIR}/Makefile"
7182 QTDIR="$outpath" "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
7184 done
7185 done
7186 rm -f .projects .projects.3
7188 #-------------------------------------------------------------------------------
7189 # XShape is important, DnD in the Designer doens't work without it
7190 #-------------------------------------------------------------------------------
7191 if [ "$PLATFORM_X11" = "yes" ] && [ "$CFG_XSHAPE" = "no" ]; then
7192 cat <<EOF
7194 NOTICE: Qt will not be built with XShape support.
7196 As a result, drag-and-drop in the Qt Designer will NOT
7197 work. We recommend that you enable XShape support by passing
7198 the -xshape switch to $0.
7202 #-------------------------------------------------------------------------------
7203 # check for platforms that we don't yet know about
7204 #-------------------------------------------------------------------------------
7205 if [ "$CFG_ARCH" = "generic" ]; then
7206 cat <<EOF
7208 NOTICE: Atomic operations are not yet supported for this
7209 architecture.
7211 Qt will use the 'generic' architecture instead, which uses a
7212 single pthread_mutex_t to protect all atomic operations. This
7213 implementation is the slow (but safe) fallback implementation
7214 for architectures Qt does not yet support.
7218 #-------------------------------------------------------------------------------
7219 # check if the user passed the -no-zlib option, which is no longer supported
7220 #-------------------------------------------------------------------------------
7221 if [ -n "$ZLIB_FORCED" ]; then
7222 which_zlib="supplied"
7223 if [ "$CFG_ZLIB" = "system" ]; then
7224 which_zlib="system"
7227 cat <<EOF
7229 NOTICE: The -no-zlib option was supplied but is no longer
7230 supported.
7232 Qt now requires zlib support in all builds, so the -no-zlib
7233 option was ignored. Qt will be built using the $which_zlib
7234 zlib.
7238 #-------------------------------------------------------------------------------
7239 # finally save the executed command to another script
7240 #-------------------------------------------------------------------------------
7241 if [ `basename $0` != "config.status" ]; then
7242 CONFIG_STATUS="$relpath/$relconf $OPT_CMDLINE"
7244 # add the system variables
7245 for varname in $SYSTEM_VARIABLES; do
7246 cmd=`echo \
7247 'if [ -n "\$'${varname}'" ]; then
7248 CONFIG_STATUS="'${varname}'='"'\\\$${varname}'"' \$CONFIG_STATUS"
7249 fi'`
7250 eval "$cmd"
7251 done
7253 echo "$CONFIG_STATUS" | grep '\-confirm\-license' >/dev/null 2>&1 || CONFIG_STATUS="$CONFIG_STATUS -confirm-license"
7255 [ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
7256 echo "#!/bin/sh" > "$outpath/config.status"
7257 echo "if [ \"\$#\" -gt 0 ]; then" >> "$outpath/config.status"
7258 echo " $CONFIG_STATUS \"\$@\"" >> "$outpath/config.status"
7259 echo "else" >> "$outpath/config.status"
7260 echo " $CONFIG_STATUS" >> "$outpath/config.status"
7261 echo "fi" >> "$outpath/config.status"
7262 chmod +x "$outpath/config.status"
7265 if [ -n "$RPATH_MESSAGE" ]; then
7266 echo
7267 echo "$RPATH_MESSAGE"
7270 MAKE=`basename $MAKE`
7271 echo
7272 echo Qt is now configured for building. Just run \'$MAKE\'.
7273 if [ "$relpath" = "$QT_INSTALL_PREFIX" ]; then
7274 echo Once everything is built, Qt is installed.
7275 echo You should not run \'$MAKE install\'.
7276 else
7277 echo Once everything is built, you must run \'$MAKE install\'.
7278 echo Qt will be installed into $QT_INSTALL_PREFIX
7280 echo
7281 echo To reconfigure, run \'$MAKE confclean\' and \'configure\'.
7282 echo