diff --git a/Makefile.am b/Makefile.am index 3c83a27..de4c4a5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,8 +8,6 @@ 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 \ @@ -19,12 +17,10 @@ minerd_SOURCES = elist.h miner.h compat.h \ 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 +## Uncomment on MSYS2 Windows build only: +# 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@ - +minerd_CPPFLAGS = $(PTHREAD_FLAGS) -fno-strict-aliasing $(JANSSON_INCLUDES) -fPIC @LIBCURL_CPPFLAGS@ diff --git a/README b/README index fa9fc0a..c623a8c 100644 --- a/README +++ b/README @@ -3,9 +3,16 @@ Run with your gostcoin wallet app ./minerd -a gostd -t -o http://127.0.0.1:9376 -u -p ``` +Building on most linux distributions. Install libcurl and libjansson development packages first! +```bash +./autogen.sh +LIBCURL="-lcurl" ./configure CFLAGS="-O3" +make +``` + Building on Windows is possible with MSYS2. ```bash ./autogen.sh ./configure CFLAGS="-O3 -DCURL_STATICLIB" --with-libcurl=compat/curl-win-x86_64 make -``` \ No newline at end of file +``` diff --git a/autogen.sh b/autogen.sh old mode 100644 new mode 100755 diff --git a/m4/libcurl.m4 b/m4/libcurl.m4 index e21afd3..ad53a44 100644 --- a/m4/libcurl.m4 +++ b/m4/libcurl.m4 @@ -1,3 +1,24 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) 2006 - 2020, David Shaw +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +########################################################################### # LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], # [ACTION-IF-YES], [ACTION-IF-NO]) # ---------------------------------------------------------- @@ -61,7 +82,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], AH_TEMPLATE([LIBCURL_PROTOCOL_SMTP],[Defined if libcurl supports SMTP]) AC_ARG_WITH(libcurl, - AC_HELP_STRING([--with-libcurl=PREFIX],[look for the curl library in PREFIX/lib and headers in PREFIX/include]), + AS_HELP_STRING([--with-libcurl=PREFIX],[look for the curl library in PREFIX/lib and headers in PREFIX/include]), [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])]) if test "$_libcurl_with" != "no" ; then @@ -73,6 +94,7 @@ 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"]) @@ -105,7 +127,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG], LIBCURL_CPPFLAGS=`$_libcurl_config --cflags` fi if test x"$LIBCURL" = "x" ; then - LIBCURL=`$_libcurl_config --static-libs` + LIBCURL=`$_libcurl_config --libs` # This is so silly, but Apple actually has a bug in their # curl-config script. Fixed in Tiger, but there are still @@ -152,11 +174,11 @@ int x; curl_easy_setopt(NULL,CURLOPT_URL,NULL); x=CURL_ERROR_SIZE; x=CURLOPT_WRITEFUNCTION; -x=CURLOPT_FILE; +x=CURLOPT_WRITEDATA; x=CURLOPT_ERRORBUFFER; x=CURLOPT_STDERR; x=CURLOPT_VERBOSE; -if (x) ; +if (x) {;} ]])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no) CPPFLAGS=$_libcurl_save_cppflags