QDirIterator refactoring
[qt-netbsd.git] / configure
blobb65e6d54edf58bcc35a75d25ef20a44157baa43c
1 #!/bin/sh
3 # Configures to build the Qt library
5 # Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
6 # Contact: Nokia Corporation (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 if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ]; then
123 # This is a depot build, or an all-platforms package
124 PLATFORM_QWS=maybe
125 else
126 # This must be the embedded package, since the Qt/Mac source files are not present
127 PLATFORM_QWS=yes
131 #-----------------------------------------------------------------------------
132 # Qt version detection
133 #-----------------------------------------------------------------------------
134 QT_VERSION=`grep '^# *define *QT_VERSION_STR' "$relpath"/src/corelib/global/qglobal.h`
135 QT_MAJOR_VERSION=
136 QT_MINOR_VERSION=0
137 QT_PATCH_VERSION=0
138 if [ -n "$QT_VERSION" ]; then
139 QT_VERSION=`echo $QT_VERSION | sed 's,^# *define *QT_VERSION_STR *"*\([^ ]*\)"$,\1,'`
140 MAJOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
141 if [ -n "$MAJOR" ]; then
142 MINOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
143 PATCH=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
144 QT_MAJOR_VERSION="$MAJOR"
145 [ -z "$MINOR" ] || QT_MINOR_VERSION="$MINOR"
146 [ -z "$PATCH" ] || QT_PATCH_VERSION="$PATCH"
149 if [ -z "$QT_MAJOR_VERSION" ]; then
150 echo "Cannot process version from qglobal.h: $QT_VERSION"
151 echo "Cannot proceed."
152 exit 1
155 QT_PACKAGEDATE=`grep '^# *define *QT_PACKAGEDATE_STR' "$relpath"/src/corelib/global/qglobal.h | sed -e 's,^# *define *QT_PACKAGEDATE_STR *"\([^ ]*\)"$,\1,' -e s,-,,g`
156 if [ -z "$QT_PACKAGEDATE" ]; then
157 echo "Unable to determine package date from qglobal.h: '$QT_PACKAGEDATE'"
158 echo "Cannot proceed"
159 exit 1
162 #-------------------------------------------------------------------------------
163 # check the license
164 #-------------------------------------------------------------------------------
165 COMMERCIAL_USER=ask
166 CFG_DEV=no
167 CFG_NOKIA=no
168 CFG_EMBEDDED=no
169 EditionString=Commercial
171 earlyArgParse()
173 # parse the arguments, setting things to "yes" or "no"
174 while [ "$#" -gt 0 ]; do
175 CURRENT_OPT="$1"
176 UNKNOWN_ARG=no
177 case "$1" in
178 #Autoconf style options
179 --enable-*)
180 VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
181 VAL=yes
183 --disable-*)
184 VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
185 VAL=no
187 --*=*)
188 VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
189 VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
191 --no-*)
192 VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
193 VAL=no
195 -embedded)
196 VAR=embedded
197 # this option may or may not be followed by an argument
198 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
199 VAL=auto
200 else
201 shift;
202 VAL=$1
205 -h|help|--help|-help)
206 if [ "$VAL" = "yes" ]; then
207 OPT_HELP="$VAL"
208 COMMERCIAL_USER="no" #doesn't matter we will display the help
209 else
210 UNKNOWN_OPT=yes
211 COMMERCIAL_USER="no" #doesn't matter we will display the help
214 --*)
215 VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
216 VAL=yes
219 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
220 VAL="unknown"
223 UNKNOWN_ARG=yes
225 esac
226 if [ "$UNKNOWN_ARG" = "yes" ]; then
227 shift
228 continue
230 shift
232 UNKNOWN_OPT=no
233 case "$VAR" in
234 embedded)
235 CFG_EMBEDDED="$VAL"
236 if [ "$PLATFORM_QWS" != "no" ]; then
237 if [ "$PLATFORM_QWS" = "maybe" ]; then
238 PLATFORM_X11=no
239 PLATFORM_MAC=no
240 PLATFORM_QWS=yes
242 else
243 echo "No license exists to enable Qt for Embedded Linux. Disabling."
244 CFG_EMBEDDED=no
247 developer-build)
248 CFG_DEV="yes"
250 nokia-developer)
251 CFG_DEV="yes"
252 CFG_NOKIA="yes"
253 COMMERCIAL_USER="no"
255 commercial)
256 COMMERCIAL_USER="yes"
258 opensource)
259 COMMERCIAL_USER="no"
262 UNKNOWN_OPT=yes
264 esac
265 done
268 earlyArgParse "$@"
270 if [ "$COMMERCIAL_USER" = "ask" ]; then
271 while true; do
272 echo "Which edition of Qt do you want to use ?"
273 echo
274 echo "Type 'c' if you want to use the Commercial Edition."
275 echo "Type 'o' if you want to use the Open Source Edition."
276 echo
277 read commercial
278 echo
279 if [ "$commercial" = "c" ]; then
280 COMMERCIAL_USER="yes"
281 break
282 elif [ "$commercial" = "o" ]; then
283 COMMERCIAL_USER="no"
284 break
286 done
289 if [ "$CFG_NOKIA" = "yes" ]; then
290 Licensee="Nokia"
291 Edition="NokiaInternalBuild"
292 EditionString="Nokia Internal Build"
293 QT_EDITION="QT_EDITION_OPENSOURCE"
294 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
295 elif [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then
296 # Commercial preview release
297 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
298 Licensee="Preview"
299 Edition="Preview"
300 QT_EDITION="QT_EDITION_DESKTOP"
301 LicenseType="Technology Preview"
302 elif [ $COMMERCIAL_USER = "yes" ]; then
303 # one of commercial editions
304 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
305 [ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=yes
307 # read in the license file
308 if [ -f "$LICENSE_FILE" ]; then
309 . "$LICENSE_FILE" >/dev/null 2>&1
310 if [ -z "$LicenseKeyExt" ]; then
311 echo
312 echo "You are using an old license file."
313 echo
314 echo "Please install the license file supplied by Nokia,"
315 echo "or install the Qt Open Source Edition if you intend to"
316 echo "develop free software."
317 exit 1
319 if [ -z "$Licensee" ]; then
320 echo
321 echo "Invalid license key. Please check the license key."
322 exit 1
324 else
325 if [ -z "$LicenseKeyExt" ]; then
326 echo
327 if echo '\c' | grep '\c' >/dev/null; then
328 echo -n "Please enter your license key: "
329 else
330 echo "Please enter your license key: \c"
332 read LicenseKeyExt
333 Licensee="Unknown user"
337 # Key verification
338 echo "$LicenseKeyExt" | grep ".....*-....*-....*-....*-.....*-.....*-...." >/dev/null 2>&1 \
339 && LicenseValid="yes" \
340 || LicenseValid="no"
341 if [ "$LicenseValid" != "yes" ]; then
342 echo
343 echo "Invalid license key. Please check the license key."
344 exit 1
346 ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1`
347 PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d - | cut -b 1`
348 LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -`
349 LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1`
351 # determine which edition we are licensed to use
352 case "$LicenseTypeCode" in
353 F4M)
354 LicenseType="Commercial"
355 case $ProductCode in
357 Edition="Universal"
358 QT_EDITION="QT_EDITION_UNIVERSAL"
361 Edition="FullFramework"
362 EditionString="Full Framework"
363 QT_EDITION="QT_EDITION_DESKTOP"
366 Edition="GUIFramework"
367 EditionString="GUI Framework"
368 QT_EDITION="QT_EDITION_DESKTOPLIGHT"
370 esac
372 Z4M|R4M|Q4M)
373 LicenseType="Evaluation"
374 case $ProductCode in
376 Edition="Evaluation"
377 QT_EDITION="QT_EDITION_EVALUATION"
379 esac
381 esac
382 if [ -z "$LicenseType" -o -z "$Edition" -o -z "$QT_EDITION" ]; then
383 echo
384 echo "Invalid license key. Please check the license key."
385 exit 1
388 # verify that we are licensed to use Qt on this platform
389 LICENSE_EXTENSION=
390 if [ "$PlatformCode" = "X" ]; then
391 # Qt All-OS
392 LICENSE_EXTENSION="-ALLOS"
393 elif [ "$PLATFORM_QWS" = "yes" ]; then
394 case $PlatformCode in
395 2|4|8|A|B|E|G|J|K|P|Q|S|U|V|W)
396 # Qt for Embedded Linux
397 LICENSE_EXTENSION="-EMBEDDED"
400 echo
401 echo "You are not licensed for Qt for Embedded Linux."
402 echo
403 echo "Please contact sales@trolltech.com to upgrade your license"
404 echo "to include Qt for Embedded Linux, or install the"
405 echo "Qt Open Source Edition if you intend to develop free software."
406 exit 1
408 esac
409 elif [ "$PLATFORM_MAC" = "yes" ]; then
410 case $PlatformCode in
411 2|4|5|7|9|B|C|E|F|G|L|M|U|W|Y)
412 # Qt/Mac
413 LICENSE_EXTENSION="-DESKTOP"
415 3|6|8|A|D|H|J|K|P|Q|S|V)
416 # Embedded no-deploy
417 LICENSE_EXTENSION="-EMBEDDED"
420 echo
421 echo "You are not licensed for the Qt/Mac platform."
422 echo
423 echo "Please contact sales@trolltech.com to upgrade your license"
424 echo "to include the Qt/Mac platform."
425 exit 1
427 esac
428 else
429 case $PlatformCode in
430 2|3|4|5|7|D|E|F|J|M|Q|S|T|V|Z)
431 # Qt/X11
432 LICENSE_EXTENSION="-DESKTOP"
434 6|8|9|A|B|C|G|H|K|P|U|W)
435 # Embedded no-deploy
436 LICENSE_EXTENSION="-EMBEDDED"
439 echo
440 echo "You are not licensed for the Qt/X11 platform."
441 echo
442 echo "Please contact sales@trolltech.com to upgrade your license to"
443 echo "include the Qt/X11 platform, or install the Qt Open Source Edition"
444 echo "if you intend to develop free software."
445 exit 1
447 esac
450 if test -r "$relpath/.LICENSE"; then
451 # Generic, non-final license
452 LICENSE_EXTENSION=""
453 line=`sed 'y/a-z/A-Z/;q' "$relpath"/.LICENSE`
454 case "$line" in
455 *BETA*)
456 Edition=Beta
458 *TECHNOLOGY?PREVIEW*)
459 Edition=Preview
461 *EVALUATION*)
462 Edition=Evaluation
465 echo >&2 "Invalid license files; cannot continue"
466 exit 1
468 esac
469 Licensee="$Edition"
470 EditionString="$Edition"
471 QT_EDITION="QT_EDITION_DESKTOP"
474 case "$LicenseFeatureCode" in
475 G|L)
476 # US
477 case "$LicenseType" in
478 Commercial)
479 cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-US" "$outpath/LICENSE"
481 Evaluation)
482 cp -f "$relpath/.LICENSE-EVALUATION-US" "$outpath/LICENSE"
484 esac
486 2|5)
487 # non-US
488 case "$LicenseType" in
489 Commercial)
490 cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}" "$outpath/LICENSE"
492 Evaluation)
493 cp -f "$relpath/.LICENSE-EVALUATION" "$outpath/LICENSE"
495 esac
498 echo
499 echo "Invalid license key. Please check the license key."
500 exit 1
502 esac
503 if [ '!' -f "$outpath/LICENSE" ]; then
504 echo "The LICENSE, LICENSE.GPL3 LICENSE.LGPL file shipped with"
505 echo "this software has disappeared."
506 echo
507 echo "Sorry, you are not licensed to use this software."
508 echo "Try re-installing."
509 echo
510 exit 1
512 elif [ $COMMERCIAL_USER = "no" ]; then
513 # Open Source edition - may only be used under the terms of the GPL or LGPL.
514 [ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
515 Licensee="Open Source"
516 Edition="OpenSource"
517 EditionString="Open Source"
518 QT_EDITION="QT_EDITION_OPENSOURCE"
521 #-------------------------------------------------------------------------------
522 # initalize variables
523 #-------------------------------------------------------------------------------
525 SYSTEM_VARIABLES="CC CXX CFLAGS CXXFLAGS LDFLAGS"
526 for varname in $SYSTEM_VARIABLES; do
527 qmakevarname="${varname}"
528 # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
529 if [ "${varname}" = "LDFLAGS" ]; then
530 qmakevarname="LFLAGS"
532 cmd=`echo \
533 'if [ -n "\$'${varname}'" ]; then
534 QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}'"
535 fi'`
536 eval "$cmd"
537 done
538 # Use CC/CXX to run config.tests
539 mkdir -p "$outpath/config.tests"
540 rm -f "$outpath/config.tests/.qmake.cache"
541 cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
543 QMakeVar add styles "cde mac motif plastique cleanlooks windows"
544 QMakeVar add decorations "default windows styled"
545 QMakeVar add gfx-drivers "linuxfb"
546 QMakeVar add kbd-drivers "tty"
547 QMakeVar add mouse-drivers "pc linuxtp"
549 if [ "$CFG_DEV" = "yes" ]; then
550 QMakeVar add kbd-drivers "um"
553 # QTDIR may be set and point to an old or system-wide Qt installation
554 unset QTDIR
556 # the minimum version of libdbus-1 that we require:
557 MIN_DBUS_1_VERSION=0.62
559 # initalize internal variables
560 CFG_CONFIGURE_EXIT_ON_ERROR=yes
561 CFG_PROFILE=no
562 CFG_EXCEPTIONS=unspecified
563 CFG_SCRIPTTOOLS=auto # (yes|no|auto)
564 CFG_XMLPATTERNS=auto # (yes|no|auto)
565 CFG_INCREMENTAL=auto
566 CFG_QCONFIG=full
567 CFG_DEBUG=auto
568 CFG_MYSQL_CONFIG=
569 CFG_DEBUG_RELEASE=no
570 CFG_SHARED=yes
571 CFG_SM=auto
572 CFG_XSHAPE=auto
573 CFG_XSYNC=auto
574 CFG_XINERAMA=runtime
575 CFG_XFIXES=runtime
576 CFG_ZLIB=auto
577 CFG_SQLITE=qt
578 CFG_GIF=auto
579 CFG_TIFF=auto
580 CFG_LIBTIFF=auto
581 CFG_PNG=yes
582 CFG_LIBPNG=auto
583 CFG_JPEG=auto
584 CFG_LIBJPEG=auto
585 CFG_MNG=auto
586 CFG_LIBMNG=auto
587 CFG_XCURSOR=runtime
588 CFG_XRANDR=runtime
589 CFG_XRENDER=auto
590 CFG_MITSHM=auto
591 CFG_OPENGL=auto
592 CFG_OPENVG=no
593 CFG_OPENVG_LC_INCLUDES=no
594 CFG_OPENVG_SHIVA=no
595 CFG_OPENVG_ON_OPENGL=no
596 CFG_EGL=no
597 CFG_EGL_GLES_INCLUDES=no
598 CFG_SSE=auto
599 CFG_FONTCONFIG=auto
600 CFG_QWS_FREETYPE=auto
601 CFG_LIBFREETYPE=auto
602 CFG_SQL_AVAILABLE=
603 QT_DEFAULT_BUILD_PARTS="libs tools examples demos docs translations"
604 CFG_BUILD_PARTS=""
605 CFG_NOBUILD_PARTS=""
606 CFG_RELEASE_QMAKE=no
607 CFG_PHONON=auto
608 CFG_PHONON_BACKEND=yes
609 CFG_SVG=yes
610 CFG_WEBKIT=auto # (yes|no|auto)
612 CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen"
613 CFG_GFX_ON="linuxfb multiscreen"
614 CFG_GFX_PLUGIN_AVAILABLE=
615 CFG_GFX_PLUGIN=
616 CFG_GFX_OFF=
617 CFG_KBD_AVAILABLE="tty linuxinput sl5000 yopy vr41xx qvfb"
618 CFG_KBD_ON="tty" #default, see QMakeVar above
619 CFG_MOUSE_AVAILABLE="pc bus linuxtp yopy vr41xx tslib qvfb"
620 CFG_MOUSE_ON="pc linuxtp" #default, see QMakeVar above
622 CFG_ARCH=
623 CFG_HOST_ARCH=
624 CFG_KBD_PLUGIN_AVAILABLE=
625 CFG_KBD_PLUGIN=
626 CFG_KBD_OFF=
627 CFG_MOUSE_PLUGIN_AVAILABLE=
628 CFG_MOUSE_PLUGIN=
629 CFG_MOUSE_OFF=
630 CFG_USE_GNUMAKE=no
631 CFG_IM=yes
632 CFG_DECORATION_AVAILABLE="styled windows default"
633 CFG_DECORATION_ON="${CFG_DECORATION_AVAILABLE}" # all on by default
634 CFG_DECORATION_PLUGIN_AVAILABLE=
635 CFG_DECORATION_PLUGIN=
636 CFG_XINPUT=runtime
637 CFG_XKB=auto
638 CFG_NIS=auto
639 CFG_CUPS=auto
640 CFG_ICONV=auto
641 CFG_DBUS=auto
642 CFG_GLIB=auto
643 CFG_GSTREAMER=auto
644 CFG_QGTKSTYLE=auto
645 CFG_LARGEFILE=auto
646 CFG_OPENSSL=auto
647 CFG_PTMALLOC=no
648 CFG_STL=auto
649 CFG_PRECOMPILE=auto
650 CFG_SEPARATE_DEBUG_INFO=auto
651 CFG_REDUCE_EXPORTS=auto
652 CFG_MMX=auto
653 CFG_3DNOW=auto
654 CFG_SSE=auto
655 CFG_SSE2=auto
656 CFG_REDUCE_RELOCATIONS=no
657 CFG_IPV6=auto
658 CFG_NAS=no
659 CFG_QWS_DEPTHS=all
660 CFG_USER_BUILD_KEY=
661 CFG_ACCESSIBILITY=auto
662 CFG_QT3SUPPORT=yes
663 CFG_ENDIAN=auto
664 CFG_HOST_ENDIAN=auto
665 CFG_DOUBLEFORMAT=auto
666 CFG_ARMFPA=auto
667 CFG_IWMMXT=no
668 CFG_CLOCK_GETTIME=auto
669 CFG_CLOCK_MONOTONIC=auto
670 CFG_MREMAP=auto
671 CFG_GETADDRINFO=auto
672 CFG_IPV6IFNAME=auto
673 CFG_GETIFADDRS=auto
674 CFG_INOTIFY=auto
675 CFG_RPATH=yes
676 CFG_FRAMEWORK=auto
677 CFG_MAC_ARCHS=
678 MAC_CONFIG_TEST_COMMANDLINE= # used to make the configure tests run with the correct arch's and SDK settings
679 CFG_MAC_DWARF2=auto
680 CFG_MAC_XARCH=auto
681 CFG_MAC_CARBON=yes
682 CFG_MAC_COCOA=auto
683 COMMANDLINE_MAC_COCOA=no
684 CFG_SXE=no
685 CFG_PREFIX_INSTALL=yes
686 CFG_SDK=
687 D_FLAGS=
688 I_FLAGS=
689 L_FLAGS=
690 RPATH_FLAGS=
691 l_FLAGS=
692 QCONFIG_FLAGS=
693 XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++"
694 PLATFORM=$QMAKESPEC
695 QT_CROSS_COMPILE=no
696 OPT_CONFIRM_LICENSE=no
697 OPT_SHADOW=maybe
698 OPT_FAST=auto
699 OPT_VERBOSE=no
700 OPT_HELP=
701 CFG_SILENT=no
702 CFG_GRAPHICS_SYSTEM=default
704 # initalize variables used for installation
705 QT_INSTALL_PREFIX=
706 QT_INSTALL_DOCS=
707 QT_INSTALL_HEADERS=
708 QT_INSTALL_LIBS=
709 QT_INSTALL_BINS=
710 QT_INSTALL_PLUGINS=
711 QT_INSTALL_DATA=
712 QT_INSTALL_TRANSLATIONS=
713 QT_INSTALL_SETTINGS=
714 QT_INSTALL_EXAMPLES=
715 QT_INSTALL_DEMOS=
716 QT_HOST_PREFIX=
718 #flags for SQL drivers
719 QT_CFLAGS_PSQL=
720 QT_LFLAGS_PSQL=
721 QT_CFLAGS_MYSQL=
722 QT_LFLAGS_MYSQL=
723 QT_LFLAGS_MYSQL_R=
724 QT_CFLAGS_SQLITE=
725 QT_LFLAGS_SQLITE=
726 QT_LFLAGS_ODBC="-lodbc"
728 # flags for libdbus-1
729 QT_CFLAGS_DBUS=
730 QT_LIBS_DBUS=
732 # flags for Glib (X11 only)
733 QT_CFLAGS_GLIB=
734 QT_LIBS_GLIB=
736 # flags for GStreamer (X11 only)
737 QT_CFLAGS_GSTREAMER=
738 QT_LIBS_GSTREAMER=
740 #-------------------------------------------------------------------------------
741 # check SQL drivers, mouse drivers and decorations available in this package
742 #-------------------------------------------------------------------------------
744 # opensource version removes some drivers, so force them to be off
745 CFG_SQL_tds=no
746 CFG_SQL_oci=no
747 CFG_SQL_db2=no
749 CFG_SQL_AVAILABLE=
750 if [ -d "$relpath/src/plugins/sqldrivers" ]; then
751 for a in "$relpath/src/plugins/sqldrivers/"*; do
752 if [ -d "$a" ]; then
753 base_a=`basename "$a"`
754 CFG_SQL_AVAILABLE="${CFG_SQL_AVAILABLE} ${base_a}"
755 eval "CFG_SQL_${base_a}=auto"
757 done
760 CFG_DECORATION_PLUGIN_AVAILABLE=
761 if [ -d "$relpath/src/plugins/decorations" ]; then
762 for a in "$relpath/src/plugins/decorations/"*; do
763 if [ -d "$a" ]; then
764 base_a=`basename "$a"`
765 CFG_DECORATION_PLUGIN_AVAILABLE="${CFG_DECORATION_PLUGIN_AVAILABLE} ${base_a}"
767 done
770 CFG_KBD_PLUGIN_AVAILABLE=
771 if [ -d "$relpath/src/plugins/kbddrivers" ]; then
772 for a in "$relpath/src/plugins/kbddrivers/"*; do
773 if [ -d "$a" ]; then
774 base_a=`basename "$a"`
775 CFG_KBD_PLUGIN_AVAILABLE="${CFG_KBD_PLUGIN_AVAILABLE} ${base_a}"
777 done
780 CFG_MOUSE_PLUGIN_AVAILABLE=
781 if [ -d "$relpath/src/plugins/mousedrivers" ]; then
782 for a in "$relpath/src/plugins/mousedrivers/"*; do
783 if [ -d "$a" ]; then
784 base_a=`basename "$a"`
785 CFG_MOUSE_PLUGIN_AVAILABLE="${CFG_MOUSE_PLUGIN_AVAILABLE} ${base_a}"
787 done
790 CFG_GFX_PLUGIN_AVAILABLE=
791 if [ -d "$relpath/src/plugins/gfxdrivers" ]; then
792 for a in "$relpath/src/plugins/gfxdrivers/"*; do
793 if [ -d "$a" ]; then
794 base_a=`basename "$a"`
795 CFG_GFX_PLUGIN_AVAILABLE="${CFG_GFX_PLUGIN_AVAILABLE} ${base_a}"
797 done
798 CFG_GFX_OFF="$CFG_GFX_AVAILABLE" # assume all off
801 #-------------------------------------------------------------------------------
802 # parse command line arguments
803 #-------------------------------------------------------------------------------
805 # parse the arguments, setting things to "yes" or "no"
806 while [ "$#" -gt 0 ]; do
807 CURRENT_OPT="$1"
808 UNKNOWN_ARG=no
809 case "$1" in
810 #Autoconf style options
811 --enable-*)
812 VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
813 VAL=yes
815 --disable-*)
816 VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
817 VAL=no
819 --*=*)
820 VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
821 VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
823 --no-*)
824 VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
825 VAL=no
827 --*)
828 VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
829 VAL=yes
831 #Qt plugin options
832 -no-*-*|-plugin-*-*|-qt-*-*)
833 VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
834 VAL=`echo $1 | sed "s,^-\([^-]*\).*,\1,"`
836 #Qt style no options
837 -no-*)
838 VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"`
839 VAL=no
841 #Qt style yes options
842 -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xshape|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-svg|-webkit|-scripttools|-rpath|-force-pkg-config)
843 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
844 VAL=yes
846 #Qt style options that pass an argument
847 -qconfig)
848 if [ "$PLATFORM_QWS" != "yes" ]; then
849 echo
850 echo "WARNING: -qconfig is only tested and supported on Qt for Embedded Linux."
851 echo
853 CFG_QCONFIG="$VAL"
854 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
855 shift
856 VAL=$1
858 -prefix|-docdir|-headerdir|-plugindir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config)
859 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
860 shift
861 VAL="$1"
863 #Qt style complex options in one command
864 -enable-*|-disable-*)
865 VAR=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
866 VAL=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
868 #Qt Builtin/System style options
869 -no-*|-system-*|-qt-*)
870 VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
871 VAL=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
873 #Options that cannot be generalized
874 -k|-continue)
875 VAR=fatal_error
876 VAL=no
878 -embedded)
879 VAR=embedded
880 # this option may or may not be followed by an argument
881 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
882 VAL=auto
883 else
884 shift;
885 VAL=$1
888 -opengl)
889 VAR=opengl
890 # this option may or may not be followed by an argument
891 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
892 VAL=yes
893 else
894 shift;
895 VAL=$1
898 -openvg)
899 VAR=openvg
900 # this option may or may not be followed by an argument
901 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
902 VAL=yes
903 else
904 shift;
905 VAL=$1
908 -hostprefix)
909 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
910 # this option may or may not be followed by an argument
911 if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
912 VAL=$outpath
913 else
914 shift;
915 VAL=$1
918 -host-*-endian)
919 VAR=host_endian
920 VAL=`echo $1 | sed "s,^-.*-\(.*\)-.*,\1,"`
922 -*-endian)
923 VAR=endian
924 VAL=`echo $1 | sed "s,^-\(.*\)-.*,\1,"`
926 -qtnamespace)
927 VAR="qtnamespace"
928 shift
929 VAL="$1"
931 -graphicssystem)
932 VAR="graphicssystem"
933 shift
934 VAL=$1
936 -qtlibinfix)
937 VAR="qtlibinfix"
938 shift
939 VAL="$1"
941 -D?*|-D)
942 VAR="add_define"
943 if [ "$1" = "-D" ]; then
944 shift
945 VAL="$1"
946 else
947 VAL=`echo $1 | sed 's,-D,,'`
950 -I?*|-I)
951 VAR="add_ipath"
952 if [ "$1" = "-I" ]; then
953 shift
954 VAL="$1"
955 else
956 VAL=`echo $1 | sed 's,-I,,'`
959 -L?*|-L)
960 VAR="add_lpath"
961 if [ "$1" = "-L" ]; then
962 shift
963 VAL="$1"
964 else
965 VAL=`echo $1 | sed 's,-L,,'`
968 -R?*|-R)
969 VAR="add_rpath"
970 if [ "$1" = "-R" ]; then
971 shift
972 VAL="$1"
973 else
974 VAL=`echo $1 | sed 's,-R,,'`
977 -l?*)
978 VAR="add_link"
979 VAL=`echo $1 | sed 's,-l,,'`
981 -F?*|-F)
982 VAR="add_fpath"
983 if [ "$1" = "-F" ]; then
984 shift
985 VAL="$1"
986 else
987 VAL=`echo $1 | sed 's,-F,,'`
990 -fw?*|-fw)
991 VAR="add_framework"
992 if [ "$1" = "-fw" ]; then
993 shift
994 VAL="$1"
995 else
996 VAL=`echo $1 | sed 's,-fw,,'`
1000 VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
1001 VAL="unknown"
1004 UNKNOWN_ARG=yes
1006 esac
1007 if [ "$UNKNOWN_ARG" = "yes" ]; then
1008 echo "$1: unknown argument"
1009 OPT_HELP=yes
1010 ERROR=yes
1011 shift
1012 continue
1014 shift
1016 UNKNOWN_OPT=no
1017 case "$VAR" in
1018 qt3support)
1019 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1020 CFG_QT3SUPPORT="$VAL"
1021 else
1022 UNKNOWN_OPT=yes
1025 accessibility)
1026 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1027 CFG_ACCESSIBILITY="$VAL"
1028 else
1029 UNKNOWN_OPT=yes
1032 license)
1033 LICENSE_FILE="$VAL"
1035 gnumake)
1036 CFG_USE_GNUMAKE="$VAL"
1038 mysql_config)
1039 CFG_MYSQL_CONFIG="$VAL"
1041 prefix)
1042 QT_INSTALL_PREFIX="$VAL"
1044 hostprefix)
1045 QT_HOST_PREFIX="$VAL"
1047 force-pkg-config)
1048 QT_FORCE_PKGCONFIG=yes
1050 docdir)
1051 QT_INSTALL_DOCS="$VAL"
1053 headerdir)
1054 QT_INSTALL_HEADERS="$VAL"
1056 plugindir)
1057 QT_INSTALL_PLUGINS="$VAL"
1059 datadir)
1060 QT_INSTALL_DATA="$VAL"
1062 libdir)
1063 QT_INSTALL_LIBS="$VAL"
1065 qtnamespace)
1066 QT_NAMESPACE="$VAL"
1068 qtlibinfix)
1069 QT_LIBINFIX="$VAL"
1071 translationdir)
1072 QT_INSTALL_TRANSLATIONS="$VAL"
1074 sysconfdir|settingsdir)
1075 QT_INSTALL_SETTINGS="$VAL"
1077 examplesdir)
1078 QT_INSTALL_EXAMPLES="$VAL"
1080 demosdir)
1081 QT_INSTALL_DEMOS="$VAL"
1083 qconfig)
1084 CFG_QCONFIG="$VAL"
1086 bindir)
1087 QT_INSTALL_BINS="$VAL"
1089 buildkey)
1090 CFG_USER_BUILD_KEY="$VAL"
1092 sxe)
1093 CFG_SXE="$VAL"
1095 embedded)
1096 CFG_EMBEDDED="$VAL"
1097 if [ "$PLATFORM_QWS" != "no" ]; then
1098 if [ "$PLATFORM_QWS" = "maybe" ]; then
1099 PLATFORM_X11=no
1100 PLATFORM_MAC=no
1101 PLATFORM_QWS=yes
1103 else
1104 echo "No license exists to enable Qt for Embedded Linux. Disabling."
1105 CFG_EMBEDDED=no
1108 sse)
1109 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1110 CFG_SSE="$VAL"
1111 else
1112 UNKNOWN_OPT=yes
1115 endian)
1116 if [ "$VAL" = "little" ]; then
1117 CFG_ENDIAN="Q_LITTLE_ENDIAN"
1118 elif [ "$VAL" = "big" ]; then
1119 CFG_ENDIAN="Q_BIG_ENDIAN"
1120 else
1121 UNKNOWN_OPT=yes
1124 host_endian)
1125 if [ "$VAL" = "little" ]; then
1126 CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
1127 elif [ "$VAL" = "big" ]; then
1128 CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
1129 else
1130 UNKNOWN_OPT=yes
1133 armfpa)
1134 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1135 CFG_ARMFPA="$VAL"
1136 else
1137 UNKNOWN_OPT=yes
1140 depths)
1141 CFG_QWS_DEPTHS="$VAL"
1143 opengl)
1144 if [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
1145 [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
1146 [ "$VAL" = "es1cl" ] || [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then
1147 CFG_OPENGL="$VAL"
1148 else
1149 UNKNOWN_OPT=yes
1152 openvg)
1153 if [ "$VAL" = "auto" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1154 CFG_OPENVG="$VAL"
1155 else
1156 UNKNOWN_OPT=yes
1159 graphicssystem)
1160 if [ "$PLATFORM_QWS" = "yes" ]; then
1161 echo "Error: Graphics System plugins are not supported on QWS."
1162 echo " On QWS, the graphics system API is part of the QScreen plugin architecture "
1163 echo " rather than existing as a separate plugin."
1164 echo ""
1165 UNKNOWN_OPT=yes
1166 else
1167 if [ "$VAL" = "opengl" ]; then
1168 CFG_GRAPHICS_SYSTEM="opengl"
1169 elif [ "$VAL" = "openvg" ]; then
1170 CFG_GRAPHICS_SYSTEM="openvg"
1171 elif [ "$VAL" = "raster" ]; then
1172 CFG_GRAPHICS_SYSTEM="raster"
1173 else
1174 UNKNOWN_OPT=yes
1179 qvfb) # left for commandline compatibility, not documented
1180 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1181 if [ "$VAL" = "yes" ]; then
1182 QMakeVar add gfx-drivers qvfb
1183 QMakeVar add kbd-drivers qvfb
1184 QMakeVar add mouse-drivers qvfb
1185 CFG_GFX_ON="$CFG_GFX_ON qvfb"
1186 CFG_KBD_ON="$CFG_KBD_ON qvfb"
1187 CFG_MOUSE_ON="$CFG_MOUSE_ON qvfb"
1189 else
1190 UNKNOWN_OPT=yes
1193 nomake)
1194 CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL"
1196 make)
1197 CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL"
1199 x11)
1200 if [ "$PLATFORM_MAC" = "yes" ]; then
1201 PLATFORM_MAC=no
1202 elif [ "$PLATFORM_QWS" = "yes" ]; then
1203 PLATFORM_QWS=no
1205 if [ "$CFG_FRAMEWORK" = "auto" ]; then
1206 CFG_FRAMEWORK=no
1208 PLATFORM_X11=yes
1210 sdk)
1211 if [ "$PLATFORM_MAC" = "yes" ]; then
1212 CFG_SDK="$VAL"
1213 else
1214 UNKNOWN_OPT=yes
1217 dwarf2)
1218 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1219 CFG_MAC_DWARF2="$VAL"
1220 else
1221 UNKNOWN_OPT=yes
1224 arch)
1225 if [ "$PLATFORM_MAC" = "yes" ]; then
1226 CFG_MAC_ARCHS="$CFG_MAC_ARCHS $VAL"
1227 else
1228 CFG_ARCH=$VAL
1231 host-arch)
1232 CFG_HOST_ARCH=$VAL
1234 universal)
1235 if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1236 CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86 ppc"
1237 else
1238 UNKNOWN_OPT=yes
1241 cocoa)
1242 if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then
1243 CFG_MAC_COCOA="$VAL"
1244 COMMANDLINE_MAC_COCOA="$VAL"
1245 else
1246 UNKNOWN_OPT=yes
1249 framework)
1250 if [ "$PLATFORM_MAC" = "yes" ]; then
1251 CFG_FRAMEWORK="$VAL"
1252 else
1253 UNKNOWN_OPT=yes
1256 profile)
1257 if [ "$VAL" = "yes" ]; then
1258 CFG_PROFILE=yes
1259 QMakeVar add QMAKE_CFLAGS -pg
1260 QMakeVar add QMAKE_CXXFLAGS -pg
1261 QMakeVar add QMAKE_LFLAGS -pg
1262 QMAKE_VARS="$QMAKE_VARS CONFIG+=nostrip"
1263 else
1264 UNKNOWN_OPT=yes
1267 exceptions|g++-exceptions)
1268 if [ "$VAL" = "no" ]; then
1269 CFG_EXCEPTIONS=no
1270 elif [ "$VAL" = "yes" ]; then
1271 CFG_EXCEPTIONS=yes
1272 else
1273 UNKNOWN_OPT=yes
1276 platform)
1277 PLATFORM="$VAL"
1278 # keep compatibility with old platform names
1279 case $PLATFORM in
1280 aix-64)
1281 PLATFORM=aix-xlc-64
1283 hpux-o64)
1284 PLATFORM=hpux-acc-o64
1286 hpux-n64)
1287 PLATFORM=hpux-acc-64
1289 hpux-acc-n64)
1290 PLATFORM=hpux-acc-64
1292 irix-n32)
1293 PLATFORM=irix-cc
1295 irix-64)
1296 PLATFORM=irix-cc-64
1298 irix-cc-n64)
1299 PLATFORM=irix-cc-64
1301 reliant-64)
1302 PLATFORM=reliant-cds-64
1304 solaris-64)
1305 PLATFORM=solaris-cc-64
1307 solaris-64)
1308 PLATFORM=solaris-cc-64
1310 openunix-cc)
1311 PLATFORM=unixware-cc
1313 openunix-g++)
1314 PLATFORM=unixware-g++
1316 unixware7-cc)
1317 PLATFORM=unixware-cc
1319 unixware7-g++)
1320 PLATFORM=unixware-g++
1322 macx-g++-64)
1323 PLATFORM=macx-g++
1324 NATIVE_64_ARCH=
1325 case `uname -p` in
1326 i386) NATIVE_64_ARCH="x86_64" ;;
1327 powerpc) NATIVE_64_ARCH="ppc64" ;;
1328 *) echo "WARNING: Can't detect CPU architecture for macx-g++-64" ;;
1329 esac
1330 if [ ! -z "$NATIVE_64_ARCH" ]; then
1331 QTCONFIG_CONFIG="$QTCONFIG_CONFIG $NATIVE_64_ARCH"
1332 CFG_MAC_ARCHS="$CFG_MAC_ARCHS $NATIVE_64_ARCH"
1335 esac
1337 xplatform)
1338 XPLATFORM="$VAL"
1340 debug-and-release)
1341 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1342 CFG_DEBUG_RELEASE="$VAL"
1343 else
1344 UNKNOWN_OPT=yes
1347 optimized-qmake)
1348 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1349 CFG_RELEASE_QMAKE="$VAL"
1350 else
1351 UNKNOWN_OPT=yes
1354 release)
1355 if [ "$VAL" = "yes" ]; then
1356 CFG_DEBUG=no
1357 elif [ "$VAL" = "no" ]; then
1358 CFG_DEBUG=yes
1359 else
1360 UNKNOWN_OPT=yes
1363 prefix-install)
1364 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1365 CFG_PREFIX_INSTALL="$VAL"
1366 else
1367 UNKNOWN_OPT=yes
1370 debug)
1371 CFG_DEBUG="$VAL"
1373 developer-build|commercial|opensource|nokia-developer)
1374 # These switches have been dealt with already
1376 static)
1377 if [ "$VAL" = "yes" ]; then
1378 CFG_SHARED=no
1379 elif [ "$VAL" = "no" ]; then
1380 CFG_SHARED=yes
1381 else
1382 UNKNOWN_OPT=yes
1385 incremental)
1386 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1387 CFG_INCREMENTAL="$VAL"
1388 else
1389 UNKNOWN_OPT=yes
1392 fatal_error)
1393 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1394 CFG_CONFIGURE_EXIT_ON_ERROR="$VAL"
1395 else
1396 UNKNOWN_OPT=yes
1399 feature-*)
1400 if [ "$PLATFORM_QWS" = "yes" ]; then
1401 FEATURE=`echo $VAR | sed "s,^[^-]*-\([^-]*\),\1," | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
1402 if [ "$VAL" = "no" ]; then
1403 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE"
1404 elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then
1405 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_$FEATURE"
1406 else
1407 UNKNOWN_OPT=yes
1409 else
1410 UNKNOWN_OPT=yes
1413 shared)
1414 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1415 CFG_SHARED="$VAL"
1416 else
1417 UNKNOWN_OPT=yes
1420 gif)
1421 [ "$VAL" = "qt" ] && VAL=yes
1422 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1423 CFG_GIF="$VAL"
1424 else
1425 UNKNOWN_OPT=yes
1429 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1430 CFG_SM="$VAL"
1431 else
1432 UNKNOWN_OPT=yes
1436 xinerama)
1437 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1438 CFG_XINERAMA="$VAL"
1439 else
1440 UNKNOWN_OPT=yes
1443 xshape)
1444 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1445 CFG_XSHAPE="$VAL"
1446 else
1447 UNKNOWN_OPT=yes
1450 xsync)
1451 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1452 CFG_XSYNC="$VAL"
1453 else
1454 UNKNOWN_OPT=yes
1457 xinput)
1458 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1459 CFG_XINPUT="$VAL"
1460 else
1461 UNKNOWN_OPT=yes
1464 stl)
1465 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1466 CFG_STL="$VAL"
1467 else
1468 UNKNOWN_OPT=yes
1471 pch)
1472 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1473 CFG_PRECOMPILE="$VAL"
1474 else
1475 UNKNOWN_OPT=yes
1478 separate-debug-info)
1479 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1480 CFG_SEPARATE_DEBUG_INFO="$VAL"
1481 else
1482 UNKNOWN_OPT=yes
1485 reduce-exports)
1486 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1487 CFG_REDUCE_EXPORTS="$VAL"
1488 else
1489 UNKNOWN_OPT=yes
1492 mmx)
1493 if [ "$VAL" = "no" ]; then
1494 CFG_MMX="$VAL"
1495 else
1496 UNKNOWN_OPT=yes
1499 3dnow)
1500 if [ "$VAL" = "no" ]; then
1501 CFG_3DNOW="$VAL"
1502 else
1503 UNKNOWN_OPT=yes
1506 sse)
1507 if [ "$VAL" = "no" ]; then
1508 CFG_SSE="$VAL"
1509 else
1510 UNKNOWN_OPT=yes
1513 sse2)
1514 if [ "$VAL" = "no" ]; then
1515 CFG_SSE2="$VAL"
1516 else
1517 UNKNOWN_OPT=yes
1520 iwmmxt)
1521 CFG_IWMMXT="yes"
1523 reduce-relocations)
1524 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1525 CFG_REDUCE_RELOCATIONS="$VAL"
1526 else
1527 UNKNOWN_OPT=yes
1530 freetype)
1531 [ "$VAL" = "qt" ] && VAL=yes
1532 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1533 CFG_QWS_FREETYPE="$VAL"
1534 else
1535 UNKNOWN_OPT=yes
1538 zlib)
1539 [ "$VAL" = "qt" ] && VAL=yes
1540 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1541 CFG_ZLIB="$VAL"
1542 else
1543 UNKNOWN_OPT=yes
1545 # No longer supported:
1546 #[ "$VAL" = "no" ] && CFG_LIBPNG=no
1548 sqlite)
1549 if [ "$VAL" = "system" ]; then
1550 CFG_SQLITE=system
1551 else
1552 UNKNOWN_OPT=yes
1555 libpng)
1556 [ "$VAL" = "yes" ] && VAL=qt
1557 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1558 CFG_LIBPNG="$VAL"
1559 else
1560 UNKNOWN_OPT=yes
1563 libjpeg)
1564 [ "$VAL" = "yes" ] && VAL=qt
1565 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1566 CFG_LIBJPEG="$VAL"
1567 else
1568 UNKNOWN_OPT=yes
1571 libmng)
1572 [ "$VAL" = "yes" ] && VAL=qt
1573 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1574 CFG_LIBMNG="$VAL"
1575 else
1576 UNKNOWN_OPT=yes
1579 libtiff)
1580 [ "$VAL" = "yes" ] && VAL=qt
1581 if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
1582 CFG_LIBTIFF="$VAL"
1583 else
1584 UNKNOWN_OPT=yes
1587 nas-sound)
1588 if [ "$VAL" = "system" ] || [ "$VAL" = "no" ]; then
1589 CFG_NAS="$VAL"
1590 else
1591 UNKNOWN_OPT=yes
1594 xcursor)
1595 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1596 CFG_XCURSOR="$VAL"
1597 else
1598 UNKNOWN_OPT=yes
1601 xfixes)
1602 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1603 CFG_XFIXES="$VAL"
1604 else
1605 UNKNOWN_OPT=yes
1608 xrandr)
1609 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
1610 CFG_XRANDR="$VAL"
1611 else
1612 UNKNOWN_OPT=yes
1615 xrender)
1616 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1617 CFG_XRENDER="$VAL"
1618 else
1619 UNKNOWN_OPT=yes
1622 mitshm)
1623 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1624 CFG_MITSHM="$VAL"
1625 else
1626 UNKNOWN_OPT=yes
1629 fontconfig)
1630 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1631 CFG_FONTCONFIG="$VAL"
1632 else
1633 UNKNOWN_OPT=yes
1636 xkb)
1637 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1638 CFG_XKB="$VAL"
1639 else
1640 UNKNOWN_OPT=yes
1643 cups)
1644 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1645 CFG_CUPS="$VAL"
1646 else
1647 UNKNOWN_OPT=yes
1650 iconv)
1651 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1652 CFG_ICONV="$VAL"
1653 else
1654 UNKNOWN_OPT=yes
1657 glib)
1658 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1659 CFG_GLIB="$VAL"
1660 else
1661 UNKNOWN_OPT=yes
1664 gstreamer)
1665 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1666 CFG_GSTREAMER="$VAL"
1667 else
1668 UNKNOWN_OPT=yes
1671 gtkstyle)
1672 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1673 CFG_QGTKSTYLE="$VAL"
1674 else
1675 UNKNOWN_OPT=yes
1678 qdbus|dbus)
1679 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "linked" ]; then
1680 CFG_DBUS="$VAL"
1681 elif [ "$VAL" = "runtime" ]; then
1682 CFG_DBUS="yes"
1683 else
1684 UNKNOWN_OPT=yes
1687 dbus-linked)
1688 if [ "$VAL" = "yes" ]; then
1689 CFG_DBUS="linked"
1690 else
1691 UNKNOWN_OPT=yes
1694 nis)
1695 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1696 CFG_NIS="$VAL"
1697 else
1698 UNKNOWN_OPT=yes
1701 largefile)
1702 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1703 CFG_LARGEFILE="$VAL"
1704 else
1705 UNKNOWN_OPT=yes
1708 openssl)
1709 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1710 CFG_OPENSSL="$VAL"
1711 else
1712 UNKNOWN_OPT=yes
1715 openssl-linked)
1716 if [ "$VAL" = "yes" ]; then
1717 CFG_OPENSSL="linked"
1718 else
1719 UNKNOWN_OPT=yes
1722 ptmalloc)
1723 if [ "$VAL" = "yes" ]; then
1724 CFG_PTMALLOC="yes"
1725 else
1726 UNKNOWN_OPT=yes
1730 xmlpatterns)
1731 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1732 CFG_XMLPATTERNS="yes"
1733 else
1734 if [ "$VAL" = "no" ]; then
1735 CFG_XMLPATTERNS="no"
1736 else
1737 UNKNOWN_OPT=yes
1741 scripttools)
1742 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1743 CFG_SCRIPTTOOLS="yes"
1744 else
1745 if [ "$VAL" = "no" ]; then
1746 CFG_SCRIPTTOOLS="no"
1747 else
1748 UNKNOWN_OPT=yes
1752 svg)
1753 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1754 CFG_SVG="yes"
1755 else
1756 if [ "$VAL" = "no" ]; then
1757 CFG_SVG="no"
1758 else
1759 UNKNOWN_OPT=yes
1763 webkit)
1764 if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ]; then
1765 CFG_WEBKIT="yes"
1766 else
1767 if [ "$VAL" = "no" ]; then
1768 CFG_WEBKIT="no"
1769 else
1770 UNKNOWN_OPT=yes
1774 confirm-license)
1775 if [ "$VAL" = "yes" ]; then
1776 OPT_CONFIRM_LICENSE="$VAL"
1777 else
1778 UNKNOWN_OPT=yes
1781 h|help)
1782 if [ "$VAL" = "yes" ]; then
1783 OPT_HELP="$VAL"
1784 else
1785 UNKNOWN_OPT=yes
1788 sql-*|gfx-*|decoration-*|kbd-*|mouse-*)
1789 # if Qt style options were used, $VAL can be "no", "qt", or "plugin"
1790 # if autoconf style options were used, $VAL can be "yes" or "no"
1791 [ "$VAL" = "yes" ] && VAL=qt
1792 # now $VAL should be "no", "qt", or "plugin"... double-check
1793 if [ "$VAL" != "no" ] && [ "$VAL" != "qt" ] && [ "$VAL" != "plugin" ]; then
1794 UNKNOWN_OPT=yes
1796 # now $VAL is "no", "qt", or "plugin"
1797 OPT="$VAL"
1798 VAL=`echo $VAR | sed "s,^[^-]*-\([^-]*\).*,\1,"`
1799 VAR=`echo $VAR | sed "s,^\([^-]*\).*,\1,"`
1801 # Grab the available values
1802 case "$VAR" in
1803 sql)
1804 avail="$CFG_SQL_AVAILABLE"
1806 gfx)
1807 avail="$CFG_GFX_AVAILABLE"
1808 if [ "$OPT" = "plugin" ]; then
1809 avail="$CFG_GFX_PLUGIN_AVAILABLE"
1812 decoration)
1813 avail="$CFG_DECORATION_AVAILABLE"
1814 if [ "$OPT" = "plugin" ]; then
1815 avail="$CFG_DECORATION_PLUGIN_AVAILABLE"
1818 kbd)
1819 avail="$CFG_KBD_AVAILABLE"
1820 if [ "$OPT" = "plugin" ]; then
1821 avail="$CFG_KBD_PLUGIN_AVAILABLE"
1824 mouse)
1825 avail="$CFG_MOUSE_AVAILABLE"
1826 if [ "$OPT" = "plugin" ]; then
1827 avail="$CFG_MOUSE_PLUGIN_AVAILABLE"
1831 avail=""
1832 echo "BUG: Unhandled type $VAR used in $CURRENT_OPT"
1834 esac
1836 # Check that that user's value is available.
1837 found=no
1838 for d in $avail; do
1839 if [ "$VAL" = "$d" ]; then
1840 found=yes
1841 break
1843 done
1844 [ "$found" = yes ] || ERROR=yes
1846 if [ "$VAR" = "sql" ]; then
1847 # set the CFG_SQL_driver
1848 eval "CFG_SQL_$VAL=\$OPT"
1849 continue
1852 if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then
1853 if [ "$OPT" = "plugin" ]; then
1854 [ "$VAR" = "decoration" ] && QMakeVar del "${VAR}s" "$VAL"
1855 [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"` && CFG_DECORATION_PLUGIN="$CFG_DECORATION_PLUGIN ${VAL}"
1856 [ "$VAR" = "kbd" ] && QMakeVar del "${VAR}s" "$VAL"
1857 [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_KBD_PLUGIN="$CFG_KBD_PLUGIN ${VAL}"
1858 [ "$VAR" = "mouse" ] && QMakeVar del "${VAR}s" "$VAL"
1859 [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_MOUSE_PLUGIN="$CFG_MOUSE_PLUGIN ${VAL}"
1860 [ "$VAR" = "gfx" ] && QMakeVar del "${VAR}s" "$VAL"
1861 [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"` && CFG_GFX_PLUGIN="${CFG_GFX_PLUGIN} ${VAL}"
1862 VAR="${VAR}-${OPT}"
1863 else
1864 if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "decoration" ] || [ "$VAR" = "mouse" ]; then
1865 [ "$VAR" = "gfx" ] && CFG_GFX_ON="$CFG_GFX_ON $VAL"
1866 [ "$VAR" = "kbd" ] && CFG_KBD_ON="$CFG_KBD_ON $VAL"
1867 [ "$VAR" = "decoration" ] && CFG_DECORATION_ON="$CFG_DECORATION_ON $VAL"
1868 [ "$VAR" = "mouse" ] && CFG_MOUSE_ON="$CFG_MOUSE_ON $VAL"
1869 VAR="${VAR}-driver"
1872 QMakeVar add "${VAR}s" "${VAL}"
1873 elif [ "$OPT" = "no" ]; then
1874 PLUG_VAR="${VAR}-plugin"
1875 if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "mouse" ]; then
1876 IN_VAR="${VAR}-driver"
1877 else
1878 IN_VAR="${VAR}"
1880 [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"`
1881 [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"`
1882 [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"`
1883 [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"`
1884 QMakeVar del "${IN_VAR}s" "$VAL"
1885 QMakeVar del "${PLUG_VAR}s" "$VAL"
1887 if [ "$ERROR" = "yes" ]; then
1888 echo "$CURRENT_OPT: unknown argument"
1889 OPT_HELP=yes
1892 v|verbose)
1893 if [ "$VAL" = "yes" ]; then
1894 if [ "$OPT_VERBOSE" = "$VAL" ]; then # takes two verboses to turn on qmake debugs
1895 QMAKE_SWITCHES="$QMAKE_SWITCHES -d"
1896 else
1897 OPT_VERBOSE=yes
1899 elif [ "$VAL" = "no" ]; then
1900 if [ "$OPT_VERBOSE" = "$VAL" ] && echo "$QMAKE_SWITCHES" | grep ' -d' >/dev/null 2>&1; then
1901 QMAKE_SWITCHES=`echo $QMAKE_SWITCHES | sed "s, -d,,"`
1902 else
1903 OPT_VERBOSE=no
1905 else
1906 UNKNOWN_OPT=yes
1909 fast)
1910 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1911 OPT_FAST="$VAL"
1912 else
1913 UNKNOWN_OPT=yes
1916 rpath)
1917 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1918 CFG_RPATH="$VAL"
1919 else
1920 UNKNOWN_OPT=yes
1923 add_define)
1924 D_FLAGS="$D_FLAGS \"$VAL\""
1926 add_ipath)
1927 I_FLAGS="$I_FLAGS -I\"${VAL}\""
1929 add_lpath)
1930 L_FLAGS="$L_FLAGS -L\"${VAL}\""
1932 add_rpath)
1933 RPATH_FLAGS="$RPATH_FLAGS \"${VAL}\""
1935 add_link)
1936 l_FLAGS="$l_FLAGS -l\"${VAL}\""
1938 add_fpath)
1939 if [ "$PLATFORM_MAC" = "yes" ]; then
1940 L_FLAGS="$L_FLAGS -F\"${VAL}\""
1941 I_FLAGS="$I_FLAGS -F\"${VAL}\""
1942 else
1943 UNKNOWN_OPT=yes
1946 add_framework)
1947 if [ "$PLATFORM_MAC" = "yes" ]; then
1948 l_FLAGS="$l_FLAGS -framework \"${VAL}\""
1949 else
1950 UNKNOWN_OPT=yes
1953 silent)
1954 CFG_SILENT="$VAL"
1956 phonon)
1957 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1958 CFG_PHONON="$VAL"
1959 else
1960 UNKNOWN_OPT=yes
1963 phonon-backend)
1964 if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
1965 CFG_PHONON_BACKEND="$VAL"
1966 else
1967 UNKNOWN_OPT=yes
1971 UNKNOWN_OPT=yes
1973 esac
1974 if [ "$UNKNOWN_OPT" = "yes" ]; then
1975 echo "${CURRENT_OPT}: invalid command-line switch"
1976 OPT_HELP=yes
1977 ERROR=yes
1979 done
1981 if [ "$CFG_QCONFIG" != "full" ] && [ "$CFG_QT3SUPPORT" = "yes" ]; then
1982 echo "Warning: '-qconfig $CFG_QCONFIG' will disable the qt3support library."
1983 CFG_QT3SUPPORT="no"
1986 # update QT_CONFIG to show our current predefined configuration
1987 case "$CFG_QCONFIG" in
1988 minimal|small|medium|large|full)
1989 # these are a sequence of increasing functionality
1990 for c in minimal small medium large full; do
1991 QT_CONFIG="$QT_CONFIG $c-config"
1992 [ "$CFG_QCONFIG" = $c ] && break
1993 done
1996 # not known to be sufficient for anything
1997 if [ '!' -f "$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" ]; then
1998 echo >&2 "Error: configuration file not found:"
1999 echo >&2 " $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h"
2000 OPT_HELP=yes
2002 esac
2004 #-------------------------------------------------------------------------------
2005 # build tree initialization
2006 #-------------------------------------------------------------------------------
2008 # where to find which..
2009 unixtests="$relpath/config.tests/unix"
2010 mactests="$relpath/config.tests/mac"
2011 WHICH="$unixtests/which.test"
2013 PERL=`$WHICH perl 2>/dev/null`
2015 # find out which awk we want to use, prefer gawk, then nawk, then regular awk
2016 AWK=
2017 for e in gawk nawk awk; do
2018 if "$WHICH" $e >/dev/null 2>&1 && ( $e -f /dev/null /dev/null ) >/dev/null 2>&1; then
2019 AWK=$e
2020 break
2022 done
2024 ### skip this if the user just needs help...
2025 if [ "$OPT_HELP" != "yes" ]; then
2027 # is this a shadow build?
2028 if [ "$OPT_SHADOW" = "maybe" ]; then
2029 OPT_SHADOW=no
2030 if [ "$relpath" != "$outpath" ] && [ '!' -f "$outpath/configure" ]; then
2031 if [ -h "$outpath" ]; then
2032 [ "$relpath" -ef "$outpath" ] || OPT_SHADOW=yes
2033 else
2034 OPT_SHADOW=yes
2038 if [ "$OPT_SHADOW" = "yes" ]; then
2039 if [ -f "$relpath/.qmake.cache" -o -f "$relpath/src/corelib/global/qconfig.h" ]; then
2040 echo >&2 "You cannot make a shadow build from a source tree containing a previous build."
2041 echo >&2 "Cannot proceed."
2042 exit 1
2044 [ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
2047 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2048 echo
2049 echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux"
2050 echo "By default, Qt is built in release mode with separate debug information, so"
2051 echo "-debug-and-release is not necessary anymore"
2052 echo
2055 # detect build style
2056 if [ "$CFG_DEBUG" = "auto" ]; then
2057 if [ "$PLATFORM_MAC" = "yes" ]; then
2058 CFG_DEBUG_RELEASE=yes
2059 CFG_DEBUG=yes
2060 elif [ "$CFG_DEV" = "yes" ]; then
2061 CFG_DEBUG_RELEASE=no
2062 CFG_DEBUG=yes
2063 else
2064 CFG_DEBUG_RELEASE=no
2065 CFG_DEBUG=no
2068 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
2069 QMAKE_CONFIG="$QMAKE_CONFIG build_all"
2072 if [ "$CFG_SILENT" = "yes" ]; then
2073 QMAKE_CONFIG="$QMAKE_CONFIG silent"
2076 # if the source tree is different from the build tree,
2077 # symlink or copy part of the sources
2078 if [ "$OPT_SHADOW" = "yes" ]; then
2079 echo "Preparing build tree..."
2081 if [ -z "$PERL" ]; then
2082 echo
2083 echo "You need perl in your PATH to make a shadow build."
2084 echo "Cannot proceed."
2085 exit 1
2088 [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
2090 # symlink the qmake directory
2091 find "$relpath/qmake" | while read a; do
2092 my_a=`echo "$a" | sed "s,^${relpath}/,${outpath}/,"`
2093 if [ '!' -f "$my_a" ]; then
2094 if [ -d "$a" ]; then
2095 # directories are created...
2096 mkdir -p "$my_a"
2097 else
2098 a_dir=`dirname "$my_a"`
2099 [ -d "$a_dir" ] || mkdir -p "$a_dir"
2100 # ... and files are symlinked
2101 case `basename "$a"` in
2102 *.o|*.d|GNUmakefile*|qmake)
2105 rm -f "$my_a"
2106 ln -s "$a" "$my_a"
2108 esac
2111 done
2113 # make a syncqt script that can be used in the shadow
2114 rm -f "$outpath/bin/syncqt"
2115 if [ -x "$relpath/bin/syncqt" ]; then
2116 mkdir -p "$outpath/bin"
2117 echo "#!/bin/sh" >"$outpath/bin/syncqt"
2118 echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/syncqt"
2119 echo "perl \"$relpath/bin/syncqt\" -outdir \"$outpath\" $*" >>"$outpath/bin/syncqt"
2120 chmod 755 "$outpath/bin/syncqt"
2123 # symlink the mkspecs directory
2124 mkdir -p "$outpath/mkspecs"
2125 rm -f "$outpath"/mkspecs/*
2126 ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
2127 rm -f "$outpath/mkspecs/default"
2129 # symlink the doc directory
2130 rm -rf "$outpath/doc"
2131 ln -s "$relpath/doc" "$outpath/doc"
2133 # make sure q3porting.xml can be found
2134 mkdir -p "$outpath/tools/porting/src"
2135 rm -f "$outpath/tools/porting/src/q3porting.xml"
2136 ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src"
2139 # symlink files from src/gui/embedded neccessary to build qvfb
2140 if [ "$CFG_DEV" = "yes" ]; then
2141 mkdir -p "$outpath/tools/qvfb"
2142 for f in qvfbhdr.h qlock_p.h qlock.cpp qwssignalhandler_p.h qwssignalhandler.cpp; do
2143 dest="${outpath}/tools/qvfb/${f}"
2144 rm -f "$dest"
2145 ln -s "${relpath}/src/gui/embedded/${f}" "${dest}"
2146 done
2149 # symlink fonts to be able to run application from build directory
2150 if [ "$PLATFORM_QWS" = "yes" ] && [ ! -e "${outpath}/lib/fonts" ]; then
2151 if [ "$PLATFORM" = "$XPLATFORM" ]; then
2152 mkdir -p "${outpath}/lib"
2153 ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
2157 if [ "$OPT_FAST" = "auto" ]; then
2158 if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then
2159 OPT_FAST=yes
2160 else
2161 OPT_FAST=no
2165 # find a make command
2166 if [ -z "$MAKE" ]; then
2167 MAKE=
2168 for mk in gmake make; do
2169 if "$WHICH" $mk >/dev/null 2>&1; then
2170 MAKE=`"$WHICH" $mk`
2171 break
2173 done
2174 if [ -z "$MAKE" ]; then
2175 echo >&2 "You don't seem to have 'make' or 'gmake' in your PATH."
2176 echo >&2 "Cannot proceed."
2177 exit 1
2181 fi ### help
2183 #-------------------------------------------------------------------------------
2184 # auto-detect all that hasn't been specified in the arguments
2185 #-------------------------------------------------------------------------------
2187 [ "$PLATFORM_QWS" = "yes" -a "$CFG_EMBEDDED" = "no" ] && CFG_EMBEDDED=auto
2188 if [ "$CFG_EMBEDDED" != "no" ]; then
2189 case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2190 Darwin:*)
2191 [ -z "$PLATFORM" ] && PLATFORM=qws/macx-generic-g++
2192 if [ -z "$XPLATFORM" ]; then
2193 [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2194 XPLATFORM="qws/macx-$CFG_EMBEDDED-g++"
2197 FreeBSD:*)
2198 [ -z "$PLATFORM" ] && PLATFORM=qws/freebsd-generic-g++
2199 if [ -z "$XPLATFORM" ]; then
2200 [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2201 XPLATFORM="qws/freebsd-$CFG_EMBEDDED-g++"
2204 SunOS:5*)
2205 [ -z "$PLATFORM" ] && PLATFORM=qws/solaris-generic-g++
2206 if [ -z "$XPLATFORM" ]; then
2207 [ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
2208 XPLATFORM="qws/solaris-$CFG_EMBEDDED-g++"
2211 Linux:*)
2212 if [ -z "$PLATFORM" ]; then
2213 case "$UNAME_MACHINE" in
2214 *86)
2215 PLATFORM=qws/linux-x86-g++
2217 *86_64)
2218 PLATFORM=qws/linux-x86_64-g++
2220 *ppc)
2221 PLATFORM=qws/linux-ppc-g++
2224 PLATFORM=qws/linux-generic-g++
2226 esac
2228 if [ -z "$XPLATFORM" ]; then
2229 if [ "$CFG_EMBEDDED" = "auto" ]; then
2230 if [ -n "$CFG_ARCH" ]; then
2231 CFG_EMBEDDED=$CFG_ARCH
2232 else
2233 case "$UNAME_MACHINE" in
2234 *86)
2235 CFG_EMBEDDED=x86
2237 *86_64)
2238 CFG_EMBEDDED=x86_64
2240 *ppc)
2241 CFG_EMBEDDED=ppc
2244 CFG_EMBEDDED=generic
2246 esac
2249 XPLATFORM="qws/linux-$CFG_EMBEDDED-g++"
2252 CYGWIN*:*)
2253 CFG_EMBEDDED=x86
2256 echo "Qt for Embedded Linux is not supported on this platform. Disabling."
2257 CFG_EMBEDDED=no
2258 PLATFORM_QWS=no
2260 esac
2262 if [ -z "$PLATFORM" ]; then
2263 PLATFORM_NOTES=
2264 case "$UNAME_SYSTEM:$UNAME_RELEASE" in
2265 Darwin:*)
2266 if [ "$PLATFORM_MAC" = "yes" ]; then
2267 PLATFORM=macx-g++
2268 # PLATFORM=macx-xcode
2269 else
2270 PLATFORM=darwin-g++
2273 AIX:*)
2274 #PLATFORM=aix-g++
2275 #PLATFORM=aix-g++-64
2276 PLATFORM=aix-xlc
2277 #PLATFORM=aix-xlc-64
2278 PLATFORM_NOTES="
2279 - Also available for AIX: aix-g++ aix-g++-64 aix-xlc-64
2282 GNU:*)
2283 PLATFORM=hurd-g++
2285 dgux:*)
2286 PLATFORM=dgux-g++
2288 # DYNIX/ptx:4*)
2289 # PLATFORM=dynix-g++
2290 # ;;
2291 ULTRIX:*)
2292 PLATFORM=ultrix-g++
2294 FreeBSD:*)
2295 PLATFORM=freebsd-g++
2296 PLATFORM_NOTES="
2297 - Also available for FreeBSD: freebsd-icc
2300 OpenBSD:*)
2301 PLATFORM=openbsd-g++
2303 NetBSD:*)
2304 PLATFORM=netbsd-g++
2306 BSD/OS:*|BSD/386:*)
2307 PLATFORM=bsdi-g++
2309 IRIX*:*)
2310 #PLATFORM=irix-g++
2311 PLATFORM=irix-cc
2312 #PLATFORM=irix-cc-64
2313 PLATFORM_NOTES="
2314 - Also available for IRIX: irix-g++ irix-cc-64
2317 HP-UX:*)
2318 case "$UNAME_MACHINE" in
2319 ia64)
2320 #PLATFORM=hpuxi-acc-32
2321 PLATFORM=hpuxi-acc-64
2322 PLATFORM_NOTES="
2323 - Also available for HP-UXi: hpuxi-acc-32
2327 #PLATFORM=hpux-g++
2328 PLATFORM=hpux-acc
2329 #PLATFORM=hpux-acc-64
2330 #PLATFORM=hpux-cc
2331 #PLATFORM=hpux-acc-o64
2332 PLATFORM_NOTES="
2333 - Also available for HP-UX: hpux-g++ hpux-acc-64 hpux-acc-o64
2336 esac
2338 OSF1:*)
2339 #PLATFORM=tru64-g++
2340 PLATFORM=tru64-cxx
2341 PLATFORM_NOTES="
2342 - Also available for Tru64: tru64-g++
2345 Linux:*)
2346 case "$UNAME_MACHINE" in
2347 x86_64|s390x|ppc64)
2348 PLATFORM=linux-g++-64
2351 PLATFORM=linux-g++
2353 esac
2354 PLATFORM_NOTES="
2355 - Also available for Linux: linux-kcc linux-icc linux-cxx
2358 SunOS:5*)
2359 #PLATFORM=solaris-g++
2360 PLATFORM=solaris-cc
2361 #PLATFORM=solaris-cc64
2362 PLATFORM_NOTES="
2363 - Also available for Solaris: solaris-g++ solaris-cc-64
2366 ReliantUNIX-*:*|SINIX-*:*)
2367 PLATFORM=reliant-cds
2368 #PLATFORM=reliant-cds-64
2369 PLATFORM_NOTES="
2370 - Also available for Reliant UNIX: reliant-cds-64
2373 CYGWIN*:*)
2374 PLATFORM=cygwin-g++
2376 LynxOS*:*)
2377 PLATFORM=lynxos-g++
2379 OpenUNIX:*)
2380 #PLATFORM=unixware-g++
2381 PLATFORM=unixware-cc
2382 PLATFORM_NOTES="
2383 - Also available for OpenUNIX: unixware-g++
2386 UnixWare:*)
2387 #PLATFORM=unixware-g++
2388 PLATFORM=unixware-cc
2389 PLATFORM_NOTES="
2390 - Also available for UnixWare: unixware-g++
2393 SCO_SV:*)
2394 #PLATFORM=sco-g++
2395 PLATFORM=sco-cc
2396 PLATFORM_NOTES="
2397 - Also available for SCO OpenServer: sco-g++
2400 UNIX_SV:*)
2401 PLATFORM=unixware-g++
2404 if [ "$OPT_HELP" != "yes" ]; then
2405 echo
2406 for p in $PLATFORMS; do
2407 echo " $relconf $* -platform $p"
2408 done
2409 echo >&2
2410 echo " The build script does not currently recognize all" >&2
2411 echo " platforms supported by Qt." >&2
2412 echo " Rerun this script with a -platform option listed to" >&2
2413 echo " set the system/compiler combination you use." >&2
2414 echo >&2
2415 exit 2
2417 esac
2420 if [ "$PLATFORM_QWS" = "yes" ]; then
2421 CFG_SM=no
2422 PLATFORMS=`find "$relpath/mkspecs/qws" | sed "s,$relpath/mkspecs/qws/,,"`
2423 else
2424 PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mkspecs/qws/,,"`
2427 [ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
2428 if [ -d "$PLATFORM" ]; then
2429 QMAKESPEC="$PLATFORM"
2430 else
2431 QMAKESPEC="$relpath/mkspecs/${PLATFORM}"
2433 if [ -d "$XPLATFORM" ]; then
2434 XQMAKESPEC="$XPLATFORM"
2435 else
2436 XQMAKESPEC="$relpath/mkspecs/${XPLATFORM}"
2438 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2439 QT_CROSS_COMPILE=yes
2440 QMAKE_CONFIG="$QMAKE_CONFIG cross_compile"
2443 if [ "$PLATFORM_MAC" = "yes" ]; then
2444 if [ `basename $QMAKESPEC` = "macx-xcode" ] || [ `basename $XQMAKESPEC` = "macx-xcode" ]; then
2445 echo >&2
2446 echo " Platform 'macx-xcode' should not be used when building Qt/Mac." >&2
2447 echo " Please build Qt/Mac with 'macx-g++', then if you would like to" >&2
2448 echo " use mac-xcode on your application code it can link to a Qt/Mac" >&2
2449 echo " built with 'macx-g++'" >&2
2450 echo >&2
2451 exit 2
2455 # check specified platforms are supported
2456 if [ '!' -d "$QMAKESPEC" ]; then
2457 echo
2458 echo " The specified system/compiler is not supported:"
2459 echo
2460 echo " $QMAKESPEC"
2461 echo
2462 echo " Please see the README file for a complete list."
2463 echo
2464 exit 2
2466 if [ '!' -d "$XQMAKESPEC" ]; then
2467 echo
2468 echo " The specified system/compiler is not supported:"
2469 echo
2470 echo " $XQMAKESPEC"
2471 echo
2472 echo " Please see the README file for a complete list."
2473 echo
2474 exit 2
2476 if [ '!' -f "${XQMAKESPEC}/qplatformdefs.h" ]; then
2477 echo
2478 echo " The specified system/compiler port is not complete:"
2479 echo
2480 echo " $XQMAKESPEC/qplatformdefs.h"
2481 echo
2482 echo " Please contact qt-bugs@trolltech.com."
2483 echo
2484 exit 2
2487 # now look at the configs and figure out what platform we are config'd for
2488 [ "$CFG_EMBEDDED" = "no" ] \
2489 && [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ] \
2490 && PLATFORM_X11=yes
2491 ### echo "$XQMAKESPEC" | grep mkspecs/qws >/dev/null 2>&1 && PLATFORM_QWS=yes
2493 if [ "$UNAME_SYSTEM" = "SunOS" ]; then
2494 # Solaris 2.5 and 2.6 have libposix4, which was renamed to librt for Solaris 7 and up
2495 if echo $UNAME_RELEASE | grep "^5\.[5|6]" >/dev/null 2>&1; then
2496 sed -e "s,-lrt,-lposix4," "$XQMAKESPEC/qmake.conf" > "$XQMAKESPEC/qmake.conf.new"
2497 mv "$XQMAKESPEC/qmake.conf.new" "$XQMAKESPEC/qmake.conf"
2501 #-------------------------------------------------------------------------------
2502 # determine the system architecture
2503 #-------------------------------------------------------------------------------
2504 if [ "$OPT_VERBOSE" = "yes" ]; then
2505 echo "Determining system architecture... ($UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE)"
2508 if [ "$CFG_EMBEDDED" != "no" -a "$CFG_EMBEDDED" != "auto" ] && [ -n "$CFG_ARCH" ]; then
2509 if [ "$CFG_ARCH" != "$CFG_EMBEDDED" ]; then
2510 echo ""
2511 echo "You have specified a target architecture with -embedded and -arch."
2512 echo "The two architectures you have specified are different, so we can"
2513 echo "not proceed. Either set both to be the same, or only use -embedded."
2514 echo ""
2515 exit 1
2519 if [ -z "${CFG_HOST_ARCH}" ]; then
2520 case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in
2521 IRIX*:*:*)
2522 CFG_HOST_ARCH=`uname -p`
2523 if [ "$OPT_VERBOSE" = "yes" ]; then
2524 echo " SGI ($CFG_HOST_ARCH)"
2527 SunOS:5*:*)
2528 case "$UNAME_MACHINE" in
2529 sun4u*|sun4v*)
2530 if [ "$OPT_VERBOSE" = "yes" ]; then
2531 echo " Sun SPARC (sparc)"
2533 CFG_HOST_ARCH=sparc
2535 i86pc)
2536 case "$PLATFORM" in
2537 *-64)
2538 if [ "$OPT_VERBOSE" = "yes" ]; then
2539 echo " 64-bit AMD 80x86 (x86_64)"
2541 CFG_HOST_ARCH=x86_64
2544 if [ "$OPT_VERBOSE" = "yes" ]; then
2545 echo " 32-bit Intel 80x86 (i386)"
2547 CFG_HOST_ARCH=i386
2549 esac
2550 esac
2552 Darwin:*:*)
2553 case "$UNAME_MACHINE" in
2554 Power?Macintosh)
2555 if [ "$OPT_VERBOSE" = "yes" ]; then
2556 echo " 32-bit Apple PowerPC (powerpc)"
2559 x86)
2560 if [ "$OPT_VERBOSE" = "yes" ]; then
2561 echo " 32-bit Intel 80x86 (i386)"
2564 esac
2565 CFG_HOST_ARCH=macosx
2567 AIX:*:00????????00)
2568 if [ "$OPT_VERBOSE" = "yes" ]; then
2569 echo " 64-bit IBM PowerPC (powerpc)"
2571 CFG_HOST_ARCH=powerpc
2573 HP-UX:*:9000*)
2574 if [ "$OPT_VERBOSE" = "yes" ]; then
2575 echo " HP PA-RISC (parisc)"
2577 CFG_HOST_ARCH=parisc
2579 *:*:i?86)
2580 if [ "$OPT_VERBOSE" = "yes" ]; then
2581 echo " 32-bit Intel 80x86 (i386)"
2583 CFG_HOST_ARCH=i386
2585 *:*:x86_64|*:*:amd64)
2586 if [ "$PLATFORM" = "linux-g++-32" -o "$PLATFORM" = "linux-icc-32" ]; then
2587 if [ "$OPT_VERBOSE" = "yes" ]; then
2588 echo " 32 bit on 64-bit AMD 80x86 (i386)"
2590 CFG_HOST_ARCH=i386
2591 else
2592 if [ "$OPT_VERBOSE" = "yes" ]; then
2593 echo " 64-bit AMD 80x86 (x86_64)"
2595 CFG_HOST_ARCH=x86_64
2598 *:*:ppc)
2599 if [ "$OPT_VERBOSE" = "yes" ]; then
2600 echo " 32-bit PowerPC (powerpc)"
2602 CFG_HOST_ARCH=powerpc
2604 *:*:ppc64)
2605 if [ "$OPT_VERBOSE" = "yes" ]; then
2606 echo " 64-bit PowerPC (powerpc)"
2608 CFG_HOST_ARCH=powerpc
2610 *:*:s390*)
2611 if [ "$OPT_VERBOSE" = "yes" ]; then
2612 echo " IBM S/390 (s390)"
2614 CFG_HOST_ARCH=s390
2616 *:*:arm*)
2617 if [ "$OPT_VERBOSE" = "yes" ]; then
2618 echo " ARM (arm)"
2620 CFG_HOST_ARCH=arm
2622 Linux:*:sparc*)
2623 if [ "$OPT_VERBOSE" = "yes" ]; then
2624 echo " Linux on SPARC"
2626 CFG_HOST_ARCH=sparc
2628 *:*:*)
2629 if [ "$OPT_VERBOSE" = "yes" ]; then
2630 echo " Trying '$UNAME_MACHINE'..."
2632 CFG_HOST_ARCH="$UNAME_MACHINE"
2634 esac
2637 if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
2638 if [ -n "$CFG_ARCH" ]; then
2639 CFG_EMBEDDED=$CFG_ARCH
2642 case "$CFG_EMBEDDED" in
2643 x86)
2644 CFG_ARCH=i386
2646 x86_64)
2647 CFG_ARCH=x86_64
2649 ipaq|sharp)
2650 CFG_ARCH=arm
2652 dm7000)
2653 CFG_ARCH=powerpc
2655 dm800)
2656 CFG_ARCH=mips
2658 sh4al)
2659 CFG_ARCH=sh4a
2662 CFG_ARCH="$CFG_EMBEDDED"
2664 esac
2665 elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
2666 CFG_ARCH=$CFG_HOST_ARCH
2669 if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then
2670 if [ "$OPT_VERBOSE" = "yes" ]; then
2671 echo " '$CFG_ARCH' is supported"
2673 else
2674 if [ "$OPT_VERBOSE" = "yes" ]; then
2675 echo " '$CFG_ARCH' is unsupported, using 'generic'"
2677 CFG_ARCH=generic
2679 if [ "$CFG_HOST_ARCH" != "$CFG_ARCH" ]; then
2680 if [ -d "$relpath/src/corelib/arch/$CFG_HOST_ARCH" ]; then
2681 if [ "$OPT_VERBOSE" = "yes" ]; then
2682 echo " '$CFG_HOST_ARCH' is supported"
2684 else
2685 if [ "$OPT_VERBOSE" = "yes" ]; then
2686 echo " '$CFG_HOST_ARCH' is unsupported, using 'generic'"
2688 CFG_HOST_ARCH=generic
2692 if [ "$OPT_VERBOSE" = "yes" ]; then
2693 echo "System architecture: '$CFG_ARCH'"
2694 if [ "$PLATFORM_QWS" = "yes" ]; then
2695 echo "Host architecture: '$CFG_HOST_ARCH'"
2699 #-------------------------------------------------------------------------------
2700 # tests that don't need qmake (must be run before displaying help)
2701 #-------------------------------------------------------------------------------
2703 if [ -z "$PKG_CONFIG" ]; then
2704 # See if PKG_CONFIG is set in the mkspec:
2705 PKG_CONFIG=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%PKG_CONFIG[^_].*=%%p' | tr '\n' ' '`
2707 if [ -z "$PKG_CONFIG" ]; then
2708 PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
2711 # Work out if we can use pkg-config
2712 if [ "$QT_CROSS_COMPILE" = "yes" ]; then
2713 if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then
2714 echo >&2 ""
2715 echo >&2 "You have asked to use pkg-config and are cross-compiling."
2716 echo >&2 "Please make sure you have a correctly set-up pkg-config"
2717 echo >&2 "environment!"
2718 echo >&2 ""
2719 if [ -z "$PKG_CONFIG_PATH" ]; then
2720 echo >&2 ""
2721 echo >&2 "Warning: PKG_CONFIG_PATH has not been set. This could mean"
2722 echo >&2 "the host compiler's .pc files will be used. This is probably"
2723 echo >&2 "not what you want."
2724 echo >&2 ""
2725 elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then
2726 echo >&2 ""
2727 echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not"
2728 echo >&2 "been set. This means your toolchain's .pc files must contain"
2729 echo >&2 "the paths to the toolchain's libraries & headers. If configure"
2730 echo >&2 "tests are failing, please check these files."
2731 echo >&2 ""
2733 else
2734 PKG_CONFIG=""
2738 # process CFG_MAC_ARCHS
2739 if [ "$PLATFORM_MAC" = "yes" ]; then
2740 # check -arch arguments for validity.
2741 ALLOWED="x86 ppc x86_64 ppc64 i386"
2742 # Save the list so we can re-write it using only valid values
2743 CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS"
2744 CFG_MAC_ARCHS=
2745 for i in $CFG_MAC_ARCHS_IN
2747 if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then
2748 echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64";
2749 exit 2;
2751 if [ "$i" = "i386" -o "$i" = "x86" ]; then
2752 # These are synonymous values
2753 # CFG_MAC_ARCHS requires x86 while GCC requires i386
2754 CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86"
2755 MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch i386"
2756 else
2757 CFG_MAC_ARCHS="$CFG_MAC_ARCHS $i"
2758 MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -arch $i"
2760 done
2763 # pass on $CFG_SDK to the configure tests.
2764 if [ '!' -z "$CFG_SDK" ]; then
2765 MAC_CONFIG_TEST_COMMANDLINE="-sdk $CFG_SDK"
2766 echo "tests command line: $MAC_CONFIG_TEST_COMMANDLINE"
2769 # find the default framework value
2770 if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
2771 if [ "$CFG_FRAMEWORK" = "auto" ]; then
2772 CFG_FRAMEWORK="$CFG_SHARED"
2773 elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
2774 echo
2775 echo "WARNING: Using static linking will disable the use of Mac frameworks."
2776 echo
2777 CFG_FRAMEWORK="no"
2779 else
2780 CFG_FRAMEWORK=no
2783 QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
2784 TEST_COMPILER="$CC"
2785 [ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
2787 # auto-detect precompiled header support
2788 if [ "$CFG_PRECOMPILE" = "auto" ]; then
2789 if [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
2790 CFG_PRECOMPILE=no
2791 elif "$unixtests/precomp.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2792 CFG_PRECOMPILE=no
2793 else
2794 CFG_PRECOMPILE=yes
2796 elif [ "$CFG_PRECOMPILE" = "yes" ] && [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
2797 echo
2798 echo "WARNING: Using universal binaries disables precompiled headers."
2799 echo
2800 CFG_PRECOMPILE=no
2803 #auto-detect DWARF2 on the mac
2804 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" == "auto" ]; then
2805 if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
2806 CFG_MAC_DWARF2=no
2807 else
2808 CFG_MAC_DWARF2=yes
2812 # auto-detect support for -Xarch on the mac
2813 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" == "auto" ]; then
2814 if "$mactests/xarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then
2815 CFG_MAC_XARCH=no
2816 else
2817 CFG_MAC_XARCH=yes
2821 # don't autodetect support for separate debug info on objcopy when
2822 # cross-compiling as lots of toolchains seems to have problems with this
2823 if [ "$QT_CROSS_COMPILE" = "yes" ] && [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
2824 CFG_SEPARATE_DEBUG_INFO="no"
2827 # auto-detect support for separate debug info in objcopy
2828 if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
2829 TEST_COMPILER_CFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CFLAGS[^_].*=%%p' | tr '\n' ' '`
2830 TEST_COMPILER_CXXFLAGS=`getQMakeConf "$XQMAKESPEC" | sed -n -e 's%QMAKE_CXXFLAGS[^_].*=%%p' | tr '\n' ' '`
2831 TEST_OBJCOPY=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_OBJCOPY" | sed "s%.* *= *\(.*\)$%\1%" | tail -1`
2832 COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
2833 COMPILER_WITH_FLAGS=`echo "$COMPILER_WITH_FLAGS" | sed -e "s%\\$\\$QMAKE_CFLAGS%$TEST_COMPILER_CFLAGS%g"`
2834 if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$TEST_OBJCOPY" "$OPT_VERBOSE"; then
2835 CFG_SEPARATE_DEBUG_INFO=no
2836 else
2837 case "$PLATFORM" in
2838 hpux-*)
2839 # binutils on HP-UX is buggy; default to no.
2840 CFG_SEPARATE_DEBUG_INFO=no
2843 CFG_SEPARATE_DEBUG_INFO=yes
2845 esac
2849 # auto-detect -fvisibility support
2850 if [ "$CFG_REDUCE_EXPORTS" = "auto" ]; then
2851 if "$unixtests/fvisibility.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2852 CFG_REDUCE_EXPORTS=no
2853 else
2854 CFG_REDUCE_EXPORTS=yes
2858 # detect the availability of the -Bsymbolic-functions linker optimization
2859 if [ "$CFG_REDUCE_RELOCATIONS" != "no" ]; then
2860 if "$unixtests/bsymbolic_functions.test" "$TEST_COMPILER" "$OPT_VERBOSE"; then
2861 CFG_REDUCE_RELOCATIONS=no
2862 else
2863 CFG_REDUCE_RELOCATIONS=yes
2867 # auto-detect GNU make support
2868 if [ "$CFG_USE_GNUMAKE" = "auto" ] && "$MAKE" -v | grep "GNU Make" >/dev/null 2>&1; then
2869 CFG_USE_GNUMAKE=yes
2872 # If -opengl wasn't specified, don't try to auto-detect
2873 if [ "$PLATFORM_QWS" = "yes" ] && [ "$CFG_OPENGL" = "auto" ]; then
2874 CFG_OPENGL=no
2877 # mac
2878 if [ "$PLATFORM_MAC" = "yes" ]; then
2879 if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
2880 CFG_OPENGL=desktop
2884 # find the default framework value
2885 if [ "$PLATFORM_MAC" = "yes" ] && [ "$PLATFORM" != "macx-xlc" ]; then
2886 if [ "$CFG_FRAMEWORK" = "auto" ]; then
2887 CFG_FRAMEWORK="$CFG_SHARED"
2888 elif [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_SHARED" = "no" ]; then
2889 echo
2890 echo "WARNING: Using static linking will disable the use of Mac frameworks."
2891 echo
2892 CFG_FRAMEWORK="no"
2894 else
2895 CFG_FRAMEWORK=no
2898 # x11 tests are done after qmake is built
2901 #setup the build parts
2902 if [ -z "$CFG_BUILD_PARTS" ]; then
2903 CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
2905 # don't build tools by default when cross-compiling
2906 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2907 CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, tools,,g"`
2910 for nobuild in $CFG_NOBUILD_PARTS; do
2911 CFG_BUILD_PARTS=`echo "$CFG_BUILD_PARTS" | sed "s, $nobuild,,g"`
2912 done
2913 if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then
2914 # echo
2915 # echo "WARNING: libs is a required part of the build."
2916 # echo
2917 CFG_BUILD_PARTS="$CFG_BUILD_PARTS libs"
2920 #-------------------------------------------------------------------------------
2921 # post process QT_INSTALL_* variables
2922 #-------------------------------------------------------------------------------
2924 #prefix
2925 if [ -z "$QT_INSTALL_PREFIX" ]; then
2926 if [ "$CFG_DEV" = "yes" ]; then
2927 QT_INSTALL_PREFIX="$outpath" # At Trolltech, we use sandboxed builds by default
2928 elif [ "$PLATFORM_QWS" = "yes" ]; then
2929 QT_INSTALL_PREFIX="/usr/local/Trolltech/QtEmbedded-${QT_VERSION}"
2930 if [ "$PLATFORM" != "$XPLATFORM" ]; then
2931 QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}"
2933 else
2934 QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION
2937 QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
2939 #docs
2940 if [ -z "$QT_INSTALL_DOCS" ]; then #default
2941 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2942 if [ "$PLATFORM_MAC" = "yes" ]; then
2943 QT_INSTALL_DOCS="/Developer/Documentation/Qt"
2946 [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
2949 QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
2951 #headers
2952 if [ -z "$QT_INSTALL_HEADERS" ]; then #default
2953 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2954 if [ "$PLATFORM_MAC" = "yes" ]; then
2955 if [ "$CFG_FRAMEWORK" = "yes" ]; then
2956 QT_INSTALL_HEADERS=
2960 [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
2963 QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"`
2965 #libs
2966 if [ -z "$QT_INSTALL_LIBS" ]; then #default
2967 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2968 if [ "$PLATFORM_MAC" = "yes" ]; then
2969 if [ "$CFG_FRAMEWORK" = "yes" ]; then
2970 QT_INSTALL_LIBS="/Libraries/Frameworks"
2974 [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback
2976 QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
2978 #bins
2979 if [ -z "$QT_INSTALL_BINS" ]; then #default
2980 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2981 if [ "$PLATFORM_MAC" = "yes" ]; then
2982 QT_INSTALL_BINS="/Developer/Applications/Qt"
2985 [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
2988 QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
2990 #plugins
2991 if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
2992 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
2993 if [ "$PLATFORM_MAC" = "yes" ]; then
2994 QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins"
2997 [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
2999 QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
3001 #data
3002 if [ -z "$QT_INSTALL_DATA" ]; then #default
3003 QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
3005 QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
3007 #translations
3008 if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
3009 QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
3011 QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
3013 #settings
3014 if [ -z "$QT_INSTALL_SETTINGS" ]; then #default
3015 if [ "$PLATFORM_MAC" = "yes" ]; then
3016 QT_INSTALL_SETTINGS=/Library/Preferences/Qt
3017 else
3018 QT_INSTALL_SETTINGS=/etc/xdg
3021 QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"`
3023 #examples
3024 if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default
3025 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3026 if [ "$PLATFORM_MAC" = "yes" ]; then
3027 QT_INSTALL_EXAMPLES="/Developer/Examples/Qt"
3030 [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback
3032 QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"`
3034 #demos
3035 if [ -z "$QT_INSTALL_DEMOS" ]; then #default
3036 if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
3037 if [ "$PLATFORM_MAC" = "yes" ]; then
3038 QT_INSTALL_DEMOS="/Developer/Examples/Qt/Demos"
3041 [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos"
3043 QT_INSTALL_DEMOS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DEMOS"`
3045 #-------------------------------------------------------------------------------
3046 # help - interactive parts of the script _after_ this section please
3047 #-------------------------------------------------------------------------------
3049 # next, emit a usage message if something failed.
3050 if [ "$OPT_HELP" = "yes" ]; then
3051 [ "x$ERROR" = "xyes" ] && echo
3052 if [ "$CFG_NIS" = "no" ]; then
3053 NSY=" "
3054 NSN="*"
3055 else
3056 NSY="*"
3057 NSN=" "
3059 if [ "$CFG_CUPS" = "no" ]; then
3060 CUY=" "
3061 CUN="*"
3062 else
3063 CUY="*"
3064 CUN=" "
3066 if [ "$CFG_ICONV" = "no" ]; then
3067 CIY=" "
3068 CIN="*"
3069 else
3070 CIY="*"
3071 CIN=" "
3073 if [ "$CFG_LARGEFILE" = "no" ]; then
3074 LFSY=" "
3075 LFSN="*"
3076 else
3077 LFSY="*"
3078 LFSN=" "
3080 if [ "$CFG_STL" = "auto" ] || [ "$CFG_STL" = "yes" ]; then
3081 SHY="*"
3082 SHN=" "
3083 else
3084 SHY=" "
3085 SHN="*"
3087 if [ "$CFG_IPV6" = "auto" ]; then
3088 I6Y="*"
3089 I6N=" "
3091 if [ "$CFG_PRECOMPILE" = "auto" ] || [ "$CFG_PRECOMPILE" = "no" ]; then
3092 PHY=" "
3093 PHN="*"
3094 else
3095 PHY="*"
3096 PHN=" "
3099 cat <<EOF
3100 Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
3101 [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-datadir <dir>]
3102 [-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>]
3103 [-demosdir <dir>] [-buildkey <key>] [-release] [-debug]
3104 [-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
3105 [-largefile] [-no-exceptions] [-exceptions] [-no-accessibility]
3106 [-accessibility] [-no-stl] [-stl] [-no-sql-<driver>] [-sql-<driver>]
3107 [-plugin-sql-<driver>] [-system-sqlite] [-no-qt3support] [-qt3support]
3108 [-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
3109 [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff]
3110 [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng]
3111 [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>]
3112 [-no-make <part>] [-R <string>] [-l <string>] [-no-rpath] [-rpath] [-continue]
3113 [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
3114 [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked]
3115 [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]
3116 [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info] [-armfpa]
3117 [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns]
3118 [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend]
3119 [-no-openssl] [-openssl] [-openssl-linked]
3120 [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit]
3121 [-no-scripttools] [-scripttools]
3123 [additional platform specific options (see below)]
3126 Installation options:
3128 These are optional, but you may specify install directories.
3130 -prefix <dir> ...... This will install everything relative to <dir>
3131 (default $QT_INSTALL_PREFIX)
3133 if [ "$PLATFORM_QWS" = "yes" ]; then
3134 cat <<EOF
3136 -hostprefix [dir] .. Tools and libraries needed when developing
3137 applications are installed in [dir]. If [dir] is
3138 not given, the current build directory will be used.
3141 cat <<EOF
3143 * -prefix-install .... Force a sandboxed "local" installation of
3144 Qt. This will install into
3145 $QT_INSTALL_PREFIX, if this option is
3146 disabled then some platforms will attempt a
3147 "system" install by placing default values to
3148 be placed in a system location other than
3149 PREFIX.
3151 You may use these to separate different parts of the install:
3153 -bindir <dir> ......... Executables will be installed to <dir>
3154 (default PREFIX/bin)
3155 -libdir <dir> ......... Libraries will be installed to <dir>
3156 (default PREFIX/lib)
3157 -docdir <dir> ......... Documentation will be installed to <dir>
3158 (default PREFIX/doc)
3159 -headerdir <dir> ...... Headers will be installed to <dir>
3160 (default PREFIX/include)
3161 -plugindir <dir> ...... Plugins will be installed to <dir>
3162 (default PREFIX/plugins)
3163 -datadir <dir> ........ Data used by Qt programs will be installed to <dir>
3164 (default PREFIX)
3165 -translationdir <dir> . Translations of Qt programs will be installed to <dir>
3166 (default PREFIX/translations)
3167 -sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>
3168 (default PREFIX/etc/settings)
3169 -examplesdir <dir> .... Examples will be installed to <dir>
3170 (default PREFIX/examples)
3171 -demosdir <dir> ....... Demos will be installed to <dir>
3172 (default PREFIX/demos)
3174 You may use these options to turn on strict plugin loading.
3176 -buildkey <key> .... Build the Qt library and plugins using the specified
3177 <key>. When the library loads plugins, it will only
3178 load those that have a matching key.
3180 Configure options:
3182 The defaults (*) are usually acceptable. A plus (+) denotes a default value
3183 that needs to be evaluated. If the evaluation succeeds, the feature is
3184 included. Here is a short explanation of each option:
3186 * -release ........... Compile and link Qt with debugging turned off.
3187 -debug ............. Compile and link Qt with debugging turned on.
3188 -debug-and-release . Compile and link two versions of Qt, with and without
3189 debugging turned on (Mac only).
3191 -developer-build.... Compile and link Qt with Qt developer options (including auto-tests exporting)
3193 -opensource......... Compile and link the Open-Source Edition of Qt.
3194 -commercial......... Compile and link the Commercial Edition of Qt.
3197 * -shared ............ Create and use shared Qt libraries.
3198 -static ............ Create and use static Qt libraries.
3200 * -no-fast ........... Configure Qt normally by generating Makefiles for all
3201 project files.
3202 -fast .............. Configure Qt quickly by generating Makefiles only for
3203 library and subdirectory targets. All other Makefiles
3204 are created as wrappers, which will in turn run qmake.
3206 -no-largefile ...... Disables large file support.
3207 + -largefile ......... Enables Qt to access files larger than 4 GB.
3210 if [ "$PLATFORM_QWS" = "yes" ]; then
3211 EXCN="*"
3212 EXCY=" "
3213 else
3214 EXCN=" "
3215 EXCY="*"
3217 if [ "$CFG_DBUS" = "no" ]; then
3218 DBY=" "
3219 DBN="+"
3220 else
3221 DBY="+"
3222 DBN=" "
3225 cat << EOF
3226 $EXCN -no-exceptions ..... Disable exceptions on compilers that support it.
3227 $EXCY -exceptions ........ Enable exceptions on compilers that support it.
3229 -no-accessibility .. Do not compile Accessibility support.
3230 * -accessibility ..... Compile Accessibility support.
3232 $SHN -no-stl ............ Do not compile STL support.
3233 $SHY -stl ............... Compile STL support.
3235 -no-sql-<driver> ... Disable SQL <driver> entirely.
3236 -qt-sql-<driver> ... Enable a SQL <driver> in the QtSql library, by default
3237 none are turned on.
3238 -plugin-sql-<driver> Enable SQL <driver> as a plugin to be linked to
3239 at run time.
3241 Possible values for <driver>:
3242 [ $CFG_SQL_AVAILABLE ]
3244 -system-sqlite ..... Use sqlite from the operating system.
3246 -no-qt3support ..... Disables the Qt 3 support functionality.
3247 * -qt3support ........ Enables the Qt 3 support functionality.
3249 -no-xmlpatterns .... Do not build the QtXmlPatterns module.
3250 + -xmlpatterns ....... Build the QtXmlPatterns module.
3251 QtXmlPatterns is built if a decent C++ compiler
3252 is used and exceptions are enabled.
3254 -no-phonon ......... Do not build the Phonon module.
3255 + -phonon ............ Build the Phonon module.
3256 Phonon is built if a decent C++ compiler is used.
3257 -no-phonon-backend.. Do not build the platform phonon plugin.
3258 + -phonon-backend..... Build the platform phonon plugin.
3260 -no-svg ............ Do not build the SVG module.
3261 + -svg ............... Build the SVG module.
3263 -no-webkit ......... Do not build the WebKit module.
3264 + -webkit ............ Build the WebKit module.
3265 WebKit is built if a decent C++ compiler is used.
3267 -no-scripttools .... Do not build the QtScriptTools module.
3268 + -scripttools ....... Build the QtScriptTools module.
3270 -platform target ... The operating system and compiler you are building
3271 on ($PLATFORM).
3273 See the README file for a list of supported
3274 operating systems and compilers.
3276 if [ "${PLATFORM_QWS}" != "yes" ]; then
3277 cat << EOF
3278 -graphicssystem <sys> Sets an alternate graphics system. Available options are:
3279 raster - Software rasterizer
3280 opengl - Rendering via OpenGL, Experimental!
3283 cat << EOF
3285 -no-mmx ............ Do not compile with use of MMX instructions.
3286 -no-3dnow .......... Do not compile with use of 3DNOW instructions.
3287 -no-sse ............ Do not compile with use of SSE instructions.
3288 -no-sse2 ........... Do not compile with use of SSE2 instructions.
3290 -qtnamespace <name> Wraps all Qt library code in 'namespace <name> {...}'.
3291 -qtlibinfix <infix> Renames all libQt*.so to libQt*<infix>.so.
3293 -D <string> ........ Add an explicit define to the preprocessor.
3294 -I <string> ........ Add an explicit include path.
3295 -L <string> ........ Add an explicit library path.
3297 -help, -h .......... Display this information.
3299 Third Party Libraries:
3301 -qt-zlib ........... Use the zlib bundled with Qt.
3302 + -system-zlib ....... Use zlib from the operating system.
3303 See http://www.gzip.org/zlib
3305 -no-gif ............ Do not compile the plugin for GIF reading support.
3306 * -qt-gif ............ Compile the plugin for GIF reading support.
3307 See also src/plugins/imageformats/gif/qgifhandler.h
3309 -no-libtiff ........ Do not compile the plugin for TIFF support.
3310 -qt-libtiff ........ Use the libtiff bundled with Qt.
3311 + -system-libtiff .... Use libtiff from the operating system.
3312 See http://www.libtiff.org
3314 -no-libpng ......... Do not compile in PNG support.
3315 -qt-libpng ......... Use the libpng bundled with Qt.
3316 + -system-libpng ..... Use libpng from the operating system.
3317 See http://www.libpng.org/pub/png
3319 -no-libmng ......... Do not compile the plugin for MNG support.
3320 -qt-libmng ......... Use the libmng bundled with Qt.
3321 + -system-libmng ..... Use libmng from the operating system.
3322 See http://www.libmng.com
3324 -no-libjpeg ........ Do not compile the plugin for JPEG support.
3325 -qt-libjpeg ........ Use the libjpeg bundled with Qt.
3326 + -system-libjpeg .... Use libjpeg from the operating system.
3327 See http://www.ijg.org
3329 -no-openssl ........ Do not compile support for OpenSSL.
3330 + -openssl ........... Enable run-time OpenSSL support.
3331 -openssl-linked .... Enabled linked OpenSSL support.
3333 -ptmalloc .......... Override the system memory allocator with ptmalloc.
3334 (Experimental.)
3336 Additional options:
3338 -make <part> ....... Add part to the list of parts to be built at make time.
3339 ($QT_DEFAULT_BUILD_PARTS)
3340 -nomake <part> ..... Exclude part from the list of parts to be built.
3342 -R <string> ........ Add an explicit runtime library path to the Qt
3343 libraries.
3344 -l <string> ........ Add an explicit library.
3346 -no-rpath .......... Do not use the library install path as a runtime
3347 library path.
3348 + -rpath ............. Link Qt libraries and executables using the library
3349 install path as a runtime library path. Equivalent
3350 to -R install_libpath
3352 -continue .......... Continue as far as possible if an error occurs.
3354 -verbose, -v ....... Print verbose information about each step of the
3355 configure process.
3357 -silent ............ Reduce the build output so that warnings and errors
3358 can be seen more easily.
3360 * -no-optimized-qmake ... Do not build qmake optimized.
3361 -optimized-qmake ...... Build qmake optimized.
3363 $NSN -no-nis ............ Do not compile NIS support.
3364 $NSY -nis ............... Compile NIS support.
3366 $CUN -no-cups ........... Do not compile CUPS support.
3367 $CUY -cups .............. Compile CUPS support.
3368 Requires cups/cups.h and libcups.so.2.
3370 $CIN -no-iconv .......... Do not compile support for iconv(3).
3371 $CIY -iconv ............. Compile support for iconv(3).
3373 $PHN -no-pch ............ Do not use precompiled header support.
3374 $PHY -pch ............... Use precompiled header support.
3376 $DBN -no-dbus ........... Do not compile the QtDBus module.
3377 $DBY -dbus .............. Compile the QtDBus module and dynamically load libdbus-1.
3378 -dbus-linked ....... Compile the QtDBus module and link to libdbus-1.
3380 -reduce-relocations ..... Reduce relocations in the libraries through extra
3381 linker optimizations (Qt/X11 and Qt for Embedded Linux only;
3382 experimental; needs GNU ld >= 2.18).
3385 if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
3386 if [ "$QT_CROSS_COMPILE" = "yes" ]; then
3387 SBY=""
3388 SBN="*"
3389 else
3390 SBY="*"
3391 SBN=" "
3393 elif [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
3394 SBY="*"
3395 SBN=" "
3396 else
3397 SBY=" "
3398 SBN="*"
3401 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
3403 cat << EOF
3405 $SBN -no-separate-debug-info . Do not store debug information in a separate file.
3406 $SBY -separate-debug-info .... Strip debug information into a separate .debug file.
3410 fi # X11/QWS
3412 if [ "$PLATFORM_X11" = "yes" ]; then
3413 if [ "$CFG_SM" = "no" ]; then
3414 SMY=" "
3415 SMN="*"
3416 else
3417 SMY="*"
3418 SMN=" "
3420 if [ "$CFG_XSHAPE" = "no" ]; then
3421 SHY=" "
3422 SHN="*"
3423 else
3424 SHY="*"
3425 SHN=" "
3427 if [ "$CFG_XINERAMA" = "no" ]; then
3428 XAY=" "
3429 XAN="*"
3430 else
3431 XAY="*"
3432 XAN=" "
3434 if [ "$CFG_FONTCONFIG" = "no" ]; then
3435 FCGY=" "
3436 FCGN="*"
3437 else
3438 FCGY="*"
3439 FCGN=" "
3441 if [ "$CFG_XCURSOR" = "no" ]; then
3442 XCY=" "
3443 XCN="*"
3444 else
3445 XCY="*"
3446 XCN=" "
3448 if [ "$CFG_XFIXES" = "no" ]; then
3449 XFY=" "
3450 XFN="*"
3451 else
3452 XFY="*"
3453 XFN=" "
3455 if [ "$CFG_XRANDR" = "no" ]; then
3456 XZY=" "
3457 XZN="*"
3458 else
3459 XZY="*"
3460 XZN=" "
3462 if [ "$CFG_XRENDER" = "no" ]; then
3463 XRY=" "
3464 XRN="*"
3465 else
3466 XRY="*"
3467 XRN=" "
3469 if [ "$CFG_MITSHM" = "no" ]; then
3470 XMY=" "
3471 XMN="*"
3472 else
3473 XMY="*"
3474 XMN=" "
3476 if [ "$CFG_XINPUT" = "no" ]; then
3477 XIY=" "
3478 XIN="*"
3479 else
3480 XIY="*"
3481 XIN=" "
3483 if [ "$CFG_XKB" = "no" ]; then
3484 XKY=" "
3485 XKN="*"
3486 else
3487 XKY="*"
3488 XKN=" "
3490 if [ "$CFG_IM" = "no" ]; then
3491 IMY=" "
3492 IMN="*"
3493 else
3494 IMY="*"
3495 IMN=" "
3497 cat << EOF
3499 Qt/X11 only:
3501 -no-gtkstyle ....... Do not build the GTK theme integration.
3502 + -gtkstyle .......... Build the GTK theme integration.
3504 * -no-nas-sound ...... Do not compile in NAS sound support.
3505 -system-nas-sound .. Use NAS libaudio from the operating system.
3506 See http://radscan.com/nas.html
3508 -no-opengl ......... Do not support OpenGL.
3509 + -opengl <api> ...... Enable OpenGL support.
3510 With no parameter, this will auto-detect the "best"
3511 OpenGL API to use. If desktop OpenGL is avaliable, it
3512 will be used. Use desktop, es1, es1cl or es2 for <api>
3513 to force the use of the Desktop (OpenGL 1.x or 2.x),
3514 OpenGL ES 1.x Common profile, 1.x Common Lite profile
3515 or 2.x APIs instead. On X11, the EGL API will be used
3516 to manage GL contexts in the case of OpenGL ES
3518 -no-openvg ........ Do not support OpenVG.
3519 + -openvg ........... Enable OpenVG support.
3520 Requires EGL support, typically supplied by an OpenGL
3521 or other graphics implementation.
3523 $SMN -no-sm ............. Do not support X Session Management.
3524 $SMY -sm ................ Support X Session Management, links in -lSM -lICE.
3526 $SHN -no-xshape ......... Do not compile XShape support.
3527 $SHY -xshape ............ Compile XShape support.
3528 Requires X11/extensions/shape.h.
3530 $SHN -no-xsync .......... Do not compile XSync support.
3531 $SHY -xsync ............. Compile XSync support.
3532 Requires X11/extensions/sync.h.
3534 $XAN -no-xinerama ....... Do not compile Xinerama (multihead) support.
3535 $XAY -xinerama .......... Compile Xinerama support.
3536 Requires X11/extensions/Xinerama.h and libXinerama.
3537 By default, Xinerama support will be compiled if
3538 available and the shared libraries are dynamically
3539 loaded at runtime.
3541 $XCN -no-xcursor ........ Do not compile Xcursor support.
3542 $XCY -xcursor ........... Compile Xcursor support.
3543 Requires X11/Xcursor/Xcursor.h and libXcursor.
3544 By default, Xcursor support will be compiled if
3545 available and the shared libraries are dynamically
3546 loaded at runtime.
3548 $XFN -no-xfixes ......... Do not compile Xfixes support.
3549 $XFY -xfixes ............ Compile Xfixes support.
3550 Requires X11/extensions/Xfixes.h and libXfixes.
3551 By default, Xfixes support will be compiled if
3552 available and the shared libraries are dynamically
3553 loaded at runtime.
3555 $XZN -no-xrandr ......... Do not compile Xrandr (resize and rotate) support.
3556 $XZY -xrandr ............ Compile Xrandr support.
3557 Requires X11/extensions/Xrandr.h and libXrandr.
3559 $XRN -no-xrender ........ Do not compile Xrender support.
3560 $XRY -xrender ........... Compile Xrender support.
3561 Requires X11/extensions/Xrender.h and libXrender.
3563 $XMN -no-mitshm ......... Do not compile MIT-SHM support.
3564 $XMY -mitshm ............ Compile MIT-SHM support.
3565 Requires sys/ipc.h, sys/shm.h and X11/extensions/XShm.h
3567 $FCGN -no-fontconfig ..... Do not compile FontConfig (anti-aliased font) support.
3568 $FCGY -fontconfig ........ Compile FontConfig support.
3569 Requires fontconfig/fontconfig.h, libfontconfig,
3570 freetype.h and libfreetype.
3572 $XIN -no-xinput.......... Do not compile Xinput support.
3573 $XIY -xinput ............ Compile Xinput support. This also enabled tablet support
3574 which requires IRIX with wacom.h and libXi or
3575 XFree86 with X11/extensions/XInput.h and libXi.
3577 $XKN -no-xkb ............ Do not compile XKB (X KeyBoard extension) support.
3578 $XKY -xkb ............... Compile XKB support.
3583 if [ "$PLATFORM_MAC" = "yes" ]; then
3584 cat << EOF
3586 Qt/Mac only:
3588 -Fstring ........... Add an explicit framework path.
3589 -fw string ......... Add an explicit framework.
3591 -cocoa ............. Build the Cocoa version of Qt. Note that -no-framework
3592 and -static is not supported with -cocoa. Specifying
3593 this option creates Qt binaries that requires Mac OS X
3594 10.5 or higher.
3596 * -framework ......... Build Qt as a series of frameworks and
3597 link tools against those frameworks.
3598 -no-framework ...... Do not build Qt as a series of frameworks.
3600 * -dwarf2 ............ Enable dwarf2 debugging symbols.
3601 -no-dwarf2 ......... Disable dwarf2 debugging symbols.
3603 -universal ......... Equivalent to -arch "ppc x86"
3605 -arch <arch> ....... Build Qt for <arch>
3606 Example values for <arch>: x86 ppc x86_64 ppc64
3607 Multiple -arch arguments can be specified, 64-bit archs
3608 will be built with the Cocoa framework.
3610 -sdk <sdk> ......... Build Qt using Apple provided SDK <sdk>. This option requires gcc 4.
3611 To use a different SDK with gcc 3.3, set the SDKROOT environment variable.
3616 if [ "$PLATFORM_QWS" = "yes" ]; then
3617 cat << EOF
3619 Qt for Embedded Linux only:
3621 -xplatform target ... The target platform when cross-compiling.
3623 -no-feature-<feature> Do not compile in <feature>.
3624 -feature-<feature> .. Compile in <feature>. The available features
3625 are described in src/corelib/global/qfeatures.txt
3627 -embedded <arch> .... This will enable the embedded build, you must have a
3628 proper license for this switch to work.
3629 Example values for <arch>: arm mips x86 generic
3631 -armfpa ............. Target platform is uses the ARM-FPA floating point format.
3632 -no-armfpa .......... Target platform does not use the ARM-FPA floating point format.
3634 The floating point format is usually autodetected by configure. Use this
3635 to override the detected value.
3637 -little-endian ...... Target platform is little endian (LSB first).
3638 -big-endian ......... Target platform is big endian (MSB first).
3640 -host-little-endian . Host platform is little endian (LSB first).
3641 -host-big-endian .... Host platform is big endian (MSB first).
3643 You only need to specify the endianness when
3644 cross-compiling, otherwise the host
3645 endianness will be used.
3647 -no-freetype ........ Do not compile in Freetype2 support.
3648 -qt-freetype ........ Use the libfreetype bundled with Qt.
3649 * -system-freetype .... Use libfreetype from the operating system.
3650 See http://www.freetype.org/
3652 -qconfig local ...... Use src/corelib/global/qconfig-local.h rather than the
3653 default ($CFG_QCONFIG).
3655 -depths <list> ...... Comma-separated list of supported bit-per-pixel
3656 depths, from: 1, 4, 8, 12, 15, 16, 18, 24, 32 and 'all'.
3658 -qt-decoration-<style> ....Enable a decoration <style> in the QtGui library,
3659 by default all available decorations are on.
3660 Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
3661 -plugin-decoration-<style> Enable decoration <style> as a plugin to be
3662 linked to at run time.
3663 Possible values for <style>: [ $CFG_DECORATION_PLUGIN_AVAILABLE ]
3664 -no-decoration-<style> ....Disable decoration <style> entirely.
3665 Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
3667 -no-opengl .......... Do not support OpenGL.
3668 -opengl <api> ....... Enable OpenGL ES support
3669 With no parameter, this will attempt to auto-detect OpenGL ES 1.x
3670 or 2.x. Use es1, es1cl or es2 for <api> to override auto-detection.
3672 NOTE: A QGLScreen driver for the hardware is required to support
3673 OpenGL ES on Qt for Embedded Linux.
3675 -qt-gfx-<driver> ... Enable a graphics <driver> in the QtGui library.
3676 Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
3677 -plugin-gfx-<driver> Enable graphics <driver> as a plugin to be
3678 linked to at run time.
3679 Possible values for <driver>: [ $CFG_GFX_PLUGIN_AVAILABLE ]
3680 -no-gfx-<driver> ... Disable graphics <driver> entirely.
3681 Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
3683 -qt-kbd-<driver> ... Enable a keyboard <driver> in the QtGui library.
3684 Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
3686 -plugin-kbd-<driver> Enable keyboard <driver> as a plugin to be linked to
3687 at runtime.
3688 Possible values for <driver>: [ $CFG_KBD_PLUGIN_AVAILABLE ]
3690 -no-kbd-<driver> ... Disable keyboard <driver> entirely.
3691 Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
3693 -qt-mouse-<driver> ... Enable a mouse <driver> in the QtGui library.
3694 Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
3695 -plugin-mouse-<driver> Enable mouse <driver> as a plugin to be linked to
3696 at runtime.
3697 Possible values for <driver>: [ $CFG_MOUSE_PLUGIN_AVAILABLE ]
3698 -no-mouse-<driver> ... Disable mouse <driver> entirely.
3699 Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
3701 -iwmmxt ............ Compile using the iWMMXt instruction set
3702 (available on some XScale CPUs).
3708 if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
3709 if [ "$CFG_GLIB" = "no" ]; then
3710 GBY=" "
3711 GBN="+"
3712 else
3713 GBY="+"
3714 GBN=" "
3716 cat << EOF
3717 $GBN -no-glib ........... Do not compile Glib support.
3718 $GBY -glib .............. Compile Glib support.
3723 [ "x$ERROR" = "xyes" ] && exit 1
3724 exit 0
3725 fi # Help
3728 # -----------------------------------------------------------------------------
3729 # LICENSING, INTERACTIVE PART
3730 # -----------------------------------------------------------------------------
3732 if [ "$PLATFORM_QWS" = "yes" ]; then
3733 Platform="Qt for Embedded Linux"
3734 elif [ "$PLATFORM_MAC" = "yes" ]; then
3735 Platform="Qt/Mac"
3736 else
3737 PLATFORM_X11=yes
3738 Platform="Qt/X11"
3741 echo
3742 echo "This is the $Platform ${EditionString} Edition."
3743 echo
3745 if [ "$Edition" = "NokiaInternalBuild" ]; then
3746 echo "Detected -nokia-developer option"
3747 echo "Nokia employees and agents are allowed to use this software under"
3748 echo "the authority of Nokia Corporation and/or its subsidiary(-ies)"
3749 elif [ "$Edition" = "OpenSource" ]; then
3750 while true; do
3751 echo "You are licensed to use this software under the terms of"
3752 echo "the GNU General Public License (GPL) versions 3."
3753 echo "You are also licensed to use this software under the terms of"
3754 echo "the Lesser GNU General Public License (LGPL) versions 2.1."
3755 echo
3756 affix="either"
3757 if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
3758 echo "You have already accepted the terms of the $LicenseType license."
3759 acceptance=yes
3760 else
3761 echo "Type '3' to view the GNU General Public License version 3."
3762 echo "Type 'L' to view the Lesser GNU General Public License version 2.1."
3763 echo "Type 'yes' to accept this license offer."
3764 echo "Type 'no' to decline this license offer."
3765 echo
3766 if echo '\c' | grep '\c' >/dev/null; then
3767 echo -n "Do you accept the terms of $affix license? "
3768 else
3769 echo "Do you accept the terms of $affix license? \c"
3771 read acceptance
3773 echo
3774 if [ "$acceptance" = "yes" ] || [ "$acceptance" = "y" ]; then
3775 break
3776 elif [ "$acceptance" = "no" ]; then
3777 echo "You are not licensed to use this software."
3778 echo
3779 exit 1
3780 elif [ "$acceptance" = "3" ]; then
3781 more "$relpath/LICENSE.GPL3"
3782 elif [ "$acceptance" = "L" ]; then
3783 more "$relpath/LICENSE.LGPL"
3785 done
3786 elif [ "$Edition" = "Preview" ]; then
3787 TheLicense=`head -n 1 "$relpath/LICENSE.PREVIEW.COMMERCIAL"`
3788 while true; do
3790 if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
3791 echo "You have already accepted the terms of the $LicenseType license."
3792 acceptance=yes
3793 else
3794 echo "You are licensed to use this software under the terms of"
3795 echo "the $TheLicense"
3796 echo
3797 echo "Type '?' to read the Preview License."
3798 echo "Type 'yes' to accept this license offer."
3799 echo "Type 'no' to decline this license offer."
3800 echo
3801 if echo '\c' | grep '\c' >/dev/null; then
3802 echo -n "Do you accept the terms of the license? "
3803 else
3804 echo "Do you accept the terms of the license? \c"
3806 read acceptance
3808 echo
3809 if [ "$acceptance" = "yes" ]; then
3810 break
3811 elif [ "$acceptance" = "no" ] ;then
3812 echo "You are not licensed to use this software."
3813 echo
3814 exit 0
3815 elif [ "$acceptance" = "?" ]; then
3816 more "$relpath/LICENSE.PREVIEW.COMMERCIAL"
3818 done
3819 elif [ "$Edition" != "OpenSource" ]; then
3820 if [ -n "$ExpiryDate" ]; then
3821 ExpiryDate=`echo $ExpiryDate | sed -e "s,-,,g" | tr -d "\n\r"`
3822 [ -z "$ExpiryDate" ] && ExpiryDate="0"
3823 Today=`date +%Y%m%d`
3824 if [ "$Today" -gt "$ExpiryDate" ]; then
3825 case "$LicenseType" in
3826 Commercial|Academic|Educational)
3827 if [ "$QT_PACKAGEDATE" -gt "$ExpiryDate" ]; then
3828 echo
3829 echo "NOTICE NOTICE NOTICE NOTICE"
3830 echo
3831 echo " Your support and upgrade period has expired."
3832 echo
3833 echo " You are no longer licensed to use this version of Qt."
3834 echo " Please contact sales@trolltech.com to renew your support"
3835 echo " and upgrades for this license."
3836 echo
3837 echo "NOTICE NOTICE NOTICE NOTICE"
3838 echo
3839 exit 1
3840 else
3841 echo
3842 echo "WARNING WARNING WARNING WARNING"
3843 echo
3844 echo " Your support and upgrade period has expired."
3845 echo
3846 echo " You may continue to use your last licensed release"
3847 echo " of Qt under the terms of your existing license"
3848 echo " agreement. But you are not entitled to technical"
3849 echo " support, nor are you entitled to use any more recent"
3850 echo " Qt releases."
3851 echo
3852 echo " Please contact sales@trolltech.com to renew your"
3853 echo " support and upgrades for this license."
3854 echo
3855 echo "WARNING WARNING WARNING WARNING"
3856 echo
3857 sleep 3
3860 Evaluation|*)
3861 echo
3862 echo "NOTICE NOTICE NOTICE NOTICE"
3863 echo
3864 echo " Your Evaluation license has expired."
3865 echo
3866 echo " You are no longer licensed to use this software. Please"
3867 echo " contact sales@trolltech.com to purchase license, or install"
3868 echo " the Qt Open Source Edition if you intend to develop free"
3869 echo " software."
3870 echo
3871 echo "NOTICE NOTICE NOTICE NOTICE"
3872 echo
3873 exit 1
3875 esac
3878 TheLicense=`head -n 1 "$outpath/LICENSE"`
3879 while true; do
3880 if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
3881 echo "You have already accepted the terms of the $TheLicense."
3882 acceptance=yes
3883 else
3884 echo "You are licensed to use this software under the terms of"
3885 echo "the $TheLicense."
3886 echo
3887 echo "Type '?' to view the $TheLicense."
3888 echo "Type 'yes' to accept this license offer."
3889 echo "Type 'no' to decline this license offer."
3890 echo
3891 if echo '\c' | grep '\c' >/dev/null; then
3892 echo -n "Do you accept the terms of the $TheLicense? "
3893 else
3894 echo "Do you accept the terms of the $TheLicense? \c"
3896 read acceptance
3898 echo
3899 if [ "$acceptance" = "yes" ]; then
3900 break
3901 elif [ "$acceptance" = "no" ]; then
3902 echo "You are not licensed to use this software."
3903 echo
3904 exit 1
3905 else [ "$acceptance" = "?" ]
3906 more "$outpath/LICENSE"
3908 done
3911 # this should be moved somewhere else
3912 case "$PLATFORM" in
3913 aix-*)
3914 AIX_VERSION=`uname -v`
3915 if [ "$AIX_VERSION" -lt "5" ]; then
3916 QMakeVar add QMAKE_LIBS_X11 -lbind
3921 esac
3923 #-------------------------------------------------------------------------------
3924 # generate qconfig.cpp
3925 #-------------------------------------------------------------------------------
3926 [ -d "$outpath/src/corelib/global" ] || mkdir -p "$outpath/src/corelib/global"
3928 LICENSE_USER_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_lcnsuser=$Licensee"`
3929 LICENSE_PRODUCTS_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_lcnsprod=$Edition"`
3930 PREFIX_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_prfxpath=$QT_INSTALL_PREFIX"`
3931 DOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_INSTALL_DOCS"`
3932 HEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_INSTALL_HEADERS"`
3933 LIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_INSTALL_LIBS"`
3934 BINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_INSTALL_BINS"`
3935 PLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_INSTALL_PLUGINS"`
3936 DATA_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_datapath=$QT_INSTALL_DATA"`
3937 TRANSLATIONS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_trnspath=$QT_INSTALL_TRANSLATIONS"`
3938 SETTINGS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_stngpath=$QT_INSTALL_SETTINGS"`
3939 EXAMPLES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_xmplpath=$QT_INSTALL_EXAMPLES"`
3940 DEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INSTALL_DEMOS"`
3942 cat > "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3943 /* License Info */
3944 static const char qt_configure_licensee_str [256 + 12] = "$LICENSE_USER_STR";
3945 static const char qt_configure_licensed_products_str [256 + 12] = "$LICENSE_PRODUCTS_STR";
3948 if [ ! -z "$QT_HOST_PREFIX" ]; then
3949 HOSTPREFIX_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_prfxpath=$QT_HOST_PREFIX"`
3950 HOSTDOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_HOST_PREFIX/doc"`
3951 HOSTHEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_HOST_PREFIX/include"`
3952 HOSTLIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_HOST_PREFIX/lib"`
3953 HOSTBINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_HOST_PREFIX/bin"`
3954 HOSTPLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_HOST_PREFIX/plugins"`
3955 HOSTDATA_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_datapath=$QT_HOST_PREFIX"`
3956 HOSTTRANSLATIONS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_trnspath=$QT_HOST_PREFIX/translations"`
3957 HOSTSETTINGS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_stngpath=$QT_INSTALL_SETTINGS"`
3958 HOSTEXAMPLES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_xmplpath=$QT_INSTALL_EXAMPLES"`
3959 HOSTDEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INSTALL_DEMOS"`
3961 cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3963 #if defined(QT_BOOTSTRAPPED) || defined(QT_BUILD_QMAKE)
3964 /* Installation Info */
3965 static const char qt_configure_prefix_path_str [256 + 12] = "$HOSTPREFIX_PATH_STR";
3966 static const char qt_configure_documentation_path_str[256 + 12] = "$HOSTDOCUMENTATION_PATH_STR";
3967 static const char qt_configure_headers_path_str [256 + 12] = "$HOSTHEADERS_PATH_STR";
3968 static const char qt_configure_libraries_path_str [256 + 12] = "$HOSTLIBRARIES_PATH_STR";
3969 static const char qt_configure_binaries_path_str [256 + 12] = "$HOSTBINARIES_PATH_STR";
3970 static const char qt_configure_plugins_path_str [256 + 12] = "$HOSTPLUGINS_PATH_STR";
3971 static const char qt_configure_data_path_str [256 + 12] = "$HOSTDATA_PATH_STR";
3972 static const char qt_configure_translations_path_str [256 + 12] = "$HOSTTRANSLATIONS_PATH_STR";
3973 static const char qt_configure_settings_path_str [256 + 12] = "$HOSTSETTINGS_PATH_STR";
3974 static const char qt_configure_examples_path_str [256 + 12] = "$HOSTEXAMPLES_PATH_STR";
3975 static const char qt_configure_demos_path_str [256 + 12] = "$HOSTDEMOS_PATH_STR";
3976 #else // QT_BOOTSTRAPPED
3980 cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3981 /* Installation Info */
3982 static const char qt_configure_prefix_path_str [256 + 12] = "$PREFIX_PATH_STR";
3983 static const char qt_configure_documentation_path_str[256 + 12] = "$DOCUMENTATION_PATH_STR";
3984 static const char qt_configure_headers_path_str [256 + 12] = "$HEADERS_PATH_STR";
3985 static const char qt_configure_libraries_path_str [256 + 12] = "$LIBRARIES_PATH_STR";
3986 static const char qt_configure_binaries_path_str [256 + 12] = "$BINARIES_PATH_STR";
3987 static const char qt_configure_plugins_path_str [256 + 12] = "$PLUGINS_PATH_STR";
3988 static const char qt_configure_data_path_str [256 + 12] = "$DATA_PATH_STR";
3989 static const char qt_configure_translations_path_str [256 + 12] = "$TRANSLATIONS_PATH_STR";
3990 static const char qt_configure_settings_path_str [256 + 12] = "$SETTINGS_PATH_STR";
3991 static const char qt_configure_examples_path_str [256 + 12] = "$EXAMPLES_PATH_STR";
3992 static const char qt_configure_demos_path_str [256 + 12] = "$DEMOS_PATH_STR";
3995 if [ ! -z "$QT_HOST_PREFIX" ]; then
3996 cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
3997 #endif // QT_BOOTSTRAPPED
4002 cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
4003 /* strlen( "qt_lcnsxxxx" ) == 12 */
4004 #define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;
4005 #define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;
4006 #define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12;
4007 #define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12;
4008 #define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12;
4009 #define QT_CONFIGURE_LIBRARIES_PATH qt_configure_libraries_path_str + 12;
4010 #define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12;
4011 #define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12;
4012 #define QT_CONFIGURE_DATA_PATH qt_configure_data_path_str + 12;
4013 #define QT_CONFIGURE_TRANSLATIONS_PATH qt_configure_translations_path_str + 12;
4014 #define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;
4015 #define QT_CONFIGURE_EXAMPLES_PATH qt_configure_examples_path_str + 12;
4016 #define QT_CONFIGURE_DEMOS_PATH qt_configure_demos_path_str + 12;
4019 # avoid unecessary rebuilds by copying only if qconfig.cpp has changed
4020 if cmp -s "$outpath/src/corelib/global/qconfig.cpp" "$outpath/src/corelib/global/qconfig.cpp.new"; then
4021 rm -f "$outpath/src/corelib/global/qconfig.cpp.new"
4022 else
4023 [ -f "$outpath/src/corelib/global/qconfig.cpp" ] && chmod +w "$outpath/src/corelib/global/qconfig.cpp"
4024 mv "$outpath/src/corelib/global/qconfig.cpp.new" "$outpath/src/corelib/global/qconfig.cpp"
4025 chmod -w "$outpath/src/corelib/global/qconfig.cpp"
4028 # -----------------------------------------------------------------------------
4029 # build qmake
4030 # -----------------------------------------------------------------------------
4032 # symlink includes
4033 if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt" ]; then
4034 SYNCQT_OPTS=
4035 [ "$CFG_DEV" = "yes" ] && SYNCQT_OPTS="$SYNCQT_OPTS -check-includes"
4036 if [ "$OPT_SHADOW" = "yes" ]; then
4037 "$outpath/bin/syncqt" $SYNCQT_OPTS
4038 elif [ "$CFG_DEV" = "yes" ] || [ ! -d $relpath/include ]; then
4039 QTDIR="$relpath" perl "$outpath/bin/syncqt" $SYNCQT_OPTS
4043 # $1: variable name
4044 # $2: optional transformation
4045 # relies on $QMAKESPEC, $COMPILER_CONF and $mkfile being set correctly, as the latter
4046 # is where the resulting variable is written to
4047 setBootstrapVariable()
4049 variableRegExp="^$1[^_A-Z0-9]"
4050 getQMakeConf | grep "$variableRegExp" | ( [ -n "$2" ] && sed "$2" ; [ -z "$2" ] && cat ) | $AWK '
4052 varLength = index($0, "=") - 1
4053 valStart = varLength + 2
4054 if (substr($0, varLength, 1) == "+") {
4055 varLength = varLength - 1
4056 valStart = valStart + 1
4058 var = substr($0, 0, varLength)
4059 gsub("[ \t]+", "", var)
4060 val = substr($0, valStart)
4061 printf "%s_%s = %s\n", var, NR, val
4063 END {
4064 if (length(var) > 0) {
4065 printf "%s =", var
4066 for (i = 1; i <= NR; ++i)
4067 printf " $(%s_%s)", var, i
4068 printf "\n"
4070 }' >> "$mkfile"
4073 # build qmake
4074 if true; then ###[ '!' -f "$outpath/bin/qmake" ];
4075 echo "Creating qmake. Please wait..."
4077 OLD_QCONFIG_H=
4078 QCONFIG_H="$outpath/src/corelib/global/qconfig.h"
4079 QMAKE_QCONFIG_H="${QCONFIG_H}.qmake"
4080 if [ -f "$QCONFIG_H" ]; then
4081 OLD_QCONFIG_H=$QCONFIG_H
4082 mv -f "$OLD_QCONFIG_H" "${OLD_QCONFIG_H}.old"
4085 # create temporary qconfig.h for compiling qmake, if it doesn't exist
4086 # when building qmake, we use #defines for the install paths,
4087 # however they are real functions in the library
4088 if [ '!' -f "$QMAKE_QCONFIG_H" ]; then
4089 mkdir -p "$outpath/src/corelib/global"
4090 [ -f "$QCONFIG_H" ] && chmod +w "$QCONFIG_H"
4091 echo "/* All features enabled while building qmake */" >"$QMAKE_QCONFIG_H"
4094 mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
4095 for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
4096 if [ '!' -f "$conf" ]; then
4097 ln -s "$QCONFIG_H" "$conf"
4099 done
4101 #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
4102 rm -f mkspecs/default
4103 ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
4104 # fix makefiles
4105 for mkfile in GNUmakefile Makefile; do
4106 EXTRA_LFLAGS=
4107 EXTRA_CFLAGS=
4108 in_mkfile="${mkfile}.in"
4109 if [ "$mkfile" = "Makefile" ]; then
4110 # if which qmake >/dev/null 2>&1 && [ -f qmake/qmake.pro ]; then
4111 # (cd qmake && qmake) >/dev/null 2>&1 && continue
4112 # fi
4113 in_mkfile="${mkfile}.unix"
4115 in_mkfile="$relpath/qmake/$in_mkfile"
4116 mkfile="$outpath/qmake/$mkfile"
4117 if [ -f "$mkfile" ]; then
4118 [ "$CFG_DEV" = "yes" ] && "$WHICH" chflags >/dev/null 2>&1 && chflags nouchg "$mkfile"
4119 rm -f "$mkfile"
4121 [ -f "$in_mkfile" ] || continue
4123 echo "########################################################################" > "$mkfile"
4124 echo "## This file was autogenerated by configure, all changes will be lost ##" >> "$mkfile"
4125 echo "########################################################################" >> "$mkfile"
4126 EXTRA_OBJS=
4127 EXTRA_SRCS=
4128 EXTRA_CFLAGS="\$(QMAKE_CFLAGS)"
4129 EXTRA_CXXFLAGS="\$(QMAKE_CXXFLAGS)"
4130 EXTRA_LFLAGS="\$(QMAKE_LFLAGS)"
4132 if [ "$PLATFORM" = "irix-cc" ] || [ "$PLATFORM" = "irix-cc-64" ]; then
4133 EXTRA_LFLAGS="$EXTRA_LFLAGS -lm"
4136 [ -n "$CC" ] && echo "CC = $CC" >> "$mkfile"
4137 [ -n "$CXX" ] && echo "CXX = $CXX" >> "$mkfile"
4138 if [ "$CFG_SILENT" = "yes" ]; then
4139 [ -z "$CC" ] && setBootstrapVariable QMAKE_CC 's,QMAKE_CC.*=,CC=\@,'
4140 [ -z "$CXX" ] && setBootstrapVariable QMAKE_CXX 's,QMAKE_CXX.*=,CXX=\@,'
4141 else
4142 [ -z "$CC" ] && setBootstrapVariable QMAKE_CC 's,QMAKE_CC,CC,'
4143 [ -z "$CXX" ] && setBootstrapVariable QMAKE_CXX 's,QMAKE_CXX,CXX,'
4145 setBootstrapVariable QMAKE_CFLAGS
4146 setBootstrapVariable QMAKE_CXXFLAGS 's,\$\$QMAKE_CFLAGS,\$(QMAKE_CFLAGS),'
4147 setBootstrapVariable QMAKE_LFLAGS
4149 if [ $QT_EDITION = "QT_EDITION_OPENSOURCE" ]; then
4150 EXTRA_CFLAGS="$EXTRA_CFLAGS -DQMAKE_OPENSOURCE_EDITION"
4151 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -DQMAKE_OPENSOURCE_EDITION"
4153 if [ "$CFG_RELEASE_QMAKE" = "yes" ]; then
4154 setBootstrapVariable QMAKE_CFLAGS_RELEASE
4155 setBootstrapVariable QMAKE_CXXFLAGS_RELEASE 's,\$\$QMAKE_CFLAGS_RELEASE,\$(QMAKE_CFLAGS_RELEASE),'
4156 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
4157 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_RELEASE)"
4158 elif [ "$CFG_DEBUG" = "yes" ]; then
4159 setBootstrapVariable QMAKE_CFLAGS_DEBUG
4160 setBootstrapVariable QMAKE_CXXFLAGS_DEBUG 's,\$\$QMAKE_CFLAGS_DEBUG,\$(QMAKE_CFLAGS_DEBUG),'
4161 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_DEBUG)"
4162 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_DEBUG)"
4165 if [ '!' -z "$RPATH_FLAGS" ] && [ '!' -z "`getQMakeConf \"$QMAKESPEC\" | grep QMAKE_RPATH | awk '{print $3;}'`" ]; then
4166 setBootstrapVariable QMAKE_RPATH 's,\$\$LITERAL_WHITESPACE, ,'
4167 for rpath in $RPATH_FLAGS; do
4168 EXTRA_LFLAGS="\$(QMAKE_RPATH)\"$rpath\" $EXTRA_LFLAGS"
4169 done
4171 if [ "$PLATFORM_MAC" = "yes" ]; then
4172 echo "export MACOSX_DEPLOYMENT_TARGET = 10.4" >> "$mkfile"
4173 echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
4174 echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"
4175 EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
4176 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(CARBON_CFLAGS)"
4177 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
4178 EXTRA_OBJS="qsettings_mac.o qcore_mac.o"
4179 EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\""
4180 if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then # matches both x86 and x86_64
4181 X86_CFLAGS="-arch i386"
4182 X86_LFLAGS="-arch i386"
4183 EXTRA_CFLAGS="$X86_CFLAGS $EXTRA_CFLAGS"
4184 EXTRA_CXXFLAGS="$X86_CFLAGS $EXTRA_CXXFLAGS"
4185 EXTRA_LFLAGS="$EXTRA_LFLAGS $X86_LFLAGS"
4187 if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then # matches both ppc and ppc64
4188 PPC_CFLAGS="-arch ppc"
4189 PPC_LFLAGS="-arch ppc"
4190 EXTRA_CFLAGS="$PPC_CFLAGS $EXTRA_CFLAGS"
4191 EXTRA_CXXFLAGS="$PPC_CFLAGS $EXTRA_CXXFLAGS"
4192 EXTRA_LFLAGS="$EXTRA_LFLAGS $PPC_LFLAGS"
4194 if [ '!' -z "$CFG_SDK" ]; then
4195 echo "SDK_LFLAGS =-Wl,-syslibroot,$CFG_SDK" >>"$mkfile"
4196 echo "SDK_CFLAGS =-isysroot $CFG_SDK" >>"$mkfile"
4197 EXTRA_CFLAGS="$EXTRA_CFLAGS \$(SDK_CFLAGS)"
4198 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(SDK_CFLAGS)"
4199 EXTRA_LFLAGS="$EXTRA_LFLAGS \$(SDK_LFLAGS)"
4202 [ "$CFG_EMBEDDED" != "no" ] && EXTRA_CFLAGS="$EXTRA_CFLAGS -DQWS"
4203 if [ '!' -z "$D_FLAGS" ]; then
4204 for DEF in $D_FLAGS; do
4205 EXTRA_CFLAGS="$EXTRA_CFLAGS \"-D${DEF}\""
4206 done
4208 QMAKE_BIN_DIR="$QT_INSTALL_BINS"
4209 [ -z "$QMAKE_BIN_DIR" ] && QMAKE_BIN_DIR="${QT_INSTALL_PREFIX}/bin"
4210 QMAKE_DATA_DIR="$QT_INSTALL_DATA"
4211 [ -z "$QMAKE_DATA_DIR" ] && QMAKE_DATA_DIR="${QT_INSTALL_PREFIX}"
4212 echo >>"$mkfile"
4213 adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`
4214 adjoutpath=`echo "$outpath" | sed 's/ /\\\\\\\\ /g'`
4215 adjqmakespec=`echo "$QMAKESPEC" | sed 's/ /\\\\\\\\ /g'`
4216 sed -e "s,@SOURCE_PATH@,$adjrelpath,g" -e "s,@BUILD_PATH@,$adjoutpath,g" \
4217 -e "s,@QMAKE_CFLAGS@,$EXTRA_CFLAGS,g" -e "s,@QMAKE_LFLAGS@,$EXTRA_LFLAGS,g" \
4218 -e "s,@QMAKE_CXXFLAGS@,$EXTRA_CXXFLAGS,g" \
4219 -e "s,@QT_INSTALL_BINS@,\$(INSTALL_ROOT)$QMAKE_BIN_DIR,g" \
4220 -e "s,@QT_INSTALL_DATA@,\$(INSTALL_ROOT)$QMAKE_DATA_DIR,g" \
4221 -e "s,@QMAKE_QTOBJS@,$EXTRA_OBJS,g" -e "s,@QMAKE_QTSRCS@,$EXTRA_SRCS,g" \
4222 -e "s,@QMAKESPEC@,$adjqmakespec,g" "$in_mkfile" >>"$mkfile"
4224 if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
4225 (cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
4226 sed "s,^.*/\([^/]*.o\):,\1:,g" "$mkfile" >"$mkfile.tmp"
4227 sed "s,$outpath,$adjoutpath,g" "$mkfile.tmp" >"$mkfile"
4228 rm "$mkfile.tmp"
4230 done
4232 QMAKE_BUILD_ERROR=no
4233 (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes
4234 [ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake
4235 [ '!' -z "$OLD_QCONFIG_H" ] && mv -f "${OLD_QCONFIG_H}.old" "$OLD_QCONFIG_H" #put back qconfig.h
4236 [ "$QMAKE_BUILD_ERROR" = "yes" ] && exit 2
4237 fi # Build qmake
4239 #-------------------------------------------------------------------------------
4240 # tests that need qmake
4241 #-------------------------------------------------------------------------------
4243 # detect availability of float math.h functions
4244 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/floatmath "floatmath" $L_FLAGS $I_FLAGS $l_FLAGS; then
4245 CFG_USE_FLOATMATH=yes
4246 else
4247 CFG_USE_FLOATMATH=no
4250 # detect mmx support
4251 if [ "${CFG_MMX}" = "auto" ]; then
4252 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mmx "mmx" $L_FLAGS $I_FLAGS $l_FLAGS "-mmmx"; then
4253 CFG_MMX=yes
4254 else
4255 CFG_MMX=no
4259 # detect 3dnow support
4260 if [ "${CFG_3DNOW}" = "auto" ]; then
4261 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/3dnow "3dnow" $L_FLAGS $I_FLAGS $l_FLAGS "-m3dnow"; then
4262 CFG_3DNOW=yes
4263 else
4264 CFG_3DNOW=no
4268 # detect sse support
4269 if [ "${CFG_SSE}" = "auto" ]; then
4270 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse "sse" $L_FLAGS $I_FLAGS $l_FLAGS "-msse"; then
4271 CFG_SSE=yes
4272 else
4273 CFG_SSE=no
4277 # detect sse2 support
4278 if [ "${CFG_SSE2}" = "auto" ]; then
4279 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse2 "sse2" $L_FLAGS $I_FLAGS $l_FLAGS "-msse2"; then
4280 CFG_SSE2=yes
4281 else
4282 CFG_SSE2=no
4286 # check iWMMXt support
4287 if [ "$CFG_IWMMXT" = "yes" ]; then
4288 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $l_FLAGS "-mcpu=iwmmxt"
4289 if [ $? != "0" ]; then
4290 echo "The iWMMXt functionality test failed!"
4291 echo " Please make sure your compiler supports iWMMXt intrinsics!"
4292 exit 1
4296 # detect zlib
4297 if [ "$CFG_ZLIB" = "no" ]; then
4298 # Note: Qt no longer support builds without zlib
4299 # So we force a "no" to be "auto" here.
4300 # If you REALLY really need no zlib support, you can still disable
4301 # it by doing the following:
4302 # add "no-zlib" to mkspecs/qconfig.pri
4303 # #define QT_NO_COMPRESS (probably by adding to src/corelib/global/qconfig.h)
4305 # There's no guarantee that Qt will build under those conditions
4307 CFG_ZLIB=auto
4308 ZLIB_FORCED=yes
4310 if [ "$CFG_ZLIB" = "auto" ]; then
4311 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/zlib "zlib" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4312 CFG_ZLIB=system
4313 else
4314 CFG_ZLIB=yes
4318 # detect how jpeg should be built
4319 if [ "$CFG_JPEG" = "auto" ]; then
4320 if [ "$CFG_SHARED" = "yes" ]; then
4321 CFG_JPEG=plugin
4322 else
4323 CFG_JPEG=yes
4326 # detect jpeg
4327 if [ "$CFG_LIBJPEG" = "auto" ]; then
4328 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libjpeg "libjpeg" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4329 CFG_LIBJPEG=system
4330 else
4331 CFG_LIBJPEG=qt
4335 # detect how gif should be built
4336 if [ "$CFG_GIF" = "auto" ]; then
4337 if [ "$CFG_SHARED" = "yes" ]; then
4338 CFG_GIF=plugin
4339 else
4340 CFG_GIF=yes
4344 # detect how tiff should be built
4345 if [ "$CFG_TIFF" = "auto" ]; then
4346 if [ "$CFG_SHARED" = "yes" ]; then
4347 CFG_TIFF=plugin
4348 else
4349 CFG_TIFF=yes
4353 # detect tiff
4354 if [ "$CFG_LIBTIFF" = "auto" ]; then
4355 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libtiff "libtiff" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4356 CFG_LIBTIFF=system
4357 else
4358 CFG_LIBTIFF=qt
4362 # detect how mng should be built
4363 if [ "$CFG_MNG" = "auto" ]; then
4364 if [ "$CFG_SHARED" = "yes" ]; then
4365 CFG_MNG=plugin
4366 else
4367 CFG_MNG=yes
4370 # detect mng
4371 if [ "$CFG_LIBMNG" = "auto" ]; then
4372 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libmng "libmng" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4373 CFG_LIBMNG=system
4374 else
4375 CFG_LIBMNG=qt
4379 # detect png
4380 if [ "$CFG_LIBPNG" = "auto" ]; then
4381 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libpng "libpng" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4382 CFG_LIBPNG=system
4383 else
4384 CFG_LIBPNG=qt
4388 # detect accessibility
4389 if [ "$CFG_ACCESSIBILITY" = "auto" ]; then
4390 CFG_ACCESSIBILITY=yes
4393 # auto-detect SQL-modules support
4394 for _SQLDR in $CFG_SQL_AVAILABLE; do
4395 case $_SQLDR in
4396 mysql)
4397 if [ "$CFG_SQL_mysql" != "no" ]; then
4398 [ -z "$CFG_MYSQL_CONFIG" ] && CFG_MYSQL_CONFIG=`"$WHICH" mysql_config`
4399 if [ -x "$CFG_MYSQL_CONFIG" ]; then
4400 QT_CFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --include 2>/dev/null`
4401 QT_LFLAGS_MYSQL_R=`$CFG_MYSQL_CONFIG --libs_r 2>/dev/null`
4402 QT_LFLAGS_MYSQL=`$CFG_MYSQL_CONFIG --libs 2>/dev/null`
4403 QT_MYSQL_VERSION=`$CFG_MYSQL_CONFIG --version 2>/dev/null`
4404 QT_MYSQL_VERSION_MAJOR=`echo $QT_MYSQL_VERSION | cut -d . -f 1`
4406 if [ -n "$QT_MYSQL_VERSION" ] && [ "$QT_MYSQL_VERSION_MAJOR" -lt 4 ]; then
4407 if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4408 echo "This version of MySql is not supported ($QT_MYSQL_VERSION)."
4409 echo " You need MySql 4 or higher."
4410 echo " If you believe this message is in error you may use the continue"
4411 echo " switch (-continue) to $0 to continue."
4412 exit 101
4413 else
4414 CFG_SQL_mysql="no"
4415 QT_LFLAGS_MYSQL=""
4416 QT_LFLAGS_MYSQL_R=""
4417 QT_CFLAGS_MYSQL=""
4419 else
4420 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 $MAC_CONFIG_TEST_COMMANDLINE; then
4421 QMakeVar add CONFIG use_libmysqlclient_r
4422 if [ "$CFG_SQL_mysql" = "auto" ]; then
4423 CFG_SQL_mysql=plugin
4425 QT_LFLAGS_MYSQL="$QT_LFLAGS_MYSQL_R"
4426 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 $MAC_CONFIG_TEST_COMMANDLINE; then
4427 if [ "$CFG_SQL_mysql" = "auto" ]; then
4428 CFG_SQL_mysql=plugin
4430 else
4431 if [ "$CFG_SQL_mysql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4432 echo "MySQL support cannot be enabled due to functionality tests!"
4433 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4434 echo " If you believe this message is in error you may use the continue"
4435 echo " switch (-continue) to $0 to continue."
4436 exit 101
4437 else
4438 CFG_SQL_mysql=no
4439 QT_LFLAGS_MYSQL=""
4440 QT_LFLAGS_MYSQL_R=""
4441 QT_CFLAGS_MYSQL=""
4447 psql)
4448 if [ "$CFG_SQL_psql" != "no" ]; then
4449 if "$WHICH" pg_config >/dev/null 2>&1; then
4450 QT_CFLAGS_PSQL=`pg_config --includedir 2>/dev/null`
4451 QT_LFLAGS_PSQL=`pg_config --libdir 2>/dev/null`
4453 [ -z "$QT_CFLAGS_PSQL" ] || QT_CFLAGS_PSQL="-I$QT_CFLAGS_PSQL"
4454 [ -z "$QT_LFLAGS_PSQL" ] || QT_LFLAGS_PSQL="-L$QT_LFLAGS_PSQL"
4455 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 $MAC_CONFIG_TEST_COMMANDLINE; then
4456 if [ "$CFG_SQL_psql" = "auto" ]; then
4457 CFG_SQL_psql=plugin
4459 else
4460 if [ "$CFG_SQL_psql" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4461 echo "PostgreSQL support cannot be enabled due to functionality tests!"
4462 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4463 echo " If you believe this message is in error you may use the continue"
4464 echo " switch (-continue) to $0 to continue."
4465 exit 101
4466 else
4467 CFG_SQL_psql=no
4468 QT_CFLAGS_PSQL=""
4469 QT_LFLAGS_PSQL=""
4474 odbc)
4475 if [ "$CFG_SQL_odbc" != "no" ]; then
4476 if [ "$PLATFORM_MAC" != "yes" ] && "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/odbc "ODBC" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4477 if [ "$CFG_SQL_odbc" = "auto" ]; then
4478 CFG_SQL_odbc=plugin
4480 else
4481 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iodbc "iODBC" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4482 QT_LFLAGS_ODBC="-liodbc"
4483 if [ "$CFG_SQL_odbc" = "auto" ]; then
4484 CFG_SQL_odbc=plugin
4486 else
4487 if [ "$CFG_SQL_odbc" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4488 echo "ODBC 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_odbc=no
4500 oci)
4501 if [ "$CFG_SQL_oci" != "no" ]; then
4502 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/oci "OCI" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4503 if [ "$CFG_SQL_oci" = "auto" ]; then
4504 CFG_SQL_oci=plugin
4506 else
4507 if [ "$CFG_SQL_oci" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4508 echo "Oracle (OCI) support cannot be enabled due to functionality tests!"
4509 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4510 echo " If you believe this message is in error you may use the continue"
4511 echo " switch (-continue) to $0 to continue."
4512 exit 101
4513 else
4514 CFG_SQL_oci=no
4519 tds)
4520 if [ "$CFG_SQL_tds" != "no" ]; then
4521 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tds "TDS" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4522 if [ "$CFG_SQL_tds" = "auto" ]; then
4523 CFG_SQL_tds=plugin
4525 else
4526 if [ "$CFG_SQL_tds" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4527 echo "TDS support cannot be enabled due to functionality tests!"
4528 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4529 echo " If you believe this message is in error you may use the continue"
4530 echo " switch (-continue) to $0 to continue."
4531 exit 101
4532 else
4533 CFG_SQL_tds=no
4538 db2)
4539 if [ "$CFG_SQL_db2" != "no" ]; then
4540 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/db2 "DB2" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4541 if [ "$CFG_SQL_db2" = "auto" ]; then
4542 CFG_SQL_db2=plugin
4544 else
4545 if [ "$CFG_SQL_db2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4546 echo "ODBC support cannot be enabled due to functionality tests!"
4547 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4548 echo " If you believe this message is in error you may use the continue"
4549 echo " switch (-continue) to $0 to continue."
4550 exit 101
4551 else
4552 CFG_SQL_db2=no
4557 ibase)
4558 if [ "$CFG_SQL_ibase" != "no" ]; then
4559 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ibase "InterBase" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4560 if [ "$CFG_SQL_ibase" = "auto" ]; then
4561 CFG_SQL_ibase=plugin
4563 else
4564 if [ "$CFG_SQL_ibase" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4565 echo "InterBase support cannot be enabled due to functionality tests!"
4566 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4567 echo " If you believe this message is in error you may use the continue"
4568 echo " switch (-continue) to $0 to continue."
4569 exit 101
4570 else
4571 CFG_SQL_ibase=no
4576 sqlite2)
4577 if [ "$CFG_SQL_sqlite2" != "no" ]; then
4578 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sqlite2 "SQLite2" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4579 if [ "$CFG_SQL_sqlite2" = "auto" ]; then
4580 CFG_SQL_sqlite2=plugin
4582 else
4583 if [ "$CFG_SQL_sqlite2" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4584 echo "SQLite2 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_SQL_sqlite2=no
4595 sqlite)
4596 if [ "$CFG_SQL_sqlite" != "no" ]; then
4597 SQLITE_AUTODETECT_FAILED="no"
4598 if [ "$CFG_SQLITE" = "system" ]; then
4599 if [ -n "$PKG_CONFIG" ]; then
4600 QT_CFLAGS_SQLITE=`$PKG_CONFIG --cflags sqlite3 2>/dev/null`
4601 QT_LFLAGS_SQLITE=`$PKG_CONFIG --libs sqlite3 2>/dev/null`
4603 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 $MAC_CONFIG_TEST_COMMANDLINE; then
4604 if [ "$CFG_SQL_sqlite" = "auto" ]; then
4605 CFG_SQL_sqlite=plugin
4607 QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
4608 else
4609 SQLITE_AUTODETECT_FAILED="yes"
4610 CFG_SQL_sqlite=no
4612 elif [ -f "$relpath/src/3rdparty/sqlite/sqlite3.h" ]; then
4613 if [ "$CFG_SQL_sqlite" = "auto" ]; then
4614 CFG_SQL_sqlite=plugin
4616 else
4617 SQLITE_AUTODETECT_FAILED="yes"
4618 CFG_SQL_sqlite=no
4621 if [ "$SQLITE_AUTODETECT_FAILED" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4622 echo "SQLite support cannot be enabled due to functionality tests!"
4623 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4624 echo " If you believe this message is in error you may use the continue"
4625 echo " switch (-continue) to $0 to continue."
4626 exit 101
4631 if [ "$OPT_VERBOSE" = "yes" ]; then
4632 echo "unknown SQL driver: $_SQLDR"
4635 esac
4636 done
4638 # auto-detect NIS support
4639 if [ "$CFG_NIS" != "no" ]; then
4640 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/nis "NIS" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4641 CFG_NIS=yes
4642 else
4643 if [ "$CFG_NIS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4644 echo "NIS support cannot be enabled due to functionality tests!"
4645 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4646 echo " If you believe this message is in error you may use the continue"
4647 echo " switch (-continue) to $0 to continue."
4648 exit 101
4649 else
4650 CFG_NIS=no
4655 # auto-detect CUPS support
4656 if [ "$CFG_CUPS" != "no" ]; then
4657 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/cups "Cups" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4658 CFG_CUPS=yes
4659 else
4660 if [ "$CFG_CUPS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4661 echo "Cups 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_CUPS=no
4672 # auto-detect iconv(3) support
4673 if [ "$CFG_ICONV" != "no" ]; then
4674 if [ "$PLATFORM_QWS" = "yes" ]; then
4675 CFG_ICONV=no
4676 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/iconv" "POSIX iconv" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4677 CFG_ICONV=yes
4678 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/gnu-libiconv" "GNU libiconv" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
4679 CFG_ICONV=gnu
4680 else
4681 if [ "$CFG_ICONV" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4682 echo "Iconv support cannot be enabled due to functionality tests!"
4683 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4684 echo " If you believe this message is in error you may use the continue"
4685 echo " switch (-continue) to $0 to continue."
4686 exit 101
4687 else
4688 CFG_ICONV=no
4693 # auto-detect libdbus-1 support
4694 if [ "$CFG_DBUS" != "no" ]; then
4695 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then
4696 QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null`
4697 QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null`
4699 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 $MAC_CONFIG_TEST_COMMANDLINE; then
4700 [ "$CFG_DBUS" = "auto" ] && CFG_DBUS=yes
4701 QMakeVar set QT_CFLAGS_DBUS "$QT_CFLAGS_DBUS"
4702 QMakeVar set QT_LIBS_DBUS "$QT_LIBS_DBUS"
4703 else
4704 if [ "$CFG_DBUS" = "auto" ]; then
4705 CFG_DBUS=no
4706 elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4707 # CFG_DBUS is "yes" or "linked" here
4709 echo "The QtDBus module cannot be enabled because libdbus-1 version $MIN_DBUS_1_VERSION was not found."
4710 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4711 echo " If you believe this message is in error you may use the continue"
4712 echo " switch (-continue) to $0 to continue."
4713 exit 101
4718 # Generate a CRC of the namespace for using in constants for the Carbon port.
4719 # This should mean that you really *can* load two Qt's and have our custom
4720 # Carbon events work.
4721 if [ "$PLATFORM_MAC" = "yes" -a ! -z "$QT_NAMESPACE" ]; then
4722 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`
4725 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
4727 # detect EGL support
4728 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/egl" "EGL (EGL/egl.h)" $L_FLAGS $I_FLAGS $l_FLAGS; then
4729 # EGL specified by QMAKE_*_EGL, included with <EGL/egl.h>
4730 CFG_EGL=yes
4731 CFG_EGL_GLES_INCLUDES=no
4732 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/egl4gles1" "EGL (GLES/egl.h)" $L_FLAGS $I_FLAGS $l_FLAGS; then
4733 # EGL specified by QMAKE_*_EGL, included with <GLES/egl.h>
4734 CFG_EGL=yes
4735 CFG_EGL_GLES_INCLUDES=yes
4737 if ( [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es1cl" ] || [ "$CFG_OPENGL" = "es2" ] ) && [ "$CFG_EGL" != "yes" ] && [ "$PLATFORM_X11" = "yes" ]; then
4738 echo "The EGL functionality test failed!"
4739 echo " EGL is required for OpenGL ES on X11 to manage contexts & surfaces."
4740 echo " You might need to modify the include and library search paths by editing"
4741 echo " QMAKE_INCDIR_EGL, QMAKE_LIBDIR_EGL and QMAKE_LIBS_EGL in"
4742 echo " ${XQMAKESPEC}."
4743 exit 1
4747 # auto-detect Glib support
4748 if [ "$CFG_GLIB" != "no" ]; then
4749 if [ -n "$PKG_CONFIG" ]; then
4750 QT_CFLAGS_GLIB=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0 2>/dev/null`
4751 QT_LIBS_GLIB=`$PKG_CONFIG --libs glib-2.0 gthread-2.0 2>/dev/null`
4753 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
4754 CFG_GLIB=yes
4755 QMakeVar set QT_CFLAGS_GLIB "$QT_CFLAGS_GLIB"
4756 QMakeVar set QT_LIBS_GLIB "$QT_LIBS_GLIB"
4757 else
4758 if [ "$CFG_GLIB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4759 echo "Glib support cannot be enabled due to functionality tests!"
4760 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4761 echo " If you believe this message is in error you may use the continue"
4762 echo " switch (-continue) to $0 to continue."
4763 exit 101
4764 else
4765 CFG_GLIB=no
4770 if [ "$CFG_PHONON" != "no" ]; then
4771 if [ "$CFG_PHONON_BACKEND" != "no" ]; then
4772 if [ "$CFG_GLIB" = "yes" -a "$CFG_GSTREAMER" != "no" ]; then
4773 if [ -n "$PKG_CONFIG" ]; then
4774 QT_CFLAGS_GSTREAMER=`$PKG_CONFIG --cflags gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
4775 QT_LIBS_GSTREAMER=`$PKG_CONFIG --libs gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null`
4777 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
4778 CFG_GSTREAMER=yes
4779 QMakeVar set QT_CFLAGS_GSTREAMER "$QT_CFLAGS_GSTREAMER"
4780 QMakeVar set QT_LIBS_GSTREAMER "$QT_LIBS_GSTREAMER"
4781 else
4782 if [ "$CFG_GSTREAMER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4783 echo "Gstreamer support cannot be enabled due to functionality tests!"
4784 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4785 echo " If you believe this message is in error you may use the continue"
4786 echo " switch (-continue) to $0 to continue."
4787 exit 101
4788 else
4789 CFG_GSTREAMER=no
4792 elif [ "$CFG_GLIB" = "no" ]; then
4793 CFG_GSTREAMER=no
4796 if [ "$CFG_GSTREAMER" = "yes" ]; then
4797 CFG_PHONON=yes
4798 else
4799 if [ "$CFG_PHONON" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4800 echo "Phonon support cannot be enabled due to functionality tests!"
4801 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4802 echo " If you believe this message is in error you may use the continue"
4803 echo " switch (-continue) to $0 to continue."
4804 exit 101
4805 else
4806 CFG_PHONON=no
4809 else
4810 CFG_PHONON=yes
4813 fi # X11/QWS
4815 # x11
4816 if [ "$PLATFORM_X11" = "yes" ]; then
4817 x11tests="$relpath/config.tests/x11"
4818 X11TESTS_FLAGS=
4820 # work around broken X11 headers when using GCC 2.95 or later
4821 NOTYPE=no
4822 "$x11tests/notype.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath" && NOTYPE=yes
4823 if [ $NOTYPE = "yes" ]; then
4824 QMakeVar add QMAKE_CXXFLAGS -fpermissive
4825 X11TESTS_FLAGS="$X11TESTS_FLAGS -fpermissive"
4828 # Check we actually have X11 :-)
4829 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xlib "XLib" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
4830 if [ $? != "0" ]; then
4831 echo "Basic XLib functionality test failed!"
4832 echo " You might need to modify the include and library search paths by editing"
4833 echo " QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in ${XQMAKESPEC}."
4834 exit 1
4837 # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x)
4838 if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
4839 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
4840 CFG_OPENGL=desktop
4841 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
4842 CFG_OPENGL=es2
4843 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
4844 CFG_OPENGL=es1
4845 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
4846 CFG_OPENGL=es1cl
4847 else
4848 if [ "$CFG_OPENGL" = "yes" ]; then
4849 echo "All the OpenGL functionality tests failed!"
4850 echo " You might need to modify the include and library search paths by editing"
4851 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4852 echo " ${XQMAKESPEC}."
4853 exit 1
4855 CFG_OPENGL=no
4857 case "$PLATFORM" in
4858 hpux*)
4859 # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
4860 if [ "$CFG_OPENGL" = "desktop" ]; then
4861 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
4862 if [ $? != "0" ]; then
4863 QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
4869 esac
4870 elif [ "$CFG_OPENGL" = "es1cl" ]; then
4871 # OpenGL ES 1.x common lite
4872 "$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
4873 if [ $? != "0" ]; then
4874 echo "The OpenGL ES 1.x Common Lite Profile functionality test failed!"
4875 echo " You might need to modify the include and library search paths by editing"
4876 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4877 echo " ${XQMAKESPEC}."
4878 exit 1
4880 elif [ "$CFG_OPENGL" = "es1" ]; then
4881 # OpenGL ES 1.x
4882 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS
4883 if [ $? != "0" ]; then
4884 echo "The OpenGL ES 1.x functionality test failed!"
4885 echo " You might need to modify the include and library search paths by editing"
4886 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4887 echo " ${XQMAKESPEC}."
4888 exit 1
4890 elif [ "$CFG_OPENGL" = "es2" ]; then
4891 #OpenGL ES 2.x
4892 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS
4893 if [ $? != "0" ]; then
4894 echo "The OpenGL ES 2.0 functionality test failed!"
4895 echo " You might need to modify the include and library search paths by editing"
4896 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4897 echo " ${XQMAKESPEC}."
4898 exit 1
4900 elif [ "$CFG_OPENGL" = "desktop" ]; then
4901 # Desktop OpenGL support
4902 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
4903 if [ $? != "0" ]; then
4904 echo "The OpenGL functionality test failed!"
4905 echo " You might need to modify the include and library search paths by editing"
4906 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
4907 echo " ${XQMAKESPEC}."
4908 exit 1
4910 case "$PLATFORM" in
4911 hpux*)
4912 # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct.
4913 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/glxfbconfig "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS
4914 if [ $? != "0" ]; then
4915 QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT
4920 esac
4923 # if opengl is disabled and the user specified graphicssystem gl, disable it...
4924 if [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && [ "$CFG_OPENGL" = "no" ]; then
4925 echo "OpenGL Graphics System is disabled due to missing OpenGL support..."
4926 CFG_GRAPHICS_SYSTEM=default
4929 # auto-detect Xcursor support
4930 if [ "$CFG_XCURSOR" != "no" ]; then
4931 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
4932 if [ "$CFG_XCURSOR" != "runtime" ]; then
4933 CFG_XCURSOR=yes;
4935 else
4936 if [ "$CFG_XCURSOR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4937 echo "Xcursor support cannot be enabled due to functionality tests!"
4938 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4939 echo " If you believe this message is in error you may use the continue"
4940 echo " switch (-continue) to $0 to continue."
4941 exit 101
4942 else
4943 CFG_XCURSOR=no
4948 # auto-detect Xfixes support
4949 if [ "$CFG_XFIXES" != "no" ]; then
4950 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xfixes "Xfixes" $L_FLAGS $I_FLAGS $X11TESTS_FLAGS; then
4951 if [ "$CFG_XFIXES" != "runtime" ]; then
4952 CFG_XFIXES=yes;
4954 else
4955 if [ "$CFG_XFIXES" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4956 echo "Xfixes support cannot be enabled due to functionality tests!"
4957 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4958 echo " If you believe this message is in error you may use the continue"
4959 echo " switch (-continue) to $0 to continue."
4960 exit 101
4961 else
4962 CFG_XFIXES=no
4967 # auto-detect Xrandr support (resize and rotate extension)
4968 if [ "$CFG_XRANDR" != "no" ]; then
4969 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
4970 if [ "$CFG_XRANDR" != "runtime" ]; then
4971 CFG_XRANDR=yes
4973 else
4974 if [ "$CFG_XRANDR" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4975 echo "Xrandr support cannot be enabled due to functionality tests!"
4976 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4977 echo " If you believe this message is in error you may use the continue"
4978 echo " switch (-continue) to $0 to continue."
4979 exit 101
4980 else
4981 CFG_XRANDR=no
4986 # auto-detect Xrender support
4987 if [ "$CFG_XRENDER" != "no" ]; then
4988 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
4989 CFG_XRENDER=yes
4990 else
4991 if [ "$CFG_XRENDER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
4992 echo "Xrender support cannot be enabled due to functionality tests!"
4993 echo " Turn on verbose messaging (-v) to $0 to see the final report."
4994 echo " If you believe this message is in error you may use the continue"
4995 echo " switch (-continue) to $0 to continue."
4996 exit 101
4997 else
4998 CFG_XRENDER=no
5003 # auto-detect MIT-SHM support
5004 if [ "$CFG_MITSHM" != "no" ]; then
5005 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
5006 CFG_MITSHM=yes
5007 else
5008 if [ "$CFG_MITSHM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5009 echo "MITSHM support cannot be enabled due to functionality tests!"
5010 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5011 echo " If you believe this message is in error you may use the continue"
5012 echo " switch (-continue) to $0 to continue."
5013 exit 101
5014 else
5015 CFG_MITSHM=no
5020 # auto-detect FontConfig support
5021 if [ "$CFG_FONTCONFIG" != "no" ]; then
5022 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig 2>/dev/null; then
5023 QT_CFLAGS_FONTCONFIG=`$PKG_CONFIG --cflags fontconfig 2>/dev/null`
5024 QT_LIBS_FONTCONFIG=`$PKG_CONFIG --libs fontconfig 2>/dev/null`
5025 else
5026 QT_CFLAGS_FONTCONFIG=
5027 QT_LIBS_FONTCONFIG="-lfreetype -lfontconfig"
5029 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
5030 CFG_FONTCONFIG=yes
5031 QMakeVar set QMAKE_CFLAGS_X11 "$QT_CFLAGS_FONTCONFIG \$\$QMAKE_CFLAGS_X11"
5032 QMakeVar set QMAKE_LIBS_X11 "$QT_LIBS_FONTCONFIG \$\$QMAKE_LIBS_X11"
5033 CFG_LIBFREETYPE=system
5034 else
5035 if [ "$CFG_FONTCONFIG" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5036 echo "FontConfig support cannot be enabled due to functionality tests!"
5037 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5038 echo " If you believe this message is in error you may use the continue"
5039 echo " switch (-continue) to $0 to continue."
5040 exit 101
5041 else
5042 CFG_FONTCONFIG=no
5047 # auto-detect Session Management support
5048 if [ "$CFG_SM" = "auto" ]; then
5049 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
5050 CFG_SM=yes
5051 else
5052 if [ "$CFG_SM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5053 echo "Session Management support cannot be enabled due to functionality tests!"
5054 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5055 echo " If you believe this message is in error you may use the continue"
5056 echo " switch (-continue) to $0 to continue."
5057 exit 101
5058 else
5059 CFG_SM=no
5064 # auto-detect SHAPE support
5065 if [ "$CFG_XSHAPE" != "no" ]; then
5066 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
5067 CFG_XSHAPE=yes
5068 else
5069 if [ "$CFG_XSHAPE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5070 echo "XShape support cannot be enabled due to functionality tests!"
5071 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5072 echo " If you believe this message is in error you may use the continue"
5073 echo " switch (-continue) to $0 to continue."
5074 exit 101
5075 else
5076 CFG_XSHAPE=no
5081 # auto-detect XSync support
5082 if [ "$CFG_XSYNC" != "no" ]; then
5083 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xsync "XSync" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
5084 CFG_XSYNC=yes
5085 else
5086 if [ "$CFG_XSYNC" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5087 echo "XSync support cannot be enabled due to functionality tests!"
5088 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5089 echo " If you believe this message is in error you may use the continue"
5090 echo " switch (-continue) to $0 to continue."
5091 exit 101
5092 else
5093 CFG_XSYNC=no
5098 # auto-detect Xinerama support
5099 if [ "$CFG_XINERAMA" != "no" ]; then
5100 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
5101 if [ "$CFG_XINERAMA" != "runtime" ]; then
5102 CFG_XINERAMA=yes
5104 else
5105 if [ "$CFG_XINERAMA" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5106 echo "Xinerama support cannot be enabled due to functionality tests!"
5107 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5108 echo " If you believe this message is in error you may use the continue"
5109 echo " switch (-continue) to $0 to continue."
5110 exit 101
5111 else
5112 CFG_XINERAMA=no
5117 # auto-detect Xinput support
5118 if [ "$CFG_XINPUT" != "no" ]; then
5119 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
5120 if [ "$CFG_XINPUT" != "runtime" ]; then
5121 CFG_XINPUT=yes
5123 else
5124 if [ "$CFG_XINPUT" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5125 echo "Tablet and Xinput support cannot be enabled due to functionality tests!"
5126 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5127 echo " If you believe this message is in error you may use the continue"
5128 echo " switch (-continue) to $0 to continue."
5129 exit 101
5130 else
5131 CFG_XINPUT=no
5136 # auto-detect XKB support
5137 if [ "$CFG_XKB" != "no" ]; then
5138 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
5139 CFG_XKB=yes
5140 else
5141 if [ "$CFG_XKB" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5142 echo "XKB support cannot be enabled due to functionality tests!"
5143 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5144 echo " If you believe this message is in error you may use the continue"
5145 echo " switch (-continue) to $0 to continue."
5146 exit 101
5147 else
5148 CFG_XKB=no
5153 if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then
5154 if [ -n "$PKG_CONFIG" ]; then
5155 QT_CFLAGS_QGTKSTYLE=`$PKG_CONFIG --cflags gtk+-2.0 ">=" 2.10 atk 2>/dev/null`
5156 QT_LIBS_QGTKSTYLE=`$PKG_CONFIG --libs gobject-2.0 2>/dev/null`
5158 if [ -n "$QT_CFLAGS_QGTKSTYLE" ] ; then
5159 CFG_QGTKSTYLE=yes
5160 QMakeVar set QT_CFLAGS_QGTKSTYLE "$QT_CFLAGS_QGTKSTYLE"
5161 QMakeVar set QT_LIBS_QGTKSTYLE "$QT_LIBS_QGTKSTYLE"
5162 else
5163 if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5164 echo "Gtk theme support cannot be enabled due to functionality tests!"
5165 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5166 echo " If you believe this message is in error you may use the continue"
5167 echo " switch (-continue) to $0 to continue."
5168 exit 101
5169 else
5170 CFG_QGTKSTYLE=no
5173 elif [ "$CFG_GLIB" = "no" ]; then
5174 CFG_QGTKSTYLE=no
5176 fi # X11
5179 if [ "$PLATFORM_MAC" = "yes" ]; then
5180 if [ "$CFG_PHONON" != "no" ]; then
5181 # Always enable Phonon (unless it was explicitly disabled)
5182 CFG_PHONON=yes
5186 # QWS
5187 if [ "$PLATFORM_QWS" = "yes" ]; then
5189 # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x)
5190 if [ "$CFG_OPENGL" = "yes" ]; then
5191 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
5192 CFG_OPENGL=es2
5193 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
5194 CFG_OPENGL=es1
5195 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
5196 CFG_OPENGL=es1cl
5197 else
5198 echo "All the OpenGL ES functionality tests failed!"
5199 echo " You might need to modify the include and library search paths by editing"
5200 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5201 echo " ${XQMAKESPEC}."
5202 exit 1
5204 elif [ "$CFG_OPENGL" = "es1" ]; then
5205 # OpenGL ES 1.x
5206 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS
5207 if [ $? != "0" ]; then
5208 echo "The OpenGL ES 1.x functionality test failed!"
5209 echo " You might need to modify the include and library search paths by editing"
5210 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5211 echo " ${XQMAKESPEC}."
5212 exit 1
5214 elif [ "$CFG_OPENGL" = "es2" ]; then
5215 #OpenGL ES 2.x
5216 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS
5217 if [ $? != "0" ]; then
5218 echo "The OpenGL ES 2.0 functionality test failed!"
5219 echo " You might need to modify the include and library search paths by editing"
5220 echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
5221 echo " ${XQMAKESPEC}."
5222 exit 1
5224 elif [ "$CFG_OPENGL" = "desktop" ]; then
5225 # Desktop OpenGL support
5226 echo "Desktop OpenGL support is not avaliable on Qt for Embedded Linux"
5227 exit 1
5230 # screen drivers
5231 for screen in ${CFG_GFX_ON} ${CFG_GFX_PLUGIN}; do
5232 if [ "${screen}" = "ahi" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5233 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/ahi "Ahi" $L_FLAGS $I_FLAGS $l_FLAGS
5234 if [ $? != "0" ]; then
5235 echo "The Ahi screen driver functionality test failed!"
5236 echo " You might need to modify the include and library search paths by editing"
5237 echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
5238 echo " ${XQMAKESPEC}."
5239 exit 1
5243 if [ "${screen}" = "svgalib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5244 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/svgalib "SVGAlib" $L_FLAGS $I_FLAGS $l_FLAGS
5245 if [ $? != "0" ]; then
5246 echo "The SVGAlib screen driver functionality test failed!"
5247 echo " You might need to modify the include and library search paths by editing"
5248 echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
5249 echo " ${XQMAKESPEC}."
5250 exit 1
5254 if [ "${screen}" = "directfb" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5255 if [ -n "$PKG_CONFIG" ]; then
5256 if $PKG_CONFIG --exists directfb 2>/dev/null; then
5257 QT_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
5258 QT_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
5259 elif directfb-config --version >/dev/null 2>&1; then
5260 QT_CFLAGS_DIRECTFB=`directfb-config --cflags 2>/dev/null`
5261 QT_LIBS_DIRECTFB=`directfb-config --libs 2>/dev/null`
5265 # QMake variables set here override those in the mkspec. Therefore we only set the variables here if they are not zero.
5266 if [ -n "$QT_CFLAGS_DIRECTFB" ] || [ -n "$QT_LIBS_DIRECTFB" ]; then
5267 QMakeVar set QT_CFLAGS_DIRECTFB "$QT_CFLAGS_DIRECTFB"
5268 QMakeVar set QT_LIBS_DIRECTFB "$QT_LIBS_DIRECTFB"
5270 if [ "$CFG_QT3SUPPORT" = "yes" ]; then
5271 QMakeVar set QT_DEFINES_DIRECTFB "QT3_SUPPORT"
5274 "$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
5275 if [ $? != "0" ]; then
5276 echo "The DirectFB screen driver functionality test failed!"
5277 echo " You might need to modify the include and library search paths by editing"
5278 echo " QT_CFLAGS_DIRECTFB and QT_LIBS_DIRECTFB in"
5279 echo " ${XQMAKESPEC}."
5280 exit 1
5284 done
5286 # mouse drivers
5287 for mouse in ${CFG_MOUSE_ON} ${CFG_MOUSE_PLUGIN}; do
5288 if [ "${mouse}" = "tslib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
5289 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tslib "tslib" $L_FLAGS $I_FLAGS $l_FLAGS
5290 if [ $? != "0" ]; then
5291 echo "The tslib functionality test failed!"
5292 echo " You might need to modify the include and library search paths by editing"
5293 echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
5294 echo " ${XQMAKESPEC}."
5295 exit 1
5298 done
5300 CFG_QGTKSTYLE=no
5302 # sound
5303 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/sound "sound" $L_FLAGS $I_FLAGS $l_FLAGS
5304 if [ $? != "0" ]; then
5305 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SOUND"
5308 fi # QWS
5310 # freetype support
5311 [ "x$CFG_EMBEDDED" != "xno" ] && CFG_LIBFREETYPE="$CFG_QWS_FREETYPE"
5312 [ "x$PLATFORM_MAC" = "xyes" ] && CFG_LIBFREETYPE=no
5313 if [ "$CFG_LIBFREETYPE" = "auto" ]; then
5314 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/freetype "FreeType" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
5315 CFG_LIBFREETYPE=system
5316 else
5317 CFG_LIBFREETYPE=yes
5321 if [ "$CFG_ENDIAN" = "auto" ]; then
5322 if [ "$PLATFORM_MAC" = "yes" ]; then
5323 true #leave as auto
5324 else
5325 "$unixtests/endian.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5326 F="$?"
5327 if [ "$F" -eq 0 ]; then
5328 CFG_ENDIAN="Q_LITTLE_ENDIAN"
5329 elif [ "$F" -eq 1 ]; then
5330 CFG_ENDIAN="Q_BIG_ENDIAN"
5331 else
5332 echo
5333 echo "The target system byte order could not be detected!"
5334 echo "Turn on verbose messaging (-v) to see the final report."
5335 echo "You can use the -little-endian or -big-endian switch to"
5336 echo "$0 to continue."
5337 exit 101
5342 if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
5343 if [ "$PLATFORM_MAC" = "yes" ]; then
5344 true #leave as auto
5345 else
5346 "$unixtests/endian.test" "$QMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5347 F="$?"
5348 if [ "$F" -eq 0 ]; then
5349 CFG_HOST_ENDIAN="Q_LITTLE_ENDIAN"
5350 elif [ "$F" -eq 1 ]; then
5351 CFG_HOST_ENDIAN="Q_BIG_ENDIAN"
5352 else
5353 echo
5354 echo "The host system byte order could not be detected!"
5355 echo "Turn on verbose messaging (-v) to see the final report."
5356 echo "You can use the -host-little-endian or -host-big-endian switch to"
5357 echo "$0 to continue."
5358 exit 101
5363 if [ "$CFG_ARMFPA" != "auto" ]; then
5364 if [ "$CFG_ARMFPA" = "yes" ]; then
5365 if [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
5366 CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
5367 else
5368 CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
5370 else
5371 CFG_DOUBLEFORMAT="normal"
5376 if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then
5377 if [ "$PLATFORM_QWS" != "yes" ]; then
5378 CFG_DOUBLEFORMAT=normal
5379 else
5380 "$unixtests/doubleformat.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
5381 F="$?"
5382 if [ "$F" -eq 10 ] && [ "$CFG_ENDIAN" = "Q_LITTLE_ENDIAN" ]; then
5383 CFG_DOUBLEFORMAT=normal
5384 elif [ "$F" -eq 11 ] && [ "$CFG_ENDIAN" = "Q_BIG_ENDIAN" ]; then
5385 CFG_DOUBLEFORMAT=normal
5386 elif [ "$F" -eq 10 ]; then
5387 CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE"
5388 elif [ "$F" -eq 11 ]; then
5389 CFG_DOUBLEFORMAT="Q_DOUBLE_BIG"
5390 elif [ "$F" -eq 12 ]; then
5391 CFG_DOUBLEFORMAT="Q_DOUBLE_LITTLE_SWAPPED"
5392 CFG_ARMFPA="yes"
5393 elif [ "$F" -eq 13 ]; then
5394 CFG_DOUBLEFORMAT="Q_DOUBLE_BIG_SWAPPED"
5395 CFG_ARMFPA="yes"
5396 else
5397 echo
5398 echo "The system floating point format could not be detected."
5399 echo "This may cause data to be generated in a wrong format"
5400 echo "Turn on verbose messaging (-v) to see the final report."
5401 # we do not fail on this since this is a new test, and if it fails,
5402 # the old behavior should be correct in most cases
5403 CFG_DOUBLEFORMAT=normal
5408 HAVE_STL=no
5409 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then
5410 HAVE_STL=yes
5413 if [ "$CFG_STL" != "no" ]; then
5414 if [ "$HAVE_STL" = "yes" ]; then
5415 CFG_STL=yes
5416 else
5417 if [ "$CFG_STL" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5418 echo "STL support cannot be enabled due to functionality tests!"
5419 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5420 echo " If you believe this message is in error you may use the continue"
5421 echo " switch (-continue) to $0 to continue."
5422 exit 101
5423 else
5424 CFG_STL=no
5429 # find if the platform supports IPv6
5430 if [ "$CFG_IPV6" != "no" ]; then
5431 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6 "IPv6" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
5432 CFG_IPV6=yes
5433 else
5434 if [ "$CFG_IPV6" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5435 echo "IPv6 support cannot be enabled due to functionality tests!"
5436 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5437 echo " If you believe this message is in error you may use the continue"
5438 echo " switch (-continue) to $0 to continue."
5439 exit 101
5440 else
5441 CFG_IPV6=no
5446 # detect POSIX clock_gettime()
5447 if [ "$CFG_CLOCK_GETTIME" = "auto" ]; then
5448 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
5449 CFG_CLOCK_GETTIME=yes
5450 else
5451 CFG_CLOCK_GETTIME=no
5455 # detect POSIX monotonic clocks
5456 if [ "$CFG_CLOCK_GETTIME" = "yes" ] && [ "$CFG_CLOCK_MONOTONIC" = "auto" ]; then
5457 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
5458 CFG_CLOCK_MONOTONIC=yes
5459 else
5460 CFG_CLOCK_MONOTONIC=no
5462 elif [ "$CFG_CLOCK_GETTIME" = "no" ]; then
5463 CFG_CLOCK_MONOTONIC=no
5466 # detect mremap
5467 if [ "$CFG_MREMAP" = "auto" ]; then
5468 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/mremap "mremap" $L_FLAGS $I_FLAGS $l_FLAGS; then
5469 CFG_MREMAP=yes
5470 else
5471 CFG_MREMAP=no
5475 # find if the platform provides getaddrinfo (ipv6 dns lookups)
5476 if [ "$CFG_GETADDRINFO" != "no" ]; then
5477 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getaddrinfo "getaddrinfo" $L_FLAGS $I_FLAGS $l_FLAGS; then
5478 CFG_GETADDRINFO=yes
5479 else
5480 if [ "$CFG_GETADDRINFO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5481 echo "getaddrinfo support cannot be enabled due to functionality tests!"
5482 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5483 echo " If you believe this message is in error you may use the continue"
5484 echo " switch (-continue) to $0 to continue."
5485 exit 101
5486 else
5487 CFG_GETADDRINFO=no
5492 # find if the platform provides inotify
5493 if [ "$CFG_INOTIFY" != "no" ]; then
5494 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/inotify "inotify" $L_FLAGS $I_FLAGS $l_FLAGS; then
5495 CFG_INOTIFY=yes
5496 else
5497 if [ "$CFG_INOTIFY" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5498 echo "inotify support cannot be enabled due to functionality tests!"
5499 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5500 echo " If you believe this message is in error you may use the continue"
5501 echo " switch (-continue) to $0 to continue."
5502 exit 101
5503 else
5504 CFG_INOTIFY=no
5509 # find if the platform provides if_nametoindex (ipv6 interface name support)
5510 if [ "$CFG_IPV6IFNAME" != "no" ]; then
5511 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
5512 CFG_IPV6IFNAME=yes
5513 else
5514 if [ "$CFG_IPV6IFNAME" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5515 echo "IPv6 interface name support cannot be enabled due to functionality tests!"
5516 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5517 echo " If you believe this message is in error you may use the continue"
5518 echo " switch (-continue) to $0 to continue."
5519 exit 101
5520 else
5521 CFG_IPV6IFNAME=no
5526 # find if the platform provides getifaddrs (network interface enumeration)
5527 if [ "$CFG_GETIFADDRS" != "no" ]; then
5528 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/getifaddrs "getifaddrs" $L_FLAGS $I_FLAGS $l_FLAGS; then
5529 CFG_GETIFADDRS=yes
5530 else
5531 if [ "$CFG_GETIFADDRS" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5532 echo "getifaddrs support cannot be enabled due to functionality tests!"
5533 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5534 echo " If you believe this message is in error you may use the continue"
5535 echo " switch (-continue) to $0 to continue."
5536 exit 101
5537 else
5538 CFG_GETIFADDRS=no
5543 # find if the platform supports X/Open Large File compilation environment
5544 if [ "$CFG_LARGEFILE" != "no" ]; then
5545 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
5546 CFG_LARGEFILE=yes
5547 else
5548 if [ "$CFG_LARGEFILE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5549 echo "X/Open Large File support cannot be enabled due to functionality tests!"
5550 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5551 echo " If you believe this message is in error you may use the continue"
5552 echo " switch (-continue) to $0 to continue."
5553 exit 101
5554 else
5555 CFG_LARGEFILE=no
5560 # detect OpenSSL
5561 if [ "$CFG_OPENSSL" != "no" ]; then
5562 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/openssl "OpenSSL" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
5563 if [ "$CFG_OPENSSL" = "auto" ]; then
5564 CFG_OPENSSL=yes
5566 else
5567 if ( [ "$CFG_OPENSSL" = "yes" ] || [ "$CFG_OPENSSL" = "linked" ] ) && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5568 echo "OpenSSL support cannot be enabled due to functionality tests!"
5569 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5570 echo " If you believe this message is in error you may use the continue"
5571 echo " switch (-continue) to $0 to continue."
5572 exit 101
5573 else
5574 CFG_OPENSSL=no
5579 # detect OpenVG support
5580 if [ "$CFG_OPENVG" != "no" ]; then
5581 if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
5582 if [ "$CFG_OPENVG" = "auto" ]; then
5583 CFG_OPENVG=yes
5585 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG openvg_on_opengl" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
5586 if [ "$CFG_OPENVG" = "auto" ]; then
5587 CFG_OPENVG=yes
5589 CFG_OPENVG_ON_OPENGL=yes
5590 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG lower_case_includes" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG (lc includes)" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
5591 if [ "$CFG_OPENVG" = "auto" ]; then
5592 CFG_OPENVG=yes
5594 CFG_OPENVG_LC_INCLUDES=yes
5595 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG openvg_on_opengl lower_case_includes" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/openvg" "OpenVG (lc includes)" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
5596 if [ "$CFG_OPENVG" = "auto" ]; then
5597 CFG_OPENVG=yes
5599 CFG_OPENVG_LC_INCLUDES=yes
5600 CFG_OPENVG_ON_OPENGL=yes
5601 else
5602 if [ "$CFG_OPENVG" != "auto" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
5603 echo "$CFG_OPENVG was specified for OpenVG but cannot be enabled due to functionality tests!"
5604 echo " Turn on verbose messaging (-v) to $0 to see the final report."
5605 echo " If you believe this message is in error you may use the continue"
5606 echo " switch (-continue) to $0 to continue."
5607 exit 101
5608 else
5609 CFG_OPENVG=no
5612 if [ "$CFG_OPENVG" == "yes" ] && "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/shivavg" "ShivaVG" $L_FLAGS $I_FLAGS $l_FLAGS $CONFIG_ARG; then
5613 CFG_OPENVG_SHIVA=yes
5617 # if openvg is disabled and the user specified graphicssystem vg, disable it...
5618 if [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && [ "$CFG_OPENVG" = "no" ]; then
5619 echo "OpenVG Graphics System is disabled due to missing OpenVG support..."
5620 CFG_GRAPHICS_SYSTEM=default
5623 if [ "$CFG_PTMALLOC" != "no" ]; then
5624 # build ptmalloc, copy .a file to lib/
5625 echo "Building ptmalloc. Please wait..."
5626 (cd "$relpath/src/3rdparty/ptmalloc/"; "$MAKE" "clean" ; "$MAKE" "posix"
5627 mkdir "$outpath/lib/" ; cp "libptmalloc3.a" "$outpath/lib/")
5629 QMakeVar add QMAKE_LFLAGS "$outpath/lib/libptmalloc3.a"
5632 #-------------------------------------------------------------------------------
5633 # ask for all that hasn't been auto-detected or specified in the arguments
5634 #-------------------------------------------------------------------------------
5636 ### fix this: user input should be validated in a loop
5637 if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PLATFORM_QWS" = "yes" ]; then
5638 echo
5639 echo "Choose pixel-depths to support:"
5640 echo
5641 echo " 1. 1bpp, black/white"
5642 echo " 4. 4bpp, grayscale"
5643 echo " 8. 8bpp, paletted"
5644 echo " 12. 12bpp, rgb 4-4-4"
5645 echo " 15. 15bpp, rgb 5-5-5"
5646 echo " 16. 16bpp, rgb 5-6-5"
5647 echo " 18. 18bpp, rgb 6-6-6"
5648 echo " 24. 24bpp, rgb 8-8-8"
5649 echo " 32. 32bpp, argb 8-8-8-8 and rgb 8-8-8"
5650 echo " all. All supported depths"
5651 echo
5652 echo "Your choices (default 8,16,32):"
5653 read CFG_QWS_DEPTHS
5654 if [ -z "$CFG_QWS_DEPTHS" ] || [ "$CFG_QWS_DEPTHS" = "yes" ]; then
5655 CFG_QWS_DEPTHS=8,16,32
5658 if [ -n "$CFG_QWS_DEPTHS" -a "$PLATFORM_QWS" = "yes" ]; then
5659 if [ "$CFG_QWS_DEPTHS" = "all" ]; then
5660 CFG_QWS_DEPTHS="1 4 8 12 15 16 18 24 32 generic"
5662 for D in `echo "$CFG_QWS_DEPTHS" | sed -e 's/,/ /g'`; do
5663 case $D in
5664 1|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";;
5665 generic) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_GENERIC";;
5666 esac
5667 done
5670 # enable dwarf2 support on Mac
5671 if [ "$CFG_MAC_DWARF2" = "yes" ]; then
5672 QT_CONFIG="$QT_CONFIG dwarf2"
5675 # Set the default arch. Select 32-bit/carbon if nothing else has
5676 # been specified on the configure line.
5677 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_ARCHS" == "" ]; then
5678 source "$mactests/defaultarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests"
5680 if [ "$QT_MAC_DEFUALT_ARCH" == "x86_64" ]; then
5681 CFG_MAC_ARCHS=" x86"
5682 elif [ "$QT_MAC_DEFUALT_ARCH" == "ppc64" ]; then
5683 CFG_MAC_ARCHS=" ppc"
5684 else
5685 CFG_MAC_ARCHS=" $QT_MAC_DEFUALT_ARCH"
5688 [ "$OPT_VERBOSE" == "yes" ] && echo "Setting Mac architechture to$CFG_MAC_ARCHS."
5691 # enable cocoa and/or carbon on Mac
5692 if [ "$CFG_MAC_COCOA" = "yes" ]; then
5693 # -cocoa on the command line disables carbon completely (i.e. use cocoa for 32-bit as well)
5694 CFG_MAC_CARBON="no"
5695 else
5696 # check which archs are in use, enable cocoa if we find a 64-bit one
5697 if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then
5698 CFG_MAC_COCOA="yes";
5699 CFG_MAC_CARBON="no";
5700 if echo "$CFG_MAC_ARCHS" | grep -w ppc > /dev/null 2>&1; then
5701 CFG_MAC_CARBON="yes";
5703 if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then
5704 CFG_MAC_CARBON="yes";
5706 else
5707 # no 64-bit archs found.
5708 CFG_MAC_COCOA="no"
5712 # set the global Mac deployment target. This is overridden on an arch-by-arch basis
5713 # in some cases, see code further down
5714 case "$PLATFORM,$CFG_MAC_COCOA" in
5715 macx*,yes)
5716 # Cocoa
5717 QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.5
5718 CFG_QT3SUPPORT="no"
5720 macx*,no)
5721 # gcc, Carbon
5722 QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.4
5724 esac
5726 # enable Qt 3 support functionality
5727 if [ "$CFG_QT3SUPPORT" = "yes" ]; then
5728 QT_CONFIG="$QT_CONFIG qt3support"
5731 # enable Phonon
5732 if [ "$CFG_PHONON" = "yes" ]; then
5733 QT_CONFIG="$QT_CONFIG phonon"
5734 if [ "$CFG_PHONON_BACKEND" = "yes" ]; then
5735 QT_CONFIG="$QT_CONFIG phonon-backend"
5737 else
5738 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PHONON"
5741 # disable accessibility
5742 if [ "$CFG_ACCESSIBILITY" = "no" ]; then
5743 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ACCESSIBILITY"
5744 else
5745 QT_CONFIG="$QT_CONFIG accessibility"
5748 # enable egl
5749 if [ "$CFG_EGL" = "no" ]; then
5750 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL"
5751 else
5752 QT_CONFIG="$QT_CONFIG egl"
5753 if [ "$CFG_EGL_GLES_INCLUDES" = "yes" ]; then
5754 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GLES_EGL"
5758 # enable openvg
5759 if [ "$CFG_OPENVG" = "no" ]; then
5760 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENVG"
5761 else
5762 QT_CONFIG="$QT_CONFIG openvg"
5763 if [ "$CFG_OPENVG_LC_INCLUDES" = "yes" ]; then
5764 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LOWER_CASE_VG_INCLUDES"
5766 if [ "$CFG_OPENVG_ON_OPENGL" = "yes" ]; then
5767 QT_CONFIG="$QT_CONFIG openvg_on_opengl"
5769 if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
5770 QT_CONFIG="$QT_CONFIG shivavg"
5771 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SHIVAVG"
5775 # enable opengl
5776 if [ "$CFG_OPENGL" = "no" ]; then
5777 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENGL"
5778 else
5779 QT_CONFIG="$QT_CONFIG opengl"
5782 if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es1cl" ] || [ "$CFG_OPENGL" = "es2" ]; then
5783 if [ "$PLATFORM_QWS" = "yes" ]; then
5784 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_BACKINGSTORE_SUBSURFACES"
5785 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_USE_EGLWINDOWSURFACE"
5787 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES"
5790 if [ "$CFG_OPENGL" = "es1" ]; then
5791 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1"
5792 QT_CONFIG="$QT_CONFIG opengles1"
5795 if [ "$CFG_OPENGL" = "es1cl" ]; then
5796 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1_CL"
5797 QT_CONFIG="$QT_CONFIG opengles1cl"
5800 if [ "$CFG_OPENGL" = "es2" ]; then
5801 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_2"
5802 QT_CONFIG="$QT_CONFIG opengles2"
5805 # safe execution environment
5806 if [ "$CFG_SXE" != "no" ]; then
5807 QT_CONFIG="$QT_CONFIG sxe"
5810 # build up the variables for output
5811 if [ "$CFG_DEBUG" = "yes" ]; then
5812 QMAKE_OUTDIR="${QMAKE_OUTDIR}debug"
5813 QMAKE_CONFIG="$QMAKE_CONFIG debug"
5814 elif [ "$CFG_DEBUG" = "no" ]; then
5815 QMAKE_OUTDIR="${QMAKE_OUTDIR}release"
5816 QMAKE_CONFIG="$QMAKE_CONFIG release"
5818 if [ "$CFG_SHARED" = "yes" ]; then
5819 QMAKE_OUTDIR="${QMAKE_OUTDIR}-shared"
5820 QMAKE_CONFIG="$QMAKE_CONFIG shared dll"
5821 elif [ "$CFG_SHARED" = "no" ]; then
5822 QMAKE_OUTDIR="${QMAKE_OUTDIR}-static"
5823 QMAKE_CONFIG="$QMAKE_CONFIG static"
5825 if [ "$PLATFORM_QWS" = "yes" ]; then
5826 QMAKE_OUTDIR="${QMAKE_OUTDIR}-emb-$CFG_EMBEDDED"
5827 QMAKE_CONFIG="$QMAKE_CONFIG embedded"
5828 QT_CONFIG="$QT_CONFIG embedded"
5829 rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
5831 QMakeVar set PRECOMPILED_DIR ".pch/$QMAKE_OUTDIR"
5832 QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR"
5833 QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR"
5834 QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR"
5835 QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR"
5836 if [ "$CFG_LARGEFILE" = "yes" ]; then
5837 QMAKE_CONFIG="$QMAKE_CONFIG largefile"
5839 if [ "$CFG_STL" = "no" ]; then
5840 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STL"
5841 else
5842 QMAKE_CONFIG="$QMAKE_CONFIG stl"
5844 if [ "$CFG_USE_GNUMAKE" = "yes" ]; then
5845 QMAKE_CONFIG="$QMAKE_CONFIG GNUmake"
5847 [ "$CFG_REDUCE_EXPORTS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_exports"
5848 [ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
5849 [ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
5850 if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
5851 QMakeVar add QMAKE_CFLAGS -g
5852 QMakeVar add QMAKE_CXXFLAGS -g
5853 QMAKE_CONFIG="$QMAKE_CONFIG separate_debug_info"
5855 [ "$CFG_MMX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG mmx"
5856 [ "$CFG_3DNOW" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG 3dnow"
5857 [ "$CFG_SSE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse"
5858 [ "$CFG_SSE2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse2"
5859 [ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
5860 [ "$PLATFORM_MAC" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG $CFG_MAC_ARCHS"
5861 if [ "$CFG_IPV6" = "yes" ]; then
5862 QT_CONFIG="$QT_CONFIG ipv6"
5864 if [ "$CFG_CLOCK_GETTIME" = "yes" ]; then
5865 QT_CONFIG="$QT_CONFIG clock-gettime"
5867 if [ "$CFG_CLOCK_MONOTONIC" = "yes" ]; then
5868 QT_CONFIG="$QT_CONFIG clock-monotonic"
5870 if [ "$CFG_MREMAP" = "yes" ]; then
5871 QT_CONFIG="$QT_CONFIG mremap"
5873 if [ "$CFG_GETADDRINFO" = "yes" ]; then
5874 QT_CONFIG="$QT_CONFIG getaddrinfo"
5876 if [ "$CFG_IPV6IFNAME" = "yes" ]; then
5877 QT_CONFIG="$QT_CONFIG ipv6ifname"
5879 if [ "$CFG_GETIFADDRS" = "yes" ]; then
5880 QT_CONFIG="$QT_CONFIG getifaddrs"
5882 if [ "$CFG_INOTIFY" = "yes" ]; then
5883 QT_CONFIG="$QT_CONFIG inotify"
5885 if [ "$CFG_LIBJPEG" = "system" ]; then
5886 QT_CONFIG="$QT_CONFIG system-jpeg"
5888 if [ "$CFG_JPEG" = "no" ]; then
5889 QT_CONFIG="$QT_CONFIG no-jpeg"
5890 elif [ "$CFG_JPEG" = "yes" ]; then
5891 QT_CONFIG="$QT_CONFIG jpeg"
5893 if [ "$CFG_LIBMNG" = "system" ]; then
5894 QT_CONFIG="$QT_CONFIG system-mng"
5896 if [ "$CFG_MNG" = "no" ]; then
5897 QT_CONFIG="$QT_CONFIG no-mng"
5898 elif [ "$CFG_MNG" = "yes" ]; then
5899 QT_CONFIG="$QT_CONFIG mng"
5901 if [ "$CFG_LIBPNG" = "no" ]; then
5902 CFG_PNG="no"
5904 if [ "$CFG_LIBPNG" = "system" ]; then
5905 QT_CONFIG="$QT_CONFIG system-png"
5907 if [ "$CFG_PNG" = "no" ]; then
5908 QT_CONFIG="$QT_CONFIG no-png"
5909 elif [ "$CFG_PNG" = "yes" ]; then
5910 QT_CONFIG="$QT_CONFIG png"
5912 if [ "$CFG_GIF" = "no" ]; then
5913 QT_CONFIG="$QT_CONFIG no-gif"
5914 elif [ "$CFG_GIF" = "yes" ]; then
5915 QT_CONFIG="$QT_CONFIG gif"
5917 if [ "$CFG_LIBTIFF" = "system" ]; then
5918 QT_CONFIG="$QT_CONFIG system-tiff"
5920 if [ "$CFG_TIFF" = "no" ]; then
5921 QT_CONFIG="$QT_CONFIG no-tiff"
5922 elif [ "$CFG_TIFF" = "yes" ]; then
5923 QT_CONFIG="$QT_CONFIG tiff"
5925 if [ "$CFG_LIBFREETYPE" = "no" ]; then
5926 QT_CONFIG="$QT_CONFIG no-freetype"
5927 elif [ "$CFG_LIBFREETYPE" = "system" ]; then
5928 QT_CONFIG="$QT_CONFIG system-freetype"
5929 else
5930 QT_CONFIG="$QT_CONFIG freetype"
5933 if [ "x$PLATFORM_MAC" = "xyes" ]; then
5934 #On Mac we implicitly link against libz, so we
5935 #never use the 3rdparty stuff.
5936 [ "$CFG_ZLIB" = "yes" ] && CFG_ZLIB="system"
5938 if [ "$CFG_ZLIB" = "yes" ]; then
5939 QT_CONFIG="$QT_CONFIG zlib"
5940 elif [ "$CFG_ZLIB" = "system" ]; then
5941 QT_CONFIG="$QT_CONFIG system-zlib"
5944 [ "$CFG_NIS" = "yes" ] && QT_CONFIG="$QT_CONFIG nis"
5945 [ "$CFG_CUPS" = "yes" ] && QT_CONFIG="$QT_CONFIG cups"
5946 [ "$CFG_ICONV" = "yes" ] && QT_CONFIG="$QT_CONFIG iconv"
5947 [ "$CFG_ICONV" = "gnu" ] && QT_CONFIG="$QT_CONFIG gnu-libiconv"
5948 [ "$CFG_GLIB" = "yes" ] && QT_CONFIG="$QT_CONFIG glib"
5949 [ "$CFG_GSTREAMER" = "yes" ] && QT_CONFIG="$QT_CONFIG gstreamer"
5950 [ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus"
5951 [ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked"
5952 [ "$CFG_NAS" = "system" ] && QT_CONFIG="$QT_CONFIG nas"
5953 [ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl"
5954 [ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked"
5956 if [ "$PLATFORM_X11" = "yes" ]; then
5957 [ "$CFG_SM" = "yes" ] && QT_CONFIG="$QT_CONFIG x11sm"
5959 # for some reason, the following libraries are not always built shared,
5960 # so *every* program/lib (including Qt) has to link against them
5961 if [ "$CFG_XSHAPE" = "yes" ]; then
5962 QT_CONFIG="$QT_CONFIG xshape"
5964 if [ "$CFG_XSYNC" = "yes" ]; then
5965 QT_CONFIG="$QT_CONFIG xsync"
5967 if [ "$CFG_XINERAMA" = "yes" ]; then
5968 QT_CONFIG="$QT_CONFIG xinerama"
5969 QMakeVar set QMAKE_LIBS_X11 '-lXinerama $$QMAKE_LIBS_X11'
5971 if [ "$CFG_XCURSOR" = "yes" ]; then
5972 QT_CONFIG="$QT_CONFIG xcursor"
5973 QMakeVar set QMAKE_LIBS_X11 '-lXcursor $$QMAKE_LIBS_X11'
5975 if [ "$CFG_XFIXES" = "yes" ]; then
5976 QT_CONFIG="$QT_CONFIG xfixes"
5977 QMakeVar set QMAKE_LIBS_X11 '-lXfixes $$QMAKE_LIBS_X11'
5979 if [ "$CFG_XRANDR" = "yes" ]; then
5980 QT_CONFIG="$QT_CONFIG xrandr"
5981 if [ "$CFG_XRENDER" != "yes" ]; then
5982 # libXrandr uses 1 function from libXrender, so we always have to have it :/
5983 QMakeVar set QMAKE_LIBS_X11 '-lXrandr -lXrender $$QMAKE_LIBS_X11'
5984 else
5985 QMakeVar set QMAKE_LIBS_X11 '-lXrandr $$QMAKE_LIBS_X11'
5988 if [ "$CFG_XRENDER" = "yes" ]; then
5989 QT_CONFIG="$QT_CONFIG xrender"
5990 QMakeVar set QMAKE_LIBS_X11 '-lXrender $$QMAKE_LIBS_X11'
5992 if [ "$CFG_MITSHM" = "yes" ]; then
5993 QT_CONFIG="$QT_CONFIG mitshm"
5995 if [ "$CFG_FONTCONFIG" = "yes" ]; then
5996 QT_CONFIG="$QT_CONFIG fontconfig"
5998 if [ "$CFG_XINPUT" = "yes" ]; then
5999 QMakeVar set QMAKE_LIBS_X11 '-lXi $$QMAKE_LIBS_X11'
6001 if [ "$CFG_XINPUT" = "yes" ]; then
6002 QT_CONFIG="$QT_CONFIG xinput tablet"
6004 if [ "$CFG_XKB" = "yes" ]; then
6005 QT_CONFIG="$QT_CONFIG xkb"
6009 [ '!' -z "$D_FLAGS" ] && QMakeVar add DEFINES "$D_FLAGS"
6010 [ '!' -z "$L_FLAGS" ] && QMakeVar add QMAKE_LIBDIR_FLAGS "$L_FLAGS"
6011 [ '!' -z "$l_FLAGS" ] && QMakeVar add LIBS "$l_FLAGS"
6013 if [ "$PLATFORM_MAC" = "yes" ]; then
6014 if [ "$CFG_RPATH" = "yes" ]; then
6015 QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname"
6017 elif [ -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_RPATH | awk '{print $3;}'`" ]; then
6018 if [ -n "$RPATH_FLAGS" ]; then
6019 echo
6020 echo "ERROR: -R cannot be used on this platform as \$QMAKE_RPATH is"
6021 echo " undefined."
6022 echo
6023 exit 1
6024 elif [ "$CFG_RPATH" = "yes" ]; then
6025 RPATH_MESSAGE=" NOTE: This platform does not support runtime library paths, using -no-rpath."
6026 CFG_RPATH=no
6028 else
6029 if [ "$CFG_RPATH" = "yes" ]; then
6030 # set the default rpath to the library installation directory
6031 RPATH_FLAGS="\"$QT_INSTALL_LIBS\" $RPATH_FLAGS"
6033 if [ -n "$RPATH_FLAGS" ]; then
6034 # add the user defined rpaths
6035 QMakeVar add QMAKE_RPATHDIR "$RPATH_FLAGS"
6039 if [ '!' -z "$I_FLAGS" ]; then
6040 # add the user define include paths
6041 QMakeVar add QMAKE_CFLAGS "$I_FLAGS"
6042 QMakeVar add QMAKE_CXXFLAGS "$I_FLAGS"
6045 # turn off exceptions for the compilers that support it
6046 if [ "$PLATFORM_QWS" = "yes" ]; then
6047 COMPILER=`echo $XPLATFORM | cut -f 3- -d-`
6048 else
6049 COMPILER=`echo $PLATFORM | cut -f 2- -d-`
6051 if [ "$CFG_EXCEPTIONS" = "unspecified" -a "$PLATFORM_QWS" = "yes" ]; then
6052 CFG_EXCEPTIONS=no
6055 if [ "$CFG_EXCEPTIONS" != "no" ]; then
6056 QTCONFIG_CONFIG="$QTCONFIG_CONFIG exceptions"
6060 # Some Qt modules are too advanced in C++ for some old compilers
6061 # Detect here the platforms where they are known to work.
6063 # See Qt documentation for more information on which features are
6064 # supported and on which compilers.
6066 canBuildQtXmlPatterns="yes"
6067 canBuildWebKit="$HAVE_STL"
6068 canBuildQtConcurrent="yes"
6070 # WebKit requires stdint.h
6071 "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stdint "Stdint" $L_FLAGS $I_FLAGS $l_FLAGS
6072 if [ $? != "0" ]; then
6073 canBuildWebKit="no"
6076 case "$XPLATFORM" in
6077 hpux-g++*)
6078 # PA-RISC's assembly is too limited
6079 # gcc 3.4 on that platform can't build QtXmlPatterns
6080 # the assembly it generates cannot be compiled
6082 # Check gcc's version
6083 case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
6086 3.4*)
6087 canBuildQtXmlPatterns="no"
6090 canBuildWebKit="no"
6091 canBuildQtXmlPatterns="no"
6093 esac
6095 *-g++*)
6096 # Check gcc's version
6097 case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
6098 4*|3.4*)
6100 3.3*)
6101 canBuildWebKit="no"
6104 canBuildWebKit="no"
6105 canBuildQtXmlPatterns="no"
6107 esac
6109 solaris-cc*)
6110 # Check the compiler version
6111 case `${QMAKE_CONF_COMPILER} -V 2>&1 | awk '{print $4}'` in
6112 5.[012345678])
6113 canBuildWebKit="no"
6114 canBuildQtXmlPatterns="no"
6115 canBuildQtConcurrent="no"
6117 5.9)
6118 canBuildWebKit="no"
6120 esac
6122 hpux-acc*)
6123 canBuildWebKit="no"
6124 canBuildQtXmlPatterns="no"
6125 canBuildQtConcurrent="no"
6127 hpuxi-acc*)
6128 canBuildWebKit="no"
6130 aix-xlc*)
6131 # Get the xlC version
6132 cat > xlcver.c <<EOF
6133 #include <stdio.h>
6134 int main()
6136 printf("%d.%d\n", __xlC__ >> 8, __xlC__ & 0xFF);
6137 return 0;
6140 xlcver=
6141 if ${QMAKE_CONF_COMPILER} -o xlcver xlcver.c >/dev/null 2>/dev/null; then
6142 xlcver=`./xlcver 2>/dev/null`
6143 rm -f ./xlcver
6145 if [ "$OPT_VERBOSE" = "yes" ]; then
6146 if [ -n "$xlcver" ]; then
6147 echo Found IBM xlC version: $xlcver.
6148 else
6149 echo Could not determine IBM xlC version, assuming oldest supported.
6153 case "$xlcver" in
6154 [123456].*)
6155 canBuildWebKit="no"
6156 canBuildQtXmlPatterns="no"
6157 canBuildQtConcurrent="no"
6160 canBuildWebKit="no"
6162 esac
6164 irix-cc*)
6165 canBuildWebKit="no"
6166 canBuildQtConcurrent="no"
6168 esac
6170 CFG_CONCURRENT="yes"
6171 if [ "$canBuildQtConcurrent" = "no" ]; then
6172 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CONCURRENT"
6173 CFG_CONCURRENT="no"
6176 if [ "$CFG_XMLPATTERNS" = "yes" -a "$CFG_EXCEPTIONS" = "no" ]; then
6177 echo "QtXmlPatterns was requested, but it can't be built due to exceptions being disabled."
6178 exit 1
6180 if [ "$CFG_XMLPATTERNS" = "auto" -a "$CFG_EXCEPTIONS" != "no" ]; then
6181 CFG_XMLPATTERNS="$canBuildQtXmlPatterns"
6182 elif [ "$CFG_EXCEPTIONS" = "no" ]; then
6183 CFG_XMLPATTERNS="no"
6185 if [ "$CFG_XMLPATTERNS" = "yes" ]; then
6186 QT_CONFIG="$QT_CONFIG xmlpatterns"
6187 else
6188 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XMLPATTERNS"
6191 if [ "$CFG_SVG" = "yes" ]; then
6192 QT_CONFIG="$QT_CONFIG svg"
6193 else
6194 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SVG"
6197 if [ "$CFG_WEBKIT" = "auto" ]; then
6198 CFG_WEBKIT="$canBuildWebKit"
6201 if [ "$CFG_WEBKIT" = "yes" ]; then
6202 QT_CONFIG="$QT_CONFIG webkit"
6203 # The reason we set CFG_WEBKIT, is such that the printed overview of what will be enabled, shows correctly.
6204 CFG_WEBKIT="yes"
6205 else
6206 CFG_WEBKIT="no"
6207 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_WEBKIT"
6210 if [ "$CFG_SCRIPTTOOLS" = "auto" ]; then
6211 CFG_SCRIPTTOOLS="yes"
6214 if [ "$CFG_SCRIPTTOOLS" = "yes" ]; then
6215 QT_CONFIG="$QT_CONFIG scripttools"
6216 CFG_SCRIPTTOOLS="yes"
6217 else
6218 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SCRIPTTOOLS"
6221 if [ "$CFG_EXCEPTIONS" = "no" ]; then
6222 case "$COMPILER" in
6223 g++*)
6224 QMakeVar add QMAKE_CFLAGS -fno-exceptions
6225 QMakeVar add QMAKE_CXXFLAGS -fno-exceptions
6226 QMakeVar add QMAKE_LFLAGS -fno-exceptions
6228 cc*)
6229 case "$PLATFORM" in
6230 irix-cc*)
6231 QMakeVar add QMAKE_CFLAGS -LANG:exceptions=off
6232 QMakeVar add QMAKE_CXXFLAGS -LANG:exceptions=off
6233 QMakeVar add QMAKE_LFLAGS -LANG:exceptions=off
6235 *) ;;
6236 esac
6238 *) ;;
6239 esac
6240 QMAKE_CONFIG="$QMAKE_CONFIG exceptions_off"
6243 # On Mac, set the minimum deployment target for the different architechtures
6244 # using the Xarch compiler option when supported (10.5 and up). On 10.4 the
6245 # deployment version is set to 10.4 globally using the QMAKE_MACOSX_DEPLOYMENT_TARGET
6246 # env. variable. "-cocoa" on the command line means Cocoa is used in 32-bit mode also,
6247 # in this case fall back on QMAKE_MACOSX_DEPLOYMENT_TARGET which will be set to 10.5.
6248 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] && [ "$COMMANDLINE_MAC_COCOA" != "yes" ]; then
6249 if echo "$CFG_MAC_ARCHS" | grep '\<x86\>' > /dev/null 2>&1; then
6250 QMakeVar add QMAKE_CFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
6251 QMakeVar add QMAKE_CXXFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
6252 QMakeVar add QMAKE_LFLAGS "-Xarch_i386 -mmacosx-version-min=10.4"
6253 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86 "-arch i386 -Xarch_i386 -mmacosx-version-min=10.4"
6255 if echo "$CFG_MAC_ARCHS" | grep '\<ppc\>' > /dev/null 2>&1; then
6256 QMakeVar add QMAKE_CFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
6257 QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
6258 QMakeVar add QMAKE_LFLAGS "-Xarch_ppc -mmacosx-version-min=10.4"
6259 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=10.4"
6261 if echo "$CFG_MAC_ARCHS" | grep '\<x86_64\>' > /dev/null 2>&1; then
6262 QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
6263 QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
6264 QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5"
6265 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5"
6267 if echo "$CFG_MAC_ARCHS" | grep '\<ppc64\>' > /dev/null 2>&1; then
6268 QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
6269 QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
6270 QMakeVar add QMAKE_LFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5"
6271 QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC_64 "-arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5"
6275 #-------------------------------------------------------------------------------
6276 # generate QT_BUILD_KEY
6277 #-------------------------------------------------------------------------------
6279 # some compilers generate binary incompatible code between different versions,
6280 # so we need to generate a build key that is different between these compilers
6281 case "$COMPILER" in
6282 g++*)
6283 # GNU C++
6284 COMPILER_VERSION=`${QMAKE_CONF_COMPILER} -dumpversion 2>/dev/null`
6286 case "$COMPILER_VERSION" in
6287 *.*.*)
6288 QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
6289 QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
6290 QT_GCC_PATCH_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
6292 *.*)
6293 QT_GCC_MAJOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\1,'`
6294 QT_GCC_MINOR_VERSION=`echo $COMPILER_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\).*,\2,'`
6295 QT_GCC_PATCH_VERSION=0
6297 esac
6299 case "$COMPILER_VERSION" in
6300 2.95.*)
6301 COMPILER_VERSION="2.95.*"
6303 3.*)
6304 COMPILER_VERSION="3.*"
6306 4.*)
6307 COMPILER_VERSION="4"
6311 esac
6312 [ '!' -z "$COMPILER_VERSION" ] && COMPILER="g++-${COMPILER_VERSION}"
6317 esac
6319 # QT_CONFIG can contain the following:
6321 # Things that affect the Qt API/ABI:
6323 # Options:
6324 # minimal-config small-config medium-config large-config full-config
6326 # Different edition modules:
6327 # network canvas table xml opengl sql
6329 # Options:
6330 # stl
6332 # Things that do not affect the Qt API/ABI:
6333 # system-jpeg no-jpeg jpeg
6334 # system-mng no-mng mng
6335 # system-png no-png png
6336 # system-zlib no-zlib zlib
6337 # system-libtiff no-libtiff
6338 # no-gif gif
6339 # debug release
6340 # dll staticlib
6342 # nocrosscompiler
6343 # GNUmake
6344 # largefile
6345 # nis
6346 # nas
6347 # tablet
6348 # ipv6
6350 # X11 : x11sm xinerama xcursor xfixes xrandr xrender mitshm fontconfig xkb
6351 # Embedded: embedded freetype
6353 ALL_OPTIONS="stl"
6354 BUILD_CONFIG=
6355 BUILD_OPTIONS=
6357 # determine the build options
6358 for config_option in $QMAKE_CONFIG $QT_CONFIG; do
6359 SKIP="yes"
6360 case "$config_option" in
6361 *-config)
6362 # take the last *-config setting. this is the highest config being used,
6363 # and is the one that we will use for tagging plugins
6364 BUILD_CONFIG="$config_option"
6367 stl)
6368 # these config options affect the Qt API/ABI. they should influence
6369 # the generation of the buildkey, so we don't skip them
6370 SKIP="no"
6373 *) # skip all other options since they don't affect the Qt API/ABI.
6375 esac
6377 if [ "$SKIP" = "no" ]; then
6378 BUILD_OPTIONS="$BUILD_OPTIONS $config_option"
6380 done
6382 # put the options that we are missing into .options
6383 rm -f .options
6384 for opt in `echo $ALL_OPTIONS`; do
6385 SKIP="no"
6386 if echo $BUILD_OPTIONS | grep $opt >/dev/null 2>&1; then
6387 SKIP="yes"
6389 if [ "$SKIP" = "no" ]; then
6390 echo "$opt" >> .options
6392 done
6394 # reconstruct BUILD_OPTIONS with a sorted negative feature list
6395 # (ie. only things that are missing are will be put into the build key)
6396 BUILD_OPTIONS=
6397 if [ -f .options ]; then
6398 for opt in `sort -f .options | uniq`; do
6399 BUILD_OPTIONS="$BUILD_OPTIONS no-$opt"
6400 done
6402 rm -f .options
6404 # QT_NO* defines affect the Qt API (and binary compatibility). they need
6405 # to be included in the build key
6406 for build_option in $D_FLAGS; do
6407 build_option=`echo $build_option | cut -d \" -f 2 -`
6408 case "$build_option" in
6409 QT_NO*)
6410 echo "$build_option" >> .options
6413 # skip all other compiler defines
6415 esac
6416 done
6418 # sort the compile time defines (helps ensure that changes in this configure
6419 # script don't affect the QT_BUILD_KEY generation)
6420 if [ -f .options ]; then
6421 for opt in `sort -f .options | uniq`; do
6422 BUILD_OPTIONS="$BUILD_OPTIONS $opt"
6423 done
6425 rm -f .options
6427 BUILD_OPTIONS="$BUILD_CONFIG $BUILD_OPTIONS"
6428 # extract the operating system from the XPLATFORM
6429 TARGET_OPERATING_SYSTEM=`echo $XPLATFORM | cut -f 2- -d/ | cut -f -1 -d-`
6431 # when cross-compiling, don't include build-host information (build key is target specific)
6432 QT_BUILD_KEY="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
6433 if [ -n "$QT_NAMESPACE" ]; then
6434 QT_BUILD_KEY="$QT_BUILD_KEY $QT_NAMESPACE"
6436 MAC_NEED_TWO_BUILD_KEYS="no"
6437 if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then
6438 QT_BUILD_KEY_CARBON=$QT_BUILD_KEY
6439 TARGET_OPERATING_SYSTEM="$TARGET_OPERATING_SYSTEM-cocoa"
6440 QT_BUILD_KEY_COCOA="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
6441 if [ "$CFG_MAC_CARBON" = "no" ]; then
6442 QT_BUILD_KEY=$QT_BUILD_KEY_COCOA
6443 else
6444 MAC_NEED_TWO_BUILD_KEYS="yes"
6447 # don't break loading plugins build with an older version of Qt
6448 QT_BUILD_KEY_COMPAT=
6449 if [ "$QT_CROSS_COMPILE" = "no" ]; then
6450 # previous versions of Qt used a build key built from the uname
6451 QT_BUILD_KEY_COMPAT="$CFG_USER_BUILD_KEY $UNAME_MACHINE $UNAME_SYSTEM $COMPILER $BUILD_OPTIONS"
6452 if [ -n "$QT_NAMESPACE" ]; then
6453 QT_BUILD_KEY_COMPAT="$QT_BUILD_KEY_COMPAT $QT_NAMESPACE"
6456 # strip out leading/trailing/extra whitespace
6457 QT_BUILD_KEY=`echo $QT_BUILD_KEY | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
6458 QT_BUILD_KEY_COMPAT=`echo $QT_BUILD_KEY_COMPAT | sed -e "s, *, ,g" -e "s,^ *,," -e "s, *$,,"`
6460 #-------------------------------------------------------------------------------
6461 # part of configuration information goes into qconfig.h
6462 #-------------------------------------------------------------------------------
6464 case "$CFG_QCONFIG" in
6465 full)
6466 echo "/* Everything */" >"$outpath/src/corelib/global/qconfig.h.new"
6469 tmpconfig="$outpath/src/corelib/global/qconfig.h.new"
6470 echo "#ifndef QT_BOOTSTRAPPED" >"$tmpconfig"
6471 cat "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" >>"$tmpconfig"
6472 echo "#endif" >>"$tmpconfig"
6474 esac
6476 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6478 /* Qt Edition */
6479 #ifndef QT_EDITION
6480 # define QT_EDITION $QT_EDITION
6481 #endif
6483 /* Machine byte-order */
6484 #define Q_BIG_ENDIAN 4321
6485 #define Q_LITTLE_ENDIAN 1234
6488 if [ "$MAC_NEED_TWO_BUILD_KEYS" = "no" ]; then
6489 echo "#define QT_BUILD_KEY \"$QT_BUILD_KEY\"" \
6490 >> "$outpath/src/corelib/global/qconfig.h.new"
6491 else
6492 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6494 #define QT_BUILD_KEY_CARBON "$QT_BUILD_KEY_CARBON"
6495 #define QT_BUILD_KEY_COCOA "$QT_BUILD_KEY_COCOA"
6499 if [ -n "$QT_BUILD_KEY_COMPAT" ]; then
6500 echo "#define QT_BUILD_KEY_COMPAT \"$QT_BUILD_KEY_COMPAT\"" \
6501 >> "$outpath/src/corelib/global/qconfig.h.new"
6503 echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
6505 echo "#ifdef QT_BOOTSTRAPPED" >>"$outpath/src/corelib/global/qconfig.h.new"
6506 if [ "$CFG_HOST_ENDIAN" = "auto" ]; then
6507 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6508 #if defined(__BIG_ENDIAN__)
6509 # define Q_BYTE_ORDER Q_BIG_ENDIAN
6510 #elif defined(__LITTLE_ENDIAN__)
6511 # define Q_BYTE_ORDER Q_LITTLE_ENDIAN
6512 #else
6513 # error "Unable to determine byte order!"
6514 #endif
6516 else
6517 echo "#define Q_BYTE_ORDER $CFG_HOST_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
6519 echo "#else" >>"$outpath/src/corelib/global/qconfig.h.new"
6520 if [ "$CFG_ENDIAN" = "auto" ]; then
6521 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6522 #if defined(__BIG_ENDIAN__)
6523 # define Q_BYTE_ORDER Q_BIG_ENDIAN
6524 #elif defined(__LITTLE_ENDIAN__)
6525 # define Q_BYTE_ORDER Q_LITTLE_ENDIAN
6526 #else
6527 # error "Unable to determine byte order!"
6528 #endif
6530 else
6531 echo "#define Q_BYTE_ORDER $CFG_ENDIAN" >>"$outpath/src/corelib/global/qconfig.h.new"
6533 echo "#endif" >>"$outpath/src/corelib/global/qconfig.h.new"
6535 if [ "$CFG_DOUBLEFORMAT" != "normal" ]; then
6536 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6537 /* Non-IEEE double format */
6538 #define Q_DOUBLE_LITTLE "01234567"
6539 #define Q_DOUBLE_BIG "76543210"
6540 #define Q_DOUBLE_LITTLE_SWAPPED "45670123"
6541 #define Q_DOUBLE_BIG_SWAPPED "32107654"
6542 #define Q_DOUBLE_FORMAT $CFG_DOUBLEFORMAT
6545 if [ "$CFG_ARMFPA" = "yes" ]; then
6546 if [ "$CFG_ARCH" != "$CFG_HOST_ARCH" ]; then
6547 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6548 #ifndef QT_BOOTSTRAPPED
6549 # define QT_ARMFPA
6550 #endif
6552 else
6553 echo "#define QT_ARMFPA" >>"$outpath/src/corelib/global/qconfig.h.new"
6557 CFG_ARCH_STR=`echo $CFG_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6558 CFG_HOST_ARCH_STR=`echo $CFG_HOST_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6559 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6560 /* Machine Architecture */
6561 #ifndef QT_BOOTSTRAPPED
6562 # define QT_ARCH_${CFG_ARCH_STR}
6563 #else
6564 # define QT_ARCH_${CFG_HOST_ARCH_STR}
6565 #endif
6568 echo '/* Compile time features */' >>"$outpath/src/corelib/global/qconfig.h.new"
6569 [ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\"" >>"$outpath/src/corelib/global/qconfig.h.new"
6571 if [ "$CFG_LARGEFILE" = "yes" ]; then
6572 echo "#define QT_LARGEFILE_SUPPORT 64" >>"$outpath/src/corelib/global/qconfig.h.new"
6575 # if both carbon and cocoa are specified, enable the autodetection code.
6576 if [ "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then
6577 echo "#define AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
6578 elif [ "$CFG_MAC_COCOA" = "yes" ]; then
6579 echo "#define QT_MAC_USE_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new"
6582 if [ "$CFG_FRAMEWORK" = "yes" ]; then
6583 echo "#define QT_MAC_FRAMEWORK_BUILD" >>"$outpath/src/corelib/global/qconfig.h.new"
6586 if [ "$PLATFORM_MAC" = "yes" ]; then
6587 cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF
6588 #if defined(__LP64__)
6589 # define QT_POINTER_SIZE 8
6590 #else
6591 # define QT_POINTER_SIZE 4
6592 #endif
6594 else
6595 "$unixtests/ptrsize.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
6596 echo "#define QT_POINTER_SIZE $?" >>"$outpath/src/corelib/global/qconfig.h.new"
6600 echo "" >>"$outpath/src/corelib/global/qconfig.h.new"
6602 if [ "$CFG_DEV" = "yes" ]; then
6603 echo "#define QT_BUILD_INTERNAL" >>"$outpath/src/corelib/global/qconfig.h.new"
6606 # Embedded compile time options
6607 if [ "$PLATFORM_QWS" = "yes" ]; then
6608 # Add QWS to config.h
6609 QCONFIG_FLAGS="$QCONFIG_FLAGS Q_WS_QWS"
6611 # Add excluded decorations to $QCONFIG_FLAGS
6612 decors=`grep '^decorations -= ' "$QMAKE_VARS_FILE" | ${AWK} '{print $3}'`
6613 for decor in $decors; do
6614 NODECORATION=`echo $decor | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6615 QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_NO_QWS_DECORATION_${NODECORATION}"
6616 done
6618 # Figure which embedded drivers which are turned off
6619 CFG_GFX_OFF="$CFG_GFX_AVAILABLE"
6620 for ADRIVER in $CFG_GFX_ON; do
6621 CFG_GFX_OFF=`echo "${CFG_GFX_OFF} " | sed "s,${ADRIVER} ,,g"`
6622 done
6624 CFG_KBD_OFF="$CFG_KBD_AVAILABLE"
6625 # the um driver is currently not in the available list for external builds
6626 if [ "$CFG_DEV" = "no" ]; then
6627 CFG_KBD_OFF="$CFG_KBD_OFF um"
6629 for ADRIVER in $CFG_KBD_ON; do
6630 CFG_KBD_OFF=`echo "${CFG_KBD_OFF} " | sed "s,${ADRIVER} ,,g"`
6631 done
6633 CFG_MOUSE_OFF="$CFG_MOUSE_AVAILABLE"
6634 for ADRIVER in $CFG_MOUSE_ON; do
6635 CFG_MOUSE_OFF=`echo "${CFG_MOUSE_OFF} " | sed "s,${ADRIVER} ,,g"`
6636 done
6638 for DRIVER in $CFG_GFX_OFF; do
6639 NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6640 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_$NODRIVER"
6641 done
6643 for DRIVER in $CFG_KBD_OFF; do
6644 NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6645 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_KBD_$NODRIVER"
6646 done
6648 for DRIVER in $CFG_MOUSE_OFF; do
6649 NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6650 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_MOUSE_$NODRIVER"
6651 done
6652 fi # QWS
6654 if [ "${CFG_USE_FLOATMATH}" = "yes" ]; then
6655 QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_USE_MATH_H_FLOATS"
6658 # Add turned on SQL drivers
6659 for DRIVER in $CFG_SQL_AVAILABLE; do
6660 eval "VAL=\$CFG_SQL_$DRIVER"
6661 case "$VAL" in
6663 ONDRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6664 QCONFIG_FLAGS="$QCONFIG_FLAGS QT_SQL_$ONDRIVER"
6665 SQL_DRIVERS="$SQL_DRIVERS $DRIVER"
6667 plugin)
6668 SQL_PLUGINS="$SQL_PLUGINS $DRIVER"
6670 esac
6671 done
6674 QMakeVar set sql-drivers "$SQL_DRIVERS"
6675 QMakeVar set sql-plugins "$SQL_PLUGINS"
6677 # Add other configuration options to the qconfig.h file
6678 [ "$CFG_GIF" = "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_BUILTIN_GIF_READER=1"
6679 [ "$CFG_TIFF" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_TIFF"
6680 [ "$CFG_PNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_PNG"
6681 [ "$CFG_JPEG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_JPEG"
6682 [ "$CFG_MNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_MNG"
6683 [ "$CFG_ZLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB"
6684 [ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS"
6685 [ "$CFG_IPV6" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6"
6686 [ "$CFG_SXE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE"
6687 [ "$CFG_DBUS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_DBUS"
6689 if [ "$PLATFORM_QWS" != "yes" ]; then
6690 [ "$CFG_GRAPHICS_SYSTEM" = "raster" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RASTER"
6691 [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENGL"
6692 [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENVG"
6695 # X11/Unix/Mac only configs
6696 [ "$CFG_CUPS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CUPS"
6697 [ "$CFG_ICONV" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICONV"
6698 [ "$CFG_GLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLIB"
6699 [ "$CFG_GSTREAMER" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GSTREAMER"
6700 [ "$CFG_QGTKSTYLE" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_GTK"
6701 [ "$CFG_CLOCK_MONOTONIC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CLOCK_MONOTONIC"
6702 [ "$CFG_MREMAP" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MREMAP"
6703 [ "$CFG_GETADDRINFO" = "no" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETADDRINFO"
6704 [ "$CFG_IPV6IFNAME" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6IFNAME"
6705 [ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS"
6706 [ "$CFG_INOTIFY" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY"
6707 [ "$CFG_NAS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NAS"
6708 [ "$CFG_NIS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS"
6709 [ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL"
6710 [ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL"
6712 [ "$CFG_SM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SESSIONMANAGER"
6713 [ "$CFG_XCURSOR" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XCURSOR"
6714 [ "$CFG_XFIXES" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XFIXES"
6715 [ "$CFG_FONTCONFIG" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FONTCONFIG"
6716 [ "$CFG_XINERAMA" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINERAMA"
6717 [ "$CFG_XKB" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XKB"
6718 [ "$CFG_XRANDR" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRANDR"
6719 [ "$CFG_XRENDER" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRENDER"
6720 [ "$CFG_MITSHM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MITSHM"
6721 [ "$CFG_XSHAPE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE"
6722 [ "$CFG_XSYNC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC"
6723 [ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET"
6725 [ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR"
6726 [ "$CFG_XINERAMA" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINERAMA"
6727 [ "$CFG_XFIXES" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XFIXES"
6728 [ "$CFG_XRANDR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XRANDR"
6729 [ "$CFG_XINPUT" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XINPUT"
6731 # sort QCONFIG_FLAGS for neatness if we can
6732 [ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq`
6733 QCONFIG_FLAGS=`echo $QCONFIG_FLAGS`
6735 if [ -n "$QCONFIG_FLAGS" ]; then
6736 for cfg in $QCONFIG_FLAGS; do
6737 cfgd=`echo $cfg | sed 's/=.*$//'` # trim pushed 'Foo=Bar' defines
6738 cfg=`echo $cfg | sed 's/=/ /'` # turn first '=' into a space
6739 # figure out define logic, so we can output the correct
6740 # ifdefs to override the global defines in a project
6741 cfgdNeg=
6742 if [ true ] && echo "$cfgd" | grep 'QT_NO_' >/dev/null 2>&1; then
6743 # QT_NO_option can be forcefully turned on by QT_option
6744 cfgdNeg=`echo $cfgd | sed "s,QT_NO_,QT_,"`
6745 elif [ true ] && echo "$cfgd" | grep 'QT_' >/dev/null 2>&1; then
6746 # QT_option can be forcefully turned off by QT_NO_option
6747 cfgdNeg=`echo $cfgd | sed "s,QT_,QT_NO_,"`
6750 if [ -z $cfgdNeg ]; then
6751 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
6752 #ifndef $cfgd
6753 # define $cfg
6754 #endif
6757 else
6758 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
6759 #if defined($cfgd) && defined($cfgdNeg)
6760 # undef $cfgd
6761 #elif !defined($cfgd) && !defined($cfgdNeg)
6762 # define $cfg
6763 #endif
6767 done
6770 if [ "$CFG_REDUCE_EXPORTS" = "yes" ]; then
6771 cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF
6772 #define QT_VISIBILITY_AVAILABLE
6777 # avoid unecessary rebuilds by copying only if qconfig.h has changed
6778 if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
6779 rm -f "$outpath/src/corelib/global/qconfig.h.new"
6780 else
6781 [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h"
6782 mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
6783 chmod -w "$outpath/src/corelib/global/qconfig.h"
6784 for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
6785 if [ '!' -f "$conf" ]; then
6786 ln -s "$outpath/src/corelib/global/qconfig.h" "$conf"
6788 done
6791 #-------------------------------------------------------------------------------
6792 # save configuration into qconfig.pri
6793 #-------------------------------------------------------------------------------
6795 QTCONFIG="$outpath/mkspecs/qconfig.pri"
6796 QTCONFIG_CONFIG="$QTCONFIG_CONFIG no_mocdepend"
6797 [ -f "$QTCONFIG.tmp" ] && rm -f "$QTCONFIG.tmp"
6798 if [ "$CFG_DEBUG" = "yes" ]; then
6799 QTCONFIG_CONFIG="$QTCONFIG_CONFIG debug"
6800 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
6801 QT_CONFIG="$QT_CONFIG release"
6803 QT_CONFIG="$QT_CONFIG debug"
6804 elif [ "$CFG_DEBUG" = "no" ]; then
6805 QTCONFIG_CONFIG="$QTCONFIG_CONFIG release"
6806 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
6807 QT_CONFIG="$QT_CONFIG debug"
6809 QT_CONFIG="$QT_CONFIG release"
6811 if [ "$CFG_STL" = "yes" ]; then
6812 QTCONFIG_CONFIG="$QTCONFIG_CONFIG stl"
6814 if [ "$CFG_FRAMEWORK" = "no" ]; then
6815 QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_no_framework"
6816 else
6817 QT_CONFIG="$QT_CONFIG qt_framework"
6818 QTCONFIG_CONFIG="$QTCONFIG_CONFIG qt_framework"
6820 if [ "$PLATFORM_MAC" = "yes" ]; then
6821 QT_CONFIG="$QT_CONFIG $CFG_MAC_ARCHS"
6823 if [ "$CFG_DEV" = "yes" ]; then
6824 QT_CONFIG="$QT_CONFIG private_tests"
6827 # Make the application arch follow the Qt arch for single arch builds.
6828 # (for multiple-arch builds, set CONFIG manually in the application .pro file)
6829 if [ `echo "$CFG_MAC_ARCHS" | wc -w` -eq 1 ]; then
6830 QTCONFIG_CONFIG="$QTCONFIG_CONFIG $CFG_MAC_ARCHS"
6833 cat >>"$QTCONFIG.tmp" <<EOF
6834 #configuration
6835 CONFIG += $QTCONFIG_CONFIG
6836 QT_ARCH = $CFG_ARCH
6837 QT_EDITION = $Edition
6838 QT_CONFIG += $QT_CONFIG
6840 #versioning
6841 QT_VERSION = $QT_VERSION
6842 QT_MAJOR_VERSION = $QT_MAJOR_VERSION
6843 QT_MINOR_VERSION = $QT_MINOR_VERSION
6844 QT_PATCH_VERSION = $QT_PATCH_VERSION
6846 #namespaces
6847 QT_LIBINFIX = $QT_LIBINFIX
6848 QT_NAMESPACE = $QT_NAMESPACE
6849 QT_NAMESPACE_MAC_CRC = $QT_NAMESPACE_MAC_CRC
6852 if [ "$CFG_RPATH" = "yes" ]; then
6853 echo "QMAKE_RPATHDIR += \"$QT_INSTALL_LIBS\"" >> "$QTCONFIG.tmp"
6855 if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
6856 echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION" >> "$QTCONFIG.tmp"
6857 echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION" >> "$QTCONFIG.tmp"
6858 echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION" >> "$QTCONFIG.tmp"
6860 # replace qconfig.pri if it differs from the newly created temp file
6861 if cmp -s "$QTCONFIG.tmp" "$QTCONFIG"; then
6862 rm -f "$QTCONFIG.tmp"
6863 else
6864 mv -f "$QTCONFIG.tmp" "$QTCONFIG"
6867 #-------------------------------------------------------------------------------
6868 # save configuration into .qmake.cache
6869 #-------------------------------------------------------------------------------
6871 CACHEFILE="$outpath/.qmake.cache"
6872 [ -f "$CACHEFILE.tmp" ] && rm -f "$CACHEFILE.tmp"
6873 cat >>"$CACHEFILE.tmp" <<EOF
6874 CONFIG += $QMAKE_CONFIG dylib create_prl link_prl depend_includepath fix_output_dirs QTDIR_build
6875 QT_SOURCE_TREE = \$\$quote($relpath)
6876 QT_BUILD_TREE = \$\$quote($outpath)
6877 QT_BUILD_PARTS = $CFG_BUILD_PARTS
6878 QMAKE_ABSOLUTE_SOURCE_ROOT = \$\$QT_SOURCE_TREE
6879 QMAKE_MOC_SRC = \$\$QT_BUILD_TREE/src/moc
6881 #local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR
6882 QMAKE_MOC = \$\$QT_BUILD_TREE/bin/moc
6883 QMAKE_UIC = \$\$QT_BUILD_TREE/bin/uic
6884 QMAKE_UIC3 = \$\$QT_BUILD_TREE/bin/uic3
6885 QMAKE_RCC = \$\$QT_BUILD_TREE/bin/rcc
6886 QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp
6887 QMAKE_INCDIR_QT = \$\$QT_BUILD_TREE/include
6888 QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib
6892 if [ -n "$QT_CFLAGS_PSQL" ]; then
6893 echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$CACHEFILE.tmp"
6895 if [ -n "$QT_LFLAGS_PSQL" ]; then
6896 echo "QT_LFLAGS_PSQL = $QT_LFLAGS_PSQL" >> "$CACHEFILE.tmp"
6898 if [ -n "$QT_CFLAGS_MYSQL" ]; then
6899 echo "QT_CFLAGS_MYSQL = $QT_CFLAGS_MYSQL" >> "$CACHEFILE.tmp"
6901 if [ -n "$QT_LFLAGS_MYSQL" ]; then
6902 echo "QT_LFLAGS_MYSQL = $QT_LFLAGS_MYSQL" >> "$CACHEFILE.tmp"
6904 if [ -n "$QT_CFLAGS_SQLITE" ]; then
6905 echo "QT_CFLAGS_SQLITE = $QT_CFLAGS_SQLITE" >> "$CACHEFILE.tmp"
6907 if [ -n "$QT_LFLAGS_SQLITE" ]; then
6908 echo "QT_LFLAGS_SQLITE = $QT_LFLAGS_SQLITE" >> "$CACHEFILE.tmp"
6910 if [ -n "$QT_LFLAGS_ODBC" ]; then
6911 echo "QT_LFLAGS_ODBC = $QT_LFLAGS_ODBC" >> "$CACHEFILE.tmp"
6914 if [ "$QT_EDITION" != "QT_EDITION_OPENSOURCE" ]; then
6915 echo "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" >> "$CACHEFILE.tmp"
6918 #dump in the OPENSSL_LIBS info
6919 if [ '!' -z "$OPENSSL_LIBS" ]; then
6920 echo "OPENSSL_LIBS = $OPENSSL_LIBS" >> "$CACHEFILE.tmp"
6921 elif [ "$CFG_OPENSSL" = "linked" ]; then
6922 echo "OPENSSL_LIBS = -lssl -lcrypto" >> "$CACHEFILE.tmp"
6925 #dump in the SDK info
6926 if [ '!' -z "$CFG_SDK" ]; then
6927 echo "QMAKE_MAC_SDK = $CFG_SDK" >> "$CACHEFILE.tmp"
6930 # mac gcc -Xarch support
6931 if [ "$CFG_MAC_XARCH" = "no" ]; then
6932 echo "QMAKE_MAC_XARCH = no" >> "$CACHEFILE.tmp"
6935 #dump the qmake spec
6936 if [ -d "$outpath/mkspecs/$XPLATFORM" ]; then
6937 echo "QMAKESPEC = \$\$QT_BUILD_TREE/mkspecs/$XPLATFORM" >> "$CACHEFILE.tmp"
6938 else
6939 echo "QMAKESPEC = $XPLATFORM" >> "$CACHEFILE.tmp"
6942 # cmdline args
6943 cat "$QMAKE_VARS_FILE" >> "$CACHEFILE.tmp"
6944 rm -f "$QMAKE_VARS_FILE" 2>/dev/null
6946 # incrementals
6947 INCREMENTAL=""
6948 [ "$CFG_INCREMENTAL" = "auto" ] && "$WHICH" p4 >/dev/null 2>&1 && [ "$CFG_DEV" = "yes" ] && CFG_INCREMENTAL="yes"
6949 if [ "$CFG_INCREMENTAL" = "yes" ]; then
6950 find "$relpath" -perm u+w -mtime -3 | grep 'cpp$' | while read f; do
6951 # don't need to worry about generated files
6952 [ -r `echo $f | sed "s,cpp$,ui,"` ] && continue
6953 basename "$f" | grep '^moc_' >/dev/null 2>&1 && continue
6954 # done
6955 INCREMENTAL="$INCREMENTAL `basename \"$f\" | sed 's,.cpp,.o,'`"
6956 done
6957 [ '!' -z "$INCREMENTAL" ] && echo "QMAKE_INCREMENTAL += $INCREMENTAL" >> "$CACHEFILE.tmp"
6958 [ -r "$outpath/.qmake.incremental" ] && echo "include($outpath/.qmake.incremental)" >> "$CACHEFILE.tmp"
6961 # replace .qmake.cache if it differs from the newly created temp file
6962 if cmp -s "$CACHEFILE.tmp" "$CACHEFILE"; then
6963 rm -f "$CACHEFILE.tmp"
6964 else
6965 mv -f "$CACHEFILE.tmp" "$CACHEFILE"
6968 #-------------------------------------------------------------------------------
6969 # give feedback on configuration
6970 #-------------------------------------------------------------------------------
6972 case "$COMPILER" in
6973 g++*)
6974 if [ "$CFG_EXCEPTIONS" != "no" ]; then
6975 cat <<EOF
6977 This target is using the GNU C++ compiler ($PLATFORM).
6979 Recent versions of this compiler automatically include code for
6980 exceptions, which increase both the size of the Qt libraries and
6981 the amount of memory taken by your applications.
6983 You may choose to re-run `basename $0` with the -no-exceptions
6984 option to compile Qt without exceptions. This is completely binary
6985 compatible, and existing applications will continue to work.
6990 cc*)
6991 case "$PLATFORM" in
6992 irix-cc*)
6993 if [ "$CFG_EXCEPTIONS" != "no" ]; then
6994 cat <<EOF
6996 This target is using the MIPSpro C++ compiler ($PLATFORM).
6998 You may choose to re-run `basename $0` with the -no-exceptions
6999 option to compile Qt without exceptions. This will make the
7000 size of the Qt library smaller and reduce the amount of memory
7001 taken by your applications.
7006 *) ;;
7007 esac
7009 *) ;;
7010 esac
7012 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" == "no" ] && [ "$CFG_WEBKIT" = "yes" ] && [ "$CFG_DEBUG_RELEASE" == "yes" ]; then
7013 cat <<EOF
7014 WARNING: DWARF2 debug symbols are not enabled. Linking webkit
7015 in debug mode will run out of memory on systems with 2GB or less.
7016 Install Xcode 2.4.1 or higher to enable DWARF2, or configure with
7017 -no-webkit or -release to skip webkit debug.
7021 echo
7022 if [ "$XPLATFORM" = "$PLATFORM" ]; then
7023 echo "Build type: $PLATFORM"
7024 else
7025 echo "Building on: $PLATFORM"
7026 echo "Building for: $XPLATFORM"
7029 if [ "$PLATFORM_MAC" = "yes" ]; then
7030 echo "Architecture: $CFG_ARCH ($CFG_MAC_ARCHS )"
7031 else
7032 echo "Architecture: $CFG_ARCH"
7035 if [ "$PLATFORM_QWS" = "yes" ]; then
7036 echo "Host architecture: $CFG_HOST_ARCH"
7039 if [ "$PLATFORM_MAC" = "yes" ]; then
7040 if [ "$CFG_MAC_COCOA" = "yes" ]; then
7041 if [ "$CFG_MAC_CARBON" = "yes" ]; then
7042 echo "Using framework: Carbon for 32-bit, Cocoa for 64-bit"
7043 else
7044 echo "Using framework: Cocoa"
7046 else
7047 echo "Using framework: Carbon"
7051 if [ -n "$PLATFORM_NOTES" ]; then
7052 echo "Platform notes:"
7053 echo "$PLATFORM_NOTES"
7054 else
7055 echo
7058 if [ "$OPT_VERBOSE" = "yes" ]; then
7059 if echo '\c' | grep '\c' >/dev/null; then
7060 echo -n "qmake vars .......... "
7061 else
7062 echo "qmake vars .......... \c"
7064 cat "$QMAKE_VARS_FILE" | tr '\n' ' '
7065 echo "qmake switches ...... $QMAKE_SWITCHES"
7068 [ "$CFG_INCREMENTAL" = "yes" ] && [ '!' -z "$INCREMENTAL" ] && echo "Incremental ......... $INCREMENTAL"
7069 echo "Build ............... $CFG_BUILD_PARTS"
7070 echo "Configuration ....... $QMAKE_CONFIG $QT_CONFIG"
7071 if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
7072 echo "Debug ............... yes (combined)"
7073 if [ "$CFG_DEBUG" = "yes" ]; then
7074 echo "Default Link ........ debug"
7075 else
7076 echo "Default Link ........ release"
7078 else
7079 echo "Debug ............... $CFG_DEBUG"
7081 echo "Qt 3 compatibility .. $CFG_QT3SUPPORT"
7082 [ "$CFG_DBUS" = "no" ] && echo "QtDBus module ....... no"
7083 [ "$CFG_DBUS" = "yes" ] && echo "QtDBus module ....... yes (run-time)"
7084 [ "$CFG_DBUS" = "linked" ] && echo "QtDBus module ....... yes (linked)"
7085 echo "QtConcurrent code.... $CFG_CONCURRENT"
7086 echo "QtScriptTools module $CFG_SCRIPTTOOLS"
7087 echo "QtXmlPatterns module $CFG_XMLPATTERNS"
7088 echo "Phonon module ....... $CFG_PHONON"
7089 echo "SVG module .......... $CFG_SVG"
7090 echo "WebKit module ....... $CFG_WEBKIT"
7091 echo "STL support ......... $CFG_STL"
7092 echo "PCH support ......... $CFG_PRECOMPILE"
7093 echo "MMX/3DNOW/SSE/SSE2.. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}"
7094 if [ "${CFG_ARCH}" = "arm" ]; then
7095 echo "iWMMXt support ...... ${CFG_IWMMXT}"
7097 [ "${PLATFORM_QWS}" != "yes" ] && echo "Graphics System ..... $CFG_GRAPHICS_SYSTEM"
7098 echo "IPv6 support ........ $CFG_IPV6"
7099 echo "IPv6 ifname support . $CFG_IPV6IFNAME"
7100 echo "getaddrinfo support . $CFG_GETADDRINFO"
7101 echo "getifaddrs support .. $CFG_GETIFADDRS"
7102 echo "Accessibility ....... $CFG_ACCESSIBILITY"
7103 echo "NIS support ......... $CFG_NIS"
7104 echo "CUPS support ........ $CFG_CUPS"
7105 echo "Iconv support ....... $CFG_ICONV"
7106 echo "Glib support ........ $CFG_GLIB"
7107 echo "GStreamer support ... $CFG_GSTREAMER"
7108 echo "Large File support .. $CFG_LARGEFILE"
7109 echo "GIF support ......... $CFG_GIF"
7110 if [ "$CFG_TIFF" = "no" ]; then
7111 echo "TIFF support ........ $CFG_TIFF"
7112 else
7113 echo "TIFF support ........ $CFG_TIFF ($CFG_LIBTIFF)"
7115 if [ "$CFG_JPEG" = "no" ]; then
7116 echo "JPEG support ........ $CFG_JPEG"
7117 else
7118 echo "JPEG support ........ $CFG_JPEG ($CFG_LIBJPEG)"
7120 if [ "$CFG_PNG" = "no" ]; then
7121 echo "PNG support ......... $CFG_PNG"
7122 else
7123 echo "PNG support ......... $CFG_PNG ($CFG_LIBPNG)"
7125 if [ "$CFG_MNG" = "no" ]; then
7126 echo "MNG support ......... $CFG_MNG"
7127 else
7128 echo "MNG support ......... $CFG_MNG ($CFG_LIBMNG)"
7130 echo "zlib support ........ $CFG_ZLIB"
7131 echo "Session management .. $CFG_SM"
7132 if [ "$PLATFORM_QWS" = "yes" ]; then
7133 echo "Embedded support .... $CFG_EMBEDDED"
7134 if [ "$CFG_QWS_FREETYPE" = "auto" ]; then
7135 echo "Freetype2 support ... $CFG_QWS_FREETYPE ($CFG_LIBFREETYPE)"
7136 else
7137 echo "Freetype2 support ... $CFG_QWS_FREETYPE"
7139 # Normalize the decoration output first
7140 CFG_GFX_ON=`echo ${CFG_GFX_ON}`
7141 CFG_GFX_PLUGIN=`echo ${CFG_GFX_PLUGIN}`
7142 echo "Graphics (qt) ....... ${CFG_GFX_ON}"
7143 echo "Graphics (plugin) ... ${CFG_GFX_PLUGIN}"
7144 CFG_DECORATION_ON=`echo ${CFG_DECORATION_ON}`
7145 CFG_DECORATION_PLUGIN=`echo ${CFG_DECORATION_PLUGIN}`
7146 echo "Decorations (qt) .... $CFG_DECORATION_ON"
7147 echo "Decorations (plugin) $CFG_DECORATION_PLUGIN"
7148 CFG_KBD_ON=`echo ${CFG_KBD_ON}`
7149 CFG_KBD_PLUGIN=`echo ${CFG_KBD_PLUGIN}`
7150 echo "Keyboard driver (qt). ${CFG_KBD_ON}"
7151 echo "Keyboard driver (plugin) ${CFG_KBD_PLUGIN}"
7152 CFG_MOUSE_ON=`echo ${CFG_MOUSE_ON}`
7153 CFG_MOUSE_PLUGIN=`echo ${CFG_MOUSE_PLUGIN}`
7154 echo "Mouse driver (qt) ... $CFG_MOUSE_ON"
7155 echo "Mouse driver (plugin) $CFG_MOUSE_PLUGIN"
7157 if [ "$CFG_OPENGL" = "desktop" ]; then
7158 echo "OpenGL support ...... yes (Desktop OpenGL)"
7159 elif [ "$CFG_OPENGL" = "es1" ]; then
7160 echo "OpenGL support ...... yes (OpenGL ES 1.x Common profile)"
7161 elif [ "$CFG_OPENGL" = "es1cl" ]; then
7162 echo "OpenGL support ...... yes (OpenGL ES 1.x Common Lite profile)"
7163 elif [ "$CFG_OPENGL" = "es2" ]; then
7164 echo "OpenGL support ...... yes (OpenGL ES 2.x)"
7165 else
7166 echo "OpenGL support ...... no"
7168 if [ "$CFG_EGL" != "no" ]; then
7169 if [ "$CFG_EGL_GLES_INCLUDES" != "no" ]; then
7170 echo "EGL support ......... yes <GLES/egl.h>"
7171 else
7172 echo "EGL support ......... yes <EGL/egl.h>"
7175 if [ "$CFG_OPENVG" ]; then
7176 if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
7177 echo "OpenVG support ...... ShivaVG"
7178 else
7179 echo "OpenVG support ...... $CFG_OPENVG"
7182 if [ "$PLATFORM_X11" = "yes" ]; then
7183 echo "NAS sound support ... $CFG_NAS"
7184 echo "XShape support ...... $CFG_XSHAPE"
7185 echo "XSync support ....... $CFG_XSYNC"
7186 echo "Xinerama support .... $CFG_XINERAMA"
7187 echo "Xcursor support ..... $CFG_XCURSOR"
7188 echo "Xfixes support ...... $CFG_XFIXES"
7189 echo "Xrandr support ...... $CFG_XRANDR"
7190 echo "Xrender support ..... $CFG_XRENDER"
7191 echo "Xi support .......... $CFG_XINPUT"
7192 echo "MIT-SHM support ..... $CFG_MITSHM"
7193 echo "FontConfig support .. $CFG_FONTCONFIG"
7194 echo "XKB Support ......... $CFG_XKB"
7195 echo "immodule support .... $CFG_IM"
7196 echo "GTK theme support ... $CFG_QGTKSTYLE"
7198 [ "$CFG_SQL_mysql" != "no" ] && echo "MySQL support ....... $CFG_SQL_mysql"
7199 [ "$CFG_SQL_psql" != "no" ] && echo "PostgreSQL support .. $CFG_SQL_psql"
7200 [ "$CFG_SQL_odbc" != "no" ] && echo "ODBC support ........ $CFG_SQL_odbc"
7201 [ "$CFG_SQL_oci" != "no" ] && echo "OCI support ......... $CFG_SQL_oci"
7202 [ "$CFG_SQL_tds" != "no" ] && echo "TDS support ......... $CFG_SQL_tds"
7203 [ "$CFG_SQL_db2" != "no" ] && echo "DB2 support ......... $CFG_SQL_db2"
7204 [ "$CFG_SQL_ibase" != "no" ] && echo "InterBase support ... $CFG_SQL_ibase"
7205 [ "$CFG_SQL_sqlite2" != "no" ] && echo "SQLite 2 support .... $CFG_SQL_sqlite2"
7206 [ "$CFG_SQL_sqlite" != "no" ] && echo "SQLite support ...... $CFG_SQL_sqlite ($CFG_SQLITE)"
7208 OPENSSL_LINKAGE=""
7209 if [ "$CFG_OPENSSL" = "yes" ]; then
7210 OPENSSL_LINKAGE="(run-time)"
7211 elif [ "$CFG_OPENSSL" = "linked" ]; then
7212 OPENSSL_LINKAGE="(linked)"
7214 echo "OpenSSL support ..... $CFG_OPENSSL $OPENSSL_LINKAGE"
7216 [ "$CFG_PTMALLOC" != "no" ] && echo "Use ptmalloc ........ $CFG_PTMALLOC"
7218 # complain about not being able to use dynamic plugins if we are using a static build
7219 if [ "$CFG_SHARED" = "no" ]; then
7220 echo
7221 echo "WARNING: Using static linking will disable the use of dynamically"
7222 echo "loaded plugins. Make sure to import all needed static plugins,"
7223 echo "or compile needed modules into the library."
7224 echo
7226 if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
7227 echo
7228 echo "NOTE: When linking against OpenSSL, you can override the default"
7229 echo "library names through OPENSSL_LIBS."
7230 echo "For example:"
7231 echo " ./configure -openssl-linked OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto'"
7232 echo
7234 if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "no" ]; then
7235 echo
7236 echo "NOTE: Mac OS X frameworks implicitly build debug and release Qt libraries."
7237 echo
7239 echo
7241 sepath=`echo "$relpath" | sed -e 's/\\./\\\\./g'`
7242 PROCS=1
7243 EXEC=""
7246 #-------------------------------------------------------------------------------
7247 # build makefiles based on the configuration
7248 #-------------------------------------------------------------------------------
7250 echo "Finding project files. Please wait..."
7251 "$outpath/bin/qmake" -prl -r "${relpath}/projects.pro"
7252 if [ -f "${relpath}/projects.pro" ]; then
7253 mkfile="${outpath}/Makefile"
7254 [ -f "$mkfile" ] && chmod +w "$mkfile"
7255 QTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" "${relpath}/projects.pro" -o "$mkfile"
7258 # .projects -> projects to process
7259 # .projects.1 -> qt and moc
7260 # .projects.2 -> subdirs and libs
7261 # .projects.3 -> the rest
7262 rm -f .projects .projects.1 .projects.2 .projects.3
7264 QMAKE_PROJECTS=`find "$relpath/." -name '*.pro' -print | sed 's-/\./-/-'`
7265 if [ -z "$AWK" ]; then
7266 for p in `echo $QMAKE_PROJECTS`; do
7267 echo "$p" >> .projects
7268 done
7269 else
7270 cat >projects.awk <<EOF
7271 BEGIN {
7272 files = 0
7273 target_file = ""
7274 input_file = ""
7276 first = "./.projects.1.tmp"
7277 second = "./.projects.2.tmp"
7278 third = "./.projects.3.tmp"
7281 FNR == 1 {
7282 if ( input_file ) {
7283 if ( ! target_file )
7284 target_file = third
7285 print input_file >target_file
7288 matched_target = 0
7289 template_lib = 0
7290 input_file = FILENAME
7291 target_file = ""
7294 /^(TARGET.*=)/ {
7295 if ( \$3 == "moc" || \$3 ~ /^Qt/ ) {
7296 target_file = first
7297 matched_target = 1
7301 matched_target == 0 && /^(TEMPLATE.*=)/ {
7302 if ( \$3 == "subdirs" )
7303 target_file = second
7304 else if ( \$3 == "lib" )
7305 template_lib = 1
7306 else
7307 target_file = third
7310 matched_target == 0 && template_lib == 1 && /^(CONFIG.*=)/ {
7311 if ( \$0 ~ /plugin/ )
7312 target_file = third
7313 else
7314 target_file = second
7317 END {
7318 if ( input_file ) {
7319 if ( ! target_file )
7320 target_file = third
7321 print input_file >>target_file
7327 rm -f .projects.all
7328 for p in `echo $QMAKE_PROJECTS`; do
7329 echo "$p" >> .projects.all
7330 done
7332 # if you get errors about the length of the command line to awk, change the -l arg
7333 # to split below
7334 split -l 100 .projects.all .projects.all.
7335 for p in .projects.all.*; do
7336 "$AWK" -f projects.awk `cat $p`
7337 [ -f .projects.1.tmp ] && cat .projects.1.tmp >> .projects.1
7338 [ -f .projects.2.tmp ] && cat .projects.2.tmp >> .projects.2
7339 [ -f .projects.3.tmp ] && cat .projects.3.tmp >> .projects.3
7340 rm -f .projects.1.tmp .projects.2.tmp .projects.3.tmp $p
7341 done
7342 rm -f .projects.all* projects.awk
7344 [ -f .projects.1 ] && cat .projects.1 >>.projects
7345 [ -f .projects.2 ] && cat .projects.2 >>.projects
7346 rm -f .projects.1 .projects.2
7347 if [ -f .projects.3 ] && [ "$OPT_FAST" = "no" ]; then
7348 cat .projects.3 >>.projects
7349 rm -f .projects.3
7352 # don't sort Qt and MOC in with the other project files
7353 # also work around a segfaulting uniq(1)
7354 if [ -f .sorted.projects.2 ]; then
7355 sort .sorted.projects.2 > .sorted.projects.2.new
7356 mv -f .sorted.projects.2.new .sorted.projects.2
7357 cat .sorted.projects.2 >> .sorted.projects.1
7359 [ -f .sorted.projects.1 ] && sort .sorted.projects.1 >> .sorted.projects
7360 rm -f .sorted.projects.2 .sorted.projects.1
7362 NORM_PROJECTS=0
7363 FAST_PROJECTS=0
7364 if [ -f .projects ]; then
7365 uniq .projects >.tmp
7366 mv -f .tmp .projects
7367 NORM_PROJECTS=`cat .projects | wc -l | sed -e "s, ,,g"`
7369 if [ -f .projects.3 ]; then
7370 uniq .projects.3 >.tmp
7371 mv -f .tmp .projects.3
7372 FAST_PROJECTS=`cat .projects.3 | wc -l | sed -e "s, ,,g"`
7374 echo " `expr $NORM_PROJECTS + $FAST_PROJECTS` projects found."
7375 echo
7377 PART_ROOTS=
7378 for part in $CFG_BUILD_PARTS; do
7379 case "$part" in
7380 tools) PART_ROOTS="$PART_ROOTS tools" ;;
7381 libs) PART_ROOTS="$PART_ROOTS src" ;;
7382 examples) PART_ROOTS="$PART_ROOTS examples demos" ;;
7383 *) ;;
7384 esac
7385 done
7387 if [ "$CFG_DEV" = "yes" ]; then
7388 PART_ROOTS="$PART_ROOTS tests"
7391 echo "Creating makefiles. Please wait..."
7392 for file in .projects .projects.3; do
7393 [ '!' -f "$file" ] && continue
7394 for a in `cat $file`; do
7395 IN_ROOT=no
7396 for r in $PART_ROOTS; do
7397 if echo "$a" | grep "^$r" >/dev/null 2>&1 || echo "$a" | grep "^$relpath/$r" >/dev/null 2>&1; then
7398 IN_ROOT=yes
7399 break
7401 done
7402 [ "$IN_ROOT" = "no" ] && continue
7404 case $a in
7405 *winmain/winmain.pro) continue ;;
7406 */qmake/qmake.pro) continue ;;
7407 *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*) SPEC=$QMAKESPEC ;;
7408 *) SPEC=$XQMAKESPEC ;;
7409 esac
7410 dir=`dirname "$a" | sed -e "s;$sepath;.;g"`
7411 test -d "$dir" || mkdir -p "$dir"
7412 OUTDIR="$outpath/$dir"
7413 if [ -f "${OUTDIR}/Makefile" ] && [ "$OPT_FAST" = "yes" ]; then
7414 # fast configure - the makefile exists, skip it
7415 # since the makefile exists, it was generated by qmake, which means we
7416 # can skip it, since qmake has a rule to regenerate the makefile if the .pro
7417 # file changes...
7418 [ "$OPT_VERBOSE" = "yes" ] && echo " skipping $a"
7419 continue;
7421 QMAKE_SPEC_ARGS="-spec $SPEC"
7422 if echo '\c' | grep '\c' >/dev/null; then
7423 echo -n " for $a"
7424 else
7425 echo " for $a\c"
7428 QMAKE="$outpath/bin/qmake"
7429 QMAKE_ARGS="$QMAKE_SWITCHES $QMAKE_SPEC_ARGS"
7430 if [ "$file" = ".projects.3" ]; then
7431 if echo '\c' | grep '\c' >/dev/null; then
7432 echo -n " (fast)"
7433 else
7434 echo " (fast)\c"
7436 echo
7438 cat >"${OUTDIR}/Makefile" <<EOF
7439 # ${OUTDIR}/Makefile: generated by configure
7441 # WARNING: This makefile will be replaced with a real makefile.
7442 # All changes made to this file will be lost.
7444 [ "$CFG_DEBUG_RELEASE" = "no" ] && echo "first_target: first" >>${OUTDIR}/Makefile
7446 cat >>"${OUTDIR}/Makefile" <<EOF
7447 QMAKE = "$QMAKE"
7448 all clean install qmake first Makefile: FORCE
7449 \$(QMAKE) $QMAKE_ARGS -o "$OUTDIR" "$a"
7450 cd "$OUTDIR"
7451 \$(MAKE) \$@
7453 FORCE:
7456 else
7457 if [ "$OPT_VERBOSE" = "yes" ]; then
7458 echo " (`basename $SPEC`)"
7459 echo "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
7460 else
7461 echo
7464 [ -f "${OUTDIR}/Makefile" ] && chmod +w "${OUTDIR}/Makefile"
7465 QTDIR="$outpath" "$QMAKE" $QMAKE_ARGS -o "$OUTDIR" "$a"
7467 done
7468 done
7469 rm -f .projects .projects.3
7471 #-------------------------------------------------------------------------------
7472 # XShape is important, DnD in the Designer doens't work without it
7473 #-------------------------------------------------------------------------------
7474 if [ "$PLATFORM_X11" = "yes" ] && [ "$CFG_XSHAPE" = "no" ]; then
7475 cat <<EOF
7477 NOTICE: Qt will not be built with XShape support.
7479 As a result, drag-and-drop in the Qt Designer will NOT
7480 work. We recommend that you enable XShape support by passing
7481 the -xshape switch to $0.
7485 #-------------------------------------------------------------------------------
7486 # check for platforms that we don't yet know about
7487 #-------------------------------------------------------------------------------
7488 if [ "$CFG_ARCH" = "generic" ]; then
7489 cat <<EOF
7491 NOTICE: Atomic operations are not yet supported for this
7492 architecture.
7494 Qt will use the 'generic' architecture instead, which uses a
7495 single pthread_mutex_t to protect all atomic operations. This
7496 implementation is the slow (but safe) fallback implementation
7497 for architectures Qt does not yet support.
7501 #-------------------------------------------------------------------------------
7502 # check if the user passed the -no-zlib option, which is no longer supported
7503 #-------------------------------------------------------------------------------
7504 if [ -n "$ZLIB_FORCED" ]; then
7505 which_zlib="supplied"
7506 if [ "$CFG_ZLIB" = "system" ]; then
7507 which_zlib="system"
7510 cat <<EOF
7512 NOTICE: The -no-zlib option was supplied but is no longer
7513 supported.
7515 Qt now requires zlib support in all builds, so the -no-zlib
7516 option was ignored. Qt will be built using the $which_zlib
7517 zlib.
7521 #-------------------------------------------------------------------------------
7522 # finally save the executed command to another script
7523 #-------------------------------------------------------------------------------
7524 if [ `basename $0` != "config.status" ]; then
7525 CONFIG_STATUS="$relpath/$relconf $OPT_CMDLINE"
7527 # add the system variables
7528 for varname in $SYSTEM_VARIABLES; do
7529 cmd=`echo \
7530 'if [ -n "\$'${varname}'" ]; then
7531 CONFIG_STATUS="'${varname}'='"'\\\$${varname}'"' \$CONFIG_STATUS"
7532 fi'`
7533 eval "$cmd"
7534 done
7536 echo "$CONFIG_STATUS" | grep '\-confirm\-license' >/dev/null 2>&1 || CONFIG_STATUS="$CONFIG_STATUS -confirm-license"
7538 [ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
7539 echo "#!/bin/sh" > "$outpath/config.status"
7540 echo "if [ \"\$#\" -gt 0 ]; then" >> "$outpath/config.status"
7541 echo " $CONFIG_STATUS \"\$@\"" >> "$outpath/config.status"
7542 echo "else" >> "$outpath/config.status"
7543 echo " $CONFIG_STATUS" >> "$outpath/config.status"
7544 echo "fi" >> "$outpath/config.status"
7545 chmod +x "$outpath/config.status"
7548 if [ -n "$RPATH_MESSAGE" ]; then
7549 echo
7550 echo "$RPATH_MESSAGE"
7553 MAKE=`basename "$MAKE"`
7554 echo
7555 echo Qt is now configured for building. Just run \'$MAKE\'.
7556 if [ "$relpath" = "$QT_INSTALL_PREFIX" ]; then
7557 echo Once everything is built, Qt is installed.
7558 echo You should not run \'$MAKE install\'.
7559 else
7560 echo Once everything is built, you must run \'$MAKE install\'.
7561 echo Qt will be installed into $QT_INSTALL_PREFIX
7563 echo
7564 echo To reconfigure, run \'$MAKE confclean\' and \'configure\'.
7565 echo