From 4ae58938489832c7ef0e70e89e9b5fcf7f8602ca Mon Sep 17 00:00:00 2001 From: wildart Date: Fri, 1 Jul 2016 22:55:40 -0400 Subject: [PATCH] mbedtls build configuration without git-external --- deps/Versions.make | 1 + deps/checksums/mbedtls-2.2.1-apache.tgz/md5 | 1 + .../checksums/mbedtls-2.2.1-apache.tgz/sha512 | 1 + .../md5 | 0 .../sha512 | 0 deps/mbedtls.mk | 52 ++++++++++++------- deps/mbedtls.version | 2 - 7 files changed, 36 insertions(+), 21 deletions(-) create mode 100644 deps/checksums/mbedtls-2.2.1-apache.tgz/md5 create mode 100644 deps/checksums/mbedtls-2.2.1-apache.tgz/sha512 rename deps/checksums/{mbedtls-bfafadb45daf8d2114e3109e2f9021fc72ee36bb.tar.gz => mbedtls-2.2.1-gpl.tgz}/md5 (100%) rename deps/checksums/{mbedtls-bfafadb45daf8d2114e3109e2f9021fc72ee36bb.tar.gz => mbedtls-2.2.1-gpl.tgz}/sha512 (100%) delete mode 100644 deps/mbedtls.version diff --git a/deps/Versions.make b/deps/Versions.make index 7f29e1662d0a2..ddc025104e669 100644 --- a/deps/Versions.make +++ b/deps/Versions.make @@ -14,3 +14,4 @@ PATCHELF_VER = 0.9 GIT_VER = 1.8.5.6 VIRTUALENV_VER = 15.0.0 RMATH_JULIA_VER = 0.1 +MBEDTLS_VER = 2.2.1 diff --git a/deps/checksums/mbedtls-2.2.1-apache.tgz/md5 b/deps/checksums/mbedtls-2.2.1-apache.tgz/md5 new file mode 100644 index 0000000000000..6a06d0ebc2b38 --- /dev/null +++ b/deps/checksums/mbedtls-2.2.1-apache.tgz/md5 @@ -0,0 +1 @@ +77751c0e370ed2ab01934e4c5e1d380f diff --git a/deps/checksums/mbedtls-2.2.1-apache.tgz/sha512 b/deps/checksums/mbedtls-2.2.1-apache.tgz/sha512 new file mode 100644 index 0000000000000..f8b91b02ac065 --- /dev/null +++ b/deps/checksums/mbedtls-2.2.1-apache.tgz/sha512 @@ -0,0 +1 @@ +6a74abc4ea225eb6bcf20894bb1a6faa82dbaff11129c41849151e2654570609efeee70d0644ce63c4d2c11e6142b2db262b88f3a22fdceff0a215a64a5d6eb0 diff --git a/deps/checksums/mbedtls-bfafadb45daf8d2114e3109e2f9021fc72ee36bb.tar.gz/md5 b/deps/checksums/mbedtls-2.2.1-gpl.tgz/md5 similarity index 100% rename from deps/checksums/mbedtls-bfafadb45daf8d2114e3109e2f9021fc72ee36bb.tar.gz/md5 rename to deps/checksums/mbedtls-2.2.1-gpl.tgz/md5 diff --git a/deps/checksums/mbedtls-bfafadb45daf8d2114e3109e2f9021fc72ee36bb.tar.gz/sha512 b/deps/checksums/mbedtls-2.2.1-gpl.tgz/sha512 similarity index 100% rename from deps/checksums/mbedtls-bfafadb45daf8d2114e3109e2f9021fc72ee36bb.tar.gz/sha512 rename to deps/checksums/mbedtls-2.2.1-gpl.tgz/sha512 diff --git a/deps/mbedtls.mk b/deps/mbedtls.mk index 6702b56b004b9..cb512ae09cd73 100644 --- a/deps/mbedtls.mk +++ b/deps/mbedtls.mk @@ -1,26 +1,25 @@ ## mbedtls -MBEDTLS_GIT_URL := git://github.com/ARMmbed/mbedtls.git ifeq ($(USE_GPL_LIBS), 1) -MBEDTLS_TAR_URL = https://tls.mbed.org/download/mbedtls-2.2.1-gpl.tgz + MBEDTLS_SRC = mbedtls-$(MBEDTLS_VER)-gpl else -MBEDTLS_TAR_URL = https://tls.mbed.org/download/mbedtls-2.2.1-apache.tgz + MBEDTLS_SRC = mbedtls-$(MBEDTLS_VER)-apache endif -$(eval $(call git-external,mbedtls,MBEDTLS,CMakeLists.txt,build/libmbedtls.$(SHLIB_EXT),$(SRCDIR)/srccache)) +MBEDTLS_URL = https://tls.mbed.org/download/$(MBEDTLS_SRC).tgz -MBEDTLS_OBJ_SOURCE := $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/library/libmbedtls.$(SHLIB_EXT) \ - $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/library/libmbedx509.$(SHLIB_EXT) \ - $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/library/libmbedcrypto.$(SHLIB_EXT) +MBEDTLS_OBJ_SOURCE := $(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/library/libmbedtls.$(SHLIB_EXT) \ + $(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/library/libmbedx509.$(SHLIB_EXT) \ + $(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/library/libmbedcrypto.$(SHLIB_EXT) MBEDTLS_OBJ_TARGET := $(build_shlibdir)/libmbedtls.$(SHLIB_EXT) \ $(build_shlibdir)/libmbedx509.$(SHLIB_EXT) \ $(build_shlibdir)/libmbedcrypto.$(SHLIB_EXT) MBEDTLS_OPTS := $(CMAKE_COMMON) -DUSE_SHARED_MBEDTLS_LIBRARY=ON \ - -DENABLE_PROGRAMS=OFF -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=ON -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_RPATH=$(build_prefix) -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE ifeq ($(OS),WINNT) -MBEDTLS_OPTS += -DENABLE_ZLIB_SUPPORT=OFF -DENABLE_TESTING=OFF +MBEDTLS_OPTS += -DENABLE_ZLIB_SUPPORT=OFF ifeq ($(BUILD_OS),WINNT) MBEDTLS_OPTS += -G"MSYS Makefiles" endif @@ -28,20 +27,29 @@ else MBEDTLS_OPTS += -DENABLE_ZLIB_SUPPORT=ON endif -$(BUILDDIR)/$(MBEDTLS_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(MBEDTLS_SRC_DIR)/CMakeLists.txt - -cd $(SRCDIR)/srccache/$(MBEDTLS_SRC_DIR) && patch -p0 -f < $(SRCDIR)/patches/mbedtls.patch +$(SRCDIR)/srccache/$(MBEDTLS_SRC).tgz: | $(SRCDIR)/srccache + $(JLDOWNLOAD) $@ $(MBEDTLS_URL) + +$(SRCDIR)/srccache/$(MBEDTLS_SRC)/CMakeLists.txt: $(SRCDIR)/srccache/$(MBEDTLS_SRC).tgz + $(JLCHECKSUM) $< + mkdir -p $(dir $@) && \ + $(TAR) -C $(dir $@) --strip-components 1 -xf $< + touch -c $@ + +$(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/Makefile: $(SRCDIR)/srccache/$(MBEDTLS_SRC)/CMakeLists.txt + -cd $(SRCDIR)/srccache/$(SRCDIR)/srccache/mbedtls-$(MBEDTLS_VER) && patch -p0 -f < $(SRCDIR)/patches/mbedtls.patch mkdir -p $(dir $@) cd $(dir $@) && \ $(CMAKE) $(dir $<) $(MBEDTLS_OPTS) touch -c $@ -$(MBEDTLS_OBJ_SOURCE): $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/Makefile +$(MBEDTLS_OBJ_SOURCE): $(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/Makefile $(MAKE) -C $(dir $<) touch -c $@ -$(BUILDDIR)/$(MBEDTLS_SRC_DIR)/checked: $(MBEDTLS_OBJ_SOURCE) +$(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/checked: $(MBEDTLS_OBJ_SOURCE) ifeq ($(OS),$(BUILD_OS)) - -$(MAKE) -C $(dir $@) test + $(MAKE) -C $(dir $@) test endif echo 1 > $@ @@ -49,16 +57,22 @@ $(MBEDTLS_OBJ_TARGET): $(MBEDTLS_OBJ_SOURCE) | $(build_shlibdir) ifeq ($(OS), WINNT) cp $^ $(build_shlibdir) else - $(call make-install,$(MBEDTLS_SRC_DIR),) + $(call make-install,mbedtls-$(MBEDTLS_VER),) endif touch -c $(MBEDTLS_OBJ_TARGET) clean-mbedtls: - -rm -rf $(BUILDDIR)/$(MBEDTLS_SRC_DIR) + -rm -rf $(BUILDDIR)/mbedtls-$(MBEDTLS_VER) -rm -f $(MBEDTLS_OBJ_TARGET) -get-mbedtls: $(MBEDTLS_SRC_FILE) -configure-mbedtls: $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/Makefile +distclean-mbedtls: + -rm -rf $(SRCDIR)/srccache/$(MBEDTLS_SRC).tgz + -rm -rf $(SRCDIR)/srccache/$(MBEDTLS_SRC) + -rm -rf $(BUILDDIR)/mbedtls-$(MBEDTLS_VER) + + +get-mbedtls: $(SRCDIR)/srccache/$(MBEDTLS_SRC).tgz +configure-mbedtls: $(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/Makefile compile-mbedtls: $(MBEDTLS_OBJ_SOURCE) -check-mbedtls: $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/checked +check-mbedtls: $(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/checked install-mbedtls: $(MBEDTLS_OBJ_TARGET) diff --git a/deps/mbedtls.version b/deps/mbedtls.version deleted file mode 100644 index 65ed266ae32e4..0000000000000 --- a/deps/mbedtls.version +++ /dev/null @@ -1,2 +0,0 @@ -MBEDTLS_BRANCH=mbedtls-2.2.1 -MBEDTLS_SHA1=bfafadb45daf8d2114e3109e2f9021fc72ee36bb