diff --git a/.travis.yml b/.travis.yml index 4f92f0e314bb4..63a17a0774909 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ before_install: ln -s /usr/bin/gcc-5 $HOME/bin/x86_64-linux-gnu-gcc; ln -s /usr/bin/g++-5 $HOME/bin/x86_64-linux-gnu-g++; gcc --version; - BUILDOPTS="-j3 VERBOSE=1 FORCE_ASSERTIONS=1 LLVM_ASSERTIONS=1"; + BUILDOPTS="VERBOSE=1 FORCE_ASSERTIONS=1 LLVM_ASSERTIONS=1"; echo "override ARCH=$ARCH" >> Make.user; TESTSTORUN="all"; elif [ `uname` = "Darwin" ]; then diff --git a/contrib/windows/msys_build.sh b/contrib/windows/msys_build.sh index c4fbf1e9f8074..ca6a88b877499 100755 --- a/contrib/windows/msys_build.sh +++ b/contrib/windows/msys_build.sh @@ -201,6 +201,8 @@ fi echo 'FORCE_ASSERTIONS = 1' >> Make.user cat Make.user -make -j3 VERBOSE=1 +echo `uname -s` +make VERBOSE=1 +#make -j3 VERBOSE=1 make build-stats #make debug diff --git a/deps/http_parser.mk b/deps/http_parser.mk index d6b2e62e33b2f..a0f5a99907bfd 100644 --- a/deps/http_parser.mk +++ b/deps/http_parser.mk @@ -7,10 +7,11 @@ $(eval $(call git-external,http_parser,HTTPPARSER,Makefile,libhttp_parser.$(SHLI HTTPPARSER_OBJ_TARGET := $(build_shlibdir)/libhttp_parser.$(SHLIB_EXT) HTTPPARSER_OBJ_SOURCE := $(BUILDDIR)/$(HTTPPARSER_SRC_DIR)/libhttp_parser.$(SHLIB_EXT) -$(HTTPPARSER_OBJ_SOURCE): $(BUILDDIR)/$(HTTPPARSER_SRC_DIR)/Makefile -ifeq ($(OS),WINNT) +$(BUILDDIR)/$(HTTPPARSER_SRC_DIR)/patched: $(BUILDDIR)/$(HTTPPARSER_SRC_DIR)/Makefile -cd $(BUILDDIR)/$(HTTPPARSER_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/http_parser-win.patch -endif + echo 1 > $@ + +$(HTTPPARSER_OBJ_SOURCE): $(BUILDDIR)/$(HTTPPARSER_SRC_DIR)/patched $(MAKE) -C $(dir $<) library $(MAKE_COMMON) touch -c $@ @@ -21,18 +22,19 @@ endif echo 1 > $@ $(HTTPPARSER_OBJ_TARGET): $(HTTPPARSER_OBJ_SOURCE) - $(call make-install,$(HTTPPARSER_SRC_DIR), library PREFIX=$(build_staging)/$(HTTPPARSER_SRC_DIR)$(build_prefix)) + $(MAKE) -C $(dir $<) install PREFIX=$(build_prefix) ifeq ($(OS),WINNT) - cp $(build_libdir)/libhttp_parser.*.$(SHLIB_EXT) $(HTTPPARSER_OBJ_TARGET) + cp $(build_libdir)/libhttp_parser.$(SHLIB_EXT) $(HTTPPARSER_OBJ_TARGET) endif touch -c $(HTTPPARSER_OBJ_TARGET) clean-http_parser: + -$(MAKE) -C $(dir $(HTTPPARSER_OBJ_SOURCE)) uninstall PREFIX=$(build_prefix) + -rm -rf $(HTTPPARSER_OBJ_TARGET) -rm -rf $(BUILDDIR)/$(HTTPPARSER_SRC_DIR) - -rm -f $(HTTPPARSER_OBJ_TARGET) get-http_parser: $(HTTPPARSER_SRC_FILE) -configure-http_parser: $(BUILDDIR)/$(HTTPPARSER_SRC_DIR)/Makefile +configure-http_parser: $(BUILDDIR)/$(HTTPPARSER_SRC_DIR)/patched compile-http_parser: $(HTTPPARSER_OBJ_SOURCE) check-http_parser: $(BUILDDIR)/$(HTTPPARSER_SRC_DIR)/checked install-http_parser: $(HTTPPARSER_OBJ_TARGET) diff --git a/deps/libgit2.mk b/deps/libgit2.mk index 7a0aecd2dc7bd..2283912f0c638 100644 --- a/deps/libgit2.mk +++ b/deps/libgit2.mk @@ -20,10 +20,10 @@ LIBGIT2_OPTS += -DBUILD_CLAR=OFF -DDLLTOOL=`which $(CROSS_COMPILE)dlltool` LIBGIT2_OPTS += -DCMAKE_FIND_ROOT_PATH=/usr/$(XC_HOST) -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY endif else -LIBGIT2_OPTS += -DUSE_OPENSSL=OFF -DUSE_CUSTOM_TLS=ON -DCMAKE_INSTALL_RPATH=$(build_prefix) -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE +LIBGIT2_OPTS += -DUSE_OPENSSL=OFF -DCMAKE_INSTALL_RPATH=$(build_prefix) -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE endif -$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/CMakeLists.txt +$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/CMakeLists.txt $(HTTPPARSER_OBJ_TARGET) $(LIBSSH2_OBJ_TARGET) ifeq ($(OS),WINNT) -cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p0 -f < $(SRCDIR)/patches/libgit2-ssh.patch else diff --git a/deps/libssh2.mk b/deps/libssh2.mk index 38cc7e6069879..74decfa9682ec 100644 --- a/deps/libssh2.mk +++ b/deps/libssh2.mk @@ -21,7 +21,7 @@ else LIBSSH2_OPTS += -DCRYPTO_BACKEND=mbedTLS -DENABLE_ZLIB_COMPRESSION=ON endif -$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/CMakeLists.txt +$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/CMakeLists.txt $(MBEDTLS_OBJ_TARGET) mkdir -p $(dir $@) cd $(dir $@) && \ $(CMAKE) $(dir $<) $(LIBSSH2_OPTS) diff --git a/deps/mbedtls.mk b/deps/mbedtls.mk index c0330acf1e1e6..93121d9a59eb5 100644 --- a/deps/mbedtls.mk +++ b/deps/mbedtls.mk @@ -15,13 +15,13 @@ MBEDTLS_OBJ_TARGET := $(build_shlibdir)/libmbedtls.$(SHLIB_EXT) \ $(build_shlibdir)/libmbedcrypto.$(SHLIB_EXT) MBEDTLS_OPTS := $(CMAKE_COMMON) -DUSE_SHARED_MBEDTLS_LIBRARY=ON \ - -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=ON -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_PROGRAMS=OFF -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 ifeq ($(BUILD_OS),WINNT) -MBEDTLS_OPTS += -G"MSYS Makefiles" +MBEDTLS_OPTS += -G"MSYS Makefiles" -DENABLE_TESTING=OFF endif else MBEDTLS_OPTS += -DENABLE_ZLIB_SUPPORT=ON diff --git a/deps/mbedtlsstream.mk b/deps/mbedtlsstream.mk index 170c770bb7161..b4d690999f444 100644 --- a/deps/mbedtlsstream.mk +++ b/deps/mbedtlsstream.mk @@ -12,7 +12,7 @@ MBEDTLSSTREAM_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_RPATH=$(build_prefix) \ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -$(BUILDDIR)/$(MBEDTLSSTREAM_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(MBEDTLSSTREAM_SRC_DIR)/CMakeLists.txt +$(BUILDDIR)/$(MBEDTLSSTREAM_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(MBEDTLSSTREAM_SRC_DIR)/CMakeLists.txt $(HTTPPARSER_OBJ_TARGET) $(LIBGIT2_OBJ_TARGET) $(MBEDTLS_OBJ_TARGET) mkdir -p $(dir $@) cd $(dir $@) && \ $(CMAKE) $(dir $<) $(MBEDTLSSTREAM_OPTS) diff --git a/deps/patches/http_parser-win.patch b/deps/patches/http_parser-win.patch index 0973658441ebb..5d5f9b9cafccb 100644 --- a/deps/patches/http_parser-win.patch +++ b/deps/patches/http_parser-win.patch @@ -1,12 +1,8 @@ -diff --git a/Makefile b/Makefile -index 5f4eb22..983f669 100644 ---- a/Makefile -+++ b/Makefile -@@ -18,18 +18,30 @@ - # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +--- a/Makefile 2016-04-19 10:41:48.000000000 -0400 ++++ b/Makefile 2016-07-06 21:40:44.000000000 -0400 +@@ -19,11 +19,24 @@ # IN THE SOFTWARE. -+VERSION = 2.7.0 PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') +ifeq ($(findstring cygwin,$(PLATFORM)), cygwin) +PLATFORM = winnt @@ -14,33 +10,27 @@ index 5f4eb22..983f669 100644 +ifeq ($(findstring mingw,$(PLATFORM)), mingw) +PLATFORM = winnt +endif ++ifeq ($(findstring msys,$(PLATFORM)), msys) ++PLATFORM = winnt ++endif + HELPER ?= BINEXT ?= ifeq (darwin,$(PLATFORM)) --SONAME ?= libhttp_parser.2.7.0.dylib -+SONAME ?= libhttp_parser.$(VERSION).dylib + SONAME ?= libhttp_parser.2.7.0.dylib SOEXT ?= dylib -+else ifeq (winnt, $(PLATFORM)) -+CC = gcc -+SONAME ?= libhttp_parser.$(VERSION).dll ++else ifeq (winnt,$(PLATFORM)) ++SONAME ?= libhttp_parser-2.7.dll +SOEXT ?= dll else ifeq (wine,$(PLATFORM)) CC = winegcc BINEXT = .exe.so - HELPER = wine - else --SONAME ?= libhttp_parser.so.2.7.0 -+SONAME ?= libhttp_parser.so.$(VERSION) - SOEXT ?= so - endif - -@@ -50,7 +62,12 @@ CFLAGS += -Wall -Wextra -Werror +@@ -50,11 +61,18 @@ CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA) CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA) CFLAGS_BENCH = $(CFLAGS_FAST) -Wno-unused-parameter + -+ifeq (winnt, $(PLATFORM)) ++ifeq (winnt,$(PLATFORM)) +CFLAGS_LIB = $(CFLAGS_FAST) +else CFLAGS_LIB = $(CFLAGS_FAST) -fPIC @@ -48,12 +38,75 @@ index 5f4eb22..983f669 100644 LDFLAGS_LIB = $(LDFLAGS) -shared -@@ -141,7 +158,7 @@ clean: + INSTALL ?= install ++STRIP ?= strip ++ + PREFIX ?= $(DESTDIR)/usr/local + LIBDIR = $(PREFIX)/lib + INCLUDEDIR = $(PREFIX)/include +@@ -64,6 +82,8 @@ + LDFLAGS_LIB += -Wl,-soname=$(SONAME) + endif + ++all: library package ++ + test: test_g test_fast + $(HELPER) ./test_g$(BINEXT) + $(HELPER) ./test_fast$(BINEXT) +@@ -101,10 +121,12 @@ + libhttp_parser.o: http_parser.c http_parser.h Makefile + $(CC) $(CPPFLAGS_FAST) $(CFLAGS_LIB) -c http_parser.c -o libhttp_parser.o + +-library: libhttp_parser.o ++library: $(SONAME) ++$(SONAME): libhttp_parser.o + $(CC) $(LDFLAGS_LIB) -o $(SONAME) $< + +-package: http_parser.o ++package: libhttp_parser.a ++libhttp_parser.a: http_parser.o + $(AR) rcs libhttp_parser.a http_parser.o + + url_parser: http_parser.o contrib/url_parser.c +@@ -122,26 +144,28 @@ + tags: http_parser.c http_parser.h test.c + ctags $^ + +-install: library +- $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h +- $(INSTALL) -D $(SONAME) $(LIBDIR)/$(SONAME) +- ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT) +- +-install-strip: library +- $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h +- $(INSTALL) -D -s $(SONAME) $(LIBDIR)/$(SONAME) +- ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT) ++install: library package ++ $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR) ++ $(INSTALL) -m 0644 http_parser.h $(DESTDIR)$(INCLUDEDIR)/http_parser.h ++ $(INSTALL) -d $(DESTDIR)$(LIBDIR) ++ $(INSTALL) -m 0644 $(SONAME) $(DESTDIR)$(LIBDIR)/$(SONAME) ++ ln -sf $(SONAME) $(DESTDIR)$(LIBDIR)/libhttp_parser.$(SOEXT) ++ $(INSTALL) -m 0644 libhttp_parser.a $(DESTDIR)$(LIBDIR)/libhttp_parser.a ++ ++install-strip: install ++ $(STRIP) $(DESTDIR)$(LIBDIR)/$(SONAME) + + uninstall: +- rm $(INCLUDEDIR)/http_parser.h +- rm $(LIBDIR)/$(SONAME) +- rm $(LIBDIR)/libhttp_parser.so ++ rm $(DESTDIR)$(INCLUDEDIR)/http_parser.h ++ rm $(DESTDIR)$(LIBDIR)/$(SONAME) ++ rm $(DEstdiR)$(LIBDIR)/libhttp_parser.$(SOEXT) ++ rm $(DEstdiR)$(LIBDIR)/libhttp_parser.a + + clean: rm -f *.o *.a tags test test_fast test_g \ http_parser.tar libhttp_parser.so.* \ url_parser url_parser_g parsertrace parsertrace_g \ - *.exe *.exe.so -+ *.exe *.exe.so *.dll ++ *.exe.so *.dll contrib/url_parser.c: http_parser.h contrib/parsertrace.c: http_parser.h diff --git a/deps/patches/libgit2-custom-tls.patch b/deps/patches/libgit2-custom-tls.patch index 43abcbfacd113..cb06fe3e512a6 100644 --- a/deps/patches/libgit2-custom-tls.patch +++ b/deps/patches/libgit2-custom-tls.patch @@ -1,53 +1,65 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 93a9e47..75fe5ef 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -542,6 +542,9 @@ IF (OPENSSL_FOUND) - SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES}) - ENDIF() - -+IF (USE_CUSTOM_TLS) -+ ADD_DEFINITIONS(-DGIT_CUSTOM_TLS) -+ENDIF() - - - IF (THREADSAFE) diff --git a/src/settings.c b/src/settings.c -index 00a3ef0..61e0199 100644 +index 00a3ef0..21430bc 100644 --- a/src/settings.c +++ b/src/settings.c -@@ -29,7 +29,7 @@ int git_libgit2_features(void) +@@ -29,9 +29,7 @@ int git_libgit2_features(void) #ifdef GIT_THREADS | GIT_FEATURE_THREADS #endif -#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) -+#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) || defined(GIT_CUSTOM_TLS) | GIT_FEATURE_HTTPS - #endif +-#endif #if defined(GIT_SSH) + | GIT_FEATURE_SSH + #endif diff --git a/src/transport.c b/src/transport.c -index 327052f..c4f3254 100644 +index 327052f..32f8464 100644 --- a/src/transport.c +++ b/src/transport.c -@@ -29,7 +29,7 @@ static transport_definition local_transport_definition = { "file://", git_transp +@@ -29,9 +29,7 @@ static transport_definition local_transport_definition = { "file://", git_transp static transport_definition transports[] = { { "git://", git_transport_smart, &git_subtransport_definition }, { "http://", git_transport_smart, &http_subtransport_definition }, -#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) -+#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) || defined(GIT_CUSTOM_TLS) { "https://", git_transport_smart, &http_subtransport_definition }, - #endif +-#endif { "file://", git_transport_local, NULL }, + #ifdef GIT_SSH + { "ssh://", git_transport_smart, &ssh_subtransport_definition }, diff --git a/src/transports/http.c b/src/transports/http.c -index 4fbbfbb..9ef05c6 100644 +index 4fbbfbb..30520a0 100644 --- a/src/transports/http.c +++ b/src/transports/http.c -@@ -620,7 +620,7 @@ static int http_connect(http_subtransport *t) +@@ -620,7 +620,6 @@ static int http_connect(http_subtransport *t) error = git_stream_connect(t->io); -#if defined(GIT_OPENSSL) || defined(GIT_SECURE_TRANSPORT) || defined(GIT_CURL) -+#if defined(GIT_OPENSSL) || defined(GIT_SECURE_TRANSPORT) || defined(GIT_CURL) || defined(GIT_CUSTOM_TLS) if ((!error || error == GIT_ECERTIFICATE) && t->owner->certificate_check_cb != NULL && git_stream_is_encrypted(t->io)) { git_cert *cert; +@@ -640,7 +639,7 @@ static int http_connect(http_subtransport *t) + return error; + } + } +-#endif ++ + if (error < 0) + return error; + +diff --git a/tests/core/features.c b/tests/core/features.c +index 85cddfe..cf5e190 100644 +--- a/tests/core/features.c ++++ b/tests/core/features.c +@@ -17,11 +17,7 @@ void test_core_features__0(void) + cl_assert((caps & GIT_FEATURE_THREADS) == 0); + #endif + +-#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) + cl_assert((caps & GIT_FEATURE_HTTPS) != 0); +-#else +- cl_assert((caps & GIT_FEATURE_HTTPS) == 0); +-#endif + + #if defined(GIT_SSH) + cl_assert((caps & GIT_FEATURE_SSH) != 0);