configure.ac 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607
  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], [0])
  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. AC_DEFINE([USE_LIBEVENT],[1],[Defined to 1 if libevent support is wanted])
  602. libevent=yes
  603. ],[
  604. libevent=no
  605. libevent_enableaction="install libevent 2.0.3+"
  606. if test -n "$need_bfg_driver_proxy_enableaction"; then
  607. need_bfg_driver_proxy_enableaction="${need_bfg_driver_proxy_enableaction} (getwork) or libevent 2.0.3+ (stratum)"
  608. else
  609. need_bfg_driver_proxy_enableaction="install libevent 2.0.3+"
  610. fi
  611. if test "x$libevent" = "xyes"; then
  612. AC_MSG_ERROR([Unable to find libevent 2.0.3+])
  613. else
  614. AC_MSG_WARN([libevent 2.0.3+ not found; stratum proxy will be unavailable])
  615. fi
  616. ])
  617. if test "x$libevent" = "xyes"; then
  618. need_work2d=yes
  619. fi
  620. fi
  621. AM_CONDITIONAL([USE_LIBEVENT], [test x$libevent = xyes])
  622. driverlist="$driverlist proxy/need_bfg_driver_proxy"
  623. if test x$libevent$httpsrv = xnono; then
  624. need_bfg_driver_proxy=no
  625. else
  626. need_bfg_driver_proxy=yes
  627. driverlist="$driverlist proxy:getwork/httpsrv proxy:stratum/libevent"
  628. fi
  629. AM_CONDITIONAL([NEED_BFG_DRIVER_PROXY], [test x$libevent$httpsrv != xnono])
  630. BFG_DRIVER(,ModMiner,SHA256d,auto,[
  631. need_dynclock=yes
  632. need_lowl_vcom=yes
  633. need_binloader=yes
  634. has_fpga=yes
  635. have_udevrules=true
  636. ])
  637. PKG_PROG_PKG_CONFIG()
  638. label_LIBUSB=libusb
  639. USE_LIBUSB=no
  640. libusb_include_path=""
  641. AC_ARG_WITH([libusb],
  642. [AC_HELP_STRING([--without-libusb],[Compile using libusb (default enabled)])],
  643. [want_libusb=$withval],
  644. [want_libusb=auto]
  645. )
  646. if test "x$want_libusb" != "xno"; then
  647. howto_LIBUSB="install libusb 1.0+"
  648. PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],[
  649. USE_LIBUSB=yes
  650. ],[
  651. for usb_lib in usb-1.0 usb; do
  652. AC_CHECK_LIB($usb_lib, libusb_init, [
  653. USE_LIBUSB=yes
  654. break
  655. ])
  656. done
  657. if test "x$USE_LIBUSB" = xyes; then
  658. AC_CHECK_DECL([libusb_init],[
  659. LIBUSB_LIBS="-l$usb_lib"
  660. ],[
  661. BFG_FIND_INCLUDE_PATH([libusb-1.0],[libusb.h],[
  662. LIBUSB_LIBS="-l$usb_lib"
  663. LIBUSB_CFLAGS="-I${inclpath_libusb_h}"
  664. ],[
  665. USE_LIBUSB=no
  666. ])
  667. ],[#include <libusb.h>])
  668. fi
  669. ])
  670. fi
  671. BFG_DRIVER(,CoinTerra,SHA256d libusb,auto,[
  672. need_lowl_usb=yes
  673. has_asic=yes
  674. have_udevrules=true
  675. ])
  676. BFG_DRIVER(,Klondike,SHA256d libusb,auto,[
  677. need_lowl_usb=yes
  678. has_asic=yes
  679. have_udevrules=true
  680. ])
  681. BFG_DRIVER(titan,KnC Titan,scrypt,no,[
  682. if test "x$titan_opt" = "x"; then
  683. if test "x$USE_KNCASIC" = "xyes"; then
  684. titan_controller="$kncasic_controller"
  685. else
  686. titan_controller=RPI
  687. fi
  688. else
  689. titan_controller=$titan_opt
  690. if test "x$USE_KNCASIC" = "xyes"; then
  691. if test "x$kncasic_controller" != "$titan_controller"; then
  692. AC_MSG_ERROR([Can only build kncasic and titan drivers together for the same controller (kncasic=$kncasic_controller vs titan=$titan_controller)])
  693. fi
  694. fi
  695. fi
  696. need_knc_asic=yes
  697. AC_DEFINE_UNQUOTED([CONTROLLER_BOARD_$titan_controller],[1])
  698. AH_TEMPLATE([CONTROLLER_BOARD_BACKPLANE])
  699. AH_TEMPLATE([CONTROLLER_BOARD_BBB])
  700. AH_TEMPLATE([CONTROLLER_BOARD_RPI])
  701. ])
  702. BFG_DRIVER(,X6500,SHA256d libusb,auto,[
  703. need_dynclock=yes
  704. need_lowl_ftdi=yes
  705. need_binloader=yes
  706. has_fpga=yes
  707. have_udevrules=true
  708. ])
  709. BFG_DRIVER(,ZTEX,SHA256d libusb,auto,[
  710. need_dynclock=yes
  711. need_lowl_usb=yes
  712. need_binloader=yes
  713. has_fpga=yes
  714. have_udevrules=true
  715. ])
  716. BFG_DRIVER(bifury,Bi*Fury,SHA256d,auto,[
  717. need_lowl_vcom=yes
  718. has_asic=yes
  719. have_udevrules=true
  720. ])
  721. BFG_DRIVER(,Bitfury,SHA256d,auto,[
  722. need_lowl_spi=yes
  723. ])
  724. BFG_DRIVER(,BFSB,SHA256d Bitfury,no)
  725. BFG_DRIVER(bigpic,Big Picture Mining USB,SHA256d Bitfury,auto,[
  726. need_lowl_vcom=yes
  727. has_asic=yes
  728. have_udevrules=true
  729. ])
  730. BFG_DRIVER(bfx,BFx2,SHA256d libusb Bitfury,auto,[
  731. need_lowl_ftdi=yes
  732. has_asic=yes
  733. $broad_udevrules && have_udevrules=true
  734. ])
  735. BFG_DRIVER(,DrillBit,SHA256d Bitfury,auto,[
  736. need_lowl_vcom=yes
  737. has_asic=yes
  738. have_udevrules=true
  739. ])
  740. BFG_DRIVER(,Twinfury,SHA256d Bitfury,auto,[
  741. need_lowl_vcom=yes
  742. has_asic=yes
  743. have_udevrules=true
  744. ])
  745. BFG_DRIVER(,LittleFury,SHA256d Bitfury,auto,[
  746. need_lowl_vcom=yes
  747. has_asic=yes
  748. have_udevrules=true
  749. ])
  750. label_HIDAPI=hidapi
  751. howto_HIDAPI="install hidapi"
  752. USE_HIDAPI=no
  753. for _hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
  754. PKG_CHECK_MODULES([hidapi],[$_hidapi_lib],[
  755. USE_HIDAPI=yes
  756. break
  757. ],[
  758. true
  759. ])
  760. done
  761. BFG_DRIVER(,NanoFury,SHA256d hidapi Bitfury,auto,[
  762. need_lowl_hid=yes
  763. has_asic=yes
  764. have_udevrules=true
  765. ])
  766. BFG_DRIVER(hashbuster,HashBuster Nano,SHA256d hidapi Bitfury,auto,[
  767. need_lowl_hid=yes
  768. has_asic=yes
  769. have_udevrules=true
  770. ])
  771. BFG_DRIVER(hashbusterusb,HashBuster Micro,SHA256d libusb Bitfury,auto,[
  772. need_lowl_usb=yes
  773. has_asic=yes
  774. have_udevrules=true
  775. ])
  776. BFG_DRIVER(,HashFast,SHA256d,auto,[
  777. need_lowl_vcom=yes
  778. has_asic=yes
  779. have_udevrules=true
  780. ])
  781. BFG_DRIVER(,JingTian,SHA256d,no,[
  782. need_lowl_spi=yes
  783. has_asic=yes
  784. ])
  785. BFG_DRIVER(,Metabank,SHA256d Bitfury,no)
  786. BFG_DRIVER(minergate,Spondoolies minergate interface,SHA256d,no,[
  787. need_lowlevel=yes
  788. has_asic=yes
  789. ])
  790. BFG_DRIVER(,Minion,SHA256d,no,[
  791. need_lowl_spi=yes
  792. has_asic=yes
  793. ])
  794. BFG_DRIVER(,RockMiner,SHA256d,auto,[
  795. need_lowl_vcom=yes
  796. has_asic=yes
  797. have_udevrules=true
  798. ])
  799. if test "x$need_lowl_vcom" != "xno"; then
  800. # Lowlevel VCOM doesn't need libusb, but it can take advantage of it to reattach drivers
  801. if test "x$USE_LIBUSB" != xno; then
  802. need_lowl_usb=yes
  803. elif test "x$USE_LIBUSB$want_libusb" = xnoyes; then
  804. AC_MSG_ERROR([Could not find libusb, which you specifically requested])
  805. fi
  806. fi
  807. lowllist="$lowllist ftdi/need_lowl_ftdi"
  808. if test x$need_lowl_ftdi = xyes; then
  809. AC_DEFINE([NEED_BFG_LOWL_FTDI], [1], [Defined to 1 if lowlevel ftdi drivers are being used])
  810. need_lowl_usb=yes
  811. fi
  812. lowllist="$lowllist spi/need_lowl_spi"
  813. if test x$need_lowl_spi = xyes; then
  814. AC_DEFINE([NEED_BFG_LOWL_SPI], [1], [Defined to 1 if lowlevel SPI drivers are being used])
  815. fi
  816. if test "x$need_lowl_usb" = "xno"; then
  817. USE_LIBUSB=no
  818. LIBUSB_LIBS=''
  819. LIBUSB_CFLAGS=''
  820. fi
  821. if test "x$USE_LIBUSB" = xyes; then
  822. AC_DEFINE([HAVE_LIBUSB], [1], [Define if you have libusb-1.0])
  823. save_CFLAGS="$CFLAGS"
  824. CFLAGS="$LIBUSB_CFLAGS $CFLAGS"
  825. AC_CHECK_DECLS([libusb_error_name],[true],[true],[#include <libusb.h>])
  826. CFLAGS="$save_CFLAGS"
  827. fi
  828. if test x$need_lowl_vcom = xyes; then
  829. AC_DEFINE([NEED_BFG_LOWL_VCOM], [1], [Defined to 1 if lowlevel VCOM drivers are being used])
  830. need_lowlevel=yes
  831. if $have_win32; then
  832. echo '#include <iospeeds.h>' >iospeeds_local.h
  833. found_ddkusb=false
  834. AC_CHECK_HEADER([usbiodef.h],[
  835. found_ddkusb=true
  836. ],[
  837. BFG_FIND_INCLUDE_PATH([ddk],[usbiodef.h],[
  838. found_ddkusb=true
  839. AUTOSCAN_CPPFLAGS="-I${inclpath_usbiodef_h}"
  840. ],[],[
  841. #include <windows.h>
  842. #include <ddk/usbioctl.h>
  843. AC_INCLUDES_DEFAULT
  844. ])
  845. ],[
  846. #include <windows.h>
  847. #include <usbioctl.h>
  848. AC_INCLUDES_DEFAULT
  849. ])
  850. if $found_ddkusb; then
  851. AUTOSCAN_LIBS="-lsetupapi"
  852. AC_DEFINE([HAVE_WIN_DDKUSB],[1],[Defined to 1 if Windows DDK USB headers are being used])
  853. fi
  854. else
  855. AC_MSG_CHECKING([what baud rates your system supports])
  856. echo '#include <termios.h>' | ${CPP} -dM - 2>/dev/null | ${SED} 's/.*[ ]B\([0-9][0-9]*\)[ ].*/IOSPEED(\1)/' | grep IOSPEED >iospeeds_local.h
  857. if grep -q IOSPEED iospeeds_local.h; then
  858. AC_MSG_RESULT([done])
  859. else
  860. AC_MSG_RESULT([failed, using standard POSIX])
  861. echo '#include <iospeeds_posix.h>' >iospeeds_local.h
  862. fi
  863. fi
  864. fi
  865. if test "x$USE_OPENCL$need_lowl_hid" = xnono; then
  866. DLOPEN_FLAGS=""
  867. fi
  868. lowllist="$lowllist hid/need_lowl_hid"
  869. if test x$need_lowl_hid = xyes; then
  870. AC_DEFINE([NEED_BFG_LOWL_HID], [1], [Defined to 1 if lowlevel hid drivers are being used])
  871. need_lowlevel=yes
  872. fi
  873. lowllist="$lowllist mswin/need_lowl_mswin"
  874. if test x$need_lowl_mswin = xyes; then
  875. AC_DEFINE([NEED_BFG_LOWL_MSWIN], [1], [Defined to 1 if lowlevel mswin drivers are being used])
  876. need_lowlevel=yes
  877. fi
  878. lowllist="$lowllist pci/need_lowl_pci"
  879. if test x$need_lowl_pci = xyes; then
  880. AC_DEFINE([NEED_BFG_LOWL_PCI], [1], [Defined to 1 if lowlevel PCI drivers are being used])
  881. need_lowlevel=yes
  882. lowllist="$lowllist pci:uio/uio"
  883. if test x$uio = xyes; then
  884. AC_DEFINE([USE_UIO], [1], [Defined to 1 if lowlevel PCI drivers should support UIO])
  885. fi
  886. lowllist="$lowllist pci:vfio/vfio"
  887. if test x$vfio = xyes; then
  888. AC_DEFINE([USE_VFIO], [1], [Defined to 1 if lowlevel PCI drivers should support VFIO])
  889. fi
  890. fi
  891. AM_CONDITIONAL([USE_VFIO], [test x$need_lowl_pci$vfio = xyesyes])
  892. lowllist="$lowllist usb/need_lowl_usb"
  893. if test x$need_lowl_usb = xyes; then
  894. need_lowlevel=yes
  895. fi
  896. lowllist="$lowllist vcom/need_lowl_vcom"
  897. if test x$need_lowl_vcom = xyes; then
  898. need_lowlevel=yes
  899. fi
  900. if test x$need_lowlevel = xyes; then
  901. AC_DEFINE([HAVE_BFG_LOWLEVEL], [1], [Defined to 1 if lowlevel drivers are being used])
  902. fi
  903. if test x$need_linux_i2c_dev = xyes; then
  904. AC_CHECK_HEADERS([linux/i2c-dev-user.h])
  905. AC_CHECK_DECL([i2c_smbus_read_word_data],[true],[
  906. AC_MSG_ERROR([linux/i2c-dev.h header from i2c-tools/libi2c-dev (NOT linux headers) is required for KnCMiner drivers])
  907. ],[
  908. #include <stddef.h>
  909. #ifdef HAVE_LINUX_I2C_DEV_USER_H
  910. #include <linux/i2c-dev-user.h>
  911. #else
  912. #ifdef NEED_LINUX_I2C_H
  913. #include <linux/i2c.h>
  914. #endif
  915. #include <linux/i2c-dev.h>
  916. #endif
  917. ])
  918. fi
  919. curses="auto"
  920. AC_ARG_WITH([curses],
  921. [AC_HELP_STRING([--without-curses],[Compile support for curses TUI (default enabled)])],
  922. [curses=$withval]
  923. )
  924. if test "x$curses" = "xno"; then
  925. optlist="$optlist curses"
  926. else
  927. curses_enableaction="install a curses library"
  928. orig_libs="$LIBS"
  929. if test "x${curses}" = "xyes"; then
  930. preferl=''
  931. else
  932. preferl="${curses} ${curses}6 ${curses}5"
  933. fi
  934. for wideornot in w u ''; do
  935. for ncursesver in '' 6 5; do
  936. preferl="${preferl} ncurses${wideornot}${ncursesver}"
  937. done
  938. preferl="${preferl} pdcurses${wideornot}"
  939. done
  940. if test "x$cross_compiling" != "xyes"; then
  941. AC_MSG_CHECKING([for best native curses library])
  942. orig_cflags="$CFLAGS"
  943. for curses_lib in ${preferl}; do
  944. if ! ${curses_lib}-config --cflags >/dev/null 2>/dev/null; then
  945. continue
  946. fi
  947. CFLAGS="$orig_cflags $(${curses_lib}-config --cflags)"
  948. LIBS="$orig_libs $(${curses_lib}-config --libs)"
  949. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  950. #include <curses.h>
  951. ]], [[
  952. WINDOW *w = NULL;
  953. mvwprintw(w, 2, 2, "Testing %s", "o hai");
  954. ]])], [
  955. curses=yes
  956. optlist="$optlist ${curses_lib}/curses"
  957. AC_MSG_RESULT([$curses_lib])
  958. NCURSES_LIBS=`${curses_lib}-config --libs`
  959. NCURSES_CPPFLAGS=`${curses_lib}-config --cflags`
  960. break
  961. ], [
  962. AC_MSG_WARN([${curses_lib} doesn't seem to be installed properly])
  963. ])
  964. done
  965. CFLAGS="$orig_cflags"
  966. if test "x$curses" != "xyes"; then
  967. AC_MSG_RESULT([none?])
  968. fi
  969. fi
  970. if test "x$curses" != "xyes"; then
  971. sym=addstr
  972. AC_SEARCH_LIBS(${sym}, ${preferl}, [
  973. curses=yes
  974. eval "curseslib=\"\${ac_cv_search_${sym}}\""
  975. barelib=`echo "${curseslib}" | ${SED} -e 's/-l//'`
  976. optlist="$optlist ${barelib}/curses"
  977. if test "x${curseslib}" != "xnone required"; then
  978. NCURSES_LIBS="${curseslib}"
  979. fi
  980. # Need to check for headers in subdirectories, to ensure we get wide stuff
  981. barelib=`echo "${barelib}" | ${SED} -e 's/6//'`
  982. barelib=`echo "${barelib}" | ${SED} -e 's/5//'`
  983. BFG_FIND_INCLUDE_PATH([${barelib}],[curses.h],[
  984. NCURSES_CPPFLAGS="-I${inclpath_curses_h}"
  985. ])
  986. break
  987. ], [
  988. if test "x$curses" = "xyes"; then
  989. AC_MSG_ERROR([Could not find curses library - please install libncurses-dev or pdcurses-dev (or configure --without-curses)])
  990. else
  991. AC_MSG_WARN([Could not find curses library - if you want a TUI, install libncurses-dev or pdcurses-dev])
  992. curses=no
  993. optlist="$optlist curses"
  994. fi
  995. ])
  996. fi
  997. if test "x$curses" = "xyes"; then
  998. AC_DEFINE([HAVE_CURSES], [1], [Defined to 1 if curses TUI support is wanted])
  999. AC_MSG_CHECKING([whether curses library supports wide characters])
  1000. orig_cflags="$CFLAGS"
  1001. CFLAGS="$orig_cflags $NCURSES_CPPFLAGS"
  1002. LIBS="$orig_libs $NCURSES_LIBS"
  1003. AC_LINK_IFELSE([
  1004. AC_LANG_PROGRAM([
  1005. #define PDC_WIDE
  1006. #include <curses.h>
  1007. ],[
  1008. addwstr(L"test");
  1009. add_wch(WACS_VLINE);
  1010. ])
  1011. ],[
  1012. AC_MSG_RESULT([yes])
  1013. AC_DEFINE([USE_UNICODE],[1],[Defined to 1 if curses supports wide characters])
  1014. ],[
  1015. AC_MSG_RESULT([no])
  1016. ])
  1017. CFLAGS="$orig_cflags"
  1018. fi
  1019. LIBS="$orig_libs"
  1020. fi
  1021. BFG_BUNDLED_LIB([libbase58],[libbase58],[auto],[libbase58],[base58],[],[--disable-tool --disable-static --enable-shared])
  1022. BFG_BUNDLED_LIB([libblkmaker],[libblkmaker_jansson-0.1],[no],[libblkmaker],[blkmaker_jansson-0.1 blkmaker-0.1],[libbase58])
  1023. $have_udevrules || use_udevrules=false
  1024. if $use_udevrules; then
  1025. AC_ARG_WITH([udevrulesdir],
  1026. AS_HELP_STRING([--with-udevrulesdir=DIR], [Install udev rules into this directory]),
  1027. [], [
  1028. if test -d /lib/udev/rules.d; then
  1029. with_udevrulesdir=/lib/udev/rules.d
  1030. else
  1031. with_udevrulesdir=no
  1032. fi
  1033. ]
  1034. )
  1035. if test "x$with_udevrulesdir" = "xno"; then
  1036. use_udevrules=false
  1037. fi
  1038. if $use_udevrules; then
  1039. AC_SUBST([udevrulesdir], [$with_udevrulesdir])
  1040. fi
  1041. fi
  1042. AM_CONDITIONAL([NEED_BFG_BINLOADER], [test x$need_binloader = xyes])
  1043. AM_CONDITIONAL([NEED_DYNCLOCK], [test x$need_dynclock = xyes])
  1044. AM_CONDITIONAL([USE_GC3355], [test x$need_gc3355 = xyes])
  1045. AM_CONDITIONAL([NEED_BFG_LOWL_VCOM], [test x$need_lowl_vcom = xyes])
  1046. AM_CONDITIONAL([NEED_BFG_LOWL_FTDI], [test x$need_lowl_ftdi = xyes])
  1047. AM_CONDITIONAL([NEED_BFG_LOWL_HID], [test x$need_lowl_hid = xyes])
  1048. AM_CONDITIONAL([NEED_BFG_LOWL_MSWIN], [test x$need_lowl_mswin = xyes])
  1049. AM_CONDITIONAL([NEED_BFG_LOWL_PCI], [test x$need_lowl_pci = xyes])
  1050. AM_CONDITIONAL([NEED_BFG_LOWL_SPI], [test x$need_lowl_spi = xyes])
  1051. AM_CONDITIONAL([NEED_BFG_LOWLEVEL], [test x$need_lowlevel = xyes])
  1052. AM_CONDITIONAL([NEED_BFG_WORK2D], [test x$need_work2d = xyes])
  1053. AM_CONDITIONAL([NEED_KNC_ASIC], [test x$need_knc_asic = xyes])
  1054. AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
  1055. AM_CONDITIONAL([HAVE_SENSORS], [test x$with_sensors = xyes])
  1056. AM_CONDITIONAL([HAVE_CYGWIN], [test x$have_cygwin = xtrue])
  1057. AM_CONDITIONAL([HAVE_LIBUSB], [test x$USE_LIBUSB = xyes])
  1058. AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
  1059. AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
  1060. AM_CONDITIONAL([HAVE_WIN_DDKUSB], [test x$found_ddkusb = xtrue])
  1061. AM_CONDITIONAL([HAS_FPGA], [test x$has_fpga != xno])
  1062. AM_CONDITIONAL([HAS_ASIC], [test x$has_asic != xno])
  1063. AM_CONDITIONAL([USE_UDEVRULES], [$use_udevrules])
  1064. AM_CONDITIONAL([BROAD_UDEVRULES], [$broad_udevrules])
  1065. dnl Find YASM
  1066. has_yasm=false
  1067. if test "x$have_x86_32$have_x86_64" != "xfalsefalse"; then
  1068. AC_PATH_PROG([YASM],[yasm],[false])
  1069. if test "x$YASM" != "xfalse" ; then
  1070. has_yasm_enableaction="install yasm 1.0.1+"
  1071. AC_MSG_CHECKING([if yasm version is greater than 1.0.1])
  1072. yasmver=`"$YASM" --version | head -1 | cut -d\ -f2`
  1073. yamajor=`echo $yasmver | cut -d. -f1`
  1074. yaminor=`echo $yasmver | cut -d. -f2`
  1075. yamini=`echo $yasmver | cut -d. -f3`
  1076. if test "$yamajor" -ge "1" ; then
  1077. if test "$yamajor" -eq "1" ; then
  1078. if test "$yaminor" -ge "0" ; then
  1079. if test "$yaminor" -eq "0"; then
  1080. if test "$yamini" -ge "1"; then
  1081. has_yasm=true
  1082. fi
  1083. else
  1084. has_yasm=true
  1085. fi
  1086. fi
  1087. fi
  1088. else
  1089. has_yasm=false
  1090. fi
  1091. if test "x$has_yasm" = "xtrue" ; then
  1092. AC_MSG_RESULT([yes])
  1093. else
  1094. AC_MSG_RESULT([no])
  1095. fi
  1096. fi
  1097. if test "x$has_yasm" = "xfalse" ; then
  1098. AC_MSG_NOTICE([yasm is required for the assembly algorithms. They will be skipped.])
  1099. else
  1100. AC_DEFINE([HAVE_YASM], [1], [Defined to 1 if yasm is being used])
  1101. if test "x$have_win32$have_cygwin" != "xfalsefalse"; then
  1102. if test "x$have_x86_64" = xtrue; then
  1103. YASM_FMT="win64"
  1104. else
  1105. YASM_FMT="coff"
  1106. fi
  1107. elif test "x$have_macho" = "xtrue"; then
  1108. YASM_FMT="macho$bitness"
  1109. else
  1110. YASM_FMT="elf$bitness"
  1111. fi
  1112. fi
  1113. fi
  1114. AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
  1115. have_sse2=no
  1116. if test "x$USE_CPUMINING$have_x86_32" = "xyestrue"; then
  1117. AC_MSG_CHECKING([if SSE2 code compiles])
  1118. save_CFLAGS="$CFLAGS"
  1119. for flags in '' '-msse2'; do
  1120. CFLAGS="$CFLAGS $flags"
  1121. AC_TRY_LINK([
  1122. #include <xmmintrin.h>
  1123. ],[
  1124. int *i = (int *)0xdeadbeef;
  1125. __m128i a, b;
  1126. a = _mm_set1_epi32(i[0]);
  1127. b = _mm_set_epi32(i[0], i[1], i[2], i[3]);
  1128. a = _mm_add_epi32(a, b);
  1129. a = _mm_andnot_si128(a, b);
  1130. a = _mm_or_si128(a, b);
  1131. a = _mm_slli_epi32(a, i[4]);
  1132. a = _mm_and_si128(a, b);
  1133. a = _mm_xor_si128(a, b);
  1134. ],[
  1135. if test "x$flags" = "x"; then
  1136. AC_MSG_RESULT([yes])
  1137. else
  1138. AC_MSG_RESULT([with $flags])
  1139. fi
  1140. SSE2_CFLAGS="$flags"
  1141. have_sse2=yes
  1142. break
  1143. ],[
  1144. true
  1145. ])
  1146. done
  1147. CFLAGS="${save_CFLAGS}"
  1148. if test "x$have_sse2" = "xyes"; then
  1149. AC_DEFINE([HAVE_SSE2], [1], [Defined to 1 if yasm is being used])
  1150. else
  1151. AC_MSG_RESULT([no])
  1152. fi
  1153. fi
  1154. AM_CONDITIONAL([HAVE_SSE2], [test "x$have_sse2" = "xyes"])
  1155. if test "x$need_lowl_vcom" = "xyes"; then
  1156. AC_ARG_WITH([libudev], [AC_HELP_STRING([--without-libudev], [Autodetect FPGAs using libudev (default enabled)])],
  1157. [libudev=$withval],
  1158. [libudev=auto]
  1159. )
  1160. if test "x$libudev" != "xno"; then
  1161. AC_CHECK_HEADER([libudev.h],[
  1162. libudev=yes
  1163. UDEV_LIBS=-ludev
  1164. AC_DEFINE([HAVE_LIBUDEV], [1], [Defined to 1 if libudev is wanted])
  1165. ], [
  1166. if test "x$libudev" = "xyes"; then
  1167. AC_MSG_ERROR([libudev not found])
  1168. fi
  1169. libudev=no
  1170. ])
  1171. fi
  1172. fi
  1173. AM_CONDITIONAL([HAVE_LIBUDEV], [test x$libudev != xno])
  1174. AC_SUBST(LIBUSB_LIBS)
  1175. AC_SUBST(LIBUSB_CFLAGS)
  1176. PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.18.2], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.18.2])])
  1177. if echo "$LIBCURL_CFLAGS" | grep '@CPPFLAG_CURL_STATICLIB@' >/dev/null 2>&1; then
  1178. AC_MSG_WARN([Your libcurl pkgconfig file is broken, applying workaround])
  1179. LIBCURL_CFLAGS=`echo "$LIBCURL_CFLAGS" | ${SED} 's/@CPPFLAG_CURL_STATICLIB@//'`
  1180. fi
  1181. AC_SUBST(LIBCURL_LIBS)
  1182. AC_CHECK_FUNCS([setrlimit])
  1183. dnl CCAN wants to know a lot of vars.
  1184. # All the configuration checks. Regrettably, the __attribute__ checks will
  1185. # give false positives on old GCCs, since they just cause warnings. But that's
  1186. # fairly harmless.
  1187. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((cold)) cleanup(void) { }])],
  1188. AC_DEFINE([HAVE_ATTRIBUTE_COLD], [1],
  1189. [Define if __attribute__((cold))]))
  1190. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((const)) cleanup(void) { }])],
  1191. AC_DEFINE([HAVE_ATTRIBUTE_CONST], [1],
  1192. [Define if __attribute__((const))]))
  1193. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((noreturn)) cleanup(void) { exit(1); }])],
  1194. [
  1195. AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], [1],
  1196. [Define if __attribute__((noreturn))])
  1197. AC_DEFINE_UNQUOTED([NORETURN], [__attribute__((noreturn))], [Syntax of noreturn attribute])
  1198. ], [
  1199. AC_DEFINE_UNQUOTED([NORETURN], [])
  1200. ]
  1201. )
  1202. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((format(__printf__, 1, 2))) cleanup(const char *fmt, ...) { }])],
  1203. AC_DEFINE([HAVE_ATTRIBUTE_PRINTF], [1],
  1204. [Define if __attribute__((format(__printf__)))]))
  1205. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((unused)) cleanup(void) { }])],
  1206. AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1],
  1207. [Define if __attribute__((unused))]))
  1208. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((used)) cleanup(void) { }])],
  1209. AC_DEFINE([HAVE_ATTRIBUTE_USED], [1],
  1210. [Define if __attribute__((used))]))
  1211. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_constant_p(1) ? 0 : 1; }])],
  1212. AC_DEFINE([HAVE_BUILTIN_CONSTANT_P], [1],
  1213. [Define if have __builtin_constant_p]))
  1214. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_types_compatible_p(char *, int) ? 1 : 0; }])],
  1215. AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P], [1],
  1216. [Define if have __builtin_types_compatible_p]))
  1217. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static int __attribute__((warn_unused_result)) func(int x) { return x; }])],
  1218. AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1],
  1219. [Define if __attribute__((warn_unused_result))]))
  1220. # byteswap functions
  1221. AH_TEMPLATE([HAVE_BYTESWAP_H], [Define to use byteswap macros from byteswap.h])
  1222. AH_TEMPLATE([HAVE_ENDIAN_H], [Define to use byteswap macros from endian.h])
  1223. AH_TEMPLATE([HAVE_SYS_ENDIAN_H], [Define to use byteswap macros from sys/endian.h])
  1224. AH_TEMPLATE([HAVE_LIBKERN_OSBYTEORDER_H], [Define to use byteswap macros from libkern/OSByteOrder.h])
  1225. BSWAP=''
  1226. for sym in bswap_ __builtin_bswap __bswap_ __swap swap OSSwapInt; do
  1227. AC_MSG_CHECKING([for ${sym}* functions])
  1228. for headerfile in '' byteswap.h endian.h sys/endian.h libkern/OSByteOrder.h; do
  1229. BFG_INCLUDE([headerinclude], [${headerfile}])
  1230. AC_LINK_IFELSE([
  1231. AC_LANG_PROGRAM([
  1232. ${headerinclude}
  1233. ], [
  1234. (void) ${sym}16(0);
  1235. (void) ${sym}32(0);
  1236. (void) ${sym}64(0);
  1237. ])
  1238. ], [
  1239. BSWAP="${sym}"
  1240. if test "x${headerfile}" = "x"; then
  1241. AC_MSG_RESULT([yes])
  1242. else
  1243. AC_MSG_RESULT([found in ${headerfile}])
  1244. AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$headerfile]), 1)
  1245. fi
  1246. break 2
  1247. ])
  1248. done
  1249. AC_MSG_RESULT([no])
  1250. done
  1251. if test "x$BSWAP" = "x"; then
  1252. true # Substitutes are provided in miner.h
  1253. elif test "x$BSWAP" = "xbswap_"; then
  1254. AC_MSG_CHECKING([if bswap_16 is already a macro])
  1255. BFG_PREPROC_IFELSE([defined(bswap_16)], $headerfile, [
  1256. AC_MSG_RESULT([yes])
  1257. BSWAP=""
  1258. ],[
  1259. AC_MSG_RESULT([no])
  1260. ])
  1261. fi
  1262. if test "x$BSWAP" != "x"; then
  1263. AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, [Define to 16-bit byteswap macro])
  1264. AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, [Define to 16-bit byteswap macro])
  1265. AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, [Define to 16-bit byteswap macro])
  1266. fi
  1267. # endian definition macros
  1268. AC_MSG_CHECKING([for platform endian])
  1269. found_endian=no
  1270. for headerfile in '' endian.h sys/endian.h sys/param.h; do
  1271. for pfx in '' '__'; do
  1272. 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}, [
  1273. if test "x$headerfile" = "x"; then
  1274. headerfilec=''
  1275. else
  1276. headerfilec=" (${headerfile})"
  1277. fi
  1278. BFG_PREPROC_IFELSE([${pfx}BYTE_ORDER == ${pfx}BIG_ENDIAN], ${headerfile}, [
  1279. AC_MSG_RESULT([big endian${headerfilec}])
  1280. AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if your platform is big endian])
  1281. ], [
  1282. AC_MSG_RESULT([little endian${headerfilec}])
  1283. ])
  1284. found_endian=yes
  1285. break 2
  1286. ],[true])
  1287. done
  1288. done
  1289. if test "x$found_endian" = "xno"; then
  1290. if $have_win32 || $have_cygwin; then
  1291. AC_MSG_RESULT([assuming little endian (Windows)])
  1292. else
  1293. # AC_C_BIGENDIAN is reported to have problems, and invasive even if buried in a conditional, so don't use it
  1294. AC_MSG_RESULT([unknown])
  1295. AC_MSG_ERROR([Unable to identify platform endian])
  1296. fi
  1297. fi
  1298. AC_MSG_CHECKING([if good static asserts compile])
  1299. AC_TRY_LINK([
  1300. #include <stddef.h>
  1301. ], [
  1302. _Static_assert(1, ":)");
  1303. ], [
  1304. AC_MSG_RESULT([yes])
  1305. ], [
  1306. AC_MSG_RESULT([no])
  1307. AC_DEFINE_UNQUOTED([_Static_assert(...)], [], [Turns _Static_assert into noop for compilers that don't support it])
  1308. ])
  1309. AC_MSG_CHECKING([if GNU format attribute compiles])
  1310. AC_TRY_COMPILE([
  1311. #define FORMAT_SYNTAX_CHECK(...) __attribute__(( format(__VA_ARGS__) ))
  1312. int myfunc(char *fmt, ...) FORMAT_SYNTAX_CHECK(printf, 1, 2);
  1313. int myfunc(char *fmt, ...) {
  1314. return 42;
  1315. }
  1316. ], [
  1317. myfunc("abc%d", 42);
  1318. ], [
  1319. AC_MSG_RESULT([yes])
  1320. AC_DEFINE_UNQUOTED([FORMAT_SYNTAX_CHECK(...)], [__attribute__(( format(__VA_ARGS__) ))], [Syntax of format-checking attribute])
  1321. ], [
  1322. AC_MSG_RESULT([no])
  1323. AC_DEFINE_UNQUOTED([FORMAT_SYNTAX_CHECK(...)], [])
  1324. ])
  1325. AC_MSG_CHECKING([for clock_gettime(CLOCK_MONOTONIC)])
  1326. AC_TRY_COMPILE([
  1327. #define _GNU_SOURCE
  1328. #include <time.h>
  1329. ],[
  1330. struct timespec ts;
  1331. clock_gettime(CLOCK_MONOTONIC, &ts);
  1332. ],[
  1333. AC_MSG_RESULT([yes])
  1334. AC_DEFINE([HAVE_CLOCK_GETTIME_MONOTONIC], [1], [Defined to 1 if clock_gettime(CLOCK_MONOTONIC) is defined])
  1335. save_LIBS="${LIBS}"
  1336. AC_SEARCH_LIBS([clock_gettime],[rt posix4],[
  1337. if test "x${ac_cv_search_clock_gettime}" != "xnone required"; then
  1338. RT_LIBS="${ac_cv_search_clock_gettime}"
  1339. fi
  1340. ])
  1341. LIBS="${save_LIBS}"
  1342. AC_CHECK_FUNCS([clock_nanosleep])
  1343. AC_MSG_CHECKING([for clock_gettime(CLOCK_MONOTONIC_RAW)])
  1344. AC_TRY_COMPILE([
  1345. #define _GNU_SOURCE
  1346. #include <time.h>
  1347. ],[
  1348. struct timespec ts;
  1349. clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
  1350. ],[
  1351. AC_MSG_RESULT([yes])
  1352. AC_DEFINE([HAVE_CLOCK_GETTIME_MONOTONIC_RAW], [1], [Defined to 1 if clock_gettime(CLOCK_MONOTONIC_RAW) is defined])
  1353. ],[
  1354. AC_MSG_RESULT([no])
  1355. ])
  1356. ],[
  1357. AC_MSG_RESULT([no])
  1358. ])
  1359. save_LIBS="$LIBS"
  1360. LIBS="$LIBS $MATH_LIBS"
  1361. AC_CHECK_FUNCS([log2])
  1362. LIBS="$save_LIBS"
  1363. if test "x$prefix" = xNONE; then
  1364. prefix=/usr/local
  1365. fi
  1366. AM_CONDITIONAL([NEED_BITSTREAM_FPGAMINER], [test x$USE_MODMINER$USE_X6500 != xnono])
  1367. dnl Hide unnecessary explanations, only after any fatal errors
  1368. howto_SHA256D=x
  1369. if test "x$USE_SHA256D" = xno; then
  1370. howto_BITFURY=x
  1371. fi
  1372. if test "x$want_libusb" = xno; then
  1373. howto_LIBUSB=x
  1374. fi
  1375. m4_define([BFG_PRINT_LIST],[
  1376. eval _mylist="\$$2"
  1377. _yeslist=
  1378. _nolist=
  1379. _enableactions=
  1380. foundone=no
  1381. for _opt in $_mylist; do
  1382. IFS=/ read _opt _var <<EOF
  1383. $_opt
  1384. EOF
  1385. test -n "$_var" || _var="$_opt"
  1386. eval "_val=\"\$${_var}\""
  1387. if test "x$_val" = "xno" || test "x$_val" = "xfalse"; then
  1388. _nolist="$_nolist $_opt"
  1389. _enableaction=`bfg_enableaction $_var`
  1390. if test -n "$_enableaction"; then
  1391. _enableactions="${_enableactions}~ To enable ${_opt}: ${_enableaction}"
  1392. fi
  1393. else
  1394. _yeslist="$_yeslist $_opt"
  1395. foundone=yes
  1396. fi
  1397. done
  1398. _yeslist=`echo "$_yeslist" | tr ' ' '\n' | sort | tr '\n' ' '`
  1399. _nolist=`echo "$_nolist" | tr ' ' '\n' | sort | tr '\n' ' '`
  1400. AC_DEFINE_UNQUOTED(AS_TR_CPP([BFG_$2]),["$_yeslist"],[List of drivers being built])
  1401. $2_print=" Enabled..$1..:${_yeslist}~ Disabled.$1..:${_nolist}${_enableactions}"
  1402. ])
  1403. BFG_PRINT_LIST([Lowlevel..],[lowllist])
  1404. BFG_PRINT_LIST([Drivers...],[driverlist])
  1405. BFG_PRINT_LIST([Algorithms],[algolist])
  1406. if test "x$foundone" = "xno"; then
  1407. AC_MSG_ERROR([No mining algorithms configured!])
  1408. fi
  1409. BFG_PRINT_LIST([Options...],[optlist])
  1410. AC_SUBST(AUTOSCAN_CPPFLAGS)
  1411. AC_SUBST(AUTOSCAN_LIBS)
  1412. AC_SUBST(PTHREAD_FLAGS)
  1413. AC_SUBST(DLOPEN_FLAGS)
  1414. AC_SUBST(PTHREAD_LIBS)
  1415. AC_SUBST(NCURSES_CPPFLAGS)
  1416. AC_SUBST(NCURSES_LIBS)
  1417. AC_SUBST(PDCURSES_LIBS)
  1418. AC_SUBST(WS2_LIBS)
  1419. AC_SUBST(MM_LIBS)
  1420. AC_SUBST(MATH_LIBS)
  1421. AC_SUBST(RT_LIBS)
  1422. AC_SUBST(UDEV_LIBS)
  1423. AC_SUBST(SSE2_CFLAGS)
  1424. AC_SUBST(YASM_FMT)
  1425. AC_CONFIG_FILES([
  1426. Makefile
  1427. x86_64/Makefile
  1428. x86_32/Makefile
  1429. ccan.bfg/Makefile
  1430. lib/Makefile
  1431. ])
  1432. if $use_udevrules; then
  1433. AC_CONFIG_FILES([70-bfgminer.rules])
  1434. fi
  1435. AC_OUTPUT
  1436. BFG_CUSTOM_SUBDIRS_OUTPUT
  1437. wordfilter ()
  1438. {
  1439. echo "$1" | ${SED} 's/ \+/ /g;s/^ *//;s/ *$//'
  1440. }
  1441. echo
  1442. echo "------------------------------------------------------------------------"
  1443. echo "$PACKAGE $VERSION configuration options summary"
  1444. echo "------------------------------------------------------------------------"
  1445. echo
  1446. echo " CFLAGS...............: "`wordfilter "$CPPFLAGS $AUTOSCAN_CPPFLAGS $NCURSES_CPPFLAGS $PTHREAD_FLAGS $CFLAGS $LIBUSB_CFLAGS $JANSSON_CFLAGS $PTHREAD_FLAGS $libbase58_CFLAGS $libblkmaker_CFLAGS $hidapi_CFLAGS"`
  1447. 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"`
  1448. echo " Installation.prefix..: $prefix"
  1449. echo
  1450. echo "${lowllist_print}" | tr '~' '\n'
  1451. echo "${driverlist_print}" | tr '~' '\n'
  1452. echo "${algolist_print}" | tr '~' '\n'
  1453. echo "${optlist_print}" | tr '~' '\n'
  1454. echo