forked from RadiantBlockchain/rad-bfgminer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
1620 lines (1467 loc) · 43.6 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl * Copyright 2011-2016 Luke Dashjr
dnl * Copyright 2011-2013 Con Kolivas
dnl * Copyright 2010-2011 Jeff Garzik
dnl * Copyright 2012 Xiangfu
dnl * Copyright 2011 Rusty Russell
dnl * Copyright 2011 Mark Crichton
dnl * Copyright 2013-2014 Nate Woolls
dnl *
dnl * This program is free software; you can redistribute it and/or modify it
dnl * under the terms of the GNU General Public License as published by the Free
dnl * Software Foundation; either version 3 of the License, or (at your option)
dnl * any later version. See COPYING for more details.
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [1])
m4_define([v_min], [0])
m4_define([v_mic], [3])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_ver], [v_maj.v_min.v_mic])
m4_define([lt_rev], m4_eval(v_maj + v_min))
m4_define([lt_cur], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
AC_INIT([rad-bfgminer], [v_ver], [])
AC_PREREQ([2.59c])
AC_CANONICAL_SYSTEM
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([miner.c])
AC_CONFIG_HEADERS([config.h])
AH_BOTTOM([
#ifdef WIN32
#include "winhacks.h"
#endif
])
AM_INIT_AUTOMAKE([foreign subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_USE_SYSTEM_EXTENSIONS
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
m4_ifdef([v_rel], , [m4_define([v_rel], [])])
AC_DEFINE_UNQUOTED(CGMINER_MAJOR_VERSION, [v_maj], [Major version])
AC_DEFINE_UNQUOTED(CGMINER_MINOR_VERSION, [v_min], [Minor version])
AC_DEFINE_UNQUOTED(CGMINER_MINOR_SUBVERSION, [v_mic], [Micro version])
version_info="lt_rev:lt_cur:lt_age"
release_info="v_rel"
AC_SUBST(version_info)
AC_SUBST(release_info)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
AC_SUBST(VMAJ)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl Make sure anyone changing configure.ac/Makefile.am has a clue
AM_MAINTAINER_MODE([enable])
dnl Checks for programs
AC_PROG_CC_C99
gl_EARLY
AC_PROG_GCC_TRADITIONAL
AM_PROG_CC_C_O
AC_PROG_RANLIB
AC_PROG_CPP
AC_PROG_SED
gl_INIT
AC_SYS_LARGEFILE
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS([sys/epoll.h])
AC_CHECK_HEADERS([sys/mman.h])
AC_CHECK_HEADERS([sys/prctl.h])
AC_CHECK_HEADERS([sys/file.h])
AC_CHECK_HEADERS([sys/termios.h])
AC_CHECK_HEADERS([sys/unistd.h])
AC_CHECK_HEADERS([linux/spi/spidev.h])
AC_CHECK_MEMBER([struct i2c_msg.buf],[
true
],[
dnl Note the member is different here to avoid caching screwing things up
AC_CHECK_MEMBER([struct i2c_msg.len],[
AC_DEFINE([NEED_LINUX_I2C_H],[1],[Defined if linux/i2c.h is needed to supplement linux/i2c-dev.h])
],[
true
],[
AC_INCLUDES_DEFAULT
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
])
],[
AC_INCLUDES_DEFAULT
#include <linux/i2c-dev.h>
])
# Setuid
AC_CHECK_HEADERS([pwd.h])
# Check for chroot support
AC_CHECK_FUNCS([chroot])
AC_CHECK_FUNCS([sleep])
AC_FUNC_ALLOCA
lowllist=
driverlist=
algolist=
optlist=
has_fpga=no
has_asic=no
need_binloader=no
need_dynclock=no
need_gc3355=no
need_linux_i2c_dev=no
need_lowl_vcom=no
need_lowlevel=no
need_lowl_ftdi=no
need_lowl_hid=no
need_lowl_mswin=no
need_lowl_pci=no
need_lowl_spi=no
need_lowl_usb=no
need_knc_asic=no
need_work2d=no
have_cygwin=false
have_win32=false
have_macho=false
use_udevrules=true
have_udevrules=false
AUTOSCAN_CPPFLAGS=""
AUTOSCAN_LIBS=""
DLOPEN_FLAGS="-ldl"
WS2_LIBS=""
MM_LIBS=""
MATH_LIBS="-lm"
RT_LIBS=""
case $target in
amd64-* | x86_64-*)
have_x86_32=false
have_x86_64=true
bitness="64"
;;
i386-* | i486-* | i586-* | i686-* | x86-*)
have_x86_32=true
have_x86_64=false
bitness="32"
;;
*)
have_x86_32=false
have_x86_64=false
;;
esac
case $target in
*-*-mingw*)
have_win32=true
use_udevrules=false
DLOPEN_FLAGS=""
WS2_LIBS="-lws2_32"
MM_LIBS="-lwinmm"
AC_DEFINE([_WIN32_WINNT], [0x0501], "WinNT version for XP+ support")
AC_DEFINE([FD_SETSIZE], [4096], [Maximum sockets before fd_set overflows])
;;
*-*-cygwin*)
have_cygwin=true
use_udevrules=false
;;
powerpc-*-darwin*)
CFLAGS="$CFLAGS -faltivec"
have_macho=true
use_udevrules=false
;;
*-*-darwin*)
LDFLAGS="$LDFLAGS -framework IOKit -framework CoreFoundation"
have_macho=true
use_udevrules=false
;;
esac
m4_define([BFG_INCLUDE],
if test "x$2" = "x"; then
$1=''
else
$1="[#]include <$2>"
fi
)
m4_define([BFG_PREPROC_IFELSE],
BFG_INCLUDE([headerinclude], $2)
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([
${headerinclude}
], [
#if !( $1 )
#error "$1 false in preprocessor"
#endif
])
],[$3],[$4])
)
m4_define([BFG_FIND_INCLUDE_PATH],[
m4_pushdef([_rel_path],[$1])
m4_pushdef([_header_file],[$2])
m4_pushdef([_iffound],[$3])
m4_pushdef([_ifnotfound],[$4])
m4_pushdef([_includes],[$5])
m4_pushdef([_result_var],[inclpath_[]patsubst(_header_file,[[./]],[_])])
AC_CHECK_HEADER([_rel_path/_header_file],[
AC_MSG_CHECKING([_header_file path])
_result_var=`echo '[#]include <'"_rel_path"'/_header_file>' | ${CPP} -M - 2>/dev/null | ${SED} [-E -e ':a' -e '/\\$/!b b' -e N -e 's/\\\n/ /' -e 't a' -e ':b' -e 's/^[^:]*:[[:space:]]*(([^[:space:]\]|\\.)*[[:space:]])*(([^[:space:]\]|\\.)*)(\\|\\\\|\/)?]patsubst([_header_file],[\.],[\\.])[([[:space:]].*)?$/\3/' -e 't' -e d]`
if test "x$_result_var" = "x"; then
AC_MSG_RESULT([failed])
AC_MSG_ERROR([Couldn't determine include path for _header_file])
else
AC_MSG_RESULT([$_result_var])
_iffound
fi
],[
true
_ifnotfound
],[
_includes
])
m4_popdef([_rel_path],[_header_file],[_iffound],[_ifnotfound],[_result_var])
])
bfg_enableaction() {
_var=$1
eval "_missingdeps=\"\$${_var}_missingdeps\""
if test -n "$_missingdeps"; then
_enableaction=
for _missingdep in $_missingdeps; do
eval "_howto=\"\$howto_${_missingdep}\""
if test "x$_howto" = "x"; then
eval "_label=\"\${label_${_missingdep}-${_missingdep}}\""
_howto="enable $_label"
fi
if test "$_howto" != "x"; then
_enableaction="$_enableaction; $_howto"
fi
done
_enableaction="${_enableaction:2}"
else
eval "_enableaction=\"\$${_var}_enableaction\""
fi
echo "$_enableaction"
}
dnl _BFG_AUTOITEM(list,driver,DriverName,dependency list,default:no/auto,CodeIfEnabled)
m4_define([_BFG_AUTOITEM],[
m4_pushdef([_list],[$1])
m4_pushdef([_this_drv],m4_default([$2],m4_tolower([$3])))
m4_pushdef([_this_drvuc],m4_toupper(_this_drv))
m4_pushdef([_this_USE],USE_[]_this_drvuc)
m4_pushdef([_this_name],[$3])
m4_pushdef([_deplist],[$4])
m4_pushdef([_this_default],[$5])
m4_pushdef([_this_enablecode],[$6])
m4_case(_list,
[algo],[algolist="$algolist []_this_name/[]_this_USE"],
[driver],[driverlist="$driverlist []_this_drv/[]_this_USE"],
[]
)
label_[]_this_drvuc="[]_this_name"
AC_ARG_ENABLE([]_this_drv,
m4_bmatch(_this_default,[.*no$],
AC_HELP_STRING([--enable-[]_this_drv],[Compile support for ]_this_name[ (default disabled)]),
AC_HELP_STRING([--disable-[]_this_drv],[Compile support for ]_this_name[ (default enabled)])),
[[]_this_USE=$enableval],
[[]_this_USE=[]_this_default]
)
[]_this_drv[]_opt=
if test "x$[]_this_USE" = "xno"; then
true
else
if test "x$[]_this_USE" = xauto; then
_wasauto=yes
else
_wasauto=no
fi
if test "x$[]_this_USE" != xyes; then
if test "x$[]_this_USE" != xauto; then
[]_this_drv[]_opt="$[]_this_USE"
fi
[]_this_USE=yes
fi
for __drvdep in []m4_toupper(_deplist); do
eval "_drvdep=\"\$USE_$__drvdep\""
if test "x$_drvdep" != "xyes"; then
[]_this_USE[]_missingdeps="$[]_this_USE[]_missingdeps $__drvdep"
[]_this_USE=no
fi
done
if test "x$[]_this_USE[]$_wasauto" = xnono; then
_enableaction=`bfg_enableaction []_this_USE`
AC_MSG_ERROR([To enable []_this_name: $_enableaction])
fi
fi
if test "x$[]_this_USE" = "xyes"; then
AC_DEFINE([]_this_USE,[1],[Defined to 1 if []_this_name support is wanted])
[]_this_enablecode
fi
AM_CONDITIONAL([]_this_USE,[test x$[]_this_USE = xyes])
m4_popdef([_this_drv],[_this_drvuc],[_this_USE],[_this_name],[_deplist],[_this_default],[_this_enablecode])
])
dnl BFG_ALGO(AlgoName,default:no/yes,CodeIfEnabled)
m4_define([BFG_ALGO],[
_BFG_AUTOITEM([algo],,[$1],,[$2],[$3])
])
dnl BFG_DRIVER(driver,DriverName,dependency list,default:no/auto,CodeIfEnabled)
m4_define([BFG_DRIVER],[
_BFG_AUTOITEM([driver],[$1],[$2],[$3],$dd[$4],[$5])
])
AC_CHECK_DECL([HASH_ITER],[
AC_CHECK_DECL([DL_CONCAT],[
true
],[
AC_MSG_ERROR([Could not find DL_FOREACH_SAFE - install uthash-dev 1.9.4+])
],[
#include <utlist.h>
])
],[
AC_MSG_ERROR([Could not find HASH_ITER - please install uthash-dev 1.9.4+])
],[
#include <uthash.h>
])
ddyes=yes
ddauto=auto
ddno=no
AC_ARG_ENABLE([other-drivers],
[AC_HELP_STRING([--disable-other-drivers],[Build without drivers by default unless explicitly enabled])],
[
if test x$enableval = xyes; then
ddno=yes
else
ddyes=no
ddauto=no
fi
]
)
broad_udevrules=false
AC_ARG_ENABLE([broad-udevrules],
[AC_HELP_STRING([--enable-broad-udevrules],[Include udev rules for ambiguous devices which may not be miners])],
[
if test "x$enableval" = "xyes"; then
broad_udevrules=true
fi
]
)
use_udevrules_group=true
udevrules_group="video"
AC_ARG_WITH([udevrules-group],
[AC_HELP_STRING([--with-udevrules-group=groupname],[Configure mining devices to be owned by a specific group (default `video')])],
[
if test "x$withval" = "xno"; then
use_udevrules_group=false
else
udevrules_group="$withval"
fi
]
)
AM_CONDITIONAL([USE_UDEVRULES_GROUP], [$use_udevrules_group])
AC_SUBST([UDEVRULES_GROUP], [$udevrules_group])
BFG_ALGO(SHA512_256d,yes)
BFG_ALGO(Keccak,no)
BFG_ALGO(SHA256d,no)
BFG_ALGO(scrypt,no)
lowl_pci=no
if test "x$ac_cv_header_sys_mman_h" = "xyes"; then
AC_ARG_WITH([uio],
[AC_HELP_STRING([--without-uio],[Compile support for PCI devices via Linux UIO interface (default enabled)])],
[uio=$withval],
[uio=yes])
AC_ARG_WITH([vfio],
[AC_HELP_STRING([--without-vfio],[Compile support for PCI devices via Linux VFIO interface (default enabled)])],
[vfio=$withval],
[vfio=auto])
if test "x$vfio" != "xno"; then
AC_CHECK_HEADER([linux/vfio.h],[
vfio=yes
],[
if test "x$vfio" = "xyes"; then
AC_MSG_ERROR([Unable to find linux/vfio.h])
elif test "x$uio" = "xyes"; then
AC_MSG_WARN([linux/vfio.h not found; PCI device support will require UIO (and root access)])
else
AC_MSG_WARN([linux/vfio.h not found; PCI device support will not be available])
fi
vfio=no
])
fi
if test "x$vfio$uio" != xnono; then
lowl_pci=yes
fi
fi
BFG_DRIVER(cpumining,CPU mining,,no,[
driverlist="$driverlist cpu:asm/has_yasm"
driverlist="$driverlist cpu:sse2/have_sse2"
])
driverlist=`echo "${driverlist}" | ${SED} -e 's/ cpumining/ cpu/'`
BFG_DRIVER(,OpenCL,,no)
m4_define([BFG_PTHREAD_FLAG_CHECK],
AC_MSG_CHECKING([for $1])
for cflag in ' -pthread' ''; do
for lib in ' -lpthread' ' -lwinpthread' ''; do
CFLAGS="${save_CFLAGS}${cflag}"
LIBS="${save_LIBS}${lib}"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
#include <pthread.h>
], [
void *f = $1;
])
], [
found_pthread=true
PTHREAD_FLAGS="${cflag}"
PTHREAD_LIBS="${lib}"
if test "x${cflag}${lib}" = "x"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([with${cflag}${lib}])
fi
$2
break 2
])
done
done
if test "x${found_pthread}" = "xfalse"; then
AC_MSG_RESULT([no])
fi
)
save_CFLAGS="${CFLAGS}"
save_LIBS="${LIBS}"
found_pthread=false
BFG_PTHREAD_FLAG_CHECK([pthread_cancel],[
AC_DEFINE([HAVE_PTHREAD_CANCEL], [1], [Define if you have a native pthread_cancel])
])
if test "x${found_pthread}" = "xfalse"; then
BFG_PTHREAD_FLAG_CHECK([pthread_create])
if test "x${found_pthread}" = "xfalse"; then
AC_MSG_ERROR([Could not find pthread library - please install libpthread])
fi
fi
# check for nanosleep here, since it is provided by winpthread
AC_CHECK_FUNCS([nanosleep])
CFLAGS="${save_CFLAGS}"
LIBS="${save_LIBS}"
PKG_CHECK_MODULES([JANSSON],[jansson],[
true
],[
AC_MSG_CHECKING([for jansson in system-default locations])
LIBS="$LIBS -ljansson"
AC_TRY_LINK([
#include <jansson.h>
],[
json_object();
],[
AC_MSG_RESULT([found])
JANSSON_LIBS=-ljansson
],[
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Could not find jansson library])
])
LIBS="${save_LIBS}"
])
AC_SUBST(JANSSON_CFLAGS)
AC_SUBST(JANSSON_LIBS)
if test "x$USE_OPENCL" = xyes; then
adl="yes"
if test "x$USE_KECCAK" = xyes; then
AC_DEFINE([USE_OPENCL_FULLHEADER],[1],[Defined to 1 if OpenCL fullheader kernel interface is wanted])
fi
driverlist="$driverlist opencl:sensors/with_sensors"
AC_ARG_WITH([sensors],
[AC_HELP_STRING([--without-sensors],[Build with libsensors monitoring (default enabled)])],
[true],[with_sensors=auto])
if test "x$USE_OPENCL" != xyes; then
with_sensors=no
fi
if test "x$with_sensors" != xno; then
AC_MSG_CHECKING([for libsensors])
save_LIBS="${LIBS}"
LIBS="$LIBS -lsensors"
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <stddef.h>
#include <sensors/sensors.h>
],[
const sensors_chip_name *cn;
cn = sensors_get_detected_chips(NULL, NULL);
])],[
with_sensors=yes
sensors_LIBS="-lsensors"
AC_DEFINE([HAVE_SENSORS], [1], [Defined if libsensors was found])
AC_MSG_RESULT([yes])
],[
with_sensors=no
AC_MSG_RESULT([no])
if ! $have_win32; then
with_sensors_enableaction="install libsensors"
fi
])
LIBS="$save_LIBS"
fi
AC_SUBST(sensors_LIBS)
driverlist="$driverlist opencl:adl/adl"
AC_ARG_ENABLE([adl],
[AC_HELP_STRING([--disable-adl],[Build without ADL monitoring (default enabled)])],
[adl=$enableval]
)
if test x$adl = xyes
then
AC_DEFINE([HAVE_ADL], [1], [Defined if ADL headers were found])
fi
else
adl="no"
fi
BFG_DRIVER(,AlcheMist,scrypt,no,[
need_lowl_vcom=yes
has_asic=yes
])
BFG_DRIVER(,BitForce,SHA256d,auto,[
driverlist="$driverlist bitforce:pci/need_lowl_pci"
if test "x$lowl_pci" = "xyes"; then
need_lowl_pci=yes
fi
need_lowl_vcom=yes
driverlist="$driverlist bitforce:mswin/need_lowl_mswin"
if test x$have_win32 = xtrue; then
need_lowl_mswin=yes
fi
has_fpga=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(bitmain,Bitmain Antminer S* series,SHA256d,no,[
need_lowl_vcom=yes
has_asic=yes
])
BFG_DRIVER(,Icarus,SHA256d,auto,[
need_dynclock=yes
need_lowl_vcom=yes
has_fpga=yes
has_asic=yes
have_udevrules=true
])
driverlist="$driverlist cairnsmore/USE_ICARUS erupter/USE_ICARUS antminer/USE_ICARUS compac/USE_ICARUS"
BFG_DRIVER(,DualMiner,Icarus,auto,[
need_gc3355=yes
$broad_udevrules && have_udevrules=true
])
BFG_DRIVER(,ZeusMiner,scrypt Icarus,auto,[
need_lowl_vcom=yes
has_asic=yes
$broad_udevrules && have_udevrules=true
])
BFG_DRIVER(,GridSeed,scrypt,auto,[
need_gc3355=yes
need_lowl_vcom=yes
has_asic=yes
$broad_udevrules && have_udevrules=true
])
BFG_DRIVER(,Avalon,SHA256d,auto,[
need_lowl_vcom=yes
has_asic=yes
$broad_udevrules && have_udevrules=true
])
BFG_DRIVER(avalonmm,Avalon2/3,SHA256d,auto,[
need_lowl_vcom=yes
need_work2d=yes
has_asic=yes
$broad_udevrules && have_udevrules=true
])
BFG_DRIVER(,KnC,SHA256d,no,[
need_linux_i2c_dev=yes
need_lowl_spi=yes
])
BFG_DRIVER(kncasic,KnC gen 2,SHA256d,no,[
kncasic_controller="$kncasic_opt"
if test "x$kncasic_opt" = "x"; then
kncasic_controller=BBB
fi
need_knc_asic=yes
AC_DEFINE_UNQUOTED([CONTROLLER_BOARD_$kncasic_controller],[1])
])
AC_ARG_WITH([libmicrohttpd],
[AC_HELP_STRING([--without-libmicrohttpd],[Compile support for libmicrohttpd getwork server (default enabled)])],
[httpsrv=$withval],
[httpsrv=$ddauto]
)
if test "x$httpsrv" != "xno"; then
PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >= 0.9.5],[
AC_DEFINE([USE_LIBMICROHTTPD],[1],[Defined to 1 if libmicrohttpd support is wanted])
httpsrv=yes
],[
httpsrv=no
httpsrv_enableaction="install libmicrohttpd 0.9.5+"
need_bfg_driver_proxy_enableaction="install libmicrohttpd 0.9.5+"
if test "x$httpsrv" = "xyes"; then
AC_MSG_ERROR([Unable to find libmicrohttpd 0.9.5+])
else
AC_MSG_WARN([libmicrohttpd 0.9.5+ not found; getwork proxy will be unavailable])
fi
])
fi
AM_CONDITIONAL([USE_LIBMICROHTTPD], [test x$httpsrv = xyes])
AC_ARG_WITH([libevent],
[AC_HELP_STRING([--without-libevent],[Compile support for libevent stratum server (default enabled)])],
[libevent=$withval],
[libevent=$ddauto]
)
if test "x$libevent" != "xno"; then
PKG_CHECK_MODULES([libevent],[libevent >= 2.0.3],[
PKG_CHECK_MODULES([libevent_pthreads],[libevent_pthreads],[
libevent_CFLAGS="${libevent_CFLAGS} ${libevent_pthreads_CFLAGS}"
libevent_LIBS="${libevent_LIBS} ${libevent_pthreads_LIBS}"
],[true])
AC_MSG_CHECKING([if libevent supports threading])
BFG_PREPROC_IFELSE([EVTHREAD_USE_PTHREADS_IMPLEMENTED || EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED],[event2/thread.h],[
AC_MSG_RESULT([yes])
have_libevent=yes
],[
AC_MSG_RESULT([no])
])
])
if test "x$have_libevent" = "xyes"; then
libevent=yes
need_work2d=yes
AC_DEFINE([USE_LIBEVENT],[1],[Defined to 1 if libevent support is wanted])
else
libevent_enableaction="install libevent 2.0.3+"
if test -n "$need_bfg_driver_proxy_enableaction"; then
need_bfg_driver_proxy_enableaction="${need_bfg_driver_proxy_enableaction} (getwork) or libevent 2.0.3+ (stratum)"
else
need_bfg_driver_proxy_enableaction="install libevent 2.0.3+"
fi
if test "x$libevent" = "xyes"; then
AC_MSG_ERROR([Unable to find libevent 2.0.3+])
else
AC_MSG_WARN([libevent 2.0.3+ not found; stratum proxy will be unavailable])
fi
libevent=no
fi
fi
AM_CONDITIONAL([USE_LIBEVENT], [test x$libevent = xyes])
driverlist="$driverlist proxy/need_bfg_driver_proxy"
if test x$libevent$httpsrv = xnono; then
need_bfg_driver_proxy=no
else
need_bfg_driver_proxy=yes
driverlist="$driverlist proxy:getwork/httpsrv proxy:stratum/libevent"
fi
AM_CONDITIONAL([NEED_BFG_DRIVER_PROXY], [test x$libevent$httpsrv != xnono])
BFG_DRIVER(,ModMiner,SHA256d,auto,[
need_dynclock=yes
need_lowl_vcom=yes
need_binloader=yes
has_fpga=yes
have_udevrules=true
])
PKG_PROG_PKG_CONFIG()
label_LIBUSB=libusb
USE_LIBUSB=no
libusb_include_path=""
AC_ARG_WITH([libusb],
[AC_HELP_STRING([--without-libusb],[Compile using libusb (default enabled)])],
[want_libusb=$withval],
[want_libusb=auto]
)
if test "x$want_libusb" != "xno"; then
howto_LIBUSB="install libusb 1.0+"
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],[
USE_LIBUSB=yes
],[
for usb_lib in usb-1.0 usb; do
AC_CHECK_LIB($usb_lib, libusb_init, [
USE_LIBUSB=yes
break
])
done
if test "x$USE_LIBUSB" = xyes; then
AC_CHECK_DECL([libusb_init],[
LIBUSB_LIBS="-l$usb_lib"
],[
BFG_FIND_INCLUDE_PATH([libusb-1.0],[libusb.h],[
LIBUSB_LIBS="-l$usb_lib"
LIBUSB_CFLAGS="-I${inclpath_libusb_h}"
],[
USE_LIBUSB=no
])
],[#include <libusb.h>])
fi
])
fi
BFG_DRIVER(,CoinTerra,SHA256d libusb,auto,[
need_lowl_usb=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(,Klondike,SHA256d libusb,auto,[
need_lowl_usb=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(titan,KnC Titan,scrypt,no,[
if test "x$titan_opt" = "x"; then
if test "x$USE_KNCASIC" = "xyes"; then
titan_controller="$kncasic_controller"
else
titan_controller=RPI
fi
else
titan_controller=$titan_opt
if test "x$USE_KNCASIC" = "xyes"; then
if test "x$kncasic_controller" != "$titan_controller"; then
AC_MSG_ERROR([Can only build kncasic and titan drivers together for the same controller (kncasic=$kncasic_controller vs titan=$titan_controller)])
fi
fi
fi
need_knc_asic=yes
AC_DEFINE_UNQUOTED([CONTROLLER_BOARD_$titan_controller],[1])
AH_TEMPLATE([CONTROLLER_BOARD_BACKPLANE])
AH_TEMPLATE([CONTROLLER_BOARD_BBB])
AH_TEMPLATE([CONTROLLER_BOARD_RPI])
])
BFG_DRIVER(,X6500,SHA256d libusb,auto,[
need_dynclock=yes
need_lowl_ftdi=yes
need_binloader=yes
has_fpga=yes
have_udevrules=true
])
BFG_DRIVER(,ZTEX,SHA256d libusb,auto,[
need_dynclock=yes
need_lowl_usb=yes
need_binloader=yes
has_fpga=yes
have_udevrules=true
])
BFG_DRIVER(bifury,Bi*Fury,SHA256d,auto,[
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(,Bitfury,SHA256d,auto,[
need_lowl_spi=yes
])
BFG_DRIVER(,BFSB,SHA256d Bitfury,no)
BFG_DRIVER(bigpic,Big Picture Mining USB,SHA256d Bitfury,auto,[
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(bfx,BFx2,SHA256d libusb Bitfury,auto,[
need_lowl_ftdi=yes
has_asic=yes
$broad_udevrules && have_udevrules=true
])
BFG_DRIVER(,DrillBit,SHA256d Bitfury,auto,[
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(,Twinfury,SHA256d Bitfury,auto,[
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(,LittleFury,SHA256d Bitfury,auto,[
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
])
label_HIDAPI=hidapi
howto_HIDAPI="install hidapi"
USE_HIDAPI=no
for _hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
PKG_CHECK_MODULES([hidapi],[$_hidapi_lib],[
USE_HIDAPI=yes
break
],[
true
])
done
BFG_DRIVER(,NanoFury,SHA256d hidapi Bitfury,auto,[
need_lowl_hid=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(hashbuster,HashBuster Nano,SHA256d hidapi Bitfury,auto,[
need_lowl_hid=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(hashbusterusb,HashBuster Micro,SHA256d libusb Bitfury,auto,[
need_lowl_usb=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(,HashFast,SHA256d,auto,[
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
])
BFG_DRIVER(,JingTian,SHA256d,no,[
need_lowl_spi=yes
has_asic=yes
])
BFG_DRIVER(,Metabank,SHA256d Bitfury,no)
BFG_DRIVER(minergate,Spondoolies minergate interface,SHA256d,no,[
need_lowlevel=yes
has_asic=yes
])
BFG_DRIVER(,Minion,SHA256d,no,[
need_lowl_spi=yes
has_asic=yes
])
BFG_DRIVER(,RockMiner,SHA256d,auto,[
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
])
if test "x$need_lowl_vcom" != "xno"; then
# Lowlevel VCOM doesn't need libusb, but it can take advantage of it to reattach drivers
if test "x$USE_LIBUSB" != xno; then
need_lowl_usb=yes
elif test "x$USE_LIBUSB$want_libusb" = xnoyes; then
AC_MSG_ERROR([Could not find libusb, which you specifically requested])
fi
fi
lowllist="$lowllist ftdi/need_lowl_ftdi"
if test x$need_lowl_ftdi = xyes; then
AC_DEFINE([NEED_BFG_LOWL_FTDI], [1], [Defined to 1 if lowlevel ftdi drivers are being used])
need_lowl_usb=yes
fi
lowllist="$lowllist spi/need_lowl_spi"
if test x$need_lowl_spi = xyes; then
AC_DEFINE([NEED_BFG_LOWL_SPI], [1], [Defined to 1 if lowlevel SPI drivers are being used])
fi
if test "x$need_lowl_usb" = "xno"; then
USE_LIBUSB=no
LIBUSB_LIBS=''
LIBUSB_CFLAGS=''
fi
if test "x$USE_LIBUSB" = xyes; then
AC_DEFINE([HAVE_LIBUSB], [1], [Define if you have libusb-1.0])
save_CFLAGS="$CFLAGS"
CFLAGS="$LIBUSB_CFLAGS $CFLAGS"
AC_CHECK_DECLS([libusb_error_name],[true],[true],[#include <libusb.h>])
CFLAGS="$save_CFLAGS"
fi
if test x$need_lowl_vcom = xyes; then
AC_DEFINE([NEED_BFG_LOWL_VCOM], [1], [Defined to 1 if lowlevel VCOM drivers are being used])
need_lowlevel=yes
if $have_win32; then
echo '#include <iospeeds.h>' >iospeeds_local.h
found_ddkusb=false
AC_CHECK_HEADER([usbiodef.h],[
found_ddkusb=true
],[
BFG_FIND_INCLUDE_PATH([ddk],[usbiodef.h],[
found_ddkusb=true
AUTOSCAN_CPPFLAGS="-I${inclpath_usbiodef_h}"
],[],[
#include <windows.h>
#include <ddk/usbioctl.h>
AC_INCLUDES_DEFAULT
])
],[
#include <windows.h>
#include <usbioctl.h>
AC_INCLUDES_DEFAULT
])
if $found_ddkusb; then
AUTOSCAN_LIBS="-lsetupapi"
AC_DEFINE([HAVE_WIN_DDKUSB],[1],[Defined to 1 if Windows DDK USB headers are being used])
fi
else
AC_MSG_CHECKING([what baud rates your system supports])
echo '#include <termios.h>' | ${CPP} -dM - 2>/dev/null | ${SED} 's/.*[ ]B\([0-9][0-9]*\)[ ].*/IOSPEED(\1)/' | grep IOSPEED >iospeeds_local.h
if grep -q IOSPEED iospeeds_local.h; then
AC_MSG_RESULT([done])
else
AC_MSG_RESULT([failed, using standard POSIX])
echo '#include <iospeeds_posix.h>' >iospeeds_local.h
fi
fi
fi
if test "x$USE_OPENCL$need_lowl_hid" = xnono; then
DLOPEN_FLAGS=""
fi
lowllist="$lowllist hid/need_lowl_hid"
if test x$need_lowl_hid = xyes; then
AC_DEFINE([NEED_BFG_LOWL_HID], [1], [Defined to 1 if lowlevel hid drivers are being used])
need_lowlevel=yes
fi
lowllist="$lowllist mswin/need_lowl_mswin"
if test x$need_lowl_mswin = xyes; then
AC_DEFINE([NEED_BFG_LOWL_MSWIN], [1], [Defined to 1 if lowlevel mswin drivers are being used])
need_lowlevel=yes
fi
lowllist="$lowllist pci/need_lowl_pci"
if test x$need_lowl_pci = xyes; then
AC_DEFINE([NEED_BFG_LOWL_PCI], [1], [Defined to 1 if lowlevel PCI drivers are being used])
need_lowlevel=yes
lowllist="$lowllist pci:uio/uio"