From 280abe79388e6effecbf409e6588b28fd5132428 Mon Sep 17 00:00:00 2001 From: R4SAS Date: Sat, 26 May 2018 00:48:21 +0300 Subject: [PATCH] some modifications for windows static building --- Makefile.am | 26 ++++++++++++++------------ compat.h | 3 ++- cpu-miner.c | 3 ++- cpuminer-config.h | 8 ++++---- m4/libcurl.m4 | 3 +-- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Makefile.am b/Makefile.am index 76d70c5..3c83a27 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,3 @@ - if WANT_JANSSON JANSSON_INCLUDES= -I$(top_srcdir)/compat/jansson else @@ -6,23 +5,26 @@ JANSSON_INCLUDES= endif ACLOCAL_AMFLAGS = -I m4 - EXTRA_DIST = example-cfg.json nomacro.pl - SUBDIRS = compat INCLUDES = $(PTHREAD_FLAGS) -fno-strict-aliasing $(JANSSON_INCLUDES) bin_PROGRAMS = minerd - minerd_SOURCES = elist.h miner.h compat.h \ - cpu-miner.c util.c \ - sha2.c sha2-arm.S sha2-x86.S sha2-x64.S \ - scrypt.c scrypt-arm.S scrypt-x86.S scrypt-x64.S \ - blake.c bmw.c groestl.c jh.c keccak.c skein.c \ - aes_helper.c cubehash.c shavite.c simd.c echo.c luffa.c\ - quark.c gost.c Xcoin.c -minerd_LDFLAGS = $(PTHREAD_FLAGS) -minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@ + cpu-miner.c util.c \ + sha2.c sha2-arm.S sha2-x86.S sha2-x64.S \ + scrypt.c scrypt-arm.S scrypt-x86.S scrypt-x64.S \ + blake.c bmw.c groestl.c jh.c keccak.c skein.c \ + aes_helper.c cubehash.c shavite.c simd.c echo.c luffa.c\ + quark.c gost.c Xcoin.c + +# Linux (default) +#minerd_LDFLAGS = $(PTHREAD_FLAGS) +# Windows +minerd_LDFLAGS = $(PTHREAD_FLAGS) -Wl,-Bstatic -static-libgcc +minerd_DEFS = -DCURL_STATICLIB -DWIN32 -DWIN32_LEAN_AND_MEAN + +minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@ minerd_CPPFLAGS = @LIBCURL_CPPFLAGS@ diff --git a/compat.h b/compat.h index cb76309..67c3e6a 100644 --- a/compat.h +++ b/compat.h @@ -5,10 +5,11 @@ #include -static inline void sleep(int secs) +/* static inline void sleep(int secs) { Sleep(secs * 1000); } +*/ enum { PRIO_PROCESS = 0, diff --git a/cpu-miner.c b/cpu-miner.c index dab312c..82deea8 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -172,10 +172,11 @@ static char const usage[] = "\ Usage: " PROGRAM_NAME " [OPTIONS]\n\ Options:\n\ -a, --algo=ALGO specify the algorithm to use\n\ + gostd GOSTcoin\n\ scrypt scrypt(1024, 1, 1) (default)\n\ sha256d SHA-256d\n\ quark Quarkcoin\n\ - X11 Xcoin\n\ + X11 Xcoin\n\ -o, --url=URL URL of mining server (default: " DEF_RPC_URL ")\n\ -O, --userpass=U:P username:password pair for mining server\n\ -u, --user=USERNAME username for mining server\n\ diff --git a/cpuminer-config.h b/cpuminer-config.h index 9cce557..34597d4 100644 --- a/cpuminer-config.h +++ b/cpuminer-config.h @@ -14,7 +14,7 @@ /* Define to 1 if you have and it should be used (not on Ultrix). */ -#define HAVE_ALLOCA_H 1 +/* #undef HAVE_ALLOCA_H */ /* Define to 1 if you have the declaration of `be32dec', and to 0 if you don't. */ @@ -57,7 +57,7 @@ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYSLOG_H 1 +/* #undef HAVE_SYSLOG_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_ENDIAN_H */ @@ -69,7 +69,7 @@ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYS_SYSCTL_H 1 +/* #undef HAVE_SYS_SYSCTL_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 @@ -81,7 +81,7 @@ #define LIBCURL_FEATURE_ASYNCHDNS 1 /* Defined if libcurl supports IDN */ -#define LIBCURL_FEATURE_IDN 1 +/* #undef LIBCURL_FEATURE_IDN */ /* Defined if libcurl supports IPv6 */ #define LIBCURL_FEATURE_IPV6 1 diff --git a/m4/libcurl.m4 b/m4/libcurl.m4 index d7d5a52..e21afd3 100644 --- a/m4/libcurl.m4 +++ b/m4/libcurl.m4 @@ -73,7 +73,6 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], _libcurl_try_link=yes if test -d "$_libcurl_with" ; then - LIBCURL_CPPFLAGS="-I$withval/include" _libcurl_ldflags="-L$withval/lib" AC_PATH_PROG([_libcurl_config],[curl-config],[], ["$withval/bin"]) @@ -106,7 +105,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` fi if test x"$LIBCURL" = "x" ; then - LIBCURL=`$_libcurl_config --libs` + LIBCURL=`$_libcurl_config --static-libs` # This is so silly, but Apple actually has a bug in their # curl-config script. Fixed in Tiger, but there are still