-
Notifications
You must be signed in to change notification settings - Fork 86
/
configure
executable file
·7857 lines (7265 loc) · 267 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
#############################################################################
##
## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
## This file is the build configuration utility of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## No Commercial Usage
## This file contains pre-release code and may not be distributed.
## You may use this file in accordance with the terms and conditions
## contained in the Technology Preview License Agreement accompanying
## this package.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, Nokia gives you certain additional
## rights. These rights are described in the Nokia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
## If you have questions regarding the use of this file, please contact
## Nokia at qt-info@nokia.com.
##
##
##
##
##
##
##
##
## $QT_END_LICENSE$
##
#############################################################################
#-------------------------------------------------------------------------------
# script initialization
#-------------------------------------------------------------------------------
# the name of this script
relconf=`basename $0`
# the directory of this script is the "source tree"
relpath=`dirname $0`
relpath=`(cd "$relpath"; /bin/pwd)`
# the current directory is the "build tree" or "object tree"
outpath=`/bin/pwd`
#license file location
LICENSE_FILE="$QT_LICENSE_FILE"
[ -z "$LICENSE_FILE" ] && LICENSE_FILE="$HOME/.qt-license"
if [ -f "$LICENSE_FILE" ]; then
tr -d '\r' <"$LICENSE_FILE" >"${LICENSE_FILE}.tmp"
diff "${LICENSE_FILE}.tmp" "${LICENSE_FILE}" >/dev/null 2>&1 || LICENSE_FILE="${LICENSE_FILE}.tmp"
fi
# later cache the command line in config.status
OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"`
# initialize global variables
QMAKE_SWITCHES=
QMAKE_VARS=
QMAKE_CONFIG=
QTCONFIG_CONFIG=
QT_CONFIG=
SUPPORTED=
QMAKE_VARS_FILE=.qmake.vars
:> "$QMAKE_VARS_FILE"
#-------------------------------------------------------------------------------
# utility functions
#-------------------------------------------------------------------------------
shellEscape()
{
echo "$@" | sed 's/ /\ /g'
}
# Adds a new qmake variable to the cache
# Usage: QMakeVar mode varname contents
# where mode is one of: set, add, del
QMakeVar()
{
case "$1" in
set)
eq="="
;;
add)
eq="+="
;;
del)
eq="-="
;;
*)
echo >&2 "BUG: wrong command to QMakeVar: $1"
;;
esac
echo "$2" "$eq" "$3" >> "$QMAKE_VARS_FILE"
}
# relies on $QMAKESPEC being set correctly. parses include statements in
# qmake.conf and prints out the expanded file
getQMakeConf()
{
tmpSPEC="$QMAKESPEC"
if [ -n "$1" ]; then
tmpSPEC="$1"
fi
$AWK -v "QMAKESPEC=$tmpSPEC" '
/^include\(.+\)$/{
fname = QMAKESPEC "/" substr($0, 9, length($0) - 9)
while ((getline line < fname) > 0)
print line
close(fname)
next
}
{ print }' "$tmpSPEC/qmake.conf"
}
# relies on $TEST_COMPILER being set correctly
compilerSupportsFlag()
{
cat >conftest.cpp <<EOF
int main() { return 0; }
EOF
"$TEST_COMPILER" "$@" -o /dev/null conftest.cpp
ret=$?
rm -f conftest.cpp conftest.o
return $ret
}
# relies on $TEST_COMPILER being set correctly
linkerSupportsFlag()
{
lflags=-Wl
for flag
do
safe_flag=`shellEscape "$flag"`
lflags=$lflags,$safe_flag
done
compilerSupportsFlag "$lflags" >/dev/null 2>&1
}
#-------------------------------------------------------------------------------
# operating system detection
#-------------------------------------------------------------------------------
# need that throughout the script
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
#-------------------------------------------------------------------------------
# window system detection
#-------------------------------------------------------------------------------
PLATFORM_X11=no
PLATFORM_MAC=no
PLATFORM_QWS=no
if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ] && [ -d /System/Library/Frameworks/Carbon.framework ]; then
# Qt/Mac
# ~ the Carbon SDK exists
# ~ src/gui/base/qapplication_mac.cpp is present
# ~ this is the internal edition and Qt/Mac sources exist
PLATFORM_MAC=maybe
elif [ -f "$relpath"/src/gui/kernel/qapplication_qws.cpp ]; then
# Qt Embedded
# ~ src/gui/base/qapplication_qws.cpp is present
# ~ this is the free or commercial edition
# ~ this is the internal edition and Qt Embedded is explicitly enabled
if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ]; then
# This is a depot build, or an all-platforms package
PLATFORM_QWS=maybe
else
# This must be the embedded package, since the Qt/Mac source files are not present
PLATFORM_QWS=yes
fi
fi
#-----------------------------------------------------------------------------
# Qt version detection
#-----------------------------------------------------------------------------
QT_VERSION=`grep '^# *define *QT_VERSION_STR' "$relpath"/src/corelib/global/qglobal.h`
QT_MAJOR_VERSION=
QT_MINOR_VERSION=0
QT_PATCH_VERSION=0
if [ -n "$QT_VERSION" ]; then
QT_VERSION=`echo $QT_VERSION | sed 's,^# *define *QT_VERSION_STR *"*\([^ ]*\)"$,\1,'`
MAJOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\1,'`
if [ -n "$MAJOR" ]; then
MINOR=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\2,'`
PATCH=`echo $QT_VERSION | sed 's,^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*,\3,'`
QT_MAJOR_VERSION="$MAJOR"
[ -z "$MINOR" ] || QT_MINOR_VERSION="$MINOR"
[ -z "$PATCH" ] || QT_PATCH_VERSION="$PATCH"
fi
fi
if [ -z "$QT_MAJOR_VERSION" ]; then
echo "Cannot process version from qglobal.h: $QT_VERSION"
echo "Cannot proceed."
exit 1
fi
QT_PACKAGEDATE=`grep '^# *define *QT_PACKAGEDATE_STR' "$relpath"/src/corelib/global/qglobal.h | sed -e 's,^# *define *QT_PACKAGEDATE_STR *"\([^ ]*\)"$,\1,' -e s,-,,g`
if [ -z "$QT_PACKAGEDATE" ]; then
echo "Unable to determine package date from qglobal.h: '$QT_PACKAGEDATE'"
echo "Cannot proceed"
exit 1
fi
#-------------------------------------------------------------------------------
# check the license
#-------------------------------------------------------------------------------
COMMERCIAL_USER=ask
CFG_DEV=no
CFG_NOKIA=no
CFG_EMBEDDED=no
CFG_RTOS_ENABLED=yes
EditionString=Commercial
earlyArgParse()
{
# parse the arguments, setting things to "yes" or "no"
while [ "$#" -gt 0 ]; do
CURRENT_OPT="$1"
UNKNOWN_ARG=no
case "$1" in
#Autoconf style options
--enable-*)
VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
VAL=yes
;;
--disable-*)
VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
VAL=no
;;
--*=*)
VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
;;
--no-*)
VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
VAL=no
;;
-embedded)
VAR=embedded
# this option may or may not be followed by an argument
if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
VAL=auto
else
shift;
VAL=$1
fi
;;
-h|help|--help|-help)
if [ "$VAL" = "yes" ]; then
OPT_HELP="$VAL"
COMMERCIAL_USER="no" #doesn't matter we will display the help
else
UNKNOWN_OPT=yes
COMMERCIAL_USER="no" #doesn't matter we will display the help
fi
;;
--*)
VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
VAL=yes
;;
-*)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
VAL="unknown"
;;
*)
UNKNOWN_ARG=yes
;;
esac
if [ "$UNKNOWN_ARG" = "yes" ]; then
shift
continue
fi
shift
UNKNOWN_OPT=no
case "$VAR" in
embedded)
CFG_EMBEDDED="$VAL"
if [ "$PLATFORM_QWS" != "no" ]; then
if [ "$PLATFORM_QWS" = "maybe" ]; then
PLATFORM_X11=no
PLATFORM_MAC=no
PLATFORM_QWS=yes
fi
else
echo "No license exists to enable Qt for Embedded Linux. Disabling."
CFG_EMBEDDED=no
fi
;;
developer-build)
CFG_DEV="yes"
;;
nokia-developer)
CFG_DEV="yes"
CFG_NOKIA="yes"
COMMERCIAL_USER="no"
;;
commercial)
COMMERCIAL_USER="yes"
;;
opensource)
COMMERCIAL_USER="no"
;;
*)
UNKNOWN_OPT=yes
;;
esac
done
}
earlyArgParse "$@"
if [ "$COMMERCIAL_USER" = "ask" ]; then
while true; do
echo "Which edition of Qt do you want to use ?"
echo
echo "Type 'c' if you want to use the Commercial Edition."
echo "Type 'o' if you want to use the Open Source Edition."
echo
read commercial
echo
if [ "$commercial" = "c" ]; then
COMMERCIAL_USER="yes"
break
elif [ "$commercial" = "o" ]; then
COMMERCIAL_USER="no"
break
fi
done
fi
if [ "$CFG_NOKIA" = "yes" ]; then
Licensee="Nokia"
Edition="NokiaInternalBuild"
EditionString="Nokia Internal Build"
QT_EDITION="QT_EDITION_OPENSOURCE"
[ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
elif [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then
# Commercial preview release
[ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
Licensee="Preview"
Edition="Preview"
QT_EDITION="QT_EDITION_DESKTOP"
LicenseType="Technology Preview"
elif [ $COMMERCIAL_USER = "yes" ]; then
# one of commercial editions
[ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
[ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=no
# read in the license file
if [ -f "$LICENSE_FILE" ]; then
. "$LICENSE_FILE" >/dev/null 2>&1
if [ -z "$LicenseKeyExt" ]; then
echo
echo "You are using an old license file."
echo
echo "Please install the license file supplied by Nokia,"
echo "or install the Qt Open Source Edition if you intend to"
echo "develop free software."
exit 1
fi
if [ -z "$Licensee" ]; then
echo
echo "Invalid license key. Please check the license key."
exit 1
fi
else
if [ -z "$LicenseKeyExt" ]; then
echo
if echo '\c' | grep '\c' >/dev/null; then
echo -n "Please enter your license key: "
else
echo "Please enter your license key: \c"
fi
read LicenseKeyExt
Licensee="Unknown user"
fi
fi
# Key verification
echo "$LicenseKeyExt" | grep ".....*-....*-....*-....*-.....*-.....*-...." >/dev/null 2>&1 \
&& LicenseValid="yes" \
|| LicenseValid="no"
if [ "$LicenseValid" != "yes" ]; then
echo
echo "Invalid license key. Please check the license key."
exit 1
fi
ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1`
PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d -`
LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -`
LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1`
# determine which edition we are licensed to use
case "$LicenseTypeCode" in
F4M)
LicenseType="Commercial"
case $ProductCode in
F)
Edition="Universal"
QT_EDITION="QT_EDITION_UNIVERSAL"
;;
B)
Edition="FullFramework"
EditionString="Full Framework"
QT_EDITION="QT_EDITION_DESKTOP"
;;
L)
Edition="GUIFramework"
EditionString="GUI Framework"
QT_EDITION="QT_EDITION_DESKTOPLIGHT"
;;
esac
;;
Z4M|R4M|Q4M)
LicenseType="Evaluation"
QMakeVar add DEFINES QT_EVAL
case $ProductCode in
B)
Edition="Evaluation"
QT_EDITION="QT_EDITION_EVALUATION"
;;
esac
;;
esac
if [ -z "$LicenseType" -o -z "$Edition" -o -z "$QT_EDITION" ]; then
echo
echo "Invalid license key. Please check the license key."
exit 1
fi
# verify that we are licensed to use Qt on this platform
LICENSE_EXTENSION=
case "$PlatformCode" in
*L)
CFG_RTOS_ENABLED=yes
PlatformCode=`echo "$PlatformCode" | sed 'h;y/8NPQRTZ/UCWX9M7/;x;G;s/\(.\)....\(.\)./\1\2/'`
;;
*)
CFG_RTOS_ENABLED=no
PlatformCode=`echo "$PlatformCode" | sed 's/.$//'`
;;
esac
case "$PlatformCode,$PLATFORM_MAC,$PLATFORM_QWS" in
X9,* | XC,* | XU,* | XW,* | XM,*)
# Qt All-OS
LICENSE_EXTENSION="-ALLOS"
;;
8M,* | KM,* | S9,* | SC,* | SU,* | SW,* | X9,* | XC,* | XU,* | XW,*)
# Qt for Embedded Linux
LICENSE_EXTENSION="-EMBEDDED"
;;
6M,*,no | N7,*,no | N9,*,no | NX,*,no)
# Embedded no-deploy
LICENSE_EXTENSION="-EMBEDDED"
;;
FM,*,no | LM,yes,* | ZM,no,no)
# Desktop
LICENSE_EXTENSION="-DESKTOP"
;;
*)
Platform=Linux/X11
[ "$PLATFORM_MAC" = "yes" ] && Platform='Mac OS X'
[ "$PLATFORM_QWS" = "yes" ] && Platform='Embedded Linux'
echo
echo "You are not licensed for the $Platform platform."
echo
echo "Please contact qt-info@nokia.com to upgrade your license to"
echo "include the $Platform platform, or install the Qt Open Source Edition"
echo "if you intend to develop free software."
exit 1
;;
esac
if test -r "$relpath/.LICENSE"; then
# Generic, non-final license
LICENSE_EXTENSION=""
line=`sed 'y/a-z/A-Z/;q' "$relpath"/.LICENSE`
case "$line" in
*BETA*)
Edition=Beta
;;
*TECHNOLOGY?PREVIEW*)
Edition=Preview
;;
*EVALUATION*)
Edition=Evaluation
;;
*)
echo >&2 "Invalid license files; cannot continue"
exit 1
;;
esac
Licensee="$Edition"
EditionString="$Edition"
QT_EDITION="QT_EDITION_DESKTOP"
fi
case "$LicenseFeatureCode" in
B|G|L|Y)
# US
case "$LicenseType" in
Commercial)
cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-US" "$outpath/LICENSE"
;;
Evaluation)
cp -f "$relpath/.LICENSE-EVALUATION-US" "$outpath/LICENSE"
;;
esac
;;
2|4|5|F)
# non-US
case "$LicenseType" in
Commercial)
cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}" "$outpath/LICENSE"
;;
Evaluation)
cp -f "$relpath/.LICENSE-EVALUATION" "$outpath/LICENSE"
;;
esac
;;
*)
echo
echo "Invalid license key. Please check the license key."
exit 1
;;
esac
case "$LicenseFeatureCode" in
4|B|F|Y)
CFG_RTOS_ENABLED=yes
;;
2|5|G|L)
CFG_RTOS_ENABLED=no
;;
esac
if [ '!' -f "$outpath/LICENSE" ]; then
echo "The LICENSE, LICENSE.GPL3 LICENSE.LGPL file shipped with"
echo "this software has disappeared."
echo
echo "Sorry, you are not licensed to use this software."
echo "Try re-installing."
echo
exit 1
fi
elif [ $COMMERCIAL_USER = "no" ]; then
# Open Source edition - may only be used under the terms of the GPL or LGPL.
[ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
Licensee="Open Source"
Edition="OpenSource"
EditionString="Open Source"
QT_EDITION="QT_EDITION_OPENSOURCE"
fi
#-------------------------------------------------------------------------------
# initalize variables
#-------------------------------------------------------------------------------
SYSTEM_VARIABLES="CC CXX CFLAGS CXXFLAGS LDFLAGS"
for varname in $SYSTEM_VARIABLES; do
qmakevarname="${varname}"
# use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
if [ "${varname}" = "LDFLAGS" ]; then
qmakevarname="LFLAGS"
fi
cmd=`echo \
'if [ -n "\$'${varname}'" ]; then
QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}'"
fi'`
eval "$cmd"
done
# Use CC/CXX to run config.tests
mkdir -p "$outpath/config.tests"
rm -f "$outpath/config.tests/.qmake.cache"
cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
QMakeVar add styles "cde mac motif plastique cleanlooks windows"
QMakeVar add decorations "default windows styled"
QMakeVar add mouse-drivers "pc"
if [ "$UNAME_SYSTEM" = "Linux" ] ; then
QMakeVar add gfx-drivers "linuxfb"
QMakeVar add mouse-drivers "linuxtp"
fi
QMakeVar add kbd-drivers "tty"
if [ "$CFG_DEV" = "yes" ]; then
QMakeVar add kbd-drivers "um"
fi
# QTDIR may be set and point to an old or system-wide Qt installation
unset QTDIR
# the minimum version of libdbus-1 that we require:
MIN_DBUS_1_VERSION=0.93
# initalize internal variables
CFG_CONFIGURE_EXIT_ON_ERROR=yes
CFG_PROFILE=no
CFG_EXCEPTIONS=unspecified
CFG_SCRIPT=auto # (yes|no|auto)
CFG_SCRIPTTOOLS=auto # (yes|no|auto)
CFG_XMLPATTERNS=auto # (yes|no|auto)
CFG_INCREMENTAL=auto
CFG_QCONFIG=full
CFG_DEBUG=auto
CFG_MYSQL_CONFIG=
CFG_DEBUG_RELEASE=no
CFG_SHARED=yes
CFG_SM=auto
CFG_XSHAPE=auto
CFG_XSYNC=auto
CFG_XINERAMA=runtime
CFG_XFIXES=runtime
CFG_ZLIB=auto
CFG_SQLITE=qt
CFG_GIF=auto
CFG_TIFF=auto
CFG_LIBTIFF=auto
CFG_PNG=yes
CFG_LIBPNG=auto
CFG_JPEG=auto
CFG_LIBJPEG=auto
CFG_MNG=auto
CFG_LIBMNG=auto
CFG_XCURSOR=runtime
CFG_XRANDR=runtime
CFG_XRENDER=auto
CFG_MITSHM=auto
CFG_OPENGL=auto
CFG_OPENVG=no
CFG_OPENVG_LC_INCLUDES=no
CFG_OPENVG_SHIVA=no
CFG_OPENVG_ON_OPENGL=no
CFG_EGL=no
CFG_EGL_GLES_INCLUDES=no
CFG_SSE=auto
CFG_FONTCONFIG=auto
CFG_QWS_FREETYPE=auto
CFG_LIBFREETYPE=auto
CFG_SQL_AVAILABLE=
QT_DEFAULT_BUILD_PARTS="libs tools examples demos docs translations"
CFG_BUILD_PARTS=""
CFG_NOBUILD_PARTS=""
CFG_RELEASE_QMAKE=no
CFG_PHONON=auto
CFG_PHONON_BACKEND=yes
CFG_MULTIMEDIA=yes
CFG_SVG=yes
CFG_DECLARATIVE=auto
CFG_WEBKIT=auto # (yes|no|auto)
CFG_JAVASCRIPTCORE_JIT=auto
CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen directfb"
CFG_GFX_ON="linuxfb multiscreen"
CFG_GFX_PLUGIN_AVAILABLE=
CFG_GFX_PLUGIN=
CFG_GFX_OFF=
CFG_KBD_AVAILABLE="tty linuxinput qvfb"
CFG_KBD_ON="tty" #default, see QMakeVar above
CFG_MOUSE_AVAILABLE="pc linuxtp linuxinput tslib qvfb"
CFG_MOUSE_ON="pc linuxtp" #default, see QMakeVar above
if [ -f "$relpath/src/gui/embedded/qscreenqnx_qws.cpp" ]; then
CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} qnx"
CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} qnx"
CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} qnx"
fi
CFG_ARCH=
CFG_HOST_ARCH=
CFG_KBD_PLUGIN_AVAILABLE=
CFG_KBD_PLUGIN=
CFG_KBD_OFF=
CFG_MOUSE_PLUGIN_AVAILABLE=
CFG_MOUSE_PLUGIN=
CFG_MOUSE_OFF=
CFG_USE_GNUMAKE=no
CFG_IM=yes
CFG_DECORATION_AVAILABLE="styled windows default"
CFG_DECORATION_ON="${CFG_DECORATION_AVAILABLE}" # all on by default
CFG_DECORATION_PLUGIN_AVAILABLE=
CFG_DECORATION_PLUGIN=
CFG_XINPUT=runtime
CFG_XKB=auto
CFG_NIS=auto
CFG_CUPS=auto
CFG_ICONV=auto
CFG_DBUS=auto
CFG_GLIB=auto
CFG_GSTREAMER=auto
CFG_QGTKSTYLE=auto
CFG_LARGEFILE=auto
CFG_OPENSSL=auto
CFG_PTMALLOC=no
CFG_STL=auto
CFG_PRECOMPILE=auto
CFG_SEPARATE_DEBUG_INFO=auto
CFG_REDUCE_EXPORTS=auto
CFG_MMX=auto
CFG_3DNOW=auto
CFG_SSE=auto
CFG_SSE2=auto
CFG_REDUCE_RELOCATIONS=no
CFG_IPV6=auto
CFG_NAS=no
CFG_QWS_DEPTHS=all
CFG_USER_BUILD_KEY=
CFG_ACCESSIBILITY=auto
CFG_QT3SUPPORT=yes
CFG_ENDIAN=auto
CFG_HOST_ENDIAN=auto
CFG_DOUBLEFORMAT=auto
CFG_ARMFPA=auto
CFG_IWMMXT=no
CFG_CLOCK_GETTIME=auto
CFG_CLOCK_MONOTONIC=auto
CFG_MREMAP=auto
CFG_GETADDRINFO=auto
CFG_IPV6IFNAME=auto
CFG_GETIFADDRS=auto
CFG_INOTIFY=auto
CFG_RPATH=yes
CFG_FRAMEWORK=auto
CFG_MAC_ARCHS=
MAC_CONFIG_TEST_COMMANDLINE= # used to make the configure tests run with the correct arch's and SDK settings
CFG_MAC_DWARF2=auto
CFG_MAC_XARCH=auto
CFG_MAC_CARBON=yes
CFG_MAC_COCOA=auto
COMMANDLINE_MAC_COCOA=no
CFG_SXE=no
CFG_PREFIX_INSTALL=yes
CFG_SDK=
D_FLAGS=
I_FLAGS=
L_FLAGS=
RPATH_FLAGS=
l_FLAGS=
QCONFIG_FLAGS=
XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++"
PLATFORM=$QMAKESPEC
QT_CROSS_COMPILE=no
OPT_CONFIRM_LICENSE=no
OPT_SHADOW=maybe
OPT_FAST=auto
OPT_VERBOSE=no
OPT_HELP=
CFG_SILENT=no
CFG_GRAPHICS_SYSTEM=default
CFG_ALSA=auto
# initalize variables used for installation
QT_INSTALL_PREFIX=
QT_INSTALL_DOCS=
QT_INSTALL_HEADERS=
QT_INSTALL_LIBS=
QT_INSTALL_BINS=
QT_INSTALL_PLUGINS=
QT_INSTALL_DATA=
QT_INSTALL_TRANSLATIONS=
QT_INSTALL_SETTINGS=
QT_INSTALL_EXAMPLES=
QT_INSTALL_DEMOS=
QT_HOST_PREFIX=
#flags for SQL drivers
QT_CFLAGS_PSQL=
QT_LFLAGS_PSQL=
QT_CFLAGS_MYSQL=
QT_LFLAGS_MYSQL=
QT_LFLAGS_MYSQL_R=
QT_CFLAGS_SQLITE=
QT_LFLAGS_SQLITE=
QT_LFLAGS_ODBC="-lodbc"
# flags for libdbus-1
QT_CFLAGS_DBUS=
QT_LIBS_DBUS=
# flags for Glib (X11 only)
QT_CFLAGS_GLIB=
QT_LIBS_GLIB=
# flags for GStreamer (X11 only)
QT_CFLAGS_GSTREAMER=
QT_LIBS_GSTREAMER=
#-------------------------------------------------------------------------------
# check SQL drivers, mouse drivers and decorations available in this package
#-------------------------------------------------------------------------------
# opensource version removes some drivers, so force them to be off
CFG_SQL_tds=no
CFG_SQL_oci=no
CFG_SQL_db2=no
CFG_SQL_AVAILABLE=
if [ -d "$relpath/src/plugins/sqldrivers" ]; then
for a in "$relpath/src/plugins/sqldrivers/"*; do
if [ -d "$a" ]; then
base_a=`basename "$a"`
CFG_SQL_AVAILABLE="${CFG_SQL_AVAILABLE} ${base_a}"
eval "CFG_SQL_${base_a}=auto"
fi
done
fi
CFG_DECORATION_PLUGIN_AVAILABLE=
if [ -d "$relpath/src/plugins/decorations" ]; then
for a in "$relpath/src/plugins/decorations/"*; do
if [ -d "$a" ]; then
base_a=`basename "$a"`
CFG_DECORATION_PLUGIN_AVAILABLE="${CFG_DECORATION_PLUGIN_AVAILABLE} ${base_a}"
fi
done
fi
CFG_KBD_PLUGIN_AVAILABLE=
if [ -d "$relpath/src/plugins/kbddrivers" ]; then
for a in "$relpath/src/plugins/kbddrivers/"*; do
if [ -d "$a" ]; then
base_a=`basename "$a"`
CFG_KBD_PLUGIN_AVAILABLE="${CFG_KBD_PLUGIN_AVAILABLE} ${base_a}"
fi
done
fi
CFG_MOUSE_PLUGIN_AVAILABLE=
if [ -d "$relpath/src/plugins/mousedrivers" ]; then
for a in "$relpath/src/plugins/mousedrivers/"*; do
if [ -d "$a" ]; then
base_a=`basename "$a"`
CFG_MOUSE_PLUGIN_AVAILABLE="${CFG_MOUSE_PLUGIN_AVAILABLE} ${base_a}"
fi
done
fi
CFG_GFX_PLUGIN_AVAILABLE=
if [ -d "$relpath/src/plugins/gfxdrivers" ]; then
for a in "$relpath/src/plugins/gfxdrivers/"*; do
if [ -d "$a" ]; then
base_a=`basename "$a"`
CFG_GFX_PLUGIN_AVAILABLE="${CFG_GFX_PLUGIN_AVAILABLE} ${base_a}"
fi
done
CFG_GFX_OFF="$CFG_GFX_AVAILABLE" # assume all off
fi
#-------------------------------------------------------------------------------
# parse command line arguments
#-------------------------------------------------------------------------------
# parse the arguments, setting things to "yes" or "no"
while [ "$#" -gt 0 ]; do
CURRENT_OPT="$1"
UNKNOWN_ARG=no
case "$1" in
#Autoconf style options
--enable-*)
VAR=`echo $1 | sed "s,^--enable-\(.*\),\1,"`
VAL=yes
;;
--disable-*)
VAR=`echo $1 | sed "s,^--disable-\(.*\),\1,"`
VAL=no
;;
--*=*)
VAR=`echo $1 | sed "s,^--\(.*\)=.*,\1,"`
VAL=`echo $1 | sed "s,^--.*=\(.*\),\1,"`
;;
--no-*)
VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
VAL=no
;;
--*)
VAR=`echo $1 | sed "s,^--\(.*\),\1,"`
VAL=yes
;;
#Qt plugin options
-no-*-*|-plugin-*-*|-qt-*-*)
VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
VAL=`echo $1 | sed "s,^-\([^-]*\).*,\1,"`
;;
#Qt style no options
-no-*)
VAR=`echo $1 | sed "s,^-no-\(.*\),\1,"`
VAL=no
;;
#Qt style yes options
-incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-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|-multimedia|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
VAL=yes
;;
#Qt style options that pass an argument
-qconfig)
if [ "$PLATFORM_QWS" != "yes" ]; then
echo
echo "WARNING: -qconfig is only tested and supported on Qt for Embedded Linux."
echo
fi
CFG_QCONFIG="$VAL"
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
shift
VAL=$1
;;
-prefix|-docdir|-headerdir|-plugindir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
shift
VAL="$1"
;;
#Qt style complex options in one command
-enable-*|-disable-*)
VAR=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
VAL=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
;;
#Qt Builtin/System style options
-no-*|-system-*|-qt-*)
VAR=`echo $1 | sed "s,^-[^-]*-\(.*\),\1,"`
VAL=`echo $1 | sed "s,^-\([^-]*\)-.*,\1,"`
;;
#Options that cannot be generalized
-k|-continue)
VAR=fatal_error
VAL=no
;;
-embedded)
VAR=embedded
# this option may or may not be followed by an argument
if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
VAL=auto
else
shift;
VAL=$1
fi
;;
-opengl)
VAR=opengl
# this option may or may not be followed by an argument
if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
VAL=yes
else
shift;
VAL=$1
fi
;;
-openvg)
VAR=openvg
# this option may or may not be followed by an argument
if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
VAL=yes
else
shift;
VAL=$1
fi
;;
-hostprefix)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
# this option may or may not be followed by an argument
if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
VAL=$outpath
else
shift;
VAL=$1
fi
;;
-host-*-endian)
VAR=host_endian
VAL=`echo $1 | sed "s,^-.*-\(.*\)-.*,\1,"`
;;
-*-endian)
VAR=endian
VAL=`echo $1 | sed "s,^-\(.*\)-.*,\1,"`
;;
-qtnamespace)
VAR="qtnamespace"
shift
VAL="$1"
;;
-graphicssystem)
VAR="graphicssystem"
shift
VAL=$1
;;