configure.ac 32 KB

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