Commit f062765c94acdc4a67bd325ee4e912a78c1437ce

Con Kolivas 2011-08-20T10:08:59

Explicitly link in ws2_32 on the windows build and update README file on how to compile successfully on windows.

diff --git a/Makefile.am b/Makefile.am
index 0fed929..35e3650 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,7 +26,7 @@ cgminer_SOURCES	= elist.h miner.h compat.h bench_block.h	\
 		  phatk110816.cl poclbm110816.cl
 
 cgminer_LDFLAGS	= $(PTHREAD_FLAGS)
-cgminer_LDADD	= @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @OPENCL_LIBS@ @NCURSES_LIBS@ @PDCURSES_LIBS@ lib/libgnu.a ccan/libccan.a
+cgminer_LDADD	= @LIBCURL_LIBS@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @OPENCL_LIBS@ @NCURSES_LIBS@ @PDCURSES_LIBS@ @WS2_LIBS@ lib/libgnu.a ccan/libccan.a
 cgminer_CPPFLAGS = @LIBCURL_CPPFLAGS@ -I$(top_builddir)/lib -I$(top_srcdir)/lib
 
 if HAVE_x86_64
diff --git a/README b/README
index 9cda62d..79dfcd6 100644
--- a/README
+++ b/README
@@ -56,13 +56,15 @@ Basic WIN32 build instructions (on Fedora 13; requires mingw32):
 	./mknsis.sh
 	
 Native WIN32 build instructions (on mingw32, on windows):
-	Install AMD APP sdk, latest version
+	Install the Microsoft platform SDK
+	Install AMD APP sdk, latest version (only if you want GPU mining)
 	(Do NOT install the ati amd sdk if you are on nvidia)
 	Install mingw32
 	Install libcurl, copy libcurl.m4 into /mingw/share/aclocal
+	Install pkg-config, copy pkg.m4 into /mingw/share/aclocal
 	Run:
 	autoreconf -fvi
-	CFLAGS="-O2 -Wall -msse2 -I<path to AMD APP include>" LDFLAGS="-L<path to AMD APP lib/x86>" ./configure
+	CFLAGS="-O2 -msse2" ./configure
 	make
 
 Usage instructions:  Run "cgminer --help" to see options.
diff --git a/configure.ac b/configure.ac
index d66885f..f480ed5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,7 @@ AC_FUNC_ALLOCA
 have_win32=false
 PTHREAD_FLAGS="-pthread"
 OPENCL_FLAGS="-lOpenCL"
+WS2_LIBS=""
 
 case $target in
   x86_64-*)
@@ -43,6 +44,7 @@ case $target in
     have_x86_64=false
     have_win32=true
     PTHREAD_FLAGS=""
+    WS2_LIBS="-lws2_32"
     ;;
   *-*-darwin*)
     OPENCL_FLAGS="-framework OpenCL"
@@ -167,6 +169,7 @@ AC_SUBST(PTHREAD_FLAGS)
 AC_SUBST(PTHREAD_LIBS)
 AC_SUBST(NCURSES_LIBS)
 AC_SUBST(PDCURSES_LIBS)
+AC_SUBST(WS2_LIBS)
 
 AC_CONFIG_FILES([
 	Makefile