configure.ac 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188
  1. dnl * Copyright 2012-2013 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 *
  8. dnl * This program is free software; you can redistribute it and/or modify it
  9. dnl * under the terms of the GNU General Public License as published by the Free
  10. dnl * Software Foundation; either version 3 of the License, or (at your option)
  11. dnl * any later version. See COPYING for more details.
  12. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  13. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  14. m4_define([v_maj], [3])
  15. m4_define([v_min], [1])
  16. m4_define([v_mic], [4])
  17. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  18. m4_define([v_ver], [v_maj.v_min.v_mic])
  19. m4_define([lt_rev], m4_eval(v_maj + v_min))
  20. m4_define([lt_cur], v_mic)
  21. m4_define([lt_age], v_min)
  22. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  23. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  24. AC_INIT([bfgminer], [v_ver], [luke-jr+bfgminer@utopios.org])
  25. AC_PREREQ([2.59c])
  26. AC_CANONICAL_SYSTEM
  27. AC_CONFIG_MACRO_DIR([m4])
  28. AC_CONFIG_SRCDIR([miner.c])
  29. AC_CONFIG_HEADERS([config.h])
  30. AM_INIT_AUTOMAKE([foreign])
  31. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  32. AC_USE_SYSTEM_EXTENSIONS
  33. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  34. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  35. m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
  36. m4_ifdef([v_rel], , [m4_define([v_rel], [])])
  37. AC_DEFINE_UNQUOTED(CGMINER_MAJOR_VERSION, [v_maj], [Major version])
  38. AC_DEFINE_UNQUOTED(CGMINER_MINOR_VERSION, [v_min], [Minor version])
  39. AC_DEFINE_UNQUOTED(CGMINER_MINOR_SUBVERSION, [v_mic], [Micro version])
  40. version_info="lt_rev:lt_cur:lt_age"
  41. release_info="v_rel"
  42. AC_SUBST(version_info)
  43. AC_SUBST(release_info)
  44. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  45. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  46. VMAJ=v_maj
  47. AC_SUBST(VMAJ)
  48. AC_CANONICAL_BUILD
  49. AC_CANONICAL_HOST
  50. dnl Make sure anyone changing configure.ac/Makefile.am has a clue
  51. AM_MAINTAINER_MODE([enable])
  52. dnl Checks for programs
  53. AC_PROG_CC_C99
  54. gl_EARLY
  55. AC_PROG_GCC_TRADITIONAL
  56. AM_PROG_CC_C_O
  57. AC_PROG_RANLIB
  58. AC_PROG_CPP
  59. gl_INIT
  60. dnl Checks for header files.
  61. AC_HEADER_STDC
  62. AC_CHECK_HEADERS(syslog.h)
  63. AC_CHECK_HEADERS([sys/epoll.h])
  64. AC_CHECK_HEADERS([sys/prctl.h])
  65. AC_CHECK_HEADERS([sys/file.h])
  66. AC_CHECK_HEADERS([linux/spi/spidev.h])
  67. AC_FUNC_ALLOCA
  68. need_dynclock=no
  69. need_fpgautils=no
  70. have_cygwin=false
  71. have_win32=false
  72. have_macho=false
  73. DLOPEN_FLAGS="-ldl"
  74. WS2_LIBS=""
  75. MM_LIBS=""
  76. MATH_LIBS="-lm"
  77. RT_LIBS=""
  78. case $target in
  79. amd64-* | x86_64-*)
  80. have_x86_32=false
  81. have_x86_64=true
  82. bitness="64"
  83. ;;
  84. i386-* | i486-* | i586-* | i686-* | x86-*)
  85. have_x86_32=true
  86. have_x86_64=false
  87. bitness="32"
  88. ;;
  89. *)
  90. have_x86_32=false
  91. have_x86_64=false
  92. ;;
  93. esac
  94. case $target in
  95. *-*-mingw*)
  96. have_win32=true
  97. DLOPEN_FLAGS=""
  98. WS2_LIBS="-lws2_32"
  99. MM_LIBS="-lwinmm"
  100. AC_DEFINE([_WIN32_WINNT], [0x0501], "WinNT version for XP+ support")
  101. AC_DEFINE([FD_SETSIZE], [4096], [Maximum sockets before fd_set overflows])
  102. ;;
  103. *-*-cygwin*)
  104. have_cygwin=true
  105. ;;
  106. powerpc-*-darwin*)
  107. CFLAGS="$CFLAGS -faltivec"
  108. have_macho=true
  109. ;;
  110. *-*-darwin*)
  111. have_macho=true
  112. ;;
  113. esac
  114. m4_define([BFG_INCLUDE],
  115. if test "x$2" = "x"; then
  116. $1=''
  117. else
  118. $1="[#]include <$2>"
  119. fi
  120. )
  121. m4_define([BFG_PREPROC_IFELSE],
  122. BFG_INCLUDE([headerinclude], $2)
  123. AC_COMPILE_IFELSE([
  124. AC_LANG_PROGRAM([
  125. ${headerinclude}
  126. ], [
  127. #if !( $1 )
  128. #error "$1 false in preprocessor"
  129. #endif
  130. ])
  131. ],[$3],[$4])
  132. )
  133. AC_CHECK_DECL([HASH_ITER],[
  134. AC_CHECK_DECL([DL_FOREACH_SAFE],[
  135. true
  136. ],[
  137. AC_MSG_ERROR([Could not find DL_FOREACH_SAFE - install uthash-dev 1.9.2+])
  138. ],[
  139. #include <utlist.h>
  140. ])
  141. ],[
  142. AC_MSG_ERROR([Could not find HASH_ITER - please install uthash-dev 1.9.2+])
  143. ],[
  144. #include <uthash.h>
  145. ])
  146. cpumining="no"
  147. AC_ARG_ENABLE([cpumining],
  148. [AC_HELP_STRING([--enable-cpumining],[Build with CPU mining support (default disabled)])],
  149. [cpumining=$enableval]
  150. )
  151. if test "x$cpumining" = xyes; then
  152. AC_DEFINE_UNQUOTED([WANT_CPUMINE], [1], [Enable CPUMINING])
  153. fi
  154. AM_CONDITIONAL([HAS_CPUMINE], [test x$cpumining = xyes])
  155. opencl="yes"
  156. AC_ARG_ENABLE([opencl],
  157. [AC_HELP_STRING([--disable-opencl],[Build without support for OpenCL (default enabled)])],
  158. [opencl=$enableval]
  159. )
  160. if test "x$opencl" = xyes; then
  161. AC_DEFINE([HAVE_OPENCL], [1], [Defined to 1 if OpenCL support is wanted])
  162. else
  163. DLOPEN_FLAGS=""
  164. fi
  165. AM_CONDITIONAL([HAVE_OPENCL], [test x$opencl = xyes])
  166. m4_define([BFG_PTHREAD_FLAG_CHECK],
  167. AC_MSG_CHECKING([for $1])
  168. for cflag in ' -pthread' ''; do
  169. for lib in ' -lpthread' ' -lwinpthread' ''; do
  170. CFLAGS="${save_CFLAGS}${cflag}"
  171. LIBS="${save_LIBS}${lib}"
  172. AC_LINK_IFELSE([
  173. AC_LANG_PROGRAM([
  174. #include <pthread.h>
  175. ], [
  176. void *f = $1;
  177. ])
  178. ], [
  179. found_pthread=true
  180. PTHREAD_FLAGS="${cflag}"
  181. PTHREAD_LIBS="${lib}"
  182. if test "x${cflag}${lib}" = "x"; then
  183. AC_MSG_RESULT([yes])
  184. else
  185. AC_MSG_RESULT([with${cflag}${lib}])
  186. fi
  187. $2
  188. break 2
  189. ])
  190. done
  191. done
  192. if test "x${found_pthread}" = "xfalse"; then
  193. AC_MSG_RESULT([no])
  194. fi
  195. )
  196. save_CFLAGS="${CFLAGS}"
  197. save_LIBS="${LIBS}"
  198. found_pthread=false
  199. BFG_PTHREAD_FLAG_CHECK([pthread_cancel],[
  200. AC_DEFINE([HAVE_PTHREAD_CANCEL], [1], [Define if you have a native pthread_cancel])
  201. ])
  202. if test "x${found_pthread}" = "xfalse"; then
  203. BFG_PTHREAD_FLAG_CHECK([pthread_create])
  204. if test "x${found_pthread}" = "xfalse"; then
  205. AC_MSG_ERROR([Could not find pthread library - please install libpthread])
  206. fi
  207. fi
  208. # check for nanosleep here, since it is provided by winpthread
  209. AC_CHECK_FUNCS([nanosleep])
  210. CFLAGS="${save_CFLAGS}"
  211. LIBS="${save_LIBS}"
  212. PKG_CHECK_MODULES([JANSSON],[jansson],[
  213. true
  214. ],[
  215. AC_MSG_CHECKING([for jansson in system-default locations])
  216. LIBS="$LIBS -ljansson"
  217. AC_TRY_LINK([
  218. #include <jansson.h>
  219. ],[
  220. json_object();
  221. ],[
  222. AC_MSG_RESULT([found])
  223. JANSSON_LIBS=-ljansson
  224. ],[
  225. AC_MSG_RESULT([not found])
  226. AC_MSG_ERROR([Could not find jansson library])
  227. ])
  228. LIBS="${save_LIBS}"
  229. ])
  230. AC_SUBST(JANSSON_CFLAGS)
  231. AC_SUBST(JANSSON_LIBS)
  232. if test "x$opencl" = xyes; then
  233. adl="yes"
  234. AC_ARG_WITH([sensors],
  235. [AC_HELP_STRING([--without-sensors],[Build with libsensors monitoring (default enabled)])],
  236. [true],[with_sensors=auto])
  237. if test "x$opencl" != xyes; then
  238. with_sensors=no
  239. fi
  240. if test "x$with_sensors" != xno; then
  241. AC_MSG_CHECKING([for libsensors])
  242. save_LIBS="${LIBS}"
  243. LIBS="$LIBS -lsensors"
  244. AC_LINK_IFELSE([AC_LANG_PROGRAM([
  245. #include <stddef.h>
  246. #include <sensors/sensors.h>
  247. ],[
  248. const sensors_chip_name *cn;
  249. cn = sensors_get_detected_chips(NULL, NULL);
  250. ])],[
  251. with_sensors=yes
  252. sensors_LIBS="-lsensors"
  253. AC_DEFINE([HAVE_SENSORS], [1], [Defined if libsensors was found])
  254. AC_MSG_RESULT([yes])
  255. ],[
  256. with_sensors=no
  257. AC_MSG_RESULT([no])
  258. ])
  259. LIBS="$save_LIBS"
  260. fi
  261. AC_SUBST(sensors_LIBS)
  262. AC_ARG_ENABLE([adl],
  263. [AC_HELP_STRING([--disable-adl],[Build without ADL monitoring (default enabled)])],
  264. [adl=$enableval]
  265. )
  266. if test x$adl = xyes
  267. then
  268. AC_DEFINE([HAVE_ADL], [1], [Defined if ADL headers were found])
  269. fi
  270. else
  271. adl="no"
  272. fi
  273. AC_ARG_ENABLE([bitforce],
  274. [AC_HELP_STRING([--disable-bitforce],[Compile support for BitForce (default enabled)])],
  275. [bitforce=$enableval],
  276. [bitforce=yes]
  277. )
  278. if test "x$bitforce" = xyes; then
  279. AC_DEFINE([USE_BITFORCE], [1], [Defined to 1 if BitForce support is wanted])
  280. need_fpgautils=yes
  281. fi
  282. AM_CONDITIONAL([HAS_BITFORCE], [test x$bitforce = xyes])
  283. AC_ARG_ENABLE([icarus],
  284. [AC_HELP_STRING([--disable-icarus],[Compile support for Icarus (default enabled)])],
  285. [icarus=$enableval],
  286. [icarus=yes]
  287. )
  288. if test "x$icarus" = xyes; then
  289. AC_DEFINE([USE_ICARUS], [1], [Defined to 1 if Icarus support is wanted])
  290. need_dynclock=yes
  291. need_fpgautils=yes
  292. fi
  293. AM_CONDITIONAL([HAS_ICARUS], [test x$icarus = xyes])
  294. avalon="no"
  295. AC_ARG_ENABLE([avalon],
  296. [AC_HELP_STRING([--disable-avalon],[Compile support for Avalon (default enabled)])],
  297. [avalon=$enableval],
  298. [avalon=yes]
  299. )
  300. if test "x$avalon" = xyes; then
  301. AC_DEFINE([USE_AVALON], [1], [Defined to 1 if Avalon support is wanted])
  302. need_fpgautils=yes
  303. fi
  304. AM_CONDITIONAL([HAS_AVALON], [test x$avalon = xyes])
  305. httpsrv=auto
  306. AC_ARG_WITH([libmicrohttpd],
  307. [AC_HELP_STRING([--without-libmicrohttpd],[Compile support for libmicrohttpd getwork server (default enabled)])],
  308. [httpsrv=$withval]
  309. )
  310. if test "x$httpsrv" != "xno"; then
  311. PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd],[
  312. AC_DEFINE([USE_LIBMICROHTTPD],[1],[Defined to 1 if libmicrohttpd support is wanted])
  313. httpsrv=yes
  314. ],[
  315. if test "x$httpsrv" = "xyes"; then
  316. AC_MSG_ERROR([Unable to find libmicrohttpd])
  317. else
  318. AC_MSG_WARN([libmicrohttpd not found; getwork proxy will be unavailable])
  319. fi
  320. ])
  321. fi
  322. AM_CONDITIONAL([USE_LIBMICROHTTPD], [test x$httpsrv = xyes])
  323. AC_ARG_ENABLE([modminer],
  324. [AC_HELP_STRING([--disable-modminer],[Compile support for ModMiner (default enabled)])],
  325. [modminer=$enableval],
  326. [modminer=yes]
  327. )
  328. if test "x$modminer" = xyes; then
  329. AC_DEFINE([USE_MODMINER], [1], [Defined to 1 if ModMiner support is wanted])
  330. need_dynclock=yes
  331. need_fpgautils=yes
  332. fi
  333. AM_CONDITIONAL([HAS_MODMINER], [test x$modminer = xyes])
  334. PKG_PROG_PKG_CONFIG()
  335. libusb=no
  336. libusb_include_path=""
  337. PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],[
  338. libusb=yes
  339. ],[
  340. for usb_lib in usb-1.0 usb; do
  341. AC_CHECK_LIB($usb_lib, libusb_init, [
  342. libusb=yes
  343. break
  344. ])
  345. done
  346. if test "x$libusb" = xyes; then
  347. AC_CHECK_DECL([libusb_init],[
  348. true
  349. ],[
  350. AC_MSG_CHECKING([whether libusb_init is declared in subdirectory])
  351. libusb_include_path=`echo '#include <libusb-1.0/libusb.h>' | ${CPP} -M - 2>/dev/null | tr -d '\\n\\r\\\\' | sed 's/^[^:]*:[[:space:]]*\([^[:space:]]*\)\/.*/\1/'`
  352. if test "x$libusb_include_path" != "x"; then
  353. LIBUSB_LIBS="-l$usb_lib"
  354. LIBUSB_CFLAGS="-I$libusb_include_path"
  355. AC_MSG_RESULT([yes])
  356. else
  357. libusb=no
  358. AC_MSG_RESULT([no])
  359. fi
  360. ],[#include <libusb.h>])
  361. fi
  362. ])
  363. AC_ARG_ENABLE([x6500],
  364. [AC_HELP_STRING([--disable-x6500],[Compile support for X6500 (default if libusb)])],
  365. [x6500=$enableval],
  366. [x6500=auto]
  367. )
  368. if test "x$x6500$libusb" = xyesno; then
  369. AC_MSG_ERROR([Could not find libusb, required for X6500 support])
  370. elif test "x$x6500" = xauto; then
  371. x6500="$libusb"
  372. if test "x$libusb" = xno; then
  373. AC_MSG_WARN([Could not find libusb, required for X6500 support])
  374. x6500warn=yes
  375. fi
  376. fi
  377. if test "x$x6500" = xyes; then
  378. AC_DEFINE([USE_X6500], [1], [Defined to 1 if X6500 support is wanted])
  379. need_dynclock=yes
  380. need_fpgautils=yes
  381. fi
  382. AM_CONDITIONAL([HAS_X6500], [test x$x6500 = xyes])
  383. AC_ARG_ENABLE([ztex],
  384. [AC_HELP_STRING([--disable-ztex],[Compile support for ZTEX (default if libusb)])],
  385. [ztex=$enableval],
  386. [ztex=auto]
  387. )
  388. if test "x$ztex$libusb" = xyesno; then
  389. AC_MSG_ERROR([Could not find libusb, required for ZTEX support])
  390. elif test "x$ztex" = xauto; then
  391. ztex="$libusb"
  392. if test "x$libusb" = xno; then
  393. AC_MSG_WARN([Could not find libusb, required for ZTEX support])
  394. ztexwarn=yes
  395. fi
  396. fi
  397. if test "x$ztex" = xyes; then
  398. AC_DEFINE([USE_ZTEX], [1], [Defined to 1 if ZTEX support is wanted])
  399. need_dynclock=yes
  400. need_fpgautils=yes
  401. fi
  402. AM_CONDITIONAL([HAS_ZTEX], [test x$ztex = xyes])
  403. bitfury=yes
  404. AC_ARG_ENABLE([bitfury],
  405. [AC_HELP_STRING([--disable-bitfury],[Compile support for Bitfury (default enabled)])],
  406. [bitfury=$enableval]
  407. )
  408. if test "x$bitfury" = xyes; then
  409. AC_DEFINE([USE_BITFURY], [1], [Defined to 1 if Bitfury support is wanted])
  410. fi
  411. AM_CONDITIONAL([HAS_BITFURY], [test x$bitfury = xyes])
  412. bfsb=no
  413. AC_ARG_ENABLE([bfsb],
  414. [AC_HELP_STRING([--enable-bfsb],[Compile support for BFSB (default disabled)])],
  415. [bfsb=$enableval]
  416. )
  417. if test "x$bfsb" = "xyes"; then
  418. if test "x$bitfury" = "xno"; then
  419. AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled BFSB])
  420. fi
  421. AC_DEFINE([USE_BFSB], [1], [Defined to 1 if BFSB support is wanted])
  422. fi
  423. AM_CONDITIONAL([HAS_BFSB], [test x$bfsb = xyes])
  424. bigpic=auto
  425. AC_ARG_ENABLE([bigpic],
  426. [AC_HELP_STRING([--disable-bigpic],[Compile support for Big Picture Mining USB (default enabled)])],
  427. [bigpic=$enableval]
  428. )
  429. if test "x$bigpic" = "xno"; then
  430. true
  431. elif test "x$bitfury" = "xyes"; then
  432. bigpic=yes
  433. elif test "x$bigpic" = "xyes"; then
  434. AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled BigPic])
  435. else
  436. bigpic=no
  437. fi
  438. if test "x$bigpic" = "xyes"; then
  439. AC_DEFINE([USE_BIGPIC], [1], [Defined to 1 if Big Picture Mining USB support is wanted])
  440. need_fpgautils=yes
  441. fi
  442. AM_CONDITIONAL([HAS_BIGPIC], [test x$bigpic = xyes])
  443. littlefury=auto
  444. AC_ARG_ENABLE([littlefury],
  445. [AC_HELP_STRING([--disable-littlefury],[Compile support for LittleFury (default enabled)])],
  446. [littlefury=$enableval]
  447. )
  448. if test "x$littlefury" = "xno"; then
  449. true
  450. elif test "x$bitfury" = "xyes"; then
  451. littlefury=yes
  452. elif test "x$littlefury" = "xyes"; then
  453. AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled LittleFury])
  454. else
  455. littlefury=no
  456. fi
  457. if test "x$littlefury" = "xyes"; then
  458. AC_DEFINE([USE_LITTLEFURY], [1], [Defined to 1 if LittleFury support is wanted])
  459. need_fpgautils=yes
  460. fi
  461. AM_CONDITIONAL([HAS_LITTLEFURY], [test x$littlefury = xyes])
  462. metabank=no
  463. AC_ARG_ENABLE([metabank],
  464. [AC_HELP_STRING([--enable-metabank],[Compile support for Metabank (default disabled)])],
  465. [metabank=$enableval]
  466. )
  467. if test "x$metabank" = "xyes"; then
  468. if test "x$bitfury" = "xno"; then
  469. AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled Metabank])
  470. fi
  471. AC_DEFINE([USE_METABANK], [1], [Defined to 1 if Metabank support is wanted])
  472. fi
  473. AM_CONDITIONAL([HAS_METABANK], [test x$metabank = xyes])
  474. if test "x$x6500$ztex" = "xnono"; then
  475. libusb=no
  476. LIBUSB_LIBS=''
  477. LIBUSB_CFLAGS=''
  478. fi
  479. if test "x$libusb" = xyes; then
  480. AC_DEFINE([HAVE_LIBUSB], [1], [Define if you have libusb-1.0])
  481. save_CFLAGS="$CFLAGS"
  482. CFLAGS="$LIBUSB_CFLAGS $CFLAGS"
  483. AC_CHECK_DECLS([libusb_error_name],[true],[true],[#include <libusb.h>])
  484. CFLAGS="$save_CFLAGS"
  485. fi
  486. scrypt="no"
  487. AC_ARG_ENABLE([scrypt],
  488. [AC_HELP_STRING([--enable-scrypt],[Compile support for scrypt mining (default disabled)])],
  489. [scrypt=$enableval]
  490. )
  491. if test "x$scrypt" = xyes; then
  492. AC_DEFINE([USE_SCRYPT], [1], [Defined to 1 if scrypt support is wanted])
  493. fi
  494. if test x$need_fpgautils = xyes; then
  495. AC_DEFINE([HAVE_FPGAUTILS], [1], [Defined to 1 if fpgautils is being used])
  496. if $have_win32; then
  497. echo '#include <iospeeds.h>' >iospeeds_local.h
  498. else
  499. AC_MSG_CHECKING([what baud rates your system supports])
  500. echo '#include <termios.h>' | ${CPP} -dM - 2>/dev/null | sed 's/.*[ ]B\([0-9][0-9]*\)[ ].*/IOSPEED(\1)/' | grep IOSPEED >iospeeds_local.h
  501. if grep -q IOSPEED iospeeds_local.h; then
  502. AC_MSG_RESULT([done])
  503. else
  504. AC_MSG_RESULT([failed, using standard POSIX])
  505. echo '#include <iospeeds_posix.h>' >iospeeds_local.h
  506. fi
  507. fi
  508. fi
  509. curses="auto"
  510. AC_ARG_WITH([curses],
  511. [AC_HELP_STRING([--without-curses],[Compile support for curses TUI (default enabled)])],
  512. [curses=$withval]
  513. )
  514. if test "x$curses" = "xno"; then
  515. cursesmsg='User specified --without-curses. TUI support DISABLED'
  516. else
  517. orig_libs="$LIBS"
  518. if test "x${curses}" = "xyes"; then
  519. preferl=''
  520. else
  521. preferl="${curses} ${curses}6 ${curses}5"
  522. fi
  523. for wideornot in w u ''; do
  524. for ncursesver in '' 6 5; do
  525. preferl="${preferl} ncurses${wideornot}${ncursesver}"
  526. done
  527. preferl="${preferl} pdcurses${wideornot}"
  528. done
  529. if test "x$cross_compiling" != "xyes"; then
  530. AC_MSG_CHECKING([for best native curses library])
  531. orig_cflags="$CFLAGS"
  532. for curses_lib in ${preferl}; do
  533. if ! ${curses_lib}-config --cflags >/dev/null 2>/dev/null; then
  534. continue
  535. fi
  536. CFLAGS="$orig_cflags $(${curses_lib}-config --cflags)"
  537. LIBS="$orig_libs $(${curses_lib}-config --libs)"
  538. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  539. #include <curses.h>
  540. ]], [[
  541. WINDOW *w = NULL;
  542. mvwprintw(w, 2, 2, "Testing %s", "o hai");
  543. ]])], [
  544. curses=yes
  545. cursesmsg="FOUND: ${curses_lib}"
  546. AC_MSG_RESULT([$curses_lib])
  547. NCURSES_LIBS=`${curses_lib}-config --libs`
  548. NCURSES_CPPFLAGS=`${curses_lib}-config --cflags`
  549. break
  550. ], [
  551. AC_MSG_WARN([${curses_lib} doesn't seem to be installed properly])
  552. ])
  553. done
  554. CFLAGS="$orig_cflags"
  555. if test "x$curses" != "xyes"; then
  556. AC_MSG_RESULT([none?])
  557. fi
  558. fi
  559. if test "x$curses" != "xyes"; then
  560. sym=addstr
  561. AC_SEARCH_LIBS(${sym}, ${preferl}, [
  562. curses=yes
  563. eval "curseslib=\"\${ac_cv_search_${sym}}\""
  564. barelib="${curseslib/-l/}"
  565. cursesmsg="FOUND: ${barelib}"
  566. if test "x${curseslib}" != "xnone required"; then
  567. NCURSES_LIBS="${curseslib}"
  568. fi
  569. # Need to check for headers in subdirectories, to ensure we get wide stuff
  570. AC_MSG_CHECKING([for curses header subdirectory])
  571. barelib="${barelib/6/}"
  572. barelib="${barelib/5/}"
  573. cursesincl=`echo "#include <${barelib}/curses.h>" | ${CPP} -M - 2>/dev/null | tr -d '\\n\\r\\\\' | sed 's/^[^:]*:[[:space:]]*\([^[:space:]]*\)\/.*/\1/'`
  574. if test "x$cursesincl" != "x"; then
  575. NCURSES_CPPFLAGS="-I${cursesincl}"
  576. AC_MSG_RESULT([$cursesincl])
  577. else
  578. AC_MSG_RESULT([none found])
  579. fi
  580. break
  581. ], [
  582. if test "x$curses" = "xyes"; then
  583. AC_MSG_ERROR([Could not find curses library - please install libncurses-dev or pdcurses-dev (or configure --without-curses)])
  584. else
  585. AC_MSG_WARN([Could not find curses library - if you want a TUI, install libncurses-dev or pdcurses-dev])
  586. curses=no
  587. cursesmsg='NOT FOUND. TUI support DISABLED'
  588. fi
  589. ])
  590. fi
  591. if test "x$curses" = "xyes"; then
  592. AC_DEFINE([HAVE_CURSES], [1], [Defined to 1 if curses TUI support is wanted])
  593. AC_MSG_CHECKING([whether curses library supports wide characters])
  594. LIBS="$orig_libs $NCURSES_CPPFLAGS $NCURSES_LIBS"
  595. AC_LINK_IFELSE([
  596. AC_LANG_PROGRAM([
  597. #define PDC_WIDE
  598. #include <curses.h>
  599. ],[
  600. addwstr(L"test");
  601. add_wch(WACS_VLINE);
  602. ])
  603. ],[
  604. AC_MSG_RESULT([yes])
  605. AC_DEFINE([USE_UNICODE],[1],[Defined to 1 if curses supports wide characters])
  606. ],[
  607. AC_MSG_RESULT([no])
  608. ])
  609. fi
  610. LIBS="$orig_libs"
  611. fi
  612. AC_ARG_WITH([system-libblkmaker], [AC_HELP_STRING([--with-system-libblkmaker], [Use system libblkmaker rather than bundled one (default disabled)])],[true],[with_system_libblkmaker=no])
  613. if test "x$with_system_libblkmaker" = "xyes"; then
  614. PKG_CHECK_MODULES([libblkmaker],[libblkmaker_jansson-0.1],[
  615. true
  616. ],[
  617. AC_MSG_ERROR([Could not find system libblkmaker])
  618. ])
  619. else
  620. save_LDFLAGS="$LDFLAGS"
  621. LDFLAGS="$LDFLAGS -Wl,-zorigin"
  622. origin_LDFLAGS=
  623. AC_MSG_CHECKING([whether the linker recognizes the -zorigin option])
  624. AC_TRY_LINK([],[],[
  625. AC_MSG_RESULT([yes])
  626. origin_LDFLAGS=',-zorigin'
  627. ],[
  628. AC_MSG_RESULT([no])
  629. ])
  630. LDFLAGS="$save_LDFLAGS"
  631. libblkmaker_CFLAGS='-Ilibblkmaker'
  632. libblkmaker_LDFLAGS='-Llibblkmaker/.libs -Wl,-rpath,\$$ORIGIN/libblkmaker/.libs'"$origin_LDFLAGS"
  633. libblkmaker_LIBS='-lblkmaker_jansson-0.1 -lblkmaker-0.1'
  634. AC_CONFIG_SUBDIRS([libblkmaker])
  635. fi
  636. AC_SUBST(libblkmaker_CFLAGS)
  637. AC_SUBST(libblkmaker_LDFLAGS)
  638. AC_SUBST(libblkmaker_LIBS)
  639. AM_CONDITIONAL([NEED_LIBBLKMAKER], [test x$with_system_libblkmaker != xyes])
  640. AM_CONDITIONAL([NEED_DYNCLOCK], [test x$need_dynclock = xyes])
  641. AM_CONDITIONAL([NEED_FPGAUTILS], [test x$need_fpgautils = xyes])
  642. AM_CONDITIONAL([HAS_SCRYPT], [test x$scrypt = xyes])
  643. AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
  644. AM_CONDITIONAL([HAVE_SENSORS], [test x$with_sensors = xyes])
  645. AM_CONDITIONAL([HAVE_CYGWIN], [test x$have_cygwin = xtrue])
  646. AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
  647. AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
  648. AM_CONDITIONAL([HAS_FPGA], [test x$bitforce$icarus$modminer$x6500$ztex != xnonononono])
  649. AM_CONDITIONAL([HAS_ASIC], [test x$avalon$bfsb$bigpic$icarus$httpsrv$metabank != xnononononono])
  650. dnl Find YASM
  651. has_yasm=false
  652. if test "x$have_x86_32$have_x86_64" != "xfalsefalse"; then
  653. AC_PATH_PROG([YASM],[yasm],[false])
  654. if test "x$YASM" != "xfalse" ; then
  655. AC_MSG_CHECKING([if yasm version is greater than 1.0.1])
  656. yasmver=`"$YASM" --version | head -1 | cut -d\ -f2`
  657. yamajor=`echo $yasmver | cut -d. -f1`
  658. yaminor=`echo $yasmver | cut -d. -f2`
  659. yamini=`echo $yasmver | cut -d. -f3`
  660. if test "$yamajor" -ge "1" ; then
  661. if test "$yamajor" -eq "1" ; then
  662. if test "$yaminor" -ge "0" ; then
  663. if test "$yaminor" -eq "0"; then
  664. if test "$yamini" -ge "1"; then
  665. has_yasm=true
  666. fi
  667. else
  668. has_yasm=true
  669. fi
  670. fi
  671. fi
  672. else
  673. has_yasm=false
  674. fi
  675. if test "x$has_yasm" = "xtrue" ; then
  676. AC_MSG_RESULT([yes])
  677. else
  678. AC_MSG_RESULT([no])
  679. fi
  680. fi
  681. if test "x$has_yasm" = "xfalse" ; then
  682. AC_MSG_NOTICE([yasm is required for the assembly algorithms. They will be skipped.])
  683. else
  684. AC_DEFINE([HAVE_YASM], [1], [Defined to 1 if yasm is being used])
  685. if test "x$have_win32$have_cygwin" != "xfalsefalse"; then
  686. if test "x$have_x86_64" = xtrue; then
  687. YASM_FMT="win64"
  688. else
  689. YASM_FMT="coff"
  690. fi
  691. elif test "x$have_macho" = "xtrue"; then
  692. YASM_FMT="macho$bitness"
  693. else
  694. YASM_FMT="elf$bitness"
  695. fi
  696. fi
  697. fi
  698. AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
  699. have_sse2=no
  700. if test "x$cpumining$have_x86_32" = "xyestrue"; then
  701. AC_MSG_CHECKING([if SSE2 code compiles])
  702. save_CFLAGS="$CFLAGS"
  703. for flags in '' '-msse2'; do
  704. CFLAGS="$CFLAGS $flags"
  705. AC_TRY_LINK([
  706. #include <xmmintrin.h>
  707. ],[
  708. int *i = (int *)0xdeadbeef;
  709. __m128i a, b;
  710. a = _mm_set1_epi32(i[0]);
  711. b = _mm_set_epi32(i[0], i[1], i[2], i[3]);
  712. a = _mm_add_epi32(a, b);
  713. a = _mm_andnot_si128(a, b);
  714. a = _mm_or_si128(a, b);
  715. a = _mm_slli_epi32(a, i[4]);
  716. a = _mm_and_si128(a, b);
  717. a = _mm_xor_si128(a, b);
  718. ],[
  719. if test "x$flags" = "x"; then
  720. AC_MSG_RESULT([yes])
  721. else
  722. AC_MSG_RESULT([with $flags])
  723. fi
  724. SSE2_CFLAGS="$flags"
  725. have_sse2=yes
  726. break
  727. ],[
  728. true
  729. ])
  730. done
  731. CFLAGS="${save_CFLAGS}"
  732. if test "x$have_sse2" = "xyes"; then
  733. AC_DEFINE([HAVE_SSE2], [1], [Defined to 1 if yasm is being used])
  734. else
  735. AC_MSG_RESULT([no])
  736. fi
  737. fi
  738. AM_CONDITIONAL([HAVE_SSE2], [test "x$have_sse2" = "xyes"])
  739. if test "x$need_fpgautils" = "xyes"; then
  740. AC_ARG_WITH([libudev], [AC_HELP_STRING([--without-libudev], [Autodetect FPGAs using libudev (default enabled)])],
  741. [libudev=$withval],
  742. [libudev=auto]
  743. )
  744. if test "x$libudev" != "xno"; then
  745. AC_CHECK_HEADER([libudev.h],[
  746. libudev=yes
  747. UDEV_LIBS=-ludev
  748. AC_DEFINE([HAVE_LIBUDEV], [1], [Defined to 1 if libudev is wanted])
  749. ], [
  750. if test "x$libudev" = "xyes"; then
  751. AC_MSG_ERROR([libudev not found])
  752. fi
  753. libudev=no
  754. ])
  755. fi
  756. fi
  757. AM_CONDITIONAL([HAVE_LIBUDEV], [test x$libudev != xno])
  758. AC_SUBST(LIBUSB_LIBS)
  759. AC_SUBST(LIBUSB_CFLAGS)
  760. PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.18.2], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.18.2])])
  761. if echo "$LIBCURL_CFLAGS" | grep '@CPPFLAG_CURL_STATICLIB@' >/dev/null 2>&1; then
  762. AC_MSG_WARN([Your libcurl pkgconfig file is broken, applying workaround])
  763. LIBCURL_CFLAGS=`echo "$LIBCURL_CFLAGS" | sed 's/@CPPFLAG_CURL_STATICLIB@//'`
  764. fi
  765. AC_SUBST(LIBCURL_LIBS)
  766. AC_CHECK_FUNCS([setrlimit])
  767. dnl CCAN wants to know a lot of vars.
  768. # All the configuration checks. Regrettably, the __attribute__ checks will
  769. # give false positives on old GCCs, since they just cause warnings. But that's
  770. # fairly harmless.
  771. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((cold)) cleanup(void) { }])],
  772. AC_DEFINE([HAVE_ATTRIBUTE_COLD], [1],
  773. [Define if __attribute__((cold))]))
  774. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((const)) cleanup(void) { }])],
  775. AC_DEFINE([HAVE_ATTRIBUTE_CONST], [1],
  776. [Define if __attribute__((const))]))
  777. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((noreturn)) cleanup(void) { exit(1); }])],
  778. [
  779. AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], [1],
  780. [Define if __attribute__((noreturn))])
  781. AC_DEFINE_UNQUOTED([NORETURN], [__attribute__((noreturn))], [Syntax of noreturn attribute])
  782. ], [
  783. AC_DEFINE_UNQUOTED([NORETURN], [])
  784. ]
  785. )
  786. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((format(__printf__, 1, 2))) cleanup(const char *fmt, ...) { }])],
  787. AC_DEFINE([HAVE_ATTRIBUTE_PRINTF], [1],
  788. [Define if __attribute__((format(__printf__)))]))
  789. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((unused)) cleanup(void) { }])],
  790. AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1],
  791. [Define if __attribute__((unused))]))
  792. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((used)) cleanup(void) { }])],
  793. AC_DEFINE([HAVE_ATTRIBUTE_USED], [1],
  794. [Define if __attribute__((used))]))
  795. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_constant_p(1) ? 0 : 1; }])],
  796. AC_DEFINE([HAVE_BUILTIN_CONSTANT_P], [1],
  797. [Define if have __builtin_constant_p]))
  798. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_types_compatible_p(char *, int) ? 1 : 0; }])],
  799. AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P], [1],
  800. [Define if have __builtin_types_compatible_p]))
  801. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static int __attribute__((warn_unused_result)) func(int x) { return x; }])],
  802. AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1],
  803. [Define if __attribute__((warn_unused_result))]))
  804. AC_MSG_CHECKING([for roundl function])
  805. save_LIBS="${LIBS}"
  806. LIBS="$LIBS -lm"
  807. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  808. #include <math.h>
  809. ]], [[
  810. return (roundl(*(long double *)0xdeadbeef) == 1.0);
  811. ]])], [
  812. AC_MSG_RESULT([yes])
  813. ], [
  814. AC_MSG_RESULT([no])
  815. AC_DEFINE([NEED_ROUNDL], [1], [Defined to 1 if C99 roundl is missing])
  816. ])
  817. LIBS="${save_LIBS}"
  818. # byteswap functions
  819. AH_TEMPLATE([HAVE_BYTESWAP_H], [Define to use byteswap macros from byteswap.h])
  820. AH_TEMPLATE([HAVE_ENDIAN_H], [Define to use byteswap macros from endian.h])
  821. AH_TEMPLATE([HAVE_SYS_ENDIAN_H], [Define to use byteswap macros from sys/endian.h])
  822. AH_TEMPLATE([HAVE_LIBKERN_OSBYTEORDER_H], [Define to use byteswap macros from libkern/OSByteOrder.h])
  823. BSWAP=''
  824. for sym in bswap_ __builtin_bswap __bswap_ __swap swap OSSwapInt; do
  825. AC_MSG_CHECKING([for ${sym}* functions])
  826. for headerfile in '' byteswap.h endian.h sys/endian.h libkern/OSByteOrder.h; do
  827. BFG_INCLUDE([headerinclude], [${headerfile}])
  828. AC_LINK_IFELSE([
  829. AC_LANG_PROGRAM([
  830. ${headerinclude}
  831. ], [
  832. (void) ${sym}16(0);
  833. (void) ${sym}32(0);
  834. (void) ${sym}64(0);
  835. ])
  836. ], [
  837. BSWAP="${sym}"
  838. if test "x${headerfile}" = "x"; then
  839. AC_MSG_RESULT([yes])
  840. else
  841. AC_MSG_RESULT([found in ${headerfile}])
  842. AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$headerfile]), 1)
  843. fi
  844. break 2
  845. ])
  846. done
  847. AC_MSG_RESULT([no])
  848. done
  849. if test "x$BSWAP" = "x"; then
  850. true # Substitutes are provided in miner.h
  851. elif test "x$BSWAP" = "xbswap_"; then
  852. AC_MSG_CHECKING([if bswap_16 is already a macro])
  853. BFG_PREPROC_IFELSE([defined(bswap_16)], $headerfile, [
  854. AC_MSG_RESULT([yes])
  855. BSWAP=""
  856. ],[
  857. AC_MSG_RESULT([no])
  858. ])
  859. fi
  860. if test "x$BSWAP" != "x"; then
  861. AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, [Define to 16-bit byteswap macro])
  862. AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, [Define to 16-bit byteswap macro])
  863. AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, [Define to 16-bit byteswap macro])
  864. fi
  865. # endian definition macros
  866. AC_MSG_CHECKING([for platform endian])
  867. found_endian=no
  868. for headerfile in '' endian.h sys/endian.h sys/param.h; do
  869. for pfx in '' '__'; do
  870. 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}, [
  871. if test "x$headerfile" = "x"; then
  872. headerfilec=''
  873. else
  874. headerfilec=" (${headerfile})"
  875. fi
  876. BFG_PREPROC_IFELSE([${pfx}BYTE_ORDER == ${pfx}BIG_ENDIAN], ${headerfile}, [
  877. AC_MSG_RESULT([big endian${headerfilec}])
  878. AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if your platform is big endian])
  879. ], [
  880. AC_MSG_RESULT([little endian${headerfilec}])
  881. ])
  882. found_endian=yes
  883. break 2
  884. ],[true])
  885. done
  886. done
  887. if test "x$found_endian" = "xno"; then
  888. if $have_win32 || $have_cygwin; then
  889. AC_MSG_RESULT([assuming little endian (Windows)])
  890. else
  891. # AC_C_BIGENDIAN is reported to have problems, and invasive even if buried in a conditional, so don't use it
  892. AC_MSG_RESULT([unknown])
  893. AC_MSG_ERROR([Unable to identify platform endian])
  894. fi
  895. fi
  896. AC_MSG_CHECKING([if GNU format attribute compiles])
  897. AC_TRY_COMPILE([
  898. #define FORMAT_SYNTAX_CHECK(...) __attribute__(( format(__VA_ARGS__) ))
  899. int myfunc(char *fmt, ...) FORMAT_SYNTAX_CHECK(printf, 1, 2);
  900. int myfunc(char *fmt, ...) {
  901. return 42;
  902. }
  903. ], [
  904. myfunc("abc%d", 42);
  905. ], [
  906. AC_MSG_RESULT([yes])
  907. AC_DEFINE_UNQUOTED([FORMAT_SYNTAX_CHECK(...)], [__attribute__(( format(__VA_ARGS__) ))], [Syntax of format-checking attribute])
  908. ], [
  909. AC_MSG_RESULT([no])
  910. AC_DEFINE_UNQUOTED([FORMAT_SYNTAX_CHECK(...)], [])
  911. ])
  912. AC_MSG_CHECKING([for clock_gettime(CLOCK_MONOTONIC)])
  913. AC_TRY_COMPILE([
  914. #define _GNU_SOURCE
  915. #include <time.h>
  916. ],[
  917. struct timespec ts;
  918. clock_gettime(CLOCK_MONOTONIC, &ts);
  919. ],[
  920. AC_MSG_RESULT([yes])
  921. AC_DEFINE([HAVE_CLOCK_GETTIME_MONOTONIC], [1], [Defined to 1 if clock_gettime(CLOCK_MONOTONIC) is defined])
  922. save_LIBS="${LIBS}"
  923. AC_SEARCH_LIBS([clock_gettime],[rt posix4],[
  924. if test "x${ac_cv_search_clock_gettime}" != "xnone required"; then
  925. RT_LIBS="${ac_cv_search_clock_gettime}"
  926. fi
  927. ])
  928. LIBS="${save_LIBS}"
  929. AC_CHECK_FUNCS([clock_nanosleep])
  930. AC_MSG_CHECKING([for clock_gettime(CLOCK_MONOTONIC_RAW)])
  931. AC_TRY_COMPILE([
  932. #define _GNU_SOURCE
  933. #include <time.h>
  934. ],[
  935. struct timespec ts;
  936. clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
  937. ],[
  938. AC_MSG_RESULT([yes])
  939. AC_DEFINE([HAVE_CLOCK_GETTIME_MONOTONIC_RAW], [1], [Defined to 1 if clock_gettime(CLOCK_MONOTONIC_RAW) is defined])
  940. ],[
  941. AC_MSG_RESULT([no])
  942. ])
  943. ],[
  944. AC_MSG_RESULT([no])
  945. ])
  946. if test "x$prefix" = xNONE; then
  947. prefix=/usr/local
  948. fi
  949. AM_CONDITIONAL([NEED_BITSTREAM_FPGAMINER], [test x$modminer$x6500 != xnono])
  950. AC_DEFINE_UNQUOTED([PHATK_KERNNAME], ["phatk121016"], [Filename for phatk kernel])
  951. AC_DEFINE_UNQUOTED([POCLBM_KERNNAME], ["poclbm130302"], [Filename for poclbm kernel])
  952. AC_DEFINE_UNQUOTED([DIAKGCN_KERNNAME], ["diakgcn121016"], [Filename for diakgcn kernel])
  953. AC_DEFINE_UNQUOTED([DIABLO_KERNNAME], ["diablo130302"], [Filename for diablo kernel])
  954. AC_DEFINE_UNQUOTED([SCRYPT_KERNNAME], ["scrypt130511"], [Filename for scrypt kernel])
  955. AC_SUBST(PTHREAD_FLAGS)
  956. AC_SUBST(DLOPEN_FLAGS)
  957. AC_SUBST(PTHREAD_LIBS)
  958. AC_SUBST(NCURSES_CPPFLAGS)
  959. AC_SUBST(NCURSES_LIBS)
  960. AC_SUBST(PDCURSES_LIBS)
  961. AC_SUBST(WS2_LIBS)
  962. AC_SUBST(MM_LIBS)
  963. AC_SUBST(MATH_LIBS)
  964. AC_SUBST(RT_LIBS)
  965. AC_SUBST(UDEV_LIBS)
  966. AC_SUBST(SSE2_CFLAGS)
  967. AC_SUBST(YASM_FMT)
  968. AC_CONFIG_FILES([
  969. Makefile
  970. x86_64/Makefile
  971. x86_32/Makefile
  972. ccan/Makefile
  973. lib/Makefile
  974. ])
  975. AC_OUTPUT
  976. echo
  977. echo
  978. echo
  979. echo "------------------------------------------------------------------------"
  980. echo "$PACKAGE $VERSION"
  981. echo "------------------------------------------------------------------------"
  982. echo
  983. echo
  984. echo "Configuration Options Summary:"
  985. echo
  986. echo " curses.TUI...........: $cursesmsg"
  987. if test "x$scrypt" != xno; then
  988. echo " scrypt...............: Enabled"
  989. else
  990. echo " scrypt...............: Disabled"
  991. fi
  992. echo
  993. if test "x$opencl" = xyes; then
  994. echo " OpenCL...............: Enabled"
  995. else
  996. echo " OpenCL...............: Disabled"
  997. fi
  998. if test "x$with_sensors" = xyes; then
  999. echo " sensors.monitoring.: Enabled"
  1000. elif test "x$opencl" = xyes; then
  1001. echo " sensors.monitoring.: Disabled"
  1002. else
  1003. echo " sensors.monitoring.: n/a"
  1004. fi
  1005. if test "x$adl" = xyes; then
  1006. echo " ADL.monitoring.....: Enabled"
  1007. elif test "x$opencl" = xyes; then
  1008. echo " ADL.monitoring.....: Disabled"
  1009. else
  1010. echo " ADL.monitoring.....: n/a"
  1011. fi
  1012. if test "x$avalon" = xyes; then
  1013. echo " Avalon.ASICs.........: Enabled"
  1014. else
  1015. echo " Avalon.ASICs.........: Disabled"
  1016. fi
  1017. if test "x$bigpic" = xyes; then
  1018. echo " BPM.USB.ASICs........: Enabled"
  1019. else
  1020. echo " BPM.USB.ASICs........: Disabled"
  1021. fi
  1022. if test "x$bitforce" = xyes; then
  1023. echo " BitForce.devices.....: Enabled"
  1024. else
  1025. echo " BitForce.devices.....: Disabled"
  1026. fi
  1027. if test "x$icarus" = xyes; then
  1028. echo " Icarus.FPGAs.........: Enabled"
  1029. else
  1030. echo " Icarus.FPGAs.........: Disabled"
  1031. fi
  1032. if test "x$modminer" = xyes; then
  1033. echo " ModMiner.FPGAs.......: Enabled"
  1034. else
  1035. echo " ModMiner.FPGAs.......: Disabled"
  1036. fi
  1037. if test "x$x6500" = xyes; then
  1038. echo " X6500.FPGAs..........: Enabled"
  1039. elif test "x$ztexwarn" = xyes; then
  1040. echo " X6500.FPGAs..........: Disabled (libusb not found)"
  1041. else
  1042. echo " X6500.FPGAs..........: Disabled"
  1043. fi
  1044. if test "x$ztex" = xyes; then
  1045. echo " ZTEX.FPGAs...........: Enabled"
  1046. elif test "x$ztexwarn" = xyes; then
  1047. echo " ZTEX.FPGAs...........: Disabled (libusb not found)"
  1048. else
  1049. echo " ZTEX.FPGAs...........: Disabled"
  1050. fi
  1051. if test "x$need_fpgautils" = xyes; then
  1052. echo " libudev.detection....: $libudev"
  1053. fi
  1054. if test "x$bitfury" = xyes; then
  1055. echo " Bitfury.ASICs........: Enabled"
  1056. else
  1057. echo " Bitfury.ASICs........: Disabled"
  1058. fi
  1059. echo
  1060. if test "x$cpumining" = xyes; then
  1061. echo " CPU Mining...........: Enabled"
  1062. echo " ASM.(for CPU mining).: $has_yasm"
  1063. else
  1064. echo " CPU Mining...........: Disabled"
  1065. fi
  1066. echo
  1067. echo "Compilation............: make (or gmake)"
  1068. echo " CPPFLAGS.............:" $CPPFLAGS $NCURSES_CPPFLAGS $PTHREAD_FLAGS
  1069. echo " CFLAGS...............:" $CFLAGS $LIBUSB_CFLAGS $JANSSON_CFLAGS $PTHREAD_FLAGS
  1070. echo " LDFLAGS..............:" $LDFLAGS $PTHREAD_FLAGS $PTHREAD_LIBS
  1071. echo " LDADD................:" $LIBS $DLOPEN_FLAGS $LIBCURL_LIBS $JANSSON_LIBS $NCURSES_LIBS $PDCURSES_LIBS $WS2_LIBS $MATH_LIBS $UDEV_LIBS $LIBUSB_LIBS
  1072. echo
  1073. echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
  1074. echo " prefix...............: $prefix"
  1075. echo