Skip to content

Commit

Permalink
added RPATH parameters to cmake builds, switched libssh2 and libgit2 …
Browse files Browse the repository at this point in the history
…to mbedtls dependent branch
  • Loading branch information
wildart committed Jun 28, 2016
1 parent 55f1380 commit 55bd933
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 43 deletions.
5 changes: 4 additions & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ USE_SYSTEM_ARPACK:=0
USE_SYSTEM_SUITESPARSE:=0
USE_SYSTEM_LIBUV:=0
USE_SYSTEM_UTF8PROC:=0
USE_SYSTEM_HTTPPARSER:=0
USE_SYSTEM_MBEDTLS:=0
USE_SYSTEM_LIBSSH2:=0
USE_SYSTEM_LIBGIT2:=0
USE_SYSTEM_PATCHELF:=0

Expand Down Expand Up @@ -234,7 +237,7 @@ CMAKE ?= cmake
CMAKE_GENERATOR ?= make

# Point pkg-config to only look at our libraries
export PKG_CONFIG_LIBDIR = $(JULIAHOME)/usr/lib/pkgconfig
export PKG_CONFIG_PATH = $(JULIAHOME)/usr/lib/pkgconfig

This comment has been minimized.

Copy link
@tkelman

tkelman Jul 1, 2016

Contributor

this change would probably reintroduce issues with iconv on mac

This comment has been minimized.

Copy link
@wildart

wildart Jul 2, 2016

Author Member

If we try to go without libcurl, it can be switched back.

This comment has been minimized.

Copy link
@tkelman

tkelman Jul 2, 2016

Contributor

we definitely don't want to pick up the system libcurl, that adds a needs-root devel-package build dependency that we'd have to copy around from the buildbots to make the binaries actually self contained


# Figure out OS and architecture
BUILD_OS := $(shell uname)
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,15 @@ endif
ifeq ($(USE_SYSTEM_MPFR),0)
JL_PRIVATE_LIBS += mpfr
endif
ifeq ($(USE_SYSTEM_HTTPPARSER),0)
JL_PRIVATE_LIBS += http_parser
endif
ifeq ($(USE_SYSTEM_MBEDTLS),0)
JL_PRIVATE_LIBS += mbedtls mbedcrypto mbedx509
endif
ifeq ($(USE_SYSTEM_LIBSSH2),0)
JL_PRIVATE_LIBS += ssh2
endif
ifeq ($(USE_SYSTEM_LIBGIT2),0)
JL_PRIVATE_LIBS += git2
endif
Expand Down
17 changes: 16 additions & 1 deletion deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,18 @@ ifeq ($(USE_SYSTEM_GMP), 0)
STAGE1_DEPS += gmp
endif

ifeq ($(USE_SYSTEM_HTTPPARSER), 0)
STAGE1_DEPS += http_parser
endif

ifeq ($(USE_SYSTEM_MBEDTLS), 0)
STAGE1_DEPS += mbedtls
endif

ifeq ($(USE_SYSTEM_LIBSSH2), 0)
STAGE1_DEPS += libssh2
endif

ifeq ($(USE_SYSTEM_LIBGIT2), 0)
STAGE1_DEPS += libgit2
endif
Expand Down Expand Up @@ -215,7 +227,7 @@ install: $(addprefix install-, $(DEP_LIBS))
cleanall: $(addprefix clean-, $(DEP_LIBS))
distcleanall: $(addprefix distclean-, $(DEP_LIBS))
rm -rf $(build_prefix)
getall: get-llvm get-libuv get-pcre get-openlibm get-openspecfun get-dsfmt get-Rmath-julia get-openblas get-lapack get-fftw get-suitesparse get-arpack get-unwind get-osxunwind get-gmp get-mpfr get-patchelf get-utf8proc get-virtualenv get-objconv get-libgit2
getall: get-llvm get-libuv get-pcre get-openlibm get-openspecfun get-dsfmt get-Rmath-julia get-openblas get-lapack get-fftw get-suitesparse get-arpack get-unwind get-osxunwind get-gmp get-mpfr get-patchelf get-utf8proc get-virtualenv get-objconv get-http_parser get-mbedtls get-libssh2 get-libgit2

