configure.ac 43 KB

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