Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle Add configuration support for mbedTLS #370

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ CHIP_CHECK_PROJECT_CONFIG_INCLUDES(chip-project-includes, CHIP_PROJECT_CONFIG_IN

# Device Layer

if test "${CONFIG_DEVICE_LAYER}" = 1; then
if test "${CONFIG_DEVICE_LAYER}" = 1; then
CHIP_CHECK_PROJECT_CONFIG_INCLUDES(chip-device-project-includes, CHIP_DEVICE_PROJECT_CONFIG_INCLUDE, CHIPDeviceProjectConfig.h, CHIP Device Layer,)
fi

Expand Down Expand Up @@ -1354,6 +1354,36 @@ else
AC_DEFINE([CHIP_WITH_OPENSSL], [1], [Define to 1 to build CHIP with OpenSSL features])
fi

#
#
# mbedTLS
#

NL_WITH_OPTIONAL_EXTERNAL_PACKAGE([mbedTLS],
[MBEDTLS],
[mbedtls],
[-lmbedtls],
[
# Check for required mbedTLS headers.

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],

[],
[
AC_MSG_ERROR(The mbedTLS header "$ac_header" is required but cannot be found.)
]
)
]
)

AM_CONDITIONAL([CHIP_WITH_MBEDTLS], [test "${nl_with_mbedtls}" != "no"])

if test "${nl_with_mbedtls}" = "no"; then
AC_DEFINE([CHIP_WITH_MBEDTLS], [0], [Define to 1 to build CHIP with mbedTLS features])
else
AC_DEFINE([CHIP_WITH_MBEDTLS], [1], [Define to 1 to build CHIP with mbedTLS features])
fi

#
# LwIP
#
Expand Down Expand Up @@ -1790,6 +1820,12 @@ CPPFLAGS="${CPPFLAGS} ${OPENSSL_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${OPENSSL_LDFLAGS}"
LIBS="${LIBS} ${OPENSSL_LIBS}"

# Add any mbedTLS CPPFLAGS, LDFLAGS, and LIBS

CPPFLAGS="${CPPFLAGS} ${MBEDTLS_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${MBEDTLS_LDFLAGS}"
LIBS="${LIBS} ${MBEDTLS_LIBS}"

# Add any nlunit-test CPPFLAGS, LDFLAGS, and LIBS

CPPFLAGS="${CPPFLAGS} ${NLUNIT_TEST_CPPFLAGS}"
Expand Down Expand Up @@ -1961,6 +1997,10 @@ AC_MSG_NOTICE([
OpenSSL compile flags : ${OPENSSL_CPPFLAGS:--}
OpenSSL link flags : ${OPENSSL_LDFLAGS:--}
OpenSSL link libraries : ${OPENSSL_LIBS:--}
mbedTLS source : ${nl_with_mbedtls}
mbedTLS compile flags : ${MBEDTLS_CPPFLAGS:--}
mbedTLS link flags : ${MBEDTLS_LDFLAGS:--}
mbedTLS link libraries : ${MBEDTLS_LIBS:--}
Nlunit-test source : ${nl_with_nlunit_test:--}
Nlunit-test compile flags : ${NLUNIT_TEST_CPPFLAGS:--}
Nlunit-test link flags : ${NLUNIT_TEST_LDFLAGS:--}
Expand Down