## PATHS ##
# sort is used to remove potential duplicates
Expand Down Expand Up @@ -264,6 +276,9 @@ include $(SRCDIR)/gmp.mk
include $(SRCDIR)/mpfr.mk
include $(SRCDIR)/patchelf.mk
include $(SRCDIR)/git.mk
include $(SRCDIR)/http_parser.mk
include $(SRCDIR)/mbedtls.mk
include $(SRCDIR)/libssh2.mk
include $(SRCDIR)/libgit2.mk
include $(SRCDIR)/virtualenv.mk

Expand Down
33 changes: 4 additions & 29 deletions deps/libgit2.mk
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
## libgit2

LIBGIT2_GIT_URL := git://github.com/libgit2/libgit2.git
LIBGIT2_TAR_URL = https://api.github.com/repos/libgit2/libgit2/tarball/$1
LIBGIT2_GIT_URL := git://github.com/wildart/libgit2.git
LIBGIT2_TAR_URL = https://api.github.com/repos/wildart/libgit2/tarball/$1
$(eval $(call git-external,libgit2,LIBGIT2,CMakeLists.txt,build/libgit2.$(SHLIB_EXT),$(SRCDIR)/srccache))

LIBGIT2_OBJ_SOURCE := $(BUILDDIR)/$(LIBGIT2_SRC_DIR)/libgit2.$(SHLIB_EXT)
LIBGIT2_OBJ_TARGET := $(build_shlibdir)/libgit2.$(SHLIB_EXT)

LIBGIT2_OPTS := $(CMAKE_COMMON) -DTHREADSAFE=ON -DCMAKE_PREFIX_PATH=$(build_prefix)
ifeq ($(OS),WINNT)
LIBGIT2_OPTS += -DWIN32=ON -DMINGW=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
ifneq ($(ARCH),x86_64)
LIBGIT2_OPTS += -DCMAKE_C_FLAGS="-mincoming-stack-boundary=2"
endif
ifeq ($(BUILD_OS),WINNT)
LIBGIT2_OPTS += -G"MSYS Makefiles"
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 += -DCMAKE_BUILD_TYPE=Release
endif
LIBGIT2_OPTS := $(CMAKE_COMMON) -DUSE_OPENSSL=OFF -DTHREADSAFE=ON -DCMAKE_PREFIX_PATH=$(build_prefix) -DCMAKE_INSTALL_RPATH=$(build_prefix) -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_BUILD_TYPE=Release

$(BUILDDIR)/$(LIBGIT2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR)/CMakeLists.txt
-cd $(SRCDIR)/srccache/$(LIBGIT2_SRC_DIR) && patch -p1 -f < $(SRCDIR)/patches/libgit2-require-openssl.patch
mkdir -p $(dir $@)
cd $(dir $@) && \
$(CMAKE) $(dir $<) $(LIBGIT2_OPTS)
Expand All @@ -38,17 +23,7 @@ ifeq ($(OS),$(BUILD_OS))
endif
echo 1 > $@
$(LIBGIT2_OBJ_TARGET): $(LIBGIT2_OBJ_SOURCE) | $(build_shlibdir)
cp $< $@
@#$$(call make-install,$(LIBGIT2_SRC_DIR),) # currently don't need the full install
ifeq ($(OS),Linux)
@# If we're on linux, copy over libssl and libcrypto for libgit2

This comment has been minimized.

Copy link
@tkelman

tkelman Jun 30, 2016

Contributor

there are related lines in the main makefile that also need to be removed

-LIBGIT_LIBS=$$(ldd "$@" | tail -n +2 | awk '{print $$(NF-1)}'); \
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); \
done
endif
$(call make-install,$(LIBGIT2_SRC_DIR),)
touch -c $@

