configure.ac 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618
  1. dnl * Copyright 2011-2014 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 * Copyright 2013-2014 Nate Woolls
  8. dnl *
  9. dnl * This program is free software; you can redistribute it and/or modify it
  10. dnl * under the terms of the GNU General Public License as published by the Free
  11. dnl * Software Foundation; either version 3 of the License, or (at your option)
  12. dnl * any later version. See COPYING for more details.
  13. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  14. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  15. m4_define([v_maj], [5])
  16. m4_define([v_min], [4])
  17. m4_define([v_mic], [2])
  18. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  19. m4_define([v_ver], [v_maj.v_min.v_mic])
  20. m4_define([lt_rev], m4_eval(v_maj + v_min))
  21. m4_define([lt_cur], v_mic)
  22. m4_define([lt_age], v_min)
  23. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  24. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  25. AC_INIT([bfgminer], [v_ver], [luke-jr+bfgminer@utopios.org])
  26. AC_PREREQ([2.59c])
  27. AC_CANONICAL_SYSTEM
  28. AC_CONFIG_MACRO_DIR([m4])
  29. AC_CONFIG_SRCDIR([miner.c])
  30. AC_CONFIG_HEADERS([config.h])
  31. AH_BOTTOM([
  32. #ifdef WIN32
  33. #include "winhacks.h"
  34. #endif
  35. ])
  36. AM_INIT_AUTOMAKE([foreign subdir-objects])
  37. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  38. AC_USE_SYSTEM_EXTENSIONS
  39. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  40. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  41. m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
  42. m4_ifdef([v_rel], , [m4_define([v_rel], [])])
  43. AC_DEFINE_UNQUOTED(CGMINER_MAJOR_VERSION, [v_maj], [Major version])
  44. AC_DEFINE_UNQUOTED(CGMINER_MINOR_VERSION, [v_min], [Minor version])
  45. AC_DEFINE_UNQUOTED(CGMINER_MINOR_SUBVERSION, [v_mic], [Micro version])
  46. version_info="lt_rev:lt_cur:lt_age"
  47. release_info="v_rel"
  48. AC_SUBST(version_info)
  49. AC_SUBST(release_info)
  50. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  51. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  52. VMAJ=v_maj
  53. AC_SUBST(VMAJ)
  54. AC_CANONICAL_BUILD
  55. AC_CANONICAL_HOST
  56. dnl Make sure anyone changing configure.ac/Makefile.am has a clue
  57. AM_MAINTAINER_MODE([enable])
  58. dnl Checks for programs
  59. AC_PROG_CC_C99
  60. gl_EARLY
  61. AC_PROG_GCC_TRADITIONAL
  62. AM_PROG_CC_C_O
  63. AC_PROG_RANLIB
  64. AC_PROG_CPP
  65. AC_PROG_SED
  66. gl_INIT
  67. AC_SYS_LARGEFILE
  68. dnl Checks for header files.
  69. AC_HEADER_STDC
  70. AC_CHECK_HEADERS(syslog.h)
  71. AC_CHECK_HEADERS([sys/epoll.h])
  72. AC_CHECK_HEADERS([sys/mman.h])
  73. AC_CHECK_HEADERS([sys/prctl.h])
  74. AC_CHECK_HEADERS([sys/file.h])
  75. AC_CHECK_HEADERS([sys/termios.h])
  76. AC_CHECK_HEADERS([linux/spi/spidev.h])
  77. AC_CHECK_MEMBER([struct i2c_msg.buf],[
  78. true
  79. ],[
  80. dnl Note the member is different here to avoid caching screwing things up
  81. AC_CHECK_MEMBER([struct i2c_msg.len],[
  82. AC_DEFINE([NEED_LINUX_I2C_H],[1],[Defined if linux/i2c.h is needed to supplement linux/i2c-dev.h])
  83. ],[
  84. true
  85. ],[
  86. AC_INCLUDES_DEFAULT
  87. #include <linux/i2c.h>
  88. #include <linux/i2c-dev.h>
  89. ])
  90. ],[
  91. AC_INCLUDES_DEFAULT
  92. #include <linux/i2c-dev.h>
  93. ])
  94. # Setuid
  95. AC_CHECK_HEADERS([pwd.h])
  96. # Check for chroot support
  97. AC_CHECK_FUNCS([chroot])
  98. AC_CHECK_FUNCS([sleep])
  99. AC_FUNC_ALLOCA
  100. lowllist=
  101. driverlist=
  102. algolist=
  103. optlist=
  104. has_fpga=no
  105. has_asic=no
  106. need_binloader=no
  107. need_dynclock=no
  108. need_gc3355=no
  109. need_linux_i2c_dev=no
  110. need_lowl_vcom=no
  111. need_lowlevel=no
  112. need_lowl_ftdi=no
  113. need_lowl_hid=no
  114. need_lowl_mswin=no
  115. need_lowl_pci=no
  116. need_lowl_spi=no
  117. need_lowl_usb=no
  118. need_knc_asic=no
  119. need_work2d=no
  120. have_cygwin=false
  121. have_win32=false
  122. have_macho=false
  123. use_udevrules=true
  124. have_udevrules=false
  125. AUTOSCAN_CPPFLAGS=""
  126. AUTOSCAN_LIBS=""
  127. DLOPEN_FLAGS="-ldl"
  128. WS2_LIBS=""
  129. MM_LIBS=""
  130. MATH_LIBS="-lm"
  131. RT_LIBS=""
  132. case $target in
  133. amd64-* | x86_64-*)
  134. have_x86_32=false
  135. have_x86_64=true
  136. bitness="64"
  137. ;;
  138. i386-* | i486-* | i586-* | i686-* | x86-*)
  139. have_x86_32=true
  140. have_x86_64=false
  141. bitness="32"
  142. ;;
  143. *)
  144. have_x86_32=false
  145. have_x86_64=false
  146. ;;
  147. esac
  148. case $target in
  149. *-*-mingw*)
  150. have_win32=true
  151. use_udevrules=false
  152. DLOPEN_FLAGS=""
  153. WS2_LIBS="-lws2_32"
  154. MM_LIBS="-lwinmm"
  155. AC_DEFINE([_WIN32_WINNT], [0x0501], "WinNT version for XP+ support")
  156. AC_DEFINE([FD_SETSIZE], [4096], [Maximum sockets before fd_set overflows])
  157. ;;
  158. *-*-cygwin*)
  159. have_cygwin=true
  160. use_udevrules=false
  161. ;;
  162. powerpc-*-darwin*)
  163. CFLAGS="$CFLAGS -faltivec"
  164. have_macho=true
  165. use_udevrules=false
  166. ;;
  167. *-*-darwin*)
  168. LDFLAGS="$LDFLAGS -framework IOKit -framework CoreFoundation"
  169. have_macho=true
  170. use_udevrules=false
  171. ;;
  172. esac
  173. m4_define([BFG_INCLUDE],
  174. if test "x$2" = "x"; then
  175. $1=''
  176. else
  177. $1="[#]include <$2>"
  178. fi
  179. )
  180. m4_define([BFG_PREPROC_IFELSE],
  181. BFG_INCLUDE([headerinclude], $2)
  182. AC_COMPILE_IFELSE([
  183. AC_LANG_PROGRAM([
  184. ${headerinclude}
  185. ], [
  186. #if !( $1 )
  187. #error "$1 false in preprocessor"
  188. #endif
  189. ])
  190. ],[$3],[$4])
  191. )
  192. m4_define([BFG_FIND_INCLUDE_PATH],[
  193. m4_pushdef([_rel_path],[$1])
  194. m4_pushdef([_header_file],[$2])
  195. m4_pushdef([_iffound],[$3])
  196. m4_pushdef([_ifnotfound],[$4])
  197. m4_pushdef([_includes],[$5])
  198. m4_pushdef([_result_var],[inclpath_[]patsubst(_header_file,[[./]],[_])])
  199. AC_CHECK_HEADER([_rel_path/_header_file],[
  200. AC_MSG_CHECKING([_header_file path])
  201. _result_var=`echo '[#]include <'"_rel_path"'/_header_file>' | ${CPP} -M - 2>/dev/null | ${SED} [-E -e ':a' -e '/\\$/!b b' -e N -e 's/\\\n/ /' -e 't a' -e ':b' -e 's/^[^:]*:[[:space:]]*(([^[:space:]\]|\\.)*[[:space:]])*(([^[:space:]\]|\\.)*)(\\|\\\\|\/)?]patsubst([_header_file],[\.],[\\.])[([[:space:]].*)?$/\3/' -e 't' -e d]`
  202. if test "x$_result_var" = "x"; then
  203. AC_MSG_RESULT([failed])
  204. AC_MSG_ERROR([Couldn't determine include path for _header_file])
  205. else
  206. AC_MSG_RESULT([$_result_var])
  207. _iffound
  208. fi
  209. ],[
  210. true
  211. _ifnotfound
  212. ],[
  213. _includes
  214. ])
  215. m4_popdef([_rel_path],[_header_file],[_iffound],[_ifnotfound],[_result_var])
  216. ])
  217. bfg_enableaction() {
  218. _var=$1
  219. eval "_missingdeps=\"\$${_var}_missingdeps\""
  220. if test -n "$_missingdeps"; then
  221. _enableaction=
  222. for _missingdep in $_missingdeps; do
  223. eval "_howto=\"\$howto_${_missingdep}\""
  224. if test "x$_howto" = "x"; then
  225. eval "_label=\"\${label_${_missingdep}-${_missingdep}}\""
  226. _howto="enable $_label"
  227. fi
  228. if test "$_howto" != "x"; then
  229. _enableaction="$_enableaction; $_howto"
  230. fi
  231. done
  232. _enableaction="${_enableaction:2}"
  233. else
  234. eval "_enableaction=\"\$${_var}_enableaction\""
  235. fi
  236. echo "$_enableaction"
  237. }
  238. dnl _BFG_AUTOITEM(list,driver,DriverName,dependency list,default:no/auto,CodeIfEnabled)
  239. m4_define([_BFG_AUTOITEM],[
  240. m4_pushdef([_list],[$1])
  241. m4_pushdef([_this_drv],m4_default([$2],m4_tolower([$3])))
  242. m4_pushdef([_this_drvuc],m4_toupper(_this_drv))
  243. m4_pushdef([_this_USE],USE_[]_this_drvuc)
  244. m4_pushdef([_this_name],[$3])
  245. m4_pushdef([_deplist],[$4])
  246. m4_pushdef([_this_default],[$5])
  247. m4_pushdef([_this_enablecode],[$6])
  248. m4_case(_list,
  249. [algo],[algolist="$algolist []_this_name/[]_this_USE"],
  250. [driver],[driverlist="$driverlist []_this_drv/[]_this_USE"],
  251. []
  252. )
  253. label_[]_this_drvuc="[]_this_name"
  254. AC_ARG_ENABLE([]_this_drv,
  255. m4_bmatch(_this_default,[.*no$],
  256. AC_HELP_STRING([--enable-[]_this_drv],[Compile support for ]_this_name[ (default disabled)]),
  257. AC_HELP_STRING([--disable-[]_this_drv],[Compile support for ]_this_name[ (default enabled)])),
  258. [[]_this_USE=$enableval],
  259. [[]_this_USE=[]_this_default]
  260. )
  261. []_this_drv[]_opt=
  262. if test "x$[]_this_USE" = "xno"; then
  263. true
  264. else
  265. if test "x$[]_this_USE" = xauto; then
  266. _wasauto=yes
  267. else
  268. _wasauto=no
  269. fi
  270. if test "x$[]_this_USE" != xyes; then
  271. if test "x$[]_this_USE" != xauto; then
  272. []_this_drv[]_opt="$[]_this_USE"
  273. fi
  274. []_this_USE=yes
  275. fi
  276. for __drvdep in []m4_toupper(_deplist); do
  277. eval "_drvdep=\"\$USE_$__drvdep\""
  278. if test "x$_drvdep" != "xyes"; then
  279. []_this_USE[]_missingdeps="$[]_this_USE[]_missingdeps $__drvdep"
  280. []_this_USE=no
  281. fi
  282. done
  283. if test "x$[]_this_USE[]$_wasauto" = xnono; then
  284. _enableaction=`bfg_enableaction []_this_USE`
  285. AC_MSG_ERROR([To enable []_this_name: $_enableaction])
  286. fi
  287. fi
  288. if test "x$[]_this_USE" = "xyes"; then
  289. AC_DEFINE([]_this_USE,[1],[Defined to 1 if []_this_name support is wanted])
  290. []_this_enablecode
  291. fi
  292. AM_CONDITIONAL([]_this_USE,[test x$[]_this_USE = xyes])
  293. m4_popdef([_this_drv],[_this_drvuc],[_this_USE],[_this_name],[_deplist],[_this_default],[_this_enablecode])
  294. ])
  295. dnl BFG_ALGO(AlgoName,default:no/yes,CodeIfEnabled)
  296. m4_define([BFG_ALGO],[
  297. _BFG_AUTOITEM([algo],,[$1],,[$2],[$3])
  298. ])
  299. dnl BFG_DRIVER(driver,DriverName,dependency list,default:no/auto,CodeIfEnabled)
  300. m4_define([BFG_DRIVER],[
  301. _BFG_AUTOITEM([driver],[$1],[$2],[$3],$dd[$4],[$5])
  302. ])
  303. AC_CHECK_DECL([HASH_ITER],[
  304. AC_CHECK_DECL([DL_CONCAT],[
  305. true
  306. ],[
  307. AC_MSG_ERROR([Could not find DL_FOREACH_SAFE - install uthash-dev 1.9.4+])
  308. ],[
  309. #include <utlist.h>
  310. ])
  311. ],[
  312. AC_MSG_ERROR([Could not find HASH_ITER - please install uthash-dev 1.9.4+])
  313. ],[
  314. #include <uthash.h>
  315. ])
  316. ddyes=yes
  317. ddauto=auto
  318. ddno=no
  319. AC_ARG_ENABLE([other-drivers],
  320. [AC_HELP_STRING([--disable-other-drivers],[Build without drivers by default unless explicitly enabled])],
  321. [
  322. if test x$enableval = xyes; then
  323. ddno=yes
  324. else
  325. ddyes=no
  326. ddauto=no
  327. fi
  328. ]
  329. )
  330. broad_udevrules=false
  331. AC_ARG_ENABLE([broad-udevrules],
  332. [AC_HELP_STRING([--enable-broad-udevrules],[Include udev rules for ambiguous devices which may not be miners])],
  333. [
  334. if test "x$enableval" = "xyes"; then
  335. broad_udevrules=true
  336. fi
  337. ]
  338. )
  339. use_udevrules_group=true
  340. udevrules_group="video"
  341. AC_ARG_WITH([udevrules-group],
  342. [AC_HELP_STRING([--with-udevrules-group=groupname],[Configure mining devices to be owned by a specific group (default `video')])],
  343. [
  344. if test "x$withval" = "xno"; then
  345. use_udevrules_group=false
  346. else
  347. udevrules_group="$withval"
  348. fi
  349. ]
  350. )
  351. AM_CONDITIONAL([USE_UDEVRULES_GROUP], [$use_udevrules_group])
  352. AC_SUBST([UDEVRULES_GROUP], [$udevrules_group])
  353. BFG_ALGO(Keccak,no)
  354. BFG_ALGO(SHA256d,yes)
  355. BFG_ALGO(scrypt,no)
  356. lowl_pci=no
  357. if test "x$ac_cv_header_sys_mman_h" = "xyes"; then
  358. AC_ARG_WITH([uio],
  359. [AC_HELP_STRING([--without-uio],[Compile support for PCI devices via Linux UIO interface (default enabled)])],
  360. [uio=$withval],
  361. [uio=yes])
  362. AC_ARG_WITH([vfio],
  363. [AC_HELP_STRING([--without-vfio],[Compile support for PCI devices via Linux VFIO interface (default enabled)])],
  364. [vfio=$withval],
  365. [vfio=auto])
  366. if test "x$vfio" != "xno"; then
  367. AC_CHECK_HEADER([linux/vfio.h],[
  368. vfio=yes
  369. ],[
  370. if test "x$vfio" = "xyes"; then
  371. AC_MSG_ERROR([Unable to find linux/vfio.h])
  372. elif test "x$uio" = "xyes"; then
  373. AC_MSG_WARN([linux/vfio.h not found; PCI device support will require UIO (and root access)])
  374. else
  375. AC_MSG_WARN([linux/vfio.h not found; PCI device support will not be available])
  376. fi
  377. vfio=no
  378. ])
  379. fi
  380. if test "x$vfio$uio" != xnono; then
  381. lowl_pci=yes
  382. fi
  383. fi
  384. BFG_DRIVER(cpumining,CPU mining,,no,[
  385. driverlist="$driverlist cpu:asm/has_yasm"
  386. driverlist="$driverlist cpu:sse2/have_sse2"
  387. ])
  388. driverlist=`echo "${driverlist}" | ${SED} -e 's/ cpumining/ cpu/'`
  389. BFG_DRIVER(,OpenCL,,no)
  390. m4_define([BFG_PTHREAD_FLAG_CHECK],
  391. AC_MSG_CHECKING([for $1])
  392. for cflag in ' -pthread' ''; do
  393. for lib in ' -lpthread' ' -lwinpthread' ''; do
  394. CFLAGS="${save_CFLAGS}${cflag}"
  395. LIBS="${save_LIBS}${lib}"
  396. AC_LINK_IFELSE([
  397. AC_LANG_PROGRAM([
  398. #include <pthread.h>
  399. ], [
  400. void *f = $1;
  401. ])
  402. ], [
  403. found_pthread=true
  404. PTHREAD_FLAGS="${cflag}"
  405. PTHREAD_LIBS="${lib}"
  406. if test "x${cflag}${lib}" = "x"; then
  407. AC_MSG_RESULT([yes])
  408. else
  409. AC_MSG_RESULT([with${cflag}${lib}])
  410. fi
  411. $2
  412. break 2
  413. ])
  414. done
  415. done
  416. if test "x${found_pthread}" = "xfalse"; then
  417. AC_MSG_RESULT([no])
  418. fi
  419. )
  420. save_CFLAGS="${CFLAGS}"
  421. save_LIBS="${LIBS}"
  422. found_pthread=false
  423. BFG_PTHREAD_FLAG_CHECK([pthread_cancel],[
  424. AC_DEFINE([HAVE_PTHREAD_CANCEL], [1], [Define if you have a native pthread_cancel])
  425. ])
  426. if test "x${found_pthread}" = "xfalse"; then
  427. BFG_PTHREAD_FLAG_CHECK([pthread_create])
  428. if test "x${found_pthread}" = "xfalse"; then
  429. AC_MSG_ERROR([Could not find pthread library - please install libpthread])
  430. fi
  431. fi
  432. # check for nanosleep here, since it is provided by winpthread
  433. AC_CHECK_FUNCS([nanosleep])
  434. CFLAGS="${save_CFLAGS}"
  435. LIBS="${save_LIBS}"
  436. PKG_CHECK_MODULES([JANSSON],[jansson],[
  437. true
  438. ],[
  439. AC_MSG_CHECKING([for jansson in system-default locations])
  440. LIBS="$LIBS -ljansson"
  441. AC_TRY_LINK([
  442. #include <jansson.h>
  443. ],[
  444. json_object();
  445. ],[
  446. AC_MSG_RESULT([found])
  447. JANSSON_LIBS=-ljansson
  448. ],[
  449. AC_MSG_RESULT([not found])
  450. AC_MSG_ERROR([Could not find jansson library])
  451. ])
  452. LIBS="${save_LIBS}"
  453. ])
  454. AC_SUBST(JANSSON_CFLAGS)
  455. AC_SUBST(JANSSON_LIBS)
  456. if test "x$USE_OPENCL" = xyes; then
  457. adl="yes"
  458. if test "x$USE_KECCAK" = xyes; then
  459. AC_DEFINE([USE_OPENCL_FULLHEADER],[1],[Defined to 1 if OpenCL fullheader kernel interface is wanted])
  460. fi
  461. driverlist="$driverlist opencl:sensors/with_sensors"
  462. AC_ARG_WITH([sensors],
  463. [AC_HELP_STRING([--without-sensors],[Build with libsensors monitoring (default enabled)])],
  464. [true],[with_sensors=auto])
  465. if test "x$USE_OPENCL" != xyes; then
  466. with_sensors=no
  467. fi
  468. if test "x$with_sensors" != xno; then
  469. AC_MSG_CHECKING([for libsensors])
  470. save_LIBS="${LIBS}"
  471. LIBS="$LIBS -lsensors"
  472. AC_LINK_IFELSE([AC_LANG_PROGRAM([
  473. #include <stddef.h>
  474. #include <sensors/sensors.h>
  475. ],[
  476. const sensors_chip_name *cn;
  477. cn = sensors_get_detected_chips(NULL, NULL);
  478. ])],[
  479. with_sensors=yes
  480. sensors_LIBS="-lsensors"
  481. AC_DEFINE([HAVE_SENSORS], [1], [Defined if libsensors was found])
  482. AC_MSG_RESULT([yes])
  483. ],[
  484. with_sensors=no
  485. AC_MSG_RESULT([no])
  486. if ! $have_win32; then
  487. with_sensors_enableaction="install libsensors"
  488. fi
  489. ])
  490. LIBS="$save_LIBS"
  491. fi
  492. AC_SUBST(sensors_LIBS)
  493. driverlist="$driverlist opencl:adl/adl"
  494. AC_ARG_ENABLE([adl],
  495. [AC_HELP_STRING([--disable-adl],[Build without ADL monitoring (default enabled)])],
  496. [adl=$enableval]
  497. )
  498. if test x$adl = xyes
  499. then
  500. AC_DEFINE([HAVE_ADL], [1], [Defined if ADL headers were found])
  501. fi
  502. else
  503. adl="no"
  504. fi
  505. BFG_DRIVER(,AlcheMist,scrypt,no,[
  506. need_lowl_vcom=yes
  507. has_asic=yes
  508. ])
  509. BFG_DRIVER(,BitForce,SHA256d,auto,[
  510. driverlist="$driverlist bitforce:pci/need_lowl_pci"
  511. if test "x$lowl_pci" = "xyes"; then
  512. need_lowl_pci=yes
  513. fi
  514. need_lowl_vcom=yes
  515. driverlist="$driverlist bitforce:mswin/need_lowl_mswin"
  516. if test x$have_win32 = xtrue; then
  517. need_lowl_mswin=yes
  518. fi
  519. has_fpga=yes
  520. has_asic=yes
  521. have_udevrules=true
  522. ])
  523. BFG_DRIVER(bitmain,Bitmain Antminer S* series,SHA256d,no,[
  524. need_lowl_vcom=yes
  525. has_asic=yes
  526. ])
  527. BFG_DRIVER(,Icarus,SHA256d,auto,[
  528. need_dynclock=yes
  529. need_lowl_vcom=yes
  530. has_fpga=yes
  531. has_asic=yes
  532. have_udevrules=true
  533. ])
  534. driverlist="$driverlist cairnsmore/USE_ICARUS erupter/USE_ICARUS antminer/USE_ICARUS compac/USE_ICARUS"
  535. BFG_DRIVER(,DualMiner,Icarus,auto,[
  536. need_gc3355=yes
  537. $broad_udevrules && have_udevrules=true
  538. ])
  539. BFG_DRIVER(,ZeusMiner,scrypt Icarus,auto,[
  540. need_lowl_vcom=yes
  541. has_asic=yes
  542. $broad_udevrules && have_udevrules=true
  543. ])
  544. BFG_DRIVER(,GridSeed,scrypt,auto,[
  545. need_gc3355=yes
  546. need_lowl_vcom=yes
  547. has_asic=yes
  548. $broad_udevrules && have_udevrules=true
  549. ])
  550. BFG_DRIVER(,Avalon,SHA256d,auto,[
  551. need_lowl_vcom=yes
  552. has_asic=yes
  553. $broad_udevrules && have_udevrules=true
  554. ])
  555. BFG_DRIVER(avalonmm,Avalon2/3,SHA256d,auto,[
  556. need_lowl_vcom=yes
  557. need_work2d=yes
  558. has_asic=yes
  559. $broad_udevrules && have_udevrules=true
  560. ])
  561. BFG_DRIVER(,KnC,SHA256d,no,[
  562. need_linux_i2c_dev=yes
  563. need_lowl_spi=yes
  564. ])
  565. BFG_DRIVER(kncasic,KnC gen 2,SHA256d,no,[
  566. kncasic_controller="$kncasic_opt"
  567. if test "x$kncasic_opt" = "x"; then
  568. kncasic_controller=BBB
  569. fi
  570. need_knc_asic=yes
  571. AC_DEFINE_UNQUOTED([CONTROLLER_BOARD_$kncasic_controller],[1])
  572. ])
  573. AC_ARG_WITH([libmicrohttpd],
  574. [AC_HELP_STRING([--without-libmicrohttpd],[Compile support for libmicrohttpd getwork server (default enabled)])],
  575. [httpsrv=$withval],
  576. [httpsrv=$ddauto]
  577. )
  578. if test "x$httpsrv" != "xno"; then
  579. PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >= 0.9.5],[
  580. AC_DEFINE([USE_LIBMICROHTTPD],[1],[Defined to 1 if libmicrohttpd support is wanted])
  581. httpsrv=yes
  582. ],[
  583. httpsrv=no
  584. httpsrv_enableaction="install libmicrohttpd 0.9.5+"
  585. need_bfg_driver_proxy_enableaction="install libmicrohttpd 0.9.5+"
  586. if test "x$httpsrv" = "xyes"; then
  587. AC_MSG_ERROR([Unable to find libmicrohttpd 0.9.5+])
  588. else
  589. AC_MSG_WARN([libmicrohttpd 0.9.5+ not found; getwork proxy will be unavailable])
  590. fi
  591. ])
  592. fi
  593. AM_CONDITIONAL([USE_LIBMICROHTTPD], [test x$httpsrv = xyes])
  594. AC_ARG_WITH([libevent],
  595. [AC_HELP_STRING([--without-libevent],[Compile support for libevent stratum server (default enabled)])],
  596. [libevent=$withval],
  597. [libevent=$ddauto]
  598. )
  599. if test "x$libevent" != "xno"; then
  600. PKG_CHECK_MODULES([libevent],[libevent >= 2.0.3],[
  601. PKG_CHECK_MODULES([libevent_pthreads],[libevent_pthreads],[
  602. libevent_CFLAGS="${libevent_CFLAGS} ${libevent_pthreads_CFLAGS}"
  603. libevent_LIBS="${libevent_LIBS} ${libevent_pthreads_LIBS}"
  604. ],[true])
  605. AC_MSG_CHECKING([if libevent supports threading])
  606. BFG_PREPROC_IFELSE([EVTHREAD_USE_PTHREADS_IMPLEMENTED || EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED],[event2/thread.h],[
  607. AC_MSG_RESULT([yes])
  608. have_libevent=yes
  609. ],[
  610. AC_MSG_RESULT([no])
  611. ])
  612. ])
  613. if test "x$have_libevent" = "xyes"; then
  614. libevent=yes
  615. need_work2d=yes
  616. AC_DEFINE([USE_LIBEVENT],[1],[Defined to 1 if libevent support is wanted])
  617. else
  618. libevent_enableaction="install libevent 2.0.3+"
  619. if test -n "$need_bfg_driver_proxy_enableaction"; then
  620. need_bfg_driver_proxy_enableaction="${need_bfg_driver_proxy_enableaction} (getwork) or libevent 2.0.3+ (stratum)"
  621. else
  622. need_bfg_driver_proxy_enableaction="install libevent 2.0.3+"
  623. fi
  624. if test "x$libevent" = "xyes"; then
  625. AC_MSG_ERROR([Unable to find libevent 2.0.3+])
  626. else
  627. AC_MSG_WARN([libevent 2.0.3+ not found; stratum proxy will be unavailable])
  628. fi
  629. libevent=no
  630. fi
  631. fi
  632. AM_CONDITIONAL([USE_LIBEVENT], [test x$libevent = xyes])
  633. driverlist="$driverlist proxy/need_bfg_driver_proxy"
  634. if test x$libevent$httpsrv = xnono; then
  635. need_bfg_driver_proxy=no
  636. else
  637. need_bfg_driver_proxy=yes
  638. driverlist="$driverlist proxy:getwork/httpsrv proxy:stratum/libevent"
  639. fi
  640. AM_CONDITIONAL([NEED_BFG_DRIVER_PROXY], [test x$libevent$httpsrv != xnono])
  641. BFG_DRIVER(,ModMiner,SHA256d,auto,[
  642. need_dynclock=yes
  643. need_lowl_vcom=yes
  644. need_binloader=yes
  645. has_fpga=yes
  646. have_udevrules=true
  647. ])
  648. PKG_PROG_PKG_CONFIG()
  649. label_LIBUSB=libusb
  650. USE_LIBUSB=no
  651. libusb_include_path=""
  652. AC_ARG_WITH([libusb],
  653. [AC_HELP_STRING([--without-libusb],[Compile using libusb (default enabled)])],
  654. [want_libusb=$withval],
  655. [want_libusb=auto]
  656. )
  657. if test "x$want_libusb" != "xno"; then
  658. howto_LIBUSB="install libusb 1.0+"
  659. PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],[
  660. USE_LIBUSB=yes
  661. ],[
  662. for usb_lib in usb-1.0 usb; do
  663. AC_CHECK_LIB($usb_lib, libusb_init, [
  664. USE_LIBUSB=yes
  665. break
  666. ])
  667. done
  668. if test "x$USE_LIBUSB" = xyes; then
  669. AC_CHECK_DECL([libusb_init],[
  670. LIBUSB_LIBS="-l$usb_lib"
  671. ],[
  672. BFG_FIND_INCLUDE_PATH([libusb-1.0],[libusb.h],[
  673. LIBUSB_LIBS="-l$usb_lib"
  674. LIBUSB_CFLAGS="-I${inclpath_libusb_h}"
  675. ],[
  676. USE_LIBUSB=no
  677. ])
  678. ],[#include <libusb.h>])
  679. fi
  680. ])
  681. fi
  682. BFG_DRIVER(,CoinTerra,SHA256d libusb,auto,[
  683. need_lowl_usb=yes
  684. has_asic=yes
  685. have_udevrules=true
  686. ])
  687. BFG_DRIVER(,Klondike,SHA256d libusb,auto,[
  688. need_lowl_usb=yes
  689. has_asic=yes
  690. have_udevrules=true
  691. ])
  692. BFG_DRIVER(titan,KnC Titan,scrypt,no,[
  693. if test "x$titan_opt" = "x"; then
  694. if test "x$USE_KNCASIC" = "xyes"; then
  695. titan_controller="$kncasic_controller"
  696. else
  697. titan_controller=RPI
  698. fi
  699. else
  700. titan_controller=$titan_opt
  701. if test "x$USE_KNCASIC" = "xyes"; then
  702. if test "x$kncasic_controller" != "$titan_controller"; then
  703. AC_MSG_ERROR([Can only build kncasic and titan drivers together for the same controller (kncasic=$kncasic_controller vs titan=$titan_controller)])
  704. fi
  705. fi
  706. fi
  707. need_knc_asic=yes
  708. AC_DEFINE_UNQUOTED([CONTROLLER_BOARD_$titan_controller],[1])
  709. AH_TEMPLATE([CONTROLLER_BOARD_BACKPLANE])
  710. AH_TEMPLATE([CONTROLLER_BOARD_BBB])
  711. AH_TEMPLATE([CONTROLLER_BOARD_RPI])
  712. ])
  713. BFG_DRIVER(,X6500,SHA256d libusb,auto,[
  714. need_dynclock=yes
  715. need_lowl_ftdi=yes
  716. need_binloader=yes
  717. has_fpga=yes
  718. have_udevrules=true
  719. ])
  720. BFG_DRIVER(,ZTEX,SHA256d libusb,auto,[
  721. need_dynclock=yes
  722. need_lowl_usb=yes
  723. need_binloader=yes
  724. has_fpga=yes
  725. have_udevrules=true
  726. ])
  727. BFG_DRIVER(bifury,Bi*Fury,SHA256d,auto,[
  728. need_lowl_vcom=yes
  729. has_asic=yes
  730. have_udevrules=true
  731. ])
  732. BFG_DRIVER(,Bitfury,SHA256d,auto,[
  733. need_lowl_spi=yes
  734. ])
  735. BFG_DRIVER(,BFSB,SHA256d Bitfury,no)
  736. BFG_DRIVER(bigpic,Big Picture Mining USB,SHA256d Bitfury,auto,[
  737. need_lowl_vcom=yes
  738. has_asic=yes
  739. have_udevrules=true
  740. ])
  741. BFG_DRIVER(bfx,BFx2,SHA256d libusb Bitfury,auto,[
  742. need_lowl_ftdi=yes
  743. has_asic=yes
  744. $broad_udevrules && have_udevrules=true
  745. ])
  746. BFG_DRIVER(,DrillBit,SHA256d Bitfury,auto,[
  747. need_lowl_vcom=yes
  748. has_asic=yes
  749. have_udevrules=true
  750. ])
  751. BFG_DRIVER(,Twinfury,SHA256d Bitfury,auto,[
  752. need_lowl_vcom=yes
  753. has_asic=yes
  754. have_udevrules=true
  755. ])
  756. BFG_DRIVER(,LittleFury,SHA256d Bitfury,auto,[
  757. need_lowl_vcom=yes
  758. has_asic=yes
  759. have_udevrules=true
  760. ])
  761. label_HIDAPI=hidapi
  762. howto_HIDAPI="install hidapi"
  763. USE_HIDAPI=no
  764. for _hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
  765. PKG_CHECK_MODULES([hidapi],[$_hidapi_lib],[
  766. USE_HIDAPI=yes
  767. break
  768. ],[
  769. true
  770. ])
  771. done
  772. BFG_DRIVER(,NanoFury,SHA256d hidapi Bitfury,auto,[
  773. need_lowl_hid=yes
  774. has_asic=yes
  775. have_udevrules=true
  776. ])
  777. BFG_DRIVER(hashbuster,HashBuster Nano,SHA256d hidapi Bitfury,auto,[
  778. need_lowl_hid=yes
  779. has_asic=yes
  780. have_udevrules=true
  781. ])
  782. BFG_DRIVER(hashbusterusb,HashBuster Micro,SHA256d libusb Bitfury,auto,[
  783. need_lowl_usb=yes
  784. has_asic=yes
  785. have_udevrules=true
  786. ])
  787. BFG_DRIVER(,HashFast,SHA256d,auto,[
  788. need_lowl_vcom=yes
  789. has_asic=yes
  790. have_udevrules=true
  791. ])
  792. BFG_DRIVER(,JingTian,SHA256d,no,[
  793. need_lowl_spi=yes
  794. has_asic=yes
  795. ])
  796. BFG_DRIVER(,Metabank,SHA256d Bitfury,no)
  797. BFG_DRIVER(minergate,Spondoolies minergate interface,SHA256d,no,[
  798. need_lowlevel=yes
  799. has_asic=yes
  800. ])
  801. BFG_DRIVER(,Minion,SHA256d,no,[
  802. need_lowl_spi=yes
  803. has_asic=yes
  804. ])
  805. BFG_DRIVER(,RockMiner,SHA256d,auto,[
  806. need_lowl_vcom=yes
  807. has_asic=yes
  808. have_udevrules=true
  809. ])
  810. if test "x$need_lowl_vcom" != "xno"; then
  811. # Lowlevel VCOM doesn't need libusb, but it can take advantage of it to reattach drivers
  812. if test "x$USE_LIBUSB" != xno; then
  813. need_lowl_usb=yes
  814. elif test "x$USE_LIBUSB$want_libusb" = xnoyes; then
  815. AC_MSG_ERROR([Could not find libusb, which you specifically requested])
  816. fi
  817. fi
  818. lowllist="$lowllist ftdi/need_lowl_ftdi"
  819. if test x$need_lowl_ftdi = xyes; then
  820. AC_DEFINE([NEED_BFG_LOWL_FTDI], [1], [Defined to 1 if lowlevel ftdi drivers are being used])
  821. need_lowl_usb=yes
  822. fi
  823. lowllist="$lowllist spi/need_lowl_spi"
  824. if test x$need_lowl_spi = xyes; then
  825. AC_DEFINE([NEED_BFG_LOWL_SPI], [1], [Defined to 1 if lowlevel SPI drivers are being used])
  826. fi
  827. if test "x$need_lowl_usb" = "xno"; then
  828. USE_LIBUSB=no
  829. LIBUSB_LIBS=''
  830. LIBUSB_CFLAGS=''
  831. fi
  832. if test "x$USE_LIBUSB" = xyes; then
  833. AC_DEFINE([HAVE_LIBUSB], [1], [Define if you have libusb-1.0])
  834. save_CFLAGS="$CFLAGS"
  835. CFLAGS="$LIBUSB_CFLAGS $CFLAGS"
  836. AC_CHECK_DECLS([libusb_error_name],[true],[true],[#include <libusb.h>])
  837. CFLAGS="$save_CFLAGS"
  838. fi
  839. if test x$need_lowl_vcom = xyes; then
  840. AC_DEFINE([NEED_BFG_LOWL_VCOM], [1], [Defined to 1 if lowlevel VCOM drivers are being used])
  841. need_lowlevel=yes
  842. if $have_win32; then
  843. echo '#include <iospeeds.h>' >iospeeds_local.h
  844. found_ddkusb=false
  845. AC_CHECK_HEADER([usbiodef.h],[
  846. found_ddkusb=true
  847. ],[
  848. BFG_FIND_INCLUDE_PATH([ddk],[usbiodef.h],[
  849. found_ddkusb=true
  850. AUTOSCAN_CPPFLAGS="-I${inclpath_usbiodef_h}"
  851. ],[],[
  852. #include <windows.h>
  853. #include <ddk/usbioctl.h>
  854. AC_INCLUDES_DEFAULT
  855. ])
  856. ],[
  857. #include <windows.h>
  858. #include <usbioctl.h>
  859. AC_INCLUDES_DEFAULT
  860. ])
  861. if $found_ddkusb; then
  862. AUTOSCAN_LIBS="-lsetupapi"
  863. AC_DEFINE([HAVE_WIN_DDKUSB],[1],[Defined to 1 if Windows DDK USB headers are being used])
  864. fi
  865. else
  866. AC_MSG_CHECKING([what baud rates your system supports])
  867. echo '#include <termios.h>' | ${CPP} -dM - 2>/dev/null | ${SED} 's/.*[ ]B\([0-9][0-9]*\)[ ].*/IOSPEED(\1)/' | grep IOSPEED >iospeeds_local.h
  868. if grep -q IOSPEED iospeeds_local.h; then
  869. AC_MSG_RESULT([done])
  870. else
  871. AC_MSG_RESULT([failed, using standard POSIX])
  872. echo '#include <iospeeds_posix.h>' >iospeeds_local.h
  873. fi
  874. fi
  875. fi
  876. if test "x$USE_OPENCL$need_lowl_hid" = xnono; then
  877. DLOPEN_FLAGS=""
  878. fi
  879. lowllist="$lowllist hid/need_lowl_hid"
  880. if test x$need_lowl_hid = xyes; then
  881. AC_DEFINE([NEED_BFG_LOWL_HID], [1], [Defined to 1 if lowlevel hid drivers are being used])
  882. need_lowlevel=yes
  883. fi
  884. lowllist="$lowllist mswin/need_lowl_mswin"
  885. if test x$need_lowl_mswin = xyes; then
  886. AC_DEFINE([NEED_BFG_LOWL_MSWIN], [1], [Defined to 1 if lowlevel mswin drivers are being used])
  887. need_lowlevel=yes
  888. fi
  889. lowllist="$lowllist pci/need_lowl_pci"
  890. if test x$need_lowl_pci = xyes; then
  891. AC_DEFINE([NEED_BFG_LOWL_PCI], [1], [Defined to 1 if lowlevel PCI drivers are being used])
  892. need_lowlevel=yes
  893. lowllist="$lowllist pci:uio/uio"
  894. if test x$uio = xyes; then
  895. AC_DEFINE([USE_UIO], [1], [Defined to 1 if lowlevel PCI drivers should support UIO])
  896. fi
  897. lowllist="$lowllist pci:vfio/vfio"
  898. if test x$vfio = xyes; then
  899. AC_DEFINE([USE_VFIO], [1], [Defined to 1 if lowlevel PCI drivers should support VFIO])
  900. fi
  901. fi
  902. AM_CONDITIONAL([USE_VFIO], [test x$need_lowl_pci$vfio = xyesyes])
  903. lowllist="$lowllist usb/need_lowl_usb"
  904. if test x$need_lowl_usb = xyes; then
  905. need_lowlevel=yes
  906. fi
  907. lowllist="$lowllist vcom/need_lowl_vcom"
  908. if test x$need_lowl_vcom = xyes; then
  909. need_lowlevel=yes
  910. fi
  911. if test x$need_lowlevel = xyes; then
  912. AC_DEFINE([HAVE_BFG_LOWLEVEL], [1], [Defined to 1 if lowlevel drivers are being used])
  913. fi
  914. if test x$need_linux_i2c_dev = xyes; then
  915. AC_CHECK_HEADERS([linux/i2c-dev-user.h])
  916. AC_CHECK_DECL([i2c_smbus_read_word_data],[true],[
  917. AC_MSG_ERROR([linux/i2c-dev.h header from i2c-tools/libi2c-dev (NOT linux headers) is required for KnCMiner drivers])
  918. ],[
  919. #include <stddef.h>
  920. #ifdef HAVE_LINUX_I2C_DEV_USER_H
  921. #include <linux/i2c-dev-user.h>
  922. #else
  923. #ifdef NEED_LINUX_I2C_H
  924. #include <linux/i2c.h>
  925. #endif
  926. #include <linux/i2c-dev.h>
  927. #endif
  928. ])
  929. fi
  930. curses="auto"
  931. AC_ARG_WITH([curses],
  932. [AC_HELP_STRING([--without-curses],[Compile support for curses TUI (default enabled)])],
  933. [curses=$withval]
  934. )
  935. if test "x$curses" = "xno"; then
  936. optlist="$optlist curses"
  937. else
  938. curses_enableaction="install a curses library"
  939. orig_libs="$LIBS"
  940. if test "x${curses}" = "xyes"; then
  941. preferl=''
  942. else
  943. preferl="${curses} ${curses}6 ${curses}5"
  944. fi
  945. for wideornot in w u ''; do
  946. for ncursesver in '' 6 5; do
  947. preferl="${preferl} ncurses${wideornot}${ncursesver}"
  948. done
  949. preferl="${preferl} pdcurses${wideornot}"
  950. done
  951. if test "x$cross_compiling" != "xyes"; then
  952. AC_MSG_CHECKING([for best native curses library])
  953. orig_cflags="$CFLAGS"
  954. for curses_lib in ${preferl}; do
  955. if ! ${curses_lib}-config --cflags >/dev/null 2>/dev/null; then
  956. continue
  957. fi
  958. CFLAGS="$orig_cflags $(${curses_lib}-config --cflags)"
  959. LIBS="$orig_libs $(${curses_lib}-config --libs)"
  960. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  961. #include <curses.h>
  962. ]], [[
  963. WINDOW *w = NULL;
  964. mvwprintw(w, 2, 2, "Testing %s", "o hai");
  965. ]])], [
  966. curses=yes
  967. optlist="$optlist ${curses_lib}/curses"
  968. AC_MSG_RESULT([$curses_lib])
  969. NCURSES_LIBS=`${curses_lib}-config --libs`
  970. NCURSES_CPPFLAGS=`${curses_lib}-config --cflags`
  971. break
  972. ], [
  973. AC_MSG_WARN([${curses_lib} doesn't seem to be installed properly])
  974. ])
  975. done
  976. CFLAGS="$orig_cflags"
  977. if test "x$curses" != "xyes"; then
  978. AC_MSG_RESULT([none?])
  979. fi
  980. fi
  981. if test "x$curses" != "xyes"; then
  982. sym=addstr
  983. AC_SEARCH_LIBS(${sym}, ${preferl}, [
  984. curses=yes
  985. eval "curseslib=\"\${ac_cv_search_${sym}}\""
  986. barelib=`echo "${curseslib}" | ${SED} -e 's/-l//'`
  987. optlist="$optlist ${barelib}/curses"
  988. if test "x${curseslib}" != "xnone required"; then
  989. NCURSES_LIBS="${curseslib}"
  990. fi
  991. # Need to check for headers in subdirectories, to ensure we get wide stuff
  992. barelib=`echo "${barelib}" | ${SED} -e 's/6//'`
  993. barelib=`echo "${barelib}" | ${SED} -e 's/5//'`
  994. BFG_FIND_INCLUDE_PATH([${barelib}],[curses.h],[
  995. NCURSES_CPPFLAGS="-I${inclpath_curses_h}"
  996. ])
  997. break
  998. ], [
  999. if test "x$curses" = "xyes"; then
  1000. AC_MSG_ERROR([Could not find curses library - please install libncurses-dev or pdcurses-dev (or configure --without-curses)])
  1001. else
  1002. AC_MSG_WARN([Could not find curses library - if you want a TUI, install libncurses-dev or pdcurses-dev])
  1003. curses=no
  1004. optlist="$optlist curses"
  1005. fi
  1006. ])
  1007. fi
  1008. if test "x$curses" = "xyes"; then
  1009. AC_DEFINE([HAVE_CURSES], [1], [Defined to 1 if curses TUI support is wanted])
  1010. AC_MSG_CHECKING([whether curses library supports wide characters])
  1011. orig_cflags="$CFLAGS"
  1012. CFLAGS="$orig_cflags $NCURSES_CPPFLAGS"
  1013. LIBS="$orig_libs $NCURSES_LIBS"
  1014. AC_LINK_IFELSE([
  1015. AC_LANG_PROGRAM([
  1016. #define PDC_WIDE
  1017. #include <curses.h>
  1018. ],[
  1019. addwstr(L"test");
  1020. add_wch(WACS_VLINE);
  1021. ])
  1022. ],[
  1023. AC_MSG_RESULT([yes])
  1024. AC_DEFINE([USE_UNICODE],[1],[Defined to 1 if curses supports wide characters])
  1025. ],[
  1026. AC_MSG_RESULT([no])
  1027. ])
  1028. CFLAGS="$orig_cflags"
  1029. fi
  1030. LIBS="$orig_libs"
  1031. fi
  1032. BFG_BUNDLED_LIB([libbase58],[libbase58],[auto],[libbase58],[base58],[],[--disable-tool --disable-static --enable-shared])
  1033. BFG_BUNDLED_LIB([libblkmaker],[libblkmaker_jansson-0.1],[no],[libblkmaker],[blkmaker_jansson-0.1 blkmaker-0.1],[libbase58])
  1034. $have_udevrules || use_udevrules=false
  1035. if $use_udevrules; then
  1036. AC_ARG_WITH([udevrulesdir],
  1037. AS_HELP_STRING([--with-udevrulesdir=DIR], [Install udev rules into this directory]),
  1038. [], [
  1039. if test -d /lib/udev/rules.d; then
  1040. with_udevrulesdir=/lib/udev/rules.d
  1041. else
  1042. with_udevrulesdir=no
  1043. fi
  1044. ]
  1045. )
  1046. if test "x$with_udevrulesdir" = "xno"; then
  1047. use_udevrules=false
  1048. fi
  1049. if $use_udevrules; then
  1050. AC_SUBST([udevrulesdir], [$with_udevrulesdir])
  1051. fi
  1052. fi
  1053. AM_CONDITIONAL([NEED_BFG_BINLOADER], [test x$need_binloader = xyes])
  1054. AM_CONDITIONAL([NEED_DYNCLOCK], [test x$need_dynclock = xyes])
  1055. AM_CONDITIONAL([USE_GC3355], [test x$need_gc3355 = xyes])
  1056. AM_CONDITIONAL([NEED_BFG_LOWL_VCOM], [test x$need_lowl_vcom = xyes])
  1057. AM_CONDITIONAL([NEED_BFG_LOWL_FTDI], [test x$need_lowl_ftdi = xyes])
  1058. AM_CONDITIONAL([NEED_BFG_LOWL_HID], [test x$need_lowl_hid = xyes])
  1059. AM_CONDITIONAL([NEED_BFG_LOWL_MSWIN], [test x$need_lowl_mswin = xyes])
  1060. AM_CONDITIONAL([NEED_BFG_LOWL_PCI], [test x$need_lowl_pci = xyes])
  1061. AM_CONDITIONAL([NEED_BFG_LOWL_SPI], [test x$need_lowl_spi = xyes])
  1062. AM_CONDITIONAL([NEED_BFG_LOWLEVEL], [test x$need_lowlevel = xyes])
  1063. AM_CONDITIONAL([NEED_BFG_WORK2D], [test x$need_work2d = xyes])
  1064. AM_CONDITIONAL([NEED_KNC_ASIC], [test x$need_knc_asic = xyes])
  1065. AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
  1066. AM_CONDITIONAL([HAVE_SENSORS], [test x$with_sensors = xyes])
  1067. AM_CONDITIONAL([HAVE_CYGWIN], [test x$have_cygwin = xtrue])
  1068. AM_CONDITIONAL([HAVE_LIBUSB], [test x$USE_LIBUSB = xyes])
  1069. AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
  1070. AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
  1071. AM_CONDITIONAL([HAVE_WIN_DDKUSB], [test x$found_ddkusb = xtrue])
  1072. AM_CONDITIONAL([HAS_FPGA], [test x$has_fpga != xno])
  1073. AM_CONDITIONAL([HAS_ASIC], [test x$has_asic != xno])
  1074. AM_CONDITIONAL([USE_UDEVRULES], [$use_udevrules])
  1075. AM_CONDITIONAL([BROAD_UDEVRULES], [$broad_udevrules])
  1076. dnl Find YASM
  1077. has_yasm=false
  1078. if test "x$have_x86_32$have_x86_64" != "xfalsefalse"; then
  1079. AC_PATH_PROG([YASM],[yasm],[false])
  1080. if test "x$YASM" != "xfalse" ; then
  1081. has_yasm_enableaction="install yasm 1.0.1+"
  1082. AC_MSG_CHECKING([if yasm version is greater than 1.0.1])
  1083. yasmver=`"$YASM" --version | head -1 | cut -d\ -f2`
  1084. yamajor=`echo $yasmver | cut -d. -f1`
  1085. yaminor=`echo $yasmver | cut -d. -f2`
  1086. yamini=`echo $yasmver | cut -d. -f3`
  1087. if test "$yamajor" -ge "1" ; then
  1088. if test "$yamajor" -eq "1" ; then
  1089. if test "$yaminor" -ge "0" ; then
  1090. if test "$yaminor" -eq "0"; then
  1091. if test "$yamini" -ge "1"; then
  1092. has_yasm=true
  1093. fi
  1094. else
  1095. has_yasm=true
  1096. fi
  1097. fi
  1098. fi
  1099. else
  1100. has_yasm=false
  1101. fi
  1102. if test "x$has_yasm" = "xtrue" ; then
  1103. AC_MSG_RESULT([yes])
  1104. else
  1105. AC_MSG_RESULT([no])
  1106. fi
  1107. fi
  1108. if test "x$has_yasm" = "xfalse" ; then
  1109. AC_MSG_NOTICE([yasm is required for the assembly algorithms. They will be skipped.])
  1110. else
  1111. AC_DEFINE([HAVE_YASM], [1], [Defined to 1 if yasm is being used])
  1112. if test "x$have_win32$have_cygwin" != "xfalsefalse"; then
  1113. if test "x$have_x86_64" = xtrue; then
  1114. YASM_FMT="win64"
  1115. else
  1116. YASM_FMT="coff"
  1117. fi
  1118. elif test "x$have_macho" = "xtrue"; then
  1119. YASM_FMT="macho$bitness"
  1120. else
  1121. YASM_FMT="elf$bitness"
  1122. fi
  1123. fi
  1124. fi
  1125. AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
  1126. have_sse2=no
  1127. if test "x$USE_CPUMINING$have_x86_32" = "xyestrue"; then
  1128. AC_MSG_CHECKING([if SSE2 code compiles])
  1129. save_CFLAGS="$CFLAGS"
  1130. for flags in '' '-msse2'; do
  1131. CFLAGS="$CFLAGS $flags"
  1132. AC_TRY_LINK([
  1133. #include <xmmintrin.h>
  1134. ],[
  1135. int *i = (int *)0xdeadbeef;
  1136. __m128i a, b;
  1137. a = _mm_set1_epi32(i[0]);
  1138. b = _mm_set_epi32(i[0], i[1], i[2], i[3]);
  1139. a = _mm_add_epi32(a, b);
  1140. a = _mm_andnot_si128(a, b);
  1141. a = _mm_or_si128(a, b);
  1142. a = _mm_slli_epi32(a, i[4]);
  1143. a = _mm_and_si128(a, b);
  1144. a = _mm_xor_si128(a, b);
  1145. ],[
  1146. if test "x$flags" = "x"; then
  1147. AC_MSG_RESULT([yes])
  1148. else
  1149. AC_MSG_RESULT([with $flags])
  1150. fi
  1151. SSE2_CFLAGS="$flags"
  1152. have_sse2=yes
  1153. break
  1154. ],[
  1155. true
  1156. ])
  1157. done
  1158. CFLAGS="${save_CFLAGS}"
  1159. if test "x$have_sse2" = "xyes"; then
  1160. AC_DEFINE([HAVE_SSE2], [1], [Defined to 1 if yasm is being used])
  1161. else
  1162. AC_MSG_RESULT([no])
  1163. fi
  1164. fi
  1165. AM_CONDITIONAL([HAVE_SSE2], [test "x$have_sse2" = "xyes"])
  1166. if test "x$need_lowl_vcom" = "xyes"; then
  1167. AC_ARG_WITH([libudev], [AC_HELP_STRING([--without-libudev], [Autodetect FPGAs using libudev (default enabled)])],
  1168. [libudev=$withval],
  1169. [libudev=auto]
  1170. )
  1171. if test "x$libudev" != "xno"; then
  1172. AC_CHECK_HEADER([libudev.h],[
  1173. libudev=yes
  1174. UDEV_LIBS=-ludev
  1175. AC_DEFINE([HAVE_LIBUDEV], [1], [Defined to 1 if libudev is wanted])
  1176. ], [
  1177. if test "x$libudev" = "xyes"; then
  1178. AC_MSG_ERROR([libudev not found])
  1179. fi
  1180. libudev=no
  1181. ])
  1182. fi
  1183. fi
  1184. AM_CONDITIONAL([HAVE_LIBUDEV], [test x$libudev != xno])
  1185. AC_SUBST(LIBUSB_LIBS)
  1186. AC_SUBST(LIBUSB_CFLAGS)
  1187. PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.18.2], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.18.2])])
  1188. if echo "$LIBCURL_CFLAGS" | grep '@CPPFLAG_CURL_STATICLIB@' >/dev/null 2>&1; then
  1189. AC_MSG_WARN([Your libcurl pkgconfig file is broken, applying workaround])
  1190. LIBCURL_CFLAGS=`echo "$LIBCURL_CFLAGS" | ${SED} 's/@CPPFLAG_CURL_STATICLIB@//'`
  1191. fi
  1192. AC_SUBST(LIBCURL_LIBS)
  1193. AC_CHECK_FUNCS([setrlimit])
  1194. dnl CCAN wants to know a lot of vars.
  1195. # All the configuration checks. Regrettably, the __attribute__ checks will
  1196. # give false positives on old GCCs, since they just cause warnings. But that's
  1197. # fairly harmless.
  1198. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((cold)) cleanup(void) { }])],
  1199. AC_DEFINE([HAVE_ATTRIBUTE_COLD], [1],
  1200. [Define if __attribute__((cold))]))
  1201. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((const)) cleanup(void) { }])],
  1202. AC_DEFINE([HAVE_ATTRIBUTE_CONST], [1],
  1203. [Define if __attribute__((const))]))
  1204. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((noreturn)) cleanup(void) { exit(1); }])],
  1205. [
  1206. AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], [1],
  1207. [Define if __attribute__((noreturn))])
  1208. AC_DEFINE_UNQUOTED([NORETURN], [__attribute__((noreturn))], [Syntax of noreturn attribute])
  1209. ], [
  1210. AC_DEFINE_UNQUOTED([NORETURN], [])
  1211. ]
  1212. )
  1213. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((format(__printf__, 1, 2))) cleanup(const char *fmt, ...) { }])],
  1214. AC_DEFINE([HAVE_ATTRIBUTE_PRINTF], [1],
  1215. [Define if __attribute__((format(__printf__)))]))
  1216. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((unused)) cleanup(void) { }])],
  1217. AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1],
  1218. [Define if __attribute__((unused))]))
  1219. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((used)) cleanup(void) { }])],
  1220. AC_DEFINE([HAVE_ATTRIBUTE_USED], [1],
  1221. [Define if __attribute__((used))]))
  1222. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_constant_p(1) ? 0 : 1; }])],
  1223. AC_DEFINE([HAVE_BUILTIN_CONSTANT_P], [1],
  1224. [Define if have __builtin_constant_p]))
  1225. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_types_compatible_p(char *, int) ? 1 : 0; }])],
  1226. AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P], [1],
  1227. [Define if have __builtin_types_compatible_p]))
  1228. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static int __attribute__((warn_unused_result)) func(int x) { return x; }])],
  1229. AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1],
  1230. [Define if __attribute__((warn_unused_result))]))
  1231. # byteswap functions
  1232. AH_TEMPLATE([HAVE_BYTESWAP_H], [Define to use byteswap macros from byteswap.h])
  1233. AH_TEMPLATE([HAVE_ENDIAN_H], [Define to use byteswap macros from endian.h])
  1234. AH_TEMPLATE([HAVE_SYS_ENDIAN_H], [Define to use byteswap macros from sys/endian.h])
  1235. AH_TEMPLATE([HAVE_LIBKERN_OSBYTEORDER_H], [Define to use byteswap macros from libkern/OSByteOrder.h])
  1236. BSWAP=''
  1237. for sym in bswap_ __builtin_bswap __bswap_ __swap swap OSSwapInt; do
  1238. AC_MSG_CHECKING([for ${sym}* functions])
  1239. for headerfile in '' byteswap.h endian.h sys/endian.h libkern/OSByteOrder.h; do
  1240. BFG_INCLUDE([headerinclude], [${headerfile}])
  1241. AC_LINK_IFELSE([
  1242. AC_LANG_PROGRAM([
  1243. ${headerinclude}
  1244. ], [
  1245. (void) ${sym}16(0);
  1246. (void) ${sym}32(0);
  1247. (void) ${sym}64(0);
  1248. ])
  1249. ], [
  1250. BSWAP="${sym}"
  1251. if test "x${headerfile}" = "x"; then
  1252. AC_MSG_RESULT([yes])
  1253. else
  1254. AC_MSG_RESULT([found in ${headerfile}])
  1255. AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$headerfile]), 1)
  1256. fi
  1257. break 2
  1258. ])
  1259. done
  1260. AC_MSG_RESULT([no])
  1261. done
  1262. if test "x$BSWAP" = "x"; then
  1263. true # Substitutes are provided in miner.h
  1264. elif test "x$BSWAP" = "xbswap_"; then
  1265. AC_MSG_CHECKING([if bswap_16 is already a macro])
  1266. BFG_PREPROC_IFELSE([defined(bswap_16)], $headerfile, [
  1267. AC_MSG_RESULT([yes])
  1268. BSWAP=""
  1269. ],[
  1270. AC_MSG_RESULT([no])
  1271. ])
  1272. fi
  1273. if test "x$BSWAP" != "x"; then
  1274. AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, [Define to 16-bit byteswap macro])
  1275. AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, [Define to 16-bit byteswap macro])
  1276. AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, [Define to 16-bit byteswap macro])
  1277. fi
  1278. # endian definition macros
  1279. AC_MSG_CHECKING([for platform endian])
  1280. found_endian=no
  1281. for headerfile in '' endian.h sys/endian.h sys/param.h; do
  1282. for pfx in '' '__'; do
  1283. 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}, [
  1284. if test "x$headerfile" = "x"; then
  1285. headerfilec=''
  1286. else
  1287. headerfilec=" (${headerfile})"
  1288. fi
  1289. BFG_PREPROC_IFELSE([${pfx}BYTE_ORDER == ${pfx}BIG_ENDIAN], ${headerfile}, [
  1290. AC_MSG_RESULT([big endian${headerfilec}])
  1291. AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if your platform is big endian])
  1292. ], [
  1293. AC_MSG_RESULT([little endian${headerfilec}])
  1294. ])
  1295. found_endian=yes
  1296. break 2
  1297. ],[true])
  1298. done
  1299. done
  1300. if test "x$found_endian" = "xno"; then
  1301. if $have_win32 || $have_cygwin; then
  1302. AC_MSG_RESULT([assuming little endian (Windows)])
  1303. else
  1304. # AC_C_BIGENDIAN is reported to have problems, and invasive even if buried in a conditional, so don't use it
  1305. AC_MSG_RESULT([unknown])
  1306. AC_MSG_ERROR([Unable to identify platform endian])
  1307. fi
  1308. fi
  1309. AC_MSG_CHECKING([if good static asserts compile])
  1310. AC_TRY_LINK([
  1311. #include <stddef.h>
  1312. ], [
  1313. _Static_assert(1, ":)");
  1314. ], [
  1315. AC_MSG_RESULT([yes])
  1316. ], [
  1317. AC_MSG_RESULT([no])
  1318. AC_DEFINE_UNQUOTED([_Static_assert(...)], [], [Turns _Static_assert into noop for compilers that don't support it])
  1319. ])
  1320. AC_MSG_CHECKING([if GNU format attribute compiles])
  1321. AC_TRY_COMPILE([
  1322. #define FORMAT_SYNTAX_CHECK(...) __attribute__(( format(__VA_ARGS__) ))
  1323. int myfunc(char *fmt, ...) FORMAT_SYNTAX_CHECK(printf, 1, 2);
  1324. int myfunc(char *fmt, ...) {
  1325. return 42;
  1326. }
  1327. ], [
  1328. myfunc("abc%d", 42);
  1329. ], [
  1330. AC_MSG_RESULT([yes])
  1331. AC_DEFINE_UNQUOTED([FORMAT_SYNTAX_CHECK(...)], [__attribute__(( format(__VA_ARGS__) ))], [Syntax of format-checking attribute])
  1332. ], [
  1333. AC_MSG_RESULT([no])
  1334. AC_DEFINE_UNQUOTED([FORMAT_SYNTAX_CHECK(...)], [])
  1335. ])
  1336. AC_MSG_CHECKING([for clock_gettime(CLOCK_MONOTONIC)])
  1337. AC_TRY_COMPILE([
  1338. #define _GNU_SOURCE
  1339. #include <time.h>
  1340. ],[
  1341. struct timespec ts;
  1342. clock_gettime(CLOCK_MONOTONIC, &ts);
  1343. ],[
  1344. AC_MSG_RESULT([yes])
  1345. AC_DEFINE([HAVE_CLOCK_GETTIME_MONOTONIC], [1], [Defined to 1 if clock_gettime(CLOCK_MONOTONIC) is defined])
  1346. save_LIBS="${LIBS}"
  1347. AC_SEARCH_LIBS([clock_gettime],[rt posix4],[
  1348. if test "x${ac_cv_search_clock_gettime}" != "xnone required"; then
  1349. RT_LIBS="${ac_cv_search_clock_gettime}"
  1350. fi
  1351. ])
  1352. LIBS="${save_LIBS}"
  1353. AC_CHECK_FUNCS([clock_nanosleep])
  1354. AC_MSG_CHECKING([for clock_gettime(CLOCK_MONOTONIC_RAW)])
  1355. AC_TRY_COMPILE([
  1356. #define _GNU_SOURCE
  1357. #include <time.h>
  1358. ],[
  1359. struct timespec ts;
  1360. clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
  1361. ],[
  1362. AC_MSG_RESULT([yes])
  1363. AC_DEFINE([HAVE_CLOCK_GETTIME_MONOTONIC_RAW], [1], [Defined to 1 if clock_gettime(CLOCK_MONOTONIC_RAW) is defined])
  1364. ],[
  1365. AC_MSG_RESULT([no])
  1366. ])
  1367. ],[
  1368. AC_MSG_RESULT([no])
  1369. ])
  1370. save_LIBS="$LIBS"
  1371. LIBS="$LIBS $MATH_LIBS"
  1372. AC_CHECK_FUNCS([log2])
  1373. LIBS="$save_LIBS"
  1374. if test "x$prefix" = xNONE; then
  1375. prefix=/usr/local
  1376. fi
  1377. AM_CONDITIONAL([NEED_BITSTREAM_FPGAMINER], [test x$USE_MODMINER$USE_X6500 != xnono])
  1378. dnl Hide unnecessary explanations, only after any fatal errors
  1379. howto_SHA256D=x
  1380. if test "x$USE_SHA256D" = xno; then
  1381. howto_BITFURY=x
  1382. fi
  1383. if test "x$want_libusb" = xno; then
  1384. howto_LIBUSB=x
  1385. fi
  1386. m4_define([BFG_PRINT_LIST],[
  1387. eval _mylist="\$$2"
  1388. _yeslist=
  1389. _nolist=
  1390. _enableactions=
  1391. foundone=no
  1392. for _opt in $_mylist; do
  1393. IFS=/ read _opt _var <<EOF
  1394. $_opt
  1395. EOF
  1396. test -n "$_var" || _var="$_opt"
  1397. eval "_val=\"\$${_var}\""
  1398. if test "x$_val" = "xno" || test "x$_val" = "xfalse"; then
  1399. _nolist="$_nolist $_opt"
  1400. _enableaction=`bfg_enableaction $_var`
  1401. if test -n "$_enableaction"; then
  1402. _enableactions="${_enableactions}~ To enable ${_opt}: ${_enableaction}"
  1403. fi
  1404. else
  1405. _yeslist="$_yeslist $_opt"
  1406. foundone=yes
  1407. fi
  1408. done
  1409. _yeslist=`echo "$_yeslist" | tr ' ' '\n' | sort | tr '\n' ' '`
  1410. _nolist=`echo "$_nolist" | tr ' ' '\n' | sort | tr '\n' ' '`
  1411. AC_DEFINE_UNQUOTED(AS_TR_CPP([BFG_$2]),["$_yeslist"],[List of drivers being built])
  1412. $2_print=" Enabled..$1..:${_yeslist}~ Disabled.$1..:${_nolist}${_enableactions}"
  1413. ])
  1414. BFG_PRINT_LIST([Lowlevel..],[lowllist])
  1415. BFG_PRINT_LIST([Drivers...],[driverlist])
  1416. BFG_PRINT_LIST([Algorithms],[algolist])
  1417. if test "x$foundone" = "xno"; then
  1418. AC_MSG_ERROR([No mining algorithms configured!])
  1419. fi
  1420. BFG_PRINT_LIST([Options...],[optlist])
  1421. AC_SUBST(AUTOSCAN_CPPFLAGS)
  1422. AC_SUBST(AUTOSCAN_LIBS)
  1423. AC_SUBST(PTHREAD_FLAGS)
  1424. AC_SUBST(DLOPEN_FLAGS)
  1425. AC_SUBST(PTHREAD_LIBS)
  1426. AC_SUBST(NCURSES_CPPFLAGS)
  1427. AC_SUBST(NCURSES_LIBS)
  1428. AC_SUBST(PDCURSES_LIBS)
  1429. AC_SUBST(WS2_LIBS)
  1430. AC_SUBST(MM_LIBS)
  1431. AC_SUBST(MATH_LIBS)
  1432. AC_SUBST(RT_LIBS)
  1433. AC_SUBST(UDEV_LIBS)
  1434. AC_SUBST(SSE2_CFLAGS)
  1435. AC_SUBST(YASM_FMT)
  1436. AC_CONFIG_FILES([
  1437. Makefile
  1438. x86_64/Makefile
  1439. x86_32/Makefile
  1440. ccan.bfg/Makefile
  1441. lib/Makefile
  1442. ])
  1443. if $use_udevrules; then
  1444. AC_CONFIG_FILES([70-bfgminer.rules])
  1445. fi
  1446. AC_OUTPUT
  1447. BFG_CUSTOM_SUBDIRS_OUTPUT
  1448. wordfilter ()
  1449. {
  1450. echo "$1" | ${SED} 's/ \+/ /g;s/^ *//;s/ *$//'
  1451. }
  1452. echo
  1453. echo "------------------------------------------------------------------------"
  1454. echo "$PACKAGE $VERSION configuration options summary"
  1455. echo "------------------------------------------------------------------------"
  1456. echo
  1457. echo " CFLAGS...............: "`wordfilter "$CPPFLAGS $AUTOSCAN_CPPFLAGS $NCURSES_CPPFLAGS $PTHREAD_FLAGS $CFLAGS $LIBUSB_CFLAGS $JANSSON_CFLAGS $PTHREAD_FLAGS $libbase58_CFLAGS $libblkmaker_CFLAGS $hidapi_CFLAGS"`
  1458. echo " LDFLAGS..............: "`wordfilter "$LDFLAGS $AUTOSCAN_LIBS $PTHREAD_FLAGS $PTHREAD_LIBS $LIBS $DLOPEN_FLAGS $LIBCURL_LIBS $JANSSON_LIBS $NCURSES_LIBS $PDCURSES_LIBS $WS2_LIBS $MATH_LIBS $UDEV_LIBS $LIBUSB_LIBS $RT_LIBS $sensors_LIBS $libbase58_LIBS $libblkmaker_LIBS"`
  1459. echo " Installation.prefix..: $prefix"
  1460. echo
  1461. echo "${lowllist_print}" | tr '~' '\n'
  1462. echo "${driverlist_print}" | tr '~' '\n'
  1463. echo "${algolist_print}" | tr '~' '\n'
  1464. echo "${optlist_print}" | tr '~' '\n'
  1465. echo