Skip to content

Commit

Permalink
Improve handling of curl, mbedtls, libssh2 USE_SYSTEM
Browse files Browse the repository at this point in the history
  • Loading branch information
tkelman authored and mfasi committed Sep 5, 2016
1 parent b8b49f8 commit 57e0afc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ ifeq ($(USE_SYSTEM_GMP), 0)
DEP_LIBS += gmp
endif

ifeq ($(USE_SYSTEM_LIBGIT2), 0)
ifeq ($(USE_SYSTEM_MBEDTLS), 0)
DEP_LIBS += mbedtls
endif
Expand All @@ -175,9 +176,8 @@ DEP_LIBS += curl
endif
endif

ifeq ($(USE_SYSTEM_LIBGIT2), 0)
DEP_LIBS += libgit2
endif
endif # USE_SYSTEM_LIBGIT2

ifeq ($(USE_SYSTEM_MPFR), 0)
DEP_LIBS += mpfr
Expand Down
8 changes: 7 additions & 1 deletion deps/curl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ CURL_LDFLAGS := $(RPATH_ESCAPED_ORIGIN)
$(SRCDIR)/srccache/curl-$(CURL_VER).tar.bz2: | $(SRCDIR)/srccache
$(JLDOWNLOAD) $@ https://curl.haxx.se/download/curl-$(CURL_VER).tar.bz2

$(SRCDIR)/srccache/curl-$(CURL_VER)/configure: $(SRCDIR)/srccache/curl-$(CURL_VER).tar.bz2 $(MBEDTLS_OBJ_TARGET) $(LIBSSH2_OBJ_TARGET)
$(SRCDIR)/srccache/curl-$(CURL_VER)/configure: $(SRCDIR)/srccache/curl-$(CURL_VER).tar.bz2
$(JLCHECKSUM) $<
cd $(dir $<) && $(TAR) jxf $(notdir $<)
touch -c $@

ifeq ($(USE_SYSTEM_MBEDTLS), 0)
$(BUILDDIR)/curl-$(CURL_VER)/config.status: $(MBEDTLS_OBJ_TARGET)
endif
ifeq ($(USE_SYSTEM_LIBSSH2), 0)
$(BUILDDIR)/curl-$(CURL_VER)/config.status: $(LIBSSH2_OBJ_TARGET)
endif
$(BUILDDIR)/curl-$(CURL_VER)/config.status: $(SRCDIR)/srccache/curl-$(CURL_VER)/configure
mkdir -p $(dir $@)
cd $(dir $@) && \
Expand Down
7 changes: 5 additions & 2 deletions deps/libssh2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LIBSSH2_OBJ_SOURCE := $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/src/libssh2.$(SHLIB_EXT)
LIBSSH2_OBJ_TARGET := $(build_shlibdir)/libssh2.$(SHLIB_EXT)

LIBSSH2_OPTS := $(CMAKE_COMMON) -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=Release

ifeq ($(OS),WINNT)
LIBSSH2_OPTS += -DCRYPTO_BACKEND=WinCNG -DENABLE_ZLIB_COMPRESSION=OFF
Expand All @@ -30,7 +30,10 @@ $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/libssh2-encryptedpem.patch-applied: | $(SR
cd $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/libssh2-encryptedpem.patch
echo 1 > $@

$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/CMakeLists.txt $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/libssh2-mbedtls.patch-applied $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/libssh2-encryptedpem.patch-applied $(MBEDTLS_OBJ_TARGET)
ifeq ($(USE_SYSTEM_MBEDTLS), 0)
$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile: $(MBEDTLS_OBJ_TARGET)
endif
$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/CMakeLists.txt $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/libssh2-mbedtls.patch-applied $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/libssh2-encryptedpem.patch-applied
mkdir -p $(dir $@)
cd $(dir $@) && \
$(CMAKE) $(dir $<) $(LIBSSH2_OPTS)
Expand Down

0 comments on commit 57e0afc

Please sign in to comment.