configure.ac 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  2. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  3. m4_define([v_maj], [2])
  4. m4_define([v_min], [10])
  5. m4_define([v_mic], [0])
  6. ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
  7. m4_define([v_ver], [v_maj.v_min.v_mic])
  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([bfgminer], [v_ver], [luke-jr+bfgminer@utopios.org])
  14. AC_PREREQ([2.59c])
  15. AC_CANONICAL_SYSTEM
  16. AC_CONFIG_MACRO_DIR([m4])
  17. AC_CONFIG_SRCDIR([miner.c])
  18. AC_CONFIG_HEADERS([config.h])
  19. AM_INIT_AUTOMAKE([foreign])
  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_C99
  43. gl_EARLY
  44. AC_PROG_GCC_TRADITIONAL
  45. AM_PROG_CC_C_O
  46. AC_PROG_RANLIB
  47. gl_INIT
  48. dnl Checks for header files.
  49. AC_HEADER_STDC
  50. AC_CHECK_HEADERS(syslog.h)
  51. AC_CHECK_HEADERS([sys/epoll.h])
  52. AC_CHECK_HEADERS([sys/prctl.h])
  53. AC_FUNC_ALLOCA
  54. have_cygwin=false
  55. have_win32=false
  56. PTHREAD_FLAGS="-lpthread"
  57. DLOPEN_FLAGS="-ldl"
  58. WS2_LIBS=""
  59. MATH_LIBS="-lm"
  60. case $target in
  61. amd64-*)
  62. have_x86_64=true
  63. ;;
  64. x86_64-*)
  65. have_x86_64=true
  66. ;;
  67. *)
  68. have_x86_64=false
  69. ;;
  70. esac
  71. case $target in
  72. *-*-mingw*)
  73. have_x86_64=false
  74. have_win32=true
  75. PTHREAD_FLAGS=""
  76. DLOPEN_FLAGS=""
  77. WS2_LIBS="-lws2_32"
  78. AC_DEFINE([_WIN32_WINNT], [0x0501], "WinNT version for XP+ support")
  79. ;;
  80. *-*-cygwin*)
  81. have_cygwin=true
  82. ;;
  83. powerpc-*-darwin*)
  84. CFLAGS="$CFLAGS -faltivec"
  85. PTHREAD_FLAGS=""
  86. ;;
  87. *-*-darwin*)
  88. PTHREAD_FLAGS=""
  89. ;;
  90. esac
  91. m4_define([BFG_INCLUDE],
  92. if test "x$2" = "x"; then
  93. $1=''
  94. else
  95. $1="[#]include <$2>"
  96. fi
  97. )
  98. m4_define([BFG_PREPROC_IFELSE],
  99. BFG_INCLUDE([headerinclude], $2)
  100. AC_COMPILE_IFELSE([
  101. AC_LANG_PROGRAM([
  102. ${headerinclude}
  103. ], [
  104. #if !( $1 )
  105. #error "$1 false in preprocessor"
  106. #endif
  107. ])
  108. ],$3,$4)
  109. )
  110. cpumining="no"
  111. AC_ARG_ENABLE([cpumining],
  112. [AC_HELP_STRING([--enable-cpumining],[Build with cpu mining support(default disabled)])],
  113. [cpumining=$enableval]
  114. )
  115. if test "x$cpumining" = xyes; then
  116. AC_DEFINE_UNQUOTED([WANT_CPUMINE], [1], [Enable CPUMINING])
  117. fi
  118. AM_CONDITIONAL([HAS_CPUMINE], [test x$cpumining = xyes])
  119. opencl="yes"
  120. AC_ARG_ENABLE([opencl],
  121. [AC_HELP_STRING([--disable-opencl],[Build without support for OpenCL (default enabled)])],
  122. [opencl=$enableval]
  123. )
  124. if test "x$opencl" = xyes; then
  125. AC_DEFINE([HAVE_OPENCL], [1], [Defined to 1 if OpenCL support is wanted])
  126. else
  127. DLOPEN_FLAGS=""
  128. fi
  129. AM_CONDITIONAL([HAVE_OPENCL], [test x$opencl = xyes])
  130. AC_CHECK_LIB(pthread, pthread_create, ,
  131. AC_MSG_ERROR([Could not find pthread library - please install libpthread]))
  132. PTHREAD_LIBS=-lpthread
  133. AC_CHECK_LIB(jansson, json_loads, ,
  134. AC_MSG_ERROR([Could not find jansson library]))
  135. if test "x$opencl" = xyes; then
  136. adl="yes"
  137. AC_ARG_ENABLE([adl],
  138. [AC_HELP_STRING([--disable-adl],[Build without ADL monitoring (default enabled)])],
  139. [adl=$enableval]
  140. )
  141. if test x$adl = xyes
  142. then
  143. AC_DEFINE([HAVE_ADL], [1], [Defined if ADL headers were found])
  144. fi
  145. else
  146. adl="no"
  147. fi
  148. AC_ARG_ENABLE([bitforce],
  149. [AC_HELP_STRING([--disable-bitforce],[Compile support for BitForce (default enabled)])],
  150. [bitforce=$enableval],
  151. [bitforce=yes]
  152. )
  153. if test "x$bitforce" = xyes; then
  154. AC_DEFINE([USE_BITFORCE], [1], [Defined to 1 if BitForce support is wanted])
  155. fi
  156. AM_CONDITIONAL([HAS_BITFORCE], [test x$bitforce = xyes])
  157. AC_ARG_ENABLE([icarus],
  158. [AC_HELP_STRING([--disable-icarus],[Compile support for Icarus (default enabled)])],
  159. [icarus=$enableval],
  160. [icarus=yes]
  161. )
  162. if test "x$icarus" = xyes; then
  163. AC_DEFINE([USE_ICARUS], [1], [Defined to 1 if Icarus support is wanted])
  164. fi
  165. AM_CONDITIONAL([HAS_ICARUS], [test x$icarus = xyes])
  166. AC_ARG_ENABLE([modminer],
  167. [AC_HELP_STRING([--disable-modminer],[Compile support for ModMiner (default enabled)])],
  168. [modminer=$enableval],
  169. [modminer=yes]
  170. )
  171. if test "x$modminer" = xyes; then
  172. AC_DEFINE([USE_MODMINER], [1], [Defined to 1 if ModMiner support is wanted])
  173. fi
  174. AM_CONDITIONAL([HAS_MODMINER], [test x$modminer = xyes])
  175. PKG_PROG_PKG_CONFIG()
  176. libusb=no
  177. libusb_include_path=""
  178. PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],[
  179. libusb=yes
  180. ],[
  181. for usb_lib in usb-1.0 usb; do
  182. AC_CHECK_LIB($usb_lib, libusb_init, [
  183. libusb=yes
  184. break
  185. ], [])
  186. done
  187. if test "x$libusb" = xyes; then
  188. AC_CHECK_DECL([libusb_init],[
  189. ],[
  190. AC_PROG_CPP
  191. AC_MSG_CHECKING([whether libusb_init is declared in subdirectory])
  192. libusb_include_path=`echo '#include <libusb-1.0/libusb.h>' | ${CPP} -M - 2>/dev/null | sed 's/^[^[:space:]]\+[[:space:]]\+\([^[:space:]]\+\)\/.*$/\1/;t;d'`
  193. if test "x$libusb_include_path" != "x"; then
  194. LIBUSB_LIBS="-l$usb_lib"
  195. LIBUSB_CFLAGS="-I$libusb_include_path"
  196. AC_MSG_RESULT([yes])
  197. else
  198. libusb=no
  199. AC_MSG_RESULT([no])
  200. fi
  201. ],[#include <libusb.h>])
  202. fi
  203. ])
  204. if test "x$libusb" = xyes; then
  205. AC_DEFINE([HAVE_LIBUSB], [1], [Define if you have libusb-1.0])
  206. save_CFLAGS="$CFLAGS"
  207. CFLAGS="$LIBUSB_CFLAGS $CFLAGS"
  208. AC_CHECK_DECLS([libusb_error_name],[],[],[#include <libusb.h>])
  209. CFLAGS="$save_CFLAGS"
  210. fi
  211. AC_ARG_ENABLE([x6500],
  212. [AC_HELP_STRING([--disable-x6500],[Compile support for X6500 (default if libusb)])],
  213. [x6500=$enableval],
  214. [x6500=auto]
  215. )
  216. if test "x$x6500$libusb" = xyesno; then
  217. AC_MSG_ERROR([Could not find libusb, required for X6500 support])
  218. elif test "x$x6500" = xauto; then
  219. x6500="$libusb"
  220. if test "x$libusb" = xno; then
  221. AC_MSG_WARN([Could not find libusb, required for X6500 support])
  222. x6500warn=yes
  223. fi
  224. fi
  225. if test "x$x6500" = xyes; then
  226. AC_DEFINE([USE_X6500], [1], [Defined to 1 if X6500 support is wanted])
  227. fi
  228. AM_CONDITIONAL([HAS_X6500], [test x$x6500 = xyes])
  229. AC_ARG_ENABLE([ztex],
  230. [AC_HELP_STRING([--disable-ztex],[Compile support for Ztex (default if libusb)])],
  231. [ztex=$enableval],
  232. [ztex=auto]
  233. )
  234. if test "x$ztex$libusb" = xyesno; then
  235. AC_MSG_ERROR([Could not find libusb, required for Ztex support])
  236. elif test "x$ztex" = xauto; then
  237. ztex="$libusb"
  238. if test "x$libusb" = xno; then
  239. AC_MSG_WARN([Could not find libusb, required for Ztex support])
  240. ztexwarn=yes
  241. fi
  242. fi
  243. if test "x$ztex" = xyes; then
  244. AC_DEFINE([USE_ZTEX], [1], [Defined to 1 if Ztex support is wanted])
  245. fi
  246. AM_CONDITIONAL([HAS_ZTEX], [test x$ztex = xyes])
  247. scrypt="no"
  248. AC_ARG_ENABLE([scrypt],
  249. [AC_HELP_STRING([--enable-scrypt],[Compile support for scrypt mining (default disabled)])],
  250. [scrypt=$enableval]
  251. )
  252. if test "x$scrypt" = xyes; then
  253. AC_DEFINE([USE_SCRYPT], [1], [Defined to 1 if scrypt support is wanted])
  254. fi
  255. curses="auto"
  256. AC_ARG_WITH([curses],
  257. [AC_HELP_STRING([--without-curses],[Compile support for curses TUI (default enabled)])],
  258. [curses=$withval]
  259. )
  260. if test "x$curses" = "xno"; then
  261. cursesmsg='User specified --without-curses. TUI support DISABLED'
  262. else
  263. if test "x$cross_compiling" != "xyes"; then
  264. AC_MSG_CHECKING([for best native curses library])
  265. orig_libs="$LIBS"
  266. orig_cflags="$CFLAGS"
  267. for curses_lib in ncurses{w,}{,6,5}; do
  268. if ! ${curses_lib}-config --cflags >/dev/null 2>/dev/null; then
  269. continue
  270. fi
  271. CFLAGS="$orig_cflags $(${curses_lib}-config --cflags)"
  272. LIBS="$orig_libs $(${curses_lib}-config --libs)"
  273. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  274. #include <curses.h>
  275. ]], [[
  276. WINDOW *w = NULL;
  277. mvwprintw(w, 2, 2, "Testing %s", "o hai");
  278. ]])], [
  279. curses=yes
  280. cursesmsg="FOUND: ${curses_lib}"
  281. AC_MSG_RESULT([$curses_lib])
  282. NCURSES_LIBS=`${curses_lib}-config --libs`
  283. NCURSES_CPPFLAGS=`${curses_lib}-config --cflags`
  284. break
  285. ], [
  286. AC_MSG_WARN([${curses_lib} doesn't seem to be installed properly])
  287. ])
  288. done
  289. LIBS="$orig_libs"
  290. CFLAGS="$orig_cflags"
  291. fi
  292. if test "x$curses" != "xyes"; then
  293. AC_SEARCH_LIBS(addstr, ncursesw ncurses pdcurses, [
  294. curses=yes
  295. cursesmsg="FOUND: ${ac_cv_search_addstr}"
  296. cursesmsg="${cursesmsg/-l/}"
  297. ], [
  298. if test "x$curses" = "xyes"; then
  299. AC_MSG_ERROR([Could not find curses library - please install libncurses-dev or pdcurses-dev (or configure --without-curses)])
  300. else
  301. AC_MSG_WARN([Could not find curses library - if you want a TUI, install libncurses-dev or pdcurses-dev])
  302. curses=no
  303. cursesmsg='NOT FOUND. TUI support DISABLED'
  304. fi
  305. ])
  306. fi
  307. if test "x$curses" = "xyes"; then
  308. AC_DEFINE([HAVE_CURSES], [1], [Defined to 1 if curses TUI support is wanted])
  309. fi
  310. fi
  311. AC_CONFIG_SUBDIRS([libblkmaker])
  312. AM_CONDITIONAL([NEED_LIBBLKMAKER], [true])
  313. AM_CONDITIONAL([NEED_DYNCLOCK], [test x$icarus$modminer$x6500$ztex != xnonono])
  314. AM_CONDITIONAL([NEED_FPGAUTILS], [test x$icarus$bitforce$modminer$x6500$ztex != xnononono])
  315. AM_CONDITIONAL([HAS_SCRYPT], [test x$scrypt = xyes])
  316. AM_CONDITIONAL([HAVE_CURSES], [test x$curses = xyes])
  317. AM_CONDITIONAL([HAVE_CYGWIN], [test x$have_cygwin = xtrue])
  318. AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
  319. AM_CONDITIONAL([HAVE_x86_64], [test x$have_x86_64 = xtrue])
  320. JANSSON_LIBS=-ljansson
  321. dnl Find YASM
  322. has_yasm=false
  323. AC_PATH_PROG([YASM],[yasm],[false])
  324. if test "x$YASM" != "xfalse" ; then
  325. AC_MSG_CHECKING([if yasm version is greater than 1.0.1])
  326. yasmver=`yasm --version | head -1 | cut -d\ -f2`
  327. yamajor=`echo $yasmver | cut -d. -f1`
  328. yaminor=`echo $yasmver | cut -d. -f2`
  329. yamini=`echo $yasmver | cut -d. -f3`
  330. if test "$yamajor" -ge "1" ; then
  331. if test "$yamajor" -eq "1" ; then
  332. if test "$yaminor" -ge "0" ; then
  333. if test "$yaminor" -eq "0"; then
  334. if test "$yamini" -ge "1"; then
  335. has_yasm=true
  336. fi
  337. else
  338. has_yasm=true
  339. fi
  340. fi
  341. fi
  342. else
  343. has_yasm=false
  344. fi
  345. if test "x$has_yasm" = "xtrue" ; then
  346. AC_MSG_RESULT([yes])
  347. else
  348. AC_MSG_RESULT([no])
  349. fi
  350. fi
  351. if test "x$has_yasm" = "xfalse" ; then
  352. AC_MSG_NOTICE([yasm is required for the assembly algorithms. They will be skipped.])
  353. fi
  354. AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
  355. if test "x$bitforce$modminer" != xnono; then
  356. AC_ARG_WITH([libudev], [AC_HELP_STRING([--without-libudev], [Autodetect FPGAs using libudev (default enabled)])],
  357. [libudev=$withval],
  358. [libudev=auto]
  359. )
  360. if test "x$libudev" != "xno"; then
  361. AC_CHECK_HEADER([libudev.h],[
  362. libudev=yes
  363. UDEV_LIBS=-ludev
  364. AC_DEFINE([HAVE_LIBUDEV], [1], [Defined to 1 if libudev is wanted])
  365. ], [
  366. if test "x$libudev" = "xyes"; then
  367. AC_MSG_ERROR([libudev not found])
  368. fi
  369. libudev=no
  370. ])
  371. fi
  372. fi
  373. AM_CONDITIONAL([HAVE_LIBUDEV], [test x$libudev != xno])
  374. AC_SUBST(LIBUSB_LIBS)
  375. AC_SUBST(LIBUSB_CFLAGS)
  376. PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.18.2], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.18.2])])
  377. AC_SUBST(LIBCURL_LIBS)
  378. dnl CCAN wants to know a lot of vars.
  379. # All the configuration checks. Regrettably, the __attribute__ checks will
  380. # give false positives on old GCCs, since they just cause warnings. But that's
  381. # fairly harmless.
  382. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((cold)) cleanup(void) { }])],
  383. AC_DEFINE([HAVE_ATTRIBUTE_COLD], [1],
  384. [Define if __attribute__((cold))]))
  385. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((const)) cleanup(void) { }])],
  386. AC_DEFINE([HAVE_ATTRIBUTE_CONST], [1],
  387. [Define if __attribute__((const))]))
  388. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((noreturn)) cleanup(void) { exit(1); }])],
  389. AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], [1],
  390. [Define if __attribute__((noreturn))]))
  391. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((format(__printf__, 1, 2))) cleanup(const char *fmt, ...) { }])],
  392. AC_DEFINE([HAVE_ATTRIBUTE_PRINTF], [1],
  393. [Define if __attribute__((format(__printf__)))]))
  394. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((unused)) cleanup(void) { }])],
  395. AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1],
  396. [Define if __attribute__((unused))]))
  397. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static void __attribute__((used)) cleanup(void) { }])],
  398. AC_DEFINE([HAVE_ATTRIBUTE_USED], [1],
  399. [Define if __attribute__((used))]))
  400. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_constant_p(1) ? 0 : 1; }])],
  401. AC_DEFINE([HAVE_BUILTIN_CONSTANT_P], [1],
  402. [Define if have __builtin_constant_p]))
  403. AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return __builtin_types_compatible_p(char *, int) ? 1 : 0; }])],
  404. AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P], [1],
  405. [Define if have __builtin_types_compatible_p]))
  406. AC_COMPILE_IFELSE([AC_LANG_SOURCE([static int __attribute__((warn_unused_result)) func(int x) { return x; }])],
  407. AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1],
  408. [Define if __attribute__((warn_unused_result))]))
  409. # byteswap functions
  410. BSWAP=''
  411. for sym in __builtin_bswap __bswap_ bswap_ __swap swap OSSwapInt; do
  412. AC_MSG_CHECKING([for ${sym}* functions])
  413. for headerfile in '' byteswap.h endian.h sys/endian.h libkern/OSByteOrder.h; do
  414. BFG_INCLUDE([headerinclude], [${headerfile}])
  415. AC_LINK_IFELSE([
  416. AC_LANG_PROGRAM([
  417. ${headerinclude}
  418. ], [
  419. (void) ${sym}16(0);
  420. (void) ${sym}32(0);
  421. (void) ${sym}64(0);
  422. ])
  423. ], [
  424. BSWAP="${sym}"
  425. if test "x${headerfile}" = "x"; then
  426. AC_MSG_RESULT([yes])
  427. else
  428. AC_MSG_RESULT([found in ${headerfile}])
  429. AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$headerfile]), 1, [Define to use byteswap macros from <${headerfile}>])
  430. fi
  431. break 2
  432. ],[])
  433. done
  434. AC_MSG_RESULT([no])
  435. done
  436. if test "x$BSWAP" = "x"; then
  437. true # Substitutes are provided in miner.h
  438. elif test "x$BSWAP" = "xbswap_"; then
  439. AC_MSG_CHECKING([if bswap_16 is already a macro])
  440. BFG_PREPROC_IFELSE([defined(bswap_16)], $headerfile, [
  441. AC_MSG_RESULT([yes])
  442. BSWAP=""
  443. ],[
  444. AC_MSG_RESULT([no])
  445. ])
  446. fi
  447. if test "x$BSWAP" != "x"; then
  448. AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, [Define to 16-bit byteswap macro])
  449. AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, [Define to 16-bit byteswap macro])
  450. AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, [Define to 16-bit byteswap macro])
  451. fi
  452. # endian definition macros
  453. AC_MSG_CHECKING([for platform endian])
  454. found_endian=no
  455. for headerfile in '' endian.h sys/endian.h sys/param.h; do
  456. for pfx in '' '__'; do
  457. 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}, [
  458. if test "x$headerfile" != "x"; then
  459. headerfile=" (${headerfile})"
  460. fi
  461. BFG_PREPROC_IFELSE([${pfx}BYTE_ORDER == ${pfx}BIG_ENDIAN], ${headerfile}, [
  462. AC_MSG_RESULT([big endian$headerfile])
  463. AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if your platform is big endian])
  464. ], [
  465. AC_MSG_RESULT([little endian$headerfile])
  466. ])
  467. found_endian=yes
  468. break 2
  469. ],[true])
  470. done
  471. done
  472. if test "x$found_endian" = "xno"; then
  473. if $have_win32 || $have_cygwin; then
  474. AC_MSG_RESULT([assuming little endian (Windows)])
  475. else
  476. # This is reported to have problems, so only use it if our own checks fail
  477. AC_C_BIGENDIAN
  478. fi
  479. fi
  480. if test "x$prefix" = xNONE; then
  481. prefix=/usr/local
  482. fi
  483. AC_DEFINE_UNQUOTED([CGMINER_PREFIX], ["$prefix/bin"], [Path to bfgminer install])
  484. AC_DEFINE_UNQUOTED([PHATK_KERNNAME], ["phatk121016"], [Filename for phatk kernel])
  485. AC_DEFINE_UNQUOTED([POCLBM_KERNNAME], ["poclbm121016"], [Filename for poclbm kernel])
  486. AC_DEFINE_UNQUOTED([DIAKGCN_KERNNAME], ["diakgcn121016"], [Filename for diakgcn kernel])
  487. AC_DEFINE_UNQUOTED([DIABLO_KERNNAME], ["diablo121016"], [Filename for diablo kernel])
  488. AC_DEFINE_UNQUOTED([SCRYPT_KERNNAME], ["scrypt121016"], [Filename for scrypt kernel])
  489. AC_SUBST(JANSSON_LIBS)
  490. AC_SUBST(PTHREAD_FLAGS)
  491. AC_SUBST(DLOPEN_FLAGS)
  492. AC_SUBST(PTHREAD_LIBS)
  493. AC_SUBST(NCURSES_CPPFLAGS)
  494. AC_SUBST(NCURSES_LIBS)
  495. AC_SUBST(PDCURSES_LIBS)
  496. AC_SUBST(WS2_LIBS)
  497. AC_SUBST(MATH_LIBS)
  498. AC_SUBST(UDEV_LIBS)
  499. AC_CONFIG_FILES([
  500. Makefile
  501. x86_64/Makefile
  502. x86_32/Makefile
  503. ccan/Makefile
  504. lib/Makefile
  505. ])
  506. AC_OUTPUT
  507. echo
  508. echo
  509. echo
  510. echo "------------------------------------------------------------------------"
  511. echo "$PACKAGE $VERSION"
  512. echo "------------------------------------------------------------------------"
  513. echo
  514. echo
  515. echo "Configuration Options Summary:"
  516. echo
  517. echo " curses.TUI...........: $cursesmsg"
  518. if test "x$scrypt" != xno; then
  519. echo " scrypt...............: Enabled"
  520. else
  521. echo " scrypt...............: Disabled"
  522. fi
  523. echo
  524. if test "x$opencl" = xyes; then
  525. echo " OpenCL...............: Enabled"
  526. else
  527. echo " OpenCL...............: Disabled"
  528. fi
  529. if test "x$adl" = xyes; then
  530. echo " ADL.monitoring.....: Enabled"
  531. elif test "x$opencl" = xyes; then
  532. echo " ADL.monitoring.....: Disabled"
  533. else
  534. echo " ADL.monitoring.....: n/a"
  535. fi
  536. if test "x$bitforce" = xyes; then
  537. echo " BitForce.FPGAs.......: Enabled"
  538. else
  539. echo " BitForce.FPGAs.......: Disabled"
  540. fi
  541. if test "x$icarus" = xyes; then
  542. echo " Icarus.FPGAs.........: Enabled"
  543. else
  544. echo " Icarus.FPGAs.........: Disabled"
  545. fi
  546. if test "x$modminer" = xyes; then
  547. echo " ModMiner.FPGAs.......: Enabled"
  548. else
  549. echo " ModMiner.FPGAs.......: Disabled"
  550. fi
  551. if test "x$x6500" = xyes; then
  552. echo " X6500.FPGAs..........: Enabled"
  553. elif test "x$ztexwarn" = xyes; then
  554. echo " X6500.FPGAs..........: Disabled (libusb not found)"
  555. else
  556. echo " X6500.FPGAs..........: Disabled"
  557. fi
  558. if test "x$ztex" = xyes; then
  559. echo " Ztex.FPGAs...........: Enabled"
  560. elif test "x$ztexwarn" = xyes; then
  561. echo " Ztex.FPGAs...........: Disabled (libusb not found)"
  562. else
  563. echo " Ztex.FPGAs...........: Disabled"
  564. fi
  565. if test "x$bitforce$modminer" != xnono; then
  566. echo " libudev.detection....: $libudev"
  567. fi
  568. echo
  569. if test "x$cpumining" = xyes; then
  570. echo " CPU Mining...........: Enabled"
  571. echo " ASM.(for CPU mining).: $has_yasm"
  572. else
  573. echo " CPU Mining...........: Disabled"
  574. fi
  575. echo
  576. echo "Compilation............: make (or gmake)"
  577. echo " CPPFLAGS.............: $CPPFLAGS $NCURSES_CPPFLAGS"
  578. echo " CFLAGS...............: $CFLAGS $LIBUSB_CFLAGS"
  579. echo " LDFLAGS..............: $LDFLAGS $PTHREAD_FLAGS"
  580. echo " LDADD................: $DLOPEN_FLAGS $LIBCURL_LIBS $JANSSON_LIBS $PTHREAD_LIBS $NCURSES_LIBS $PDCURSES_LIBS $WS2_LIBS $MATH_LIBS $UDEV_LIBS $LIBUSB_LIBS"
  581. echo
  582. echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
  583. echo " prefix...............: $prefix"
  584. echo