-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·9424 lines (8695 loc) · 310 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) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is the build configuration utility of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
##
## 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, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
## GNU General Public License Usage
## Alternatively, this file may be used under the terms of the GNU
## General Public License version 3.0 as published by the Free Software
## Foundation and appearing in the file LICENSE.GPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU General Public License version 3.0 requirements will be
## met: http://www.gnu.org/copyleft/gpl.html.
##
##
## $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
DEVICE_VARS_FILE=.device.vars
:> "$QMAKE_VARS_FILE"
:> "$DEVICE_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"
}
# Helper function for getQMakeConf. It parses include statements in
# qmake.conf and prints out the expanded file
getQMakeConf1()
{
while read line; do case "$line" in
include*)
inc_file=`echo "$line" | sed -n -e "/^include.*(.*)/s/include.*(\(.*\)).*$/\1/p"`
current_dir=`dirname "$1"`
conf_file="$current_dir/$inc_file"
if [ ! -f "$conf_file" ]; then
echo "WARNING: Unable to find file $conf_file" >&2
continue
fi
getQMakeConf1 "$conf_file"
;;
*)
echo "$line"
;;
esac; done < "$1"
}
getQMakeConf2()
{
$AWK '
BEGIN {
values["LITERAL_WHITESPACE"] = " "
values["LITERAL_DOLLAR"] = "$"
}
/^[_A-Z0-9.]+[ \t]*\+?=/ {
valStart = index($0, "=") + 1
append = 0
if (substr($0, valStart - 2, 1) == "+") {
append = 1
}
variable = substr($0, 0, valStart - 2 - append)
value = substr($0, valStart)
gsub("[ \t]+", "", variable)
gsub("^[ \t]+", "", value)
gsub("[ \t]+$", "", value)
ovalue = ""
while (match(value, /\$\$(\{[_A-Z0-9.]+\}|[_A-Z0-9.]+)/)) {
ovalue = ovalue substr(value, 1, RSTART - 1)
var = substr(value, RSTART + 2, RLENGTH - 2)
value = substr(value, RSTART + RLENGTH)
if (var ~ /^\{/) {
var = substr(var, 2, length(var) - 2)
}
ovalue = ovalue values[var]
}
ovalue = ovalue value
combinedValue = values[variable]
if (append == 1 && length(combinedValue) > 0) {
combinedValue = combinedValue " " ovalue
} else {
combinedValue = ovalue
}
values[variable] = combinedValue
}
END {
for (var in values) {
print var "=" values[var]
}
}
'
}
getQMakeConf3()
{
echo "$2" | $AWK "/^($1)=/ { print substr(\$0, index(\$0, \"=\") + 1) }"
}
# relies on $QMAKESPEC being set correctly. parses include statements in
# qmake.conf and prints out the expanded file
getQMakeConf()
{
if [ -z "$specvals" ]; then
specvals=`getQMakeConf1 "$QMAKESPEC/qmake.conf" | getQMakeConf2`
fi
getQMakeConf3 "$1" "$specvals"
}
getXQMakeConf()
{
if [ -z "$xspecvals" ]; then
xspecvals=`getQMakeConf1 "$XQMAKESPEC/qmake.conf" | getQMakeConf2`
fi
getQMakeConf3 "$1" "$xspecvals"
}
compilerSupportsFlag()
{
cat >conftest.cpp <<EOF
int main() { return 0; }
EOF
"$@" -o conftest-out.o conftest.cpp
ret=$?
rm -f conftest.cpp conftest-out.o
return $ret
}
linkerSupportsFlag()
{
compiler=$1
shift
lflags=-Wl
for flag
do
safe_flag=`shellEscape "$flag"`
lflags=$lflags,$safe_flag
done
compilerSupportsFlag $compiler $lflags >/dev/null 2>&1
}
#-------------------------------------------------------------------------------
# device options
#-------------------------------------------------------------------------------
DeviceVar()
{
case "$1" in
set)
eq="="
;;
*)
echo >&2 "BUG: wrong command to QMakeVar: $1"
;;
esac
echo "$2" "$eq" "$3" >> "$DEVICE_VARS_FILE"
}
#-------------------------------------------------------------------------------
# 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
# detect the "echo without newline" style. usage: echo $ECHO_N "<string>$ECHO_C"
if echo '\c' | grep '\c' >/dev/null; then
ECHO_N=-n
else
ECHO_C='\c'
fi
#-------------------------------------------------------------------------------
# window system detection
#-------------------------------------------------------------------------------
PLATFORM_X11=no
PLATFORM_QWS=maybe
PLATFORM_QPA=maybe
BUILD_ON_MAC=no
if [ -d /System/Library/Frameworks/Carbon.framework ]; then
PLATFORM_MAC=maybe
BUILD_ON_MAC=yes
else
PLATFORM_MAC=no
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
;;
-embedded-lite|-qpa)
VAR=qpa
# 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
;;
-nacl)
shift;
VAR=nacl
VAL=$1
;;
-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"
PLATFORM_X11=no
PLATFORM_MAC=no
PLATFORM_QWS=yes
PLATFORM_QPA=no
;;
qpa)
CFG_EMBEDDED="no"
if [ "$PLATFORM_QPA" != "no" ]; then
if [ "$PLATFORM_QPA" = "maybe" ]; then
PLATFORM_X11=no
PLATFORM_MAC=no
PLATFORM_QWS=no
PLATFORM_QPA=yes
fi
else
echo "No license exists to enable Qt QPA. Disabling."
CFG_EMBEDDED=no
fi
;;
nacl)
echo "Using NaCl at $VAL."
PLATFORM_X11=no
PLATFORM_MAC=no
PLATFORM_QWS=no
CFG_NACL_PATH=$VAL
CFG_EMBEDDED=nacl
;;
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_QPA" = "maybe" ] && PLATFORM_QPA=no
[ "$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 Digia,"
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
echo $ECHO_N "Please enter your license key: $ECHO_C"
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
### EMBEDDED_QPA logic missing ###
case "$PlatformCode,$PLATFORM_MAC,$PLATFORM_QWS" in
X9,* | XC,* | XU,* | XW,* | XM,*)
# Qt All-OS
LICENSE_EXTENSION="-ALLOS"
;;
8M,* | KM,* | S9,* | SC,* | SM,* | 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 use contact form at http://qt.digia.com/contact-us 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="RANLIB STRIP OBJDUMP LD 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"
elif [ "${varname}" = "LD" ]; then
qmakevarname="LINK"
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_GUI=auto # (yes|no|auto)
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_XVIDEO=auto
CFG_XINERAMA=runtime
CFG_XFIXES=runtime
CFG_ZLIB=auto
CFG_SYMBIAN_DEFFILES=auto
CFG_S60=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=auto
CFG_OPENVG_LC_INCLUDES=no
CFG_OPENVG_SHIVA=auto
CFG_OPENVG_ON_OPENGL=auto
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=auto
CFG_AUDIO_BACKEND=auto
CFG_SVG=auto
CFG_DECLARATIVE=auto
CFG_DECLARATIVE_DEBUG=yes
CFG_WEBKIT=auto # (yes|no|auto|debug)
CFG_JAVASCRIPTCORE_JIT=auto
CFG_STACK_PROTECTOR_STRONG=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
if [ -f "$relpath/src/gui/embedded/qscreenintegrityfb_qws.cpp" ]; then
CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} integrity"
CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} integrity"
CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} integrityfb"
fi
if [ -f "$relpath/src/gui/embedded/qscreenvxworksfb_qws.cpp" ]; then
CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} vxworks"
CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} vxworks"
CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} vxworksfb"
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_QS60STYLE=auto
CFG_LARGEFILE=auto
CFG_OPENSSL=auto
CFG_PTMALLOC=no
CFG_STL=auto
CFG_PRECOMPILE=auto
CFG_SEPARATE_DEBUG_INFO=no
CFG_SEPARATE_DEBUG_INFO_NOCOPY=no
CFG_REDUCE_EXPORTS=auto
CFG_MMX=auto
CFG_3DNOW=auto
CFG_SSE=auto
CFG_SSE2=auto
CFG_SSE3=auto
CFG_SSSE3=auto
CFG_SSE4_1=auto
CFG_SSE4_2=auto
CFG_AVX=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_NEON=auto
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=no
CFG_MAC_COCOA=yes
COMMANDLINE_MAC_CARBON=no
CFG_MAC_HARFBUZZ=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++" or "symbian-gcce"
XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*)
XPLATFORM_INTEGRITY=no # Whether target platform is INTEGRITY (*integrity*)
XPLATFORM_SYMBIAN=no # Whether target platform is SYMBIAN (*symbian*)
XPLATFORM_SYMBIAN_SBSV2=no # Whether target platform is SYMBIAN_SBSV2 (symbian-sbsv2)
XPLATFORM_QNX=no
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_RUNTIME_SYSTEM=
CFG_ALSA=auto
CFG_PULSEAUDIO=auto
CFG_COREWLAN=auto
CFG_ICD=auto
CFG_NOPROCESS=no
CFG_ICU=auto
CFG_SYSTEM_PROXIES=no
CFG_SLOG2=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_IMPORTS=
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"
QT_LFLAGS_TDS=
# 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=
# default qpa platform
QT_QPA_DEFAULT_PLATFORM=
#flag for Symbian fpu settings
QT_CFLAGS_FPU=
# flags for libconnsettings0 (used for Maemo ICD bearer management plugin)
QT_CFLAGS_CONNSETTINGS=
QT_LIBS_CONNSETTINGS=
#-------------------------------------------------------------------------------
# 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"`