forked from openthread/openthread
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
1666 lines (1361 loc) · 50.2 KB
/
configure.ac
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
#
# Declare autoconf version requirements
#
AC_PREREQ([2.68])
#
# Initialize autoconf for the package
#
AC_INIT([OPENTHREAD],
m4_esyscmd([third_party/nlbuild-autotools/repo/scripts/mkversion -b `cat .default-version` .]),
[openthread],
[http://github.com/openthread/openthread])
# Tell the rest of the build system the absolute path where the
# nlbuild-autotools repository is rooted at.
AC_SUBST(nlbuild_autotools_stem,[third_party/nlbuild-autotools/repo])
AC_SUBST(abs_top_nlbuild_autotools_dir,[\${abs_top_srcdir}/\${nlbuild_autotools_stem}])
#
# OPENTHREAD interface current, revision, and age versions.
#
# Maintainters: Please manage these fields as follows:
#
# Interfaces removed: CURRENT++, AGE = 0, REVISION = 0
# Interfaces added: CURRENT++, AGE++, REVISION = 0
# No interfaces changed: REVISION++
#
#
AC_SUBST(LIBOPENTHREAD_VERSION_CURRENT, [0])
AC_SUBST(LIBOPENTHREAD_VERSION_AGE, [5])
AC_SUBST(LIBOPENTHREAD_VERSION_REVISION, [0])
AC_SUBST(LIBOPENTHREAD_VERSION_INFO, [${LIBOPENTHREAD_VERSION_CURRENT}:${LIBOPENTHREAD_VERSION_REVISION}:${LIBOPENTHREAD_VERSION_AGE}])
#
# Check the sanity of the source directory by checking for the
# presence of a key watch file
#
AC_CONFIG_SRCDIR([include/openthread/openthread.h])
#
# Tell autoconf where to find auxilliary build tools (e.g. config.guess,
# install-sh, missing, etc.)
#
AC_CONFIG_AUX_DIR([third_party/nlbuild-autotools/repo/third_party/autoconf])
#
# Tell autoconf where to find auxilliary M4 macros
#
AC_CONFIG_MACRO_DIRS([third_party/nlbuild-autotools/repo/third_party/autoconf/m4 third_party/nlbuild-autotools/repo/autoconf/m4])
#
# Tell autoconf what file the package is using to aggregate C preprocessor
# defines.
#
AC_CONFIG_HEADERS([include/openthread-config-generic.h])
#
# Figure out what the canonical build and host tuples are.
#
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
#
# Mac OS X / Darwin ends up putting some versioning cruft on the end of its
# tuple that we don't care about in this script. Create "clean" variables
# devoid of it.
#
NL_FILTERED_CANONICAL_BUILD
NL_FILTERED_CANONICAL_HOST
#
# Configure automake with the desired options, indicating that this is not
# a native GNU package, that we want "silent" build rules, and that we want
# objects built in the same subdirectory as their source rather than collapsed
# together at the top-level directory.
#
# Disable silent build rules by either passing --disable-silent-rules to
# configure or passing V=1 to make
#
AM_INIT_AUTOMAKE([1.14 foreign silent-rules subdir-objects tar-pax])
#
# Silent build rules requires at least automake-1.11. Employ
# techniques for not breaking earlier versions of automake.
#
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_SILENT_RULES([yes])
#
# Enable maintainer mode to prevent the package from constantly trying
# to rebuild configure, Makefile.in, etc. Rebuilding such files rarely,
# if ever, needs to be done "in the field".
#
# Use the included 'bootstrap' script instead when necessary.
#
AM_MAINTAINER_MODE
#
# Host-os-specific checks
#
case ${host_os} in
*darwin*)
OPENTHREAD_TARGET=darwin
OPENTHREAD_TARGET_DEFINES="-DOPENTHREAD_TARGET_DARWIN"
;;
*linux*)
OPENTHREAD_TARGET=linux
OPENTHREAD_TARGET_DEFINES="-DOPENTHREAD_TARGET_LINUX"
;;
esac
AC_SUBST(OPENTHREAD_TARGET_DARWIN)
AM_CONDITIONAL([OPENTHREAD_TARGET_DARWIN], [test "${OPENTHREAD_TARGET}" = "darwin"])
AC_SUBST(OPENTHREAD_TARGET_LINUX)
AM_CONDITIONAL([OPENTHREAD_TARGET_LINUX], [test "${OPENTHREAD_TARGET}" = "linux"])
AC_SUBST(OPENTHREAD_TARGET_DEFINES)
#
# Checks for build host programs
#
# This is a hack to restore some old broken behavior that was
# removed in pull request #1527. It's use is highly discouraged,
# you should try to fix your build environment instead.
AC_ARG_ENABLE(no-executables-hack,
[AS_HELP_STRING([--enable-no-executables-hack],
[Enable hack that prevents link checks at configure time. Highly discouraged.])])
AC_MSG_CHECKING([whether to disable executable checking])
if test "${enable_no_executables_hack}" = "yes"
then
AC_MSG_RESULT([yes])
AC_NO_EXECUTABLES
# Here we guess conservative values for tests that require link checks
# to test for these features. This will prevent these checks from
# being performed later in the configuration process.
ac_cv_func_strlcat=${ac_cv_func_strlcat-no}
ac_cv_func_strlcpy=${ac_cv_func_strlcpy-no}
ac_cv_func_strnlen=${ac_cv_func_strnlen-no}
else
AC_MSG_RESULT([no])
fi
# Passing -Werror to GCC-based or -compatible compilers breaks some
# autoconf tests (see
# http://lists.gnu.org/archive/html/autoconf-patches/2008-09/msg00014.html).
#
# If -Werror has been passed transform it into -Wno-error. We'll
# transform it back later with NL_RESTORE_WERROR.
NL_SAVE_WERROR
# Check for compilers.
#
# These should be checked BEFORE we check for and, implicitly,
# initialize libtool such that libtool knows what languages it has to
# work with.
AC_PROG_CPP
AC_PROG_CPP_WERROR
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_CXXCPP
AC_PROG_CXX
AC_PROG_CXX_C_O
AM_PROG_AS
# Check for other compiler toolchain tools.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib)
AC_CHECK_TOOL(OBJCOPY, objcopy)
AC_CHECK_TOOL(STRIP, strip)
# Check for other host tools.
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PATH_PROG(CMP, cmp)
#
# Checks for specific compiler characteristics
#
#
# Common compiler flags we would like to have.
#
# -Wall CC, CXX
#
PROSPECTIVE_CFLAGS="-Wall -Wextra -Wshadow -Werror -std=c99 -pedantic-errors"
PROSPECTIVE_CXXFLAGS="-Wall -Wextra -Wshadow -Werror -std=gnu++98 -Wno-c++14-compat"
AC_CACHE_CHECK([whether $CC is Clang],
[nl_cv_clang],
[nl_cv_clang=no
if test "x${GCC}" = "xyes"; then
AC_EGREP_CPP([NL_CC_IS_CLANG],
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
# if defined(__clang__) && defined(__llvm__)
NL_CC_IS_CLANG
# endif
],
[nl_cv_clang=yes])
fi
])
if test "${nl_cv_clang}" = "yes"; then
PROSPECTIVE_CFLAGS="${PROSPECTIVE_CFLAGS} -Wconversion"
PROSPECTIVE_CXXFLAGS="${PROSPECTIVE_CXXFLAGS} -Wconversion"
fi
AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS})
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CXXFLAGS})
# Check for and initialize libtool
LT_INIT
AC_PROG_LIBTOOL
# Disable building shared libraries by default (can be enabled with --enable-shared)
AC_DISABLE_SHARED
#
# Debug instances
#
AC_MSG_NOTICE([checking whether to build debug instances])
# Debug
NL_ENABLE_DEBUG([no])
AM_CONDITIONAL([OPENTHREAD_BUILD_DEBUG], [test "${nl_cv_build_debug}" = "yes"])
#
# Code coverage and compiler optimization
#
# Coverage
NL_ENABLE_COVERAGE([no])
AM_CONDITIONAL([OPENTHREAD_BUILD_COVERAGE], [test "${nl_cv_build_coverage}" = "yes"])
NL_ENABLE_COVERAGE_REPORTS([auto])
AM_CONDITIONAL([OPENTHREAD_BUILD_COVERAGE_REPORTS], [test "${nl_cv_build_coverage_reports}" = "yes"])
# Optimization
NL_ENABLE_OPTIMIZATION([yes])
AM_CONDITIONAL([OPENTHREAD_BUILD_OPTIMIZED], [test "${nl_cv_build_optimized}" = "yes"])
# Fuzz Targets
AC_MSG_CHECKING([whether to build fuzz targets])
AC_ARG_ENABLE(fuzz-targets,
[AS_HELP_STRING([--enable-fuzz-targets],[Enable building of fuzz targets @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_fuzz_targets=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-fuzz-targets])
;;
esac
],
[enable_fuzz_targets=no])
AC_MSG_RESULT(${enable_fuzz_targets})
AM_CONDITIONAL([OPENTHREAD_ENABLE_FUZZ_TARGETS], [test "${enable_fuzz_targets}" = "yes"])
# Address Sanitizer
AC_MSG_CHECKING([whether to build with Address Sanitizer support])
AC_ARG_ENABLE(address-sanitizer,
[AS_HELP_STRING([--enable-address-sanitizer],[Enable Address Sanitizer support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_address_sanitizer=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-address-sanitizer])
;;
esac
],
[enable_address_sanitizer=no])
AC_MSG_RESULT(${enable_address_sanitizer})
AM_CONDITIONAL([OPENTHREAD_WITH_ADDRESS_SANITIZER], [test "${enable_address_sanitizer}" = "yes"])
if test "${enable_address_sanitizer}" = "yes" ; then
PROSPECTIVE_CFLAGS="-fsanitize=address"
# Check if the compilers support address sanitizer
AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS})
AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CFLAGS})
fi
#
# Code style
#
AC_SUBST(PRETTY, ["\${abs_top_srcdir}/script/clang-format.sh"])
AC_SUBST(PRETTY_ARGS, ["-style=file -i"])
AC_SUBST(PRETTY_CHECK, ["\${abs_top_srcdir}/script/clang-format-check.sh"])
AC_SUBST(PRETTY_CHECK_ARGS, [""])
#
# Tests
#
AC_MSG_NOTICE([checking whether to build tests])
# Tests
NL_ENABLE_TESTS([yes])
AM_CONDITIONAL([OPENTHREAD_BUILD_TESTS], [test "${nl_cv_build_tests}" = "yes"])
#
# CLI Library
#
AC_ARG_ENABLE(cli-app,
[AS_HELP_STRING([--enable-cli-app],[Enable CLI support (no|mtd|ftd|all) @<:@default=no@:>@.])],
[
case "${enableval}" in
all|both)
enable_cli_app=yes
enable_cli_app_mtd=yes
enable_cli_app_ftd=yes
;;
no|yes)
enable_cli_app=${enableval}
enable_cli_app_mtd=${enableval}
enable_cli_app_ftd=${enableval}
;;
mtd)
enable_cli_app=yes
enable_cli_app_mtd=yes
enable_cli_app_ftd=no
;;
ftd)
enable_cli_app=yes
enable_cli_app_mtd=no
enable_cli_app_ftd=yes
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-cli-app])
;;
esac
],
[
enable_cli_app=no
enable_cli_app_mtd=no
enable_cli_app_ftd=no])
AC_MSG_CHECKING([cli-app modes])
AC_MSG_RESULT(${enable_cli_app})
AM_CONDITIONAL([OPENTHREAD_ENABLE_CLI], [test "${enable_cli_app}" == "yes"])
AM_CONDITIONAL([OPENTHREAD_ENABLE_CLI_MTD], [test "${enable_cli_app_mtd}" == "yes"])
AM_CONDITIONAL([OPENTHREAD_ENABLE_CLI_FTD], [test "${enable_cli_app_ftd}" == "yes"])
AC_SUBST(OPENTHREAD_ENABLE_CLI)
AC_SUBST(OPENTHREAD_ENABLE_CLI_FTD)
AC_SUBST(OPENTHREAD_ENABLE_CLI_MTD)
#
# NCP app
#
AC_ARG_ENABLE(ncp-app,
[AS_HELP_STRING([--enable-ncp-app],[Enable NCP support (no|mtd|ftd|radio|all) @<:@default=no@:>@.])],
[
# Map all & both to yes
case "${enableval}" in
all)
enableval=yes
;;
*)
;;
esac
case "${enableval}" in
no|yes)
enable_ncp_app=${enableval}
enable_ncp_app_mtd=${enableval}
enable_ncp_app_ftd=${enableval}
enable_ncp_app_radio=${enableval}
;;
mtd)
enable_ncp_app=yes
enable_ncp_app_mtd=yes
enable_ncp_app_ftd=no
enable_ncp_app_radio=no
;;
ftd)
enable_ncp_app=yes
enable_ncp_app_mtd=no
enable_ncp_app_ftd=yes
enable_ncp_app_radio=no
;;
radio)
enable_ncp_app=yes
enable_ncp_app_mtd=no
enable_ncp_app_ftd=no
enable_ncp_app_radio=yes
;;
*)
AC_MSG_ERROR([Invalid value ${enableval} for --enable-ncp-app])
;;
esac
],
[
enable_ncp_app=no
enable_ncp_app_ftd=no
enable_ncp_app_mtd=no
enable_ncp_app_radio=no
]
)
AC_MSG_CHECKING([ncp-app modes])
AC_MSG_RESULT(${enable_ncp_app})
AC_MSG_CHECKING([should NCP support ftd])
AC_MSG_RESULT(${enable_ncp_app_ftd})
AC_MSG_CHECKING([should NCP support mtd])
AC_MSG_RESULT(${enable_ncp_app_mtd})
AC_MSG_CHECKING([should NCP support radio-only])
AC_MSG_RESULT(${enable_ncp_app_radio})
AC_SUBST(OPENTHREAD_ENABLE_NCP)
AC_SUBST(OPENTHREAD_ENABLE_NCP_MTD)
AC_SUBST(OPENTHREAD_ENABLE_NCP_FTD)
AC_SUBST(OPENTHREAD_ENABLE_NCP_RADIO)
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP], [test "${enable_ncp_app}" == "yes"])
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_MTD], [test "${enable_ncp_app_mtd}" == "yes"])
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_FTD], [test "${enable_ncp_app_ftd}" == "yes"])
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_RADIO], [test "${enable_ncp_app_radio}" == "yes"])
#
# NCP BUS - how does the NCP talk to the host?
#
AC_ARG_WITH(
[ncp-bus],
[AS_HELP_STRING([--with-ncp-bus],[Specify the NCP bus (none|spi|uart) @<:@default=none@:>@.])],
[
case "${with_ncp_bus}" in
"none")
OPENTHREAD_ENABLE_NCP_SPI=0
OPENTHREAD_ENABLE_NCP_UART=0
;;
"spi")
OPENTHREAD_ENABLE_NCP_SPI=1
OPENTHREAD_ENABLE_NCP_UART=0
;;
"uart")
OPENTHREAD_ENABLE_NCP_SPI=0
OPENTHREAD_ENABLE_NCP_UART=1
;;
*)
AC_MSG_ERROR([unexpected --with-ncp-bus=${with_ncp_bus}])
;;
esac
],
[
OPENTHREAD_ENABLE_NCP_SPI=0
OPENTHREAD_ENABLE_NCP_UART=0
])
AC_SUBST(OPENTHREAD_ENABLE_NCP_SPI)
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_SPI], [test "${with_ncp_bus}" = "spi"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_SPI],[${OPENTHREAD_ENABLE_NCP_SPI}],[Define to 1 to enable the NCP SPI interface.])
AC_MSG_CHECKING([should NCP support SPI])
AC_MSG_RESULT([${OPENTHREAD_ENABLE_SPI}])
AC_SUBST(OPENTHREAD_ENABLE_NCP_UART)
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_UART], [test "${with_ncp_bus}" = "uart"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_UART],[${OPENTHREAD_ENABLE_NCP_UART}],[Define to 1 to enable the NCP UART interface.])
AC_MSG_CHECKING([should NCP support UART])
AC_MSG_RESULT([${OPENTHREAD_ENABLE_UART}])
#
# Multiple OpenThread Instances
#
AC_ARG_ENABLE(multiple-instances,
[AS_HELP_STRING([--enable-multiple-instances],[Enable support for multiple OpenThread instances @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_multiple_instances=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_multiple_instances} for --enable-multiple-instances])
;;
esac
],
[enable_multiple_instances=no])
if test "$enable_multiple_instances" = "yes"; then
OPENTHREAD_ENABLE_MULTIPLE_INSTANCES=1
else
OPENTHREAD_ENABLE_MULTIPLE_INSTANCES=0
fi
AC_MSG_RESULT(${enable_multiple_instances})
AC_SUBST(OPENTHREAD_ENABLE_MULTIPLE_INSTANCES)
AM_CONDITIONAL([OPENTHREAD_ENABLE_MULTIPLE_INSTANCES], [test "${enable_multiple_instances}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_MULTIPLE_INSTANCES],[${OPENTHREAD_ENABLE_MULTIPLE_INSTANCES}],[Define to 1 if you want to enable support for multiple OpenThread instances.])
#
# Builtin mbedtls
#
AC_ARG_ENABLE(builtin-mbedtls,
[AS_HELP_STRING([--enable-builtin-mbedtls],[Enable builtin mbedtls @<:@default=yes@:>@.])],
[
case "${enableval}" in
no|yes)
enable_builtin_mbedtls=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_builtin_mbedtls} for --enable-builtin-mbedtls])
;;
esac
],
[enable_builtin_mbedtls=yes])
if test "$enable_builtin_mbedtls" = "yes" -a ! "${MBEDTLS_CPPFLAGS}"; then
MBEDTLS_CPPFLAGS="-I\${abs_top_srcdir}/third_party/mbedtls"
MBEDTLS_CPPFLAGS="${MBEDTLS_CPPFLAGS} -I\${abs_top_srcdir}/third_party/mbedtls/repo.patched/include"
MBEDTLS_CPPFLAGS="${MBEDTLS_CPPFLAGS} -I\${abs_top_srcdir}/third_party/mbedtls/repo.patched/include/mbedtls"
MBEDTLS_CPPFLAGS="${MBEDTLS_CPPFLAGS} -DMBEDTLS_CONFIG_FILE=\\\"mbedtls-config.h\\\""
fi
AC_MSG_CHECKING([whether mbed TLS should be enabled])
AC_MSG_RESULT(${enable_builtin_mbedtls})
AM_CONDITIONAL([OPENTHREAD_ENABLE_BUILTIN_MBEDTLS], [test "${enable_builtin_mbedtls}" = "yes"])
#
# Thread TMF Proxy
#
AC_MSG_CHECKING([whether to enable TMF proxy])
AC_ARG_ENABLE(tmf_proxy,
[AS_HELP_STRING([--enable-tmf-proxy],[Enable TMF proxy support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_tmf_proxy=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_tmf_proxy} for --enable-tmf-proxy])
;;
esac
],
[enable_tmf_proxy=no])
if test "$enable_tmf_proxy" = "yes"; then
OPENTHREAD_ENABLE_TMF_PROXY=1
else
OPENTHREAD_ENABLE_TMF_PROXY=0
fi
AC_MSG_RESULT(${enable_tmf_proxy})
AC_SUBST(OPENTHREAD_ENABLE_TMF_PROXY)
AM_CONDITIONAL([OPENTHREAD_ENABLE_TMF_PROXY], [test "${enable_tmf_proxy}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_TMF_PROXY],[${OPENTHREAD_ENABLE_TMF_PROXY}],[Define to 1 to enable the TMF proxy feature.])
#
# Thread Network Diagnostic for MTD
#
AC_ARG_ENABLE(mtd_network_diagnostic,
[AS_HELP_STRING([--enable-mtd-network-diagnostic],[Enable network diagnostic support for MTD @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_mtd_network_diagnostic=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_mtd_network_diagnostic} for --enable-mtd-network-diagnostic])
;;
esac
],
[enable_mtd_network_diagnostic=no])
if test "$enable_mtd_network_diagnostic" = "yes"; then
OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC=1
else
OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC=0
fi
AC_MSG_CHECKING([whether to enable the network diagnostic for MTD])
AC_MSG_RESULT(${enable_mtd_network_diagnostic})
AC_SUBST(OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC)
AM_CONDITIONAL([OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC], [test "${enable_mtd_network_diagnostic}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC],[${OPENTHREAD_ENABLE_MTD_NETWORK_DIAGNOSTIC}],[Define to 1 to enable network diagnostic for MTD.])
#
# Thread Commissioner
#
AC_ARG_ENABLE(commissioner,
[AS_HELP_STRING([--enable-commissioner],[Enable commissioner support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_commissioner=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_commissioner} for --enable-commissioner])
;;
esac
],
[enable_commissioner=no])
if test "$enable_commissioner" = "yes"; then
OPENTHREAD_ENABLE_COMMISSIONER=1
else
OPENTHREAD_ENABLE_COMMISSIONER=0
fi
AC_MSG_CHECKING([whether to enable the commissioner])
AC_MSG_RESULT(${enable_commissioner})
AC_SUBST(OPENTHREAD_ENABLE_COMMISSIONER)
AM_CONDITIONAL([OPENTHREAD_ENABLE_COMMISSIONER], [test "${enable_commissioner}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_COMMISSIONER],[${OPENTHREAD_ENABLE_COMMISSIONER}],[Define to 1 to enable the commissioner role.])
#
# Thread Joiner
#
AC_ARG_ENABLE(joiner,
[AS_HELP_STRING([--enable-joiner],[Enable joiner support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_joiner=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_joiner} for --enable-joiner])
;;
esac
],
[enable_joiner=no])
if test "$enable_joiner" = "yes"; then
OPENTHREAD_ENABLE_JOINER=1
else
OPENTHREAD_ENABLE_JOINER=0
fi
AC_MSG_CHECKING([whether to enable the joiner feature])
AC_MSG_RESULT(${enable_joiner})
AC_SUBST(OPENTHREAD_ENABLE_JOINER)
AM_CONDITIONAL([OPENTHREAD_ENABLE_JOINER], [test "${enable_joiner}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_JOINER],[${OPENTHREAD_ENABLE_JOINER}],[Define to 1 to enable the joiner role.])
if test "${enable_commissioner}" = "yes" -o "${enable_joiner}" = "yes"; then
enable_dtls="yes"
OPENTHREAD_ENABLE_DTLS=1
else
enable_dtls="no"
OPENTHREAD_ENABLE_DTLS=0
fi
AC_MSG_CHECKING([whether to enable DTLS due to joiner/commissioner])
AC_MSG_RESULT(${enable_dtls})
AC_SUBST(OPENTHREAD_ENABLE_DTLS)
AM_CONDITIONAL([OPENTHREAD_ENABLE_DTLS], [test "${enable_dtls}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_DTLS],[${OPENTHREAD_ENABLE_DTLS}],[Define to 1 to enable dtls support.])
#
# Jam Detection
#
AC_ARG_ENABLE(jam_detection,
[AS_HELP_STRING([--enable-jam-detection],[Enable Jam Detection support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_jam_detection=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_jam_detection} for --enable-jam-detection])
;;
esac
],
[enable_jam_detection=no])
if test "$enable_jam_detection" = "yes"; then
OPENTHREAD_ENABLE_JAM_DETECTION=1
else
OPENTHREAD_ENABLE_JAM_DETECTION=0
fi
AC_MSG_CHECKING([whether to enable jam detection])
AC_MSG_RESULT(${enable_jam_detection})
AC_SUBST(OPENTHREAD_ENABLE_JAM_DETECTION)
AM_CONDITIONAL([OPENTHREAD_ENABLE_JAM_DETECTION], [test "${enable_jam_detection}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_JAM_DETECTION],[${OPENTHREAD_ENABLE_JAM_DETECTION}],[Define to 1 if you want to use jam detection feature])
#
# Channel Monitor
#
AC_ARG_ENABLE(channel_monitor,
[AS_HELP_STRING([--enable-channel-monitor],[Enable Channel Monitor support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_channel_monitor=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_channel_monitor} for --enable-channel-monitor])
;;
esac
],
[enable_channel_monitor=no])
if test "$enable_channel_monitor" = "yes"; then
OPENTHREAD_ENABLE_CHANNEL_MONITOR=1
else
OPENTHREAD_ENABLE_CHANNEL_MONITOR=0
fi
AC_MSG_CHECKING([whether to enable channel monitor])
AC_MSG_RESULT(${enable_channel_monitor})
AC_SUBST(OPENTHREAD_ENABLE_CHANNEL_MONITOR)
AM_CONDITIONAL([OPENTHREAD_ENABLE_CHANNEL_MONITOR], [test "${enable_channel_monitor}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_CHANNEL_MONITOR],[${OPENTHREAD_ENABLE_CHANNEL_MONITOR}],[Define to 1 if you want to use channel monitor feature])
#
# Channel Manager
#
AC_ARG_ENABLE(channel_manager,
[AS_HELP_STRING([--enable-channel-manager],[Enable Channel Manager support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_channel_manager=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_channel_manager} for --enable-channel-manager])
;;
esac
],
[enable_channel_manager=no])
if test "$enable_channel_manager" = "yes"; then
OPENTHREAD_ENABLE_CHANNEL_MANAGER=1
else
OPENTHREAD_ENABLE_CHANNEL_MANAGER=0
fi
AC_MSG_CHECKING([whether to enable channel manager])
AC_MSG_RESULT(${enable_channel_manager})
AC_SUBST(OPENTHREAD_ENABLE_CHANNEL_MANAGER)
AM_CONDITIONAL([OPENTHREAD_ENABLE_CHANNEL_MANAGER], [test "${enable_channel_manager}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_CHANNEL_MANAGER],[${OPENTHREAD_ENABLE_CHANNEL_MANAGER}],[Define to 1 if you want to enable channel manager feature])
#
# MAC Filter (include AddressFilter and RssInFilter)
#
AC_ARG_ENABLE(mac_filter,
[AS_HELP_STRING([--enable-mac-filter],[Enable MAC filter support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_mac_filter=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_mac_filter} for --enable-mac-filter])
;;
esac
],
[enable_mac_filter=no])
if test "$enable_mac_filter" = "yes"; then
OPENTHREAD_ENABLE_MAC_FILTER=1
else
OPENTHREAD_ENABLE_MAC_FILTER=0
fi
AC_MSG_CHECKING([whether to enable mac filter])
AC_MSG_RESULT(${enable_mac_filter})
AC_SUBST(OPENTHREAD_ENABLE_MAC_FILTER)
AM_CONDITIONAL([OPENTHREAD_ENABLE_MAC_FILTER], [test "${enable_mac_filter}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_MAC_FILTER],[${OPENTHREAD_ENABLE_MAC_FILTER}],[Define to 1 if you want to use MAC filter feature])
#
# Diagnostics Library
#
AC_ARG_ENABLE(diag,
[AS_HELP_STRING([--enable-diag],[Enable diagnostics support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_diag=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_diag} for --enable-diag])
;;
esac
],
[enable_diag=no])
if test "$enable_diag" = "yes"; then
OPENTHREAD_ENABLE_DIAG=1
else
OPENTHREAD_ENABLE_DIAG=0
fi
AC_MSG_CHECKING([whether to enable diag])
AC_MSG_RESULT(${enable_diag})
AC_SUBST(OPENTHREAD_ENABLE_DIAG)
AM_CONDITIONAL([OPENTHREAD_ENABLE_DIAG], [test "${enable_diag}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_DIAG],[${OPENTHREAD_ENABLE_DIAG}],[Define to 1 if you want to use diagnostics module])
#
# Legacy Network
#
AC_ARG_ENABLE(legacy,
[AS_HELP_STRING([--enable-legacy],[Enable legacy network support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_legacy=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_legacy} for --enable-legacy])
;;
esac
],
[enable_legacy=no])
if test "$enable_legacy" = "yes"; then
OPENTHREAD_ENABLE_LEGACY=1
else
OPENTHREAD_ENABLE_LEGACY=0
fi
AC_MSG_CHECKING([whether to enable legacy])
AC_MSG_RESULT(${enable_legacy})
AC_SUBST(OPENTHREAD_ENABLE_LEGACY)
AM_CONDITIONAL([OPENTHREAD_ENABLE_LEGACY], [test "${enable_legacy}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_LEGACY],[${OPENTHREAD_ENABLE_LEGACY}],[Define to 1 if you want to use legacy network support])
#
# NCP Vendor Hook Source - Specify a C++ file that implements the NCP vendor hook.
#
AC_ARG_WITH(
[ncp-vendor-hook-source],
[AS_HELP_STRING([--with-ncp-vendor-hook-source=<VENDOR_HOOK.CPP>],[Specify a C++ file that implements the NCP vendor hook. @<:@default=none@:>@.])],
[
if test "${withval}" = "no"
then OPENTHREAD_ENABLE_NCP_VENDOR_HOOK=0
elif test '!' -f "${withval}"
then AC_MSG_ERROR([Can't open ${withval} for --with-ncp-vendor-hook-source])
else
OPENTHREAD_ENABLE_NCP_VENDOR_HOOK=1
# Get the absolute path.
OPENTHREAD_NCP_VENDOR_HOOK_SOURCE=$(cd `dirname ${withval}` && pwd)/$(basename ${withval})
fi
],
[
OPENTHREAD_ENABLE_NCP_VENDOR_HOOK=0
with_ncp_vendor_hook_source=none
])
AC_MSG_CHECKING([for NCP vendor hook source])
AC_MSG_RESULT(${OPENTHREAD_NCP_VENDOR_HOOK_SOURCE-none})
AC_SUBST(OPENTHREAD_NCP_VENDOR_HOOK_SOURCE)
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_VENDOR_HOOK],[${OPENTHREAD_ENABLE_NCP_VENDOR_HOOK}],[Define to 1 if using NCP vendor hook])
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_VENDOR_HOOK], [test "${OPENTHREAD_ENABLE_NCP_VENDOR_HOOK}" = "1"])
#
# NCP Spinel Encrypter
#
AC_ARG_WITH(
[ncp-spinel-encrypter-libs],
[AS_HELP_STRING([--with-ncp-spinel-encrypter-libs=<LIBSPINEL_ENCRYPTER.A>],[Specify library files (absolute paths) implementing the NCP Spinel Encrypter. @<:@default=none@:>@.])],
[
if test "${withval}" = "no"
then OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER=0
else
OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER=1
OPENTHREAD_NCP_SPINEL_ENCRYPTER_LIBS=${withval}
fi
],
[
OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER=0
with_ncp_spinel_encrypter_libs=none
])
AC_MSG_CHECKING([for NCP Spinel Encrypter])
AC_MSG_RESULT(${OPENTHREAD_NCP_SPINEL_ENCRYPTER_LIBS-none})
AC_SUBST(OPENTHREAD_NCP_SPINEL_ENCRYPTER_LIBS)
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER],[${OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER}],[Define to 1 if using NCP Spinel Encrypter])
AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER], [test "${OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER}" = "1"])
#
# Child Supervision
#