configure.ac 44 KB

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