Skip to content

Commit

Permalink
Make Handling of the mbedTLS Make File Non-Unique (#483)
Browse files Browse the repository at this point in the history
* Always configure the mbedTLS make file; migrate conditional behavior to the make file itself.

* Ensure that mbedtls is always captured in the distribution so that the Makefile.am is picked up.

* Add missed ':--' for nl_with_mbedtls in configuration summary.

* Qualify mbedTLS sources with 'nodist_'.

Never include the mbedTLS sources in a distribution; they always will get pulled from upstream via git operations.
  • Loading branch information
gerickson authored Apr 24, 2020
1 parent db1cf59 commit a353a45
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 2 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,7 @@ Makefile
examples/Makefile
third_party/Makefile
third_party/lwip/Makefile
third_party/mbedtls/Makefile
src/Makefile
src/include/Makefile
src/ble/Makefile
Expand All @@ -2018,10 +2019,6 @@ src/platform/Makefile
tests/Makefile
])

if test "${nl_with_mbedtls}" = "internal"; then
AC_CONFIG_FILES([third_party/mbedtls/Makefile])
fi

#
# Generate the auto-generated files for the package
#
Expand Down Expand Up @@ -2093,7 +2090,7 @@ AC_MSG_NOTICE([
LwIP compile flags : ${LWIP_CPPFLAGS:--}
LwIP link flags : ${LWIP_LDFLAGS:--}
LwIP link libraries : ${LWIP_LIBS:--}
mbedTLS source : ${nl_with_mbedtls}
mbedTLS source : ${nl_with_mbedtls:--}
mbedTLS compile flags : ${MBEDTLS_CPPFLAGS:--}
mbedTLS link flags : ${MBEDTLS_LDFLAGS:--}
mbedTLS link libraries : ${MBEDTLS_LIBS:--}
Expand Down
1 change: 1 addition & 0 deletions third_party/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ EXTRA_DIST = \

DIST_SUBDIRS = \
lwip \
mbedtls \
$(NULL)

# <any of the third-party packages listed in repos.conf>_SUBDIRS are
Expand Down
11 changes: 9 additions & 2 deletions third_party/mbedtls/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@

include $(abs_top_nlbuild_autotools_dir)/automake/pre.am

if CHIP_WITH_MBEDTLS_INTERNAL

lib_LIBRARIES = libmbedtls.a

libmbedtls_a_SOURCES = \
# Never include the mbedTLS sources in a distribution; they always will get pulled from upstream
# via git operations, hence the 'nodist_' qualifier.

nodist_libmbedtls_a_SOURCES = \
repo/library/aes.c \
repo/library/pem.c \
repo/library/aesni.c \
Expand Down Expand Up @@ -104,7 +109,7 @@ libmbedtls_a_SOURCES =
$(NULL)

if !CONFIG_DEVICE_LAYER
libmbedtls_a_SOURCES += \
nodist_libmbedtls_a_SOURCES += \
repo/library/entropy_poll.c \
repo/library/timing.c \
$(NULL)
Expand All @@ -115,4 +120,6 @@ libmbedtls_a_CPPFLAGS =
$(MBEDTLS_CPPFLAGS) \
$(NULL)

endif # CHIP_WITH_MBEDTLS_INTERNAL

include $(abs_top_nlbuild_autotools_dir)/automake/post.am

0 comments on commit a353a45

Please sign in to comment.