Skip to content

Commit

Permalink
Have libgit2 use our curl.
Browse files Browse the repository at this point in the history
Enforce curl as a dependency for the libgit2 build.
Fix the libgit2 clean target
Build curl only on linux and osx.
Add pkg-config to build dependencies in README.md. Required to detect curl in libgit2 build.
  • Loading branch information
ViralBShah committed Aug 6, 2016
1 parent 046c6eb commit 3687527
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ Building Julia requires that the following software be installed:
- **[patch]**for modifying source code.
- **[cmake]** — needed to build `libgit2`.
- **[openssl]** — needed for HTTPS support in `libgit2` on Linux, install via `apt-get install libssl-dev` or `yum install openssl-devel`.
- **[pkg-config]** - needed to build libgit2 correctly, especially for proxy support

Julia uses the following external libraries, which are automatically downloaded (or in a few cases, included in the Julia source repository) and then compiled from source the first time you run `make`:

Expand Down Expand Up @@ -326,6 +327,7 @@ For a longer overview of Julia's dependencies, see these [slides](https://github
[openssl]: https://www.openssl.org
[libssh2]: https://www.libssh2.org
[mbedtls]: https://tls.mbed.org/
[pkg-config]: https://www.freedesktop.org/wiki/Software/pkg-config/
<a name="System-Provided-Libraries">
### System Provided Libraries
Expand Down
1 change: 1 addition & 0 deletions contrib/windows/msys_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ echo 'override LIBLAPACKNAME = $(LIBBLASNAME)' >> Make.user
echo 'override STAGE1_DEPS = libuv' >> Make.user
echo 'override STAGE2_DEPS = utf8proc' >> Make.user
echo 'override STAGE3_DEPS = ' >> Make.user
echo 'override STAGE4_DEPS = ' >> Make.user

if [ -n "$USEMSVC" ]; then
# Openlibm doesn't build well with MSVC right now
Expand Down
8 changes: 5 additions & 3 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,14 @@ ifeq ($(USE_SYSTEM_LIBSSH2), 0)
STAGE2_DEPS += libssh2
endif

ifneq ($(OS), WINNT)
ifeq ($(USE_SYSTEM_CURL), 0)
STAGE2_DEPS += curl
STAGE3_DEPS += curl
endif
endif

ifeq ($(USE_SYSTEM_LIBGIT2), 0)
STAGE3_DEPS += libgit2
STAGE4_DEPS += libgit2
endif

ifeq ($(USE_SYSTEM_MPFR), 0)
Expand Down Expand Up @@ -215,7 +217,7 @@ endif

## Common build target prefixes

DEP_LIBS := $(STAGE1_DEPS) $(STAGE2_DEPS) $(STAGE3_DEPS)
DEP_LIBS := $(STAGE1_DEPS) $(STAGE2_DEPS) $(STAGE3_DEPS) $(STAGE4_DEPS)

default: install | $(build_prefix)
get: $(addprefix get-, $(DEP_LIBS))
Expand Down
9 changes: 7 additions & 2 deletions deps/libgit2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ else
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 += -DCURL_INCLUDE_DIRS=$(build_includedir) -DCURL_LIBRARIES="-L$(build_shlibdir) -lcurl"
endif

ifeq ($(OS),Linux)
Expand All @@ -44,6 +46,9 @@ $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-openssl-hang.patch-applied: | $(SR
ifeq ($(OS),Linux)
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-require-openssl.patch-applied $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-openssl-hang.patch-applied
endif
ifneq ($(OS),WINNT)
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(CURL_OBJ_TARGET)
endif
$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/CMakeLists.txt $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-ssh.patch-applied $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/libgit2-agent-nonfatal.patch-applied $(LIBSSH2_OBJ_TARGET)
mkdir -p $(dir $@)
cd $(dir $@) && \
Expand Down Expand Up @@ -73,14 +78,14 @@ ifeq ($(OS),Linux)
for LIB in libssl libcrypto; do \
LIB_PATH=$$(echo "$$LIBGIT_LIBS" | grep "$$LIB"); \
echo "LIB_PATH for $$LIB: $$LIB_PATH"; \
[ ! -z "$$LIB_PATH" ] && cp -v "$$LIB_PATH" $(build_shlibdir); \
[ ! -z "$$LIB_PATH" ] && cp -v -f "$$LIB_PATH" $(build_shlibdir); \
done
endif
touch -c $@

clean-libgit2:
-$(MAKE) -C $(BUILDDIR)/$(LIBGIT2_SRC_DIR) clean
-rm -f $(LIBGIT2_OBJ_TARGET)
-rm -f $(build_shlibdir)/libgit2* $(build_shlibdir)/libssl* $(build_shlibdir)/libcrypto*

get-libgit2: $(LIBGIT2_SRC_FILE)
configure-libgit2: $(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile
Expand Down

0 comments on commit 3687527

Please sign in to comment.