-
Notifications
You must be signed in to change notification settings - Fork 25
/
configure
executable file
·1163 lines (940 loc) · 42.3 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
#!/usr/bin/env bash
# Copyright 2020-2023 Bloomberg Finance L.P.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
write_config_header() {
{
echo -n " <configuration PROFILE_NAME=\"${NTF_CONFIGURE_UFID_CANONICAL}\" ENABLED=\"true\""
echo -n " GENERATION_DIR=\"${NTF_CONFIGURE_OUTPUT}\" CONFIG_NAME=\"${NTF_CONFIGURE_UFID_CANONICAL}\""
echo -n " GENERATION_OPTIONS=\""
if [[ "${NTF_CONFIGURE_CMAKE_OPTION_DISTRIBUTION_REFROOT}" != "" ]]; then
echo -n " ${NTF_CONFIGURE_CMAKE_OPTION_DISTRIBUTION_REFROOT}"
fi
echo -n " ${NTF_CONFIGURE_CMAKE_OPTION_UFID} ${NTF_CONFIGURE_CMAKE_OPTION_BUILD_TYPE}"
echo -n " ${NTF_CONFIGURE_CMAKE_OPTION_INSTALL_PREFIX} -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF"
echo -n " ${NTF_CONFIGURE_CMAKE_OPTION_PREFIX_PATH}"
echo -n " -DCMAKE_TOOLCHAIN_FILE:PATH=${NTF_CONFIGURE_TOOLCHAIN}"
echo -n " -G "${NTF_CONFIGURE_GENERATOR}" -S ${NTF_CONFIGURE_REPOSITORY}\""
echo " BUILD_OPTIONS=\"-j ${num_threads}\">"
echo " <ADDITIONAL_GENERATION_ENVIRONMENT>"
echo " <envs>"
} >> "${NTF_CLION_XML}"
}
process_ntf_configure_env() {
env | while IFS= read -r line; do
if [[ "$line" == "NTF_CONFIGURE"* ]]; then
key="${line%%=*}"
value="${line#*=}"
echo " <env name=\"${key}\" value=\"${value}\" />" >> "${NTF_CLION_XML}"
fi
done
}
process_env() {
if [ -n "${!1}" ]; then
echo " <env name=\"${1}\" value=\"${!1}\" />" >> "${NTF_CLION_XML}"
fi
}
generate_clion_cmake_xml () {
echo "Generating Clion cmake.xml..."
NTF_CLION_STORAGE=".idea"
NTF_CLION_XML="${NTF_CLION_STORAGE}/cmake.xml"
CLION_XML_GENERATION=$1
mkdir -p ${NTF_CLION_STORAGE}
num_threads=$(grep ^processor /proc/cpuinfo | uniq | wc -l)
if [[ ${CLION_XML_GENERATION} == "clean" ]]; then
if test -f "$NTF_CLION_XML"; then
echo "cmake.xml exists, it will be overwritten"
fi
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
echo "<project version=\"4\">"
echo " <component name=\"CMakeSharedSettings\">"
echo " <configurations>"
} > ${NTF_CLION_XML}
write_config_header
elif [[ ${CLION_XML_GENERATION} == "add" ]]; then
echo "Adding new configuration to existing cmake.xml"
if ! test -f "${NTF_CLION_XML}"; then
echo "cmake.xml does not exist, aborting"
exit 1
fi
#save previously available configurations, remove only the end of the cmake.xml
num_lines=$(grep -n '</configurations>' ${NTF_CLION_XML} | awk '{print $1}')
if [[ -z ${num_lines} ]]; then
echo "Failed to find </configurations> inside ${NTF_CLION_XML}, aborting"
fi
num_lines=${num_lines:0:${#num_lines}-1}
num_lines=$(($((num_lines))-1))
head -"${num_lines}" ${NTF_CLION_XML} > clion_tmpfile && mv clion_tmpfile ${NTF_CLION_XML}
write_config_header
else
echo "--clion_config must be used with either \"clean\" or \"add\", aborting"
exit 2
fi
process_env "CC"
process_env "CXX"
process_ntf_configure_env
{
echo " </envs>"
echo " </ADDITIONAL_GENERATION_ENVIRONMENT>"
echo " </configuration>"
echo " </configurations>"
echo " </component>"
echo "</project>"
} >> ${NTF_CLION_XML}
echo "Generating Clion cmake.xml done"
}
set -o pipefail
NTF_CONFIGURE_REPOSITORY=$(dirname ${0})
if [[ -n ${NTF_CONFIGURE_REPOSITORY##/*} ]]; then
NTF_CONFIGURE_REPOSITORY=${PWD}/${NTF_CONFIGURE_REPOSITORY#.}
fi
NTF_CONFIGURE_REPOSITORY=${NTF_CONFIGURE_REPOSITORY%/}
cd ${NTF_CONFIGURE_REPOSITORY}
NTF_CONFIGURE_UNAME=$(uname)
if [[ "${NTF_CONFIGURE_UNAME}" == "MINGW32_NT-6.2" ]]; then
NTF_CONFIGURE_UNAME="Windows"
fi
if [[ -z "${NTF_CONFIGURE_UFID}" ]]; then
NTF_CONFIGURE_UFID="opt_dbg_exc_mt_64"
fi
if [[ -z "${NTF_CONFIGURE_UNITY}" ]]; then
NTF_CONFIGURE_UNITY=0
fi
if [[ -z "${NTF_CONFIGURE_REFROOT}" ]]; then
if [[ -z "${DISTRIBUTION_REFROOT}" ]]; then
NTF_CONFIGURE_REFROOT=""
else
NTF_CONFIGURE_REFROOT="${DISTRIBUTION_REFROOT}"
fi
fi
if [[ -z "${NTF_CONFIGURE_PREFIX}" ]]; then
if [[ -z "${PREFIX}" ]]; then
NTF_CONFIGURE_PREFIX="/opt/bb"
else
NTF_CONFIGURE_PREFIX="${PREFIX}"
fi
fi
if [[ -z "${NTF_CONFIGURE_OUTPUT}" ]]; then
NTF_CONFIGURE_OUTPUT="${NTF_CONFIGURE_REPOSITORY}/build"
fi
if [[ -z "${NTF_CONFIGURE_DISTRIBUTION}" ]]; then
NTF_CONFIGURE_DISTRIBUTION="unstable"
fi
if [[ -z "${NTF_CONFIGURE_GENERATOR}" ]]; then
NTF_CONFIGURE_CODE=$(which code 2>&1)
if [ ${?} -eq 0 ] || [[ "${NTF_CONFIGURE_UNAME}" == "Darwin" ]]; then
NTF_CONFIGURE_GENERATOR="Unix Makefiles"
else
NTF_CONFIGURE_NINJA=$(which ninja 2>&1)
if [ ${?} -eq 0 ]; then
NTF_CONFIGURE_GENERATOR="Ninja"
else
NTF_CONFIGURE_GENERATOR="Unix Makefiles"
fi
fi
fi
if [[ -z "${NTF_CONFIGURE_TOOLCHAIN}" ]]; then
NTF_CONFIGURE_TOOLCHAIN="${NTF_CONFIGURE_REPOSITORY}/toolchain.cmake"
fi
NTF_CONFIGURE_SANITIZER=""
if [[ -z "${NTF_CONFIGURE_MULTIPLATFORM}" ]]; then
NTF_CONFIGURE_MULTIPLATFORM=1
fi
if [[ -z "${NTF_CONFIGURE_JOBS}" ]]; then
NTF_CONFIGURE_JOBS=8
fi
if [[ -z "${NTF_CONFIGURE_WITH_BSL}" ]]; then
NTF_CONFIGURE_WITH_BSL=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_BDL}" ]]; then
NTF_CONFIGURE_WITH_BDL=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_BAL}" ]]; then
NTF_CONFIGURE_WITH_BAL=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_NTS}" ]]; then
NTF_CONFIGURE_WITH_NTS=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_NTC}" ]]; then
NTF_CONFIGURE_WITH_NTC=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV4}" ]]; then
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV4=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV6}" ]]; then
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV6=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_ADDRESS_FAMILY_LOCAL}" ]]; then
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_LOCAL=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_TCP}" ]]; then
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_TCP=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_UDP}" ]]; then
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_UDP=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_LOCAL}" ]]; then
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_LOCAL=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_SELECT}" ]]; then
NTF_CONFIGURE_WITH_SELECT=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_POLL}" ]]; then
NTF_CONFIGURE_WITH_POLL=1
fi
if [[ "${NTF_CONFIGURE_UNAME}" == "Linux" ]]; then
if [[ -z "${NTF_CONFIGURE_WITH_EPOLL}" ]]; then
NTF_CONFIGURE_WITH_EPOLL=1
fi
else
NTF_CONFIGURE_WITH_EPOLL=0
fi
if [[ "${NTF_CONFIGURE_UNAME}" == "SunOS" ]]; then
if [[ -z "${NTF_CONFIGURE_WITH_DEVPOLL}" ]]; then
NTF_CONFIGURE_WITH_DEVPOLL=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_EVENTPORT}" ]]; then
NTF_CONFIGURE_WITH_EVENTPORT=1
fi
else
NTF_CONFIGURE_WITH_DEVPOLL=0
NTF_CONFIGURE_WITH_EVENTPORT=0
fi
if [[ "${NTF_CONFIGURE_UNAME}" == "AIX" ]]; then
if [[ -z "${NTF_CONFIGURE_WITH_POLLSET}" ]]; then
NTF_CONFIGURE_WITH_POLLSET=1
fi
else
NTF_CONFIGURE_WITH_POLLSET=0
fi
if [[ "${NTF_CONFIGURE_UNAME}" == "Darwin" ]] || \
[[ "${NTF_CONFIGURE_UNAME}" == "FreeBSD" ]] ; then
if [[ -z "${NTF_CONFIGURE_WITH_KQUEUE}" ]]; then
NTF_CONFIGURE_WITH_KQUEUE=1
fi
else
NTF_CONFIGURE_WITH_KQUEUE=0
fi
if [[ "${NTF_CONFIGURE_UNAME}" == "Windows" ]]; then
if [[ -z "${NTF_CONFIGURE_WITH_IOCP}" ]]; then
NTF_CONFIGURE_WITH_IOCP=1
fi
else
NTF_CONFIGURE_WITH_IOCP=0
fi
if [[ "${NTF_CONFIGURE_UNAME}" == "Linux" ]]; then
if [[ -z "${NTF_CONFIGURE_WITH_IORING}" ]]; then
NTF_CONFIGURE_WITH_IORING=0
fi
else
NTF_CONFIGURE_WITH_IORING=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_OPENSSL}" ]]; then
NTF_CONFIGURE_WITH_OPENSSL=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_DYNAMIC_LOAD_BALANCING}" ]]; then
NTF_CONFIGURE_WITH_DYNAMIC_LOAD_BALANCING=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_THREAD_SCALING}" ]]; then
NTF_CONFIGURE_WITH_THREAD_SCALING=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_DEPRECATED_FEATURES}" ]]; then
NTF_CONFIGURE_WITH_DEPRECATED_FEATURES=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_LOGGING}" ]]; then
NTF_CONFIGURE_WITH_LOGGING=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_METRICS}" ]]; then
NTF_CONFIGURE_WITH_METRICS=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_INLINING_SUGGESTED}" ]]; then
NTF_CONFIGURE_WITH_INLINING_SUGGESTED=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_INLINING_FORCED}" ]]; then
NTF_CONFIGURE_WITH_INLINING_FORCED=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_INLINING_DISABLED}" ]]; then
NTF_CONFIGURE_WITH_INLINING_DISABLED=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_BRANCH_PREDICTION}" ]]; then
NTF_CONFIGURE_WITH_BRANCH_PREDICTION=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_SPIN_LOCKS}" ]]; then
NTF_CONFIGURE_WITH_SPIN_LOCKS=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_USERSPACE_MUTEXES}" ]]; then
if [[ "${NTF_CONFIGURE_UNAME}" == "Linux" ]]; then
NTF_CONFIGURE_WITH_USERSPACE_MUTEXES=1
else
NTF_CONFIGURE_WITH_USERSPACE_MUTEXES=0
fi
fi
if [[ -z "${NTF_CONFIGURE_WITH_SYSTEM_MUTEXES}" ]]; then
if [[ "${NTF_CONFIGURE_UNAME}" == "Linux" ]]; then
NTF_CONFIGURE_WITH_SYSTEM_MUTEXES=0
else
NTF_CONFIGURE_WITH_SYSTEM_MUTEXES=1
fi
fi
if [[ -z "${NTF_CONFIGURE_WITH_RECURSIVE_MUTEXES}" ]]; then
NTF_CONFIGURE_WITH_RECURSIVE_MUTEXES=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_STACK_TRACE_LEAK_REPORT}" ]]; then
NTF_CONFIGURE_WITH_STACK_TRACE_LEAK_REPORT=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_STACK_TRACE_TEST_ALLOCATOR}" ]]; then
NTF_CONFIGURE_WITH_STACK_TRACE_TEST_ALLOCATOR=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_APPLICATIONS}" ]]; then
NTF_CONFIGURE_WITH_APPLICATIONS=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_USAGE_EXAMPLES}" ]]; then
NTF_CONFIGURE_WITH_USAGE_EXAMPLES=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_MOCKS}" ]]; then
NTF_CONFIGURE_WITH_MOCKS=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_INTEGRATION_TESTS}" ]]; then
NTF_CONFIGURE_WITH_TESTS=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_INTEGRATION_TESTS}" ]]; then
NTF_CONFIGURE_WITH_INTEGRATION_TESTS=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_WARNINGS}" ]]; then
NTF_CONFIGURE_WITH_WARNINGS=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_WARNINGS_AS_ERRORS}" ]]; then
NTF_CONFIGURE_WITH_WARNINGS_AS_ERRORS=1
fi
if [[ -z "${NTF_CONFIGURE_WITH_TIME_TRACE}" ]]; then
NTF_CONFIGURE_WITH_TIME_TRACE=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_TIME_REPORT}" ]]; then
NTF_CONFIGURE_WITH_TIME_REPORT=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_COVERAGE}" ]]; then
NTF_CONFIGURE_WITH_COVERAGE=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_VALGRIND}" ]]; then
NTF_CONFIGURE_WITH_VALGRIND=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_DOCUMENTATION}" ]]; then
NTF_CONFIGURE_WITH_DOCUMENTATION=0
fi
if [[ -z "${NTF_CONFIGURE_WITH_DOCUMENTATION_INTERNAL}" ]]; then
NTF_CONFIGURE_WITH_DOCUMENTATION_INTERNAL=0
fi
if [[ -z "${NTF_CONFIGURE_FROM_CONTINUOUS_INTEGRATION}" ]]; then
NTF_CONFIGURE_FROM_CONTINUOUS_INTEGRATION=0
fi
if [[ -z "${NTF_CONFIGURE_FROM_PACKAGING}" ]]; then
NTF_CONFIGURE_FROM_PACKAGING=0
fi
if [[ -z "${NTF_CONFIGURE_VERBOSITY}" ]]; then
NTF_CONFIGURE_VERBOSITY=0
fi
NTF_CONFIGURE_VERBOSE=0
NTF_CONFIGURE_WHAT=0
NTF_CONFIGURE_CLEAN=1
usage()
{
echo "usage: configure [--clean] [--refroot <path>] [--prefix <path>] [--output <path>] [--distribution <name>] [--debug|release] [--ufid <code>] [--with-<feature> <name>] [--without-<feature> <name>]"
echo "where: "
echo " --refroot <path> Path to the refroot containing build dependencies [${NTF_CONFIGURE_REFROOT}]"
echo " --prefix <path> Path to the refroot where build artifacts will be installed [${NTF_CONFIGURE_PREFIX}]"
echo " --output <path> Path to the directory where build artifacts will be staged [${NTF_CONFIGURE_OUTPUT}]"
echo " --distribution <name> Name of the distribution [${NTF_CONFIGURE_DISTRIBUTION}]"
echo " --ufid <code> The unified flag identifiers for the build system [${NTF_CONFIGURE_UFID}]"
echo " --generator <name> CMake generator name: \"Ninja\", \"Unix Makefiles\", \"NMake Makefiles\", or \"msvc\" [\"${NTF_CONFIGURE_GENERATOR}\"]"
echo " --toolchain <path> Path to the cmake toolchain file [${NTF_CONFIGURE_TOOLCHAIN}]"
echo " --sanitizer <name> Sanitizer name: \"asan\" (addressability), \"msan\" (uninitialized memory), \"tsan\" (data races), or \"ubsan\" (undefined behavior)"
echo " --jobs <number> Number of parallel build jobs [${NTF_CONFIGURE_JOBS}]"
echo " --clean Remove the previous build output, if any, before configuring"
echo " --keep Retain the previous build output, if any, while configuring"
echo " --debug Build the default debug UFID"
echo " --release Build the default release UFID"
echo " --multiplatform Decorate prefix, refroot, and output directories with uname and ufid [${NTF_CONFIGURE_MULTIPLATFORM}]"
echo " --standalone Do not decorate prefix, refroot, and output directories with uname and ufid"
echo " --unity Perform a unity, or almagamated build"
echo " --with-bsl Enable and build features that depend on BSL [${NTF_CONFIGURE_WITH_BSL}]"
echo " --with-bdl Enable and build features that depend on BDL [${NTF_CONFIGURE_WITH_BDL}]"
echo " --with-bal Enable and build features that depend on BAL [${NTF_CONFIGURE_WITH_BAL}]"
echo " --with-nts Enable and build features that depend on NTS [${NTF_CONFIGURE_WITH_NTS}]"
echo " --with-ntc Enable and build features that depend on NTC [${NTF_CONFIGURE_WITH_NTC}]"
echo " --with-address-family-ipv4 Enable the IPv4 address family [${NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV4}]"
echo " --with-address-family-ipv6 Enable the IPv6 address family [${NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV6}]"
echo " --with-address-family-local Enable the local (a.k.a. Unix) address family [${NTF_CONFIGURE_WITH_ADDRESS_FAMILY_LOCAL}]"
echo " --with-transport-protocol-tcp Enable the TCP transport protocol [${NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_TCP}]"
echo " --with-transport-protocol-udp Enable the UDP transport protocol [${NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_UDP}]"
echo " --with-transport-protocol-local Enable the local (a.k.a. Unix) transport protocol [${NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_LOCAL}]"
echo " --with-select Enable the reactor driver implemented with 'select' [${NTF_CONFIGURE_WITH_SELECT}]"
echo " --with-poll Enable the reactor driver implemented with 'poll' [${NTF_CONFIGURE_WITH_POLL}]"
echo " --with-epoll Enable the reactor driver implemented with 'epoll' (Linux only) [${NTF_CONFIGURE_WITH_EPOLL}]"
echo " --with-devpoll Enable the reactor driver implemented with /dev/poll (Solaris only) [${NTF_CONFIGURE_WITH_DEVPOLL}]"
echo " --with-eventport Enable the reactor driver implemented with Event Ports (Solaris only) [${NTF_CONFIGURE_WITH_EVENTPORT}]"
echo " --with-pollset Enable the reactor driver implemented with 'pollset' (AIX only) [${NTF_CONFIGURE_WITH_POLLSET}]"
echo " --with-kqueue Enable the reactor driver implemented with 'kqueue' on (Darwin and FreeBSD only) [${NTF_CONFIGURE_WITH_KQUEUE}]"
echo " --with-iocp Enable the proactor driver implemented with I/O completion ports (Windows only) [${NTF_CONFIGURE_WITH_IOCP}]"
echo " --with-ioring Enable the proactor driver implemented with 'io_uring' (Linux only) [${NTF_CONFIGURE_WITH_IORING}]"
echo " --with-openssl Enable the encryption driver implemented with OpenSSL [${NTF_CONFIGURE_WITH_OPENSSL}]"
echo " --with-dynamic-load-balancing Enable processing I/O on any thread, rather than a single thread [${NTF_CONFIGURE_WITH_DYNAMIC_LOAD_BALANCING}]"
echo " --with-thread-scaling Enable automatic scaling of thread pools [${NTF_CONFIGURE_WITH_THREAD_SCALING}]"
echo " --with-deprecated-features Enable deprecated features [${NTF_CONFIGURE_WITH_DEPRECATED_FEATURES}]"
echo " --with-logging Build with logging [${NTF_CONFIGURE_WITH_LOGGING}]"
echo " --with-metrics Build with metrics [${NTF_CONFIGURE_WITH_METRICS}]"
echo " --with-inlining-suggested Build functions suggested to be inlined by the compiler [${NTF_CONFIGURE_WITH_INLINING_SUGGESTED}]"
echo " --with-inlining-forced Build functions forcibly inlined [${NTF_CONFIGURE_WITH_INLINING_FORCED}]"
echo " --with-inlining-suggested Build with no functions inlined [${NTF_CONFIGURE_WITH_INLINING_DISABLED}]"
echo " --with-branch-prediction Build with branch prediction [${NTF_CONFIGURE_WITH_BRANCH_PREDICTION}]"
echo " --with-spin-locks Build with mutually-exclusive locks implemented as spin locks [${NTF_CONFIGURE_WITH_SPIN_LOCKS}]"
echo " --with-userspace-mutexes Build with mutually-exclusive locks implemented as userspace mutexes [${NTF_CONFIGURE_WITH_USERSPACE_MUTEXES}]"
echo " --with-system-mutexes Build with mutually-exclusive locks implemented as system mutexes [${NTF_CONFIGURE_WITH_SYSTEM_MUTEXES}]"
echo " --with-recursive-mutexes Build with mutually-exclusive locks implemented as recursive mutexes [${NTF_CONFIGURE_WITH_RECURSIVE_MUTEXES}]"
echo " --with-stack-trace-leak-report Build chronology with stack traces dumped upon function and timer leaks [${NTF_CONFIGURE_WITH_STACK_TRACE_LEAK_REPORT}]"
echo " --with-stack-trace-test-allocator Build tests with allocator stack traces dumped upon memory leaks [${NTF_CONFIGURE_WITH_STACK_TRACE_TEST_ALLOCATOR}]"
echo " --with-warnings Build with warnings enabled [${NTF_CONFIGURE_WITH_WARNINGS}]"
echo " --with-warnings-as-errors Build with warnings as errors [${NTF_CONFIGURE_WITH_WARNINGS_AS_ERRORS}]"
echo " --with-time-trace Build with time traces enabled [${NTF_CONFIGURE_WITH_TIME_TRACE}]"
echo " --with-time-report Build with time reports enabled [${NTF_CONFIGURE_WITH_TIME_REPORT}]"
echo " --with-coverage Build with code coverage enabled [${NTF_CONFIGURE_WITH_COVERAGE}]"
echo " --with-valgrind Build with tests running under valgrind [${NTF_CONFIGURE_WITH_VALGRIND}]"
echo " --with-applications Build applications [${NTF_CONFIGURE_WITH_APPLICATIONS}]"
echo " --with-usage-examples Build usage examples [${NTF_CONFIGURE_WITH_USAGE_EXAMPLES}]"
echo " --with-mocks Build mocks [${NTF_CONFIGURE_WITH_MOCKS}]"
echo " --with-integration-tests Build integration tests [${NTF_CONFIGURE_WITH_INTEGRATION_TESTS}]"
echo " --with-documentation Build documentation [${NTF_CONFIGURE_WITH_DOCUMENTATION}]"
echo " --with-documentation-internal Build documentation of internals [${NTF_CONFIGURE_WITH_DOCUMENTATION_INTERNAL}]"
echo " --from-continuous-integration Build from a continuous integration environment [${NTF_CONFIGURE_FROM_CONTINUOUS_INTEGRATION}]"
echo " --from-packaging Build from a packaging environment [${NTF_CONFIGURE_FROM_PACKAGING}]"
echo " --verbose Enable verbose build"
echo " --what Print what is being configured"
echo " --dry-run Print commands but do not execute them"
echo " --clion_config <clean|add> Generate .idea/cmake.xml with CLion CMake configuration. Generate the file either from scratch or add configuration into the existing one"
echo ""
echo "example:"
echo " Build in debug mode:"
echo " ./configure --debug"
echo ""
echo " Build with some features and without others:"
echo " ./configure --with-poll --without-select"
echo ""
echo " Generate CLion cmake.xml for the debug build:"
echo " ./configure --clion_config clean --debug"
echo ""
echo " Add to the existing CLion cmake.xml release build configuration with warnings enabled:"
echo " ./configure --with-warnings --clion_config add --release"
exit 1
}
while true ; do
case "$1" in
--help)
usage ;;
--refroot)
NTF_CONFIGURE_REFROOT=$2 ; shift 2 ;;
--prefix)
NTF_CONFIGURE_PREFIX=$2 ; shift 2 ;;
--output)
NTF_CONFIGURE_OUTPUT=$2 ; shift 2 ;;
--distribution)
NTF_CONFIGURE_DISTRIBUTION=$2 ; shift 2 ;;
--clean)
NTF_CONFIGURE_CLEAN=1 ; shift ;;
--keep)
NTF_CONFIGURE_CLEAN=0 ; shift ;;
--ufid)
NTF_CONFIGURE_UFID=$2
if [[ "${NTF_CONFIGURE_UFID}" == *"opt"* ]]; then
NTF_CONFIGURE_WITH_LOGGING=0
else
NTF_CONFIGURE_WITH_LOGGING=1
fi
shift 2 ;;
--unity)
NTF_CONFIGURE_UNITY=1 ; shift ;;
--generator)
NTF_CONFIGURE_GENERATOR=$2 ; shift 2 ;;
--toolchain)
NTF_CONFIGURE_TOOLCHAIN=$2 ; shift 2 ;;
--sanitizer)
NTF_CONFIGURE_SANITIZER=$2 ; shift 2 ;;
--jobs)
NTF_CONFIGURE_JOBS=$2 ; shift 2 ;;
--debug)
NTF_CONFIGURE_UFID="dbg_exc_mt_64"
NTF_CONFIGURE_WITH_LOGGING=1
shift ;;
--release)
NTF_CONFIGURE_UFID="opt_dbg_exc_mt_64"
shift ;;
--multiplatform)
NTF_CONFIGURE_MULTIPLATFORM=1 ; shift ;;
--standalone)
NTF_CONFIGURE_MULTIPLATFORM=0 ; shift ;;
--with-warnings)
NTF_CONFIGURE_WITH_WARNINGS=1 ; shift ;;
--with-warnings-as-errors)
NTF_CONFIGURE_WITH_WARNINGS_AS_ERRORS=1 ; shift ;;
--with-time-trace)
NTF_CONFIGURE_WITH_TIME_TRACE=1 ; shift ;;
--with-time-report)
NTF_CONFIGURE_WITH_TIME_REPORT=1 ; shift ;;
--with-coverage)
NTF_CONFIGURE_WITH_COVERAGE=1 ; shift ;;
--with-valgrind)
NTF_CONFIGURE_WITH_VALGRIND=1 ; shift ;;
--with-bsl)
NTF_CONFIGURE_WITH_BSL=1 ; shift ;;
--with-bdl)
NTF_CONFIGURE_WITH_BDL=1 ; shift ;;
--with-bal)
NTF_CONFIGURE_WITH_BAL=1 ; shift ;;
--with-nts)
NTF_CONFIGURE_WITH_NTS=1 ; shift ;;
--with-ntc)
NTF_CONFIGURE_WITH_NTC=1 ; shift ;;
--with-address-family-ipv4)
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV4=1 ; shift ;;
--with-address-family-ipv6)
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV6=1 ; shift ;;
--with-address-family-local)
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_LOCAL=1
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_LOCAL=1
shift ;;
--with-transport-protocol-tcp)
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_TCP=1 ; shift ;;
--with-transport-protocol-udp)
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_UDP=1 ; shift ;;
--with-transport-protocol-local)
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_LOCAL=1
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_LOCAL=1
shift ;;
--with-select)
NTF_CONFIGURE_WITH_SELECT=1 ; shift ;;
--with-poll)
NTF_CONFIGURE_WITH_POLL=1 ; shift ;;
--with-epoll)
NTF_CONFIGURE_WITH_EPOLL=1 ; shift ;;
--with-devpoll)
NTF_CONFIGURE_WITH_DEVPOLL=1 ; shift ;;
--with-eventport)
NTF_CONFIGURE_WITH_EVENTPORT=1 ; shift ;;
--with-pollset)
NTF_CONFIGURE_WITH_POLLSET=1 ; shift ;;
--with-kqueue)
NTF_CONFIGURE_WITH_KQUEUE=1 ; shift ;;
--with-iocp)
NTF_CONFIGURE_WITH_IOCP=1 ; shift ;;
--with-ioring)
NTF_CONFIGURE_WITH_IORING=1 ; shift ;;
--with-openssl)
NTF_CONFIGURE_WITH_OPENSSL=1 ; shift ;;
--with-dynamic-load-balancing)
NTF_CONFIGURE_WITH_DYNAMIC_LOAD_BALANCING=1 ; shift ;;
--with-thread-scaling)
NTF_CONFIGURE_WITH_THREAD_SCALING=1 ; shift ;;
--with-logging)
NTF_CONFIGURE_WITH_LOGGING=1 ; shift ;;
--with-metrics)
NTF_CONFIGURE_WITH_METRICS=1 ; shift ;;
--with-inlining-suggested)
NTF_CONFIGURE_WITH_INLINING_SUGGESTED=1 ; shift ;;
--with-inlining-forced)
NTF_CONFIGURE_WITH_INLINING_FORCED=1 ; shift ;;
--with-inlining-disabled)
NTF_CONFIGURE_WITH_INLINING_DISABLED=1 ; shift ;;
--with-branch-prediction)
NTF_CONFIGURE_WITH_BRANCH_PREDICTION=1 ; shift ;;
--with-spin-locks)
NTF_CONFIGURE_WITH_SPIN_LOCKS=1 ; shift ;;
--with-userspace-mutexes)
NTF_CONFIGURE_WITH_USERSPACE_MUTEXES=1 ; shift ;;
--with-system-mutexes)
NTF_CONFIGURE_WITH_SYSTEM_MUTEXES=1 ; shift ;;
--with-recursive-mutexes)
NTF_CONFIGURE_WITH_RECURSIVE_MUTEXES=1 ; shift ;;
--with-stack-trace-leak-report)
NTF_CONFIGURE_WITH_STACK_TRACE_LEAK_REPORT=1 ; shift ;;
--with-stack-trace-test-allocator)
NTF_CONFIGURE_WITH_STACK_TRACE_TEST_ALLOCATOR=1 ; shift ;;
--with-applications)
NTF_CONFIGURE_WITH_APPLICATIONS=1 ; shift ;;
--with-usage-examples)
NTF_CONFIGURE_WITH_USAGE_EXAMPLES=1 ; shift ;;
--with-mocks)
NTF_CONFIGURE_WITH_MOCKS=1 ; shift ;;
--with-integration-tests)
NTF_CONFIGURE_WITH_INTEGRATION_TESTS=1 ; shift ;;
--with-documentation)
NTF_CONFIGURE_WITH_DOCUMENTATION=1 ; shift ;;
--with-documentation-internal)
NTF_CONFIGURE_WITH_DOCUMENTATION_INTERNAL=1 ; shift ;;
--without-warnings)
NTF_CONFIGURE_WITH_WARNINGS=0 ; shift ;;
--without-warnings-as-errors)
NTF_CONFIGURE_WITH_WARNINGS_AS_ERRORS=0 ; shift ;;
--without-time-trace)
NTF_CONFIGURE_WITH_TIME_TRACE=0 ; shift ;;
--without-time-report)
NTF_CONFIGURE_WITH_TIME_REPORT=0 ; shift ;;
--without-coverage)
NTF_CONFIGURE_WITH_COVERAGE=0 ; shift ;;
--without-valgrind)
NTF_CONFIGURE_WITH_VALGRIND=0 ; shift ;;
--without-bsl)
NTF_CONFIGURE_WITH_BSL=0 ; shift ;;
--without-bdl)
NTF_CONFIGURE_WITH_BDL=0 ; shift ;;
--without-bal)
NTF_CONFIGURE_WITH_BAL=0 ; shift ;;
--without-nts)
NTF_CONFIGURE_WITH_NTS=0 ; shift ;;
--without-ntc)
NTF_CONFIGURE_WITH_NTC=0 ; shift ;;
--without-address-family-ipv4)
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV4=0 ; shift ;;
--without-address-family-ipv6)
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV6=0 ; shift ;;
--without-address-family-local)
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_LOCAL=0
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_LOCAL=0
shift ;;
--without-transport-protocol-tcp)
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_TCP=0 ; shift ;;
--without-transport-protocol-udp)
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_UDP=0 ; shift ;;
--without-transport-protocol-local)
NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_LOCAL=0
NTF_CONFIGURE_WITH_ADDRESS_FAMILY_LOCAL=0
shift ;;
--without-select)
NTF_CONFIGURE_WITH_SELECT=0 ; shift ;;
--without-poll)
NTF_CONFIGURE_WITH_POLL=0 ; shift ;;
--without-epoll)
NTF_CONFIGURE_WITH_EPOLL=0 ; shift ;;
--without-devpoll)
NTF_CONFIGURE_WITH_DEVPOLL=0 ; shift ;;
--without-eventport)
NTF_CONFIGURE_WITH_EVENTPORT=0 ; shift ;;
--without-pollset)
NTF_CONFIGURE_WITH_POLLSET=0 ; shift ;;
--without-kqueue)
NTF_CONFIGURE_WITH_KQUEUE=0 ; shift ;;
--without-iocp)
NTF_CONFIGURE_WITH_IOCP=0 ; shift ;;
--without-ioring)
NTF_CONFIGURE_WITH_IORING=0 ; shift ;;
--without-openssl)
NTF_CONFIGURE_WITH_OPENSSL=0 ; shift ;;
--without-dynamic-load-balancing)
NTF_CONFIGURE_WITH_DYNAMIC_LOAD_BALANCING=0 ; shift ;;
--without-thread-scaling)
NTF_CONFIGURE_WITH_THREAD_SCALING=0 ; shift ;;
--without-logging)
NTF_CONFIGURE_WITH_LOGGING=0 ; shift ;;
--without-metrics)
NTF_CONFIGURE_WITH_METRICS=0 ; shift ;;
--without-inlining-suggested)
NTF_CONFIGURE_WITH_INLINING_SUGGESTED=0 ; shift ;;
--without-inlining-forced)
NTF_CONFIGURE_WITH_INLINING_FORCED=0 ; shift ;;
--without-inlining-disabled)
NTF_CONFIGURE_WITH_INLINING_DISABLED=0 ; shift ;;
--without-branch-prediction)
NTF_CONFIGURE_WITH_BRANCH_PREDICTION=0 ; shift ;;
--without-spin-locks)
NTF_CONFIGURE_WITH_SPIN_LOCKS=0 ; shift ;;
--without-userspace-mutexes)
NTF_CONFIGURE_WITH_USERSPACE_MUTEXES=0 ; shift ;;
--without-system-mutexes)
NTF_CONFIGURE_WITH_SYSTEM_MUTEXES=0 ; shift ;;
--without-recursive-mutexes)
NTF_CONFIGURE_WITH_RECURSIVE_MUTEXES=0 ; shift ;;
--without-stack-trace-leak-report)
NTF_CONFIGURE_WITH_STACK_TRACE_LEAK_REPORT=0 ; shift ;;
--without-stack-trace-test-allocator)
NTF_CONFIGURE_WITH_STACK_TRACE_TEST_ALLOCATOR=0 ; shift ;;
--without-applications)
NTF_CONFIGURE_WITH_APPLICATIONS=0 ; shift ;;
--without-usage-examples)
NTF_CONFIGURE_WITH_USAGE_EXAMPLES=0 ; shift ;;
--without-mocks)
NTF_CONFIGURE_WITH_MOCKS=0 ; shift ;;
--without-integration-tests)
NTF_CONFIGURE_WITH_INTEGRATION_TESTS=0 ; shift ;;
--without-documentation)
NTF_CONFIGURE_WITH_DOCUMENTATION=0 ; shift ;;
--without-documentation-internal)
NTF_CONFIGURE_WITH_DOCUMENTATION_INTERNAL=0 ; shift ;;
--from-continuous-integration)
NTF_CONFIGURE_FROM_CONTINUOUS_INTEGRATION=1
shift ;;
--from-packaging)
NTF_CONFIGURE_FROM_PACKAGING=1 ; shift ;;
--verbose)
NTF_CONFIGURE_VERBOSE=1 ; shift ;;
--verbosity)
NTF_CONFIGURE_VERBOSITY=$2 ; shift 2 ;;
--what)
NTF_CONFIGURE_WHAT=1 ; shift ;;
--clion_config)
if [[ $# -lt 2 ]]; then
NTF_GENERATE_CLION_CONFIG="clean"
shift 1
else
NTF_GENERATE_CLION_CONFIG=$2 ;
shift 2
fi ;;
--*)
echo "Invalid option: ${1}"
usage ;;
*)
NTF_CONFIGURE_TARGET_LIST=$@; break ;;
esac
done
if [ ${NTF_CONFIGURE_WHAT} -eq 1 ]; then
echo "NTF version 4.0 on ${NTF_CONFIGURE_UNAME}"
exit 0
fi
if [ ${NTF_CONFIGURE_MULTIPLATFORM} -eq 1 ]; then
NTF_CONFIGURE_OUTPUT="${NTF_CONFIGURE_OUTPUT}/${NTF_CONFIGURE_UNAME}/${NTF_CONFIGURE_UFID}"
fi
export NTF_CONFIGURE_UNAME
export NTF_CONFIGURE_UFID
export NTF_CONFIGURE_UNITY
export NTF_CONFIGURE_PREFIX
export NTF_CONFIGURE_REFROOT
export NTF_CONFIGURE_SANITIZER
export NTF_CONFIGURE_WITH_WARNINGS
export NTF_CONFIGURE_WITH_WARNINGS_AS_ERRORS
export NTF_CONFIGURE_WITH_TIME_TRACE
export NTF_CONFIGURE_WITH_TIME_REPORT
export NTF_CONFIGURE_WITH_COVERAGE
export NTF_CONFIGURE_WITH_VALGRIND
export NTF_CONFIGURE_WITH_BSL
export NTF_CONFIGURE_WITH_BDL
export NTF_CONFIGURE_WITH_BAL
export NTF_CONFIGURE_WITH_NTS
export NTF_CONFIGURE_WITH_NTC
export NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV4
export NTF_CONFIGURE_WITH_ADDRESS_FAMILY_IPV6
export NTF_CONFIGURE_WITH_ADDRESS_FAMILY_LOCAL
export NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_TCP
export NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_UDP
export NTF_CONFIGURE_WITH_TRANSPORT_PROTOCOL_LOCAL
export NTF_CONFIGURE_WITH_SELECT
export NTF_CONFIGURE_WITH_POLL
export NTF_CONFIGURE_WITH_EPOLL
export NTF_CONFIGURE_WITH_DEVPOLL
export NTF_CONFIGURE_WITH_EVENTPORT
export NTF_CONFIGURE_WITH_POLLSET
export NTF_CONFIGURE_WITH_KQUEUE
export NTF_CONFIGURE_WITH_IOCP
export NTF_CONFIGURE_WITH_IORING
export NTF_CONFIGURE_WITH_OPENSSL
export NTF_CONFIGURE_WITH_DYNAMIC_LOAD_BALANCING
export NTF_CONFIGURE_WITH_THREAD_SCALING
export NTF_CONFIGURE_WITH_DEPRECATED_FEATURES
export NTF_CONFIGURE_WITH_LOGGING
export NTF_CONFIGURE_WITH_METRICS
export NTF_CONFIGURE_WITH_INLINING_SUGGESTED
export NTF_CONFIGURE_WITH_INLINING_FORCED
export NTF_CONFIGURE_WITH_INLINING_DISABLED
export NTF_CONFIGURE_WITH_BRANCH_PREDICTION
export NTF_CONFIGURE_WITH_SPIN_LOCKS
export NTF_CONFIGURE_WITH_USERSPACE_MUTEXES
export NTF_CONFIGURE_WITH_SYSTEM_MUTEXES
export NTF_CONFIGURE_WITH_RECURSIVE_MUTEXES
export NTF_CONFIGURE_WITH_STACK_TRACE_LEAK_REPORT
export NTF_CONFIGURE_WITH_STACK_TRACE_TEST_ALLOCATOR
export NTF_CONFIGURE_WITH_APPLICATIONS
export NTF_CONFIGURE_WITH_USAGE_EXAMPLES
export NTF_CONFIGURE_WITH_MOCKS
export NTF_CONFIGURE_WITH_INTEGRATION_TESTS
export NTF_CONFIGURE_WITH_DOCUMENTATION
export NTF_CONFIGURE_WITH_DOCUMENTATION_INTERNAL
export NTF_CONFIGURE_FROM_CONTINUOUS_INTEGRATION
export NTF_CONFIGURE_FROM_PACKAGING
export NTF_CONFIGURE_VERBOSITY
cd ${NTF_CONFIGURE_REPOSITORY}
if [ ${NTF_CONFIGURE_CLEAN} -eq 1 ]; then
rm -rf ${NTF_CONFIGURE_OUTPUT}
fi
NTF_CONFIGURE_LOG_DIRECTORY=${NTF_CONFIGURE_OUTPUT}
NTF_CONFIGURE_LOG_PREFIX="${NTF_CONFIGURE_OUTPUT}/${NTF_CONFIGURE_UNAME}-${NTF_CONFIGURE_UFID}-"
mkdir -p ${NTF_CONFIGURE_LOG_DIRECTORY}
export PATH=${NTF_CONFIGURE_REFROOT}/${NTF_CONFIGURE_PREFIX}/bin:${PATH}
if [[ -z "${NTF_CONFIGURE_CMAKE}" ]]; then
NTF_CONFIGURE_CMAKE=$(which cmake 2>/dev/null)
if [ ${?} -ne 0 ]; then
NTF_CONFIGURE_CMAKE=$(which cmake3 2>/dev/null)
if [ ${?} -ne 0 ]; then
echo "Failed to find cmake"
exit 1
fi
fi
fi
if [[ -z "${NTF_CONFIGURE_MAKE}" ]]; then
NTF_CONFIGURE_MAKE=$(which gmake 2>/dev/null)
if [ ${?} -ne 0 ]; then
NTF_CONFIGURE_MAKE=$(which make 2>/dev/null)
if [ ${?} -ne 0 ]; then
echo "Failed to find make"
exit 1
fi
fi
fi
if [[ "${NTF_CONFIGURE_GENERATOR}" == "Ninja" ]]; then
if [[ -z "${NTF_CONFIGURE_NINJA}" ]]; then
NTF_CONFIGURE_NINJA=$(which ninja 2>&1)
if [ ${?} -ne 0 ]; then
echo "Failed to find ninja"
exit 1
fi
fi
fi
NTF_CONFIGURE_UFID_CANONICAL="${NTF_CONFIGURE_UFID}"
if [[ -n "${NTF_CONFIGURE_SANITIZER}" ]]; then
if [[ "${NTF_CONFIGURE_SANITIZER}" != "asan" ]] &&
[[ "${NTF_CONFIGURE_SANITIZER}" != "msan" ]] &&
[[ "${NTF_CONFIGURE_SANITIZER}" != "tsan" ]] &&
[[ "${NTF_CONFIGURE_SANITIZER}" != "ubsan" ]]; then
echo "Invalid sanitizer '"${NTF_CONFIGURE_SANITIZER}"': must be one of 'asan', 'msan', 'tsan', or 'ubsan'"
exit 1
fi
fi