configure.ac 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
  1. dnl * Copyright 2012-2013 Luke Dashjr
  2. dnl * Copyright 2011-2013 Con Kolivas
  3. dnl * Copyright 2010-2011 Jeff Garzik
  4. dnl * Copyright 2012 Xiangfu
  5. dnl * Copyright 2011 Rusty Russell
  6. dnl * Copyright 2011 Mark Crichton
  7. dnl *
  8. dnl * This program is free software; you can redistribute it and/or modify it
  9. dnl * under the terms of the GNU General Public License as published by the Free
  10. dnl * Software Foundation; either version 3 of the License, or (at your option)
  11. dnl * any later version. See COPYING for more details.
  12. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  13. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  14. m4_define([v_maj], [3])
  15. m4_define([v_min], [1])
  16. m4_define([v_mic], [4])
  17. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  18. m4_define([v_ver], [v_maj.v_min.v_mic])
  19. m4_define([lt_rev], m4_eval(v_maj + v_min))
  20. m4_define([lt_cur], v_mic)
  21. m4_define([lt_age], v_min)
  22. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  23. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  24. AC_INIT([bfgminer], [v_ver], [luke-jr+bfgminer@utopios.org])
  25. AC_PREREQ([2.59c])
  26. AC_CANONICAL_SYSTEM
  27. AC_CONFIG_MACRO_DIR([m4])
  28. AC_CONFIG_SRCDIR([miner.c])
  29. AC_CONFIG_HEADERS([config.h])
  30. AM_INIT_AUTOMAKE([foreign])
  31. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  32. AC_USE_SYSTEM_EXTENSIONS
  33. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  34. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  35. m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
  36. m4_ifdef([v_rel], , [m4_define([v_rel], [])])
  37. AC_DEFINE_UNQUOTED(CGMINER_MAJOR_VERSION, [v_maj], [Major version])
  38. AC_DEFINE_UNQUOTED(CGMINER_MINOR_VERSION, [v_min], [Minor version])
  39. AC_DEFINE_UNQUOTED(CGMINER_MINOR_SUBVERSION, [v_mic], [Micro version])
  40. version_info="lt_rev:lt_cur:lt_age"
  41. release_info="v_rel"
  42. AC_SUBST(version_info)
  43. AC_SUBST(release_info)
  44. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  45. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  46. VMAJ=v_maj
  47. AC_SUBST(VMAJ)
  48. AC_CANONICAL_BUILD
  49. AC_CANONICAL_HOST
  50. dnl Make sure anyone changing configure.ac/Makefile.am has a clue
  51. AM_MAINTAINER_MODE([enable])
  52. dnl Checks for programs
  53. AC_PROG_CC_C99
  54. gl_EARLY
  55. AC_PROG_GCC_TRADITIONAL
  56. AM_PROG_CC_C_O
  57. AC_PROG_RANLIB
  58. AC_PROG_CPP
  59. gl_INIT
  60. dnl Checks for header files.
  61. AC_HEADER_STDC
  62. AC_CHECK_HEADERS(syslog.h)
  63. AC_CHECK_HEADERS([sys/epoll.h])
  64. AC_CHECK_HEADERS([sys/prctl.h])
  65. AC_CHECK_HEADERS([sys/file.h])
  66. AC_CHECK_HEADERS([linux/spi/spidev.h])
  67. AC_FUNC_ALLOCA
  68. need_fpgautils=no
  69. have_cygwin=false
  70. have_win32=false
  71. have_macho=false
  72. DLOPEN_FLAGS="-ldl"
  73. WS2_LIBS=""
  74. MM_LIBS=""
  75. MATH_LIBS="-lm"
  76. RT_LIBS=""
  77. case $target in
  78. amd64-* | x86_64-*)
  79. have_x86_32=false
  80. have_x86_64=true
  81. bitness="64"
  82. ;;
  83. i386-* | i486-* | i586-* | i686-* | x86-*)
  84. have_x86_32=true
  85. have_x86_64=false
  86. bitness="32"
  87. ;;
  88. *)
  89. have_x86_32=false
  90. have_x86_64=false
  91. ;;
  92. esac
  93. case $target in
  94. *-*-mingw*)
  95. have_win32=true
  96. DLOPEN_FLAGS=""
  97. WS2_LIBS="-lws2_32"
  98. MM_LIBS="-lwinmm"
  99. AC_DEFINE([_WIN32_WINNT], [0x0501], "WinNT version for XP+ support")
  100. AC_DEFINE([FD_SETSIZE], [4096], [Maximum sockets before fd_set overflows])
  101. ;;
  102. *-*-cygwin*)
  103. have_cygwin=true
  104. ;;
  105. powerpc-*-darwin*)
  106. CFLAGS="$CFLAGS -faltivec"
  107. have_macho=true
  108. ;;
  109. *-*-darwin*)
  110. have_macho=true
  111. ;;
  112. esac
  113. m4_define([BFG_INCLUDE],
  114. if test "x$2" = "x"; then
  115. $1=''
  116. else
  117. $1="[#]include <$2>"
  118. fi
  119. )
  120. m4_define([BFG_PREPROC_IFELSE],
  121. BFG_INCLUDE([headerinclude], $2)
  122. AC_COMPILE_IFELSE([
  123. AC_LANG_PROGRAM([
  124. ${headerinclude}
  125. ], [
  126. #if !( $1 )
  127. #error "$1 false in preprocessor"
  128. #endif
  129. ])
  130. ],[$3],[$4])
  131. )
  132. AC_CHECK_DECL([HASH_ITER],[
  133. AC_CHECK_DECL([DL_FOREACH_SAFE],[
  134. true
  135. ],[
  136. AC_MSG_ERROR([Could not find DL_FOREACH_SAFE - install uthash-dev 1.9.2+])
  137. ],[
  138. #include <utlist.h>
  139. ])
  140. ],[
  141. AC_MSG_ERROR([Could not find HASH_ITER - please install uthash-dev 1.9.2+])
  142. ],[
  143. #include <uthash.h>
  144. ])
  145. cpumining="no"
  146. AC_ARG_ENABLE([cpumining],
  147. [AC_HELP_STRING([--enable-cpumining],[Build with CPU mining support (default disabled)])],
  148. [cpumining=$enableval]
  149. )
  150. if test "x$cpumining" = xyes; then
  151. AC_DEFINE_UNQUOTED([WANT_CPUMINE], [1], [Enable CPUMINING])
  152. fi
  153. AM_CONDITIONAL([HAS_CPUMINE], [test x$cpumining = xyes])
  154. opencl="yes"
  155. AC_ARG_ENABLE([opencl],
  156. [AC_HELP_STRING([--disable-opencl],[Build without support for OpenCL (default enabled)])],
  157. [opencl=$enableval]
  158. )
  159. if test "x$opencl" = xyes; then
  160. AC_DEFINE([HAVE_OPENCL], [1], [Defined to 1 if OpenCL support is wanted])
  161. else
  162. DLOPEN_FLAGS=""
  163. fi
  164. AM_CONDITIONAL([HAVE_OPENCL], [test x$opencl = xyes])
  165. m4_define([BFG_PTHREAD_FLAG_CHECK],
  166. AC_MSG_CHECKING([for $1])
  167. for cflag in ' -pthread' ''; do
  168. for lib in ' -lpthread' ' -lwinpthread' ''; do
  169. CFLAGS="${save_CFLAGS}${cflag}"
  170. LIBS="${save_LIBS}${lib}"
  171. AC_LINK_IFELSE([
  172. AC_LANG_PROGRAM([
  173. #include <pthread.h>
  174. ], [
  175. void *f = $1;
  176. ])
  177. ], [
  178. found_pthread=true
  179. PTHREAD_FLAGS="${cflag}"
  180. PTHREAD_LIBS="${lib}"
  181. if test "x${cflag}${lib}" = "x"; then
  182. AC_MSG_RESULT([yes])
  183. else
  184. AC_MSG_RESULT([with${cflag}${lib}])
  185. fi
  186. $2
  187. break 2
  188. ])
  189. done
  190. done
  191. if test "x${found_pthread}" = "xfalse"; then
  192. AC_MSG_RESULT([no])
  193. fi
  194. )
  195. save_CFLAGS="${CFLAGS}"
  196. save_LIBS="${LIBS}"
  197. found_pthread=false
  198. BFG_PTHREAD_FLAG_CHECK([pthread_cancel],[
  199. AC_DEFINE([HAVE_PTHREAD_CANCEL], [1], [Define if you have a native pthread_cancel])
  200. ])
  201. if test "x${found_pthread}" = "xfalse"; then
  202. BFG_PTHREAD_FLAG_CHECK([pthread_create])
  203. if test "x${found_pthread}" = "xfalse"; then
  204. AC_MSG_ERROR([Could not find pthread library - please install libpthread])
  205. fi
  206. fi
  207. # check for nanosleep here, since it is provided by winpthread
  208. AC_CHECK_FUNCS([nanosleep])
  209. CFLAGS="${save_CFLAGS}"
  210. LIBS="${save_LIBS}"
  211. PKG_CHECK_MODULES([JANSSON],[jansson],[
  212. true
  213. ],[
  214. AC_MSG_CHECKING([for jansson in system-default locations])
  215. LIBS="$LIBS -ljansson"
  216. AC_TRY_LINK([
  217. #include <jansson.h>
  218. ],[
  219. json_object();
  220. ],[
  221. AC_MSG_RESULT([found])
  222. JANSSON_LIBS=-ljansson
  223. ],[
  224. AC_MSG_RESULT([not found])
  225. AC_MSG_ERROR([Could not find jansson library])
  226. ])
  227. LIBS="${save_LIBS}"
  228. ])
  229. AC_SUBST(JANSSON_CFLAGS)
  230. AC_SUBST(JANSSON_LIBS)
  231. if test "x$opencl" = xyes; then
  232. adl="yes"
  233. AC_ARG_WITH([sensors],
  234. [AC_HELP_STRING([--without-sensors],[Build with libsensors monitoring (default enabled)])],
  235. [true],[with_sensors=auto])
  236. if test "x$opencl" != xyes; then
  237. with_sensors=no
  238. fi
  239. if test "x$with_sensors" != xno; then
  240. AC_MSG_CHECKING([for libsensors])
  241. save_LIBS="${LIBS}"
  242. LIBS="$LIBS -lsensors"
  243. AC_LINK_IFELSE([AC_LANG_PROGRAM([
  244. #include <stddef.h>
  245. #include <sensors/sensors.h>
  246. ],[
  247. const sensors_chip_name *cn;
  248. cn = sensors_get_detected_chips(NULL, NULL);
  249. ])],[
  250. with_sensors=yes
  251. sensors_LIBS="-lsensors"
  252. AC_DEFINE([HAVE_SENSORS], [1], [Defined if libsensors was found])
  253. AC_MSG_RESULT([yes])
  254. ],[
  255. with_sensors=no
  256. AC_MSG_RESULT([no])
  257. ])
  258. LIBS="$save_LIBS"
  259. fi
  260. AC_SUBST(sensors_LIBS)
  261. AC_ARG_ENABLE([adl],
  262. [AC_HELP_STRING([--disable-adl],[Build without ADL monitoring (default enabled)])],
  263. [adl=$enableval]
  264. )
  265. if test x$adl = xyes
  266. then
  267. AC_DEFINE([HAVE_ADL], [1], [Defined if ADL headers were found])
  268. fi
  269. else
  270. adl="no"
  271. fi
  272. ################################################################################
  273. AC_ARG_ENABLE([bigpic],
  274. [AC_HELP_STRING([--disable-bigpic],[Compile support for Big Picture Mining USB (default enabled)])],
  275. [bigpic=$enableval],
  276. [bigpic=yes]
  277. )
  278. if test "x$bigpic" = xyes; then
  279. AC_DEFINE([USE_BIGPIC], [1], [Defined to 1 if Big Picture Mining USB support is wanted])
  280. need_fpgautils=yes
  281. fi
  282. AM_CONDITIONAL([HAS_BIGPIC], [test x$bigpic = xyes])
  283. AC_ARG_ENABLE([bitforce],
  284. [AC_HELP_STRING([--disable-bitforce],[Compile support for BitForce (default enabled)])],
  285. [bitforce=$enableval],
  286. [bitforce=yes]
  287. )
  288. if test "x$bitforce" = xyes; then
  289. AC_DEFINE([USE_BITFORCE], [1], [Defined to 1 if BitForce support is wanted])
  290. need_fpgautils=yes
  291. fi
  292. AM_CONDITIONAL([HAS_BITFORCE], [test x$bitforce = xyes])
  293. AC_ARG_ENABLE([icarus],
  294. [AC_HELP_STRING([--disable-icarus],[Compile support for Icarus (default enabled)])],
  295. [icarus=$enableval],
  296. [icarus=yes]
  297. )
  298. if test "x$icarus" = xyes; then
  299. AC_DEFINE([USE_ICARUS], [1], [Defined to 1 if Icarus support is wanted])
  300. need_fpgautils=yes
  301. fi
  302. AM_CONDITIONAL([HAS_ICARUS], [test x$icarus = xyes])
  303. avalon="no"
  304. AC_ARG_ENABLE([avalon],
  305. [AC_HELP_STRING([--disable-avalon],[Compile support for Avalon (default enabled)])],
  306. [avalon=$enableval],
  307. [avalon=yes]
  308. )
  309. if test "x$avalon" = xyes; then
  310. AC_DEFINE([USE_AVALON], [1], [Defined to 1 if Avalon support is wanted])
  311. need_fpgautils=yes
  312. fi
  313. AM_CONDITIONAL([HAS_AVALON], [test x$avalon = xyes])
  314. httpsrv=auto
  315. AC_ARG_WITH([libmicrohttpd],
  316. [AC_HELP_STRING([--without-libmicrohttpd],[Compile support for libmicrohttpd getwork server (default enabled)])],
  317. [httpsrv=$withval]
  318. )
  319. if test "x$httpsrv" != "xno"; then
  320. PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd],[
  321. AC_DEFINE([USE_LIBMICROHTTPD],[1],[Defined to 1 if libmicrohttpd support is wanted])
  322. httpsrv=yes
  323. ],[
  324. if test "x$httpsrv" = "xyes"; then
  325. AC_MSG_ERROR([Unable to find libmicrohttpd])
  326. else
  327. AC_MSG_WARN([libmicrohttpd not found; getwork proxy will be unavailable])
  328. fi
  329. ])
  330. fi
  331. AM_CONDITIONAL([USE_LIBMICROHTTPD], [test x$httpsrv = xyes])
  332. AC_ARG_ENABLE([modminer],
  333. [AC_HELP_STRING([--disable-modminer],[Compile support for ModMiner (default enabled)])],
  334. [modminer=$enableval],
  335. [modminer=yes]
  336. )
  337. if test "x$modminer" = xyes; then
  338. AC_DEFINE([USE_MODMINER], [1], [Defined to 1 if ModMiner support is wanted])
  339. need_fpgautils=yes
  340. fi
  341. AM_CONDITIONAL([HAS_MODMINER], [test x$modminer = xyes])
  342. PKG_PROG_PKG_CONFIG()
  343. libusb=no
  344. libusb_include_path=""
  345. PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],[
  346. libusb=yes
  347. ],[
  348. for usb_lib in usb-1.0 usb; do
  349. AC_CHECK_LIB($usb_lib, libusb_init, [
  350. libusb=yes
  351. break
  352. ])
  353. done
  354. if test "x$libusb" = xyes; then
  355. AC_CHECK_DECL([libusb_init],[
  356. true
  357. ],[
  358. AC_MSG_CHECKING([whether libusb_init is declared in subdirectory])
  359. libusb_include_path=`echo '#include <libusb-1.0/libusb.h>' | ${CPP} -M - 2>/dev/null | tr -d '\\n\\r\\\\' | sed 's/^[^:]*:[[:space:]]*\([^[:space:]]*\)\/.*/\1/'`
  360. if test "x$libusb_include_path" != "x"; then
  361. LIBUSB_LIBS="-l$usb_lib"
  362. LIBUSB_CFLAGS="-I$libusb_include_path"
  363. AC_MSG_RESULT([yes])
  364. else
  365. libusb=no
  366. AC_MSG_RESULT([no])
  367. fi
  368. ],[#include <libusb.h>])
  369. fi
  370. ])
  371. AC_ARG_ENABLE([x6500],
  372. [AC_HELP_STRING([--disable-x6500],[Compile support for X6500 (default if libusb)])],
  373. [x6500=$enableval],
  374. [x6500=auto]
  375. )
  376. if test "x$x6500$libusb" = xyesno; then
  377. AC_MSG_ERROR([Could not find libusb, required for X6500 support])
  378. elif test "x$x6500" = xauto; then
  379. x6500="$libusb"
  380. if test "x$libusb" = xno; then
  381. AC_MSG_WARN([Could not find libusb, required for X6500 support])
  382. x6500warn=yes
  383. fi
  384. fi
  385. if test "x$x6500" = xyes; then
  386. AC_DEFINE([USE_X6500], [1], [Defined to 1 if X6500 support is wanted])
  387. need_fpgautils=yes
  388. fi
  389. AM_CONDITIONAL([HAS_X6500], [test x$x6500 = xyes])
  390. AC_ARG_ENABLE([ztex],
  391. [AC_HELP_STRING([--disable-ztex],[Compile support for ZTEX (default if libusb)])],
  392. [ztex=$enableval],
  393. [ztex=auto]
  394. )
  395. if test "x$ztex$libusb" = xyesno; then
  396. AC_MSG_ERROR([Could not find libusb, required for ZTEX support])
  397. elif test "x$ztex" = xauto; then
  398. ztex="$libusb"
  399. if test "x$libusb" = xno; then
  400. AC_MSG_WARN([Could not find libusb, required for ZTEX support])
  401. ztexwarn=yes
  402. fi
  403. fi
  404. if test "x$ztex" = xyes; then
  405. AC_DEFINE([USE_ZTEX], [1], [Defined to 1 if ZTEX support is wanted])
  406. need_fpgautils=yes
  407. fi
  408. AM_CONDITIONAL([HAS_ZTEX], [test x$ztex = xyes])
  409. bitfury=yes
  410. AC_ARG_ENABLE([bitfury],
  411. [AC_HELP_STRING([--disable-bitfury],[Compile support for Bitfury (default enabled)])],
  412. [bitfury=$enableval]
  413. )
  414. if test "x$bitfury" = xyes; then
  415. AC_DEFINE([USE_BITFURY], [1], [Defined to 1 if Bitfury support is wanted])
  416. fi
  417. AM_CONDITIONAL([HAS_BITFURY], [test x$bitfury = xyes])
  418. bfsb=no
  419. AC_ARG_ENABLE([bfsb],
  420. [AC_HELP_STRING([--disable-bfsb],[Compile support for BFSB (default disabled)])],
  421. [bfsb=$enableval]
  422. )
  423. if test "x$bfsb" = "xyes"; then
  424. if test "x$bitfury" = "xno"; then
  425. AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled BFSB])
  426. fi
  427. AC_DEFINE([USE_BFSB], [1], [Defined to 1 if BFSB support is wanted])
  428. fi
  429. AM_CONDITIONAL([HAS_BFSB], [test x$bfsb = xyes])
  430. littlefury=auto
  431. AC_ARG_ENABLE([littlefury],
  432. [AC_HELP_STRING([--disable-littlefury],[Compile support for LittleFury (default enabled)])],
  433. [littlefury=$enableval]
  434. )
  435. if test "x$littlefury" = "xno"; then
  436. true
  437. elif test "x$bitfury" = "xyes"; then
  438. littlefury=yes
  439. elif test "x$littlefury" = "xyes"; then
  440. AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled LittleFury])
  441. else
  442. littlefury=no
  443. fi
  444. if test "x$littlefury" = "xyes"; then
  445. AC_DEFINE([USE_LITTLEFURY], [1], [Defined to 1 if LittleFury support is wanted])
  446. need_fpgautils=yes
  447. fi
  448. AM_CONDITIONAL([HAS_LITTLEFURY], [test x$littlefury = xyes])
  449. metabank=no
  450. AC_ARG_ENABLE([metabank],
  451. [AC_HELP_STRING([--disable-metabank],[Compile support for Metabank (default disabled)])],
  452. [metabank=$enableval]
  453. )
  454. if test "x$metabank" = "xyes"; then
  455. if test "x$bitfury" = "xno"; then
  456. AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled Metabank])
  457. fi
  458. AC_DEFINE([USE_METABANK], [1], [Defined to 1 if Metabank support is wanted])
  459. fi
  460. AM_CONDITIONAL([HAS_METABANK], [test x$metabank = xyes])
  461. if test "x$x6500$ztex" = "xnono"; then
  462. libusb=no
  463. LIBUSB_LIBS=''
  464. LIBUSB_CFLAGS=''
  465. fi
  466. if test "x$libusb" = xyes; then
  467. AC_DEFINE([HAVE_LIBUSB], [1], [Define if you have libusb-1.0])
  468. save_CFLAGS="$CFLAGS"
  469. CFLAGS="$LIBUSB_CFLAGS $CFLAGS"
  470. AC_CHECK_DECLS([libusb_error_name],[true],[true],[#include <libusb.h>])
  471. CFLAGS="$save_CFLAGS"
  472. fi
  473. scrypt="no"
  474. AC_ARG_ENABLE([scrypt],
  475. [AC_HELP_STRING([--enable-scrypt],[Compile support for scrypt mining (default disabled)])],
  476. [scrypt=$enableval]
  477. )
  478. if test "x$scrypt" = xyes; then
  479. AC_DEFINE([USE_SCRYPT], [1], [Defined to 1 if scrypt support is wanted])
  480. fi
  481. if test x$need_fpgautils = xyes; then
  482. AC_DEFINE([HAVE_FPGAUTILS], [1], [Defined to 1 if fpgautils is being used])
  483. if $have_win32; then
  484. echo '#include <iospeeds.h>' >iospeeds_local.h
  485. else
  486. AC_MSG_CHECKING([what baud rates your system supports])
  487. echo '#include <termios.h>' | ${CPP} -dM - 2>/dev/null | sed 's/.*[ ]B\([0-9][0-9]*\)[ ].*/IOSPEED(\1)/' | grep IOSPEED >iospeeds_local.h
  488. if grep -q IOSPEED iospeeds_local.h; then
  489. AC_MSG_RESULT([done])
  490. else
  491. AC_MSG_RESULT([failed, using standard POSIX])
  492. echo '#include <iospeeds_posix.h>' >iospeeds_local.h
  493. fi
  494. fi
  495. fi
  496. curses="auto"
  497. AC_ARG_WITH([curses],
  498. [AC_HELP_STRING([--without-curses],[Compile support for curses TUI (default enabled)])],
  499. [curses=$withval]
  500. )
  501. if test "x$curses" = "xno"; then
  502. cursesmsg='User specified --without-curses. TUI support DISABLED'
  503. else
  504. orig_libs="$LIBS"
  505. if test "x${curses}" = "xyes"; then
  506. preferl=''
  507. else
  508. preferl="${curses} ${curses}6 ${curses}5"
  509. fi
  510. for wideornot in w u ''; do
  511. for ncursesver in '' 6 5; do
  512. preferl="${preferl} ncurses${wideornot}${ncursesver}"
  513. done
  514. preferl="${preferl} pdcurses${wideornot}"
  515. done
  516. if test "x$cross_compiling" != "xyes"; then
  517. AC_MSG_CHECKING([for best native curses library])
  518. orig_cflags="$CFLAGS"
  519. for curses_lib in ${preferl}; do
  520. if ! ${curses_lib}-config --cflags >/dev/null 2>/dev/null; then
  521. continue
  522. fi
  523. CFLAGS="$orig_cflags $(${curses_lib}-config --cflags)"
  524. LIBS="$orig_libs $(${curses_lib}-config --libs)"
  525. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  526. #include <curses.h>
  527. ]], [[
  528. WINDOW *w = NULL;
  529. mvwprintw(w, 2, 2, "Testing %s", "o hai");
  530. ]])], [
  531. curses=yes
  532. cursesmsg="FOUND: ${curses_lib}"
  533. AC_MSG_RESULT([$curses_lib])
  534. NCURSES_LIBS=`${curses_lib}-config --libs`
  535. NCURSES_CPPFLAGS=`${curses_lib}-config --cflags`
  536. break
  537. ], [
  538. AC_MSG_WARN([${curses_lib} doesn't seem to be installed properly])
  539. ])
  540. done
  541. CFLAGS="$orig_cflags"
  542. if test "x$curses" != "xyes"; then
  543. AC_MSG_RESULT([none?])
  544. fi
  545. fi
  546. if test "x$curses" != "xyes"; then
  547. sym=addstr
  548. AC_SEARCH_LIBS(${sym}, ${preferl}, [
  549. curses=yes
  550. eval "curseslib=\"\${ac_cv_search_${sym}}\""
  551. barelib="${curseslib/-l/}"
  552. cursesmsg="FOUND: ${barelib}"
  553. if test "x${curseslib}" != "xnone required"; then
  554. NCURSES_LIBS="${curseslib}"
  555. fi
  556. # Need to check for headers in subdirectories, to ensure we get wide stuff
  557. AC_MSG_CHECKING([for curses header subdirectory])
  558. barelib="${barelib/6/}"
  559. barelib="${barelib/5/}"
  560. cursesincl=`echo "#include <${barelib}/curses.h>" | ${CPP} -M - 2>/dev/null | tr -d '\\n\\r\\\\' | sed 's/^[^:]*:[[:space:]]*\([^[:space:]]*\)\/.*/\1/'`
  561. if test "x$cursesincl" != "x"; then
  562. NCURSES_CPPFLAGS="-I${cursesincl}"
  563. AC_MSG_RESULT([$cursesincl])
  564. else
  565. AC_MSG_RESULT([none found])
  566. fi
  567. break
  568. ], [
  569. if test "x$curses" = "xyes"; then
  570. AC_MSG_ERROR([Could not find curses library - please install libncurses-dev or pdcurses-dev (or configure --without-curses)])
  571. else
  572. AC_MSG_WARN([Could not find curses library - if you want a TUI, install libncurses-dev or pdcurses-dev])
  573. curses=no
  574. cursesmsg='NOT FOUND. TUI support DISABLED'
  575. fi
  576. ])
  577. fi
  578. if test "x$curses" = "xyes"; then
  579. AC_DEFINE([HAVE_CURSES], [1], [Defined to 1 if curses TUI support is wanted])
  580. AC_MSG_CHECKING([whether curses library supports wide characters])
  581. LIBS="$orig_libs $NCURSES_CPPFLAGS $NCURSES_LIBS"
  582. AC_LINK_IFELSE([
  583. AC_LANG_PROGRAM([
  584. #define PDC_WIDE
  585. #include <curses.h>
  586. ],[
  587. addwstr(L"test");
  588. add_wch(WACS_VLINE);
  589. ])
  590. ],[
  591. AC_MSG_RESULT([yes])
  592. AC_DEFINE([USE_UNICODE],[1],[Defined to 1 if curses supports wide characters])
  593. ],[
  594. AC_MSG_RESULT([no])
  595. ])
  596. fi
  597. LIBS="$orig_libs"
  598. fi
  599. AC_ARG_WITH([system-libblkmaker], [AC_HELP_STRING([--with-system-libblkmaker], [Use system libblkmaker rather than bundled one (default disabled)])],[true],[with_system_libblkmaker=no])
  600. if test "x$with_system_libblkmaker" = "xyes"; then
  601. PKG_CHECK_MODULES([libblkmaker],[libblkmaker_jansson-0.1],[
  602. true
  603. ],[
  604. AC_MSG_ERROR([Could not find system libblkmaker])
  605. ])
  606. else
  607. save_LDFLAGS="$LDFLAGS"
  608. LDFLAGS="$LDFLAGS -Wl,-zorigin"
  609. origin_LDFLAGS=
  610. AC_MSG_CHECKING([whether the linker recognizes the -zorigin option])
  611. AC_TRY_LINK([],[],[
  612. AC_MSG_RESULT([yes])
  613. origin_LDFLAGS=',-zorigin'
  614. ],[
  615. AC_MSG_RESULT([no])
  616. ])
  617. LDFLAGS="$save_LDFLAGS"
  618. libblkmaker_CFLAGS='-Ilibblkmaker'
  619. libblkmaker_LDFLAGS='-Llibblkmaker/.libs -Wl,-rpath,\$$ORIGIN/libblkmaker/.libs'"$origin_LDFLAGS"
  620. libblkmaker_LIBS='-lblkmaker_jansson-0.1 -lblkmaker-0.1'
  621. AC_CONFIG_SUBDIRS([libblkmaker])
  622. fi
  623. AC_SUBST(libblkmaker_CFLAGS)
  624. AC_SUBST(libblkmaker_LDFLAGS)
  625. AC_SUBST(libblkmaker_LIBS)
  626. AM_CONDITIONAL([NEED_LIBBLKMAKER], [test x$with_system_libblkmaker != xyes])
  627. AM_CONDITIONAL([NEED_DYNCLOCK], [test x$icarus$modminer$x6500$ztex != xnonono])
  628. AM_CONDITIONAL([NEED_FPGAUTILS], [test x$need_fpgautils = xyes])
  629. AM_CONDITIONAL([HAS_SCRYPT], [test x$scrypt = xyes])
  630. AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
  631. AM_CONDITIONAL([HAVE_SENSORS], [test x$with_sensors = xyes])
  632. AM_CONDITIONAL([HAVE_CYGWIN], [test x$have_cygwin = xtrue])
  633. AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
  634. AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
  635. AM_CONDITIONAL([HAS_FPGA], [test x$bitforce$icarus$modminer$x6500$ztex != xnonononono])
  636. AM_CONDITIONAL([HAS_ASIC], [test x$avalon$icarus$httpsrv != xnonono])
  637. dnl Find YASM
  638. has_yasm=false
  639. if test "x$have_x86_32$have_x86_64" != "xfalsefalse"; then
  640. AC_PATH_PROG([YASM],[yasm],[false])
  641. if test "x$YASM" != "xfalse" ; then
  642. AC_MSG_CHECKING([if yasm version is greater than 1.0.1])
  643. yasmver=`"$YASM" --version | head -1 | cut -d\ -f2`
  644. yamajor=`echo $yasmver | cut -d. -f1`
  645. yaminor=`echo $yasmver | cut -d. -f2`
  646. yamini=`echo $yasmver | cut -d. -f3`
  647. if test "$yamajor" -ge "1" ; then
  648. if test "$yamajor" -eq "1" ; then
  649. if test "$yaminor" -ge "0" ; then
  650. if test "$yaminor" -eq "0"; then
  651. if test "$yamini" -ge "1"; then
  652. has_yasm=true
  653. fi
  654. else
  655. has_yasm=true
  656. fi
  657. fi
  658. fi
  659. else
  660. has_yasm=false
  661. fi
  662. if test "x$has_yasm" = "xtrue" ; then
  663. AC_MSG_RESULT([yes])
  664. else
  665. AC_MSG_RESULT([no])
  666. fi
  667. fi
  668. if test "x$has_yasm" = "xfalse" ; then
  669. AC_MSG_NOTICE([yasm is required for the assembly algorithms. They will be skipped.])
  670. else
  671. AC_DEFINE([HAVE_YASM], [1], [Defined to 1 if yasm is being used])
  672. if test "x$have_win32$have_cygwin" != "xfalsefalse"; then
  673. if test "x$have_x86_64" = xtrue; then
  674. YASM_FMT="win64"
  675. else
  676. YASM_FMT="coff"
  677. fi
  678. elif test "x$have_macho" = "xtrue"; then
  679. YASM_FMT="macho$bitness"
  680. else
  681. YASM_FMT="elf$bitness"
  682. fi
  683. fi
  684. fi
  685. AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
  686. have_sse2=no
  687. if test "x$cpumining$have_x86_32" = "xyestrue"; then
  688. AC_MSG_CHECKING([if SSE2 code compiles])
  689. save_CFLAGS="$CFLAGS"
  690. for flags in '' '-msse2'; do
  691. CFLAGS="$CFLAGS $flags"
  692. AC_TRY_LINK([
  693. #include <xmmintrin.h>
  694. ],[
  695. int *i = (int *)0xdeadbeef;
  696. __m128i a, b;
  697. a = _mm_set1_epi32(i[0]);
  698. b = _mm_set_epi32(i[0], i[1], i[2], i[3]);
  699. a = _mm_add_epi32(a, b);
  700. a = _mm_andnot_si128(a, b);
  701. a = _mm_or_si128(a, b);
  702. a = _mm_slli_epi32(a, i[4]);
  703. a = _mm_and_si128(a, b);
  704. a = _mm_xor_si128(a, b);
  705. ],[
  706. if test "x$flags" = "x"; then
  707. AC_MSG_RESULT([yes])
  708. else
  709. AC_MSG_RESULT([with $flags])
  710. fi
  711. SSE2_CFLAGS="$flags"
  712. have_sse2=yes
  713. break
  714. ],[
  715. true
  716. ])
  717. done
  718. CFLAGS="${save_CFLAGS}"
  719. if test "x$have_sse2" = "xyes"; then
  720. AC_DEFINE([HAVE_SSE2], [1], [Defined to 1 if yasm is being used])
  721. else
  722. AC_MSG_RESULT([no])
  723. fi
  724. fi
  725. AM_CONDITIONAL([HAVE_SSE2], [test "x$have_sse2" = "xyes"])
  726. if test "x$bitforce$modminer$icarus" != "xnonono"; then
  727. AC_ARG_WITH([libudev], [AC_HELP_STRING([--without-libudev], [Autodetect FPGAs using libudev (default enabled)])],
  728. [libudev=$withval],
  729. [libudev=auto]
  730. )
  731. if test "x$libudev" != "xno"; then
  732. AC_CHECK_HEADER([libudev.h],[
  733. libudev=yes
  734. UDEV_LIBS=-ludev
  735. AC_DEFINE([HAVE_LIBUDEV], [1], [Defined to 1 if libudev is wanted])
  736. ], [
  737. if test "x$libudev" = "xyes"; then
  738. AC_MSG_ERROR([libudev not found])
  739. fi
  740. libudev=no
  741. ])
  742. fi
  743. fi
  744. AM_CONDITIONAL([HAVE_LIBUDEV], [test x$libudev != xno])
  745. AC_SUBST(LIBUSB_LIBS)
  746. AC_SUBST(LIBUSB_CFLAGS)
  747. PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.18.2], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.18.2])])
  748. if echo "$LIBCURL_CFLAGS" | grep '@CPPFLAG_CURL_STATICLIB@' >/dev/null 2>&1; then
  749. AC_MSG_WARN([Your libcurl pkgconfig file is broken, applying workaround])
  750. LIBCURL_CFLAGS=`echo "$LIBCURL_CFLAGS" | sed 's/@CPPFLAG_CURL_STATICLIB@//'`
  751. fi
  752. AC_SUBST(LIBCURL_LIBS)
  753. AC_CHECK_FUNCS([setrlimit])
  754. dnl CCAN wants to know a lot of vars.
  755. # All the configuration checks. Regrettably, the __attribute__ checks will
  756. # give false positives on old GCCs, since they just cause warnings. But that's
  757. # fairly harmless.
  758. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((cold)) cleanup(void) { }])],
  759. AC_DEFINE([HAVE_ATTRIBUTE_COLD], [1],
  760. [Define if __attribute__((cold))]))
  761. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((const)) cleanup(void) { }])],
  762. AC_DEFINE([HAVE_ATTRIBUTE_CONST], [1],
  763. [Define if __attribute__((const))]))
  764. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((noreturn)) cleanup(void) { exit(1); }])],
  765. [
  766. AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], [1],
  767. [Define if __attribute__((noreturn))])
  768. AC_DEFINE_UNQUOTED([NORETURN], [__attribute__((noreturn))], [Syntax of noreturn attribute])
  769. ], [
  770. AC_DEFINE_UNQUOTED([NORETURN], [])
  771. ]
  772. )
  773. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((format(__printf__, 1, 2))) cleanup(const char *fmt, ...) { }])],
  774. AC_DEFINE([HAVE_ATTRIBUTE_PRINTF], [1],
  775. [Define if __attribute__((format(__printf__)))]))
  776. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((unused)) cleanup(void) { }])],
  777. AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1],
  778. [Define if __attribute__((unused))]))
  779. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((used)) cleanup(void) { }])],
  780. AC_DEFINE([HAVE_ATTRIBUTE_USED], [1],
  781. [Define if __attribute__((used))]))
  782. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_constant_p(1) ? 0 : 1; }])],
  783. AC_DEFINE([HAVE_BUILTIN_CONSTANT_P], [1],
  784. [Define if have __builtin_constant_p]))
  785. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_types_compatible_p(char *, int) ? 1 : 0; }])],
  786. AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P], [1],
  787. [Define if have __builtin_types_compatible_p]))
  788. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static int __attribute__((warn_unused_result)) func(int x) { return x; }])],
  789. AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1],
  790. [Define if __attribute__((warn_unused_result))]))
  791. AC_MSG_CHECKING([for roundl function])
  792. save_LIBS="${LIBS}"
  793. LIBS="$LIBS -lm"
  794. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  795. #include <math.h>
  796. ]], [[
  797. return (roundl(*(long double *)0xdeadbeef) == 1.0);
  798. ]])], [
  799. AC_MSG_RESULT([yes])
  800. ], [
  801. AC_MSG_RESULT([no])
  802. AC_DEFINE([NEED_ROUNDL], [1], [Defined to 1 if C99 roundl is missing])
  803. ])
  804. LIBS="${save_LIBS}"
  805. # byteswap functions
  806. AH_TEMPLATE([HAVE_BYTESWAP_H], [Define to use byteswap macros from byteswap.h])
  807. AH_TEMPLATE([HAVE_ENDIAN_H], [Define to use byteswap macros from endian.h])
  808. AH_TEMPLATE([HAVE_SYS_ENDIAN_H], [Define to use byteswap macros from sys/endian.h])
  809. AH_TEMPLATE([HAVE_LIBKERN_OSBYTEORDER_H], [Define to use byteswap macros from libkern/OSByteOrder.h])
  810. BSWAP=''
  811. for sym in bswap_ __builtin_bswap __bswap_ __swap swap OSSwapInt; do
  812. AC_MSG_CHECKING([for ${sym}* functions])
  813. for headerfile in '' byteswap.h endian.h sys/endian.h libkern/OSByteOrder.h; do
  814. BFG_INCLUDE([headerinclude], [${headerfile}])
  815. AC_LINK_IFELSE([
  816. AC_LANG_PROGRAM([
  817. ${headerinclude}
  818. ], [
  819. (void) ${sym}16(0);
  820. (void) ${sym}32(0);
  821. (void) ${sym}64(0);
  822. ])
  823. ], [
  824. BSWAP="${sym}"
  825. if test "x${headerfile}" = "x"; then
  826. AC_MSG_RESULT([yes])
  827. else
  828. AC_MSG_RESULT([found in ${headerfile}])
  829. AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$headerfile]), 1)
  830. fi
  831. break 2
  832. ])
  833. done
  834. AC_MSG_RESULT([no])
  835. done
  836. if test "x$BSWAP" = "x"; then
  837. true # Substitutes are provided in miner.h
  838. elif test "x$BSWAP" = "xbswap_"; then
  839. AC_MSG_CHECKING([if bswap_16 is already a macro])
  840. BFG_PREPROC_IFELSE([defined(bswap_16)], $headerfile, [
  841. AC_MSG_RESULT([yes])
  842. BSWAP=""
  843. ],[
  844. AC_MSG_RESULT([no])
  845. ])
  846. fi
  847. if test "x$BSWAP" != "x"; then
  848. AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, [Define to 16-bit byteswap macro])
  849. AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, [Define to 16-bit byteswap macro])
  850. AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, [Define to 16-bit byteswap macro])
  851. fi
  852. # endian definition macros
  853. AC_MSG_CHECKING([for platform endian])
  854. found_endian=no
  855. for headerfile in '' endian.h sys/endian.h sys/param.h; do
  856. for pfx in '' '__'; do
  857. BFG_PREPROC_IFELSE([defined(${pfx}BYTE_ORDER) && defined(${pfx}BIG_ENDIAN) && defined(${pfx}LITTLE_ENDIAN) && (${pfx}BYTE_ORDER == ${pfx}BIG_ENDIAN || ${pfx}BYTE_ORDER == ${pfx}LITTLE_ENDIAN)], ${headerfile}, [
  858. if test "x$headerfile" = "x"; then
  859. headerfilec=''
  860. else
  861. headerfilec=" (${headerfile})"
  862. fi
  863. BFG_PREPROC_IFELSE([${pfx}BYTE_ORDER == ${pfx}BIG_ENDIAN], ${headerfile}, [
  864. AC_MSG_RESULT([big endian${headerfilec}])
  865. AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if your platform is big endian])
  866. ], [
  867. AC_MSG_RESULT([little endian${headerfilec}])
  868. ])
  869. found_endian=yes
  870. break 2
  871. ],[true])
  872. done
  873. done
  874. if test "x$found_endian" = "xno"; then
  875. if $have_win32 || $have_cygwin; then
  876. AC_MSG_RESULT([assuming little endian (Windows)])
  877. else
  878. # AC_C_BIGENDIAN is reported to have problems, and invasive even if buried in a conditional, so don't use it
  879. AC_MSG_RESULT([unknown])
  880. AC_MSG_ERROR([Unable to identify platform endian])
  881. fi
  882. fi
  883. AC_MSG_CHECKING([if GNU format attribute compiles])
  884. AC_TRY_COMPILE([
  885. #define FORMAT_SYNTAX_CHECK(...) __attribute__(( format(__VA_ARGS__) ))
  886. int myfunc(char *fmt, ...) FORMAT_SYNTAX_CHECK(printf, 1, 2);
  887. int myfunc(char *fmt, ...) {
  888. return 42;
  889. }
  890. ], [
  891. myfunc("abc%d", 42);
  892. ], [
  893. AC_MSG_RESULT([yes])
  894. AC_DEFINE_UNQUOTED([FORMAT_SYNTAX_CHECK(...)], [__attribute__(( format(__VA_ARGS__) ))], [Syntax of format-checking attribute])
  895. ], [
  896. AC_MSG_RESULT([no])
  897. AC_DEFINE_UNQUOTED([FORMAT_SYNTAX_CHECK(...)], [])
  898. ])
  899. AC_MSG_CHECKING([for clock_gettime(CLOCK_MONOTONIC)])
  900. AC_TRY_COMPILE([
  901. #define _GNU_SOURCE
  902. #include <time.h>
  903. ],[
  904. struct timespec ts;
  905. clock_gettime(CLOCK_MONOTONIC, &ts);
  906. ],[
  907. AC_MSG_RESULT([yes])
  908. AC_DEFINE([HAVE_CLOCK_GETTIME_MONOTONIC], [1], [Defined to 1 if clock_gettime(CLOCK_MONOTONIC) is defined])
  909. save_LIBS="${LIBS}"
  910. AC_SEARCH_LIBS([clock_gettime],[rt posix4],[
  911. if test "x${ac_cv_search_clock_gettime}" != "xnone required"; then
  912. RT_LIBS="${ac_cv_search_clock_gettime}"
  913. fi
  914. ])
  915. LIBS="${save_LIBS}"
  916. AC_CHECK_FUNCS([clock_nanosleep])
  917. AC_MSG_CHECKING([for clock_gettime(CLOCK_MONOTONIC_RAW)])
  918. AC_TRY_COMPILE([
  919. #define _GNU_SOURCE
  920. #include <time.h>
  921. ],[
  922. struct timespec ts;
  923. clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
  924. ],[
  925. AC_MSG_RESULT([yes])
  926. AC_DEFINE([HAVE_CLOCK_GETTIME_MONOTONIC_RAW], [1], [Defined to 1 if clock_gettime(CLOCK_MONOTONIC_RAW) is defined])
  927. ],[
  928. AC_MSG_RESULT([no])
  929. ])
  930. ],[
  931. AC_MSG_RESULT([no])
  932. ])
  933. if test "x$prefix" = xNONE; then
  934. prefix=/usr/local
  935. fi
  936. AM_CONDITIONAL([NEED_BITSTREAM_FPGAMINER], [test x$modminer$x6500 != xnono])
  937. AC_DEFINE_UNQUOTED([PHATK_KERNNAME], ["phatk121016"], [Filename for phatk kernel])
  938. AC_DEFINE_UNQUOTED([POCLBM_KERNNAME], ["poclbm130302"], [Filename for poclbm kernel])
  939. AC_DEFINE_UNQUOTED([DIAKGCN_KERNNAME], ["diakgcn121016"], [Filename for diakgcn kernel])
  940. AC_DEFINE_UNQUOTED([DIABLO_KERNNAME], ["diablo130302"], [Filename for diablo kernel])
  941. AC_DEFINE_UNQUOTED([SCRYPT_KERNNAME], ["scrypt130511"], [Filename for scrypt kernel])
  942. AC_SUBST(PTHREAD_FLAGS)
  943. AC_SUBST(DLOPEN_FLAGS)
  944. AC_SUBST(PTHREAD_LIBS)
  945. AC_SUBST(NCURSES_CPPFLAGS)
  946. AC_SUBST(NCURSES_LIBS)
  947. AC_SUBST(PDCURSES_LIBS)
  948. AC_SUBST(WS2_LIBS)
  949. AC_SUBST(MM_LIBS)
  950. AC_SUBST(MATH_LIBS)
  951. AC_SUBST(RT_LIBS)
  952. AC_SUBST(UDEV_LIBS)
  953. AC_SUBST(SSE2_CFLAGS)
  954. AC_SUBST(YASM_FMT)
  955. AC_CONFIG_FILES([
  956. Makefile
  957. x86_64/Makefile
  958. x86_32/Makefile
  959. ccan/Makefile
  960. lib/Makefile
  961. ])
  962. AC_OUTPUT
  963. echo
  964. echo
  965. echo
  966. echo "------------------------------------------------------------------------"
  967. echo "$PACKAGE $VERSION"
  968. echo "------------------------------------------------------------------------"
  969. echo
  970. echo
  971. echo "Configuration Options Summary:"
  972. echo
  973. echo " curses.TUI...........: $cursesmsg"
  974. if test "x$scrypt" != xno; then
  975. echo " scrypt...............: Enabled"
  976. else
  977. echo " scrypt...............: Disabled"
  978. fi
  979. echo
  980. if test "x$opencl" = xyes; then
  981. echo " OpenCL...............: Enabled"
  982. else
  983. echo " OpenCL...............: Disabled"
  984. fi
  985. if test "x$with_sensors" = xyes; then
  986. echo " sensors.monitoring.: Enabled"
  987. elif test "x$opencl" = xyes; then
  988. echo " sensors.monitoring.: Disabled"
  989. else
  990. echo " sensors.monitoring.: n/a"
  991. fi
  992. if test "x$adl" = xyes; then
  993. echo " ADL.monitoring.....: Enabled"
  994. elif test "x$opencl" = xyes; then
  995. echo " ADL.monitoring.....: Disabled"
  996. else
  997. echo " ADL.monitoring.....: n/a"
  998. fi
  999. if test "x$avalon" = xyes; then
  1000. echo " Avalon.ASICs.........: Enabled"
  1001. else
  1002. echo " Avalon.ASICs.........: Disabled"
  1003. fi
  1004. if test "x$bigpic" = xyes; then
  1005. echo " BPM.USB.ASICs........: Enabled"
  1006. else
  1007. echo " BPM.USB.ASICs........: Disabled"
  1008. fi
  1009. if test "x$bitforce" = xyes; then
  1010. echo " BitForce.devices.....: Enabled"
  1011. else
  1012. echo " BitForce.devices.....: Disabled"
  1013. fi
  1014. if test "x$icarus" = xyes; then
  1015. echo " Icarus.FPGAs.........: Enabled"
  1016. else
  1017. echo " Icarus.FPGAs.........: Disabled"
  1018. fi
  1019. if test "x$modminer" = xyes; then
  1020. echo " ModMiner.FPGAs.......: Enabled"
  1021. else
  1022. echo " ModMiner.FPGAs.......: Disabled"
  1023. fi
  1024. if test "x$x6500" = xyes; then
  1025. echo " X6500.FPGAs..........: Enabled"
  1026. elif test "x$ztexwarn" = xyes; then
  1027. echo " X6500.FPGAs..........: Disabled (libusb not found)"
  1028. else
  1029. echo " X6500.FPGAs..........: Disabled"
  1030. fi
  1031. if test "x$ztex" = xyes; then
  1032. echo " ZTEX.FPGAs...........: Enabled"
  1033. elif test "x$ztexwarn" = xyes; then
  1034. echo " ZTEX.FPGAs...........: Disabled (libusb not found)"
  1035. else
  1036. echo " ZTEX.FPGAs...........: Disabled"
  1037. fi
  1038. if test "x$bitforce$modminer" != xnono; then
  1039. echo " libudev.detection....: $libudev"
  1040. fi
  1041. if test "x$bitfury" = xyes; then
  1042. echo " Bitfury.ASICs........: Enabled"
  1043. else
  1044. echo " Bitfury.ASICs........: Disabled"
  1045. fi
  1046. echo
  1047. if test "x$cpumining" = xyes; then
  1048. echo " CPU Mining...........: Enabled"
  1049. echo " ASM.(for CPU mining).: $has_yasm"
  1050. else
  1051. echo " CPU Mining...........: Disabled"
  1052. fi
  1053. echo
  1054. echo "Compilation............: make (or gmake)"
  1055. echo " CPPFLAGS.............:" $CPPFLAGS $NCURSES_CPPFLAGS $PTHREAD_FLAGS
  1056. echo " CFLAGS...............:" $CFLAGS $LIBUSB_CFLAGS $JANSSON_CFLAGS $PTHREAD_FLAGS
  1057. echo " LDFLAGS..............:" $LDFLAGS $PTHREAD_FLAGS $PTHREAD_LIBS
  1058. echo " LDADD................:" $LIBS $DLOPEN_FLAGS $LIBCURL_LIBS $JANSSON_LIBS $NCURSES_LIBS $PDCURSES_LIBS $WS2_LIBS $MATH_LIBS $UDEV_LIBS $LIBUSB_LIBS
  1059. echo
  1060. echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
  1061. echo " prefix...............: $prefix"
  1062. echo