Skip to content

Commit

Permalink
Build curl
Browse files Browse the repository at this point in the history
Patch for mbedtls to allow curl to build with mbedtls support
  • Loading branch information
ViralBShah committed Aug 3, 2016
1 parent 511cb7d commit 1d0b18b
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 1 deletion.
1 change: 1 addition & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ USE_SYSTEM_UTF8PROC:=0
USE_SYSTEM_MBEDTLS:=0
USE_SYSTEM_LIBSSH2:=0
USE_SYSTEM_LIBGIT2:=0
USE_SYSTEM_CURL:=0
USE_SYSTEM_PATCHELF:=0

# Link to the LLVM shared library
Expand Down
5 changes: 5 additions & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ ifeq ($(USE_SYSTEM_LIBGIT2), 0)
STAGE3_DEPS += libgit2
endif

ifeq ($(USE_SYSTEM_CURL), 0)
STAGE2_DEPS += curl
endif

ifeq ($(USE_SYSTEM_MPFR), 0)
STAGE2_DEPS += mpfr
endif
Expand Down Expand Up @@ -271,6 +275,7 @@ include $(SRCDIR)/mpfr.mk
include $(SRCDIR)/patchelf.mk
include $(SRCDIR)/mbedtls.mk
include $(SRCDIR)/libssh2.mk
include $(SRCDIR)/curl.mk
include $(SRCDIR)/libgit2.mk
include $(SRCDIR)/virtualenv.mk

Expand Down
1 change: 1 addition & 0 deletions deps/Versions.make
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ MPFR_VER = 3.1.4
PATCHELF_VER = 0.9
VIRTUALENV_VER = 15.0.0
MBEDTLS_VER = 2.3.0
CURL_VER = 7.50.1
1 change: 1 addition & 0 deletions deps/checksums/curl-7.50.1.tar.bz2/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
015f6a0217ca6f2c5442ca406476920b
1 change: 1 addition & 0 deletions deps/checksums/curl-7.50.1.tar.bz2/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
94acd91fcf8ff2605e1ba2d086c2c366257b61eaf516b9ea44e574e315feb5b30f6e47d89051f259e026ef5dd9edde5f7b15a6af9ee6a38f641da354e1e677b1
46 changes: 46 additions & 0 deletions deps/curl.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## CURL ##

CURL_SRC_TARGET := $(BUILDDIR)/curl-$(CURL_VER)/.libs/libcurl.$(SHLIB_EXT)
CURL_OBJ_TARGET := $(build_shlibdir)/libcurl.$(SHLIB_EXT)

ifneq ($(OS),WINNT)
CURL_LDFLAGS := "-Wl,-rpath,'$(build_libdir)'"
endif

$(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
$(JLCHECKSUM) $<
cd $(dir $<) && $(TAR) jxf $(notdir $<)
touch -c $@
$(BUILDDIR)/curl-$(CURL_VER)/config.status: $(SRCDIR)/srccache/curl-$(CURL_VER)/configure
mkdir -p $(dir $@)
cd $(dir $@) && \
$< $(CONFIGURE_COMMON) --includedir=$(build_includedir) --with-mbedtls=$(build_shlibdir)/.. CFLAGS="$(CFLAGS) $(CURL_CFLAGS)" LDFLAGS="$(LDFLAGS) $(CURL_LDFLAGS)"
touch -c $@
$(CURL_SRC_TARGET): $(BUILDDIR)/curl-$(CURL_VER)/config.status
$(MAKE) -C $(dir $<) $(LIBTOOL_CCLD)
touch -c $@
$(BUILDDIR)/curl-$(CURL_VER)/checked: $(CURL_SRC_TARGET)
ifeq ($(OS),$(BUILD_OS))
ifneq ($(OS),WINNT)
$(MAKE) -C $(dir $@) check -j1
endif
endif
echo 1 > $@
$(CURL_OBJ_TARGET): $(CURL_SRC_TARGET)
$(call make-install,curl-$(CURL_VER),$(LIBTOOL_CCLD))
$(INSTALL_NAME_CMD)libcurl.$(SHLIB_EXT) $@
touch -c $@

clean-curl:
-$(MAKE) -C $(BUILDDIR)/curl-$(CURL_VER) clean
-rm -f $(build_shlibdir)/libcurl*
distclean-curl:
-rm -rf $(SRCDIR)/srccache/curl-$(CURL_VER).tar.bz2 $(SRCDIR)/srccache/curl-$(CURL_VER) $(BUILDDIR)/curl-$(CURL_VER)

get-curl: $(SRCDIR)/srccache/curl-$(CURL_VER).tar.bz2
configure-curl: $(BUILDDIR)/curl-$(CURL_VER)/config.status
compile-curl: $(CURL_SRC_TARGET)
check-curl: $(BUILDDIR)/curl-$(CURL_VER)/checked
install-curl: $(CURL_OBJ_TARGET)
6 changes: 5 additions & 1 deletion deps/mbedtls.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ $(SRCDIR)/srccache/$(MBEDTLS_SRC)/mbedtls-config.patch-applied: | $(SRCDIR)/srcc
cd $(SRCDIR)/srccache/$(MBEDTLS_SRC) && patch -p0 -f < $(SRCDIR)/patches/mbedtls-config.patch
echo 1 > $@

$(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/Makefile: $(SRCDIR)/srccache/$(MBEDTLS_SRC)/CMakeLists.txt $(SRCDIR)/srccache/$(MBEDTLS_SRC)/mbedtls-config.patch-applied
$(SRCDIR)/srccache/$(MBEDTLS_SRC)/mbedtls-ssl.h.patch-applied: | $(SRCDIR)/srccache/$(MBEDTLS_SRC)/CMakeLists.txt
cd $(SRCDIR)/srccache/$(MBEDTLS_SRC)/include/mbedtls && patch -p0 -f < $(SRCDIR)/patches/mbedtls-ssl.h.patch
echo 1 > $@

$(BUILDDIR)/mbedtls-$(MBEDTLS_VER)/Makefile: $(SRCDIR)/srccache/$(MBEDTLS_SRC)/CMakeLists.txt $(SRCDIR)/srccache/$(MBEDTLS_SRC)/mbedtls-config.patch-applied $(SRCDIR)/srccache/$(MBEDTLS_SRC)/mbedtls-ssl.h.patch-applied
mkdir -p $(dir $@)
cd $(dir $@) && \
$(CMAKE) $(dir $<) $(MBEDTLS_OPTS)
Expand Down
12 changes: 12 additions & 0 deletions deps/patches/mbedtls-ssl.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- ssl.h.old 2016-06-28 18:12:06.000000000 +0530
+++ ssl.h 2016-08-03 18:51:34.000000000 +0530
@@ -54,7 +54,8 @@
#endif

#if defined(MBEDTLS_HAVE_TIME)
-#include <time.h>
+//#include <time.h>
+#include "platform.h"
#endif

/*

0 comments on commit 1d0b18b

Please sign in to comment.