configure.ac 43 KB

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