New binary for Windows configure
[qt-netbsd.git] / configure
blob7e66a98532fe839e1cfbab2293255a6b1f4385da
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 # Check we actually have X11 :-)
4731 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xlib "XLib" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
4732 echo "Basic XLib functionality test failed!"
4733 echo " You might need to modify the include and library search paths by editing"
4734 echo " QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in ${XQMAKESPEC}."
4735 exit 1
4738 # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x)
4739 if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
4740 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
4741 CFG_OPENGL=desktop
4742 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
4743 CFG_OPENGL=es2
4744 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
4745 CFG_OPENGL=es1
4746 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
4747 CFG_OPENGL=es1cl
4748 else
4749 if [ "$CFG_OPENGL" = "yes" ]; then
4750 echo "All the OpenGL functionality tests failed!"
4751 echo " You might need to modify the include and library search paths by editing"
4752 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4753 echo " ${XQMAKESPEC}."
4754 exit 1
4756 CFG_OPENGL=no
4758 case "$PLATFORM" in
4759 hpux*)
4760 # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
4761 if [ "$CFG_OPENGL" = "desktop" ]; then
4762 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
4763 QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
4769 esac
4770 elif [ "$CFG_OPENGL" = "es1cl" ]; then
4771 # OpenGL ES 1.x common lite
4772 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
4773 echo "The OpenGL ES 1.x Common Lite Profile functionality test failed!"
4774 echo " You might need to modify the include and library search paths by editing"
4775 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4776 echo " ${XQMAKESPEC}."
4777 exit 1
4779 elif [ "$CFG_OPENGL" = "es1" ]; then
4780 # OpenGL ES 1.x
4781 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
4782 echo "The OpenGL ES 1.x functionality test failed!"
4783 echo " You might need to modify the include and library search paths by editing"
4784 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4785 echo " ${XQMAKESPEC}."
4786 exit 1
4788 elif [ "$CFG_OPENGL" = "es2" ]; then
4789 #OpenGL ES 2.x
4790 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
4791 echo "The OpenGL ES 2.0 functionality test failed!"
4792 echo " You might need to modify the include and library search paths by editing"
4793 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4794 echo " ${XQMAKESPEC}."
4795 exit 1
4797 elif [ "$CFG_OPENGL" = "desktop" ]; then
4798 # Desktop OpenGL support
4799 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
4800 echo "The OpenGL functionality test failed!"
4801 echo " You might need to modify the include and library search paths by editing"
4802 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4803 echo " ${XQMAKESPEC}."
4804 exit 1
4806 case "$PLATFORM" in
4807 hpux*)
4808 # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
4809 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
4810 QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
4815 esac
4818 # if opengl is disabled and the user specified graphicssystem gl, disable it...
4819 if [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && [ "$CFG_OPENGL" = "no" ]; then
4820 echo "OpenGL Graphics System is disabled due to missing OpenGL support..."
4821 CFG_GRAPHICS_SYSTEM=default
4824 # auto-detect Xcursor support
4825 if [ "$CFG_XCURSOR" != "no" ]; then
4826 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
4827 if [ "$CFG_XCURSOR" != "runtime" ]; then
4828 CFG_XCURSOR=yes;
4830 else
4831 if [ "$CFG_XCURSOR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4832 echo "Xcursor support cannot be enabled due to functionality tests!"
4833 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4834 echo " If you believe this message is in error you may use the continue"
4835 echo " switch (-continue) to $0 to continue."
4836 exit 101
4837 else
4838 CFG_XCURSOR=no
4843 # auto-detect Xfixes support
4844 if [ "$CFG_XFIXES" != "no" ]; then
4845 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xfixes "Xfixes" $L_FLAGS $I_FLAGS $X11TESTS_FLAGS; then
4846 if [ "$CFG_XFIXES" != "runtime" ]; then
4847 CFG_XFIXES=yes;
4849 else
4850 if [ "$CFG_XFIXES" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4851 echo "Xfixes support cannot be enabled due to functionality tests!"
4852 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4853 echo " If you believe this message is in error you may use the continue"
4854 echo " switch (-continue) to $0 to continue."
4855 exit 101
4856 else
4857 CFG_XFIXES=no
4862 # auto-detect Xrandr support (resize and rotate extension)
4863 if [ "$CFG_XRANDR" != "no" ]; then
4864 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
4865 if [ "$CFG_XRANDR" != "runtime" ]; then
4866 CFG_XRANDR=yes
4868 else
4869 if [ "$CFG_XRANDR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4870 echo "Xrandr support cannot be enabled due to functionality tests!"
4871 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4872 echo " If you believe this message is in error you may use the continue"
4873 echo " switch (-continue) to $0 to continue."
4874 exit 101
4875 else
4876 CFG_XRANDR=no
4881 # auto-detect Xrender support
4882 if [ "$CFG_XRENDER" != "no" ]; then
4883 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
4884 CFG_XRENDER=yes
4885 else
4886 if [ "$CFG_XRENDER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4887 echo "Xrender support cannot be enabled due to functionality tests!"
4888 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4889 echo " If you believe this message is in error you may use the continue"
4890 echo " switch (-continue) to $0 to continue."
4891 exit 101
4892 else
4893 CFG_XRENDER=no
4898 # auto-detect MIT-SHM support
4899 if [ "$CFG_MITSHM" != "no" ]; then
4900 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
4901 CFG_MITSHM=yes
4902 else
4903 if [ "$CFG_MITSHM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4904 echo "MITSHM support cannot be enabled due to functionality tests!"
4905 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4906 echo " If you believe this message is in error you may use the continue"
4907 echo " switch (-continue) to $0 to continue."
4908 exit 101
4909 else
4910 CFG_MITSHM=no
4915 # auto-detect FontConfig support
4916 if [ "$CFG_FONTCONFIG" != "no" ]; then
4917 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig 2>/dev/null; then
4918 QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig 2>/dev/null`
4919 QT_LIBS_FONTCONFIG=`$PKG_CONFIG --libs fontconfig 2>/dev/null`
4920 else
4921 QT_CFLAGS_FONTCONFIG=
4922 QT_LIBS_FONTCONFIG="-lfreetype -lfontconfig"
4924 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
4925 CFG_FONTCONFIG=yes
4926 QMakeVar set QMAKE_CFLAGS_X11 "$QT_CFLAGS_FONTCONFIG \$\$QMAKE_CFLAGS_X11"
4927 QMakeVar set QMAKE_LIBS_X11 "$QT_LIBS_FONTCONFIG \$\$QMAKE_LIBS_X11"
4928 CFG_LIBFREETYPE=system
4929 else
4930 if [ "$CFG_FONTCONFIG" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4931 echo "FontConfig support cannot be enabled due to functionality tests!"
4932 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4933 echo " If you believe this message is in error you may use the continue"
4934 echo " switch (-continue) to $0 to continue."
4935 exit 101
4936 else
4937 CFG_FONTCONFIG=no
4942 # auto-detect Session Management support
4943 if [ "$CFG_SM" = "auto" ]; then
4944 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
4945 CFG_SM=yes
4946 else
4947 if [ "$CFG_SM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4948 echo "Session Management support cannot be enabled due to functionality tests!"
4949 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4950 echo " If you believe this message is in error you may use the continue"
4951 echo " switch (-continue) to $0 to continue."
4952 exit 101
4953 else
4954 CFG_SM=no
4959 # auto-detect SHAPE support
4960 if [ "$CFG_XSHAPE" != "no" ]; then
4961 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
4962 CFG_XSHAPE=yes
4963 else
4964 if [ "$CFG_XSHAPE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4965 echo "XShape support cannot be enabled due to functionality tests!"
4966 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4967 echo " If you believe this message is in error you may use the continue"
4968 echo " switch (-continue) to $0 to continue."
4969 exit 101
4970 else
4971 CFG_XSHAPE=no
4976 # auto-detect Xinerama support
4977 if [ "$CFG_XINERAMA" != "no" ]; then
4978 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
4979 if [ "$CFG_XINERAMA" != "runtime" ]; then
4980 CFG_XINERAMA=yes
4982 else
4983 if [ "$CFG_XINERAMA" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4984 echo "Xinerama support cannot be enabled due to functionality tests!"
4985 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4986 echo " If you believe this message is in error you may use the continue"
4987 echo " switch (-continue) to $0 to continue."
4988 exit 101
4989 else
4990 CFG_XINERAMA=no
4995 # auto-detect Xinput support
4996 if [ "$CFG_XINPUT" != "no" ]; then
4997 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
4998 if [ "$CFG_XINPUT" != "runtime" ]; then
4999 CFG_XINPUT=yes
5001 else
5002 if [ "$CFG_XINPUT" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5003 echo "Tablet and Xinput support cannot be enabled due to functionality tests!"
5004 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5005 echo " If you believe this message is in error you may use the continue"
5006 echo " switch (-continue) to $0 to continue."
5007 exit 101
5008 else
5009 CFG_XINPUT=no
5014 # auto-detect XKB support
5015 if [ "$CFG_XKB" != "no" ]; then
5016 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
5017 CFG_XKB=yes
5018 else
5019 if [ "$CFG_XKB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5020 echo "XKB support cannot be enabled due to functionality tests!"
5021 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5022 echo " If you believe this message is in error you may use the continue"
5023 echo " switch (-continue) to $0 to continue."
5024 exit 101
5025 else
5026 CFG_XKB=no
5031 if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then
5032 if [ -n "$PKG_CONFIG" ]; then
5033 QT_CFLAGS_QGTKSTYLE=`$PKG_CONFIG --cflags gtk+-2.0 ">=" 2.10 atk 2>/dev/null`
5034 QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
5036 if [ -n "$QT_CFLAGS_QGTKSTYLE" ] ; then
5037 CFG_QGTKSTYLE=yes
5038 QMakeVar set QT_CFLAGS_QGTKSTYLE "$QT_CFLAGS_QGTKSTYLE"
5039 QMakeVar set QT_LIBS_QGTKSTYLE "$QT_LIBS_QGTKSTYLE"
5040 else
5041 if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5042 echo "Gtk theme support cannot be enabled due to functionality tests!"
5043 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5044 echo " If you believe this message is in error you may use the continue"
5045 echo " switch (-continue) to $0 to continue."
5046 exit 101
5047 else
5048 CFG_QGTKSTYLE=no
5051 elif [ "$CFG_GLIB" = "no" ]; then
5052 CFG_QGTKSTYLE=no
5054 fi # X11
5057 if [ "$PLATFORM_MAC" = "yes" ]; then
5058 if [ "$CFG_PHONON" != "no" ]; then
5059 # Always enable Phonon (unless it was explicitly disabled)
5060 CFG_PHONON=yes
5064 # QWS
5065 if [ "$PLATFORM_QWS" = "yes" ]; then
5067 # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x)
5068 if [ "$CFG_OPENGL" = "yes" ]; then
5069 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
5070 CFG_OPENGL=es2
5071 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
5072 CFG_OPENGL=es1
5073 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
5074 CFG_OPENGL=es1cl
5075 else
5076 echo "All the OpenGL ES functionality tests failed!"
5077 echo " You might need to modify the include and library search paths by editing"
5078 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5079 echo " ${XQMAKESPEC}."
5080 exit 1
5082 elif [ "$CFG_OPENGL" = "es1" ]; then
5083 # OpenGL ES 1.x
5084 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
5085 echo "The OpenGL ES 1.x functionality test failed!"
5086 echo " You might need to modify the include and library search paths by editing"
5087 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5088 echo " ${XQMAKESPEC}."
5089 exit 1
5091 elif [ "$CFG_OPENGL" = "es2" ]; then
5092 #OpenGL ES 2.x
5093 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
5094 echo "The OpenGL ES 2.0 functionality test failed!"
5095 echo " You might need to modify the include and library search paths by editing"
5096 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5097 echo " ${XQMAKESPEC}."
5098 exit 1
5100 elif [ "$CFG_OPENGL" = "desktop" ]; then
5101 # Desktop OpenGL support
5102 echo "Desktop OpenGL support is not avaliable on Qt for Embedded Linux"
5103 exit 1
5106 # screen drivers
5107 for screen in ${CFG_GFX_ON} ${CFG_GFX_PLUGIN}; do
5108 if [ "${screen}" = "ahi" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5109 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/ahi "Ahi" $L_FLAGS $I_FLAGS $l_FLAGS; then
5110 echo "The Ahi screen driver functionality test failed!"
5111 echo " You might need to modify the include and library search paths by editing"
5112 echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
5113 echo " ${XQMAKESPEC}."
5114 exit 1
5118 if [ "${screen}" = "svgalib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5119 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/svgalib "SVGAlib" $L_FLAGS $I_FLAGS $l_FLAGS; then
5120 echo "The SVGAlib screen driver functionality test failed!"
5121 echo " You might need to modify the include and library search paths by editing"
5122 echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
5123 echo " ${XQMAKESPEC}."
5124 exit 1
5128 if [ "${screen}" = "directfb" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5129 if [ -n "$PKG_CONFIG" ]; then
5130 if $PKG_CONFIG --exists directfb 2>/dev/null; then
5131 QT_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
5132 QT_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
5133 elif directfb-config --version >/dev/null 2>&1; then
5134 QT_CFLAGS_DIRECTFB=`directfb-config --cflags 2>/dev/null`
5135 QT_LIBS_DIRECTFB=`directfb-config --libs 2>/dev/null`
5139 # QMake variables set here override those in the mkspec. Therefore we only set the variables here if they are not zero.
5140 if [ -n "$QT_CFLAGS_DIRECTFB" ] || [ -n "$QT_LIBS_DIRECTFB" ]; then
5141 QMakeVar set QT_CFLAGS_DIRECTFB "$QT_CFLAGS_DIRECTFB"
5142 QMakeVar set QT_LIBS_DIRECTFB "$QT_LIBS_DIRECTFB"
5145 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
5146 echo "The DirectFB screen driver functionality test failed!"
5147 echo " You might need to modify the include and library search paths by editing"
5148 echo " QT_CFLAGS_DIRECTFB and QT_LIBS_DIRECTFB in"
5149 echo " ${XQMAKESPEC}."
5150 exit 1
5154 done
5156 # mouse drivers
5157 for mouse in ${CFG_MOUSE_ON} ${CFG_MOUSE_PLUGIN}; do
5158 if [ "${mouse}" = "tslib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5159 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tslib "tslib" $L_FLAGS $I_FLAGS $l_FLAGS; then
5160 echo "The tslib functionality test failed!"
5161 echo " You might need to modify the include and library search paths by editing"
5162 echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
5163 echo " ${XQMAKESPEC}."
5164 exit 1
5167 done
5169 CFG_QGTKSTYLE=no
5171 # sound
5172 if ! "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/sound "sound" $L_FLAGS $I_FLAGS $l_FLAGS; then
5173 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SOUND"
5176 fi # QWS
5178 # freetype support
5179 [ "x$CFG_EMBEDDED" != "xno" ] && CFG_LIBFREETYPE="$CFG_QWS_FREETYPE"
5180 [ "x$PLATFORM_MAC" = "xyes" ] && CFG_LIBFREETYPE=no
5181 if [ "$CFG_LIBFREETYPE" = "auto" ]; then
5182 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/freetype "FreeType" $L_FLAGS $I_FLAGS $l_FLAGS ; then
5183 CFG_LIBFREETYPE=system
5184 else
5185 CFG_LIBFREETYPE=yes
5189 if [ "$CFG_ENDIAN" = "auto" ]; then
5190 if [ "$PLATFORM_MAC" = "yes" ]; then
5191 true #leave as auto
5192 else
5193 "$unixtests/endian.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5194 F="$?"
5195 if [ "$F" -eq 0 ]; then
5196 CFG_ENDIAN="Q_LITTLE_ENDIAN"
5197 elif [ "$F" -eq 1 ]; then
5198 CFG_ENDIAN="Q_BIG_ENDIAN"
5199 else
5200 echo
5201 echo "The target system byte order could not be detected!"
5202 echo "Turn on verbose messaging (-v) to see the final report."
5203 echo "You can use the -little-endian or -big-endian switch to"
5204 echo "$0 to continue."
5205 exit 101
5210 if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
5211 if [ "$PLATFORM_MAC" = "yes" ]; then
5212 true #leave as auto
5213 else
5214 "$unixtests/endian.test" "$QMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5215 F="$?"
5216 if [ "$F" -eq 0 ]; then
5217 CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
5218 elif [ "$F" -eq 1 ]; then
5219 CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
5220 else
5221 echo
5222 echo "The host system byte order could not be detected!"
5223 echo "Turn on verbose messaging (-v) to see the final report."
5224 echo "You can use the -host-little-endian or -host-big-endian switch to"
5225 echo "$0 to continue."
5226 exit 101
5231 if [ "$CFG_ARMFPA" != "auto" ]; then
5232 if [ "$CFG_ARMFPA" = "yes" ]; then
5233 if [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
5234 CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
5235 else
5236 CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
5238 else
5239 CFG_DOUBLEFORMAT="normal"
5244 if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then
5245 if [ "$PLATFORM_QWS" != "yes" ]; then
5246 CFG_DOUBLEFORMAT=normal
5247 else
5248 "$unixtests/doubleformat.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5249 F="$?"
5250 if [ "$F" -eq 10 ] && [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
5251 CFG_DOUBLEFORMAT=normal
5252 elif [ "$F" -eq 11 ] && [ "$CFG_ENDIAN" = "Q_BIG_ENDIAN" ]; then
5253 CFG_DOUBLEFORMAT=normal
5254 elif [ "$F" -eq 10 ]; then
5255 CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE"
5256 elif [ "$F" -eq 11 ]; then
5257 CFG_DOUBLEFORMAT="Q_DOUBLE_BIG"
5258 elif [ "$F" -eq 12 ]; then
5259 CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
5260 CFG_ARMFPA="yes"
5261 elif [ "$F" -eq 13 ]; then
5262 CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
5263 CFG_ARMFPA="yes"
5264 else
5265 echo
5266 echo "The system floating point format could not be detected."
5267 echo "This may cause data to be generated in a wrong format"
5268 echo "Turn on verbose messaging (-v) to see the final report."
5269 # we do not fail on this since this is a new test, and if it fails,
5270 # the old behavior should be correct in most cases
5271 CFG_DOUBLEFORMAT=normal
5276 HAVE_STL=no
5277 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then
5278 HAVE_STL=yes
5281 if [ "$CFG_STL" != "no" ]; then
5282 if [ "$HAVE_STL" = "yes" ]; then
5283 CFG_STL=yes
5284 else
5285 if [ "$CFG_STL" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5286 echo "STL support cannot be enabled due to functionality tests!"
5287 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5288 echo " If you believe this message is in error you may use the continue"
5289 echo " switch (-continue) to $0 to continue."
5290 exit 101
5291 else
5292 CFG_STL=no
5297 # find if the platform supports IPv6
5298 if [ "$CFG_IPV6" != "no" ]; then
5299 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6 "IPv6" $L_FLAGS $I_FLAGS $l_FLAGS; then
5300 CFG_IPV6=yes
5301 else
5302 if [ "$CFG_IPV6" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5303 echo "IPv6 support cannot be enabled due to functionality tests!"
5304 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5305 echo " If you believe this message is in error you may use the continue"
5306 echo " switch (-continue) to $0 to continue."
5307 exit 101
5308 else
5309 CFG_IPV6=no
5314 # detect POSIX clock_gettime()
5315 if [ "$CFG_CLOCK_GETTIME" = "auto" ]; then
5316 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
5317 CFG_CLOCK_GETTIME=yes
5318 else
5319 CFG_CLOCK_GETTIME=no
5323 # detect POSIX monotonic clocks
5324 if [ "$CFG_CLOCK_GETTIME" = "yes" ] && [ "$CFG_CLOCK_MONOTONIC" = "auto" ]; then
5325 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
5326 CFG_CLOCK_MONOTONIC=yes
5327 else
5328 CFG_CLOCK_MONOTONIC=no
5330 elif [ "$CFG_CLOCK_GETTIME" = "no" ]; then
5331 CFG_CLOCK_MONOTONIC=no
5334 # detect mremap
5335 if [ "$CFG_MREMAP" = "auto" ]; then
5336 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mremap "mremap" $L_FLAGS $I_FLAGS $l_FLAGS; then
5337 CFG_MREMAP=yes
5338 else
5339 CFG_MREMAP=no
5343 # find if the platform provides getaddrinfo (ipv6 dns lookups)
5344 if [ "$CFG_GETADDRINFO" != "no" ]; then
5345 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getaddrinfo "getaddrinfo" $L_FLAGS $I_FLAGS $l_FLAGS; then
5346 CFG_GETADDRINFO=yes
5347 else
5348 if [ "$CFG_GETADDRINFO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5349 echo "getaddrinfo support cannot be enabled due to functionality tests!"
5350 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5351 echo " If you believe this message is in error you may use the continue"
5352 echo " switch (-continue) to $0 to continue."
5353 exit 101
5354 else
5355 CFG_GETADDRINFO=no
5360 # find if the platform provides inotify
5361 if [ "$CFG_INOTIFY" != "no" ]; then
5362 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/inotify "inotify" $L_FLAGS $I_FLAGS $l_FLAGS; then
5363 CFG_INOTIFY=yes
5364 else
5365 if [ "$CFG_INOTIFY" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5366 echo "inotify support cannot be enabled due to functionality tests!"
5367 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5368 echo " If you believe this message is in error you may use the continue"
5369 echo " switch (-continue) to $0 to continue."
5370 exit 101
5371 else
5372 CFG_INOTIFY=no
5377 # find if the platform provides if_nametoindex (ipv6 interface name support)
5378 if [ "$CFG_IPV6IFNAME" != "no" ]; then
5379 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
5380 CFG_IPV6IFNAME=yes
5381 else
5382 if [ "$CFG_IPV6IFNAME" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5383 echo "IPv6 interface name support cannot be enabled due to functionality tests!"
5384 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5385 echo " If you believe this message is in error you may use the continue"
5386 echo " switch (-continue) to $0 to continue."
5387 exit 101
5388 else
5389 CFG_IPV6IFNAME=no
5394 # find if the platform provides getifaddrs (network interface enumeration)
5395 if [ "$CFG_GETIFADDRS" != "no" ]; then
5396 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getifaddrs "getifaddrs" $L_FLAGS $I_FLAGS $l_FLAGS; then
5397 CFG_GETIFADDRS=yes
5398 else
5399 if [ "$CFG_GETIFADDRS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5400 echo "getifaddrs support cannot be enabled due to functionality tests!"
5401 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5402 echo " If you believe this message is in error you may use the continue"
5403 echo " switch (-continue) to $0 to continue."
5404 exit 101
5405 else
5406 CFG_GETIFADDRS=no
5411 # find if the platform supports X/Open Large File compilation environment
5412 if [ "$CFG_LARGEFILE" != "no" ]; then
5413 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
5414 CFG_LARGEFILE=yes
5415 else
5416 if [ "$CFG_LARGEFILE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5417 echo "X/Open Large File support cannot be enabled due to functionality tests!"
5418 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5419 echo " If you believe this message is in error you may use the continue"
5420 echo " switch (-continue) to $0 to continue."
5421 exit 101
5422 else
5423 CFG_LARGEFILE=no
5428 # detect OpenSSL
5429 if [ "$CFG_OPENSSL" != "no" ]; then
5430 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/openssl "OpenSSL" $L_FLAGS $I_FLAGS $l_FLAGS; then
5431 if [ "$CFG_OPENSSL" = "auto" ]; then
5432 CFG_OPENSSL=yes
5434 else
5435 if ( [ "$CFG_OPENSSL" = "yes" ] || [ "$CFG_OPENSSL" = "linked" ] ) && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5436 echo "OpenSSL support cannot be enabled due to functionality tests!"
5437 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5438 echo " If you believe this message is in error you may use the continue"
5439 echo " switch (-continue) to $0 to continue."
5440 exit 101
5441 else
5442 CFG_OPENSSL=no
5447 if [ "$CFG_PTMALLOC" != "no" ]; then
5448 # build ptmalloc, copy .a file to lib/
5449 echo "Building ptmalloc. Please wait..."
5450 (cd "$relpath/src/3rdparty/ptmalloc/"; "$MAKE" "clean" ; "$MAKE" "posix"
5451 mkdir "$outpath/lib/" ; cp "libptmalloc3.a" "$outpath/lib/")
5453 QMakeVar add QMAKE_LFLAGS "$outpath/lib/libptmalloc3.a"
5456 #-------------------------------------------------------------------------------
5457 # ask for all that hasn't been auto-detected or specified in the arguments
5458 #-------------------------------------------------------------------------------
5460 ### fix this: user input should be validated in a loop
5461 if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PLATFORM_QWS" = "yes" ]; then
5462 echo
5463 echo "Choose pixel-depths to support:"
5464 echo
5465 echo " 1. 1bpp, black/white"
5466 echo " 4. 4bpp, grayscale"
5467 echo " 8. 8bpp, paletted"
5468 echo " 12. 12bpp, rgb 4-4-4"
5469 echo " 15. 15bpp, rgb 5-5-5"
5470 echo " 16. 16bpp, rgb 5-6-5"
5471 echo " 18. 18bpp, rgb 6-6-6"
5472 echo " 24. 24bpp, rgb 8-8-8"
5473 echo " 32. 32bpp, argb 8-8-8-8 and rgb 8-8-8"
5474 echo " all. All supported depths"
5475 echo
5476 echo "Your choices (default 8,16,32):"
5477 read CFG_QWS_DEPTHS
5478 if [ -z "$CFG_QWS_DEPTHS" ] || [ "$CFG_QWS_DEPTHS" = "yes" ]; then
5479 CFG_QWS_DEPTHS=8,16,32
5482 if [ -n "$CFG_QWS_DEPTHS" -a "$PLATFORM_QWS" = "yes" ]; then
5483 if [ "$CFG_QWS_DEPTHS" = "all" ]; then
5484 CFG_QWS_DEPTHS="1 4 8 12 15 16 18 24 32 generic"
5486 for D in `echo "$CFG_QWS_DEPTHS" | sed -e 's/,/ /g'`; do
5487 case $D in
5488 1|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";;
5489 generic) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_GENERIC";;
5490 esac
5491 done
5494 # enable dwarf2 support on Mac
5495 if [ "$CFG_MAC_DWARF2" = "yes" ]; then
5496 QT_CONFIG="$QT_CONFIG dwarf2"
5499 # Set the default arch. Select 32-bit/carbon if nothing else has
5500 # been specified on the configure line.
5501 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_ARCHS" == "" ]; then
5502 source "$mactests/defaultarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests"
5504 if [ "$QT_MAC_DEFUALT_ARCH" == "x86_64" ]; then
5505 CFG_MAC_ARCHS=" x86"
5506 elif [ "$QT_MAC_DEFUALT_ARCH" == "ppc64" ]; then
5507 CFG_MAC_ARCHS=" ppc"
5508 else
5509 CFG_MAC_ARCHS=" $QT_MAC_DEFUALT_ARCH"
5512 [ "$OPT_VERBOSE" == "yes" ] && echo "Setting Mac architechture to$CFG_MAC_ARCHS."
5515 # enable cocoa and/or carbon on Mac
5516 if [ "$CFG_MAC_COCOA" = "yes" ]; then
5517 # -cocoa on the command line disables carbon completely (i.e. use cocoa for 32-bit as well)
5518 CFG_MAC_CARBON="no"
5519 else
5520 # check which archs are in use, enable cocoa if we find a 64-bit one
5521 if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then
5522 CFG_MAC_COCOA="yes";
5523 CFG_MAC_CARBON="no";
5524 if echo "$CFG_MAC_ARCHS" | grep -w ppc > /dev/null 2>&1; then
5525 CFG_MAC_CARBON="yes";
5527 if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then
5528 CFG_MAC_CARBON="yes";
5530 else
5531 # no 64-bit archs found.
5532 CFG_MAC_COCOA="no"
5536 # set the global Mac deployment target. This is overridden on an arch-by-arch basis
5537 # in some cases, see code further down
5538 case "$PLATFORM,$CFG_MAC_COCOA" in
5539 macx*,yes)
5540 # Cocoa
5541 QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.5
5542 CFG_QT3SUPPORT="no"
5544 macx-icc,*)
5545 # Intel CC, Carbon
5546 QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.4
5548 macx*,no)
5549 # gcc, Carbon
5550 QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.3
5552 esac
5554 # enable Qt 3 support functionality
5555 if [ "$CFG_QT3SUPPORT" = "yes" ]; then
5556 QT_CONFIG="$QT_CONFIG qt3support"
5559 # enable Phonon
5560 if [ "$CFG_PHONON" = "yes" ]; then
5561 QT_CONFIG="$QT_CONFIG phonon"
5562 if [ "$CFG_PHONON_BACKEND" = "yes" ]; then
5563 QT_CONFIG="$QT_CONFIG phonon-backend"
5565 else
5566 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PHONON"
5569 # disable accessibility
5570 if [ "$CFG_ACCESSIBILITY" = "no" ]; then
5571 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ACCESSIBILITY"
5572 else
5573 QT_CONFIG="$QT_CONFIG accessibility"
5576 # enable opengl
5577 if [ "$CFG_OPENGL" = "no" ]; then
5578 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENGL"
5579 else
5580 QT_CONFIG="$QT_CONFIG opengl"
5583 if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es1cl" ] || [ "$CFG_OPENGL" = "es2" ]; then
5584 if [ "$PLATFORM_QWS" = "yes" ]; then
5585 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_BACKINGSTORE_SUBSURFACES"
5586 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_USE_EGLWINDOWSURFACE"
5588 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES"
5591 if [ "$CFG_OPENGL" = "es1" ]; then
5592 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1"
5593 QT_CONFIG="$QT_CONFIG opengles1"
5596 if [ "$CFG_OPENGL" = "es1cl" ]; then
5597 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1_CL"
5598 QT_CONFIG="$QT_CONFIG opengles1cl"
5601 if [ "$CFG_OPENGL" = "es2" ]; then
5602 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_2"
5603 QT_CONFIG="$QT_CONFIG opengles2"
5606 # safe execution environment
5607 if [ "$CFG_SXE" != "no" ]; then
5608 QT_CONFIG="$QT_CONFIG sxe"
5611 # build up the variables for output
5612 if [ "$CFG_DEBUG" = "yes" ]; then
5613 QMAKE_OUTDIR="${QMAKE_OUTDIR}debug"
5614 QMAKE_CONFIG="$QMAKE_CONFIG debug"
5615 elif [ "$CFG_DEBUG" = "no" ]; then
5616 QMAKE_OUTDIR="${QMAKE_OUTDIR}release"
5617 QMAKE_CONFIG="$QMAKE_CONFIG release"
5619 if [ "$CFG_SHARED" = "yes" ]; then
5620 QMAKE_OUTDIR="${QMAKE_OUTDIR}-shared"
5621 QMAKE_CONFIG="$QMAKE_CONFIG shared dll"
5622 elif [ "$CFG_SHARED" = "no" ]; then
5623 QMAKE_OUTDIR="${QMAKE_OUTDIR}-static"
5624 QMAKE_CONFIG="$QMAKE_CONFIG static"
5626 if [ "$PLATFORM_QWS" = "yes" ]; then
5627 QMAKE_OUTDIR="${QMAKE_OUTDIR}-emb-$CFG_EMBEDDED"
5628 QMAKE_CONFIG="$QMAKE_CONFIG embedded"
5629 QT_CONFIG="$QT_CONFIG embedded"
5630 rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
5632 QMakeVar set PRECOMPILED_DIR ".pch/$QMAKE_OUTDIR"
5633 QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR"
5634 QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR"
5635 QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR"
5636 QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR"
5637 if [ "$CFG_LARGEFILE" = "yes" ]; then
5638 QMAKE_CONFIG="$QMAKE_CONFIG largefile"
5640 if [ "$CFG_STL" = "no" ]; then
5641 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STL"
5642 else
5643 QMAKE_CONFIG="$QMAKE_CONFIG stl"
5645 if [ "$CFG_USE_GNUMAKE" = "yes" ]; then
5646 QMAKE_CONFIG="$QMAKE_CONFIG GNUmake"
5648 [ "$CFG_REDUCE_EXPORTS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_exports"
5649 [ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
5650 [ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
5651 if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
5652 QMakeVar add QMAKE_CFLAGS -g
5653 QMakeVar add QMAKE_CXXFLAGS -g
5654 QMAKE_CONFIG="$QMAKE_CONFIG separate_debug_info"
5656 [ "$CFG_MMX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mmx"
5657 [ "$CFG_3DNOW" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG 3dnow"
5658 [ "$CFG_SSE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse"
5659 [ "$CFG_SSE2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse2"
5660 [ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
5661 [ "$PLATFORM_MAC" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG $CFG_MAC_ARCHS"
5662 if [ "$CFG_IPV6" = "yes" ]; then
5663 QT_CONFIG="$QT_CONFIG ipv6"
5665 if [ "$CFG_CLOCK_GETTIME" = "yes" ]; then
5666 QT_CONFIG="$QT_CONFIG clock-gettime"
5668 if [ "$CFG_CLOCK_MONOTONIC" = "yes" ]; then
5669 QT_CONFIG="$QT_CONFIG clock-monotonic"
5671 if [ "$CFG_MREMAP" = "yes" ]; then
5672 QT_CONFIG="$QT_CONFIG mremap"
5674 if [ "$CFG_GETADDRINFO" = "yes" ]; then
5675 QT_CONFIG="$QT_CONFIG getaddrinfo"
5677 if [ "$CFG_IPV6IFNAME" = "yes" ]; then
5678 QT_CONFIG="$QT_CONFIG ipv6ifname"
5680 if [ "$CFG_GETIFADDRS" = "yes" ]; then
5681 QT_CONFIG="$QT_CONFIG getifaddrs"
5683 if [ "$CFG_INOTIFY" = "yes" ]; then
5684 QT_CONFIG="$QT_CONFIG inotify"
5686 if [ "$CFG_LIBJPEG" = "system" ]; then
5687 QT_CONFIG="$QT_CONFIG system-jpeg"
5689 if [ "$CFG_JPEG" = "no" ]; then
5690 QT_CONFIG="$QT_CONFIG no-jpeg"
5691 elif [ "$CFG_JPEG" = "yes" ]; then
5692 QT_CONFIG="$QT_CONFIG jpeg"
5694 if [ "$CFG_LIBMNG" = "system" ]; then
5695 QT_CONFIG="$QT_CONFIG system-mng"
5697 if [ "$CFG_MNG" = "no" ]; then
5698 QT_CONFIG="$QT_CONFIG no-mng"
5699 elif [ "$CFG_MNG" = "yes" ]; then
5700 QT_CONFIG="$QT_CONFIG mng"
5702 if [ "$CFG_LIBPNG" = "no" ]; then
5703 CFG_PNG="no"
5705 if [ "$CFG_LIBPNG" = "system" ]; then
5706 QT_CONFIG="$QT_CONFIG system-png"
5708 if [ "$CFG_PNG" = "no" ]; then
5709 QT_CONFIG="$QT_CONFIG no-png"
5710 elif [ "$CFG_PNG" = "yes" ]; then
5711 QT_CONFIG="$QT_CONFIG png"
5713 if [ "$CFG_GIF" = "no" ]; then
5714 QT_CONFIG="$QT_CONFIG no-gif"
5715 elif [ "$CFG_GIF" = "yes" ]; then
5716 QT_CONFIG="$QT_CONFIG gif"
5718 if [ "$CFG_LIBTIFF" = "system" ]; then
5719 QT_CONFIG="$QT_CONFIG system-tiff"
5721 if [ "$CFG_TIFF" = "no" ]; then
5722 QT_CONFIG="$QT_CONFIG no-tiff"
5723 elif [ "$CFG_TIFF" = "yes" ]; then
5724 QT_CONFIG="$QT_CONFIG tiff"
5726 if [ "$CFG_LIBFREETYPE" = "no" ]; then
5727 QT_CONFIG="$QT_CONFIG no-freetype"
5728 elif [ "$CFG_LIBFREETYPE" = "system" ]; then
5729 QT_CONFIG="$QT_CONFIG system-freetype"
5730 else
5731 QT_CONFIG="$QT_CONFIG freetype"
5734 if [ "x$PLATFORM_MAC" = "xyes" ]; then
5735 #On Mac we implicitly link against libz, so we
5736 #never use the 3rdparty stuff.
5737 [ "$CFG_ZLIB" = "yes" ] && CFG_ZLIB="system"
5739 if [ "$CFG_ZLIB" = "yes" ]; then
5740 QT_CONFIG="$QT_CONFIG zlib"
5741 elif [ "$CFG_ZLIB" = "system" ]; then
5742 QT_CONFIG="$QT_CONFIG system-zlib"
5745 [ "$CFG_NIS" = "yes" ] && QT_CONFIG="$QT_CONFIG nis"
5746 [ "$CFG_CUPS" = "yes" ] && QT_CONFIG="$QT_CONFIG cups"
5747 [ "$CFG_ICONV" = "yes" ] && QT_CONFIG="$QT_CONFIG iconv"
5748 [ "$CFG_ICONV" = "gnu" ] && QT_CONFIG="$QT_CONFIG gnu-libiconv"
5749 [ "$CFG_GLIB" = "yes" ] && QT_CONFIG="$QT_CONFIG glib"
5750 [ "$CFG_GSTREAMER" = "yes" ] && QT_CONFIG="$QT_CONFIG gstreamer"
5751 [ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus"
5752 [ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked"
5753 [ "$CFG_NAS" = "system" ] && QT_CONFIG="$QT_CONFIG nas"
5754 [ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl"
5755 [ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked"
5757 if [ "$PLATFORM_X11" = "yes" ]; then
5758 [ "$CFG_SM" = "yes" ] && QT_CONFIG="$QT_CONFIG x11sm"
5760 # for some reason, the following libraries are not always built shared,
5761 # so *every* program/lib (including Qt) has to link against them
5762 if [ "$CFG_XSHAPE" = "yes" ]; then
5763 QT_CONFIG="$QT_CONFIG xshape"
5765 if [ "$CFG_XINERAMA" = "yes" ]; then
5766 QT_CONFIG="$QT_CONFIG xinerama"
5767 QMakeVar set QMAKE_LIBS_X11 '-lXinerama $$QMAKE_LIBS_X11'
5769 if [ "$CFG_XCURSOR" = "yes" ]; then
5770 QT_CONFIG="$QT_CONFIG xcursor"
5771 QMakeVar set QMAKE_LIBS_X11 '-lXcursor $$QMAKE_LIBS_X11'
5773 if [ "$CFG_XFIXES" = "yes" ]; then
5774 QT_CONFIG="$QT_CONFIG xfixes"
5775 QMakeVar set QMAKE_LIBS_X11 '-lXfixes $$QMAKE_LIBS_X11'
5777 if [ "$CFG_XRANDR" = "yes" ]; then
5778 QT_CONFIG="$QT_CONFIG xrandr"
5779 if [ "$CFG_XRENDER" != "yes" ]; then
5780 # libXrandr uses 1 function from libXrender, so we always have to have it :/
5781 QMakeVar set QMAKE_LIBS_X11 '-lXrandr -lXrender $$QMAKE_LIBS_X11'
5782 else
5783 QMakeVar set QMAKE_LIBS_X11 '-lXrandr $$QMAKE_LIBS_X11'
5786 if [ "$CFG_XRENDER" = "yes" ]; then
5787 QT_CONFIG="$QT_CONFIG xrender"
5788 QMakeVar set QMAKE_LIBS_X11 '-lXrender $$QMAKE_LIBS_X11'
5790 if [ "$CFG_MITSHM" = "yes" ]; then
5791 QT_CONFIG="$QT_CONFIG mitshm"
5793 if [ "$CFG_FONTCONFIG" = "yes" ]; then
5794 QT_CONFIG="$QT_CONFIG fontconfig"
5796 if [ "$CFG_XINPUT" = "yes" ]; then
5797 QMakeVar set QMAKE_LIBS_X11 '-lXi $$QMAKE_LIBS_X11'
5799 if [ "$CFG_XINPUT" = "yes" ]; then
5800 QT_CONFIG="$QT_CONFIG xinput tablet"
5802 if [ "$CFG_XKB" = "yes" ]; then
5803 QT_CONFIG="$QT_CONFIG xkb"
5807 [ '!' -z "$D_FLAGS" ] && QMakeVar add DEFINES "$D_FLAGS"
5808 [ '!' -z "$L_FLAGS" ] && QMakeVar add QMAKE_LIBDIR_FLAGS "$L_FLAGS"
5809 [ '!' -z "$l_FLAGS" ] && QMakeVar add LIBS "$l_FLAGS"
5811 if [ "$PLATFORM_MAC" = "yes" ]; then
5812 if [ "$CFG_RPATH" = "yes" ]; then
5813 QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname"
5815 elif [ -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_RPATH | awk '{print $3;}'`" ]; then
5816 if [ -n "$RPATH_FLAGS" ]; then
5817 echo
5818 echo "ERROR: -R cannot be used on this platform as \$QMAKE_RPATH is"
5819 echo " undefined."
5820 echo
5821 exit 1
5822 elif [ "$CFG_RPATH" = "yes" ]; then
5823 RPATH_MESSAGE=" NOTE: This platform does not support runtime library paths, using -no-rpath."
5824 CFG_RPATH=no
5826 else
5827 if [ "$CFG_RPATH" = "yes" ]; then
5828 # set the default rpath to the library installation directory
5829 RPATH_FLAGS="\"$QT_INSTALL_LIBS\" $RPATH_FLAGS"
5831 if [ -n "$RPATH_FLAGS" ]; then
5832 # add the user defined rpaths
5833 QMakeVar add QMAKE_RPATHDIR "$RPATH_FLAGS"
5837 if [ '!' -z "$I_FLAGS" ]; then
5838 # add the user define include paths
5839 QMakeVar add QMAKE_CFLAGS "$I_FLAGS"
5840 QMakeVar add QMAKE_CXXFLAGS "$I_FLAGS"
5843 # turn off exceptions for the compilers that support it
5844 if [ "$PLATFORM_QWS" = "yes" ]; then
5845 COMPILER=`echo $XPLATFORM | cut -f 3- -d-`
5846 else
5847 COMPILER=`echo $PLATFORM | cut -f 2- -d-`
5849 if [ "$CFG_EXCEPTIONS" = "unspecified" -a "$PLATFORM_QWS" = "yes" ]; then
5850 CFG_EXCEPTIONS=no
5853 if [ "$CFG_EXCEPTIONS" != "no" ]; then
5854 QTCONFIG_CONFIG="$QTCONFIG_CONFIG exceptions"
5858 # Some Qt modules are too advanced in C++ for some old compilers
5859 # Detect here the platforms where they are known to work.
5861 # See Qt documentation for more information on which features are
5862 # supported and on which compilers.
5864 canBuildQtXmlPatterns="yes"
5865 canBuildWebKit="$HAVE_STL"
5867 # WebKit requires stdint.h
5868 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stdint "Stdint" $L_FLAGS $I_FLAGS $l_FLAGS
5869 if [ $? != "0" ]; then
5870 canBuildWebKit="no"
5873 case "$XPLATFORM" in
5874 hpux-g++*)
5875 # PA-RISC's assembly is too limited
5876 # gcc 3.4 on that platform can't build QtXmlPatterns
5877 # the assembly it generates cannot be compiled
5879 # Check gcc's version
5880 case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
5883 3.4*)
5884 canBuildQtXmlPatterns="no"
5887 canBuildWebKit="no"
5888 canBuildQtXmlPatterns="no"
5890 esac
5892 *-g++*)
5893 # Check gcc's version
5894 case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
5895 4*|3.4*)
5897 3.3*)
5898 canBuildWebKit="no"
5901 canBuildWebKit="no"
5902 canBuildQtXmlPatterns="no"
5904 esac
5906 solaris-cc*)
5907 # Check the compiler version
5908 case `${QMAKE_CONF_COMPILER} -V 2>&1 | awk '{print $4}'` in
5910 canBuildWebKit="no"
5911 canBuildQtXmlPatterns="no"
5913 esac
5915 hpux-acc*)
5916 canBuildWebKit="no"
5917 canBuildQtXmlPatterns="no"
5919 hpuxi-acc*)
5920 canBuildWebKit="no"
5922 aix-xlc*)
5923 canBuildWebKit="no"
5924 canBuildQtXmlPatterns="no"
5926 irix-cc*)
5927 canBuildWebKit="no"
5929 esac
5931 if [ "$CFG_XMLPATTERNS" = "yes" -a "$CFG_EXCEPTIONS" = "no" ]; then
5932 echo "QtXmlPatterns was requested, but it can't be built due to exceptions being disabled."
5933 exit 1
5935 if [ "$CFG_XMLPATTERNS" = "auto" -a "$CFG_EXCEPTIONS" != "no" ]; then
5936 CFG_XMLPATTERNS="$canBuildQtXmlPatterns"
5937 elif [ "$CFG_EXCEPTIONS" = "no" ]; then
5938 CFG_XMLPATTERNS="no"
5940 if [ "$CFG_XMLPATTERNS" = "yes" ]; then
5941 QT_CONFIG="$QT_CONFIG xmlpatterns"
5942 else
5943 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XMLPATTERNS"
5946 if [ "$CFG_SVG" = "yes" ]; then
5947 QT_CONFIG="$QT_CONFIG svg"
5948 else
5949 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SVG"
5952 if [ "$CFG_WEBKIT" = "auto" ]; then
5953 CFG_WEBKIT="$canBuildWebKit"
5956 if [ "$CFG_WEBKIT" = "yes" ]; then
5957 QT_CONFIG="$QT_CONFIG webkit"
5958 # The reason we set CFG_WEBKIT, is such that the printed overview of what will be enabled, shows correctly.
5959 CFG_WEBKIT="yes"
5960 else
5961 CFG_WEBKIT="no"
5962 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WEBKIT"
5965 if [ "$CFG_SCRIPTTOOLS" = "auto" ]; then
5966 CFG_SCRIPTTOOLS="yes"
5969 if [ "$CFG_SCRIPTTOOLS" = "yes" ]; then
5970 QT_CONFIG="$QT_CONFIG scripttools"
5971 CFG_SCRIPTTOOLS="yes"
5972 else
5973 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPTTOOLS"
5976 if [ "$CFG_EXCEPTIONS" = "no" ]; then
5977 case "$COMPILER" in
5978 g++*)
5979 QMakeVar add QMAKE_CFLAGS -fno-exceptions
5980 QMakeVar add QMAKE_CXXFLAGS -fno-exceptions
5981 QMakeVar add QMAKE_LFLAGS -fno-exceptions
5983 cc*)
5984 case "$PLATFORM" in
5985 irix-cc*)
5986 QMakeVar add QMAKE_CFLAGS -LANG:exceptions=off
5987 QMakeVar add QMAKE_CXXFLAGS -LANG:exceptions=off
5988 QMakeVar add QMAKE_LFLAGS -LANG:exceptions=off
5990 *) ;;
5991 esac
5993 *) ;;
5994 esac
5995 QMAKE_CONFIG="$QMAKE_CONFIG exceptions_off"
5998 # On Mac, set the minimum deployment target using Xarch when that is supported (10.5 and up).
5999 # On 10.4 the deployment version is set to 10.3 globally using the QMAKE_MACOSX_DEPLOYMENT_TARGET env. variable
6000 # "-cocoa" on the command line means Cocoa is used in 32-bit mode also, in this case fall back on
6001 # QMAKE_MACOSX_DEPLOYMENT_TARGET which will be set to 10.5.
6002 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] && [ "$COMMANDLINE_MAC_COCOA" != "yes" ]; then
6003 if echo "$CFG_MAC_ARCHS" | grep '\<x86\>' > /dev/null 2>&1; then
6004 QMakeVar add QMAKE_CFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
6005 QMakeVar add QMAKE_CXXFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
6006 QMakeVar add QMAKE_LFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
6007 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86 "-arch i386 -Xarch_i386 -mmacosx-version-min=10.4"
6009 if echo "$CFG_MAC_ARCHS" | grep '\<ppc\>' > /dev/null 2>&1; then
6010 QMakeVar add QMAKE_CFLAGS "-Xarch_ppc -mmacosx-version-min=10.3"
6011 QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc -mmacosx-version-min=10.3"
6012 QMakeVar add QMAKE_LFLAGS "-Xarch_ppc -mmacosx-version-min=10.3"
6013 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=10.3"
6015 if echo "$CFG_MAC_ARCHS" | grep '\<x86_64\>' > /dev/null 2>&1; then
6016 QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
6017 QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
6018 QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
6019 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5"
6021 if echo "$CFG_MAC_ARCHS" | grep '\<ppc64\>' > /dev/null 2>&1; then
6022 QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
6023 QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
6024 QMakeVar add QMAKE_LFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
6025 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC_64 "-arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5"
6029 #-------------------------------------------------------------------------------
6030 # generate QT_BUILD_KEY
6031 #-------------------------------------------------------------------------------
6033 # some compilers generate binary incompatible code between different versions,
6034 # so we need to generate a build key that is different between these compilers
6035 case "$COMPILER" in
6036 g++*)
6037 # GNU C++
6038 COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
6040 case "$COMPILER_VERSION" in
6041 *.*.*)
6042 QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
6043 QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
6044 QT_GCC_PATCH_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
6046 *.*)
6047 QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\1,'`
6048 QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\2,'`
6049 QT_GCC_PATCH_VERSION=0
6051 esac
6053 case "$COMPILER_VERSION" in
6054 2.95.*)
6055 COMPILER_VERSION="2.95.*"
6057 3.*)
6058 COMPILER_VERSION="3.*"
6060 4.*)
6061 COMPILER_VERSION="4"
6065 esac
6066 [ '!' -z "$COMPILER_VERSION" ] && COMPILER="g++-${COMPILER_VERSION}"
6071 esac
6073 # QT_CONFIG can contain the following:
6075 # Things that affect the Qt API/ABI:
6077 # Options:
6078 # minimal-config small-config medium-config large-config full-config
6080 # Different edition modules:
6081 # network canvas table xml opengl sql
6083 # Options:
6084 # stl
6086 # Things that do not affect the Qt API/ABI:
6087 # system-jpeg no-jpeg jpeg
6088 # system-mng no-mng mng
6089 # system-png no-png png
6090 # system-zlib no-zlib zlib
6091 # system-libtiff no-libtiff
6092 # no-gif gif
6093 # debug release
6094 # dll staticlib
6096 # internal
6097 # nocrosscompiler
6098 # GNUmake
6099 # largefile
6100 # nis
6101 # nas
6102 # tablet
6103 # ipv6
6105 # X11 : x11sm xinerama xcursor xfixes xrandr xrender mitshm fontconfig xkb
6106 # Embedded: embedded freetype
6108 ALL_OPTIONS="stl"
6109 BUILD_CONFIG=
6110 BUILD_OPTIONS=
6112 # determine the build options
6113 for config_option in $QMAKE_CONFIG $QT_CONFIG; do
6114 SKIP="yes"
6115 case "$config_option" in
6116 *-config)
6117 # take the last *-config setting. this is the highest config being used,
6118 # and is the one that we will use for tagging plugins
6119 BUILD_CONFIG="$config_option"
6122 stl)
6123 # these config options affect the Qt API/ABI. they should influence
6124 # the generation of the buildkey, so we don't skip them
6125 SKIP="no"
6128 *) # skip all other options since they don't affect the Qt API/ABI.
6130 esac
6132 if [ "$SKIP" = "no" ]; then
6133 BUILD_OPTIONS="$BUILD_OPTIONS $config_option"
6135 done
6137 # put the options that we are missing into .options
6138 rm -f .options
6139 for opt in `echo $ALL_OPTIONS`; do
6140 SKIP="no"
6141 if echo $BUILD_OPTIONS | grep $opt >/dev/null 2>&1; then
6142 SKIP="yes"
6144 if [ "$SKIP" = "no" ]; then
6145 echo "$opt" >> .options
6147 done
6149 # reconstruct BUILD_OPTIONS with a sorted negative feature list
6150 # (ie. only things that are missing are will be put into the build key)
6151 BUILD_OPTIONS=
6152 if [ -f .options ]; then
6153 for opt in `sort -f .options | uniq`; do
6154 BUILD_OPTIONS="$BUILD_OPTIONS no-$opt"
6155 done
6157 rm -f .options
6159 # QT_NO* defines affect the Qt API (and binary compatibility). they need
6160 # to be included in the build key
6161 for build_option in $D_FLAGS; do
6162 build_option=`echo $build_option | cut -d \" -f 2 -`
6163 case "$build_option" in
6164 QT_NO*)
6165 echo "$build_option" >> .options
6168 # skip all other compiler defines
6170 esac
6171 done
6173 # sort the compile time defines (helps ensure that changes in this configure
6174 # script don't affect the QT_BUILD_KEY generation)
6175 if [ -f .options ]; then
6176 for opt in `sort -f .options | uniq`; do
6177 BUILD_OPTIONS="$BUILD_OPTIONS $opt"
6178 done
6180 rm -f .options
6182 BUILD_OPTIONS="$BUILD_CONFIG $BUILD_OPTIONS"
6183 # extract the operating system from the XPLATFORM
6184 TARGET_OPERATING_SYSTEM=`echo $XPLATFORM | cut -f 2- -d/ | cut -f -1 -d-`
6186 # when cross-compiling, don't include build-host information (build key is target specific)
6187 QT_BUILD_KEY="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
6188 if [ -n "$QT_NAMESPACE" ]; then
6189 QT_BUILD_KEY="$QT_BUILD_KEY $QT_NAMESPACE"
6191 MAC_NEED_TWO_BUILD_KEYS="no"
6192 if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then
6193 QT_BUILD_KEY_CARBON=$QT_BUILD_KEY
6194 TARGET_OPERATING_SYSTEM="$TARGET_OPERATING_SYSTEM-cocoa"
6195 QT_BUILD_KEY_COCOA="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
6196 if [ "$CFG_MAC_CARBON" = "no" ]; then
6197 QT_BUILD_KEY=$QT_BUILD_KEY_COCOA
6198 else
6199 MAC_NEED_TWO_BUILD_KEYS="yes"
6202 # don't break loading plugins build with an older version of Qt
6203 QT_BUILD_KEY_COMPAT=
6204 if [ "$QT_CROSS_COMPILE" = "no" ]; then
6205 # previous versions of Qt used a build key built from the uname
6206 QT_BUILD_KEY_COMPAT="$CFG_USER_BUILD_KEY $UNAME_MACHINE $UNAME_SYSTEM $COMPILER $BUILD_OPTIONS"
6208 # strip out leading/trailing/extra whitespace
6209 QT_BUILD_KEY=`echo $QT_BUILD_KEY | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
6210 QT_BUILD_KEY_COMPAT=`echo $QT_BUILD_KEY_COMPAT | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
6212 #-------------------------------------------------------------------------------
6213 # part of configuration information goes into qconfig.h
6214 #-------------------------------------------------------------------------------
6216 case "$CFG_QCONFIG" in
6217 full)
6218 echo "/* Everything */" >"$outpath/src/corelib/global/qconfig.h.new"
6221 tmpconfig="$outpath/src/corelib/global/qconfig.h.new"
6222 echo "#ifndef QT_BOOTSTRAPPED" >"$tmpconfig"
6223 cat "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" >>"$tmpconfig"
6224 echo "#endif" >>"$tmpconfig"
6226 esac
6228 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6230 /* Qt Edition */
6231 #ifndef QT_EDITION
6232 # define QT_EDITION $QT_EDITION
6233 #endif
6235 /* Machine byte-order */
6236 #define Q_BIG_ENDIAN 4321
6237 #define Q_LITTLE_ENDIAN 1234
6240 if [ "$MAC_NEED_TWO_BUILD_KEYS" = "no" ]; then
6241 echo "#define QT_BUILD_KEY \"$QT_BUILD_KEY\"" \
6242 >> "$outpath/src/corelib/global/qconfig.h.new"
6243 else
6244 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6246 #define QT_BUILD_KEY_CARBON "$QT_BUILD_KEY_CARBON"
6247 #define QT_BUILD_KEY_COCOA "$QT_BUILD_KEY_COCOA"
6251 if [ -n "$QT_BUILD_KEY_COMPAT" ]; then
6252 echo "#define QT_BUILD_KEY_COMPAT \"$QT_BUILD_KEY_COMPAT\"" \
6253 >> "$outpath/src/corelib/global/qconfig.h.new"
6255 echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
6257 echo "#ifdef QT_BOOTSTRAPPED" >>"$outpath/src/corelib/global/qconfig.h.new"
6258 if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
6259 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6260 #if defined(__BIG_ENDIAN__)
6261 # define Q_BYTE_ORDER Q_BIG_ENDIAN
6262 #elif defined(__LITTLE_ENDIAN__)
6263 # define Q_BYTE_ORDER Q_LITTLE_ENDIAN
6264 #else
6265 # error "Unable to determine byte order!"
6266 #endif
6268 else
6269 echo "#define Q_BYTE_ORDER $CFG_HOST_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
6271 echo "#else" >>"$outpath/src/corelib/global/qconfig.h.new"
6272 if [ "$CFG_ENDIAN" = "auto" ]; then
6273 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6274 #if defined(__BIG_ENDIAN__)
6275 # define Q_BYTE_ORDER Q_BIG_ENDIAN
6276 #elif defined(__LITTLE_ENDIAN__)
6277 # define Q_BYTE_ORDER Q_LITTLE_ENDIAN
6278 #else
6279 # error "Unable to determine byte order!"
6280 #endif
6282 else
6283 echo "#define Q_BYTE_ORDER $CFG_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
6285 echo "#endif" >>"$outpath/src/corelib/global/qconfig.h.new"
6287 if [ "$CFG_DOUBLEFORMAT" != "normal" ]; then
6288 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6289 /* Non-IEEE double format */
6290 #define Q_DOUBLE_LITTLE "01234567"
6291 #define Q_DOUBLE_BIG "76543210"
6292 #define Q_DOUBLE_LITTLE_SWAPPED "45670123"
6293 #define Q_DOUBLE_BIG_SWAPPED "32107654"
6294 #define Q_DOUBLE_FORMAT $CFG_DOUBLEFORMAT
6297 if [ "$CFG_ARMFPA" = "yes" ]; then
6298 if [ "$CFG_ARCH" != "$CFG_HOST_ARCH" ]; then
6299 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6300 #ifndef QT_BOOTSTRAPPED
6301 # define QT_ARMFPA
6302 #endif
6304 else
6305 echo "#define QT_ARMFPA" >>"$outpath/src/corelib/global/qconfig.h.new"
6309 CFG_ARCH_STR=`echo $CFG_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6310 CFG_HOST_ARCH_STR=`echo $CFG_HOST_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6311 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6312 /* Machine Architecture */
6313 #ifndef QT_BOOTSTRAPPED
6314 # define QT_ARCH_${CFG_ARCH_STR}
6315 #else
6316 # define QT_ARCH_${CFG_HOST_ARCH_STR}
6317 #endif
6320 echo '/* Compile time features */' >>"$outpath/src/corelib/global/qconfig.h.new"
6321 [ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\"" >>"$outpath/src/corelib/global/qconfig.h.new"
6323 if [ "$CFG_LARGEFILE" = "yes" ]; then
6324 echo "#define QT_LARGEFILE_SUPPORT 64" >>"$outpath/src/corelib/global/qconfig.h.new"
6327 # if both carbon and cocoa are specified, enable the autodetection code.
6328 if [ "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then
6329 echo "#define AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
6330 elif [ "$CFG_MAC_COCOA" = "yes" ]; then
6331 echo "#define QT_MAC_USE_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
6334 if [ "$CFG_FRAMEWORK" = "yes" ]; then
6335 echo "#define QT_MAC_FRAMEWORK_BUILD" >>"$outpath/src/corelib/global/qconfig.h.new"
6338 if [ "$PLATFORM_MAC" = "yes" ]; then
6339 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6340 #if defined(__LP64__)
6341 # define QT_POINTER_SIZE 8
6342 #else
6343 # define QT_POINTER_SIZE 4
6344 #endif
6346 else
6347 "$unixtests/ptrsize.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
6348 echo "#define QT_POINTER_SIZE $?" >>"$outpath/src/corelib/global/qconfig.h.new"
6352 echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
6354 if [ "$CFG_DEV" = "yes" ]; then
6355 echo "#define QT_BUILD_INTERNAL" >>"$outpath/src/corelib/global/qconfig.h.new"
6358 # Embedded compile time options
6359 if [ "$PLATFORM_QWS" = "yes" ]; then
6360 # Add QWS to config.h
6361 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_WS_QWS"
6363 # Add excluded decorations to $QCONFIG_FLAGS
6364 decors=`grep '^decorations -= ' "$QMAKE_VARS_FILE" | ${AWK} '{print $3}'`
6365 for decor in $decors; do
6366 NODECORATION=`echo $decor | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6367 QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_NO_QWS_DECORATION_${NODECORATION}"
6368 done
6370 # Figure which embedded drivers which are turned off
6371 CFG_GFX_OFF="$CFG_GFX_AVAILABLE"
6372 for ADRIVER in $CFG_GFX_ON; do
6373 CFG_GFX_OFF=`echo "${CFG_GFX_OFF} " | sed "s,${ADRIVER} ,,g"`
6374 done
6376 CFG_KBD_OFF="$CFG_KBD_AVAILABLE"
6377 # the um driver is currently not in the available list for external builds
6378 if [ "$CFG_DEV" = "no" ]; then
6379 CFG_KBD_OFF="$CFG_KBD_OFF um"
6381 for ADRIVER in $CFG_KBD_ON; do
6382 CFG_KBD_OFF=`echo "${CFG_KBD_OFF} " | sed "s,${ADRIVER} ,,g"`
6383 done
6385 CFG_MOUSE_OFF="$CFG_MOUSE_AVAILABLE"
6386 for ADRIVER in $CFG_MOUSE_ON; do
6387 CFG_MOUSE_OFF=`echo "${CFG_MOUSE_OFF} " | sed "s,${ADRIVER} ,,g"`
6388 done
6390 for DRIVER in $CFG_GFX_OFF; do
6391 NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6392 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_$NODRIVER"
6393 done
6395 for DRIVER in $CFG_KBD_OFF; do
6396 NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6397 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_KBD_$NODRIVER"
6398 done
6400 for DRIVER in $CFG_MOUSE_OFF; do
6401 NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6402 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_MOUSE_$NODRIVER"
6403 done
6404 fi # QWS
6406 if [ "${CFG_USE_FLOATMATH}" = "yes" ]; then
6407 QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_USE_MATH_H_FLOATS"
6410 # Add turned on SQL drivers
6411 for DRIVER in $CFG_SQL_AVAILABLE; do
6412 eval "VAL=\$CFG_SQL_$DRIVER"
6413 case "$VAL" in
6415 ONDRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6416 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SQL_$ONDRIVER"
6417 SQL_DRIVERS="$SQL_DRIVERS $DRIVER"
6419 plugin)
6420 SQL_PLUGINS="$SQL_PLUGINS $DRIVER"
6422 esac
6423 done
6426 QMakeVar set sql-drivers "$SQL_DRIVERS"
6427 QMakeVar set sql-plugins "$SQL_PLUGINS"
6429 # Add other configuration options to the qconfig.h file
6430 [ "$CFG_GIF" = "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_BUILTIN_GIF_READER=1"
6431 [ "$CFG_TIFF" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_TIFF"
6432 [ "$CFG_PNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_PNG"
6433 [ "$CFG_JPEG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_JPEG"
6434 [ "$CFG_MNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_MNG"
6435 [ "$CFG_ZLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB"
6436 [ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS"
6437 [ "$CFG_IPV6" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6"
6438 [ "$CFG_SXE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE"
6439 [ "$CFG_DBUS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS"
6441 if [ "$PLATFORM_QWS" != "yes" ]; then
6442 [ "$CFG_GRAPHICS_SYSTEM" = "raster" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RASTER"
6443 [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENGL"
6446 # X11/Unix/Mac only configs
6447 [ "$CFG_CUPS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CUPS"
6448 [ "$CFG_ICONV" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICONV"
6449 [ "$CFG_GLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLIB"
6450 [ "$CFG_GSTREAMER" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GSTREAMER"
6451 [ "$CFG_QGTKSTYLE" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_GTK"
6452 [ "$CFG_CLOCK_MONOTONIC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CLOCK_MONOTONIC"
6453 [ "$CFG_MREMAP" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MREMAP"
6454 [ "$CFG_GETADDRINFO" = "no" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETADDRINFO"
6455 [ "$CFG_IPV6IFNAME" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6IFNAME"
6456 [ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS"
6457 [ "$CFG_INOTIFY" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY"
6458 [ "$CFG_NAS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NAS"
6459 [ "$CFG_NIS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS"
6460 [ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL"
6461 [ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL"
6463 [ "$CFG_SM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SESSIONMANAGER"
6464 [ "$CFG_XCURSOR" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XCURSOR"
6465 [ "$CFG_XFIXES" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XFIXES"
6466 [ "$CFG_FONTCONFIG" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FONTCONFIG"
6467 [ "$CFG_XINERAMA" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINERAMA"
6468 [ "$CFG_XKB" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XKB"
6469 [ "$CFG_XRANDR" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRANDR"
6470 [ "$CFG_XRENDER" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRENDER"
6471 [ "$CFG_MITSHM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MITSHM"
6472 [ "$CFG_XSHAPE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE"
6473 [ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET"
6475 [ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR"
6476 [ "$CFG_XINERAMA" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINERAMA"
6477 [ "$CFG_XFIXES" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XFIXES"
6478 [ "$CFG_XRANDR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XRANDR"
6479 [ "$CFG_XINPUT" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINPUT"
6481 # sort QCONFIG_FLAGS for neatness if we can
6482 [ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq`
6483 QCONFIG_FLAGS=`echo $QCONFIG_FLAGS`
6485 if [ -n "$QCONFIG_FLAGS" ]; then
6486 for cfg in $QCONFIG_FLAGS; do
6487 cfgd=`echo $cfg | sed 's/=.*$//'` # trim pushed 'Foo=Bar' defines
6488 cfg=`echo $cfg | sed 's/=/ /'` # turn first '=' into a space
6489 # figure out define logic, so we can output the correct
6490 # ifdefs to override the global defines in a project
6491 cfgdNeg=
6492 if [ true ] && echo "$cfgd" | grep 'QT_NO_' >/dev/null 2>&1; then
6493 # QT_NO_option can be forcefully turned on by QT_option
6494 cfgdNeg=`echo $cfgd | sed "s,QT_NO_,QT_,"`
6495 elif [ true ] && echo "$cfgd" | grep 'QT_' >/dev/null 2>&1; then
6496 # QT_option can be forcefully turned off by QT_NO_option
6497 cfgdNeg=`echo $cfgd | sed "s,QT_,QT_NO_,"`
6500 if [ -z $cfgdNeg ]; then
6501 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
6502 #ifndef $cfgd
6503 # define $cfg
6504 #endif
6507 else
6508 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
6509 #if defined($cfgd) && defined($cfgdNeg)
6510 # undef $cfgd
6511 #elif !defined($cfgd) && !defined($cfgdNeg)
6512 # define $cfg
6513 #endif
6517 done
6520 if [ "$CFG_REDUCE_EXPORTS" = "yes" ]; then
6521 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
6522 #define QT_VISIBILITY_AVAILABLE
6527 # avoid unecessary rebuilds by copying only if qconfig.h has changed
6528 if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
6529 rm -f "$outpath/src/corelib/global/qconfig.h.new"
6530 else
6531 [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h"
6532 mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
6533 chmod -w "$outpath/src/corelib/global/qconfig.h"
6534 for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
6535 if [ '!' -f "$conf" ]; then
6536 ln -s "$outpath/src/corelib/global/qconfig.h" "$conf"
6538 done
6541 #-------------------------------------------------------------------------------
6542 # save configuration into qconfig.pri
6543 #-------------------------------------------------------------------------------
6545 QTCONFIG="$outpath/mkspecs/qconfig.pri"
6546 QTCONFIG_CONFIG="$QTCONFIG_CONFIG no_mocdepend"
6547 [ -f "$QTCONFIG.tmp" ] && rm -f "$QTCONFIG.tmp"
6548 if [ "$CFG_DEBUG" = "yes" ]; then
6549 QTCONFIG_CONFIG="$QTCONFIG_CONFIG debug"
6550 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
6551 QT_CONFIG="$QT_CONFIG release"
6553 QT_CONFIG="$QT_CONFIG debug"
6554 elif [ "$CFG_DEBUG" = "no" ]; then
6555 QTCONFIG_CONFIG="$QTCONFIG_CONFIG release"
6556 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
6557 QT_CONFIG="$QT_CONFIG debug"
6559 QT_CONFIG="$QT_CONFIG release"
6561 if [ "$CFG_STL" = "yes" ]; then
6562 QTCONFIG_CONFIG="$QTCONFIG_CONFIG stl"
6564 if [ "$CFG_FRAMEWORK" = "no" ]; then
6565 QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_no_framework"
6566 else
6567 QT_CONFIG="$QT_CONFIG qt_framework"
6568 QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_framework"
6570 if [ "$PLATFORM_MAC" = "yes" ]; then
6571 QT_CONFIG="$QT_CONFIG $CFG_MAC_ARCHS"
6574 # Make the application arch follow the Qt arch for single arch builds.
6575 # (for multiple-arch builds, set CONFIG manually in the application .pro file)
6576 if [ `echo "$CFG_MAC_ARCHS" | wc -w` -eq 1 ]; then
6577 QTCONFIG_CONFIG="$QTCONFIG_CONFIG $CFG_MAC_ARCHS"
6580 cat >>"$QTCONFIG.tmp" <<EOF
6581 #configuration
6582 CONFIG += $QTCONFIG_CONFIG
6583 QT_ARCH = $CFG_ARCH
6584 QT_EDITION = $Edition
6585 QT_CONFIG += $QT_CONFIG
6587 #versioning
6588 QT_VERSION = $QT_VERSION
6589 QT_MAJOR_VERSION = $QT_MAJOR_VERSION
6590 QT_MINOR_VERSION = $QT_MINOR_VERSION
6591 QT_PATCH_VERSION = $QT_PATCH_VERSION
6593 #namespaces
6594 QT_LIBINFIX = $QT_LIBINFIX
6595 QT_NAMESPACE = $QT_NAMESPACE
6596 QT_NAMESPACE_MAC_CRC = $QT_NAMESPACE_MAC_CRC
6599 if [ "$CFG_RPATH" = "yes" ]; then
6600 echo "QMAKE_RPATHDIR += \"$QT_INSTALL_LIBS\"" >> "$QTCONFIG.tmp"
6602 if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
6603 echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION" >> "$QTCONFIG.tmp"
6604 echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION" >> "$QTCONFIG.tmp"
6605 echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION" >> "$QTCONFIG.tmp"
6607 # replace qconfig.pri if it differs from the newly created temp file
6608 if cmp -s "$QTCONFIG.tmp" "$QTCONFIG"; then
6609 rm -f "$QTCONFIG.tmp"
6610 else
6611 mv -f "$QTCONFIG.tmp" "$QTCONFIG"
6614 #-------------------------------------------------------------------------------
6615 # save configuration into .qmake.cache
6616 #-------------------------------------------------------------------------------
6618 CACHEFILE="$outpath/.qmake.cache"
6619 [ -f "$CACHEFILE.tmp" ] && rm -f "$CACHEFILE.tmp"
6620 cat >>"$CACHEFILE.tmp" <<EOF
6621 CONFIG += $QMAKE_CONFIG dylib create_prl link_prl depend_includepath fix_output_dirs QTDIR_build
6622 QT_SOURCE_TREE = \$\$quote($relpath)
6623 QT_BUILD_TREE = \$\$quote($outpath)
6624 QT_BUILD_PARTS = $CFG_BUILD_PARTS
6625 QMAKE_ABSOLUTE_SOURCE_ROOT = \$\$QT_SOURCE_TREE
6626 QMAKE_MOC_SRC = \$\$QT_BUILD_TREE/src/moc
6628 #local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR
6629 QMAKE_MOC = \$\$QT_BUILD_TREE/bin/moc
6630 QMAKE_UIC = \$\$QT_BUILD_TREE/bin/uic
6631 QMAKE_UIC3 = \$\$QT_BUILD_TREE/bin/uic3
6632 QMAKE_RCC = \$\$QT_BUILD_TREE/bin/rcc
6633 QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp
6634 QMAKE_INCDIR_QT = \$\$QT_BUILD_TREE/include
6635 QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib
6639 if [ -n "$QT_CFLAGS_PSQL" ]; then
6640 echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$CACHEFILE.tmp"
6642 if [ -n "$QT_LFLAGS_PSQL" ]; then
6643 echo "QT_LFLAGS_PSQL = $QT_LFLAGS_PSQL" >> "$CACHEFILE.tmp"
6645 if [ -n "$QT_CFLAGS_MYSQL" ]; then
6646 echo "QT_CFLAGS_MYSQL = $QT_CFLAGS_MYSQL" >> "$CACHEFILE.tmp"
6648 if [ -n "$QT_LFLAGS_MYSQL" ]; then
6649 echo "QT_LFLAGS_MYSQL = $QT_LFLAGS_MYSQL" >> "$CACHEFILE.tmp"
6651 if [ -n "$QT_CFLAGS_SQLITE" ]; then
6652 echo "QT_CFLAGS_SQLITE = $QT_CFLAGS_SQLITE" >> "$CACHEFILE.tmp"
6654 if [ -n "$QT_LFLAGS_SQLITE" ]; then
6655 echo "QT_LFLAGS_SQLITE = $QT_LFLAGS_SQLITE" >> "$CACHEFILE.tmp"
6658 if [ "$QT_EDITION" != "QT_EDITION_OPENSOURCE" ]; then
6659 echo "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" >> "$CACHEFILE.tmp"
6662 #dump in the OPENSSL_LIBS info
6663 if [ '!' -z "$OPENSSL_LIBS" ]; then
6664 echo "OPENSSL_LIBS = $OPENSSL_LIBS" >> "$CACHEFILE.tmp"
6665 elif [ "$CFG_OPENSSL" = "linked" ]; then
6666 echo "OPENSSL_LIBS = -lssl -lcrypto" >> "$CACHEFILE.tmp"
6669 #dump in the SDK info
6670 if [ '!' -z "$CFG_SDK" ]; then
6671 echo "QMAKE_MAC_SDK = $CFG_SDK" >> "$CACHEFILE.tmp"
6674 # mac gcc -Xarch support
6675 if [ "$CFG_MAC_XARCH" = "no" ]; then
6676 echo "QMAKE_MAC_XARCH = no" >> "$CACHEFILE.tmp"
6679 #dump the qmake spec
6680 if [ -d "$outpath/mkspecs/$XPLATFORM" ]; then
6681 echo "QMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$XPLATFORM" >> "$CACHEFILE.tmp"
6682 else
6683 echo "QMAKESPEC = $XPLATFORM" >> "$CACHEFILE.tmp"
6686 # cmdline args
6687 cat "$QMAKE_VARS_FILE" >> "$CACHEFILE.tmp"
6688 rm -f "$QMAKE_VARS_FILE" 2>/dev/null
6690 # incrementals
6691 INCREMENTAL=""
6692 [ "$CFG_INCREMENTAL" = "auto" ] && "$WHICH" p4 >/dev/null 2>&1 && [ "$CFG_DEV" = "yes" ] && CFG_INCREMENTAL="yes"
6693 if [ "$CFG_INCREMENTAL" = "yes" ]; then
6694 find "$relpath" -perm u+w -mtime -3 | grep 'cpp$' | while read f; do
6695 # don't need to worry about generated files
6696 [ -r `echo $f | sed "s,cpp$,ui,"` ] && continue
6697 basename "$f" | grep '^moc_' >/dev/null 2>&1 && continue
6698 # done
6699 INCREMENTAL="$INCREMENTAL `basename \"$f\" | sed 's,.cpp,.o,'`"
6700 done
6701 [ '!' -z "$INCREMENTAL" ] && echo "QMAKE_INCREMENTAL += $INCREMENTAL" >> "$CACHEFILE.tmp"
6702 [ -r "$outpath/.qmake.incremental" ] && echo "include($outpath/.qmake.incremental)" >> "$CACHEFILE.tmp"
6705 # replace .qmake.cache if it differs from the newly created temp file
6706 if cmp -s "$CACHEFILE.tmp" "$CACHEFILE"; then
6707 rm -f "$CACHEFILE.tmp"
6708 else
6709 mv -f "$CACHEFILE.tmp" "$CACHEFILE"
6712 #-------------------------------------------------------------------------------
6713 # give feedback on configuration
6714 #-------------------------------------------------------------------------------
6716 case "$COMPILER" in
6717 g++*)
6718 if [ "$CFG_EXCEPTIONS" != "no" ]; then
6719 cat <<EOF
6721 This target is using the GNU C++ compiler ($PLATFORM).
6723 Recent versions of this compiler automatically include code for
6724 exceptions, which increase both the size of the Qt libraries and
6725 the amount of memory taken by your applications.
6727 You may choose to re-run `basename $0` with the -no-exceptions
6728 option to compile Qt without exceptions. This is completely binary
6729 compatible, and existing applications will continue to work.
6734 cc*)
6735 case "$PLATFORM" in
6736 irix-cc*)
6737 if [ "$CFG_EXCEPTIONS" != "no" ]; then
6738 cat <<EOF
6740 This target is using the MIPSpro C++ compiler ($PLATFORM).
6742 You may choose to re-run `basename $0` with the -no-exceptions
6743 option to compile Qt without exceptions. This will make the
6744 size of the Qt library smaller and reduce the amount of memory
6745 taken by your applications.
6750 *) ;;
6751 esac
6753 *) ;;
6754 esac
6756 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" == "no" ] && [ "$CFG_WEBKIT" = "yes" ] && [ "$CFG_DEBUG_RELEASE" == "yes" ]; then
6757 cat <<EOF
6758 WARNING: DWARF2 debug symbols are not enabled. Linking webkit
6759 in debug mode will run out of memory on systems with 2GB or less.
6760 Install Xcode 2.4.1 or higher to enable DWARF2, or configure with
6761 -no-webkit or -release to skip webkit debug.
6765 echo
6766 if [ "$XPLATFORM" = "$PLATFORM" ]; then
6767 echo "Build type: $PLATFORM"
6768 else
6769 echo "Building on: $PLATFORM"
6770 echo "Building for: $XPLATFORM"
6773 if [ "$PLATFORM_MAC" = "yes" ]; then
6774 echo "Architecture: $CFG_ARCH ($CFG_MAC_ARCHS )"
6775 else
6776 echo "Architecture: $CFG_ARCH"
6779 if [ "$PLATFORM_QWS" = "yes" ]; then
6780 echo "Host architecture: $CFG_HOST_ARCH"
6783 if [ "$PLATFORM_MAC" = "yes" ]; then
6784 if [ "$CFG_MAC_COCOA" = "yes" ]; then
6785 if [ "$CFG_MAC_CARBON" = "yes" ]; then
6786 echo "Using framework: Carbon for 32-bit, Cocoa for 64-bit"
6787 else
6788 echo "Using framework: Cocoa"
6790 else
6791 echo "Using framework: Carbon"
6795 if [ -n "$PLATFORM_NOTES" ]; then
6796 echo "Platform notes:"
6797 echo "$PLATFORM_NOTES"
6798 else
6799 echo
6802 if [ "$OPT_VERBOSE" = "yes" ]; then
6803 if echo '\c' | grep '\c' >/dev/null; then
6804 echo -n "qmake vars .......... "
6805 else
6806 echo "qmake vars .......... \c"
6808 cat "$QMAKE_VARS_FILE" | tr '\n' ' '
6809 echo "qmake switches ...... $QMAKE_SWITCHES"
6812 [ "$CFG_INCREMENTAL" = "yes" ] && [ '!' -z "$INCREMENTAL" ] && echo "Incremental ......... $INCREMENTAL"
6813 echo "Build ............... $CFG_BUILD_PARTS"
6814 echo "Configuration ....... $QMAKE_CONFIG $QT_CONFIG"
6815 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
6816 echo "Debug ............... yes (combined)"
6817 if [ "$CFG_DEBUG" = "yes" ]; then
6818 echo "Default Link ........ debug"
6819 else
6820 echo "Default Link ........ release"
6822 else
6823 echo "Debug ............... $CFG_DEBUG"
6825 echo "Qt 3 compatibility .. $CFG_QT3SUPPORT"
6826 [ "$CFG_DBUS" = "no" ] && echo "QtDBus module ....... no"
6827 [ "$CFG_DBUS" = "yes" ] && echo "QtDBus module ....... yes (run-time)"
6828 [ "$CFG_DBUS" = "linked" ] && echo "QtDBus module ....... yes (linked)"
6829 echo "QtScriptTools module $CFG_SCRIPTTOOLS"
6830 echo "QtXmlPatterns module $CFG_XMLPATTERNS"
6831 echo "Phonon module ....... $CFG_PHONON"
6832 echo "SVG module .......... $CFG_SVG"
6833 echo "WebKit module ....... $CFG_WEBKIT"
6834 echo "STL support ......... $CFG_STL"
6835 echo "PCH support ......... $CFG_PRECOMPILE"
6836 echo "MMX/3DNOW/SSE/SSE2.. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}"
6837 if [ "${CFG_ARCH}" = "arm" ]; then
6838 echo "iWMMXt support ...... ${CFG_IWMMXT}"
6840 [ "${PLATFORM_QWS}" != "yes" ] && echo "Graphics System ..... $CFG_GRAPHICS_SYSTEM"
6841 echo "IPv6 support ........ $CFG_IPV6"
6842 echo "IPv6 ifname support . $CFG_IPV6IFNAME"
6843 echo "getaddrinfo support . $CFG_GETADDRINFO"
6844 echo "getifaddrs support .. $CFG_GETIFADDRS"
6845 echo "Accessibility ....... $CFG_ACCESSIBILITY"
6846 echo "NIS support ......... $CFG_NIS"
6847 echo "CUPS support ........ $CFG_CUPS"
6848 echo "Iconv support ....... $CFG_ICONV"
6849 echo "Glib support ........ $CFG_GLIB"
6850 echo "GStreamer support ... $CFG_GSTREAMER"
6851 echo "Large File support .. $CFG_LARGEFILE"
6852 echo "GIF support ......... $CFG_GIF"
6853 if [ "$CFG_TIFF" = "no" ]; then
6854 echo "TIFF support ........ $CFG_TIFF"
6855 else
6856 echo "TIFF support ........ $CFG_TIFF ($CFG_LIBTIFF)"
6858 if [ "$CFG_JPEG" = "no" ]; then
6859 echo "JPEG support ........ $CFG_JPEG"
6860 else
6861 echo "JPEG support ........ $CFG_JPEG ($CFG_LIBJPEG)"
6863 if [ "$CFG_PNG" = "no" ]; then
6864 echo "PNG support ......... $CFG_PNG"
6865 else
6866 echo "PNG support ......... $CFG_PNG ($CFG_LIBPNG)"
6868 if [ "$CFG_MNG" = "no" ]; then
6869 echo "MNG support ......... $CFG_MNG"
6870 else
6871 echo "MNG support ......... $CFG_MNG ($CFG_LIBMNG)"
6873 echo "zlib support ........ $CFG_ZLIB"
6874 echo "Session management .. $CFG_SM"
6875 if [ "$PLATFORM_QWS" = "yes" ]; then
6876 echo "Embedded support .... $CFG_EMBEDDED"
6877 if [ "$CFG_QWS_FREETYPE" = "auto" ]; then
6878 echo "Freetype2 support ... $CFG_QWS_FREETYPE ($CFG_LIBFREETYPE)"
6879 else
6880 echo "Freetype2 support ... $CFG_QWS_FREETYPE"
6882 # Normalize the decoration output first
6883 CFG_GFX_ON=`echo ${CFG_GFX_ON}`
6884 CFG_GFX_PLUGIN=`echo ${CFG_GFX_PLUGIN}`
6885 echo "Graphics (qt) ....... ${CFG_GFX_ON}"
6886 echo "Graphics (plugin) ... ${CFG_GFX_PLUGIN}"
6887 CFG_DECORATION_ON=`echo ${CFG_DECORATION_ON}`
6888 CFG_DECORATION_PLUGIN=`echo ${CFG_DECORATION_PLUGIN}`
6889 echo "Decorations (qt) .... $CFG_DECORATION_ON"
6890 echo "Decorations (plugin) $CFG_DECORATION_PLUGIN"
6891 CFG_KBD_ON=`echo ${CFG_KBD_ON}`
6892 CFG_KBD_PLUGIN=`echo ${CFG_KBD_PLUGIN}`
6893 echo "Keyboard driver (qt). ${CFG_KBD_ON}"
6894 echo "Keyboard driver (plugin) ${CFG_KBD_PLUGIN}"
6895 CFG_MOUSE_ON=`echo ${CFG_MOUSE_ON}`
6896 CFG_MOUSE_PLUGIN=`echo ${CFG_MOUSE_PLUGIN}`
6897 echo "Mouse driver (qt) ... $CFG_MOUSE_ON"
6898 echo "Mouse driver (plugin) $CFG_MOUSE_PLUGIN"
6900 if [ "$CFG_OPENGL" = "desktop" ]; then
6901 echo "OpenGL support ...... yes (Desktop OpenGL)"
6902 elif [ "$CFG_OPENGL" = "es1" ]; then
6903 echo "OpenGL support ...... yes (OpenGL ES 1.x Common profile)"
6904 elif [ "$CFG_OPENGL" = "es1cl" ]; then
6905 echo "OpenGL support ...... yes (OpenGL ES 1.x Common Lite profile)"
6906 elif [ "$CFG_OPENGL" = "es2" ]; then
6907 echo "OpenGL support ...... yes (OpenGL ES 2.x)"
6908 else
6909 echo "OpenGL support ...... no"
6911 if [ "$PLATFORM_X11" = "yes" ]; then
6912 echo "NAS sound support ... $CFG_NAS"
6913 echo "XShape support ...... $CFG_XSHAPE"
6914 echo "Xinerama support .... $CFG_XINERAMA"
6915 echo "Xcursor support ..... $CFG_XCURSOR"
6916 echo "Xfixes support ...... $CFG_XFIXES"
6917 echo "Xrandr support ...... $CFG_XRANDR"
6918 echo "Xrender support ..... $CFG_XRENDER"
6919 echo "Xi support .......... $CFG_XINPUT"
6920 echo "MIT-SHM support ..... $CFG_MITSHM"
6921 echo "FontConfig support .. $CFG_FONTCONFIG"
6922 echo "XKB Support ......... $CFG_XKB"
6923 echo "immodule support .... $CFG_IM"
6924 echo "GTK theme support ... $CFG_QGTKSTYLE"
6926 [ "$CFG_SQL_mysql" != "no" ] && echo "MySQL support ....... $CFG_SQL_mysql"
6927 [ "$CFG_SQL_psql" != "no" ] && echo "PostgreSQL support .. $CFG_SQL_psql"
6928 [ "$CFG_SQL_odbc" != "no" ] && echo "ODBC support ........ $CFG_SQL_odbc"
6929 [ "$CFG_SQL_oci" != "no" ] && echo "OCI support ......... $CFG_SQL_oci"
6930 [ "$CFG_SQL_tds" != "no" ] && echo "TDS support ......... $CFG_SQL_tds"
6931 [ "$CFG_SQL_db2" != "no" ] && echo "DB2 support ......... $CFG_SQL_db2"
6932 [ "$CFG_SQL_ibase" != "no" ] && echo "InterBase support ... $CFG_SQL_ibase"
6933 [ "$CFG_SQL_sqlite2" != "no" ] && echo "SQLite 2 support .... $CFG_SQL_sqlite2"
6934 [ "$CFG_SQL_sqlite" != "no" ] && echo "SQLite support ...... $CFG_SQL_sqlite ($CFG_SQLITE)"
6936 OPENSSL_LINKAGE=""
6937 if [ "$CFG_OPENSSL" = "yes" ]; then
6938 OPENSSL_LINKAGE="(run-time)"
6939 elif [ "$CFG_OPENSSL" = "linked" ]; then
6940 OPENSSL_LINKAGE="(linked)"
6942 echo "OpenSSL support ..... $CFG_OPENSSL $OPENSSL_LINKAGE"
6944 [ "$CFG_PTMALLOC" != "no" ] && echo "Use ptmalloc ........ $CFG_PTMALLOC"
6946 # complain about not being able to use dynamic plugins if we are using a static build
6947 if [ "$CFG_SHARED" = "no" ]; then
6948 echo
6949 echo "WARNING: Using static linking will disable the use of dynamically"
6950 echo "loaded plugins. Make sure to import all needed static plugins,"
6951 echo "or compile needed modules into the library."
6952 echo
6954 if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
6955 echo
6956 echo "NOTE: When linking against OpenSSL, you can override the default"
6957 echo "library names through OPENSSL_LIBS."
6958 echo "For example:"
6959 echo " ./configure -openssl-linked OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto'"
6960 echo
6962 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "no" ]; then
6963 echo
6964 echo "NOTE: Mac OS X frameworks implicitly build debug and release Qt libraries."
6965 echo
6967 echo
6969 sepath=`echo "$relpath" | sed -e 's/\\./\\\\./g'`
6970 PROCS=1
6971 EXEC=""
6974 #-------------------------------------------------------------------------------
6975 # build makefiles based on the configuration
6976 #-------------------------------------------------------------------------------
6978 echo "Finding project files. Please wait..."
6979 "$outpath/bin/qmake" -prl -r "${relpath}/projects.pro"
6980 if [ -f "${relpath}/projects.pro" ]; then
6981 mkfile="${outpath}/Makefile"
6982 [ -f "$mkfile" ] && chmod +w "$mkfile"
6983 QTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" "${relpath}/projects.pro" -o "$mkfile"
6986 # .projects -> projects to process
6987 # .projects.1 -> qt and moc
6988 # .projects.2 -> subdirs and libs
6989 # .projects.3 -> the rest
6990 rm -f .projects .projects.1 .projects.2 .projects.3
6992 QMAKE_PROJECTS=`find "$relpath/." -name '*.pro' -print | sed 's-/\./-/-'`
6993 if [ -z "$AWK" ]; then
6994 for p in `echo $QMAKE_PROJECTS`; do
6995 echo "$p" >> .projects
6996 done
6997 else
6998 cat >projects.awk <<EOF
6999 BEGIN {
7000 files = 0
7001 target_file = ""
7002 input_file = ""
7004 first = "./.projects.1.tmp"
7005 second = "./.projects.2.tmp"
7006 third = "./.projects.3.tmp"
7009 FNR == 1 {
7010 if ( input_file ) {
7011 if ( ! target_file )
7012 target_file = third
7013 print input_file >target_file
7016 matched_target = 0
7017 template_lib = 0
7018 input_file = FILENAME
7019 target_file = ""
7022 /^(TARGET.*=)/ {
7023 if ( \$3 == "moc" || \$3 ~ /^Qt/ ) {
7024 target_file = first
7025 matched_target = 1
7029 matched_target == 0 && /^(TEMPLATE.*=)/ {
7030 if ( \$3 == "subdirs" )
7031 target_file = second
7032 else if ( \$3 == "lib" )
7033 template_lib = 1
7034 else
7035 target_file = third
7038 matched_target == 0 && template_lib == 1 && /^(CONFIG.*=)/ {
7039 if ( \$0 ~ /plugin/ )
7040 target_file = third
7041 else
7042 target_file = second
7045 END {
7046 if ( input_file ) {
7047 if ( ! target_file )
7048 target_file = third
7049 print input_file >>target_file
7055 rm -f .projects.all
7056 for p in `echo $QMAKE_PROJECTS`; do
7057 echo "$p" >> .projects.all
7058 done
7060 # if you get errors about the length of the command line to awk, change the -l arg
7061 # to split below
7062 split -l 100 .projects.all .projects.all.
7063 for p in .projects.all.*; do
7064 "$AWK" -f projects.awk `cat $p`
7065 [ -f .projects.1.tmp ] && cat .projects.1.tmp >> .projects.1
7066 [ -f .projects.2.tmp ] && cat .projects.2.tmp >> .projects.2
7067 [ -f .projects.3.tmp ] && cat .projects.3.tmp >> .projects.3
7068 rm -f .projects.1.tmp .projects.2.tmp .projects.3.tmp $p
7069 done
7070 rm -f .projects.all* projects.awk
7072 [ -f .projects.1 ] && cat .projects.1 >>.projects
7073 [ -f .projects.2 ] && cat .projects.2 >>.projects
7074 rm -f .projects.1 .projects.2
7075 if [ -f .projects.3 ] && [ "$OPT_FAST" = "no" ]; then
7076 cat .projects.3 >>.projects
7077 rm -f .projects.3
7080 # don't sort Qt and MOC in with the other project files
7081 # also work around a segfaulting uniq(1)
7082 if [ -f .sorted.projects.2 ]; then
7083 sort .sorted.projects.2 > .sorted.projects.2.new
7084 mv -f .sorted.projects.2.new .sorted.projects.2
7085 cat .sorted.projects.2 >> .sorted.projects.1
7087 [ -f .sorted.projects.1 ] && sort .sorted.projects.1 >> .sorted.projects
7088 rm -f .sorted.projects.2 .sorted.projects.1
7090 NORM_PROJECTS=0
7091 FAST_PROJECTS=0
7092 if [ -f .projects ]; then
7093 uniq .projects >.tmp
7094 mv -f .tmp .projects
7095 NORM_PROJECTS=`cat .projects | wc -l | sed -e "s, ,,g"`
7097 if [ -f .projects.3 ]; then
7098 uniq .projects.3 >.tmp
7099 mv -f .tmp .projects.3
7100 FAST_PROJECTS=`cat .projects.3 | wc -l | sed -e "s, ,,g"`
7102 echo " `expr $NORM_PROJECTS + $FAST_PROJECTS` projects found."
7103 echo
7105 PART_ROOTS=
7106 for part in $CFG_BUILD_PARTS; do
7107 case "$part" in
7108 tools) PART_ROOTS="$PART_ROOTS tools" ;;
7109 libs) PART_ROOTS="$PART_ROOTS src" ;;
7110 examples) PART_ROOTS="$PART_ROOTS examples demos" ;;
7111 *) ;;
7112 esac
7113 done
7115 if [ "$CFG_DEV" = "yes" ]; then
7116 PART_ROOTS="$PART_ROOTS tests"
7119 echo "Creating makefiles. Please wait..."
7120 for file in .projects .projects.3; do
7121 [ '!' -f "$file" ] && continue
7122 for a in `cat $file`; do
7123 IN_ROOT=no
7124 for r in $PART_ROOTS; do
7125 if echo "$a" | grep "^$r" >/dev/null 2>&1 || echo "$a" | grep "^$relpath/$r" >/dev/null 2>&1; then
7126 IN_ROOT=yes
7127 break
7129 done
7130 [ "$IN_ROOT" = "no" ] && continue
7132 case $a in
7133 *winmain/winmain.pro) continue ;;
7134 */qmake/qmake.pro) continue ;;
7135 *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*) SPEC=$QMAKESPEC ;;
7136 *) SPEC=$XQMAKESPEC ;;
7137 esac
7138 dir=`dirname $a | sed -e "s;$sepath;.;g"`
7139 test -d "$dir" || mkdir -p "$dir"
7140 OUTDIR="$outpath/$dir"
7141 if [ -f "${OUTDIR}/Makefile" ] && [ "$OPT_FAST" = "yes" ]; then
7142 # fast configure - the makefile exists, skip it
7143 # since the makefile exists, it was generated by qmake, which means we
7144 # can skip it, since qmake has a rule to regenerate the makefile if the .pro
7145 # file changes...
7146 [ "$OPT_VERBOSE" = "yes" ] && echo " skipping $a"
7147 continue;
7149 QMAKE_SPEC_ARGS="-spec $SPEC"
7150 if echo '\c' | grep '\c' >/dev/null; then
7151 echo -n " for $a"
7152 else
7153 echo " for $a\c"
7156 QMAKE="$outpath/bin/qmake"
7157 QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS"
7158 if [ "$file" = ".projects.3" ]; then
7159 if echo '\c' | grep '\c' >/dev/null; then
7160 echo -n " (fast)"
7161 else
7162 echo " (fast)\c"
7164 echo
7166 cat >"${OUTDIR}/Makefile" <<EOF
7167 # ${OUTDIR}/Makefile: generated by configure
7169 # WARNING: This makefile will be replaced with a real makefile.
7170 # All changes made to this file will be lost.
7172 [ "$CFG_DEBUG_RELEASE" = "no" ] && echo "first_target: first" >>${OUTDIR}/Makefile
7174 cat >>"${OUTDIR}/Makefile" <<EOF
7175 QMAKE = "$QMAKE"
7176 all clean install qmake first Makefile: FORCE
7177 \$(QMAKE) $QMAKE_ARGS -o "$OUTDIR" "$a"
7178 cd "$OUTDIR"
7179 \$(MAKE) \$@
7181 FORCE:
7184 else
7185 if [ "$OPT_VERBOSE" = "yes" ]; then
7186 echo " (`basename $SPEC`)"
7187 echo "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
7188 else
7189 echo
7192 [ -f "${OUTDIR}/Makefile" ] && chmod +w "${OUTDIR}/Makefile"
7193 QTDIR="$outpath" "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
7195 done
7196 done
7197 rm -f .projects .projects.3
7199 #-------------------------------------------------------------------------------
7200 # XShape is important, DnD in the Designer doens't work without it
7201 #-------------------------------------------------------------------------------
7202 if [ "$PLATFORM_X11" = "yes" ] && [ "$CFG_XSHAPE" = "no" ]; then
7203 cat <<EOF
7205 NOTICE: Qt will not be built with XShape support.
7207 As a result, drag-and-drop in the Qt Designer will NOT
7208 work. We recommend that you enable XShape support by passing
7209 the -xshape switch to $0.
7213 #-------------------------------------------------------------------------------
7214 # check for platforms that we don't yet know about
7215 #-------------------------------------------------------------------------------
7216 if [ "$CFG_ARCH" = "generic" ]; then
7217 cat <<EOF
7219 NOTICE: Atomic operations are not yet supported for this
7220 architecture.
7222 Qt will use the 'generic' architecture instead, which uses a
7223 single pthread_mutex_t to protect all atomic operations. This
7224 implementation is the slow (but safe) fallback implementation
7225 for architectures Qt does not yet support.
7229 #-------------------------------------------------------------------------------
7230 # check if the user passed the -no-zlib option, which is no longer supported
7231 #-------------------------------------------------------------------------------
7232 if [ -n "$ZLIB_FORCED" ]; then
7233 which_zlib="supplied"
7234 if [ "$CFG_ZLIB" = "system" ]; then
7235 which_zlib="system"
7238 cat <<EOF
7240 NOTICE: The -no-zlib option was supplied but is no longer
7241 supported.
7243 Qt now requires zlib support in all builds, so the -no-zlib
7244 option was ignored. Qt will be built using the $which_zlib
7245 zlib.
7249 #-------------------------------------------------------------------------------
7250 # finally save the executed command to another script
7251 #-------------------------------------------------------------------------------
7252 if [ `basename $0` != "config.status" ]; then
7253 CONFIG_STATUS="$relpath/$relconf $OPT_CMDLINE"
7255 # add the system variables
7256 for varname in $SYSTEM_VARIABLES; do
7257 cmd=`echo \
7258 'if [ -n "\$'${varname}'" ]; then
7259 CONFIG_STATUS="'${varname}'='"'\\\$${varname}'"' \$CONFIG_STATUS"
7260 fi'`
7261 eval "$cmd"
7262 done
7264 echo "$CONFIG_STATUS" | grep '\-confirm\-license' >/dev/null 2>&1 || CONFIG_STATUS="$CONFIG_STATUS -confirm-license"
7266 [ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
7267 echo "#!/bin/sh" > "$outpath/config.status"
7268 echo "if [ \"\$#\" -gt 0 ]; then" >> "$outpath/config.status"
7269 echo " $CONFIG_STATUS \"\$@\"" >> "$outpath/config.status"
7270 echo "else" >> "$outpath/config.status"
7271 echo " $CONFIG_STATUS" >> "$outpath/config.status"
7272 echo "fi" >> "$outpath/config.status"
7273 chmod +x "$outpath/config.status"
7276 if [ -n "$RPATH_MESSAGE" ]; then
7277 echo
7278 echo "$RPATH_MESSAGE"
7281 MAKE=`basename $MAKE`
7282 echo
7283 echo Qt is now configured for building. Just run \'$MAKE\'.
7284 if [ "$relpath" = "$QT_INSTALL_PREFIX" ]; then
7285 echo Once everything is built, Qt is installed.
7286 echo You should not run \'$MAKE install\'.
7287 else
7288 echo Once everything is built, you must run \'$MAKE install\'.
7289 echo Qt will be installed into $QT_INSTALL_PREFIX
7291 echo
7292 echo To reconfigure, run \'$MAKE confclean\' and \'configure\'.
7293 echo