clean-libgit2:
Expand Down
4 changes: 2 additions & 2 deletions deps/libgit2.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LIBGIT2_BRANCH=v0.24.0
LIBGIT2_SHA1=785d8c48ea8725691da3c50e7dae8751523d4c30
LIBGIT2_BRANCH=mbedtls
LIBGIT2_SHA1=d0bf6a7d063a695e5be262fcc13ff12092ddef1d
4 changes: 2 additions & 2 deletions deps/libssh2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(eval $(call git-external,libssh2,LIBSSH2,CMakeLists.txt,build/libssh2.$(SHLIB_
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 -DENABLE_ZLIB_COMPRESSION=ON -DBUILD_EXAMPLES=OFF -DCMAKE_PREFIX_PATH=$(build_prefix) -DCMAKE_BUILD_TYPE=Release
LIBSSH2_OPTS := $(CMAKE_COMMON) -DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON -DBUILD_EXAMPLES=OFF -DCMAKE_PREFIX_PATH=$(build_prefix) -DCMAKE_INSTALL_RPATH=$(build_prefix) -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_BUILD_TYPE=Release
ifeq ($(BUILD_OS),WINNT)
LIBSSH2_OPTS += -DCRYPTO_BACKEND=WinCNG
else
Expand All @@ -21,7 +21,7 @@ $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(LIBSSH2_SRC_DIR)/C
touch -c $@

$(LIBSSH2_OBJ_SOURCE): $(BUILDDIR)/$(LIBSSH2_SRC_DIR)/Makefile
$(MAKE) -C $(dir $<)
$(MAKE) -C $(dir $<) libssh2
touch -c $@

$(BUILDDIR)/$(LIBSSH2_SRC_DIR)/checked: $(LIBSSH2_OBJ_SOURCE)
Expand Down
10 changes: 2 additions & 8 deletions deps/mbedtls.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ $(eval $(call git-external,mbedtls,MBEDTLS,CMakeLists.txt,build/libmbedtls.$(SHL
MBEDTLS_OBJ_SOURCE := $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/library/libmbedtls.$(SHLIB_EXT) $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/library/libmbedx509.$(SHLIB_EXT) $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/library/libmbedcrypto.$(SHLIB_EXT)
MBEDTLS_OBJ_TARGET := $(build_shlibdir)/libmbedtls.$(SHLIB_EXT) $(build_shlibdir)/libmbedx509.$(SHLIB_EXT) $(build_shlibdir)/libmbedcrypto.$(SHLIB_EXT)

#-DCMAKE_PREFIX_PATH=$(build_prefix)
MBEDTLS_OPTS := $(CMAKE_COMMON) -DUSE_SHARED_MBEDTLS_LIBRARY=ON -DENABLE_PROGRAMS=OFF -DENABLE_ZLIB_SUPPORT=ON -DENABLE_TESTING=OFF
ifeq ($(OS),WINNT)
MBEDTLS_OPTS += -DCMAKE_BUILD_TYPE=RelWithDebInfo
else
MBEDTLS_OPTS += -DCMAKE_BUILD_TYPE=Release
endif
MBEDTLS_OPTS := $(CMAKE_COMMON) -DUSE_SHARED_MBEDTLS_LIBRARY=ON -DENABLE_PROGRAMS=OFF -DENABLE_ZLIB_SUPPORT=ON -DENABLE_TESTING=OFF -DCMAKE_INSTALL_RPATH=$(build_prefix) -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_BUILD_TYPE=Release

$(BUILDDIR)/$(MBEDTLS_SRC_DIR)/Makefile: $(SRCDIR)/srccache/$(MBEDTLS_SRC_DIR)/CMakeLists.txt
-cd $(SRCDIR)/srccache/$(MBEDTLS_SRC_DIR) && patch -p0 -f < $(SRCDIR)/mbedtls.patch
Expand Down Expand Up @@ -44,4 +38,4 @@ get-mbedtls: $(MBEDTLS_SRC_FILE)
configure-mbedtls: $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/Makefile
compile-mbedtls: $(MBEDTLS_OBJ_SOURCE)
check-mbedtls: $(BUILDDIR)/$(MBEDTLS_SRC_DIR)/checked
install-mbedtls: $(MBEDTLS_OBJ_TARGET)
install-mbedtls: $(MBEDTLS_OBJ_TARGET)

0 comments on commit 55bd933

Please sign in to comment.