Browse Source

Bugfix: Fix build without OpenCL but with scrypt

Luke Dashjr 13 years ago
parent
commit
40253055f0
2 changed files with 22 additions and 20 deletions
  1. 18 18
      configure.ac
  2. 4 2
      miner.c

+ 18 - 18
configure.ac

@@ -135,8 +135,6 @@ AC_ARG_ENABLE([adl],
 	[adl=$enableval]
 	)
 
-scrypt="no"
-
 if test "x$opencl" = xyes; then
 	if test "x$adl" != xno; then
 		if test -f ADL_SDK/adl_sdk.h; then
@@ -151,20 +149,10 @@ if test "x$opencl" = xyes; then
 			DLOPEN_FLAGS=""
 		fi
 	fi
-
-	AC_ARG_ENABLE([scrypt],
-		[AC_HELP_STRING([--enable-scrypt],[Compile support for scrypt litecoin mining (default disabled)])],
-		[scrypt=$enableval]
-		)
-	if test "x$scrypt" = xyes; then
-		AC_DEFINE([USE_SCRYPT], [1], [Defined to 1 if scrypt support is wanted])
-	fi
 else
 	DLOPEN_FLAGS=""
 fi
 
-AM_CONDITIONAL([HAS_SCRYPT], [test x$scrypt = xyes])
-
 bitforce="no"
 
 AC_ARG_ENABLE([bitforce],
@@ -209,6 +197,18 @@ if test "x$ztex" = xyes; then
 fi
 AM_CONDITIONAL([HAS_ZTEX], [test x$ztex = xyes])
 
+
+scrypt="no"
+
+AC_ARG_ENABLE([scrypt],
+	[AC_HELP_STRING([--enable-scrypt],[Compile support for scrypt litecoin mining (default disabled)])],
+	[scrypt=$enableval]
+	)
+if test "x$scrypt" = xyes; then
+	AC_DEFINE([USE_SCRYPT], [1], [Defined to 1 if scrypt support is wanted])
+fi
+
+
 curses="auto"
 
 AC_ARG_WITH([curses],
@@ -235,6 +235,7 @@ fi
 
 
 AM_CONDITIONAL([NEED_FPGAUTILS], [test x$icarus$bitforce$modminer$ztex != xnononono])
+AM_CONDITIONAL([HAS_SCRYPT], [test x$scrypt = xyes])
 AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
 AM_CONDITIONAL([WANT_JANSSON], [test x$request_jansson = xtrue])
 AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
@@ -398,19 +399,18 @@ echo "Configuration Options Summary:"
 echo
 
 echo "  curses.TUI...........: $cursesmsg"
+if test "x$scrypt" != xno; then
+	echo "  scrypt...............: Enabled"
+else
+	echo "  scrypt...............: Disabled"
+fi
 
 echo
 
 if test "x$opencl" = xyes; then
 	echo "  OpenCL...............: Enabled"
-	if test "x$scrypt" != xno; then
-		echo "  scrypt...............: Enabled"
-	else
-		echo "  scrypt...............: Disabled"
-	fi
 else
 	echo "  OpenCL...............: Disabled"
-	echo "  scrypt...............: Disabled (needs OpenCL)"
 fi
 
 if test "x$adl" != xno; then

+ 4 - 2
miner.c

@@ -108,10 +108,10 @@ int opt_dynamic_interval = 7;
 int nDevs;
 int opt_g_threads = 2;
 int gpu_threads;
+#endif
 #ifdef USE_SCRYPT
 bool opt_scrypt;
 #endif
-#endif
 bool opt_restart = true;
 static bool opt_nogpu;
 
@@ -970,9 +970,11 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITHOUT_ARG("--scrypt",
 			opt_set_bool, &opt_scrypt,
 			"Use the scrypt algorithm for mining (litecoin only)"),
+#ifdef HAVE_OPENCL
 	OPT_WITH_ARG("--shaders",
 		     set_shaders, NULL, NULL,
 		     "GPU shaders per card for tuning scrypt, comma separated"),
+#endif
 #endif
 	OPT_WITH_ARG("--sharelog",
 		     set_sharelog, NULL, NULL,
@@ -1015,7 +1017,7 @@ static struct opt_table opt_config_table[] = {
 			opt_hidden
 #endif
 	),
-#ifdef USE_SCRYPT
+#if defined(USE_SCRYPT) && defined(HAVE_OPENCL)
 	OPT_WITH_ARG("--thread-concurrency",
 		     set_thread_concurrency, NULL, NULL,
 		     "Set GPU thread concurrency for scrypt mining, comma separated"),