configure.ac 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  2. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  3. m4_define([v_maj], [4])
  4. m4_define([v_min], [3])
  5. m4_define([v_mic], [5])
  6. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  7. m4_define([v_ver], [v_maj.v_min.v_mic-scrypt.2])
  8. m4_define([lt_rev], m4_eval(v_maj + v_min))
  9. m4_define([lt_cur], v_mic)
  10. m4_define([lt_age], v_min)
  11. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  12. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  13. AC_INIT([cgminer], [v_ver], [kernel@kolivas.org])
  14. AC_PREREQ(2.59)
  15. AC_CANONICAL_SYSTEM
  16. AC_CONFIG_MACRO_DIR([m4])
  17. AC_CONFIG_SRCDIR([cgminer.c])
  18. AC_CONFIG_HEADERS([config.h])
  19. AM_INIT_AUTOMAKE([foreign subdir-objects])
  20. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  21. AC_USE_SYSTEM_EXTENSIONS
  22. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  23. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  24. m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
  25. m4_ifdef([v_rel], , [m4_define([v_rel], [])])
  26. AC_DEFINE_UNQUOTED(CGMINER_MAJOR_VERSION, [v_maj], [Major version])
  27. AC_DEFINE_UNQUOTED(CGMINER_MINOR_VERSION, [v_min], [Minor version])
  28. AC_DEFINE_UNQUOTED(CGMINER_MINOR_SUBVERSION, [v_mic], [Micro version])
  29. version_info="lt_rev:lt_cur:lt_age"
  30. release_info="v_rel"
  31. AC_SUBST(version_info)
  32. AC_SUBST(release_info)
  33. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  34. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  35. VMAJ=v_maj
  36. AC_SUBST(VMAJ)
  37. AC_CANONICAL_BUILD
  38. AC_CANONICAL_HOST
  39. dnl Make sure anyone changing configure.ac/Makefile.am has a clue
  40. AM_MAINTAINER_MODE
  41. dnl Checks for programs
  42. AC_PROG_CC
  43. gl_EARLY
  44. AC_PROG_GCC_TRADITIONAL
  45. AM_PROG_CC_C_O
  46. LT_INIT([disable-shared])
  47. gl_INIT
  48. dnl Checks for header files.
  49. AC_HEADER_STDC
  50. AC_CHECK_HEADERS(syslog.h)
  51. AC_FUNC_ALLOCA
  52. have_win32=false
  53. PTHREAD_FLAGS="-lpthread"
  54. DLOPEN_FLAGS="-ldl"
  55. WS2_LIBS=""
  56. MM_LIBS=""
  57. MATH_LIBS="-lm"
  58. RT_LIBS="-lrt"
  59. case $target in
  60. amd64-*)
  61. have_x86_64=true
  62. ;;
  63. x86_64-*)
  64. have_x86_64=true
  65. ;;
  66. *)
  67. have_x86_64=false
  68. ;;
  69. esac
  70. case $target in
  71. *-*-linux-gnu*)
  72. have_linux=true
  73. ;;
  74. *-*-mingw*)
  75. have_win32=true
  76. PTHREAD_FLAGS=""
  77. DLOPEN_FLAGS=""
  78. WS2_LIBS="-lws2_32"
  79. MM_LIBS="-lwinmm"
  80. RT_LIBS=""
  81. AC_DEFINE([_WIN32_WINNT], [0x0501], "WinNT version for XP+ support")
  82. ;;
  83. powerpc-*-darwin*)
  84. have_darwin=true
  85. CFLAGS="$CFLAGS -faltivec"
  86. PTHREAD_FLAGS=""
  87. RT_LIBS=""
  88. ;;
  89. *-*-darwin*)
  90. have_darwin=true
  91. PTHREAD_FLAGS=""
  92. RT_LIBS=""
  93. ;;
  94. esac
  95. has_winpthread=false
  96. if test "x$have_win32" = xtrue; then
  97. has_winpthread=true
  98. AC_CHECK_LIB(winpthread, nanosleep, , has_winpthread=false)
  99. PTHREAD_LIBS=-lwinpthread
  100. fi
  101. if test "x$has_winpthread" != xtrue; then
  102. AC_CHECK_LIB(pthread, pthread_create, ,
  103. AC_MSG_ERROR([Could not find pthread library - please install libpthread]))
  104. PTHREAD_LIBS=-lpthread
  105. fi
  106. scrypt="no"
  107. AC_ARG_ENABLE([scrypt],
  108. [AC_HELP_STRING([--enable-scrypt],[Compile support for scrypt mining (default disabled)])],
  109. [scrypt=$enableval]
  110. )
  111. if test "x$scrypt" = xyes; then
  112. AC_DEFINE([USE_SCRYPT], [1], [Defined to 1 if scrypt support is wanted])
  113. fi
  114. AM_CONDITIONAL([HAS_SCRYPT], [test x$scrypt = xyes])
  115. ants1="no"
  116. AC_ARG_ENABLE([ants1],
  117. [AC_HELP_STRING([--enable-ants1],[Compile support for Antminer S1 Bitmain (default disabled)])],
  118. [ants1=$enableval]
  119. )
  120. if test "x$ants1" = xyes; then
  121. AC_DEFINE([USE_ANT_S1], [1], [Defined to 1 if Antminer S1 Bitmain support is wanted])
  122. fi
  123. AM_CONDITIONAL([HAS_ANT_S1], [test x$ants1 = xyes])
  124. ants2="no"
  125. AC_ARG_ENABLE([ants2],
  126. [AC_HELP_STRING([--enable-ants2],[Compile support for Antminer S2 Bitmain (default disabled)])],
  127. [ants2=$enableval]
  128. )
  129. if test "x$ants2" = xyes; then
  130. AC_DEFINE([USE_ANT_S2], [1], [Defined to 1 if Antminer S2 Bitmain support is wanted])
  131. fi
  132. AM_CONDITIONAL([HAS_ANT_S2], [test x$ants2 = xyes])
  133. if test "x$ants1$ants2" = xyesyes; then
  134. AC_MSG_ERROR([Only one of --enable-ants1 and --enable-ants2 allowed])
  135. fi
  136. avalon="no"
  137. AC_ARG_ENABLE([avalon],
  138. [AC_HELP_STRING([--enable-avalon],[Compile support for Avalon (default disabled)])],
  139. [avalon=$enableval]
  140. )
  141. if test "x$avalon" = xyes; then
  142. AC_DEFINE([USE_AVALON], [1], [Defined to 1 if Avalon support is wanted])
  143. fi
  144. AM_CONDITIONAL([HAS_AVALON], [test x$avalon = xyes])
  145. bab="no"
  146. AC_ARG_ENABLE([bab],
  147. [AC_HELP_STRING([--enable-bab],[Compile support for BlackArrow Bitfury (default disabled)])],
  148. [bab=$enableval]
  149. )
  150. if test "x$bab" = xyes; then
  151. AC_DEFINE([USE_BAB], [1], [Defined to 1 if BlackArrow Bitfury support is wanted])
  152. fi
  153. AM_CONDITIONAL([HAS_BAB], [test x$bab = xyes])
  154. bflsc="no"
  155. AC_ARG_ENABLE([bflsc],
  156. [AC_HELP_STRING([--enable-bflsc],[Compile support for BFL ASICs (default disabled)])],
  157. [bflsc=$enableval]
  158. )
  159. if test "x$bflsc" = xyes; then
  160. AC_DEFINE([USE_BFLSC], [1], [Defined to 1 if BFL ASIC support is wanted])
  161. fi
  162. AM_CONDITIONAL([HAS_BFLSC], [test x$bflsc = xyes])
  163. bitforce="no"
  164. AC_ARG_ENABLE([bitforce],
  165. [AC_HELP_STRING([--enable-bitforce],[Compile support for BitForce FPGAs (default disabled)])],
  166. [bitforce=$enableval]
  167. )
  168. if test "x$bitforce" = xyes; then
  169. AC_DEFINE([USE_BITFORCE], [1], [Defined to 1 if BitForce support is wanted])
  170. fi
  171. AM_CONDITIONAL([HAS_BITFORCE], [test x$bitforce = xyes])
  172. bitfury="no"
  173. AC_ARG_ENABLE([bitfury],
  174. [AC_HELP_STRING([--enable-bitfury],[Compile support for BitFury ASICs (default disabled)])],
  175. [bitfury=$enableval]
  176. )
  177. if test "x$bitfury" = xyes; then
  178. AC_DEFINE([USE_BITFURY], [1], [Defined to 1 if BitFury ASIC support is wanted])
  179. fi
  180. AM_CONDITIONAL([HAS_BITFURY], [test x$bitfury = xyes])
  181. cointerra="no"
  182. AC_ARG_ENABLE([cointerra],
  183. [AC_HELP_STRING([--enable-cointerra],[Compile support for Cointerra ASICs (default disabled)])],
  184. [cointerra=$enableval]
  185. )
  186. if test "x$cointerra" = xyes; then
  187. AC_DEFINE([USE_COINTERRA], [1], [Defined to 1 if Cointerra support is wanted])
  188. fi
  189. AM_CONDITIONAL([HAS_COINTERRA], [test x$cointerra = xyes])
  190. bitmine_A1="no"
  191. AC_ARG_ENABLE([bitmine_A1],
  192. [AC_HELP_STRING([--enable-bitmine_A1],[Compile support for Bitmine.ch A1 ASICs (default disabled)])],
  193. [bitmine_A1=$enableval]
  194. )
  195. if test "x$bitmine_A1" = xyes; then
  196. AC_DEFINE([USE_BITMINE_A1], [1], [Defined to 1 if Bitmine A1 support is wanted])
  197. fi
  198. AM_CONDITIONAL([HAS_BITMINE_A1], [test x$bitmine_A1 = xyes])
  199. drillbit="no"
  200. AC_ARG_ENABLE([drillbit],
  201. [AC_HELP_STRING([--enable-drillbit],[Compile support for Drillbit BitFury ASICs (default disabled)])],
  202. [drillbit=$enableval]
  203. )
  204. if test "x$drillbit" = xyes; then
  205. AC_DEFINE([USE_DRILLBIT], [1], [Defined to 1 if Drillbit BitFury support is wanted])
  206. fi
  207. AM_CONDITIONAL([HAS_DRILLBIT], [test x$drillbit = xyes])
  208. hashfast="no"
  209. AC_ARG_ENABLE([hashfast],
  210. [AC_HELP_STRING([--enable-hashfast],[Compile support for Hashfast (default disabled)])],
  211. [hashfast=$enableval]
  212. )
  213. if test "x$hashfast" = xyes; then
  214. AC_DEFINE([USE_HASHFAST], [1], [Defined to 1 if Hashfast support is wanted])
  215. fi
  216. AM_CONDITIONAL([HAS_HASHFAST], [test x$hashfast = xyes])
  217. icarus="no"
  218. AC_ARG_ENABLE([icarus],
  219. [AC_HELP_STRING([--enable-icarus],[Compile support for Icarus (default disabled)])],
  220. [icarus=$enableval]
  221. )
  222. if test "x$icarus" = xyes; then
  223. AC_DEFINE([USE_ICARUS], [1], [Defined to 1 if Icarus support is wanted])
  224. fi
  225. AM_CONDITIONAL([HAS_ICARUS], [test x$icarus = xyes])
  226. klondike="no"
  227. AC_ARG_ENABLE([klondike],
  228. [AC_HELP_STRING([--enable-klondike],[Compile support for Klondike (default disabled)])],
  229. [klondike=$enableval]
  230. )
  231. if test "x$klondike" = xyes; then
  232. AC_DEFINE([USE_KLONDIKE], [1], [Defined to 1 if Klondike support is wanted])
  233. fi
  234. AM_CONDITIONAL([HAS_KLONDIKE], [test x$klondike = xyes])
  235. knc="no"
  236. AC_ARG_ENABLE([knc],
  237. [AC_HELP_STRING([--enable-knc],[Compile support for KnC miners (default disabled)])],
  238. [knc=$enableval]
  239. )
  240. if test "x$knc" = xyes; then
  241. AC_DEFINE([USE_KNC], [1], [Defined to 1 if KnC miner support is wanted])
  242. fi
  243. AM_CONDITIONAL([HAS_KNC], [test x$knc = xyes])
  244. avalon2="no"
  245. AC_ARG_ENABLE([avalon2],
  246. [AC_HELP_STRING([--enable-avalon2],[Compile support for Avalon2 (default disabled)])],
  247. [avalon2=$enableval]
  248. )
  249. if test "x$avalon2" = xyes; then
  250. AC_DEFINE([USE_FPGA_SERIAL], [1], [Defined to 1 if serial support required])
  251. AC_DEFINE([USE_AVALON2], [1], [Defined to 1 if Avalon2 support is wanted])
  252. fi
  253. AM_CONDITIONAL([HAS_AVALON2], [test x$avalon2 = xyes])
  254. minion="no"
  255. AC_ARG_ENABLE([minion],
  256. [AC_HELP_STRING([--enable-minion],[Compile support for Minion BlackArrow ASIC (default disabled)])],
  257. [minion=$enableval]
  258. )
  259. if test "x$minion" = xyes; then
  260. AC_DEFINE([USE_MINION], [1], [Defined to 1 if Minion BlackArrow ASIC support is wanted])
  261. fi
  262. AM_CONDITIONAL([HAS_MINION], [test x$minion = xyes])
  263. modminer="no"
  264. AC_ARG_ENABLE([modminer],
  265. [AC_HELP_STRING([--enable-modminer],[Compile support for ModMiner FPGAs(default disabled)])],
  266. [modminer=$enableval]
  267. )
  268. if test "x$modminer" = xyes; then
  269. AC_DEFINE([USE_MODMINER], [1], [Defined to 1 if ModMiner support is wanted])
  270. fi
  271. AM_CONDITIONAL([HAS_MODMINER], [test x$modminer = xyes])
  272. spondoolies="no"
  273. AC_ARG_ENABLE([spondoolies],
  274. [AC_HELP_STRING([--enable-spondoolies],[Compile support for Spondoolies (default disabled)])],
  275. [spondoolies=$enableval]
  276. )
  277. if test "x$spondoolies" = xyes; then
  278. AC_DEFINE([USE_SPONDOOLIES], [1], [Defined to 1 if Spondoolies support is wanted])
  279. fi
  280. AM_CONDITIONAL([HAS_SPONDOOLIES], [test x$spondoolies = xyes])
  281. gridseed="no"
  282. AC_ARG_ENABLE([gridseed],
  283. [AC_HELP_STRING([--enable-gridseed],[Compile support for GridSeed (default disabled)])],
  284. [gridseed=$enableval]
  285. )
  286. if test "x$gridseed" = xyes; then
  287. AC_DEFINE([USE_FPGA_SERIAL], [1], [Defined to 1 if serial support required])
  288. AC_DEFINE([USE_GRIDSEED], [1], [Defined to 1 if GridSeed support is wanted])
  289. fi
  290. AM_CONDITIONAL([HAS_GRIDSEED], [test x$gridseed = xyes])
  291. zeus="no"
  292. AC_ARG_ENABLE([zeus],
  293. [AC_HELP_STRING([--enable-zeus],[Compile support for Zeusminer (default disabled)])],
  294. [zeus=$enableval]
  295. )
  296. if test "x$zeus" = xyes; then
  297. AC_DEFINE([USE_FPGA_SERIAL], [1], [Defined to 1 if serial support required])
  298. AC_DEFINE([USE_ZEUS], [1], [Defined to 1 if Zeus support is wanted])
  299. fi
  300. AM_CONDITIONAL([HAS_ZEUS], [test x$zeus = xyes])
  301. lketc="no"
  302. AC_ARG_ENABLE([lketc],
  303. [AC_HELP_STRING([--enable-lketc],[Compile support for Zeusminer (default disabled)])],
  304. [lketc=$enableval]
  305. )
  306. if test "x$lketc" = xyes; then
  307. AC_DEFINE([USE_FPGA_SERIAL], [1], [Defined to 1 if serial support required])
  308. AC_DEFINE([USE_LKETC], [1], [Defined to 1 if Lketc support is wanted])
  309. fi
  310. AM_CONDITIONAL([HAS_LKETC], [test x$lketc = xyes])
  311. curses="auto"
  312. AC_ARG_WITH([curses],
  313. [AC_HELP_STRING([--without-curses],[Compile support for curses TUI (default enabled)])],
  314. [curses=$withval]
  315. )
  316. if test "x$curses" = "xno"; then
  317. cursesmsg='User specified --without-curses. TUI support DISABLED'
  318. else
  319. AC_SEARCH_LIBS(addstr, ncurses pdcurses, [
  320. curses=yes
  321. cursesmsg="FOUND: ${ac_cv_search_addstr}"
  322. AC_DEFINE([HAVE_CURSES], [1], [Defined to 1 if curses TUI support is wanted])
  323. ], [
  324. if test "x$curses" = "xyes"; then
  325. AC_MSG_ERROR([Could not find curses library - please install libncurses-dev or pdcurses-dev (or configure --without-curses)])
  326. else
  327. AC_MSG_WARN([Could not find curses library - if you want a TUI, install libncurses-dev or pdcurses-dev])
  328. curses=no
  329. cursesmsg='NOT FOUND. TUI support DISABLED'
  330. fi
  331. ])
  332. fi
  333. if test x$avalon$bitforce$bitfury$modminer$bflsc$icarus$hashfast$klondike$drillbit$cointerra$ants1$ants2$gridseed$zeus$lketc != xnonononononononononononononono; then
  334. want_usbutils=true
  335. else
  336. want_usbutils=false
  337. fi
  338. if test x$bitfury != xno; then
  339. want_libbitfury=true
  340. else
  341. want_libbitfury=false
  342. fi
  343. if test x$gridseed$zeus$lketc != xnonono; then
  344. want_libudev=true
  345. else
  346. want_libudev=false
  347. fi
  348. AM_CONDITIONAL([NEED_FPGAUTILS], [test x$avalon2$modminer$gridseed$zeus$lketc != xnonononono])
  349. AM_CONDITIONAL([WANT_USBUTILS], [test x$want_usbutils != xfalse])
  350. AM_CONDITIONAL([WANT_LIBBITFURY], [test x$want_libbitfury != xfalse])
  351. AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
  352. AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
  353. AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
  354. if test "x$want_usbutils" != xfalse; then
  355. dlibusb="no"
  356. AC_DEFINE([USE_USBUTILS], [1], [Defined to 1 if usbutils support required])
  357. AC_ARG_WITH([system-libusb],
  358. [AC_HELP_STRING([--with-system-libusb],[Compile against dynamic system libusb (default use included static libusb)])],
  359. [dlibusb=$withval]
  360. )
  361. if test "x$dlibusb" != xno; then
  362. case $target in
  363. *-*-freebsd*)
  364. LIBUSB_LIBS="-lusb"
  365. LIBUSB_CFLAGS=""
  366. AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have libusb-1.0])
  367. ;;
  368. *)
  369. PKG_CHECK_MODULES(LIBUSB, libusb-1.0, [AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have libusb-1.0])], [AC_MSG_ERROR([Could not find usb library - please install libusb-1.0])])
  370. ;;
  371. esac
  372. else
  373. AC_CONFIG_SUBDIRS([compat/libusb-1.0])
  374. LIBUSB_LIBS="compat/libusb-1.0/libusb/.libs/libusb-1.0.a"
  375. if test "x$have_linux" = "xtrue"; then
  376. LIBUSB_LIBS+=" -ludev"
  377. fi
  378. if test "x$have_darwin" = "xtrue"; then
  379. LIBUSB_LIBS+=" -lobjc"
  380. LDFLAGS+=" -framework CoreFoundation -framework IOKit"
  381. fi
  382. fi
  383. else
  384. LIBUSB_LIBS=""
  385. fi
  386. if test "x$want_libudev" != xfalse; then
  387. if test "x$have_linux" = "xtrue"; then
  388. AC_DEFINE([HAVE_LIBUDEV], [1], [Defined to 1 if udev support available])
  389. LIBUDEV_LIBS="-ludev"
  390. fi
  391. else
  392. LIBUDEV_LIBS=""
  393. fi
  394. AM_CONDITIONAL([WANT_STATIC_LIBUSB], [test x$dlibusb = xno])
  395. AC_CONFIG_SUBDIRS([compat/jansson-2.5])
  396. JANSSON_LIBS="compat/jansson-2.5/src/.libs/libjansson.a"
  397. PKG_PROG_PKG_CONFIG()
  398. if test "x$have_cgminer_sdk" = "xtrue"; then
  399. if test "x$have_x86_64" = xtrue; then
  400. ARCH_DIR=x86_64
  401. else
  402. ARCH_DIR=x86
  403. fi
  404. PKG_CONFIG="${PKG_CONFIG:-pkg-config} --define-variable=arch=$ARCH_DIR --define-variable=target=$target --define-variable=cgminersdkdir=$CGMINER_SDK"
  405. PKG_CONFIG_PATH="$CGMINER_SDK/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
  406. fi
  407. AC_SUBST(LIBUSB_LIBS)
  408. AC_SUBST(LIBUSB_CFLAGS)
  409. AC_SUBST(LIBUDEV_LIBS)
  410. AC_ARG_ENABLE([libcurl],
  411. [AC_HELP_STRING([--disable-libcurl],[Disable building with libcurl for getwork and GBT support])],
  412. [libcurl=$enableval]
  413. )
  414. if test "x$libcurl" != xno; then
  415. if test "x$have_win32" != xtrue; then
  416. PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.25.0], [AC_DEFINE([CURL_HAS_KEEPALIVE], [1], [Defined if version of curl supports keepalive.])],
  417. [PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.18.2], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.18.2])])])
  418. else
  419. PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.25.0], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.25.0])])
  420. AC_DEFINE([CURL_HAS_KEEPALIVE], [1])
  421. fi
  422. AC_DEFINE([HAVE_LIBCURL], [1], [Defined to 1 if libcurl support built in])
  423. else
  424. LIBCURL_LIBS=""
  425. fi
  426. AC_SUBST(LIBCURL_LIBS)
  427. #check execv signature
  428. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  429. #include <process.h>
  430. int execv(const char*, const char*const*);
  431. ])],
  432. AC_DEFINE([EXECV_2ND_ARG_TYPE], [const char* const*], [int execv(const char*, const char*const*);]),
  433. AC_DEFINE([EXECV_2ND_ARG_TYPE], [char* const*], [int execv(const char*, char*const*);]))
  434. dnl CCAN wants to know a lot of vars.
  435. # All the configuration checks. Regrettably, the __attribute__ checks will
  436. # give false positives on old GCCs, since they just cause warnings. But that's
  437. # fairly harmless.
  438. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((cold)) cleanup(void) { }])],
  439. AC_DEFINE([HAVE_ATTRIBUTE_COLD], [1],
  440. [Define if __attribute__((cold))]))
  441. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((const)) cleanup(void) { }])],
  442. AC_DEFINE([HAVE_ATTRIBUTE_CONST], [1],
  443. [Define if __attribute__((const))]))
  444. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((noreturn)) cleanup(void) { exit(1); }])],
  445. AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], [1],
  446. [Define if __attribute__((noreturn))]))
  447. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((format(__printf__, 1, 2))) cleanup(const char *fmt, ...) { }])],
  448. AC_DEFINE([HAVE_ATTRIBUTE_PRINTF], [1],
  449. [Define if __attribute__((format(__printf__)))]))
  450. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((unused)) cleanup(void) { }])],
  451. AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1],
  452. [Define if __attribute__((unused))]))
  453. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((used)) cleanup(void) { }])],
  454. AC_DEFINE([HAVE_ATTRIBUTE_USED], [1],
  455. [Define if __attribute__((used))]))
  456. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_constant_p(1) ? 0 : 1; }])],
  457. AC_DEFINE([HAVE_BUILTIN_CONSTANT_P], [1],
  458. [Define if have __builtin_constant_p]))
  459. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_types_compatible_p(char *, int) ? 1 : 0; }])],
  460. AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P], [1],
  461. [Define if have __builtin_types_compatible_p]))
  462. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static int __attribute__((warn_unused_result)) func(int x) { return x; }])],
  463. AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1],
  464. [Define if __attribute__((warn_unused_result))]))
  465. if test "x$prefix" = xNONE; then
  466. prefix=/usr/local
  467. fi
  468. AC_DEFINE_UNQUOTED([CGMINER_PREFIX], ["$prefix/bin"], [Path to cgminer install])
  469. AC_SUBST(JANSSON_LIBS)
  470. AC_SUBST(PTHREAD_FLAGS)
  471. AC_SUBST(DLOPEN_FLAGS)
  472. AC_SUBST(PTHREAD_LIBS)
  473. AC_SUBST(NCURSES_LIBS)
  474. AC_SUBST(PDCURSES_LIBS)
  475. AC_SUBST(WS2_LIBS)
  476. AC_SUBST(MM_LIBS)
  477. AC_SUBST(MATH_LIBS)
  478. AC_SUBST(RT_LIBS)
  479. AC_CONFIG_FILES([
  480. Makefile
  481. compat/Makefile
  482. ccan/Makefile
  483. lib/Makefile
  484. ])
  485. AC_OUTPUT
  486. echo
  487. echo
  488. echo
  489. echo "------------------------------------------------------------------------"
  490. echo "$PACKAGE $VERSION"
  491. echo "------------------------------------------------------------------------"
  492. echo
  493. echo
  494. echo "Configuration Options Summary:"
  495. echo
  496. if test "x$libcurl" != xno; then
  497. echo " libcurl(GBT+getwork).: Enabled: $LIBCURL_LIBS"
  498. else
  499. echo " libcurl(GBT+getwork).: Disabled"
  500. fi
  501. echo " curses.TUI...........: $cursesmsg"
  502. if test "x$scrypt" != xno; then
  503. echo " scrypt...............: Enabled"
  504. else
  505. echo " scrypt...............: Disabled"
  506. fi
  507. echo
  508. if test "x$ants1" = xyes; then
  509. echo " Antminer.S1.Bitmain..: Enabled"
  510. else
  511. echo " Antminer.S1.Bitmain..: Disabled"
  512. fi
  513. if test "x$ants2" = xyes; then
  514. echo " Antminer.S2.Bitmain..: Enabled"
  515. else
  516. echo " Antminer.S2.Bitmain..: Disabled"
  517. fi
  518. if test "x$avalon" = xyes; then
  519. echo " Avalon.ASICs.........: Enabled"
  520. else
  521. echo " Avalon.ASICs.........: Disabled"
  522. fi
  523. if test "x$avalon2" = xyes; then
  524. echo " Avalon2.ASICs........: Enabled"
  525. else
  526. echo " Avalon2.ASICs........: Disabled"
  527. fi
  528. if test "x$minion" = xyes; then
  529. echo " BlackArrowMinion.ASIC: Enabled"
  530. else
  531. echo " BlackArrowMinion.ASIC: Disabled"
  532. fi
  533. if test "x$bab" = xyes; then
  534. echo " BlackArrow.ASICs.....: Enabled"
  535. else
  536. echo " BlackArrow.ASICs.....: Disabled"
  537. fi
  538. if test "x$bflsc" = xyes; then
  539. echo " BFL.ASICs............: Enabled"
  540. else
  541. echo " BFL.ASICs............: Disabled"
  542. fi
  543. if test "x$bitforce" = xyes; then
  544. echo " BitForce.FPGAs.......: Enabled"
  545. else
  546. echo " BitForce.FPGAs.......: Disabled"
  547. fi
  548. if test "x$bitfury" = xyes; then
  549. echo " BitFury.ASICs........: Enabled"
  550. else
  551. echo " BitFury.ASICs........: Disabled"
  552. fi
  553. if test "x$cointerra" = xyes; then
  554. echo " Cointerra.ASICs......: Enabled"
  555. else
  556. echo " Cointerra.ASICs......: Disabled"
  557. fi
  558. if test "x$spondoolies" = xyes; then
  559. echo " Spondoolies.ASICs....: Enabled"
  560. else
  561. echo " Spondoolies.ASICs....: Disabled"
  562. fi
  563. if test "x$bitmine_A1" = xyes; then
  564. echo " Bitmine-A1.ASICs.....: Enabled"
  565. else
  566. echo " Bitmine-A1.ASICs.....: Disabled"
  567. fi
  568. if test "x$drillbit" = xyes; then
  569. echo " Drillbit.BitFury.....: Enabled"
  570. else
  571. echo " Drillbit.BitFury.....: Disabled"
  572. fi
  573. if test "x$hashfast" = xyes; then
  574. echo " Hashfast.ASICs.......: Enabled"
  575. else
  576. echo " Hashfast.ASICs.......: Disabled"
  577. fi
  578. if test "x$icarus" = xyes; then
  579. echo " Icarus.ASICs/FPGAs...: Enabled"
  580. else
  581. echo " Icarus.ASICs/FPGAs...: Disabled"
  582. fi
  583. if test "x$klondike" = xyes; then
  584. echo " Klondike.ASICs.......: Enabled"
  585. else
  586. echo " Klondike.ASICs.......: Disabled"
  587. fi
  588. if test "x$knc" = xyes; then
  589. echo " KnC.ASICs............: Enabled"
  590. else
  591. echo " KnC.ASICs............: Disabled"
  592. fi
  593. if test "x$modminer" = xyes; then
  594. echo " ModMiner.FPGAs.......: Enabled"
  595. else
  596. echo " ModMiner.FPGAs.......: Disabled"
  597. fi
  598. if test "x$gridseed" = xyes; then
  599. echo " GridSeed.ASICs.......: Enabled"
  600. else
  601. echo " GridSeed.ASICs.......: Disabled"
  602. fi
  603. if test "x$zeus" = xyes; then
  604. echo " Zeus.ASICs...........: Enabled"
  605. else
  606. echo " Zeus.ASICs...........: Disabled"
  607. fi
  608. if test "x$lketc" = xyes; then
  609. echo " Lketc.ASICs..........: Enabled"
  610. else
  611. echo " Lketc.ASICs..........: Disabled"
  612. fi
  613. if test "x$avalon$avalon2$bab$bflsc$bitforce$bitfury$hashfast$icarus$klondike$knc$modminer$drillbit$minion$cointerra$bitmine_A1$ants1$ants2$spondoolies$gridseed$zeus$lketc" = xnonononononononononononononononononononono; then
  614. AC_MSG_ERROR([No mining configured in])
  615. fi
  616. echo
  617. echo "Compilation............: make (or gmake)"
  618. echo " CPPFLAGS.............: $CPPFLAGS"
  619. echo " CFLAGS...............: $CFLAGS"
  620. echo " LDFLAGS..............: $LDFLAGS $PTHREAD_FLAGS"
  621. echo " LDADD................: $DLOPEN_FLAGS $LIBCURL_LIBS $JANSSON_LIBS $PTHREAD_LIBS $NCURSES_LIBS $PDCURSES_LIBS $WS2_LIBS $MATH_LIBS $LIBUSB_LIBS $LIBUDEV_LIBS $RT_LIBS"
  622. echo
  623. echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
  624. echo " prefix...............: $prefix"
  625. echo
  626. if test "x$want_usbutils$dlibusb" = xyesyes; then
  627. echo "*** SYSTEM LIBUSB BEING ADDED - NOT RECOMMENDED UNLESS YOU ARE UNABLE TO COMPILE THE INCLUDED LIBUSB ***"
  628. echo
  629. fi