Commit da2bf8071d72d4736ca9b0d7f1371438fc333f43

Con Kolivas 2014-07-28T22:57:17

Enable combined building of avalon2 and hashratio

diff --git a/Makefile.am b/Makefile.am
index 4152c18..15450c2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,6 +59,10 @@ if WANT_LIBBITFURY
 cgminer_SOURCES += libbitfury.c libbitfury.h mcp2210.c mcp2210.h
 endif
 
+if WANT_CRC16
+cgminer_SOURCES += crc16.c crc.h
+endif
+
 # Device drivers
 if HAS_AVALON
 cgminer_SOURCES += driver-avalon.c driver-avalon.h
@@ -81,7 +85,7 @@ cgminer_SOURCES += driver-hashfast.c driver-hashfast.h hf_protocol.h hf_protocol
 endif
 
 if HAS_HASHRATIO
-cgminer_SOURCES += driver-hashratio.c driver-hashratio.h crc16.c crc.h
+cgminer_SOURCES += driver-hashratio.c driver-hashratio.h
 endif
 
 if HAS_BITFURY
@@ -130,7 +134,7 @@ cgminer_SOURCES += driver-bab.c
 endif
 
 if HAS_AVALON2
-cgminer_SOURCES += driver-avalon2.c driver-avalon2.h crc16.c crc.h
+cgminer_SOURCES += driver-avalon2.c driver-avalon2.h
 endif
 
 if HAS_MINION
diff --git a/configure.ac b/configure.ac
index 8dbe17e..36ffe59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -386,12 +386,19 @@ else
 	want_libbitfury=false
 fi
 
+if test x$avalon2$hashratio != xnono; then
+	want_crc16=true
+else
+	want_crc16=false
+fi
+
 AM_CONDITIONAL([NEED_FPGAUTILS], [test x$modminer != xno])
 AM_CONDITIONAL([WANT_USBUTILS], [test x$want_usbutils != xfalse])
 AM_CONDITIONAL([WANT_LIBBITFURY], [test x$want_libbitfury != xfalse])
 AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
 AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
 AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
+AM_CONDITIONAL([WANT_CRC16], [test x$want_crc16 != xfalse])
 
 if test "x$want_usbutils" != xfalse; then
 	dlibusb="no"