configure.ac 33 KB

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