configure.ac 32 KB

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