Support for building on MinGW
- Fix dependency on libws2_32 - Update build instructions in the README - Drop mknsis.sh
This commit is contained in:
parent
8d326a4439
commit
a9c46369e8
4 changed files with 26 additions and 52 deletions
|
@ -16,6 +16,6 @@ bin_PROGRAMS = minerd
|
||||||
minerd_SOURCES = elist.h miner.h compat.h \
|
minerd_SOURCES = elist.h miner.h compat.h \
|
||||||
cpu-miner.c util.c scrypt.c scrypt-x86.S scrypt-x64.S
|
cpu-miner.c util.c scrypt.c scrypt-x86.S scrypt-x64.S
|
||||||
minerd_LDFLAGS = $(PTHREAD_FLAGS)
|
minerd_LDFLAGS = $(PTHREAD_FLAGS)
|
||||||
minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@
|
minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@
|
||||||
minerd_CPPFLAGS = @LIBCURL_CPPFLAGS@
|
minerd_CPPFLAGS = @LIBCURL_CPPFLAGS@
|
||||||
|
|
||||||
|
|
19
README
19
README
|
@ -3,6 +3,9 @@ reference cpuminer.
|
||||||
|
|
||||||
License: GPLv2. See COPYING for details.
|
License: GPLv2. See COPYING for details.
|
||||||
|
|
||||||
|
Downloads: https://github.com/pooler/cpuminer/downloads
|
||||||
|
Git tree: https://github.com/pooler/cpuminer
|
||||||
|
|
||||||
Dependencies:
|
Dependencies:
|
||||||
libcurl http://curl.haxx.se/libcurl/
|
libcurl http://curl.haxx.se/libcurl/
|
||||||
jansson http://www.digip.org/jansson/
|
jansson http://www.digip.org/jansson/
|
||||||
|
@ -14,12 +17,16 @@ Basic *nix build instructions:
|
||||||
./configure CFLAGS="-O3"
|
./configure CFLAGS="-O3"
|
||||||
make
|
make
|
||||||
|
|
||||||
Basic WIN32 build instructions (on Fedora 13; requires mingw32):
|
Basic Windows build instructions, using MinGW:
|
||||||
./autogen.sh # only needed if building from git repo
|
Install MinGW and the MSYS Developer Tool Kit (http://www.mingw.org/)
|
||||||
rm -f mingw32-config.cache
|
* Make sure you have mstcpip.h in MinGW\include
|
||||||
MINGW32_CFLAGS="-O3" mingw32-configure
|
Install libcurl devel (http://curl.haxx.se/download.html)
|
||||||
make
|
* Make sure you have libcurl.m4 in MinGW\share\aclocal
|
||||||
./mknsis.sh
|
* Make sure you have curl-config in MinGW\bin
|
||||||
|
In the MSYS shell, run:
|
||||||
|
./autogen.sh # only needed if building from git repo
|
||||||
|
LIBCURL="-lcurldll" ./configure CFLAGS="-O3"
|
||||||
|
make
|
||||||
|
|
||||||
Usage instructions: Run "minerd --help" to see options.
|
Usage instructions: Run "minerd --help" to see options.
|
||||||
|
|
||||||
|
|
24
configure.ac
24
configure.ac
|
@ -23,23 +23,25 @@ AC_CHECK_HEADERS(syslog.h)
|
||||||
AC_FUNC_ALLOCA
|
AC_FUNC_ALLOCA
|
||||||
|
|
||||||
case $target in
|
case $target in
|
||||||
*-*-mingw*)
|
|
||||||
have_x86_64=false
|
|
||||||
have_win32=true
|
|
||||||
PTHREAD_FLAGS=""
|
|
||||||
;;
|
|
||||||
x86_64-*)
|
x86_64-*)
|
||||||
have_x86_64=true
|
have_x86_64=true
|
||||||
have_win32=false
|
|
||||||
PTHREAD_FLAGS="-pthread"
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
have_x86_64=false
|
have_x86_64=false
|
||||||
have_win32=false
|
|
||||||
PTHREAD_FLAGS="-pthread"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
have_win32=false
|
||||||
|
PTHREAD_FLAGS="-pthread"
|
||||||
|
WS2_LIBS=""
|
||||||
|
|
||||||
|
case $target in
|
||||||
|
*-*-mingw*)
|
||||||
|
have_win32=true
|
||||||
|
PTHREAD_FLAGS=""
|
||||||
|
WS2_LIBS="-lws2_32"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
AC_CHECK_LIB(jansson, json_loads, request_jansson=false, request_jansson=true)
|
AC_CHECK_LIB(jansson, json_loads, request_jansson=false, request_jansson=true)
|
||||||
AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS=-lpthread)
|
AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIBS=-lpthread)
|
||||||
|
@ -55,14 +57,13 @@ else
|
||||||
JANSSON_LIBS=-ljansson
|
JANSSON_LIBS=-ljansson
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PKG_PROG_PKG_CONFIG()
|
|
||||||
|
|
||||||
LIBCURL_CHECK_CONFIG(, 7.10.1, ,
|
LIBCURL_CHECK_CONFIG(, 7.10.1, ,
|
||||||
[AC_MSG_ERROR([Missing required libcurl >= 7.10.1])])
|
[AC_MSG_ERROR([Missing required libcurl >= 7.10.1])])
|
||||||
|
|
||||||
AC_SUBST(JANSSON_LIBS)
|
AC_SUBST(JANSSON_LIBS)
|
||||||
AC_SUBST(PTHREAD_FLAGS)
|
AC_SUBST(PTHREAD_FLAGS)
|
||||||
AC_SUBST(PTHREAD_LIBS)
|
AC_SUBST(PTHREAD_LIBS)
|
||||||
|
AC_SUBST(WS2_LIBS)
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
|
@ -70,4 +71,3 @@ AC_CONFIG_FILES([
|
||||||
compat/jansson/Makefile
|
compat/jansson/Makefile
|
||||||
])
|
])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
|
33
mknsis.sh
33
mknsis.sh
|
@ -1,33 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
MINGW_PATH=/usr/i686-pc-mingw32/sys-root/mingw/bin
|
|
||||||
|
|
||||||
OUT_BASE="cpuminer-installer"
|
|
||||||
OUT_EXE="$OUT_BASE.exe"
|
|
||||||
|
|
||||||
PATH=$PATH:$MINGW_PATH \
|
|
||||||
nsiswrapper --run \
|
|
||||||
--name "CPU miner" \
|
|
||||||
--outfile "$OUT_EXE" \
|
|
||||||
minerd.exe \
|
|
||||||
$MINGW_PATH/libcurl-4.dll=libcurl-4.dll \
|
|
||||||
$MINGW_PATH/pthreadgc2.dll=pthreadgc2.dll \
|
|
||||||
$MINGW_PATH/libidn-11.dll=libidn-11.dll \
|
|
||||||
$MINGW_PATH/libssh2-1.dll=libssh2-1.dll \
|
|
||||||
$MINGW_PATH/libssl-10.dll=libssl-10.dll \
|
|
||||||
$MINGW_PATH/zlib1.dll=zlib1.dll \
|
|
||||||
$MINGW_PATH/libcrypto-10.dll=libcrypto-10.dll \
|
|
||||||
$MINGW_PATH/libiconv-2.dll=libiconv-2.dll \
|
|
||||||
$MINGW_PATH/libintl-8.dll=libintl-8.dll
|
|
||||||
|
|
||||||
chmod 0755 "$OUT_EXE"
|
|
||||||
zip -9 "$OUT_BASE" "$OUT_EXE"
|
|
||||||
rm -f "$OUT_EXE"
|
|
||||||
|
|
||||||
chmod 0644 "$OUT_BASE.zip"
|
|
||||||
|
|
||||||
echo -n "SHA1: "
|
|
||||||
sha1sum "$OUT_BASE.zip"
|
|
||||||
|
|
||||||
echo -n "MD5: "
|
|
||||||
md5sum "$OUT_BASE.zip"
|
|
Loading…
Reference in a new issue