Support for building on MinGW

- Fix dependency on libws2_32
- Update build instructions in the README
- Drop mknsis.sh
This commit is contained in:
pooler 2012-03-03 16:51:32 +01:00
parent 8d326a4439
commit a9c46369e8
4 changed files with 26 additions and 52 deletions

View file

@ -16,6 +16,6 @@ bin_PROGRAMS = minerd
minerd_SOURCES = elist.h miner.h compat.h \
cpu-miner.c util.c scrypt.c scrypt-x86.S scrypt-x64.S
minerd_LDFLAGS = $(PTHREAD_FLAGS)
minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@
minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@
minerd_CPPFLAGS = @LIBCURL_CPPFLAGS@

19
README
View file

@ -3,6 +3,9 @@ reference cpuminer.
License: GPLv2. See COPYING for details.
Downloads: https://github.com/pooler/cpuminer/downloads
Git tree: https://github.com/pooler/cpuminer
Dependencies:
libcurl http://curl.haxx.se/libcurl/
jansson http://www.digip.org/jansson/
@ -14,12 +17,16 @@ Basic *nix build instructions:
./configure CFLAGS="-O3"
make
Basic WIN32 build instructions (on Fedora 13; requires mingw32):
./autogen.sh # only needed if building from git repo
rm -f mingw32-config.cache
MINGW32_CFLAGS="-O3" mingw32-configure
make
./mknsis.sh
Basic Windows build instructions, using MinGW:
Install MinGW and the MSYS Developer Tool Kit (http://www.mingw.org/)
* Make sure you have mstcpip.h in MinGW\include
Install libcurl devel (http://curl.haxx.se/download.html)
* Make sure you have libcurl.m4 in MinGW\share\aclocal
* 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.

View file

@ -23,23 +23,25 @@ AC_CHECK_HEADERS(syslog.h)
AC_FUNC_ALLOCA
case $target in
*-*-mingw*)
have_x86_64=false
have_win32=true
PTHREAD_FLAGS=""
;;
x86_64-*)
have_x86_64=true
have_win32=false
PTHREAD_FLAGS="-pthread"
;;
*)
have_x86_64=false
have_win32=false
PTHREAD_FLAGS="-pthread"
;;
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(pthread, pthread_create, PTHREAD_LIBS=-lpthread)
@ -55,14 +57,13 @@ else
JANSSON_LIBS=-ljansson
fi
PKG_PROG_PKG_CONFIG()
LIBCURL_CHECK_CONFIG(, 7.10.1, ,
[AC_MSG_ERROR([Missing required libcurl >= 7.10.1])])
AC_SUBST(JANSSON_LIBS)
AC_SUBST(PTHREAD_FLAGS)
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(WS2_LIBS)
AC_CONFIG_FILES([
Makefile
@ -70,4 +71,3 @@ AC_CONFIG_FILES([
compat/jansson/Makefile
])
AC_OUTPUT

View file

@ -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"