SHARE
TWEET

Untitled

a guest Dec 16th, 2017 373 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/configure.ac b/configure.ac
  2. index 04cafa9..0e6cde2 100644
  3. --- a/configure.ac
  4. +++ b/configure.ac
  5. @@ -436,11 +436,13 @@ if test x$use_hardening != xno; then
  6.      HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
  7.    ],[AC_MSG_ERROR(Cannot enable -D_FORTIFY_SOURCE=2)])
  8.  
  9. -  AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"],[AC_MSG_ERROR(Cannot enable RELRO)])
  10. -  AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"],[AC_MSG_ERROR(Cannot enable BIND_NOW)])
  11.  
  12.    if test x$TARGET_OS != xwindows; then
  13.      # All windows code is PIC, forcing it on just adds useless compile warnings
  14. +
  15. +  AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"],[AC_MSG_ERROR(Cannot enable RELRO)])
  16. +  AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"],[AC_MSG_ERROR(Cannot enable BIND_NOW)])
  17. +
  18.      AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"],[AC_MSG_ERROR(Cannot enable -fPIE)])
  19.      AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"],[AC_MSG_ERROR(Cannot enable -pie)])
  20.    else
  21. diff --git a/depends/builders/mingw32.mk b/depends/builders/mingw32.mk
  22. new file mode 100644
  23. index 0000000..1363785
  24. --- /dev/null
  25. +++ b/depends/builders/mingw32.mk
  26. @@ -0,0 +1,2 @@
  27. +build_minge32_SHA256SUM = sha256sum
  28. +build_minge32_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
  29. diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk
  30. index dbfb62f..3f8ef32 100644
  31. --- a/depends/hosts/mingw32.mk
  32. +++ b/depends/hosts/mingw32.mk
  33. @@ -1,3 +1,5 @@
  34. +mingw32_CC=x86_64-w64-mingw32-gcc-posix
  35. +mingw32_CXX=x86_64-w64-mingw32-g++-posix
  36.  mingw32_CFLAGS=-pipe
  37.  mingw32_CXXFLAGS=$(mingw32_CFLAGS)
  38.  
  39. diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk
  40. index 1134e94..1471c7f 100644
  41. --- a/depends/packages/bdb.mk
  42. +++ b/depends/packages/bdb.mk
  43. @@ -9,18 +9,16 @@ define $(package)_set_vars
  44.  $(package)_config_opts=--disable-shared --enable-cxx --disable-replication
  45.  $(package)_config_opts_mingw32=--enable-mingw
  46.  $(package)_config_opts_linux=--with-pic
  47. -$(package)_cxxflags=-std=c++11
  48. -endef
  49. -
  50. -define $(package)_preprocess_cmds
  51. -  sed -i.old 's/__atomic_compare_exchange\\(/__atomic_compare_exchange_db(/' src/dbinc/atomic.h && \
  52. -  sed -i.old 's/atomic_init/atomic_init_db/' src/dbinc/atomic.h src/mp/mp_region.c src/mp/mp_mvcc.c src/mp/mp_fget.c src/mutex/mut_method.c src/mutex/mut_tas.c
  53.  endef
  54.  
  55.  define $(package)_config_cmds
  56.    ../dist/$($(package)_autoconf)
  57.  endef
  58.  
  59. +define $(package)_preprocess_cmds
  60. +   sed -i "s/WinIoCtl.h/winioctl.h/g" src/dbinc/win_db.h
  61. + endef
  62. +
  63.  define $(package)_build_cmds
  64.    $(MAKE) libdb_cxx-6.2.a libdb-6.2.a
  65.  endef
  66. diff --git a/depends/packages/rust.mk b/depends/packages/rust.mk
  67. index f61dd22..cdefbdb 100644
  68. --- a/depends/packages/rust.mk
  69. +++ b/depends/packages/rust.mk
  70. @@ -1,10 +1,8 @@
  71.  package=rust
  72.  $(package)_version=1.16.0
  73.  $(package)_download_path=https://static.rust-lang.org/dist
  74. -$(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
  75. -$(package)_sha256_hash_linux=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd
  76. -$(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz
  77. -$(package)_sha256_hash_darwin=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926
  78. +$(package)_file_name=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
  79. +$(package)_sha256_hash=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd
  80.  
  81.  define $(package)_stage_cmds
  82.    ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig
  83. diff --git a/src/metrics.cpp b/src/metrics.cpp
  84. index 6a17f93..72294d3 100644
  85. --- a/src/metrics.cpp
  86. +++ b/src/metrics.cpp
  87. @@ -16,7 +16,14 @@
  88.  #include <boost/thread.hpp>
  89.  #include <boost/thread/synchronized_value.hpp>
  90.  #include <string>
  91. +
  92. +#ifdef WIN32
  93. +#include <io.h>
  94. +#include <windows.h>
  95. +#else
  96.  #include <sys/ioctl.h>
  97. +#endif
  98. +
  99.  #include <unistd.h>
  100.  
  101.  void AtomicTimer::start()
  102. @@ -444,11 +451,18 @@ void ThreadShowMetricsScreen()
  103.  
  104.          // Get current window size
  105.          if (isTTY) {
  106. +        #ifdef WIN32
  107. +   CONSOLE_SCREEN_BUFFER_INFO csbi;
  108. +   GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
  109. +        cols = csbi.srWindow.Right - csbi.srWindow.Left + 1;
  110. +        #else
  111. +     cols = 80;
  112.              struct winsize w;
  113.              w.ws_col = 0;
  114.              if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1 && w.ws_col != 0) {
  115.                  cols = w.ws_col;
  116.              }
  117. +        #endif
  118.          }
  119.  
  120.          if (isScreen) {
  121. diff --git a/zcutil/build-win64.sh b/zcutil/build-win64.sh
  122. new file mode 100644
  123. index 0000000..f886661
  124. --- /dev/null
  125. +++ b/zcutil/build-win64.sh
  126. @@ -0,0 +1,17 @@
  127. +#!/bin/bash
  128. +HOST=x86_64-w64-mingw32
  129. +CXX=x86_64-w64-mingw32-g++-posix
  130. +CC=x86_64-w64-mingw32-gcc-posix
  131. +PREFIX="$(pwd)/depends/$HOST"
  132. +
  133. +set -eu -o pipefail
  134. +
  135. +set -x
  136. +cd "$(dirname "$(readlink -f "$0")")/.."
  137. +
  138. +cd depends/ && make HOST=$HOST V=1 NO_QT=1 && cd ../
  139. +./autogen.sh
  140. +CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site CXXFLAGS+=" -fopenmp" ./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw32 --enable-static --disable-shared --disable-zmq --disable-rust
  141. +sed -i 's/-lboost_system-mt /-lboost_system-mt-s /' configure
  142. +cd src/
  143. +CC="${CC}" CXX="${CXX}" make V=1 -j4 kotod.exe koto-cli.exe koto-tx.exe
  144. \ No newline at end of file
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top