Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libgit2 dependency to build system #8820

Merged
merged 13 commits into from
Nov 3, 2014
Prev Previous commit
Next Next commit
fixes for Windows cross-compile
  • Loading branch information
tkelman committed Oct 30, 2014
commit fed8568392afb498eaf0e16f6927c76a27e0354d
3 changes: 3 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ BUILD_LLDB = 0
#XC_HOST = i686-w64-mingw32
#XC_HOST = x86_64-w64-mingw32

# Path to cmake (override in Make.user if needed)
CMAKE = cmake

# Figure out OS and architecture
BUILD_OS := $(shell uname)

Expand Down
44 changes: 26 additions & 18 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ endif

ifeq ($(USE_SYSTEM_LIBGIT2), 0)
STAGE1_DEPS += libgit2
LIBGIT2_OPTS = -DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release
endif
ifeq ($(BUILD_OS),WINNT)
ifeq ($(OS),WINNT)
LIBGIT2_OPTS = -DBUILD_CLAR=OFF -DWIN32=ON -DMINGW=ON -DUSE_SSH=OFF -G"MSYS Makefiles"
endif
endif

ifeq ($(USE_SYSTEM_MPFR), 0)
Expand Down Expand Up @@ -1704,43 +1698,57 @@ install-virtualenv: $(VIRTUALENV_TARGET)

## libgit2

LIBGIT2_SOURCE = libgit2-$(LIBGIT2_VER)/build/libgit2.$(SHLIB_EXT)
LIBGIT2_TARGET = $(build_shlibdir)/libgit2.$(SHLIB_EXT)
LIBGIT2_OBJ_SOURCE = libgit2-$(LIBGIT2_VER)/build/libgit2.$(SHLIB_EXT)
LIBGIT2_OBJ_TARGET = $(build_shlibdir)/libgit2.$(SHLIB_EXT)

LIBGIT2_OPTS = -DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$(CC)
ifeq ($(OS),WINNT)
LIBGIT2_OPTS += -DBUILD_CLAR=OFF -DWIN32=ON -DMINGW=ON -DUSE_SSH=OFF -DCMAKE_SYSTEM_NAME=Windows
ifeq ($(BUILD_OS),WINNT)
LIBGIT2_OPTS += -G"MSYS Makefiles"
else
LIBGIT2_OPTS += -DCMAKE_RC_COMPILER=`which $(CROSS_COMPILE)windres`
LIBGIT2_OPTS += -DCMAKE_FIND_ROOT_PATH=/usr/$(XC_HOST) -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
endif
endif

libgit2-$(LIBGIT2_VER).tar.gz:
$(JLDOWNLOAD) $@ https://github.com/libgit2/libgit2/archive/v$(LIBGIT2_VER).tar.gz
libgit2-$(LIBGIT2_VER)/CMakeLists.txt: libgit2-$(LIBGIT2_VER).tar.gz
$(JLCHECKSUM) $<
ifeq ($(BUILD_OS),WINNT)
$(TAR) --exclude=libgit2-$(LIBGIT2_VER)/tests/resources/template/hooks/link.sample -zxf $<
else
$(TAR) zxf $<
endif
touch -c $@
libgit2-$(LIBGIT2_VER)/build/Makefile: libgit2-$(LIBGIT2_VER)/CMakeLists.txt
mkdir -p libgit2-$(LIBGIT2_VER)/build
cd libgit2-$(LIBGIT2_VER)/build/ && \
cmake .. $(LIBGIT2_OPTS)
$(CMAKE) .. $(LIBGIT2_OPTS)
touch -c $@
$(LIBGIT2_SOURCE): libgit2-$(LIBGIT2_VER)/build/Makefile
$(LIBGIT2_OBJ_SOURCE): libgit2-$(LIBGIT2_VER)/build/Makefile
cd libgit2-$(LIBGIT2_VER)/build/ && \
cmake --build .
$(CMAKE) --build .
touch -c $@
libgit2-$(LIBGIT2_VER)/build/checked: $(LIBGIT2_SOURCE)
libgit2-$(LIBGIT2_VER)/build/checked: $(LIBGIT2_OBJ_SOURCE)
#cd libgit2-$(LIBGIT2_VER)/build/ && \
#ctest
echo 1 > $@
$(LIBGIT2_TARGET): $(LIBGIT2_SOURCE) | $(build_shlibdir)
$(LIBGIT2_OBJ_TARGET): $(LIBGIT2_OBJ_SOURCE) | $(build_shlibdir)
cp $< $@
# Should the includes get included?
#cp -R libgit2-$(LIBGIT2_VER)/include/* $(build_includedir)

clean-libgit2:
-rm -rf libgit2-$(LIBGIT2_VER)/build/
-rm -f $(LIBGIT2_OBJ_TARGET)
distclean-libgit2: clean-libgit2
distclean-libgit2:
-rm -rf libgit2-$(LIBGIT2_VER).tar.gz libgit2-$(LIBGIT2_VER).zip libgit2-$(LIBGIT2_VER)

get-libgit2: libgit2-$(LIBGIT2_VER).tar.gz
configure-libgit2: libgit2-$(LIBGIT2_VER)/Makefile
compile-libgit2: $(LIBGIT2_SOURCE)
compile-libgit2: $(LIBGIT2_OBJ_SOURCE)
check-libgit2: compile-libgit2
install-libgit2: $(LIBGIT2_TARGET)
install-libgit2: $(LIBGIT2_OBJ_TARGET)

## phony targets ##

Expand Down
2 changes: 1 addition & 1 deletion deps/Versions.make
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ GMP_VER=6.0.0
MPFR_VER=3.1.2
PATCHELF_VER = 0.8
VIRTUALENV_VER = 1.11.6
LIBGIT2_VER = 0.21.0
LIBGIT2_VER = 0.21.1
1 change: 0 additions & 1 deletion deps/checksums/libgit2-0.21.0.tar.gz/md5

This file was deleted.

1 change: 0 additions & 1 deletion deps/checksums/libgit2-0.21.0.tar.gz/sha512

This file was deleted.

1 change: 1 addition & 0 deletions deps/checksums/libgit2-0.21.1.tar.gz/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cbf3422d54dd6f55f09855a6eb749f41
1 change: 1 addition & 0 deletions deps/checksums/libgit2-0.21.1.tar.gz/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ea065e82af79a4631e969bd3c02e576a8e8999bc8091ec8846dbb38983a5fe0ffd1b8429b204b73d9d28277157f48666ec3aa832c8e8a9f60c825e0d54804a6a