Skip to content

Commit

Permalink
compile directly on windows 10
Browse files Browse the repository at this point in the history
  • Loading branch information
janko33bd committed Feb 1, 2018
1 parent 6019e86 commit 8abc38d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 5 deletions.
3 changes: 2 additions & 1 deletion depends/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ full_host_os:=$(subst $(host_arch)-$(host_vendor)-,,$(canonical_host))
host_os:=$(findstring linux,$(full_host_os))
host_os+=$(findstring darwin,$(full_host_os))
host_os+=$(findstring mingw32,$(full_host_os))
host_os+=$(findstring mingw64,$(full_host_os))
host_os:=$(strip $(host_os))
ifeq ($(host_os),)
host_os=$(full_host_os)
Expand Down Expand Up @@ -175,7 +176,7 @@ download-osx:
download-linux:
@$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one
download-win:
@$(MAKE) -s HOST=x86_64-w64-mingw32 download-one
@$(MAKE) -s HOST=x86_64-pc-mingw64 download-one
download: download-osx download-linux download-win

.PHONY: install cached download-one download-osx download-linux download-win download check-packages check-sources
2 changes: 2 additions & 0 deletions depends/builders/mingw32.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build_mingw32_SHA256SUM = sha256sum.exe
build_mingw32_DOWNLOAD = wget.exe --timeout=$(DOWNLOAD_CONNECT_TIMEOUT) --tries=$(DOWNLOAD_RETRIES) -nv -O
2 changes: 2 additions & 0 deletions depends/builders/mingw64.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build_mingw64_SHA256SUM = sha256sum.exe
build_mingw64_DOWNLOAD = wget.exe --timeout=$(DOWNLOAD_CONNECT_TIMEOUT) --tries=$(DOWNLOAD_RETRIES) -nv -O
15 changes: 12 additions & 3 deletions depends/hosts/mingw32.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
mingw32_CFLAGS=-pipe
mingw32_CXXFLAGS=$(mingw32_CFLAGS)
mingw32_CC = gcc.exe
mingw32_CXX = g++.exe
mingw32_AR = ar.exe
mingw32_RANLIB = ranlib.exe
mingw32_STRIP = strip.exe
mingw32_NM = nm.exe
mingw22_SHA256SUM = sha256sum.exe


mingw32_CFLAGS=-pipe -DPTW32_STATIC_LIB
mingw32_CXXFLAGS=-pipe -DPTW32_STATIC_LIB

mingw32_release_CFLAGS=-O2
mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS)

mingw32_debug_CFLAGS=-O1
mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS)

mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
19 changes: 19 additions & 0 deletions depends/hosts/mingw64.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
mingw64_CC = gcc.exe
mingw64_CXX = g++.exe
mingw64_AR = ar.exe
mingw64_RANLIB = ranlib.exe
mingw64_STRIP = strip.exe
mingw64_NM = nm.exe
mingw64_SHA256SUM = sha256sum.exe


mingw64_CFLAGS=-pipe -DPTW32_STATIC_LIB
mingw64_CXXFLAGS=-pipe -DPTW32_STATIC_LIB

mingw64_release_CFLAGS=-O2
mingw64_release_CXXFLAGS=$(mingw64_release_CFLAGS)

mingw64_debug_CFLAGS=-O1
mingw64_debug_CXXFLAGS=$(mingw64_debug_CFLAGS)

mingw64_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
6 changes: 5 additions & 1 deletion depends/packages/boost.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ $(package)_version=1_64_0
$(package)_download_path=https://dl.bintray.com/boostorg/release/1.64.0/source/
$(package)_file_name=$(package)_$($(package)_version).tar.bz2
$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332
$(package)_patches=fix-compiler-warning-converting-from-null-on-windows.patch

define $(package)_set_vars
$(package)_config_opts_release=variant=release
Expand All @@ -12,7 +13,9 @@ $(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
$(package)_config_opts_mingw64=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
$(package)_config_opts_x86_64_mingw32=address-model=64
$(package)_config_opts_x86_64_mingw64=address-model=64
$(package)_config_opts_i686_mingw32=address-model=32
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
$(package)_toolset_$(host_os)=gcc
Expand All @@ -25,7 +28,8 @@ $(package)_cxxflags_linux=-fPIC
endef

define $(package)_preprocess_cmds
echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$(boost_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$(boost_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam && \
patch -p1 < $($(package)_patch_dir)/fix-compiler-warning-converting-from-null-on-windows.patch
endef

define $(package)_config_cmds
Expand Down
1 change: 1 addition & 0 deletions depends/packages/openssl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ $(package)_config_opts_mips_linux=linux-generic32
$(package)_config_opts_powerpc_linux=linux-generic32
$(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc
$(package)_config_opts_x86_64_mingw32=mingw64
$(package)_config_opts_x86_64_mingw64=mingw64
$(package)_config_opts_i686_mingw32=mingw
endef

Expand Down

0 comments on commit 8abc38d

Please sign in to comment.