aboutsummaryrefslogtreecommitdiff
path: root/contrib/depends/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/depends/Makefile')
-rw-r--r--contrib/depends/Makefile48
1 files changed, 46 insertions, 2 deletions
diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile
index dedb0674c..be81626b1 100644
--- a/contrib/depends/Makefile
+++ b/contrib/depends/Makefile
@@ -61,7 +61,15 @@ $(host_arch)_$(host_os)_prefix=$(BASEDIR)/$(host)
$(host_arch)_$(host_os)_host=$(host)
host_prefix=$($(host_arch)_$(host_os)_prefix)
build_prefix=$(host_prefix)/native
-build_host=$(build)
+ifeq ($(host_os),mingw32)
+host_cmake=Windows
+endif
+ifeq ($(host_os),linux)
+host_cmake=Linux
+endif
+ifeq ($(host_os),darwin11)
+host_cmake=Darwin
+endif
AT_$(V):=
AT_:=@
@@ -108,8 +116,18 @@ $(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain)
include funcs.mk
+CONF_PKGS := cmake-conf mxe-conf
+
+build-only-$(1)_$(3): CMAKE_RUNRESULT_FILE = $(PREFIX)/share/cmake/modules/TryRunResults.cmake
+build-only-$(1)_$(3): CMAKE_TOOLCHAIN_FILE = $(PREFIX)/$(3)/share/cmake/mxe-conf.cmake
+build-only-$(1)_$(3): CMAKE_TOOLCHAIN_DIR = $(PREFIX)/$(3)/share/cmake/mxe-conf.d
+build-only-$(1)_$(3): CMAKE_STATIC_BOOL = $(if $(findstring shared,$(3)),OFF,ON)
+build-only-$(1)_$(3): CMAKE_SHARED_BOOL = $(if $(findstring shared,$(3)),ON,OFF)
+
+
toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin)
final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
+final_build_id_long+=$(shell $(build_SHA256SUM) toolchain.cmake.in)
final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))
$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
$(AT)rm -rf $(@D)
@@ -134,6 +152,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
-e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
-e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
-e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
+ -e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
-e 's|@no_qt@|$(NO_QT)|' \
-e 's|@no_wallet@|$(NO_WALLET)|' \
-e 's|@no_upnp@|$(NO_UPNP)|' \
@@ -141,6 +160,30 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
$< > $@
$(AT)touch $@
+$(host_prefix)/share/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(final_build_id)
+ $(AT)@mkdir -p $(@D)
+ $(AT)sed -e 's|@HOST@|$(host)|' \
+ -e 's|@CC@|$(toolchain_path)$(host_CC)|' \
+ -e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \
+ -e 's|@AR@|$(toolchain_path)$(host_AR)|' \
+ -e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \
+ -e 's|@NM@|$(toolchain_path)$(host_NM)|' \
+ -e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \
+ -e 's|@build_os@|$(build_os)|' \
+ -e 's|@host_os@|$(host_os)|' \
+ -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \
+ -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
+ -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
+ -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
+ -e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
+ -e 's|@no_qt@|$(NO_QT)|' \
+ -e 's|@no_wallet@|$(NO_WALLET)|' \
+ -e 's|@no_upnp@|$(NO_UPNP)|' \
+ -e 's|@debug@|$(DEBUG)|' \
+ -e 's|@depends@|$(host_cmake)|' \
+ -e 's|@prefix@|$($(host_arch)_$(host_os)_prefix)|'\
+ $< > $@
+ $(AT)touch $@
define check_or_remove_cached
mkdir -p $(BASE_CACHE)/$(host)/$(package) && cd $(BASE_CACHE)/$(host)/$(package); \
@@ -162,11 +205,12 @@ check-sources:
@$(foreach package,$(all_packages),$(call check_or_remove_sources,$(package));)
$(host_prefix)/share/config.site: check-packages
+$(host_prefix)/share/toolchain.cmake: check-packages
check-packages: check-sources
install: check-packages $(host_prefix)/share/config.site
-
+install: check-packages $(host_prefix)/share/toolchain.cmake
download-one: check-sources $(all_sources)