Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1 | # -*- Autoconf -*- |
| 2 | # Process this file with autoconf to produce a configure script. |
| 3 | |
| 4 | # |
Grant Erickson | 8e58336 | 2020-03-31 10:40:56 -0700 | [diff] [blame] | 5 | # Copyright (c) 2020 Project CHIP Authors |
Rob Walker | e812e67 | 2020-03-31 17:51:57 -0700 | [diff] [blame] | 6 | # Copyright (c) 2018-2019 Google LLC |
| 7 | # Copyright (c) 2014-2018 Nest Labs, Inc. |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 8 | # |
| 9 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | # you may not use this file except in compliance with the License. |
| 11 | # You may obtain a copy of the License at |
| 12 | # |
| 13 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | # |
| 15 | # Unless required by applicable law or agreed to in writing, software |
| 16 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | # See the License for the specific language governing permissions and |
| 19 | # limitations under the License. |
| 20 | # |
| 21 | |
| 22 | # |
| 23 | # Description: |
| 24 | # This file is the GNU autoconf input source file for the |
| 25 | # Connected Home over IP package. |
| 26 | # |
| 27 | |
| 28 | # |
| 29 | # Declare autoconf version requirements |
| 30 | # |
| 31 | AC_PREREQ([2.68]) |
| 32 | |
| 33 | # |
| 34 | # Initialize autoconf for the package |
| 35 | # |
| 36 | AC_INIT([Chip], |
| 37 | m4_esyscmd([third_party/nlbuild-autotools/repo/scripts/mkversion -b `cat .default-version` .]), |
| 38 | [chip.support@zigbee.com], |
| 39 | [chip], |
| 40 | [https://zigbee.com/]) |
| 41 | |
| 42 | # Tell the rest of the build system the absolute path where the |
| 43 | # nlbuild-autotools repository is rooted at. |
| 44 | |
| 45 | AC_SUBST(nlbuild_autotools_stem,[third_party/nlbuild-autotools/repo]) |
| 46 | AC_SUBST(abs_top_nlbuild_autotools_dir,[\${abs_top_srcdir}/\${nlbuild_autotools_stem}]) |
| 47 | |
| 48 | # |
| 49 | # CHIP interface current, revision, and age versions. |
| 50 | # |
| 51 | # NOTE: At present, the CHIP SDK makes NO ABI compatibility |
| 52 | # commitments. Consequently, these simply serve as documentation |
| 53 | # for how the interfaces have evolved. |
| 54 | # |
| 55 | # Maintainters: Please manage these fields as follows: |
| 56 | # |
| 57 | # Interfaces removed: CURRENT++, AGE = 0, REVISION = 0 |
| 58 | # Interfaces added: CURRENT++, AGE++, REVISION = 0 |
| 59 | # No interfaces changed: REVISION++ |
| 60 | # |
| 61 | # |
| 62 | AC_SUBST(LIBCHIP_VERSION_CURRENT, [1]) |
| 63 | AC_SUBST(LIBCHIP_VERSION_AGE, [0]) |
| 64 | AC_SUBST(LIBCHIP_VERSION_REVISION, [0]) |
| 65 | AC_SUBST(LIBCHIP_VERSION_INFO, [${LIBCHIP_VERSION_CURRENT}:${LIBCHIP_VERSION_REVISION}:${LIBCHIP_VERSION_AGE}]) |
| 66 | |
| 67 | # |
| 68 | # Check the sanity of the source directory by checking for the |
| 69 | # presence of a key watch file |
| 70 | # |
| 71 | AC_CONFIG_SRCDIR([src/lib/core/CHIPConfig.h]) |
| 72 | |
| 73 | # |
| 74 | # Tell autoconf where to find auxilliary build tools (e.g. config.guess, |
| 75 | # install-sh, missing, etc.) |
| 76 | # |
| 77 | AC_CONFIG_AUX_DIR([build/autoconf]) |
| 78 | |
| 79 | # |
| 80 | # Tell autoconf where to find auxilliary M4 macros |
| 81 | # Note that nlbuild-autotools has macros in two subdirs, for local vs third-party scripts |
| 82 | # |
Rob Walker | aeec6c5 | 2020-04-20 10:05:18 -0700 | [diff] [blame] | 83 | AC_CONFIG_MACRO_DIRS([build/autoconf/m4 autoconf/m4 third_party/nlbuild-autotools/repo/third_party/autoconf/m4 third_party/nlbuild-autotools/repo/autoconf/m4]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 84 | |
| 85 | # |
| 86 | # Tell autoconf what file the package is using to aggregate C preprocessor |
| 87 | # defines. |
| 88 | # |
| 89 | AC_CONFIG_HEADERS([src/include/BuildConfig.h]) |
| 90 | |
| 91 | # |
| 92 | # Guards against multiple inclusion of the BuildConfig.h |
| 93 | # |
| 94 | |
| 95 | AH_TOP([#ifndef CHIP_BUILD_CONFIG_H |
| 96 | #define CHIP_BUILD_CONFIG_H]) |
| 97 | |
| 98 | AH_BOTTOM([#endif // CHIP_BUILD_CONFIG_H]) |
| 99 | |
| 100 | # |
| 101 | # Figure out what the canonical build, host and target tuples are. |
| 102 | # |
| 103 | AC_CANONICAL_BUILD |
| 104 | AC_CANONICAL_HOST |
| 105 | AC_CANONICAL_TARGET |
| 106 | |
| 107 | # |
| 108 | # Mac OS X / Darwin ends up putting some versioning cruft on the end of its |
| 109 | # tuple that we don't care about in this script. Create "clean" variables |
| 110 | # devoid of it. |
| 111 | # |
| 112 | |
| 113 | NL_FILTERED_CANONICAL_BUILD |
| 114 | NL_FILTERED_CANONICAL_HOST |
| 115 | NL_FILTERED_CANONICAL_TARGET |
| 116 | |
| 117 | # |
| 118 | # Configure automake with the desired options, indicating that this is not |
| 119 | # a native GNU package, that we want "silent" build rules, and that we want |
| 120 | # objects built in the same subdirectory as their source rather than collapsed |
| 121 | # together at the top-level directory. |
| 122 | # |
| 123 | # Disable silent build rules by either passing --disable-silent-rules to |
| 124 | # configure or passing V=1 to make |
| 125 | # |
| 126 | AM_INIT_AUTOMAKE([1.14 foreign silent-rules subdir-objects tar-pax no-define]) |
| 127 | |
| 128 | # |
| 129 | # Silent build rules requires at least automake-1.11. Employ |
| 130 | # techniques for not breaking earlier versions of automake. |
| 131 | # |
| 132 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 133 | AM_SILENT_RULES([yes]) |
| 134 | |
| 135 | # |
Zang MingJie | e9196fd | 2020-06-20 00:37:35 +0800 | [diff] [blame] | 136 | # Disable maintainer mode to enable the package to automatically rebuild |
| 137 | # configure, Makefile.in, etc. when the files on which they depend change (for |
| 138 | # example, configure.ac, Makefile.am, etc). |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 139 | # |
Zang MingJie | e9196fd | 2020-06-20 00:37:35 +0800 | [diff] [blame] | 140 | # For those that do not desire this behavior, run configure with |
| 141 | # `--enable-maintainer-mode` and run the top-level `bootstrap` script manually. |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 142 | # |
Zang MingJie | e9196fd | 2020-06-20 00:37:35 +0800 | [diff] [blame] | 143 | AM_MAINTAINER_MODE([disable]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 144 | |
| 145 | # |
| 146 | # Check for the target style |
| 147 | # |
| 148 | CHIP_TARGET_STYLE= |
| 149 | CHIP_TARGET_STYLE_UNIX=0 |
| 150 | CHIP_TARGET_STYLE_EMBEDDED=0 |
| 151 | |
| 152 | AC_MSG_CHECKING([for target style]) |
| 153 | |
| 154 | # The user may have attempted to explicitly specify the target |
| 155 | # style. Sanity check it or default to 'auto'. |
| 156 | |
| 157 | AC_ARG_WITH(target-style, |
| 158 | [AS_HELP_STRING([--with-target-style=TARGET], |
| 159 | [Specify the target style from one of: auto, embedded or unix @<:@default=auto@:>@.])], |
| 160 | [ |
| 161 | case "${with_target_style}" in |
| 162 | |
| 163 | auto|embedded|unix) |
| 164 | ;; |
| 165 | |
| 166 | *) |
| 167 | AC_MSG_ERROR([Invalid value ${with_target_style} for --with-target-style]) |
| 168 | ;; |
| 169 | |
| 170 | esac |
| 171 | ], |
| 172 | [with_target_style=auto]) |
| 173 | |
| 174 | # At this point, the target style is one of the allowed |
| 175 | # values. If it's 'auto' we autodetect it. |
| 176 | |
| 177 | if test "${with_target_style}" = "auto"; then |
| 178 | case ${target_os} in |
| 179 | |
| 180 | *cygwin*|*darwin*|*linux*|*freebsd*|*netbsd*|*openbsd*) |
| 181 | with_target_style=unix |
| 182 | ;; |
| 183 | |
| 184 | *freertos*) |
| 185 | with_target_style=embedded |
| 186 | ;; |
| 187 | |
| 188 | *) |
| 189 | AC_MSG_RESULT([unknown]) |
| 190 | AC_MSG_ERROR([Unsupported target OS ${target_os}]) |
| 191 | ;; |
| 192 | |
| 193 | esac |
| 194 | fi |
| 195 | |
| 196 | CHIP_TARGET_STYLE=${with_target_style} |
| 197 | |
| 198 | case ${with_target_style} in |
| 199 | |
| 200 | embedded) |
| 201 | CHIP_TARGET_STYLE_EMBEDDED=1 |
| 202 | ;; |
| 203 | |
| 204 | unix) |
| 205 | CHIP_TARGET_STYLE_UNIX=1 |
| 206 | ;; |
| 207 | |
| 208 | esac |
| 209 | |
| 210 | AC_MSG_RESULT(${CHIP_TARGET_STYLE}) |
| 211 | |
| 212 | AC_SUBST(CHIP_TARGET_STYLE) |
| 213 | AC_DEFINE_UNQUOTED([CHIP_TARGET_STYLE],[${CHIP_TARGET_STYLE}],[CHIP target style]) |
| 214 | |
| 215 | AC_SUBST(CHIP_TARGET_STYLE_EMBEDDED) |
| 216 | AM_CONDITIONAL([CHIP_TARGET_STYLE_EMBEDDED], [test "${CHIP_TARGET_STYLE}" = "embedded"]) |
| 217 | AC_DEFINE_UNQUOTED([CHIP_TARGET_STYLE_EMBEDDED],[${CHIP_TARGET_STYLE_EMBEDDED}],[Define to 1 if you want to use CHIP with an embedded (i.e. non-Unix-based) system]) |
| 218 | |
| 219 | AC_SUBST(CHIP_TARGET_STYLE_UNIX) |
| 220 | AM_CONDITIONAL([CHIP_TARGET_STYLE_UNIX], [test "${CHIP_TARGET_STYLE}" = "unix"]) |
| 221 | AC_DEFINE_UNQUOTED([CHIP_TARGET_STYLE_UNIX],[${CHIP_TARGET_STYLE_UNIX}],[Define to 1 if you want to use CHIP with a Unix-based system]) |
| 222 | |
| 223 | # |
| 224 | # Checks for build host programs |
| 225 | # |
| 226 | |
| 227 | # If we are cross-compiling and we are on an embedded target that |
| 228 | # doesn't support independent, standalone executables, then all |
| 229 | # compiler tests that attempt to create an executable will fail. In |
| 230 | # such circumstances, set AC_NO_EXECUTABLES (see http://sourceware.org/ |
| 231 | # ml/newlib/2006/msg00353.html). |
| 232 | |
| 233 | AC_MSG_CHECKING([whether to disable executable checking]) |
| 234 | if test "$cross_compiling" = yes -a "${CHIP_TARGET_STYLE}" = "embedded"; then |
| 235 | # AC_NO_EXECUTABLES |
| 236 | AC_MSG_RESULT([yes]) |
| 237 | else |
| 238 | AC_MSG_RESULT([no]) |
| 239 | fi |
| 240 | |
| 241 | # Passing -Werror to GCC-based or -compatible compilers breaks some |
| 242 | # autoconf tests (see |
| 243 | # http://lists.gnu.org/archive/html/autoconf-patches/2008-09/msg00014.html). |
| 244 | # |
| 245 | # If -Werror has been passed transform it into -Wno-error. We'll |
| 246 | # transform it back later with NL_RESTORE_WERROR. |
| 247 | |
| 248 | NL_SAVE_WERROR |
| 249 | |
| 250 | # Check for compilers. |
| 251 | # |
| 252 | # These should be checked BEFORE we check for and, implicitly, |
| 253 | # initialize libtool such that libtool knows what languages it has to |
| 254 | # work with. |
| 255 | |
| 256 | AC_PROG_CPP |
| 257 | AC_PROG_CPP_WERROR |
| 258 | |
| 259 | AC_PROG_CC |
| 260 | AC_PROG_CC_C_O |
| 261 | |
| 262 | AC_PROG_CXXCPP |
| 263 | |
| 264 | AC_PROG_CXX |
| 265 | AC_PROG_CXX_C_O |
| 266 | |
| 267 | AC_PROG_OBJC |
| 268 | AC_PROG_OBJCXX |
| 269 | |
| 270 | # Check for other compiler toolchain tools. |
| 271 | |
| 272 | AC_CHECK_TOOL(AR, ar) |
| 273 | AC_CHECK_TOOL(RANLIB, ranlib) |
| 274 | AC_CHECK_TOOL(OBJCOPY, objcopy) |
| 275 | AC_CHECK_TOOL(STRIP, strip) |
| 276 | |
| 277 | # Check for other host tools. |
| 278 | |
| 279 | AC_PROG_INSTALL |
| 280 | AC_PROG_LN_S |
| 281 | |
| 282 | AC_PATH_PROG(CLANG_FORMAT, clang-format) |
| 283 | AC_PATH_PROG(CMP, cmp) |
| 284 | AC_PATH_PROG(PERL, perl) |
| 285 | AC_PATH_PROG(VALGRIND, valgrind) |
| 286 | |
| 287 | # |
| 288 | # Python |
| 289 | # |
| 290 | # At minimum, a Python interpreter is absolutely required to |
| 291 | # auto-generate a number of header files (e.g., ASN1OID.h). |
| 292 | # Additionally, Python support is used for one binding of the |
| 293 | # Device Manager as well as to run and orchestrate several |
| 294 | # unit and functional tests. |
| 295 | # |
| 296 | |
| 297 | # In a normal "build-and-install on 'this' machine" context, |
| 298 | # placing Python packages in the normal pythondir and pyexecdir |
| 299 | # (typically |
| 300 | # lib/pythonPYTHON_VERSION/{dist,site}-packages/PACKAGE) makes |
| 301 | # sense. |
| 302 | # |
| 303 | # However, in our case, we're building and 'installing' for |
| 304 | # standalone distrubution to any number of machines for which we |
| 305 | # don't know the Python version. In those cases, override |
| 306 | # pythondir and pyexec dir. |
| 307 | |
| 308 | case "${prefix}" in |
| 309 | |
| 310 | /opt|/usr|/usr/local|NONE) |
| 311 | ;; |
| 312 | |
| 313 | *) |
| 314 | am_cv_python_pythondir="\${prefix}/lib/python" |
| 315 | am_cv_python_pyexecdir="\${exec_prefix}/lib/python" |
| 316 | ;; |
| 317 | |
| 318 | esac |
| 319 | |
| 320 | # Check for Python |
| 321 | |
| 322 | AM_PATH_PYTHON |
| 323 | |
| 324 | # If a Python interpreter of any color cannot be found, error out. |
| 325 | |
| 326 | if test "${PYTHON}" = ""; then |
| 327 | AC_MSG_ERROR([could not find python: python is required to build this package.]) |
| 328 | fi |
| 329 | |
| 330 | # Check for specific Python packages |
| 331 | |
| 332 | AC_MSG_CHECKING([for Python setuptools package]) |
| 333 | if ${PYTHON} -c 'import setuptools' >/dev/null 2>&1; then |
| 334 | have_python_package_setuptools=yes |
| 335 | else |
| 336 | have_python_package_setuptools=no |
| 337 | fi |
| 338 | AC_MSG_RESULT(${have_python_package_setuptools}) |
| 339 | |
| 340 | AC_MSG_CHECKING([for Python wheel package]) |
| 341 | if ${PYTHON} -c 'import wheel' >/dev/null 2>&1; then |
| 342 | have_python_package_wheel=yes |
| 343 | else |
| 344 | have_python_package_wheel=no |
| 345 | fi |
| 346 | AC_MSG_RESULT(${have_python_package_wheel}) |
| 347 | |
| 348 | |
| 349 | # |
| 350 | # Checks for specific compiler characteristics |
| 351 | # |
| 352 | |
| 353 | # |
| 354 | # Common compiler flags we would like to have. |
| 355 | # |
| 356 | # -Wall -Wshadow -Wframe-larger-than=9472 -Wtype-limits CC, CXX, OBJC, OBJCXX [unix, embedded] |
| 357 | # -fPIC CC, CXX, OBJC, OBJCXX [unix] |
| 358 | # -fno-stack-protector CC, CXX, OBJC, OBJCXX [unix] |
| 359 | # -fno-exceptions CXX, OBJCXX [unix] |
| 360 | # -fobjc-call-cxx-cdtors OBJC, OBJCXX [cocoa] |
| 361 | # -fobjc-arc OBJC, OBJCXX [cocoa] |
| 362 | # |
| 363 | # |
| 364 | |
| 365 | PROSPECTIVE_CFLAGS="-Wall -Wshadow -Wframe-larger-than=9472 -Wtype-limits" |
| 366 | PROSPECTIVE_CXXFLAGS="" |
| 367 | PROSPECTIVE_OBJCFLAGS="-fobjc-call-cxx-cdtors -fobjc-arc" |
| 368 | PROSPECTIVE_OBJCXXFLAGS="" |
| 369 | |
| 370 | # Suppress clang-specific warnings about -Wnonportable-include-path. |
| 371 | # |
| 372 | # -Wnonportable-include-path warns about include paths that can be |
| 373 | # problematic. This creates false positives for CHIP when compiling |
| 374 | # the CHIP Addressing and Routing Module (CHIPARM) in which source |
| 375 | # directories (e.g. src/warm/...) and public include directories |
| 376 | # (e.g. src/include/Warm/...) have identical, and consequently |
| 377 | # ambiguous, naming on case-insensitive file systems. |
| 378 | |
| 379 | case "`basename ${CC}`" in |
| 380 | |
| 381 | *clang) |
| 382 | AX_CHECK_COMPILER_OPTIONS([C], -Wno-nonportable-include-path) |
| 383 | ;; |
| 384 | |
| 385 | esac |
| 386 | |
| 387 | case "`basename ${CXX}`" in |
| 388 | |
| 389 | *clang++) |
| 390 | AX_CHECK_COMPILER_OPTIONS([C++], -Wno-nonportable-include-path) |
| 391 | ;; |
| 392 | |
| 393 | esac |
| 394 | |
| 395 | # For the flags that are desired for the "unix" target style, add |
| 396 | # those to the set to be checked. For the "embedded" target style, the |
| 397 | # CHIP system integrator knows best as to what compiler flags should |
| 398 | # be added and will have passed them in. |
| 399 | |
| 400 | if test "${CHIP_TARGET_STYLE}" = "unix"; then |
| 401 | PROSPECTIVE_CFLAGS="${PROSPECTIVE_CFLAGS} -fPIC -fno-stack-protector" |
| 402 | PROSPECTIVE_CXXFLAGS="${PROSPECTIVE_CXXFLAGS} -fno-exceptions" |
| 403 | fi |
| 404 | |
| 405 | # CHIP intentionally uses derived classes that do not use an explicit |
| 406 | # destructor and a virtual one at that. Consequently, do not emit |
| 407 | # compiler warnings or errors about it when deletion is performed on |
| 408 | # such objects. |
| 409 | |
| 410 | PROSPECTIVE_CXXFLAGS="${PROSPECTIVE_CXXFLAGS} -Wno-delete-non-virtual-dtor" |
| 411 | |
| 412 | # Check whether the C++ compiler supports C++11 with GNU |
| 413 | # extensions. If it is supported, enable it. Otherwise, proceed |
| 414 | # without error or warning. While the CHIP code itself does not rely |
| 415 | # on the GNU extensions, Android build targets crash when the standard |
| 416 | # is set to strict C++11 |
| 417 | |
| 418 | AX_CXX_COMPILE_STDCXX_11(noext, optional) |
| 419 | |
| 420 | AM_CONDITIONAL([HAVE_CXX11], [test "x${HAVE_CXX11}" == "x1"]) |
| 421 | |
| 422 | if test "x${HAVE_CXX11}" == "x1"; then |
| 423 | PROSPECTIVE_CXXFLAGS="${PROSPECTIVE_CXXFLAGS} -std=gnu++11" |
| 424 | fi |
| 425 | |
| 426 | AX_CHECK_COMPILER_OPTIONS([C], ${PROSPECTIVE_CFLAGS}) |
| 427 | AX_CHECK_COMPILER_OPTIONS([C++], ${PROSPECTIVE_CFLAGS} ${PROSPECTIVE_CXXFLAGS}) |
| 428 | |
| 429 | # Check for and initialize libtool |
| 430 | |
| 431 | LT_INIT |
| 432 | |
| 433 | # |
| 434 | # Android support |
| 435 | # |
| 436 | with_android=no |
| 437 | |
| 438 | AC_MSG_CHECKING([for an Android target]) |
| 439 | |
| 440 | case "${target}" in |
| 441 | |
| 442 | *android*) |
| 443 | with_android=yes |
| 444 | ;; |
| 445 | |
| 446 | *) |
| 447 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ |
| 448 | #if !defined(__ANDROID__) || !__ANDROID__ |
| 449 | #error "We are not compiling with Android." |
| 450 | #endif |
| 451 | ]])], |
| 452 | [with_android=yes], |
| 453 | [with_android=no]) |
| 454 | ;; |
| 455 | |
| 456 | esac |
| 457 | |
| 458 | AC_MSG_RESULT(${with_android}) |
| 459 | |
| 460 | AM_CONDITIONAL([CHIP_WITH_ANDROID], [test "${with_android}" = "yes"]) |
| 461 | |
| 462 | AC_SUBST(CROSS_SYSROOT, [$lt_sysroot]) |
| 463 | # |
| 464 | # CHIP package-specific build customization options |
| 465 | # |
| 466 | |
| 467 | # |
| 468 | # Check for logging style |
| 469 | # |
| 470 | |
| 471 | CHIP_LOGGING_STYLE= |
| 472 | CHIP_LOGGING_STYLE_ANDROID=0 |
| 473 | CHIP_LOGGING_STYLE_EXTERNAL=0 |
| 474 | CHIP_LOGGING_STYLE_STDIO=0 |
| 475 | CHIP_LOGGING_STYLE_STDIO_WEAK=0 |
| 476 | |
| 477 | AC_MSG_CHECKING([for logging style]) |
| 478 | |
| 479 | AC_ARG_WITH(logging-style, |
| 480 | [AS_HELP_STRING([--with-logging-style=STYLE], |
| 481 | [Specify the logging style from one of: auto, android, stdio, stdio-weak, or external @<:@default=auto@:>@.])], |
| 482 | [ |
| 483 | case "${with_logging_style}" in |
| 484 | |
| 485 | android|auto|external|stdio|stdio-weak) |
| 486 | ;; |
| 487 | |
| 488 | *) |
| 489 | AC_MSG_ERROR([Invalid value ${with_logging_style} for --with-logging-style]) |
| 490 | ;; |
| 491 | |
| 492 | esac |
| 493 | ], |
| 494 | [with_logging_style=auto]) |
| 495 | |
| 496 | # At this point, the logging style is one of the allowed values. If |
| 497 | # it's 'auto' we autodetect it. Otherwise, sanity check the specified |
| 498 | # value. |
| 499 | |
| 500 | if test "${with_logging_style}" = "auto"; then |
| 501 | |
| 502 | if test "${with_android}" = "yes"; then |
| 503 | with_logging_style=android |
| 504 | |
| 505 | elif test "${with_target_style}" = "unix"; then |
| 506 | with_logging_style=stdio |
| 507 | |
| 508 | else |
| 509 | with_logging_style=external |
| 510 | |
| 511 | fi |
| 512 | |
| 513 | else |
| 514 | if test "${with_android}" != "yes"; then |
| 515 | if test "${with_logging_style}" = "android"; then |
| 516 | AC_MSG_ERROR([Android-style logging may only be specified when building for Android.]) |
| 517 | fi |
| 518 | fi |
| 519 | fi |
| 520 | |
| 521 | CHIP_LOGGING_STYLE=${with_logging_style} |
| 522 | |
| 523 | case ${with_logging_style} in |
| 524 | |
| 525 | android) |
| 526 | CHIP_LOGGING_STYLE_ANDROID=1 |
| 527 | ;; |
| 528 | |
| 529 | external) |
| 530 | CHIP_LOGGING_STYLE_EXTERNAL=1 |
| 531 | ;; |
| 532 | |
| 533 | stdio) |
| 534 | CHIP_LOGGING_STYLE_STDIO=1 |
| 535 | ;; |
| 536 | |
| 537 | stdio-weak) |
| 538 | CHIP_LOGGING_STYLE_STDIO_WEAK=1 |
| 539 | ;; |
| 540 | |
| 541 | esac |
| 542 | |
| 543 | AC_MSG_RESULT(${CHIP_LOGGING_STYLE}) |
| 544 | |
| 545 | AC_SUBST(CHIP_LOGGING_STYLE) |
| 546 | AC_DEFINE_UNQUOTED([CHIP_LOGGING_STYLE],[${CHIP_LOGGING_STYLE}],[CHIP logging style]) |
| 547 | |
| 548 | AC_SUBST(CHIP_LOGGING_STYLE_ANDROID) |
| 549 | AM_CONDITIONAL([CHIP_LOGGING_STYLE_ANDROID], [test "${CHIP_LOGGING_STYLE}" = "android"]) |
| 550 | AC_DEFINE_UNQUOTED([CHIP_LOGGING_STYLE_ANDROID],[${CHIP_LOGGING_STYLE_ANDROID}],[Define to 1 if you want to use CHIP with the Android logging system]) |
| 551 | |
| 552 | AC_SUBST(CHIP_LOGGING_STYLE_EXTERNAL) |
| 553 | AM_CONDITIONAL([CHIP_LOGGING_STYLE_EXTERNAL], [test "${CHIP_LOGGING_STYLE}" = "external"]) |
| 554 | AC_DEFINE_UNQUOTED([CHIP_LOGGING_STYLE_EXTERNAL],[${CHIP_LOGGING_STYLE_EXTERNAL}],[Define to 1 if you want to use CHIP with an external (i.e. platform- and integrator-defined) logging system]) |
| 555 | |
| 556 | AC_SUBST(CHIP_LOGGING_STYLE_STDIO) |
| 557 | AM_CONDITIONAL([CHIP_LOGGING_STYLE_STDIO], [test "${CHIP_LOGGING_STYLE}" = "stdio"]) |
| 558 | AC_DEFINE_UNQUOTED([CHIP_LOGGING_STYLE_STDIO],[${CHIP_LOGGING_STYLE_STDIO}],[Define to 1 if you want to use CHIP with a C Standard I/O Library-based logging system]) |
| 559 | |
| 560 | AC_SUBST(CHIP_LOGGING_STYLE_STDIO_WEAK) |
| 561 | AM_CONDITIONAL([CHIP_LOGGING_STYLE_STDIO_WEAK], [test "${CHIP_LOGGING_STYLE}" = "stdio-weak"]) |
| 562 | AC_DEFINE_UNQUOTED([CHIP_LOGGING_STYLE_STDIO_WEAK],[${CHIP_LOGGING_STYLE_STDIO_WEAK}],[Define to 1 if you want to use CHIP with a C Standard I/O Library-based logging system,but override, at link-time an external (i.e. platform- and integrator-defined) logging system]) |
| 563 | |
| 564 | # |
| 565 | # If C Standard I/O logging is used, prepending timestamps before log |
| 566 | # lines may be enabled to support test automation and other debugging |
| 567 | # activities. |
| 568 | # |
| 569 | |
| 570 | CHIP_LOGGING_STYLE_STDIO_WITH_TIMESTAMPS=0 |
| 571 | |
| 572 | AC_MSG_CHECKING([whether to enable stdio logging timestamps]) |
| 573 | AC_ARG_ENABLE(stdio-logging-timestamps, |
| 574 | [AS_HELP_STRING([--enable-stdio-logging-timestamps],[Enable timestamps in stdio- or stdio-weak- style log output @<:@default=no@:>@.])], |
| 575 | [ |
| 576 | case "${enableval}" in |
| 577 | |
| 578 | no|yes) |
| 579 | if test "${enableval}" = "yes"; then |
| 580 | if test "${CHIP_LOGGING_STYLE}" != "stdio"; then |
| 581 | AC_MSG_ERROR([The CHIP logging style must be 'stdio' to use logging timestamps. Use --with-logging-style=stdio Use --with-logging-style=stdio-weak to enable this logging style.]) |
| 582 | else |
| 583 | CHIP_LOGGING_STYLE_STDIO_WITH_TIMESTAMPS=1 |
| 584 | fi |
| 585 | fi |
| 586 | |
| 587 | enable_stdio_logging_timestamps=${enableval} |
| 588 | ;; |
| 589 | |
| 590 | *) |
| 591 | AC_MSG_ERROR([Invalid value ${enableval} for --enable-stdio-logging-timestamps]) |
| 592 | ;; |
| 593 | |
| 594 | esac |
| 595 | ], |
| 596 | [enable_stdio_logging_timestamps=no]) |
| 597 | AC_MSG_RESULT(${enable_stdio_logging_timestamps}) |
| 598 | |
| 599 | AC_DEFINE_UNQUOTED([CHIP_LOGGING_STYLE_STDIO_WITH_TIMESTAMPS],[${CHIP_LOGGING_STYLE_STDIO_WITH_TIMESTAMPS}],[Define to 1 if you want to use CHIP with a C Standard I/O Library-based logging system with timestamped log entries]) |
| 600 | |
| 601 | # |
| 602 | # Cocoa support |
| 603 | # |
| 604 | AC_MSG_CHECKING([whether to build Cocoa support]) |
| 605 | AC_ARG_ENABLE(cocoa, |
| 606 | [AS_HELP_STRING([--enable-cocoa],[Enable Cocoa support, required for the iOS device manager @<:@default=no@:>@.])], |
| 607 | [ |
| 608 | case "${enableval}" in |
| 609 | |
| 610 | no|yes) |
| 611 | enable_cocoa=${enableval} |
| 612 | ;; |
| 613 | |
| 614 | *) |
| 615 | AC_MSG_ERROR([Invalid value ${enableval} for --enable-cocoa]) |
| 616 | ;; |
| 617 | |
| 618 | esac |
| 619 | ], |
| 620 | [enable_cocoa=no]) |
| 621 | AC_MSG_RESULT(${enable_cocoa}) |
| 622 | |
| 623 | AM_CONDITIONAL([CHIP_WITH_COCOA], [test "${enable_cocoa}" = "yes"]) |
| 624 | |
| 625 | if test "${enable_cocoa}" = "yes" ; then |
| 626 | |
| 627 | # Check if the Objective C and Objective C++ compilers support |
| 628 | # some overall options we want for those sources. |
| 629 | |
| 630 | AX_CHECK_COMPILER_OPTIONS([Objective C], ${PROSPECTIVE_CFLAGS} ${PROSPECTIVE_OBJCFLAGS}) |
| 631 | AX_CHECK_COMPILER_OPTIONS([Objective C++], ${PROSPECTIVE_CFLAGS} ${PROSPECTIVE_CXXFLAGS} ${PROSPECTIVE_OBJCFLAGS} ${PROSPECTIVE_OBJCXXFLAGS}) |
| 632 | |
| 633 | AC_LANG_PUSH([Objective C++]) |
| 634 | |
| 635 | # Check for required Cocoa headers. |
| 636 | |
| 637 | AC_CHECK_HEADERS([Foundation/Foundation.h], |
| 638 | [], |
| 639 | [ |
| 640 | AC_MSG_ERROR(The Cocoa header "$ac_header" is required but cannot be found.) |
| 641 | ]) |
| 642 | |
| 643 | AC_LANG_POP([Objective C++]) |
| 644 | fi |
| 645 | |
| 646 | # |
| 647 | # Java support |
| 648 | # |
| 649 | |
| 650 | # Influential external variables for Java support |
| 651 | |
| 652 | AC_ARG_VAR(JAVA_HOME, [Java SDK root directory]) |
| 653 | AC_ARG_VAR(JNI_CPPFLAGS, [Java Native Interface (JNI) C preprocessor flags]) |
| 654 | AC_ARG_VAR(JAVAC, [Java class compiler command]) |
| 655 | AC_ARG_VAR(JAR, [Java archiver command]) |
| 656 | |
| 657 | AC_MSG_CHECKING([whether to build Java support]) |
| 658 | AC_ARG_ENABLE(java, |
| 659 | [AS_HELP_STRING([--disable-java],[Disable Java support, otherwise required for the Android device manager and CHIP service support @<:@default=auto@:>@.])], |
| 660 | [ |
| 661 | case "${enableval}" in |
| 662 | |
| 663 | auto|no|yes) |
| 664 | enable_java=${enableval} |
| 665 | ;; |
| 666 | |
| 667 | *) |
| 668 | AC_MSG_ERROR([Invalid value ${enableval} for --enable-java]) |
| 669 | ;; |
| 670 | |
| 671 | esac |
| 672 | ], |
| 673 | [enable_java=auto]) |
| 674 | |
| 675 | if test "${enable_java}" = "auto"; then |
| 676 | if test "x${JAVA_HOME}" != "x"; then |
| 677 | enable_java=yes |
| 678 | else |
| 679 | enable_java=no |
| 680 | fi |
| 681 | fi |
| 682 | |
| 683 | AC_MSG_RESULT(${enable_java}) |
| 684 | |
| 685 | # If Java support has been requested, then check for the relevant Java |
| 686 | # headers and tools. |
| 687 | |
| 688 | if test "${enable_java}" = "yes" ; then |
| 689 | # Check for Java |
| 690 | |
| 691 | # If a specific set of JNI_INCLUDE_DIRS has *not* been given, attempt |
| 692 | # to locate the JNI include dirs from JAVA_HOME or the location of |
| 693 | # javac. |
| 694 | if test "x${JNI_INCLUDE_DIRS}" = "x" ; then |
| 695 | AC_JNI_INCLUDE_DIR |
| 696 | fi |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 697 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 698 | if test "x${JNI_INCLUDE_DIRS}" != "x" ; then |
| 699 | for dir in ${JNI_INCLUDE_DIRS} ; do |
| 700 | JNI_CPPFLAGS="${JNI_CPPFLAGS} -I${dir}" |
| 701 | done |
| 702 | |
| 703 | AC_SUBST(JNI_CPPFLAGS) |
| 704 | fi |
| 705 | |
| 706 | AC_PATH_PROG([JAVAC], [javac], [], [${JAVA_HOME:+${JAVA_HOME}/bin}${PATH_SEPARATOR}${PATH}]) |
| 707 | AC_PATH_PROG([JAR], [jar], [], [${JAVA_HOME:+${JAVA_HOME}/bin}${PATH_SEPARATOR}${PATH}]) |
| 708 | fi |
| 709 | |
| 710 | AM_CONDITIONAL([CHIP_WITH_JAVA], [test "${enable_java}" = "yes"]) |
| 711 | |
| 712 | # |
| 713 | # Debug and profile instances |
| 714 | # |
| 715 | AC_MSG_NOTICE([checking whether to build debug and profile instances]) |
| 716 | |
| 717 | # Debug |
| 718 | |
| 719 | NL_ENABLE_DEBUG([no]) |
| 720 | |
| 721 | AM_CONDITIONAL([CHIP_BUILD_DEBUG], [test "${nl_cv_build_debug}" = "yes"]) |
| 722 | |
| 723 | # Profile |
| 724 | |
| 725 | AC_MSG_CHECKING([whether to build profile instances of programs and libraries]) |
| 726 | AC_ARG_ENABLE(profile, |
| 727 | [AS_HELP_STRING([--disable-profile],[Disable the generation of profile instances @<:@default=yes@:>@.])], |
| 728 | [ |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 729 | case "${enableval}" in |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 730 | |
| 731 | no|yes) |
| 732 | build_profile=${enableval} |
| 733 | ;; |
| 734 | |
| 735 | *) |
| 736 | AC_MSG_ERROR([Invalid value ${enableval} for --enable-profile]) |
| 737 | ;; |
| 738 | |
| 739 | esac |
| 740 | ], |
| 741 | [build_profile=no]) |
| 742 | AC_MSG_RESULT(${build_profile}) |
| 743 | AM_CONDITIONAL([CHIP_BUILD_PROFILE], [test "${build_profile}" = "yes"]) |
| 744 | |
| 745 | # |
| 746 | # Code coverage and compiler optimization |
| 747 | # |
| 748 | |
| 749 | # Coverage |
| 750 | |
| 751 | NL_ENABLE_COVERAGE([no]) |
| 752 | |
| 753 | AM_CONDITIONAL([CHIP_BUILD_COVERAGE], [test "${nl_cv_build_coverage}" = "yes"]) |
| 754 | |
| 755 | NL_ENABLE_COVERAGE_REPORTS([auto]) |
| 756 | |
| 757 | AM_CONDITIONAL([CHIP_BUILD_COVERAGE_REPORTS], [test "${nl_cv_build_coverage_reports}" = "yes"]) |
| 758 | |
| 759 | # Optimization |
| 760 | |
| 761 | NL_ENABLE_OPTIMIZATION([yes]) |
| 762 | |
| 763 | AM_CONDITIONAL([CHIP_BUILD_OPTIMIZED], [test "${nl_cv_build_optimized}" = "yes"]) |
| 764 | |
| 765 | # |
| 766 | # Treat Compiler Warnings as Errors |
| 767 | # |
| 768 | NL_ENABLE_WERROR([no]) |
| 769 | |
| 770 | # |
| 771 | # Tests and tools |
| 772 | # |
| 773 | AC_MSG_NOTICE([checking whether to build tools and tests]) |
| 774 | |
| 775 | # Tests |
| 776 | |
| 777 | NL_ENABLE_TESTS([yes]) |
| 778 | |
| 779 | AM_CONDITIONAL([CHIP_BUILD_TESTS], [test "${nl_cv_build_tests}" = "yes"]) |
| 780 | |
| 781 | # Tools |
| 782 | |
| 783 | AC_MSG_CHECKING([whether to build tools]) |
| 784 | AC_ARG_ENABLE(tools, |
| 785 | [AS_HELP_STRING([--disable-tools],[Disable building of tools @<:@default=no@:>@.])], |
| 786 | [ |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 787 | case "${enableval}" in |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 788 | |
| 789 | no|yes) |
| 790 | build_tools=${enableval} |
| 791 | ;; |
| 792 | |
| 793 | *) |
| 794 | AC_MSG_ERROR([Invalid value ${enableval} for --enable-tools]) |
| 795 | ;; |
| 796 | |
| 797 | esac |
| 798 | ], |
| 799 | [build_tools=yes]) |
| 800 | AC_MSG_RESULT(${build_tools}) |
| 801 | AM_CONDITIONAL([CHIP_BUILD_TOOLS], [test "${build_tools}" = "yes"]) |
| 802 | |
Grant Erickson | 6d7428b | 2020-05-11 16:31:38 -0700 | [diff] [blame] | 803 | # Happy |
| 804 | |
| 805 | AC_MSG_CHECKING([checking whether to run functional tests with Happy]) |
| 806 | AC_ARG_WITH(happy, |
| 807 | [AS_HELP_STRING([--with-happy=HAPPY], |
| 808 | [Run CHIP functional tests using the Happy network functional test framework: yes, no, auto, or a path to the Happy network functional test framework [default=auto].])], |
| 809 | [ |
| 810 | case "${with_happy}" in |
| 811 | |
| 812 | no|yes) |
| 813 | ;; |
| 814 | |
| 815 | *) |
| 816 | configure_happy_path=${with_happy} |
| 817 | happy_path="${with_happy}/lib/python${am_cv_python_version}/site-packages/" |
| 818 | with_happy=yes |
| 819 | ;; |
| 820 | esac |
| 821 | ], |
| 822 | [with_happy=auto]) |
| 823 | |
| 824 | if test "${nl_cv_build_tests}" != "yes"; then |
| 825 | with_happy=no |
| 826 | happy_path="-" |
| 827 | else |
| 828 | if test -n ${happy_path}; then |
| 829 | grep "Nest Labs" ${configure_happy_path}/setup.py &> /dev/null |
| 830 | if test $? = 0; then |
| 831 | AC_MSG_ERROR(["You have specified a valid path, ${configure_happy_path} to a Nest Labs network functional test framework (Happy) source directory; however, it does not appear to be built and installed. Please build and install Happy from the specified path, ${configure_happy_path}, and then try again."]) |
| 832 | fi |
| 833 | if ! test -d ${happy_path}; then |
| 834 | AC_MSG_ERROR(["No Nest Labs network functional test framework (Happy) installation could be found at ${configure_happy_path}. Please provide a path to a valid Happy installation."]) |
| 835 | fi |
| 836 | fi |
| 837 | fi |
| 838 | |
| 839 | if test "${with_happy}" != "no"; then |
| 840 | PYTHONPATH=${happy_path}:${PYTHONPATH} python -c 'import happy' 2> /dev/null |
| 841 | if test $? != 0; then |
| 842 | if test "${with_happy}" = "yes"; then |
| 843 | if test -z ${happy_path}; then |
| 844 | AC_MSG_ERROR(["The Happy network functional test framework was configured with the defaults; however, Happy could not be found in the Python default package locations. Please either install Happy in a default location or invoke 'configure' with an explicit path using '--with-happy=<path to happy>'."]) |
| 845 | else |
| 846 | AC_MSG_ERROR(["The Happy network functional test framework was configured with the path ${happy_path}; however, Happy could neither be found in the Python default package locations and nor at ${happy_path}."]) |
| 847 | fi |
| 848 | else |
| 849 | with_happy=no |
| 850 | happy_path="-" |
| 851 | fi |
| 852 | else |
| 853 | with_happy=yes |
| 854 | fi |
| 855 | fi |
| 856 | |
| 857 | if test "${with_happy}" = "yes"; then |
| 858 | HAPPY_MINIMUM_VERSION="1.1.36" |
| 859 | happy_version=`PYTHONPATH=${happy_path}:${PYTHONPATH} ${PYTHON} -c 'import happy; print happy.__version__ if "__version__" in dir(happy) else "0.0.0"'` |
| 860 | AX_COMPARE_VERSION([${HAPPY_MINIMUM_VERSION}],[gt],[${happy_version}],[AC_MSG_ERROR(["The Happy network functional test framework is installed with version ${happy_version}; however, Weave test apps require at least version ${HAPPY_MINIMUM_VERSION}."])],[]) |
| 861 | fi |
| 862 | |
| 863 | AC_MSG_RESULT(${with_happy}) |
| 864 | AM_CONDITIONAL([WEAVE_RUN_HAPPY], [test "${with_happy}" = "yes"]) |
| 865 | AC_SUBST(HAPPY_PATH,[${happy_path}]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 866 | # |
| 867 | # CHIPoBLE Control Path and Throughput Test (CHIPoBLE Test) |
| 868 | # |
| 869 | |
| 870 | AC_MSG_CHECKING([whether to build CHIPoBLE Test]) |
| 871 | AC_ARG_ENABLE(chipoble-test, |
| 872 | [AS_HELP_STRING([--enable-chipoble-test],[Enable CHIPoBLE Test @<:@default=no@:>@.])], |
| 873 | [ |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 874 | case "${enableval}" in |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 875 | |
| 876 | no|yes) |
| 877 | enable_chipoble_test=${enableval} |
| 878 | ;; |
| 879 | |
| 880 | *) |
| 881 | AC_MSG_ERROR([Invalid value ${enableval} for --enable-chipoble-test]) |
| 882 | ;; |
| 883 | |
| 884 | esac |
| 885 | ], |
| 886 | [enable_chipoble_test=no]) |
| 887 | AC_MSG_RESULT(${enable_chipoble_test}) |
Martin Turon | 7a8a93f | 2020-04-15 17:38:24 -0700 | [diff] [blame] | 888 | AM_CONDITIONAL([CHIP_ENABLE_CHIPOBLE_TEST], [test "${enable_chipoble_test}" = "yes"]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 889 | if test "${enable_chipoble_test}" = "yes"; then |
Martin Turon | 7a8a93f | 2020-04-15 17:38:24 -0700 | [diff] [blame] | 890 | CHIP_ENABLE_CHIPOBLE_TEST=1 |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 891 | else |
Martin Turon | 7a8a93f | 2020-04-15 17:38:24 -0700 | [diff] [blame] | 892 | CHIP_ENABLE_CHIPOBLE_TEST=0 |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 893 | fi |
Martin Turon | 7a8a93f | 2020-04-15 17:38:24 -0700 | [diff] [blame] | 894 | AC_DEFINE_UNQUOTED([CHIP_ENABLE_CHIPOBLE_TEST],[${CHIP_ENABLE_CHIPOBLE_TEST}],[Define to 1 if you want to enable CHIPoBle Control Path and Throughput Test.]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 895 | # |
| 896 | # Documentation |
| 897 | # |
| 898 | |
| 899 | # Determine whether or not documentation (via Doxygen) should be built |
| 900 | # or not, with 'auto' as the default and establish a default support |
| 901 | # value for GraphViz 'dot' support. |
| 902 | |
| 903 | NL_ENABLE_DOCS([auto],[NO]) |
| 904 | |
| 905 | AM_CONDITIONAL(CHIP_BUILD_DOCS, [test "${nl_cv_build_docs}" = "yes"]) |
| 906 | |
| 907 | # |
| 908 | # Network Technology Layer |
| 909 | # |
| 910 | AC_MSG_CHECKING([network layer]) |
| 911 | AC_ARG_WITH(network-layer, |
| 912 | [AS_HELP_STRING([--with-network-layer=LAYER], |
| 913 | [Specify the target network layers from one of: ble, inet, or all @<:@default=all@:>@.])], |
| 914 | [ |
| 915 | case "${with_network_layer}" in |
| 916 | |
| 917 | ble|inet|all) |
| 918 | ;; |
| 919 | |
| 920 | *) |
| 921 | AC_MSG_ERROR([Invalid value ${with_network_layer} for --with-network-layer]) |
| 922 | ;; |
| 923 | |
| 924 | esac |
| 925 | ], |
| 926 | [with_network_layer=all]) |
| 927 | AC_MSG_RESULT(${with_network_layer}) |
| 928 | |
| 929 | case "${with_network_layer}" in |
| 930 | |
| 931 | ble) |
| 932 | CONFIG_NETWORK_LAYER_BLE=1 |
| 933 | CONFIG_NETWORK_LAYER_INET=0 |
| 934 | ;; |
| 935 | |
| 936 | inet) |
| 937 | CONFIG_NETWORK_LAYER_BLE=0 |
| 938 | CONFIG_NETWORK_LAYER_INET=1 |
| 939 | ;; |
| 940 | |
| 941 | all) |
| 942 | CONFIG_NETWORK_LAYER_BLE=1 |
| 943 | CONFIG_NETWORK_LAYER_INET=1 |
| 944 | ;; |
| 945 | |
| 946 | esac |
| 947 | |
| 948 | # NOTE WELL: The following logic is a transitional patch (BLE layer is currently dependent on INET layer) |
| 949 | if test ${CONFIG_NETWORK_LAYER_INET} = 0 && test ${CONFIG_NETWORK_LAYER_BLE} = 1; then |
| 950 | with_network_layer=all |
| 951 | CONFIG_NETWORK_LAYER_INET=1 |
| 952 | AC_MSG_NOTICE([NOTE WELL: the BLE layer currently requires the INET layer.]) |
| 953 | fi |
| 954 | |
| 955 | AC_SUBST(CONFIG_NETWORK_LAYER_BLE) |
| 956 | AM_CONDITIONAL([CONFIG_NETWORK_LAYER_BLE], [test "${CONFIG_NETWORK_LAYER_BLE}" = 1]) |
| 957 | AC_DEFINE_UNQUOTED([CONFIG_NETWORK_LAYER_BLE],[${CONFIG_NETWORK_LAYER_BLE}],[Define to 1 if you want to use CHIP with the Bluetooth Low Energy network stack.]) |
| 958 | |
| 959 | AC_SUBST(CONFIG_NETWORK_LAYER_INET) |
| 960 | AM_CONDITIONAL([CONFIG_NETWORK_LAYER_INET], [test "${CONFIG_NETWORK_LAYER_INET}" = 1]) |
| 961 | AC_DEFINE_UNQUOTED([CONFIG_NETWORK_LAYER_INET],[${CONFIG_NETWORK_LAYER_INET}],[Define to 1 if you want to use CHIP with the Internet Protocol network stack.]) |
| 962 | |
| 963 | # |
| 964 | # CHIP Device Layer |
| 965 | # |
| 966 | AC_MSG_CHECKING([device layer]) |
| 967 | AC_ARG_WITH(device-layer, |
| 968 | [AS_HELP_STRING([--with-device-layer=LAYER], |
doru91 | edac1aa | 2020-08-20 04:28:05 +0300 | [diff] [blame] | 969 | [Specify the target environment for the CHIP Device Layer. Choose one of: auto, darwin, efr32, esp32, nrf5, k32w, nrfconnect, linux, or none @<:@default=auto@:>@.])], |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 970 | [ |
| 971 | case "${with_device_layer}" in |
| 972 | |
doru91 | edac1aa | 2020-08-20 04:28:05 +0300 | [diff] [blame] | 973 | auto|darwin|efr32|esp32|nrf5|k32w|nrfconnect|linux|none) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 974 | ;; |
| 975 | |
| 976 | *) |
| 977 | AC_MSG_ERROR([Invalid value ${with_device_layer} for --with-device-layer]) |
| 978 | ;; |
| 979 | |
| 980 | esac |
| 981 | ], |
Vivien Nicolas | 694f20d | 2020-07-16 22:48:40 +0200 | [diff] [blame] | 982 | [with_device_layer=auto]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 983 | AC_MSG_RESULT(${with_device_layer}) |
| 984 | |
Martin Turon | 0c03fa8 | 2020-05-26 15:43:11 -0700 | [diff] [blame] | 985 | # Disable all device layer targets by default |
Vivien Nicolas | 6f8e28b | 2020-07-08 16:46:36 +0200 | [diff] [blame] | 986 | CHIP_DEVICE_LAYER_TARGET_DARWIN=0 |
| 987 | CHIP_DEVICE_LAYER_TARGET_EFR32=0 |
Martin Turon | 0c03fa8 | 2020-05-26 15:43:11 -0700 | [diff] [blame] | 988 | CHIP_DEVICE_LAYER_TARGET_ESP32=0 |
| 989 | CHIP_DEVICE_LAYER_TARGET_NRF5=0 |
doru91 | edac1aa | 2020-08-20 04:28:05 +0300 | [diff] [blame] | 990 | CHIP_DEVICE_LAYER_TARGET_K32W=0 |
Vivien Nicolas | 6f8e28b | 2020-07-08 16:46:36 +0200 | [diff] [blame] | 991 | CHIP_DEVICE_LAYER_TARGET_LINUX=0 |
Damian Królik | 34a4a93 | 2020-07-20 20:07:50 +0200 | [diff] [blame] | 992 | CHIP_DEVICE_LAYER_TARGET_NRFCONNECT=0 |
Martin Turon | 0c03fa8 | 2020-05-26 15:43:11 -0700 | [diff] [blame] | 993 | |
Vivien Nicolas | 694f20d | 2020-07-16 22:48:40 +0200 | [diff] [blame] | 994 | if test "${with_device_layer}" = "auto"; then |
| 995 | case ${target_os} in |
| 996 | |
| 997 | *darwin*) |
| 998 | with_device_layer=darwin |
| 999 | ;; |
| 1000 | |
| 1001 | *linux*) |
| 1002 | with_device_layer=linux |
| 1003 | ;; |
| 1004 | |
| 1005 | *) |
| 1006 | with_device_layer=none |
| 1007 | ;; |
| 1008 | |
| 1009 | esac |
| 1010 | fi |
| 1011 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1012 | case "${with_device_layer}" in |
Vivien Nicolas | 6f8e28b | 2020-07-08 16:46:36 +0200 | [diff] [blame] | 1013 | |
| 1014 | darwin) |
Martin Turon | 0c03fa8 | 2020-05-26 15:43:11 -0700 | [diff] [blame] | 1015 | CONFIG_DEVICE_LAYER=1 |
Vivien Nicolas | 6f8e28b | 2020-07-08 16:46:36 +0200 | [diff] [blame] | 1016 | CHIP_DEVICE_LAYER_TARGET=Darwin |
| 1017 | CHIP_DEVICE_LAYER_TARGET_DARWIN=1 |
| 1018 | ;; |
| 1019 | |
| 1020 | efr32) |
| 1021 | CONFIG_DEVICE_LAYER=1 |
| 1022 | CHIP_DEVICE_LAYER_TARGET=EFR32 |
| 1023 | CHIP_DEVICE_LAYER_TARGET_EFR32=1 |
Martin Turon | 0c03fa8 | 2020-05-26 15:43:11 -0700 | [diff] [blame] | 1024 | ;; |
| 1025 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1026 | esp32) |
| 1027 | CONFIG_DEVICE_LAYER=1 |
| 1028 | CHIP_DEVICE_LAYER_TARGET=ESP32 |
| 1029 | CHIP_DEVICE_LAYER_TARGET_ESP32=1 |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1030 | ;; |
| 1031 | |
| 1032 | nrf5) |
| 1033 | CONFIG_DEVICE_LAYER=1 |
| 1034 | CHIP_DEVICE_LAYER_TARGET=nRF5 |
| 1035 | CHIP_DEVICE_LAYER_TARGET_NRF5=1 |
Yakun Xu | 47f325f | 2020-07-15 00:10:33 +0800 | [diff] [blame] | 1036 | CFLAGS="${CFLAGS} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs" |
| 1037 | CXXFLAGS="${CXXFLAGS} -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs" |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1038 | ;; |
doru91 | edac1aa | 2020-08-20 04:28:05 +0300 | [diff] [blame] | 1039 | |
| 1040 | |
| 1041 | k32w) |
| 1042 | CONFIG_DEVICE_LAYER=1 |
| 1043 | CHIP_DEVICE_LAYER_TARGET=K32W |
| 1044 | CHIP_DEVICE_LAYER_TARGET_K32W=1 |
| 1045 | ;; |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1046 | |
Damian Królik | 34a4a93 | 2020-07-20 20:07:50 +0200 | [diff] [blame] | 1047 | nrfconnect) |
| 1048 | CONFIG_DEVICE_LAYER=1 |
| 1049 | CHIP_DEVICE_LAYER_TARGET=nrfconnect |
| 1050 | CHIP_DEVICE_LAYER_TARGET_NRFCONNECT=1 |
| 1051 | ;; |
| 1052 | |
Vivien Nicolas | 6f8e28b | 2020-07-08 16:46:36 +0200 | [diff] [blame] | 1053 | linux) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1054 | CONFIG_DEVICE_LAYER=1 |
Vivien Nicolas | 6f8e28b | 2020-07-08 16:46:36 +0200 | [diff] [blame] | 1055 | CHIP_DEVICE_LAYER_TARGET=Linux |
| 1056 | CHIP_DEVICE_LAYER_TARGET_LINUX=1 |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1057 | ;; |
| 1058 | |
| 1059 | none) |
| 1060 | CONFIG_DEVICE_LAYER=0 |
| 1061 | CHIP_DEVICE_LAYER_TARGET=NONE |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1062 | ;; |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1063 | esac |
| 1064 | |
| 1065 | AC_SUBST(CONFIG_DEVICE_LAYER) |
| 1066 | AM_CONDITIONAL([CONFIG_DEVICE_LAYER], [test "${CONFIG_DEVICE_LAYER}" = 1]) |
| 1067 | AC_DEFINE_UNQUOTED([CONFIG_DEVICE_LAYER],[${CONFIG_DEVICE_LAYER}],[Define to 1 if you want to use the CHIP Device Layer.]) |
| 1068 | |
| 1069 | AC_SUBST(CHIP_DEVICE_LAYER_TARGET) |
| 1070 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_LAYER_TARGET],[${CHIP_DEVICE_LAYER_TARGET}],[Target platform name for CHIP Device Layer.]) |
| 1071 | |
Vivien Nicolas | 6f8e28b | 2020-07-08 16:46:36 +0200 | [diff] [blame] | 1072 | AC_SUBST(CHIP_DEVICE_LAYER_TARGET_DARWIN) |
| 1073 | AM_CONDITIONAL([CHIP_DEVICE_LAYER_TARGET_DARWIN], [test "${CHIP_DEVICE_LAYER_TARGET_DARWIN}" = 1]) |
| 1074 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_LAYER_TARGET_DARWIN],[${CHIP_DEVICE_LAYER_TARGET_DARWIN}],[Define to 1 if you want to build the CHIP Device Layer for Darwin platforms.]) |
| 1075 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1076 | AC_SUBST(CHIP_DEVICE_LAYER_TARGET_EFR32) |
| 1077 | AM_CONDITIONAL([CHIP_DEVICE_LAYER_TARGET_EFR32], [test "${CHIP_DEVICE_LAYER_TARGET_EFR32}" = 1]) |
| 1078 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_LAYER_TARGET_EFR32],[${CHIP_DEVICE_LAYER_TARGET_EFR32}],[Define to 1 if you want to build the CHIP Device Layer for Silicon Labs EFR32 platforms.]) |
| 1079 | |
| 1080 | AC_SUBST(CHIP_DEVICE_LAYER_TARGET_ESP32) |
| 1081 | AM_CONDITIONAL([CHIP_DEVICE_LAYER_TARGET_ESP32], [test "${CHIP_DEVICE_LAYER_TARGET_ESP32}" = 1]) |
| 1082 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_LAYER_TARGET_ESP32],[${CHIP_DEVICE_LAYER_TARGET_ESP32}],[Define to 1 if you want to build the CHIP Device Layer for the Espressif ESP32.]) |
| 1083 | |
| 1084 | AC_SUBST(CHIP_DEVICE_LAYER_TARGET_NRF5) |
| 1085 | AM_CONDITIONAL([CHIP_DEVICE_LAYER_TARGET_NRF5], [test "${CHIP_DEVICE_LAYER_TARGET_NRF5}" = 1]) |
| 1086 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_LAYER_TARGET_NRF5],[${CHIP_DEVICE_LAYER_TARGET_NRF5}],[Define to 1 if you want to build the CHIP Device Layer for Nordic nRF5* platforms.]) |
| 1087 | |
doru91 | edac1aa | 2020-08-20 04:28:05 +0300 | [diff] [blame] | 1088 | AC_SUBST(CHIP_DEVICE_LAYER_TARGET_K32W) |
| 1089 | AM_CONDITIONAL([CHIP_DEVICE_LAYER_TARGET_K32W], [test "${CHIP_DEVICE_LAYER_TARGET_K32W}" = 1]) |
| 1090 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_LAYER_TARGET_K32W],[${CHIP_DEVICE_LAYER_TARGET_K32W}],[Define to 1 if you want to build the CHIP Device Layer for NXP K32W platforms.]) |
| 1091 | |
Damian Królik | 34a4a93 | 2020-07-20 20:07:50 +0200 | [diff] [blame] | 1092 | AC_SUBST(CHIP_DEVICE_LAYER_TARGET_NRFCONNECT) |
| 1093 | AM_CONDITIONAL([CHIP_DEVICE_LAYER_TARGET_NRFCONNECT], [test "${CHIP_DEVICE_LAYER_TARGET_NRFCONNECT}" = 1]) |
| 1094 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_LAYER_TARGET_NRFCONNECT],[${CHIP_DEVICE_LAYER_TARGET_NRFCONNECT}],[Define to 1 if you want to build the CHIP Device Layer for Nordic nRF Connect platforms.]) |
| 1095 | |
Martin Turon | 0c03fa8 | 2020-05-26 15:43:11 -0700 | [diff] [blame] | 1096 | AC_SUBST(CHIP_DEVICE_LAYER_TARGET_LINUX) |
| 1097 | AM_CONDITIONAL([CHIP_DEVICE_LAYER_TARGET_LINUX], [test "${CHIP_DEVICE_LAYER_TARGET_LINUX}" = 1]) |
| 1098 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_LAYER_TARGET_LINUX],[${CHIP_DEVICE_LAYER_TARGET_LINUX}],[Define to 1 if you want to build the CHIP Device Layer for Linux platforms.]) |
| 1099 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1100 | if test "${CONFIG_DEVICE_LAYER}" = 1; then |
| 1101 | AC_DEFINE_UNQUOTED([BLE_PLATFORM_CONFIG_INCLUDE], |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 1102 | [<platform/${CHIP_DEVICE_LAYER_TARGET}/BlePlatformConfig.h>], |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1103 | [Path to BLE platform config header file]) |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 1104 | AC_DEFINE_UNQUOTED([INET_PLATFORM_CONFIG_INCLUDE], |
| 1105 | [<platform/${CHIP_DEVICE_LAYER_TARGET}/InetPlatformConfig.h>], |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1106 | [Path to Inet Layer platform config header file]) |
| 1107 | AC_DEFINE_UNQUOTED([SYSTEM_PLATFORM_CONFIG_INCLUDE], |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 1108 | [<platform/${CHIP_DEVICE_LAYER_TARGET}/SystemPlatformConfig.h>], |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1109 | [Path to System Layer platform config header file]) |
| 1110 | AC_DEFINE_UNQUOTED([WARM_PLATFORM_CONFIG_INCLUDE], |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 1111 | [<platform/${CHIP_DEVICE_LAYER_TARGET}/WarmPlatformConfig.h>], |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1112 | [Path to WARM platform config header file]) |
| 1113 | AC_DEFINE_UNQUOTED([CHIP_PLATFORM_CONFIG_INCLUDE], |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 1114 | [<platform/${CHIP_DEVICE_LAYER_TARGET}/CHIPPlatformConfig.h>], |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1115 | [Path to CHIP platform config header file]) |
| 1116 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE], |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 1117 | [<platform/${CHIP_DEVICE_LAYER_TARGET}/CHIPDevicePlatformConfig.h>], |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1118 | [Path to CHIP Device Layer platform config header file]) |
| 1119 | fi |
| 1120 | |
Vivien Nicolas | b1e52b2 | 2020-07-22 00:14:00 +0200 | [diff] [blame] | 1121 | if test ${CHIP_DEVICE_LAYER_TARGET_DARWIN} = 1 && test ${CONFIG_NETWORK_LAYER_BLE} = 1; then |
| 1122 | AC_CHECK_HEADER([CoreBluetooth/CoreBluetooth.h]) |
| 1123 | LDFLAGS="${LDFLAGS} -framework Foundation -framework CoreBluetooth" |
| 1124 | fi |
| 1125 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1126 | # |
| 1127 | # CHIP target network stack(s) |
| 1128 | # |
| 1129 | CONFIG_TARGET_NETWORKS=sockets |
| 1130 | |
| 1131 | AC_MSG_CHECKING([target network]) |
| 1132 | AC_ARG_WITH(target-network, |
| 1133 | [AS_HELP_STRING([--with-target-network=NETWORK], |
Vivien Nicolas | 7962596 | 2020-06-19 00:28:26 +0200 | [diff] [blame] | 1134 | [Specify the target network stack from one or more of, separated by commas: sockets, lwip or Network.framework @<:@default=sockets@:>@.])], |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1135 | [ |
| 1136 | CONFIG_TARGET_NETWORKS=`echo ${with_target_network} | sed -e 's/,/ /g'` |
| 1137 | |
| 1138 | for target_network in ${CONFIG_TARGET_NETWORKS}; do |
| 1139 | case "${target_network}" in |
| 1140 | |
Vivien Nicolas | 7962596 | 2020-06-19 00:28:26 +0200 | [diff] [blame] | 1141 | lwip|sockets|Network.framework) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1142 | ;; |
| 1143 | |
| 1144 | *) |
| 1145 | AC_MSG_ERROR([Invalid value ${with_target_network} for --with-target-network]) |
| 1146 | ;; |
| 1147 | |
| 1148 | esac |
| 1149 | done |
| 1150 | ], |
| 1151 | [with_target_network=${CONFIG_TARGET_NETWORKS}]) |
| 1152 | AC_MSG_RESULT(${with_target_network}) |
| 1153 | AC_SUBST(CONFIG_TARGET_NETWORKS) |
| 1154 | AC_DEFINE_UNQUOTED([CONFIG_TARGET_NETWORKS], "${CONFIG_TARGET_NETWORKS}", [CHIP target network stack(s)]) |
| 1155 | |
| 1156 | CHIP_SYSTEM_CONFIG_USE_LWIP=0 |
| 1157 | CHIP_SYSTEM_CONFIG_USE_SOCKETS=0 |
Vivien Nicolas | 7962596 | 2020-06-19 00:28:26 +0200 | [diff] [blame] | 1158 | CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK=0 |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1159 | |
| 1160 | for target_network in ${CONFIG_TARGET_NETWORKS}; do |
| 1161 | case ${target_network} in |
| 1162 | |
| 1163 | lwip) |
| 1164 | CHIP_SYSTEM_CONFIG_USE_LWIP=1 |
| 1165 | ;; |
| 1166 | |
| 1167 | sockets) |
| 1168 | CHIP_SYSTEM_CONFIG_USE_SOCKETS=1 |
| 1169 | ;; |
| 1170 | |
Vivien Nicolas | 7962596 | 2020-06-19 00:28:26 +0200 | [diff] [blame] | 1171 | Network.framework) |
| 1172 | CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK=1 |
| 1173 | ;; |
| 1174 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1175 | esac |
| 1176 | done |
| 1177 | |
| 1178 | AC_SUBST(CHIP_SYSTEM_CONFIG_USE_LWIP) |
| 1179 | AM_CONDITIONAL([CHIP_SYSTEM_CONFIG_USE_LWIP], [test "${CHIP_SYSTEM_CONFIG_USE_LWIP}" = 1]) |
| 1180 | AC_DEFINE_UNQUOTED([CHIP_SYSTEM_CONFIG_USE_LWIP], [${CHIP_SYSTEM_CONFIG_USE_LWIP}], |
| 1181 | [Define to 1 if you want to use LwIP with CHIP System Layer.]) |
| 1182 | |
| 1183 | AC_SUBST(CHIP_SYSTEM_CONFIG_USE_SOCKETS) |
| 1184 | AM_CONDITIONAL([CHIP_SYSTEM_CONFIG_USE_SOCKETS], [test "${CHIP_SYSTEM_CONFIG_USE_SOCKETS}" = 1]) |
| 1185 | AC_DEFINE_UNQUOTED([CHIP_SYSTEM_CONFIG_USE_SOCKETS], [${CHIP_SYSTEM_CONFIG_USE_SOCKETS}], |
| 1186 | [Define to 1 if you want to use BSD sockets with CHIP System Layer.]) |
| 1187 | |
Vivien Nicolas | 7962596 | 2020-06-19 00:28:26 +0200 | [diff] [blame] | 1188 | AC_SUBST(CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK) |
| 1189 | AM_CONDITIONAL([CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK], [test "${CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK}" = 1]) |
| 1190 | AC_DEFINE_UNQUOTED([CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK], [${CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK}], |
| 1191 | [Define to 1 if you want to use Network.framework with CHIP System Layer.]) |
| 1192 | |
| 1193 | # |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1194 | # |
| 1195 | # Internet Protocol Network Endpoints |
| 1196 | # |
| 1197 | if test ${CONFIG_NETWORK_LAYER_INET} = 1; then |
| 1198 | AC_MSG_CHECKING([IPv4 enabled]) |
| 1199 | AC_ARG_ENABLE(ipv4, |
| 1200 | [AS_HELP_STRING([--disable-ipv4],[Disable the inclusion of IPv4 networking @<:@default=yes@:>@.])], |
| 1201 | [ |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 1202 | case "${enableval}" in |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1203 | |
| 1204 | no|yes) |
| 1205 | enable_ivp4=${enableval} |
| 1206 | ;; |
| 1207 | |
| 1208 | *) |
| 1209 | AC_MSG_ERROR([Invalid value ${enableval} for --enable-ivp4]) |
| 1210 | ;; |
| 1211 | |
| 1212 | esac |
| 1213 | ], |
| 1214 | [enable_ivp4=yes]) |
| 1215 | AC_MSG_RESULT(${enable_ivp4}) |
| 1216 | |
| 1217 | INET_WANT_IPV4=1 |
| 1218 | |
| 1219 | if test "${enable_ipv4}" = no; then |
| 1220 | INET_WANT_IPV4=0 |
| 1221 | fi |
| 1222 | |
| 1223 | AM_CONDITIONAL([INET_WANT_IPV4], [test "${INET_WANT_IPV4}" = 1]) |
| 1224 | AC_DEFINE_UNQUOTED([INET_WANT_IPV4],[${INET_WANT_IPV4}], [Define to 1 if you want to use CHIP with IPv4.]) |
| 1225 | |
| 1226 | if test "${INET_WANT_IPV4}" = 1; then |
| 1227 | AC_DEFINE(INET_CONFIG_ENABLE_IPV4, 1, [Define to 1 for enabling IPv4]) |
| 1228 | fi |
| 1229 | |
| 1230 | AC_MSG_CHECKING([inet network endpoint]) |
| 1231 | AC_ARG_WITH(inet-endpoint, |
| 1232 | [AS_HELP_STRING([--with-inet-endpoint=ENDPOINT], |
| 1233 | [Specify the inet network endpoint from one or more of: raw, tcp, tun, udp @<:@default=all@:>@.])], |
| 1234 | [ |
| 1235 | INET_ENDPOINTS=`echo ${with_inet_endpoint} | sed -e 's/,/ /g'` |
| 1236 | |
| 1237 | for inet_endpoint in ${INET_ENDPOINTS}; do |
| 1238 | |
| 1239 | case "${inet_endpoint}" in |
| 1240 | |
| 1241 | dns|raw|tcp|tun|udp|all) |
| 1242 | ;; |
| 1243 | |
| 1244 | *) |
| 1245 | AC_MSG_ERROR([Invalid value ${with_inet_endpoint} for --with-inet-endpoint]) |
| 1246 | ;; |
| 1247 | |
| 1248 | esac |
| 1249 | |
| 1250 | done |
| 1251 | ], |
| 1252 | [INET_ENDPOINTS=all]) |
| 1253 | AC_MSG_RESULT(${with_inet_endpoint}) |
| 1254 | |
| 1255 | AC_SUBST(INET_ENDPOINTS) |
| 1256 | AC_DEFINE_UNQUOTED([INET_ENDPOINTS], "${INET_ENDPOINTS}", [CHIP target inet network endpoint(s)]) |
| 1257 | |
| 1258 | INET_WANT_ENDPOINT_DNS=0 |
| 1259 | INET_WANT_ENDPOINT_RAW=0 |
| 1260 | INET_WANT_ENDPOINT_TCP=0 |
| 1261 | INET_WANT_ENDPOINT_TUN=0 |
| 1262 | INET_WANT_ENDPOINT_UDP=0 |
| 1263 | |
| 1264 | for wanted_endpoint in ${INET_ENDPOINTS}; do |
| 1265 | |
| 1266 | case "${wanted_endpoint}" in |
| 1267 | |
| 1268 | dns) |
| 1269 | INET_WANT_ENDPOINT_DNS=1 |
| 1270 | ;; |
| 1271 | |
| 1272 | raw) |
| 1273 | INET_WANT_ENDPOINT_RAW=1 |
| 1274 | ;; |
| 1275 | |
| 1276 | tcp) |
| 1277 | INET_WANT_ENDPOINT_TCP=1 |
| 1278 | ;; |
| 1279 | |
| 1280 | tun) |
| 1281 | INET_WANT_ENDPOINT_TUN=1 |
| 1282 | ;; |
| 1283 | |
| 1284 | udp) |
| 1285 | INET_WANT_ENDPOINT_UDP=1 |
| 1286 | ;; |
| 1287 | |
| 1288 | all) |
| 1289 | INET_WANT_ENDPOINT_DNS=1 |
| 1290 | INET_WANT_ENDPOINT_RAW=1 |
| 1291 | INET_WANT_ENDPOINT_TCP=1 |
| 1292 | INET_WANT_ENDPOINT_TUN=1 |
| 1293 | INET_WANT_ENDPOINT_UDP=1 |
| 1294 | ;; |
| 1295 | esac |
| 1296 | |
| 1297 | done |
| 1298 | |
| 1299 | if test "${INET_WANT_ENDPOINT_TUN}" = 1; then |
| 1300 | AC_CHECK_HEADERS(linux/if_tun.h,[AC_SUBST(HAVE_LINUX_IF_TUN_H, [1])], [], []) |
| 1301 | AC_CHECK_TYPE(struct rtentry, , AC_CHECK_HEADERS(linux/route.h, [AC_SUBST(HAVE_LINUX_ROUTE_H, [1])], [], []), [[#include <net/route.h>]]) |
| 1302 | AC_CHECK_TYPE(struct in6_rtmsg, , AC_CHECK_HEADERS(linux/ipv6_route.h, [AC_SUBST(HAVE_LINUX_IPV6_ROUTE_H, [1])], [], []), [[#include <net/route.h>]]) |
| 1303 | # Check whether linux/if_tun.h defines TUNGETIFF. |
| 1304 | AC_MSG_CHECKING([whether linux/if_tun.h declares TUNGETIFF]) |
| 1305 | AC_COMPILE_IFELSE([ |
| 1306 | AC_LANG_PROGRAM( |
| 1307 | [[ |
| 1308 | #if HAVE_LINUX_IF_TUN_H |
| 1309 | # include <linux/if_tun.h> |
| 1310 | #endif |
| 1311 | ]], |
| 1312 | [[ |
| 1313 | #if !defined(TUNGETIFF) |
| 1314 | #error "TUNGETIFF is not defined" |
| 1315 | #endif |
| 1316 | ]])], |
| 1317 | [ |
| 1318 | AC_MSG_RESULT([yes]) |
| 1319 | AC_DEFINE(HAVE_TUNGETIFF, 1, [Define to 1 if <linux/if_tun.h> header file defines the TUNGETIFF ioctl command.]) |
| 1320 | ], |
| 1321 | [ |
| 1322 | AC_MSG_RESULT([no]) |
| 1323 | ]) |
| 1324 | AC_CHECK_TYPES(struct in6_rtmsg, [AC_SUBST(HAVE_IN6_RTMSG, [1])],[],[#include<net/route.h>]) |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 1325 | if [[[ "${CHIP_SYSTEM_CONFIG_USE_LWIP}" -eq 0 ]]] && |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1326 | [[[ "${HAVE_LINUX_IF_TUN_H}" -eq 0 || "${HAVE_IN6_RTMSG}" -eq 0 ]]]; then |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 1327 | AC_MSG_NOTICE([Tun EndPoint cannot be enabled for current target |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1328 | CHIP_SYSTEM_CONFIG_USE_LWIP=$CHIP_SYSTEM_CONFIG_USE_LWIP, HAVE_LINUX_IF_TUN_H=$HAVE_LINUX_IF_TUN_H, |
| 1329 | HAVE_IN6_RTMSG=$HAVE_IN6_RTMSG]) |
| 1330 | INET_WANT_ENDPOINT_TUN=0 |
| 1331 | fi |
| 1332 | fi |
| 1333 | |
| 1334 | AM_CONDITIONAL([INET_WANT_ENDPOINT_DNS], [test "${INET_WANT_ENDPOINT_DNS}" = 1]) |
| 1335 | AC_DEFINE_UNQUOTED([INET_WANT_ENDPOINT_DNS],[${INET_WANT_ENDPOINT_DNS}], |
| 1336 | [Define to 1 if you want to use CHIP with the inet dns resolver.]) |
| 1337 | |
| 1338 | AM_CONDITIONAL([INET_WANT_ENDPOINT_RAW], [test "${INET_WANT_ENDPOINT_RAW}" = 1]) |
| 1339 | AC_DEFINE_UNQUOTED([INET_WANT_ENDPOINT_RAW],[${INET_WANT_ENDPOINT_RAW}], |
| 1340 | [Define to 1 if you want to use CHIP with the inet raw endpoint.]) |
| 1341 | |
| 1342 | AM_CONDITIONAL([INET_WANT_ENDPOINT_TCP], [test "${INET_WANT_ENDPOINT_TCP}" = 1]) |
| 1343 | AC_DEFINE_UNQUOTED([INET_WANT_ENDPOINT_TCP],[${INET_WANT_ENDPOINT_TCP}], |
| 1344 | [Define to 1 if you want to use CHIP with the inet tcp endpoint.]) |
| 1345 | |
| 1346 | AM_CONDITIONAL([INET_WANT_ENDPOINT_TUN], [test "${INET_WANT_ENDPOINT_TUN}" = 1]) |
| 1347 | AC_DEFINE_UNQUOTED([INET_WANT_ENDPOINT_TUN],[${INET_WANT_ENDPOINT_TUN}], |
| 1348 | [Define to 1 if you want to use CHIP with the inet tun endpoint.]) |
| 1349 | |
| 1350 | AM_CONDITIONAL([INET_WANT_ENDPOINT_UDP], [test "${INET_WANT_ENDPOINT_UDP}" = 1]) |
| 1351 | AC_DEFINE_UNQUOTED([INET_WANT_ENDPOINT_UDP],[${INET_WANT_ENDPOINT_UDP}], |
| 1352 | [Define to 1 if you want to use CHIP with the inet udp endpoint.]) |
| 1353 | |
| 1354 | if test "${INET_WANT_ENDPOINT_DNS}" = 1; then |
| 1355 | AC_DEFINE(INET_CONFIG_ENABLE_DNS_RESOLVER, 1, [Define to 1 for enabling DNS Resolver]) |
| 1356 | fi |
| 1357 | |
| 1358 | if test "${INET_WANT_ENDPOINT_RAW}" = 1; then |
| 1359 | AC_DEFINE(INET_CONFIG_ENABLE_RAW_ENDPOINT, 1, [Define to 1 for enabling Raw Endpoint]) |
| 1360 | fi |
| 1361 | |
| 1362 | if test "${INET_WANT_ENDPOINT_TCP}" = 1; then |
| 1363 | AC_DEFINE(INET_CONFIG_ENABLE_TCP_ENDPOINT, 1, [Define to 1 for enabling TCP Endpoint]) |
| 1364 | fi |
| 1365 | |
| 1366 | if test "${INET_WANT_ENDPOINT_TUN}" = 1; then |
| 1367 | AC_DEFINE(INET_CONFIG_ENABLE_TUN_ENDPOINT, 1, [Define to 1 for enabling TUN Endpoint (only for LWIP and Linux w/ support)]) |
| 1368 | fi |
| 1369 | |
| 1370 | if test "${INET_WANT_ENDPOINT_UDP}" = 1; then |
| 1371 | AC_DEFINE(INET_CONFIG_ENABLE_UDP_ENDPOINT, 1, [Define to 1 for enabling UDP Endpoint]) |
| 1372 | fi |
| 1373 | fi |
| 1374 | |
| 1375 | # Asynchronous DNS |
| 1376 | AC_MSG_CHECKING([whether to build with asynchronous DNS resolution support]) |
| 1377 | AC_ARG_ENABLE(adns, |
| 1378 | [AS_HELP_STRING([--disable-adns],[Disable building of adns @<:@default=no@:>@.])], |
| 1379 | [ |
| 1380 | case "${enableval}" in |
| 1381 | |
| 1382 | no|yes) |
| 1383 | build_adns=${enableval} |
| 1384 | ;; |
| 1385 | |
| 1386 | *) |
| 1387 | AC_MSG_ERROR([Invalid value ${enableval} for --disable-adns]) |
| 1388 | ;; |
| 1389 | |
| 1390 | esac |
| 1391 | ], |
| 1392 | [build_adns=yes]) |
| 1393 | AC_MSG_RESULT(${build_adns}) |
| 1394 | |
| 1395 | AM_CONDITIONAL([INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS], [test "${build_adns}" = "yes"]) |
| 1396 | |
| 1397 | if test ${build_adns} = "yes" && test ${INET_WANT_ENDPOINT_DNS} = 1 && test ${CHIP_SYSTEM_CONFIG_USE_SOCKETS} = 1; then |
| 1398 | AC_DEFINE(INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS, 1, [Define to 1 for enabling ASYNC DNS]) |
| 1399 | else |
| 1400 | AC_DEFINE(INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS, 0, [Define to 0 for disabling ASYNC DNS]) |
| 1401 | fi |
| 1402 | |
Grant Erickson | 7ada3ad | 2020-04-02 11:03:34 -0700 | [diff] [blame] | 1403 | # |
| 1404 | # Options for the user to specify project-specific configuration files |
| 1405 | # for various CHIP components. |
| 1406 | # |
| 1407 | |
| 1408 | AC_LANG_PUSH([C++]) |
| 1409 | |
| 1410 | # SystemLayer |
| 1411 | |
Rob Walker | aeec6c5 | 2020-04-20 10:05:18 -0700 | [diff] [blame] | 1412 | CHIP_CHECK_PROJECT_CONFIG_INCLUDES(chip-system-project-includes, SYSTEM_PROJECT_CONFIG_INCLUDE, SystemProjectConfig.h, CHIP System Layer, ${ac_abs_confdir}/config/standalone) |
Grant Erickson | 7ada3ad | 2020-04-02 11:03:34 -0700 | [diff] [blame] | 1413 | |
| 1414 | # BleLayer |
| 1415 | |
| 1416 | if test ${CONFIG_NETWORK_LAYER_BLE} = 1; then |
Rob Walker | aeec6c5 | 2020-04-20 10:05:18 -0700 | [diff] [blame] | 1417 | CHIP_CHECK_PROJECT_CONFIG_INCLUDES(chip-ble-project-includes, BLE_PROJECT_CONFIG_INCLUDE, BleProjectConfig.h, CHIP BLE Layer, ${ac_abs_confdir}/config/standalone) |
Grant Erickson | 7ada3ad | 2020-04-02 11:03:34 -0700 | [diff] [blame] | 1418 | fi |
| 1419 | |
| 1420 | # InetLayer |
| 1421 | |
| 1422 | if test ${CONFIG_NETWORK_LAYER_INET} = 1; then |
Rob Walker | aeec6c5 | 2020-04-20 10:05:18 -0700 | [diff] [blame] | 1423 | CHIP_CHECK_PROJECT_CONFIG_INCLUDES(chip-inet-project-includes, INET_PROJECT_CONFIG_INCLUDE, InetProjectConfig.h, CHIP Inet Layer, ${ac_abs_confdir}/config/standalone) |
Grant Erickson | 7ada3ad | 2020-04-02 11:03:34 -0700 | [diff] [blame] | 1424 | fi |
| 1425 | |
| 1426 | # Core |
| 1427 | |
Rob Walker | aeec6c5 | 2020-04-20 10:05:18 -0700 | [diff] [blame] | 1428 | CHIP_CHECK_PROJECT_CONFIG_INCLUDES(chip-project-includes, CHIP_PROJECT_CONFIG_INCLUDE, CHIPProjectConfig.h, CHIP Core, ${ac_abs_confdir}/config/standalone) |
Grant Erickson | 7ada3ad | 2020-04-02 11:03:34 -0700 | [diff] [blame] | 1429 | |
| 1430 | # Device Layer |
| 1431 | |
Rob Walker | ae3a900 | 2020-04-15 13:48:47 -0700 | [diff] [blame] | 1432 | if test "${CONFIG_DEVICE_LAYER}" = 1; then |
Grant Erickson | 7ada3ad | 2020-04-02 11:03:34 -0700 | [diff] [blame] | 1433 | CHIP_CHECK_PROJECT_CONFIG_INCLUDES(chip-device-project-includes, CHIP_DEVICE_PROJECT_CONFIG_INCLUDE, CHIPDeviceProjectConfig.h, CHIP Device Layer,) |
| 1434 | fi |
| 1435 | |
| 1436 | AC_LANG_POP([C++]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1437 | |
| 1438 | # |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1439 | # Check for crypto implementation |
| 1440 | # |
| 1441 | CHIP_CRYPTO= |
| 1442 | CHIP_CRYPTO_MBEDTLS=0 |
| 1443 | CHIP_CRYPTO_OPENSSL=0 |
| 1444 | |
| 1445 | AC_MSG_CHECKING([for crypto implementation]) |
| 1446 | |
| 1447 | # The user may have attempted to explicitly specify the crypto |
| 1448 | # implementation. Sanity check it or default to 'auto'. |
| 1449 | |
| 1450 | AC_ARG_WITH(crypto, |
| 1451 | [AS_HELP_STRING([--with-crypto=CRYPTO], |
| 1452 | [Specify the crypto implementation from one of: auto, mbedtls, or openssl @<:@default=auto@:>@.])], |
| 1453 | [ |
| 1454 | case "${with_crypto}" in |
| 1455 | auto|mbedtls|openssl) |
| 1456 | ;; |
| 1457 | *) |
| 1458 | AC_MSG_ERROR([Invalid value ${with_crypto} for --with-crypto]) |
| 1459 | ;; |
| 1460 | esac |
| 1461 | ], |
| 1462 | [with_crypto=auto]) |
| 1463 | |
| 1464 | # At this point, the crypto implementation is one of the allowed |
| 1465 | # values. If it's 'auto' we autodetect it. |
| 1466 | |
| 1467 | if test "${with_crypto}" = "auto"; then |
| 1468 | case ${target_os} in |
| 1469 | |
| 1470 | *cygwin*|*darwin*|*linux*|*freebsd*|*netbsd*|*openbsd*) |
| 1471 | with_crypto=openssl |
| 1472 | ;; |
| 1473 | |
| 1474 | *freertos*) |
| 1475 | with_crypto=mbedtls |
| 1476 | ;; |
| 1477 | |
| 1478 | *) |
| 1479 | AC_MSG_RESULT([unknown]) |
| 1480 | AC_MSG_ERROR([Unsupported target OS ${target_os}]) |
| 1481 | ;; |
| 1482 | |
| 1483 | esac |
| 1484 | fi |
| 1485 | |
| 1486 | CHIP_CRYPTO=${with_crypto} |
| 1487 | |
| 1488 | case ${with_crypto} in |
| 1489 | |
| 1490 | mbedtls) |
| 1491 | CHIP_CRYPTO_MBEDTLS=1 |
| 1492 | ;; |
| 1493 | |
| 1494 | openssl) |
| 1495 | CHIP_CRYPTO_OPENSSL=1 |
| 1496 | ;; |
| 1497 | |
| 1498 | esac |
| 1499 | |
| 1500 | AC_MSG_RESULT(${CHIP_CRYPTO}) |
| 1501 | |
| 1502 | AC_SUBST(CHIP_CRYPTO) |
| 1503 | AC_DEFINE_UNQUOTED([CHIP_CRYPTO],[${CHIP_CRYPTO}],[CHIP crypto implementation]) |
| 1504 | |
| 1505 | AC_SUBST(CHIP_CRYPTO_MBEDTLS) |
| 1506 | AM_CONDITIONAL([CHIP_CRYPTO_MBEDTLS], [test "${CHIP_CRYPTO}" = "mbedtls"]) |
| 1507 | AC_DEFINE_UNQUOTED([CHIP_CRYPTO_MBEDTLS],[${CHIP_CRYPTO_MBEDTLS}],[Define to 1 if you want to use CHIP with a mbedTLS crypto implementation]) |
| 1508 | |
| 1509 | AC_SUBST(CHIP_CRYPTO_OPENSSL) |
| 1510 | AM_CONDITIONAL([CHIP_CRYPTO_OPENSSL], [test "${CHIP_CRYPTO}" = "openssl"]) |
| 1511 | AC_DEFINE_UNQUOTED([CHIP_CRYPTO_OPENSSL],[${CHIP_CRYPTO_OPENSSL}],[Define to 1 if you want to use CHIP with an OpenSSL crypto implementation]) |
| 1512 | |
| 1513 | # |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1514 | # Checks for libraries and packages. |
| 1515 | # |
| 1516 | # At minimum, the following are required: |
| 1517 | # |
| 1518 | # * nlassert |
| 1519 | # * nlio |
| 1520 | # |
| 1521 | # The following are optional, depending on configuration: |
| 1522 | # |
| 1523 | # * lwip |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1524 | # * mbedtls |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1525 | # * nlunit-test |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1526 | # * nlfaultinjection |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1527 | # * openssl |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1528 | # |
| 1529 | # Most of these are supplied "in package"; however, they may be also |
| 1530 | # supplied out of package. |
| 1531 | # |
| 1532 | AC_MSG_NOTICE([checking package dependencies]) |
| 1533 | |
| 1534 | # Check if the build host has pkg-config |
| 1535 | |
| 1536 | AC_PATH_PROG([PKG_CONFIG],[pkg-config]) |
| 1537 | |
| 1538 | # |
yunhanw-google | e1d448c | 2020-07-21 11:57:53 -0700 | [diff] [blame] | 1539 | # Chip over Ble over Bluez Peripheral support |
| 1540 | # |
| 1541 | |
| 1542 | # Only a concern when the BLE layer is enabled. |
| 1543 | |
| 1544 | CONFIG_BLE_PLATFORM_BLUEZ=0 |
| 1545 | enable_chipoble_bluez="no" |
| 1546 | |
| 1547 | NL_WITH_OPTIONAL_INTERNAL_PACKAGE( |
| 1548 | [BlueZ], |
| 1549 | [BLUEZ], |
| 1550 | [bluez], |
| 1551 | [-lgdbus-internal -lshared-glib], |
| 1552 | [ |
| 1553 | # actions if not external |
| 1554 | # At this time, enable this only for linux, and only if the tests are enabled |
| 1555 | if test "${nl_cv_build_tests}" = "yes" && test "${CONFIG_NETWORK_LAYER_BLE}" = 1 && test "${with_device_layer}" = "linux"; then |
| 1556 | case "${target}" in |
| 1557 | |
| 1558 | *linux*) |
| 1559 | if test "x${HAVE_CXX11}" == "0"; then |
| 1560 | AC_MSG_ERROR([BlueZ support requires C++11 compiler]) |
| 1561 | fi |
| 1562 | CONFIG_BLE_PLATFORM_BLUEZ=1 |
| 1563 | enable_chipoble_bluez="yes" |
| 1564 | ;; |
| 1565 | |
| 1566 | *) |
| 1567 | CONFIG_BLE_PLATFORM_BLUEZ=0 |
| 1568 | enable_chipoble_bluez="no" |
| 1569 | ;; |
| 1570 | |
| 1571 | esac |
| 1572 | fi |
| 1573 | ] |
| 1574 | ) |
| 1575 | |
| 1576 | # Depending on whether bluez has been configured for an internal |
| 1577 | # location, its directory stem within this package needs to be set |
| 1578 | # accordingly. In addition, if the location is internal, then we need |
| 1579 | # to attempt to pull it down using the bootstrap makefile. |
| 1580 | |
| 1581 | if test "${nl_with_bluez}" = "internal" && test "${enable_chipoble_bluez}" = "yes"; then |
| 1582 | maybe_bluez_dirstem="bluez/repo" |
| 1583 | bluez_dirstem="third_party/${maybe_bluez_dirstem}" |
| 1584 | |
| 1585 | AC_MSG_NOTICE([attempting to create internal ${bluez_dirstem}]) |
| 1586 | |
| 1587 | ${MAKE-make} --no-print-directory -C ${srcdir} -f Makefile-bootstrap ${bluez_dirstem} |
| 1588 | |
| 1589 | if test $? -ne 0; then |
| 1590 | AC_MSG_ERROR([failed to create ${bluez_dirstem}. Please check your network connection or the correctness of 'repos.conf']) |
| 1591 | fi |
| 1592 | |
| 1593 | echo " BOOTSTRAP ${bluez_dirstem}" |
| 1594 | |
| 1595 | (cd ${srcdir}/${bluez_dirstem} && ./bootstrap) |
| 1596 | |
| 1597 | else |
| 1598 | maybe_bluez_dirstem="" |
| 1599 | fi |
| 1600 | |
| 1601 | AC_SUBST(BLUEZ_SUBDIRS, [${maybe_bluez_dirstem}]) |
| 1602 | AM_CONDITIONAL([CHIP_WITH_BLUEZ_INTERNAL], [test "${nl_with_bluez}" = "internal"]) |
| 1603 | |
| 1604 | AM_CONDITIONAL([CONFIG_BLE_PLATFORM_BLUEZ], [test "${enable_chipoble_bluez}" = "yes"]) |
| 1605 | AC_DEFINE_UNQUOTED([CONFIG_BLE_PLATFORM_BLUEZ],[${CONFIG_BLE_PLATFORM_BLUEZ}],[Define to 1 if you want to enable Chip over Ble over bluez.]) |
| 1606 | |
| 1607 | if test "${enable_chipoble_bluez}" = "yes"; then |
| 1608 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes, |
| 1609 | AC_MSG_ERROR(GLib >= 2.28 is required)) |
| 1610 | AC_SUBST(GLIB_CFLAGS) |
| 1611 | AC_SUBST(GLIB_LIBS) |
| 1612 | |
| 1613 | PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.6, dummy=yes, |
| 1614 | AC_MSG_ERROR(D-Bus >= 1.6 is required)) |
| 1615 | AC_SUBST(DBUS_CFLAGS) |
| 1616 | AC_SUBST(DBUS_LIBS) |
| 1617 | |
| 1618 | AX_CHECK_COMPILER_OPTIONS([C], ${GLIB_CFLAGS} ${DBUS_CFLAGS}) |
| 1619 | AX_CHECK_COMPILER_OPTIONS([C++], ${GLIB_CFLAGS} ${DBUS_CFLAGS}) |
| 1620 | fi |
| 1621 | |
| 1622 | # |
Grant Erickson | cb9d81f | 2020-04-02 15:47:40 -0700 | [diff] [blame] | 1623 | # OpenSSL |
| 1624 | # |
| 1625 | |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1626 | if test "${with_crypto}" = "openssl"; then |
| 1627 | NL_WITH_REQUIRED_EXTERNAL_PACKAGE([OpenSSL], |
| 1628 | [OPENSSL], |
| 1629 | [openssl], |
| 1630 | [-lcrypto], |
| 1631 | [ |
| 1632 | # Check for required OpenSSL headers. |
| 1633 | AC_CHECK_HEADERS([openssl/aes.h] [openssl/bn.h] [openssl/crypto.h] [openssl/ec.h] [openssl/err.h] [openssl/evp.h] [openssl/hmac.h] [openssl/kdf.h] [openssl/rand.h] [openssl/sha.h] [openssl/srp.h], |
| 1634 | [], |
| 1635 | [ |
| 1636 | AC_MSG_ERROR(The OpenSSL header "$ac_header" is required but cannot be found.) |
| 1637 | ] |
| 1638 | ) |
| 1639 | ] |
| 1640 | ) |
| 1641 | fi |
Grant Erickson | cb9d81f | 2020-04-02 15:47:40 -0700 | [diff] [blame] | 1642 | |
| 1643 | AM_CONDITIONAL([CHIP_WITH_OPENSSL], [test "${nl_with_openssl}" != "no"]) |
| 1644 | |
| 1645 | if test "${nl_with_openssl}" = "no"; then |
Yufeng Wang | d3c22b9 | 2020-07-14 09:09:45 -0700 | [diff] [blame] | 1646 | AC_DEFINE([CHIP_WITH_OPENSSL], [0], [Define to 0 to build CHIP without OpenSSL]) |
Grant Erickson | cb9d81f | 2020-04-02 15:47:40 -0700 | [diff] [blame] | 1647 | else |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1648 | AC_DEFINE([CHIP_WITH_OPENSSL], [1], [Define to 1 to build CHIP with OpenSSL]) |
Grant Erickson | cb9d81f | 2020-04-02 15:47:40 -0700 | [diff] [blame] | 1649 | fi |
| 1650 | |
| 1651 | # |
Pankaj Garg | 139d43b | 2020-04-15 19:04:57 -0700 | [diff] [blame] | 1652 | # mbedTLS |
| 1653 | # |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1654 | |
| 1655 | if test "${with_crypto}" = "mbedtls"; then |
| 1656 | NL_WITH_REQUIRED_INTERNAL_PACKAGE( |
| 1657 | [mbedTLS], |
| 1658 | [MBEDTLS], |
| 1659 | [mbedtls], |
Pankaj Garg | e4a5eed | 2020-05-06 09:07:13 -0700 | [diff] [blame] | 1660 | [-lmbedtls], |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1661 | [ |
| 1662 | # At this point, the internal mbedTLS package will be neither |
| 1663 | # configured nor built, so the normal checks we undertake for an |
| 1664 | # external package cannot be run here. Simply set the appropriate |
| 1665 | # variables and trust all will be well. |
| 1666 | |
| 1667 | MBEDTLS_CPPFLAGS="-I\${abs_top_srcdir}/third_party/mbedtls/repo/include" |
| 1668 | MBEDTLS_LDFLAGS="-L${ac_pwd}/third_party/mbedtls" |
| 1669 | MBEDTLS_LIBS="-lmbedtls" |
| 1670 | ], |
| 1671 | [ |
| 1672 | # Check for required mbedTLS headers. |
| 1673 | AC_CHECK_HEADERS([mbedtls/sha1.h] [mbedtls/sha256.h] [mbedtls/sha512.h] [mbedtls/md.h] [mbedtls/hkdf.h] [mbedtls/pkcs5.h] [mbedtls/chachapoly.h] [mbedtls/aes.h] [mbedtls/ecdh.h] [mbedtls/bignum.h], |
| 1674 | [], |
| 1675 | [ |
| 1676 | AC_MSG_ERROR(The mbedTLS header "$ac_header" is required but cannot be found.) |
Yakun Xu | 42f81cd | 2020-05-30 16:47:19 +0800 | [diff] [blame] | 1677 | ], |
| 1678 | [ |
| 1679 | // Undefine MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE to prevent |
| 1680 | // including these files at configure stage. This is necessary because |
| 1681 | // CPPFLAGS is shell expanded during configure stage, which is not |
| 1682 | // compatible with the expansion of make. |
| 1683 | #undef MBEDTLS_CONFIG_FILE |
| 1684 | #undef MBEDTLS_USER_CONFIG_FILE |
| 1685 | ]) |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1686 | ] |
| 1687 | ) |
Pankaj Garg | 5f7b952 | 2020-04-18 16:58:54 -0700 | [diff] [blame] | 1688 | fi |
Pankaj Garg | 139d43b | 2020-04-15 19:04:57 -0700 | [diff] [blame] | 1689 | |
Pankaj Garg | 5f7b952 | 2020-04-18 16:58:54 -0700 | [diff] [blame] | 1690 | # Depending on whether mbedTLS has been configured for an internal |
| 1691 | # location, its directory stem within this package needs to be set |
| 1692 | # accordingly. In addition, if the location is internal, then we need |
| 1693 | # to attempt to pull it down using the bootstrap makefile. |
Pankaj Garg | 139d43b | 2020-04-15 19:04:57 -0700 | [diff] [blame] | 1694 | |
Pankaj Garg | 5f7b952 | 2020-04-18 16:58:54 -0700 | [diff] [blame] | 1695 | if test "${nl_with_mbedtls}" = "internal"; then |
| 1696 | maybe_mbedtls_dirstem="mbedtls" |
| 1697 | mbedtls_dirstem="third_party/${maybe_mbedtls_dirstem}/repo" |
| 1698 | |
| 1699 | AC_MSG_NOTICE([attempting to create internal ${mbedtls_dirstem}]) |
| 1700 | |
| 1701 | ${MAKE-make} --no-print-directory -C ${srcdir} -f Makefile-bootstrap ${mbedtls_dirstem} |
| 1702 | |
| 1703 | if test $? -ne 0; then |
| 1704 | AC_MSG_ERROR([failed to create ${mbedtls_dirstem}. Please check your network connection or the correctness of 'repos.conf']) |
| 1705 | fi |
Pankaj Garg | 139d43b | 2020-04-15 19:04:57 -0700 | [diff] [blame] | 1706 | else |
Pankaj Garg | 5f7b952 | 2020-04-18 16:58:54 -0700 | [diff] [blame] | 1707 | maybe_mbedtls_dirstem="" |
Pankaj Garg | 139d43b | 2020-04-15 19:04:57 -0700 | [diff] [blame] | 1708 | fi |
| 1709 | |
Pankaj Garg | 5f7b952 | 2020-04-18 16:58:54 -0700 | [diff] [blame] | 1710 | AC_SUBST(MBEDTLS_SUBDIRS, [${maybe_mbedtls_dirstem}]) |
| 1711 | AM_CONDITIONAL([CHIP_WITH_MBEDTLS_INTERNAL], [test "${nl_with_mbedtls}" = "internal"]) |
| 1712 | |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1713 | AM_CONDITIONAL([CHIP_WITH_MBEDTLS], [test "${nl_with_mbedtls}" != "no"]) |
| 1714 | |
| 1715 | if test "${nl_with_mbedtls}" = "no"; then |
Yufeng Wang | d3c22b9 | 2020-07-14 09:09:45 -0700 | [diff] [blame] | 1716 | AC_DEFINE([CHIP_WITH_MBEDTLS], [0], [Define to 0 to build CHIP without mbedTLS]) |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 1717 | else |
| 1718 | AC_DEFINE([CHIP_WITH_MBEDTLS], [1], [Define to 1 to build CHIP with mbedTLS]) |
| 1719 | fi |
| 1720 | |
Pankaj Garg | 139d43b | 2020-04-15 19:04:57 -0700 | [diff] [blame] | 1721 | # |
Yakun Xu | 47f325f | 2020-07-15 00:10:33 +0800 | [diff] [blame] | 1722 | # OpenThread |
| 1723 | # |
| 1724 | |
| 1725 | NL_WITH_OPTIONAL_INTERNAL_PACKAGE( |
| 1726 | [OpenThread], |
| 1727 | [OPENTHREAD], |
| 1728 | [openthread], |
| 1729 | [], |
| 1730 | [ |
| 1731 | # use absolute path to support build out of source tree |
| 1732 | chip_srcdir="$(cd ${srcdir} && pwd)" |
| 1733 | |
| 1734 | # bootstrap |
| 1735 | test -f ${chip_srcdir}/third_party/openthread/repo/configure || (cd ${chip_srcdir}/third_party/openthread/repo && ./bootstrap) |
| 1736 | |
| 1737 | case "${with_device_layer}" in |
| 1738 | nrf5) |
| 1739 | OPENTHREAD_CPPFLAGS="-I\${abs_top_srcdir}/third_party/openthread/repo/include" |
| 1740 | OPENTHREAD_LDFLAGS="-L${ac_pwd}/third_party/openthread" |
| 1741 | OPENTHREAD_LIBS="-lopenthread-cli-ftd \ |
| 1742 | -lopenthread-ftd \ |
| 1743 | -lopenthread-platform-utils \ |
| 1744 | -lopenthread-nrf52840-transport \ |
| 1745 | -lopenthread-nrf52840-softdevice-sdk \ |
| 1746 | -lnordicsemi-nrf52840-radio-driver-softdevice \ |
| 1747 | \${NRF5_SDK_ROOT}/external/openthread/nrf_security/lib/libmbedcrypto_glue.a \ |
| 1748 | \${NRF5_SDK_ROOT}/external/openthread/nrf_security/lib/libmbedcrypto_glue_cc310.a \ |
| 1749 | \${NRF5_SDK_ROOT}/external/openthread/nrf_security/lib/libmbedcrypto_glue_vanilla.a \ |
| 1750 | \${NRF5_SDK_ROOT}/external/openthread/nrf_security/lib/libmbedcrypto_cc310_backend.a \ |
| 1751 | \${NRF5_SDK_ROOT}/external/openthread/nrf_security/lib/libmbedcrypto_vanilla_backend.a \ |
| 1752 | \${NRF5_SDK_ROOT}/external/openthread/nrf_security/lib/libmbedtls_base_vanilla.a \ |
| 1753 | \${NRF5_SDK_ROOT}/external/openthread/nrf_security/lib/libmbedtls_tls_vanilla.a \ |
| 1754 | \${NRF5_SDK_ROOT}/external/openthread/nrf_security/lib/libmbedtls_x509_vanilla.a \ |
| 1755 | \${NRF5_SDK_ROOT}/external/openthread/nrf_security/lib/libnrf_cc310_platform_0.9.1.a" |
| 1756 | |
| 1757 | # private definitions |
| 1758 | ot_cppflags="-Wno-expansion-to-defined \ |
| 1759 | -I${chip_srcdir}/third_party/openthread/repo/examples/platforms/nrf528xx/nrf52840 \ |
| 1760 | -I${chip_srcdir}/third_party/openthread/repo/third_party/NordicSemiconductor/libraries/nrf_security/config \ |
| 1761 | -I${chip_srcdir}/third_party/openthread/repo/third_party/NordicSemiconductor/libraries/nrf_security/include \ |
| 1762 | -I${chip_srcdir}/third_party/openthread/repo/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config \ |
| 1763 | -I${chip_srcdir}/third_party/openthread/repo/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include \ |
| 1764 | -I${chip_srcdir}/third_party/mbedtls/repo/include \ |
| 1765 | -DMBEDTLS_CONFIG_FILE=\<nrf-config.h\> \ |
| 1766 | -DMBEDTLS_USER_CONFIG_FILE=\<nrf52840-mbedtls-config.h\> \ |
| 1767 | -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\<openthread-core-nrf52840-config.h\> \ |
| 1768 | -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=\<openthread-core-nrf52840-config-check.h\> \ |
| 1769 | -DOPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1 \ |
| 1770 | -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 \ |
| 1771 | -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 \ |
kangping | 70de84e | 2020-08-14 23:19:30 +0800 | [diff] [blame] | 1772 | -DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1 \ |
Yakun Xu | 47f325f | 2020-07-15 00:10:33 +0800 | [diff] [blame] | 1773 | -DUART_AS_SERIAL_TRANSPORT=1" |
| 1774 | |
| 1775 | (mkdir -p ${ac_pwd}/third_party/openthread \ |
| 1776 | && cd ${ac_pwd}/third_party/openthread \ |
| 1777 | && CPPFLAGS="${ot_cppflags}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" ${chip_srcdir}/third_party/openthread/repo/configure \ |
| 1778 | --disable-builtin-mbedtls \ |
| 1779 | --disable-docs \ |
| 1780 | --disable-executable \ |
| 1781 | --disable-tools \ |
| 1782 | --enable-cli \ |
| 1783 | --enable-ftd \ |
| 1784 | --host=arm-none-eabi \ |
| 1785 | --prefix=${prefix} \ |
| 1786 | --exec-prefix=${exec_prefix} \ |
| 1787 | --with-examples=nrf52840) |
| 1788 | |
| 1789 | if test $? != 0; then |
| 1790 | AC_MSG_ERROR([Failed to configure OpenThread!]) |
| 1791 | fi |
| 1792 | |
| 1793 | maybe_openthread_dirstem="openthread" |
| 1794 | ;; |
| 1795 | |
| 1796 | *) |
| 1797 | AC_MSG_NOTICE([No internal OpenThread support yet!]) |
| 1798 | nl_with_openthread=no |
| 1799 | with_openthread=no |
| 1800 | ;; |
| 1801 | esac |
| 1802 | ], |
| 1803 | [ |
| 1804 | # Check for required OpenThread headers. |
| 1805 | AC_CHECK_HEADERS([openthread/dataset.h] [openthread/dataset_ftd.h] [openthread/error.h] [openthread/icmp6.h] [openthread/instance.h] [openthread/ip6.h] [openthread/link.h] [openthread/message.h] [openthread/netdata.h] [openthread/tasklet.h] [openthread/thread.h], |
| 1806 | [], |
| 1807 | [ |
| 1808 | AC_MSG_ERROR(The OpenThread header "$ac_header" is required but cannot be found.) |
| 1809 | ]) |
| 1810 | maybe_openthread_dirstem="" |
| 1811 | ] |
| 1812 | ) |
| 1813 | AC_SUBST(OPENTHREAD_SUBDIRS, [${maybe_openthread_dirstem}]) |
| 1814 | AM_CONDITIONAL([CHIP_ENABLE_OPENTHREAD], [test "${nl_with_openthread}" != "no"]) |
| 1815 | if test "${nl_with_openthread}" != "no"; then |
| 1816 | CHIP_ENABLE_OPENTHREAD=1 |
| 1817 | else |
| 1818 | CHIP_ENABLE_OPENTHREAD=0 |
| 1819 | fi |
| 1820 | AC_DEFINE_UNQUOTED([CHIP_ENABLE_OPENTHREAD],[${CHIP_ENABLE_OPENTHREAD}],[Define to 1 if you want to enable OpenThread.]) |
| 1821 | |
| 1822 | # |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 1823 | # LwIP |
| 1824 | # |
| 1825 | |
| 1826 | NL_WITH_LWIP(${CHIP_SYSTEM_CONFIG_USE_LWIP}) |
| 1827 | |
| 1828 | # |
| 1829 | # Nlio |
| 1830 | # |
| 1831 | |
| 1832 | NL_WITH_PACKAGE( |
| 1833 | [Nlio], |
| 1834 | [NLIO], |
| 1835 | [nlio], |
| 1836 | [], |
| 1837 | [ |
| 1838 | # At this point, the internal Nlio package will be neither |
| 1839 | # configured nor built, so the normal checks we undertake for an |
| 1840 | # external package cannot be run here. Simply set the appropriate |
| 1841 | # variables and trust all will be well. |
| 1842 | |
| 1843 | NLIO_CPPFLAGS="-I\${abs_top_srcdir}/third_party/nlio/repo/include" |
| 1844 | NLIO_LDFLAGS= |
| 1845 | NLIO_LIBS= |
| 1846 | ], |
| 1847 | [ |
| 1848 | # Check for required Nlio headers. |
| 1849 | |
| 1850 | AC_CHECK_HEADERS([nlbyteorder.h], |
| 1851 | [], |
| 1852 | [ |
| 1853 | AC_MSG_ERROR(The nlio header "$ac_header" is required but cannot be found.) |
| 1854 | ]) |
| 1855 | ] |
| 1856 | ) |
| 1857 | |
| 1858 | # Depending on whether nlio has been configured for an internal |
| 1859 | # location, its directory stem within this package needs to be set |
| 1860 | # accordingly. In addition, if the location is internal, then we need |
| 1861 | # to attempt to pull it down using the bootstrap makefile. |
| 1862 | |
| 1863 | if test "${nl_with_nlio}" = "internal"; then |
| 1864 | maybe_nlio_dirstem="nlio/repo" |
| 1865 | nlio_dirstem="third_party/${maybe_nlio_dirstem}" |
| 1866 | |
| 1867 | AC_MSG_NOTICE([attempting to create internal ${nlio_dirstem}]) |
| 1868 | |
| 1869 | ${MAKE-make} --no-print-directory -C ${srcdir} -f Makefile-bootstrap ${nlio_dirstem} |
| 1870 | |
| 1871 | if test $? -ne 0; then |
| 1872 | AC_MSG_ERROR([failed to create ${nlio_dirstem}. Please check your network connection or the correctness of 'repos.conf']) |
| 1873 | fi |
| 1874 | else |
| 1875 | maybe_nlio_dirstem="" |
| 1876 | fi |
| 1877 | |
| 1878 | AC_SUBST(NLIO_SUBDIRS, [${maybe_nlio_dirstem}]) |
| 1879 | AM_CONDITIONAL([CHIP_WITH_NLIO_INTERNAL], [test "${nl_with_nlio}" = "internal"]) |
| 1880 | |
| 1881 | # |
| 1882 | # Nlassert |
| 1883 | # |
| 1884 | |
| 1885 | NL_WITH_PACKAGE( |
| 1886 | [Nlassert], |
| 1887 | [NLASSERT], |
| 1888 | [nlassert], |
| 1889 | [], |
| 1890 | [ |
| 1891 | # At this point, the internal Nlassert package will be neither |
| 1892 | # configured nor built, so the normal checks we undertake for an |
| 1893 | # external package cannot be run here. Simply set the appropriate |
| 1894 | # variables and trust all will be well. |
| 1895 | |
| 1896 | NLASSERT_CPPFLAGS="-I\${abs_top_srcdir}/third_party/nlassert/repo/include" |
| 1897 | NLASSERT_LDFLAGS= |
| 1898 | NLASSERT_LIBS= |
| 1899 | ], |
| 1900 | [ |
| 1901 | # Check for required Nlassert headers. |
| 1902 | |
| 1903 | AC_CHECK_HEADERS([nlassert.h], |
| 1904 | [], |
| 1905 | [ |
| 1906 | AC_MSG_ERROR(The nlassert header "$ac_header" is required but cannot be found.) |
| 1907 | ]) |
| 1908 | ] |
| 1909 | ) |
| 1910 | |
| 1911 | # Depending on whether nlassert has been configured for an internal |
| 1912 | # location, its directory stem within this package needs to be set |
| 1913 | # accordingly. In addition, if the location is internal, then we need |
| 1914 | # to attempt to pull it down using the bootstrap makefile. |
| 1915 | |
| 1916 | if test "${nl_with_nlassert}" = "internal"; then |
| 1917 | maybe_nlassert_dirstem="nlassert/repo" |
| 1918 | nlassert_dirstem="third_party/${maybe_nlassert_dirstem}" |
| 1919 | |
| 1920 | AC_MSG_NOTICE([attempting to create internal ${nlassert_dirstem}]) |
| 1921 | |
| 1922 | ${MAKE-make} --no-print-directory -C ${srcdir} -f Makefile-bootstrap ${nlassert_dirstem} |
| 1923 | |
| 1924 | if test $? -ne 0; then |
| 1925 | AC_MSG_ERROR([failed to create ${nlassert_dirstem}. Please check your network connection or the correctness of 'repos.conf']) |
| 1926 | fi |
| 1927 | else |
| 1928 | maybe_nlassert_dirstem="" |
| 1929 | fi |
| 1930 | |
| 1931 | AC_SUBST(NLASSERT_SUBDIRS, [${maybe_nlassert_dirstem}]) |
| 1932 | AM_CONDITIONAL([CHIP_WITH_NLASSERT_INTERNAL], [test "${nl_with_nlassert}" = "internal"]) |
| 1933 | |
| 1934 | # |
Grant Erickson | 81bc570 | 2020-03-18 10:26:28 -0700 | [diff] [blame] | 1935 | # Nlfaultinjection |
| 1936 | # |
| 1937 | |
| 1938 | NL_WITH_OPTIONAL_INTERNAL_PACKAGE( |
| 1939 | [Nlfaultinjection], |
| 1940 | [NLFAULTINJECTION], |
| 1941 | [nlfaultinjection], |
| 1942 | [-lnlfaultinjection], |
| 1943 | [ |
| 1944 | # At this point, the internal nlfaultinjection package will be neither |
| 1945 | # configured nor built, so the normal checks we undertake for an |
| 1946 | # external package cannot be run here. Simply set the appropriate |
| 1947 | # variables and trust all will be well. |
| 1948 | |
| 1949 | NLFAULTINJECTION_CPPFLAGS="-I\${abs_top_srcdir}/third_party/nlfaultinjection/repo/include" |
| 1950 | NLFAULTINJECTION_LDFLAGS="-L${ac_pwd}/third_party/nlfaultinjection/repo/src" |
| 1951 | NLFAULTINJECTION_LIBS="-lnlfaultinjection" |
| 1952 | ], |
| 1953 | [ |
| 1954 | # Check for required nlfaultinjection headers. |
| 1955 | |
| 1956 | AC_LANG_PUSH([C++]) |
| 1957 | AC_CHECK_HEADERS([nlfaultinjection.hpp], |
| 1958 | [], |
| 1959 | [ |
| 1960 | AC_MSG_ERROR(The nlfaultinjection header "$ac_header" is required but cannot be found.) |
| 1961 | ]) |
| 1962 | AC_LANG_POP([C++]) |
| 1963 | ] |
| 1964 | ) |
| 1965 | |
| 1966 | # Depending on whether nlfaultinjection has been configured for an internal |
| 1967 | # location, its directory stem within this package needs to be set |
| 1968 | # accordingly. In addition, if the location is internal, then we need |
| 1969 | # to attempt to pull it down using the bootstrap makefile. |
| 1970 | |
| 1971 | if test "${nl_with_nlfaultinjection}" = "internal"; then |
| 1972 | maybe_nlfaultinjection_dirstem="nlfaultinjection/repo" |
| 1973 | nlfaultinjection_dirstem="third_party/${maybe_nlfaultinjection_dirstem}" |
| 1974 | |
| 1975 | AC_MSG_NOTICE([attempting to create internal ${nlfaultinjection_dirstem}]) |
| 1976 | |
| 1977 | ${MAKE-make} --no-print-directory -C ${srcdir} -f Makefile-bootstrap ${nlfaultinjection_dirstem} |
| 1978 | |
| 1979 | if test $? -ne 0; then |
| 1980 | AC_MSG_ERROR([failed to create ${nlfaultinjection_dirstem}. Please check your network connection or the correctness of 'repos.conf']) |
| 1981 | fi |
| 1982 | else |
| 1983 | maybe_nlfaultinjection_dirstem="" |
| 1984 | fi |
| 1985 | |
| 1986 | AC_SUBST(NLFAULTINJECTION_SUBDIRS, [${maybe_nlfaultinjection_dirstem}]) |
| 1987 | AM_CONDITIONAL([CHIP_WITH_NLFAULTINJECTION], [test "${nl_with_nlfaultinjection}" != "no"]) |
| 1988 | AM_CONDITIONAL([CHIP_WITH_NLFAULTINJECTION_INTERNAL], [test "${nl_with_nlfaultinjection}" = "internal"]) |
| 1989 | |
| 1990 | if test "${nl_with_nlfaultinjection}" = "no"; then |
Yufeng Wang | d3c22b9 | 2020-07-14 09:09:45 -0700 | [diff] [blame] | 1991 | AC_DEFINE([CHIP_WITH_NLFAULTINJECTION], [0], [Define to 0 to build CHIP without nlFaultInjection features]) |
Grant Erickson | 81bc570 | 2020-03-18 10:26:28 -0700 | [diff] [blame] | 1992 | else |
| 1993 | AC_DEFINE([CHIP_WITH_NLFAULTINJECTION], [1], [Define to 1 to build CHIP with nlFaultInjection features]) |
| 1994 | fi |
| 1995 | |
| 1996 | if test "${nl_cv_build_tests}" = "yes"; then |
| 1997 | if test "${nl_with_nlfaultinjection}" = "no"; then |
| 1998 | AC_MSG_ERROR(CHIP tests require nlfaultinjection.) |
| 1999 | fi |
| 2000 | fi |
| 2001 | |
Jiacheng Guo | 10be6f0 | 2020-07-08 13:46:03 +0800 | [diff] [blame] | 2002 | # |
| 2003 | # otbr-client |
| 2004 | # |
| 2005 | |
| 2006 | NL_WITH_OPTIONAL_INTERNAL_PACKAGE( |
| 2007 | [ot_br_posix], |
| 2008 | [OT_BR_POSIX], |
| 2009 | [ot_br_posix], |
| 2010 | [-lot_br_client], |
| 2011 | [ |
| 2012 | OT_BR_POSIX_CPPFLAGS="-I\${abs_top_srcdir}/third_party/ot-br-posix/repo/include/ -I\${abs_top_srcdir}/third_party/ot-br-posix/repo/src/" |
| 2013 | OT_BR_POSIX_LDFLAGS="-L${ac_pwd}/third_party/ot-br-posix/" |
| 2014 | OT_BR_POSIX_LIBS="-lot_br_client" |
| 2015 | ], |
| 2016 | [ |
| 2017 | # Check for required nlfaultinjection headers. |
| 2018 | AC_LANG_PUSH([C++]) |
| 2019 | AC_CHECK_HEADERS([dbus/client/thread_api_dbus.hpp], |
| 2020 | [], |
| 2021 | [ |
| 2022 | AC_MSG_ERROR(The OpenThread border router header "$ac_header" is required but cannot be found.) |
| 2023 | ]) |
| 2024 | AC_LANG_POP([C++]) |
| 2025 | ] |
| 2026 | ) |
| 2027 | |
| 2028 | AC_MSG_NOTICE("nl_with_ot_br_posix=${nl_with_ot_br_posix}") |
| 2029 | |
| 2030 | if test "${nl_with_ot_br_posix}" = "internal" && test "${with_device_layer}" = "linux"; then |
| 2031 | maybe_ot_br_posix_dirstem="ot-br-posix" |
| 2032 | ot_br_posix_dirstem="third_party/${maybe_ot_br_posix_dirstem}/repo" |
| 2033 | |
| 2034 | AC_MSG_NOTICE([attempting to create internal ${ot_br_posix_dirstem}]) |
| 2035 | |
| 2036 | ${MAKE-make} --no-print-directory -C ${srcdir} -f Makefile-bootstrap ${ot_br_posix_dirstem} |
| 2037 | |
| 2038 | if test $? -ne 0; then |
| 2039 | AC_MSG_ERROR([failed to create ${ot_br_posix_dirstem}. Please check your network connection or the correctness of 'repos.conf']) |
| 2040 | fi |
| 2041 | |
| 2042 | PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4) |
| 2043 | AC_SUBST([DBUS_CFLAGS]) |
| 2044 | AC_SUBST([DBUS_LIBS]) |
| 2045 | else |
| 2046 | maybe_ot_br_posix_dirstem= |
| 2047 | fi |
| 2048 | |
| 2049 | AC_SUBST(OT_BR_POSIX_SUBDIRS, [${maybe_ot_br_posix_dirstem}]) |
| 2050 | AM_CONDITIONAL([CHIP_WITH_OT_BR_POSIX], [test "${nl_with_ot_br_posix}" != "no"]) |
Grant Erickson | 81bc570 | 2020-03-18 10:26:28 -0700 | [diff] [blame] | 2051 | |
| 2052 | # |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2053 | # Nlunit-test |
| 2054 | # |
| 2055 | |
| 2056 | if test "${nl_cv_build_tests}" = "yes"; then |
| 2057 | NL_WITH_PACKAGE( |
| 2058 | [Nlunit-test], |
| 2059 | [NLUNIT_TEST], |
| 2060 | [nlunit_test], |
| 2061 | [-lnlunit-test], |
| 2062 | [ |
| 2063 | # At this point, the internal Nlunit-test package will be neither |
| 2064 | # configured nor built, so the normal checks we undertake for an |
| 2065 | # external package cannot be run here. Simply set the appropriate |
| 2066 | # variables and trust all will be well. |
| 2067 | |
| 2068 | NLUNIT_TEST_CPPFLAGS="-I\${abs_top_srcdir}/third_party/nlunit-test/repo/src" |
| 2069 | NLUNIT_TEST_LDFLAGS="-L${ac_pwd}/third_party/nlunit-test/repo/src" |
| 2070 | NLUNIT_TEST_LIBS="-lnlunit-test" |
| 2071 | ], |
| 2072 | [ |
| 2073 | # Check for required nlunit-test headers. |
| 2074 | |
| 2075 | AC_CHECK_HEADERS([nlunit-test.h], |
| 2076 | [], |
| 2077 | [ |
| 2078 | AC_MSG_ERROR(The nlunit-test header "$ac_header" is required but cannot be found.) |
| 2079 | ]) |
| 2080 | ]) |
| 2081 | fi |
| 2082 | |
| 2083 | # Depending on whether nlunit-test has been configured for an internal |
| 2084 | # location, its directory stem within this package needs to be set |
| 2085 | # accordingly. In addition, if the location is internal, then we need |
| 2086 | # to attempt to pull it down using the bootstrap makefile. |
| 2087 | |
| 2088 | if test "${nl_with_nlunit_test}" = "internal"; then |
| 2089 | maybe_nlunit_test_dirstem="nlunit-test/repo" |
| 2090 | nlunit_test_dirstem="third_party/${maybe_nlunit_test_dirstem}" |
| 2091 | |
| 2092 | AC_MSG_NOTICE([attempting to create internal ${nlunit_test_dirstem}]) |
| 2093 | |
| 2094 | ${MAKE-make} --no-print-directory -C ${srcdir} -f Makefile-bootstrap ${nlunit_test_dirstem} |
| 2095 | |
| 2096 | if test $? -ne 0; then |
| 2097 | AC_MSG_ERROR([failed to create ${nlunit_test_dirstem}. Please check your network connection or the correctness of 'repos.conf']) |
| 2098 | fi |
| 2099 | else |
| 2100 | maybe_nlunit_test_dirstem="" |
| 2101 | fi |
| 2102 | |
| 2103 | AC_SUBST(NLUNIT_TEST_SUBDIRS, [${maybe_nlunit_test_dirstem}]) |
| 2104 | AM_CONDITIONAL([CHIP_WITH_NLUNIT_TEST_INTERNAL], [test "${nl_with_nlunit_test}" = "internal"]) |
| 2105 | |
| 2106 | # |
Yufeng Wang | 92904f4 | 2020-06-15 13:46:29 -0700 | [diff] [blame] | 2107 | # |
| 2108 | # IniPP |
| 2109 | # |
| 2110 | |
| 2111 | if test "${CHIP_DEVICE_LAYER_TARGET_LINUX}" = 1; then |
| 2112 | NL_WITH_PACKAGE( |
| 2113 | [IniPP], |
| 2114 | [INIPP], |
| 2115 | [], |
| 2116 | [], |
| 2117 | [ |
| 2118 | INIPP_CPPFLAGS="-I\${abs_top_srcdir}/third_party/inipp/repo/inipp" |
| 2119 | ], |
| 2120 | [ |
| 2121 | # Check for required IniPP headers. |
| 2122 | |
| 2123 | AC_CHECK_HEADERS([inipp.h], |
| 2124 | [], |
| 2125 | [ |
| 2126 | AC_MSG_ERROR(The IniPP header "inipp.h" is required but cannot be found.) |
| 2127 | ]) |
| 2128 | ] |
| 2129 | ) |
| 2130 | fi |
| 2131 | |
| 2132 | # |
Yufeng Wang | bca8b6e | 2020-07-15 07:01:51 -0700 | [diff] [blame] | 2133 | # |
| 2134 | # GIO |
| 2135 | # |
| 2136 | |
Yufeng Wang | ec3de6e | 2020-07-31 10:36:39 -0700 | [diff] [blame] | 2137 | CHIP_ENABLE_GIO=0 |
| 2138 | |
Yufeng Wang | bca8b6e | 2020-07-15 07:01:51 -0700 | [diff] [blame] | 2139 | if test "${CHIP_DEVICE_LAYER_TARGET_LINUX}" = 1; then |
| 2140 | PKG_CHECK_MODULES([GIO], [gio-2.0]) |
| 2141 | |
| 2142 | # Check for GIO library is available. |
| 2143 | AC_CHECK_LIB([gio-2.0], [g_bus_get_sync], |
| 2144 | [ |
Yufeng Wang | ec3de6e | 2020-07-31 10:36:39 -0700 | [diff] [blame] | 2145 | CHIP_ENABLE_GIO=1 |
Yufeng Wang | bca8b6e | 2020-07-15 07:01:51 -0700 | [diff] [blame] | 2146 | AC_DEFINE([CHIP_WITH_GIO], [1], [Define to 1 to build CHIP with GIO]) |
| 2147 | ], |
| 2148 | [ |
Yufeng Wang | ec3de6e | 2020-07-31 10:36:39 -0700 | [diff] [blame] | 2149 | CHIP_ENABLE_GIO=0 |
Yufeng Wang | bca8b6e | 2020-07-15 07:01:51 -0700 | [diff] [blame] | 2150 | AC_DEFINE([CHIP_WITH_GIO], [0], [Define to 0 to build CHIP without GIO]) |
| 2151 | ] |
| 2152 | ) |
yunhanw-google | c0cde15 | 2020-07-29 06:33:50 -0700 | [diff] [blame] | 2153 | |
| 2154 | PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0]) |
| 2155 | |
| 2156 | AC_CHECK_PROG(GDBUSCODEGEN, gdbus-codegen, gdbus-codegen) |
Yufeng Wang | bca8b6e | 2020-07-15 07:01:51 -0700 | [diff] [blame] | 2157 | fi |
| 2158 | |
| 2159 | # |
Yufeng Wang | ec3de6e | 2020-07-31 10:36:39 -0700 | [diff] [blame] | 2160 | # |
| 2161 | # WPA |
| 2162 | # |
| 2163 | |
| 2164 | CONFIG_WIFI_PLATFORM_WPA=0 |
| 2165 | enable_chipwifi_wpa="no" |
| 2166 | |
| 2167 | # At this time, enable this only for linux, and only if the GIO package are installed. Currently, WiFi and Thread |
Rob Walker | b14e3e3 | 2020-08-20 13:59:22 -0700 | [diff] [blame] | 2168 | # are depending on the gdbus-internal configured by internal BLuez package. |
Yufeng Wang | ec3de6e | 2020-07-31 10:36:39 -0700 | [diff] [blame] | 2169 | # TODO: Refacrot BLuez to use common gdbus lib from GIO. |
| 2170 | |
| 2171 | if test "${with_device_layer}" = "linux" && test "${CHIP_ENABLE_GIO}" = 1 && test "${CONFIG_BLE_PLATFORM_BLUEZ}" = 1; then |
| 2172 | case "${target}" in |
| 2173 | *linux*) |
| 2174 | CONFIG_WIFI_PLATFORM_WPA=1 |
| 2175 | enable_chipwifi_wpa="yes" |
| 2176 | ;; |
| 2177 | *) |
| 2178 | CONFIG_WIFI_PLATFORM_WPA=0 |
| 2179 | enable_chipwifi_wpa="no" |
| 2180 | ;; |
| 2181 | esac |
| 2182 | fi |
| 2183 | |
| 2184 | AM_CONDITIONAL([CONFIG_WIFI_PLATFORM_WPA], [test "${enable_chipwifi_wpa}" = "yes"]) |
| 2185 | AC_DEFINE_UNQUOTED([CHIP_DEVICE_CONFIG_ENABLE_WPA],[${CONFIG_WIFI_PLATFORM_WPA}],[Define to 1 if you want to enable WPA support for wpa_supplicant.]) |
| 2186 | |
| 2187 | # |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2188 | # Sockets |
| 2189 | # |
| 2190 | |
| 2191 | # Influential external variables for BSD Sockets support |
| 2192 | |
| 2193 | AC_ARG_VAR(SOCKETS_CPPFLAGS, [BSD Sockets C preprocessor flags]) |
| 2194 | AC_ARG_VAR(SOCKETS_LDFLAGS, [BSD Sockets linker flags]) |
| 2195 | AC_ARG_VAR(SOCKETS_LIBS, [BSD Sockets linker libraries]) |
| 2196 | |
| 2197 | |
| 2198 | # |
| 2199 | # Check for headers |
| 2200 | # |
| 2201 | AC_HEADER_STDBOOL |
| 2202 | AC_HEADER_STDC |
| 2203 | |
| 2204 | AC_CHECK_HEADERS([ctype.h]) |
| 2205 | AC_CHECK_HEADERS([ifaddrs.h]) |
| 2206 | AC_CHECK_HEADERS([stdint.h]) |
| 2207 | AC_CHECK_HEADERS([stdlib.h]) |
| 2208 | AC_CHECK_HEADERS([string.h]) |
| 2209 | |
| 2210 | # Check for netinet/icmp6.h for ICMP6_FILTER support. Both Android and |
| 2211 | # Mac OS X fail to properly include both netinet/in.h and sys/types.h |
| 2212 | # in netinet/icmp6.h, making the check fail unless it exists and these |
| 2213 | # are both also included. |
| 2214 | |
| 2215 | AC_CHECK_HEADERS([netinet/in.h]) |
| 2216 | AC_CHECK_HEADERS([sys/types.h]) |
| 2217 | AC_CHECK_HEADERS([netinet/icmp6.h], [], [], |
| 2218 | [ |
| 2219 | #if HAVE_SYS_TYPES_H |
| 2220 | # include <sys/types.h> |
| 2221 | #endif |
| 2222 | #if HAVE_NETINET_IN_H |
| 2223 | # include <netinet/in.h> |
| 2224 | #endif |
| 2225 | ]) |
| 2226 | |
| 2227 | # But, wait, this still isn't enough. Even with all of that, Android |
| 2228 | # may still not have the ICMP6_FILTER socket option defined. Check for |
| 2229 | # that too. |
| 2230 | |
| 2231 | AC_MSG_CHECKING([whether netinet/icmp6.h declares ICMP6_FILTER]) |
| 2232 | AC_COMPILE_IFELSE([ |
| 2233 | AC_LANG_PROGRAM( |
| 2234 | [[ |
| 2235 | #if HAVE_SYS_TYPES_H |
| 2236 | # include <sys/types.h> |
| 2237 | #endif |
| 2238 | #if HAVE_NETINET_IN_H |
| 2239 | # include <netinet/in.h> |
| 2240 | #endif |
| 2241 | #if HAVE_NETINET_ICMP6_H |
| 2242 | # include <netinet/icmp6.h> |
| 2243 | #endif |
| 2244 | ]], |
| 2245 | [[ |
| 2246 | #if !defined(ICMP6_FILTER) |
| 2247 | # error "ICMP6_FILTER is not defined" |
| 2248 | #endif |
| 2249 | ]])], |
| 2250 | [ |
| 2251 | AC_MSG_RESULT([yes]) |
| 2252 | AC_DEFINE(HAVE_ICMP6_FILTER, 1, [Define to 1 if your <netinet/icmp6.h> header file defines the ICMP6_FILTER socket option.]) |
| 2253 | ], |
| 2254 | [ |
| 2255 | AC_MSG_RESULT([no]) |
| 2256 | ]) |
| 2257 | |
| 2258 | # Check for sys/socket.h for SO_BINDTODEVICE support. |
| 2259 | |
| 2260 | AC_CHECK_HEADERS([sys/socket.h]) |
| 2261 | |
| 2262 | AC_MSG_CHECKING([whether sys/socket.h declares SO_BINDTODEVICE]) |
| 2263 | AC_COMPILE_IFELSE([ |
| 2264 | AC_LANG_PROGRAM( |
| 2265 | [[ |
| 2266 | #if HAVE_SYS_SOCKET_H |
| 2267 | # include <sys/socket.h> |
| 2268 | #endif |
| 2269 | ]], |
| 2270 | [[ |
| 2271 | #if !defined(SO_BINDTODEVICE) |
| 2272 | # error "SO_BINDTODEVICE is not defined" |
| 2273 | #endif |
| 2274 | ]])], |
| 2275 | [ |
| 2276 | AC_MSG_RESULT([yes]) |
| 2277 | AC_DEFINE(HAVE_SO_BINDTODEVICE, 1, [Define to 1 if your <sys/socket.h> header file defines the SO_BINDTODEVICE socket option.]) |
| 2278 | ], |
| 2279 | [ |
| 2280 | AC_MSG_RESULT([no]) |
| 2281 | ]) |
| 2282 | |
| 2283 | # Check for sys/sockio.h |
| 2284 | AC_CHECK_HEADERS([sys/sockio.h]) |
| 2285 | |
| 2286 | # |
| 2287 | # Check for types and structures |
| 2288 | # |
| 2289 | AC_TYPE_INT8_T |
| 2290 | AC_TYPE_INT16_T |
| 2291 | AC_TYPE_INT32_T |
| 2292 | AC_TYPE_INT64_T |
| 2293 | AC_TYPE_UINT8_T |
| 2294 | AC_TYPE_UINT16_T |
| 2295 | AC_TYPE_UINT32_T |
| 2296 | AC_TYPE_UINT64_T |
| 2297 | |
| 2298 | # |
| 2299 | # Checks for library functions |
| 2300 | # |
| 2301 | |
| 2302 | CONFIG_HAVE_HEAP=0 |
| 2303 | |
| 2304 | if test "${ac_no_link}" != "yes"; then |
| 2305 | # Check for stdlib memory management functions. |
| 2306 | AC_CHECK_FUNCS([malloc free realloc strdup], [CONFIG_HAVE_HEAP=1], [CONFIG_HAVE_HEAP=0]) |
| 2307 | AC_CHECK_FUNCS([memchr memcmp memmove memset]) |
| 2308 | AC_CHECK_FUNCS([strchr strcmp strlen]) |
| 2309 | AC_CHECK_FUNCS([snprintf]) |
| 2310 | |
| 2311 | # Some versions of Android are missing getifaddrs and |
| 2312 | # freeifaddrs. Check to see if the target system is such a version. |
| 2313 | |
| 2314 | AC_CHECK_FUNCS([getifaddrs freeifaddrs]) |
| 2315 | |
| 2316 | # Check for clock_gettime, gettimeofday, settimeofday and localtime. |
| 2317 | # In some target environments, clock_gettime exists in librt. |
| 2318 | |
| 2319 | AC_SEARCH_LIBS([clock_gettime], [rt]) |
| 2320 | AC_CHECK_FUNCS([clock_gettime gettimeofday localtime]) |
| 2321 | AC_CHECK_HEADERS([time.h sys/time.h]) |
| 2322 | AC_CHECK_TYPES([clockid_t], [], [], [[#include <time.h>]]) |
| 2323 | |
| 2324 | # Check for clock_settime. This function exists on iOS, however the compiler prevents |
| 2325 | # reference to it via the use of an "unavailable" attribute. Unfortunately, this goes |
| 2326 | # unnoticed by autoconf's AC_CHECK_FUNCS macro, hence the need for custom detection code. |
| 2327 | |
| 2328 | AC_SEARCH_LIBS([clock_settime], [rt]) |
| 2329 | AC_MSG_CHECKING([clock_settime]) |
| 2330 | AC_LINK_IFELSE( |
| 2331 | [AC_LANG_SOURCE([[ |
| 2332 | #include <stdlib.h> |
| 2333 | #include <time.h> |
| 2334 | int main(int argc, char *argv[]) |
| 2335 | { |
| 2336 | clock_settime(CLOCK_REALTIME, NULL); |
| 2337 | return 0; |
| 2338 | } |
| 2339 | ]])], |
| 2340 | [AC_DEFINE([HAVE_CLOCK_SETTIME], [1], [Define to 1 if you have the `clock_settime' function.]) AC_MSG_RESULT([yes])], |
| 2341 | [AC_MSG_RESULT([no])] |
Sagar Dhawan | ba5eacf | 2020-03-23 13:49:10 -0700 | [diff] [blame] | 2342 | ) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2343 | |
| 2344 | # Note that different platforms have different APIs for monotonic timer with sleep time compensation. |
| 2345 | # CLOCK_BOOTTIME is available in later versions of linux and Android |
| 2346 | |
| 2347 | AC_CHECK_DECLS([CLOCK_MONOTONIC, CLOCK_BOOTTIME], [], [], [[#include <time.h>]]) |
| 2348 | fi |
| 2349 | |
| 2350 | AC_SUBST(CONFIG_HAVE_HEAP) |
| 2351 | AM_CONDITIONAL([CONFIG_HAVE_HEAP], [test "${CONFIG_HAVE_HEAP}" = "1"]) |
| 2352 | |
| 2353 | # |
| 2354 | # Check for POSIX thread (pthread) support |
| 2355 | # |
| 2356 | AX_PTHREAD([], []) |
| 2357 | |
| 2358 | AC_CHECK_DECL([PTHREAD_NULL], [], [AC_DEFINE([PTHREAD_NULL],[0], [Approximation of PTHREAD_NULL since pthread.h does not define one])], |
| 2359 | [[#include <pthread.h>]]) |
| 2360 | |
| 2361 | # |
Vivien Nicolas | 7962596 | 2020-06-19 00:28:26 +0200 | [diff] [blame] | 2362 | # Check for Network.framework |
| 2363 | # |
| 2364 | if test "${CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK}" = "1"; then |
| 2365 | AC_CHECK_HEADER([Network/Network.h]) |
| 2366 | LDFLAGS="${LDFLAGS} -lnetwork" |
| 2367 | fi |
| 2368 | |
| 2369 | # |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2370 | # Check for <new> |
| 2371 | # |
| 2372 | AC_LANG_PUSH([C++]) |
| 2373 | |
| 2374 | AC_CHECK_HEADERS([new]) |
| 2375 | |
| 2376 | AC_LANG_POP([C++]) |
| 2377 | |
| 2378 | |
| 2379 | # Add test enabled macro |
| 2380 | if test "${nl_cv_build_tests}" = "yes"; then |
| 2381 | CPPFLAGS="${CPPFLAGS} -DNL_CHIP_WITH_TESTS" |
| 2382 | CPPFLAGS="${CPPFLAGS} -DCHIP_CONFIG_TEST=1" |
| 2383 | CPPFLAGS="${CPPFLAGS} -DCHIP_SYSTEM_CONFIG_TEST=1" |
| 2384 | CPPFLAGS="${CPPFLAGS} -DCHIP_SYSTEM_CONFIG_PROVIDE_STATISTICS=1" |
| 2385 | if test ${CONFIG_NETWORK_LAYER_INET} = 1; then |
| 2386 | CPPFLAGS="${CPPFLAGS} -DINET_CONFIG_TEST=1" |
| 2387 | fi |
| 2388 | fi |
| 2389 | |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 2390 | # Add any crypto-implementation CPPFLAGS, LDFLAGS, and LIBS |
Rob Walker | ae3a900 | 2020-04-15 13:48:47 -0700 | [diff] [blame] | 2391 | |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 2392 | CRYPTO_CPPFLAGS="${CRYPTO_CPPFLAGS} ${MBEDTLS_CPPFLAGS} ${OPENSSL_CPPFLAGS}" |
| 2393 | CRYPTO_LDFLAGS="${CRYPTO_LDFLAGS} ${MBEDTLS_LDFLAGS} ${OPENSSL_LDFLAGS}" |
| 2394 | CRYPTO_LIBS="${CRYPTO_LIBS} ${MBEDTLS_LIBS} ${OPENSSL_LIBS}" |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2395 | |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 2396 | AC_SUBST(CRYPTO_CPPFLAGS) |
| 2397 | AC_SUBST(CRYPTO_LDFLAGS) |
| 2398 | AC_SUBST(CRYPTO_LIBS) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2399 | |
Yakun Xu | 47f325f | 2020-07-15 00:10:33 +0800 | [diff] [blame] | 2400 | CPPFLAGS="${CPPFLAGS} ${CRYPTO_CPPFLAGS} ${OPENTHREAD_CPPFLAGS}" |
| 2401 | LDFLAGS="${LDFLAGS} ${CRYPTO_LDFLAGS} ${OPENTHREAD_LDFLAGS}" |
| 2402 | LIBS="${LIBS} ${CRYPTO_LIBS} ${OPENTHREAD_LIBS}" |
Pankaj Garg | 139d43b | 2020-04-15 19:04:57 -0700 | [diff] [blame] | 2403 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2404 | # Add any code coverage CPPFLAGS, LDFLAGS, and LIBS |
| 2405 | |
| 2406 | CPPFLAGS="${CPPFLAGS} ${NL_COVERAGE_CPPFLAGS}" |
| 2407 | LDFLAGS="${LDFLAGS} ${NL_COVERAGE_LDFLAGS}" |
| 2408 | LIBS="${LIBS} ${NL_COVERAGE_LIBS}" |
| 2409 | |
| 2410 | # Fold in the warning-as-errors flag, unless it was already in effect. |
| 2411 | |
| 2412 | if test "${nl_had_CPPFLAGS_werror}" = "no"; then |
| 2413 | CPPFLAGS="${CPPFLAGS} ${NL_WERROR_CPPFLAGS}" |
| 2414 | fi |
| 2415 | |
Rob Walker | ae3a900 | 2020-04-15 13:48:47 -0700 | [diff] [blame] | 2416 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2417 | # At this point, we can restore the compiler flags to whatever the |
| 2418 | # user passed in, now that we're clear of an -Werror issues by |
| 2419 | # transforming -Wno-error back to -Werror. |
| 2420 | |
| 2421 | NL_RESTORE_WERROR |
| 2422 | |
| 2423 | # |
| 2424 | # Code style |
| 2425 | # |
| 2426 | |
Rob Walker | 1826e1d | 2020-04-23 13:55:34 -0700 | [diff] [blame] | 2427 | AC_SUBST(PRETTY, ["\${abs_top_srcdir}/scripts/helpers/clang-format.sh"]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2428 | AC_SUBST(PRETTY_ARGS, ["-style=file -i"]) |
Rob Walker | 1826e1d | 2020-04-23 13:55:34 -0700 | [diff] [blame] | 2429 | AC_SUBST(PRETTY_CHECK, ["\${abs_top_srcdir}/scripts/helpers/clang-format-check.sh"]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2430 | AC_SUBST(PRETTY_CHECK_ARGS, [""]) |
| 2431 | |
| 2432 | # Configure any autotools-based subdirectories |
| 2433 | if test "${nl_with_nlunit_test}" = "internal"; then |
| 2434 | AC_CONFIG_SUBDIRS([third_party/nlunit-test/repo]) |
Grant Erickson | f48c08e | 2020-04-28 11:42:15 -0700 | [diff] [blame] | 2435 | AC_SUBST(NLUNIT_TEST_FOREIGN_SUBDIR_DEPENDENCY,["${ac_pwd}/third_party/nlunit-test/repo/src"]) |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2436 | fi |
| 2437 | |
| 2438 | if test "${nl_with_nlio}" = "internal"; then |
| 2439 | AC_CONFIG_SUBDIRS([third_party/nlio/repo]) |
| 2440 | fi |
| 2441 | |
| 2442 | if test "${nl_with_nlassert}" = "internal"; then |
| 2443 | AC_CONFIG_SUBDIRS([third_party/nlassert/repo]) |
Pankaj Garg | 5f7b952 | 2020-04-18 16:58:54 -0700 | [diff] [blame] | 2444 | fi |
| 2445 | |
Grant Erickson | 81bc570 | 2020-03-18 10:26:28 -0700 | [diff] [blame] | 2446 | if test "${nl_with_nlfaultinjection}" = "internal"; then |
| 2447 | AC_CONFIG_SUBDIRS([third_party/nlfaultinjection/repo]) |
Grant Erickson | 9299bd3 | 2020-05-13 10:08:01 -0700 | [diff] [blame] | 2448 | AC_SUBST(NLFAULTINJECTION_FOREIGN_SUBDIR_DEPENDENCY,["${ac_pwd}/third_party/nlfaultinjection/repo/src"]) |
Rob Walker | 1eef6cf | 2020-04-20 18:16:12 -0700 | [diff] [blame] | 2449 | fi |
| 2450 | |
yunhanw-google | e1d448c | 2020-07-21 11:57:53 -0700 | [diff] [blame] | 2451 | if test "${nl_with_bluez}" = "internal" && test "${enable_chipoble_bluez}" = "yes"; then |
| 2452 | AC_CONFIG_SUBDIRS([third_party/bluez/repo]) |
| 2453 | fi |
| 2454 | |
Rob Walker | 1eef6cf | 2020-04-20 18:16:12 -0700 | [diff] [blame] | 2455 | if test "${nl_with_mbedtls}" = "internal"; then |
| 2456 | AC_CONFIG_SUBDIRS([third_party/mbedtls/repo]) |
Grant Erickson | 81bc570 | 2020-03-18 10:26:28 -0700 | [diff] [blame] | 2457 | fi |
| 2458 | |
Grant Erickson | 9299bd3 | 2020-05-13 10:08:01 -0700 | [diff] [blame] | 2459 | if test "${nl_with_lwip}" = "internal"; then |
| 2460 | AC_SUBST(LWIP_FOREIGN_SUBDIR_DEPENDENCY,["${ac_pwd}/src/lwip"]) |
| 2461 | fi |
| 2462 | |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2463 | # |
| 2464 | # Identify the various makefiles and auto-generated files for the package |
| 2465 | # |
| 2466 | AC_CONFIG_FILES([ |
| 2467 | Makefile |
Martin Turon | e4c92e1 | 2020-05-13 10:36:33 -0700 | [diff] [blame] | 2468 | docs/Makefile |
Martin Turon | ef904ab | 2020-04-20 18:15:33 -0700 | [diff] [blame] | 2469 | examples/Makefile |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2470 | third_party/Makefile |
| 2471 | third_party/lwip/Makefile |
Grant Erickson | a353a45 | 2020-04-24 08:39:46 -0700 | [diff] [blame] | 2472 | third_party/mbedtls/Makefile |
Jiacheng Guo | 10be6f0 | 2020-07-08 13:46:03 +0800 | [diff] [blame] | 2473 | third_party/ot-br-posix/Makefile |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2474 | src/Makefile |
Grant Erickson | df249095 | 2020-04-03 14:25:30 -0700 | [diff] [blame] | 2475 | src/include/Makefile |
Rob Walker | 06724df | 2020-05-26 11:09:01 -0700 | [diff] [blame] | 2476 | src/app/Makefile |
Boris Zbarsky | 3c021ad | 2020-08-07 14:15:22 -0400 | [diff] [blame] | 2477 | src/app/clusters/Makefile |
Boris Zbarsky | 3c021ad | 2020-08-07 14:15:22 -0400 | [diff] [blame] | 2478 | src/app/util/Makefile |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2479 | src/ble/Makefile |
Grant Erickson | 5f1fe83 | 2020-04-03 10:56:51 -0700 | [diff] [blame] | 2480 | src/ble/tests/Makefile |
Vidhi Shah | 4a9410e | 2020-07-29 11:47:11 -0700 | [diff] [blame] | 2481 | src/controller/java/Makefile |
Bhaskar Sarma | 242d171 | 2020-04-01 15:49:17 -0700 | [diff] [blame] | 2482 | src/crypto/Makefile |
| 2483 | src/crypto/tests/Makefile |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2484 | src/lwip/Makefile |
| 2485 | src/lwip/tests/Makefile |
| 2486 | src/system/Makefile |
| 2487 | src/system/tests/Makefile |
Martin Turon | 9389ebe | 2020-03-16 22:00:38 -0700 | [diff] [blame] | 2488 | src/setup_payload/Makefile |
Vidhi Shah | 92fda7c | 2020-07-07 07:47:51 -0700 | [diff] [blame] | 2489 | src/setup_payload/java/Makefile |
Martin Turon | 9389ebe | 2020-03-16 22:00:38 -0700 | [diff] [blame] | 2490 | src/setup_payload/tests/Makefile |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2491 | src/inet/Makefile |
Grant Erickson | 8e58336 | 2020-03-31 10:40:56 -0700 | [diff] [blame] | 2492 | src/inet/tests/Makefile |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2493 | src/lib/Makefile |
Grant Erickson | 5f1fe83 | 2020-04-03 10:56:51 -0700 | [diff] [blame] | 2494 | src/lib/core/tests/Makefile |
Martin Turon | 6f6c6d8 | 2020-06-10 10:10:10 -0700 | [diff] [blame] | 2495 | src/lib/shell/Makefile |
| 2496 | src/lib/shell/tests/Makefile |
Grant Erickson | d30c230 | 2020-04-01 11:33:22 -0700 | [diff] [blame] | 2497 | src/lib/support/Makefile |
Grant Erickson | 9189b87 | 2020-04-02 10:49:27 -0700 | [diff] [blame] | 2498 | src/lib/support/tests/Makefile |
Pankaj Garg | 73f9cdc | 2020-03-23 15:47:39 -0700 | [diff] [blame] | 2499 | src/platform/Makefile |
Martin Turon | 0c03fa8 | 2020-05-26 15:43:11 -0700 | [diff] [blame] | 2500 | src/platform/tests/Makefile |
shana-apple | ab8ffd5 | 2020-05-20 18:25:29 +0200 | [diff] [blame] | 2501 | src/qrcodetool/Makefile |
Andrei Litvin | 343b5ad | 2020-05-27 16:29:50 -0400 | [diff] [blame] | 2502 | src/transport/Makefile |
| 2503 | src/transport/tests/Makefile |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2504 | ]) |
| 2505 | |
| 2506 | # |
| 2507 | # Generate the auto-generated files for the package |
| 2508 | # |
| 2509 | AC_OUTPUT |
| 2510 | |
| 2511 | # |
| 2512 | # Summarize the package configuration |
| 2513 | # |
| 2514 | |
| 2515 | AC_MSG_NOTICE([ |
| 2516 | |
| 2517 | Configuration Summary |
| 2518 | --------------------- |
| 2519 | Package : ${PACKAGE_NAME} |
| 2520 | Version : ${PACKAGE_VERSION} |
| 2521 | Interface : ${LIBCHIP_VERSION_INFO//:/.} |
| 2522 | Build system : ${build} |
| 2523 | Host system : ${host} |
| 2524 | Target system : ${target} |
| 2525 | Target architecture : ${target_cpu} |
| 2526 | Target OS : ${target_os} |
| 2527 | Target style : ${CHIP_TARGET_STYLE} |
Martin Turon | 0c03fa8 | 2020-05-26 15:43:11 -0700 | [diff] [blame] | 2528 | Device layer : ${CHIP_DEVICE_LAYER_TARGET} |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 2529 | Cryptographic implementation : ${CHIP_CRYPTO} |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2530 | Target network layer : ${with_network_layer} |
| 2531 | Target network system(s) : ${CONFIG_TARGET_NETWORKS} |
| 2532 | IPv4 enabled : ${enable_ipv4} |
| 2533 | Internet endpoint(s) : ${INET_ENDPOINTS} |
| 2534 | Printf enhancements : ${CHIP_ENHANCED_PRINTF} |
| 2535 | Android support : ${with_android} |
| 2536 | Logging style : ${CHIP_LOGGING_STYLE} |
| 2537 | Cross compiling : ${cross_compiling} |
| 2538 | Build shared libraries : ${enable_shared} |
| 2539 | Build static libraries : ${enable_static} |
| 2540 | Build debug libraries : ${nl_cv_build_debug} |
| 2541 | Build profile libraries : ${build_profile} |
| 2542 | Build optimized libraries : ${nl_cv_build_optimized} |
| 2543 | Build coverage libraries : ${nl_cv_build_coverage} |
| 2544 | Build coverage reports : ${nl_cv_build_coverage_reports} |
| 2545 | Lcov : ${LCOV:--} |
| 2546 | Genhtml : ${GENHTML:--} |
Grant Erickson | 6d7428b | 2020-05-11 16:31:38 -0700 | [diff] [blame] | 2547 | Happy : ${with_happy} |
| 2548 | Happy Path : ${happy_path} |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2549 | Treat warnings as errors : ${nl_cv_warnings_as_errors} |
| 2550 | Build tests : ${nl_cv_build_tests} |
| 2551 | Build long running tests : ${nl_cv_build_long_tests} |
| 2552 | Build tools : ${build_tools} |
| 2553 | Tunnel Failover support : ${build_tunnel_failover} |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2554 | Prefix : ${prefix} |
| 2555 | Shadow directory program : ${LNDIR} |
| 2556 | Cocoa support : ${enable_cocoa} |
| 2557 | Java support : ${enable_java} |
| 2558 | Java home : ${JAVA_HOME:--} |
| 2559 | Java Compiler : ${JAVAC:--} |
| 2560 | Java Native Interface (JNI) compile flags : ${JNI_CPPFLAGS:--} |
| 2561 | Java Archiver : ${JAR:--} |
| 2562 | Python executable : ${PYTHON:--} |
| 2563 | Python version : ${PYTHON_VERSION:--} |
| 2564 | Python script directory : ${pythondir:--} |
| 2565 | Python extension directory : ${pyexecdir:--} |
| 2566 | Verhoeff support : ${enable_verhoeff} |
| 2567 | Pairing code decoding support : ${enable_pairing_code_decoding} |
| 2568 | Documentation support : ${nl_cv_build_docs} |
| 2569 | Clang-format : ${CLANG_FORMAT:--} |
| 2570 | Doxygen : ${DOXYGEN:--} |
| 2571 | GraphViz dot : ${DOT:--} |
| 2572 | PERL : ${PERL:--} |
yunhanw-google | e1d448c | 2020-07-21 11:57:53 -0700 | [diff] [blame] | 2573 | CHIP over BlueZ support : ${enable_chipoble_bluez:--} |
| 2574 | BlueZ source : ${nl_with_bluez:--} |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2575 | Valgrind : ${VALGRIND:--} |
| 2576 | LwIP source : ${nl_with_lwip:--} |
| 2577 | LwIP compile flags : ${LWIP_CPPFLAGS:--} |
| 2578 | LwIP link flags : ${LWIP_LDFLAGS:--} |
| 2579 | LwIP link libraries : ${LWIP_LIBS:--} |
Grant Erickson | 9299bd3 | 2020-05-13 10:08:01 -0700 | [diff] [blame] | 2580 | LwIP foreign subdirectory dependency : ${LWIP_FOREIGN_SUBDIR_DEPENDENCY:--} |
Grant Erickson | a353a45 | 2020-04-24 08:39:46 -0700 | [diff] [blame] | 2581 | mbedTLS source : ${nl_with_mbedtls:--} |
Pankaj Garg | 139d43b | 2020-04-15 19:04:57 -0700 | [diff] [blame] | 2582 | mbedTLS compile flags : ${MBEDTLS_CPPFLAGS:--} |
| 2583 | mbedTLS link flags : ${MBEDTLS_LDFLAGS:--} |
| 2584 | mbedTLS link libraries : ${MBEDTLS_LIBS:--} |
Yakun Xu | 47f325f | 2020-07-15 00:10:33 +0800 | [diff] [blame] | 2585 | OpenThread source : ${nl_with_openthread} |
| 2586 | OpenThread compile flags : ${OPENTHREAD_CPPFLAGS:--} |
| 2587 | OpenThread link flags : ${OPENTHREAD_LDFLAGS:--} |
| 2588 | OpenThread link libraries : ${OPENTHREAD_LIBS:--} |
Pankaj Garg | 5daed72 | 2020-04-20 16:55:31 -0700 | [diff] [blame] | 2589 | OpenSSL source : ${nl_with_openssl} |
| 2590 | OpenSSL compile flags : ${OPENSSL_CPPFLAGS:--} |
| 2591 | OpenSSL link flags : ${OPENSSL_LDFLAGS:--} |
| 2592 | OpenSSL link libraries : ${OPENSSL_LIBS:--} |
| 2593 | Crypto implementation compile flags : ${CRYPTO_CPPFLAGS:--} |
| 2594 | Crypto implementation link flags : ${CRYPTO_LDFLAGS:--} |
| 2595 | Crypto implementation link libraries : ${CRYPTO_LIBS:--} |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2596 | Nlunit-test source : ${nl_with_nlunit_test:--} |
| 2597 | Nlunit-test compile flags : ${NLUNIT_TEST_CPPFLAGS:--} |
| 2598 | Nlunit-test link flags : ${NLUNIT_TEST_LDFLAGS:--} |
| 2599 | Nlunit-test link libraries : ${NLUNIT_TEST_LIBS:--} |
Grant Erickson | f48c08e | 2020-04-28 11:42:15 -0700 | [diff] [blame] | 2600 | Nlunit-test foreign subdirectory dependency : ${NLUNIT_TEST_FOREIGN_SUBDIR_DEPENDENCY:--} |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2601 | Nlio source : ${nl_with_nlio:--} |
| 2602 | Nlio compile flags : ${NLIO_CPPFLAGS:--} |
| 2603 | Nlio link flags : ${NLIO_LDFLAGS:--} |
| 2604 | Nlio link libraries : ${NLIO_LIBS:--} |
| 2605 | Nlassert source : ${nl_with_nlassert:--} |
| 2606 | Nlassert compile flags : ${NLASSERT_CPPFLAGS:--} |
| 2607 | Nlassert link flags : ${NLASSERT_LDFLAGS:--} |
| 2608 | Nlassert link libraries : ${NLASSERT_LIBS:--} |
| 2609 | Nlfaultinjection source : ${nl_with_nlfaultinjection:--} |
| 2610 | Nlfaultinjection compile flags : ${NLFAULTINJECTION_CPPFLAGS:--} |
| 2611 | Nlfaultinjection link flags : ${NLFAULTINJECTION_LDFLAGS:--} |
| 2612 | Nlfaultinjection link libraries : ${NLFAULTINJECTION_LIBS:--} |
Grant Erickson | f48c08e | 2020-04-28 11:42:15 -0700 | [diff] [blame] | 2613 | Nlfaultinjection foreign subdirectory dependency : ${NLFAULTINJECTION_FOREIGN_SUBDIR_DEPENDENCY:--} |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2614 | Sockets compile flags : ${SOCKETS_CPPFLAGS:--} |
| 2615 | Sockets link flags : ${SOCKETS_LDFLAGS:--} |
| 2616 | Sockets link libraries : ${SOCKETS_LIBS:--} |
| 2617 | PThreads compile flags : ${PTHREAD_CFLAGS:--} |
| 2618 | PThreads link libraries : ${PTHREAD_LIBS:--} |
Yufeng Wang | 92904f4 | 2020-06-15 13:46:29 -0700 | [diff] [blame] | 2619 | IniPP compile flags : ${INIPP_CPPFLAGS:--} |
Yufeng Wang | bca8b6e | 2020-07-15 07:01:51 -0700 | [diff] [blame] | 2620 | GIO compile flags : ${GIO_CFLAGS:--} |
Vivien Nicolas | 0320920 | 2020-07-21 20:57:37 +0200 | [diff] [blame] | 2621 | GIO link flags : ${GIO_LIBS:--} |
yunhanw-google | c0cde15 | 2020-07-29 06:33:50 -0700 | [diff] [blame] | 2622 | GIO UNIX compile flags : ${GIO_UNIX_CFLAGS:--} |
| 2623 | GIO UNIX link flags : ${GIO_UNIX_LIBS:--} |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2624 | C Preprocessor : ${CPP} |
| 2625 | C Compiler : ${CC} |
| 2626 | C++ Preprocessor : ${CXXCPP} |
| 2627 | C++ Compiler : ${CXX} |
| 2628 | Objective C Compiler : ${OBJC:--} |
| 2629 | Objective C++ Compiler : ${OBJCXX:--} |
| 2630 | Archiver : ${AR} |
| 2631 | Archive Indexer : ${RANLIB} |
| 2632 | Symbol Stripper : ${STRIP} |
| 2633 | Object Copier : ${OBJCOPY} |
| 2634 | C Preprocessor flags : ${CPPFLAGS:--} |
| 2635 | C Compile flags : ${CFLAGS:--} |
| 2636 | C++ Compile flags : ${CXXFLAGS:--} |
| 2637 | Objective C Compile flags : ${OBJCFLAGS:--} |
| 2638 | Objective C++ Compile flags : ${OBJCXXFLAGS:--} |
| 2639 | Symbol Visibility C Compile flags : ${VISIBILITY_CFLAGS:--} |
| 2640 | Symbol Visibility C++ Compile flags : ${VISIBILITY_CXXFLAGS:--} |
| 2641 | Symbol Visibility Objective C Compile flags : ${VISIBILITY_OBJCFLAGS:--} |
| 2642 | Symbol Visibility Objective C++ Compile flags : ${VISIBILITY_OBJCXXFLAGS:--} |
| 2643 | Link flags : ${LDFLAGS:--} |
| 2644 | Link libraries : ${LIBS} |
| 2645 | Fuzzing Enabled : ${enable_fuzzing} |
Martin Turon | ba1a028 | 2020-03-10 19:25:02 -0700 | [diff] [blame] | 2646 | ]) |