forked from luke-jr/bfgminer
-
Notifications
You must be signed in to change notification settings - Fork 10
/
configure.ac
1807 lines (1655 loc) · 51.8 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 2012-2013 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], [4])
m4_define([v_min], [4])
m4_define([v_mic], [0])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
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([bfgminer], [v_ver], [[email protected]])
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 <winsock2.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
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([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=SHA256d
optlist=
has_fpga=no
has_asic=no
need_binloader=no
need_dynclock=no
need_gc3355=no
need_lowl_vcom=no
need_lowlevel=no
need_lowl_ftdi=no
need_lowl_hid=no
need_lowl_pci=no
need_lowl_spi=no
need_lowl_usb=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])
)
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
]
)
algolist="$algolist scrypt"
AC_ARG_ENABLE([scrypt],
[AC_HELP_STRING([--enable-scrypt],[Compile support for scrypt mining (default disabled)])],
[scrypt=$enableval],
[scrypt=no])
if test "x$scrypt" = xyes; then
AC_DEFINE([USE_SCRYPT], [1], [Defined to 1 if scrypt support is wanted])
fi
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=$ddyes])
AC_ARG_WITH([vfio],
[AC_HELP_STRING([--without-vfio],[Compile support for PCI devices via Linux VFIO interface (default enabled)])],
[vfio=$enableval],
[vfio=$ddauto])
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
driverlist="$driverlist cpu/cpumining"
AC_ARG_ENABLE([cpumining],
[AC_HELP_STRING([--enable-cpumining],[Build with CPU mining support (default disabled)])],
[cpumining=$enableval],
[cpumining=$ddno]
)
if test "x$cpumining" = xyes; then
AC_DEFINE_UNQUOTED([WANT_CPUMINE], [1], [Enable CPUMINING])
driverlist="$driverlist cpu:asm/has_yasm"
driverlist="$driverlist cpu:sse2/have_sse2"
fi
AM_CONDITIONAL([HAS_CPUMINE], [test x$cpumining = xyes])
driverlist="$driverlist opencl"
AC_ARG_ENABLE([opencl],
[AC_HELP_STRING([--enable-opencl],[Compile support for OpenCL (default disabled)])],
[opencl=$enableval],
[opencl=$ddno]
)
if test "x$opencl" = xyes; then
AC_DEFINE([HAVE_OPENCL], [1], [Defined to 1 if OpenCL support is wanted])
fi
AM_CONDITIONAL([HAVE_OPENCL], [test x$opencl = xyes])
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$opencl" = xyes; then
adl="$ddyes"
driverlist="$driverlist opencl:sensors/with_sensors"
AC_ARG_WITH([sensors],
[AC_HELP_STRING([--without-sensors],[Build with libsensors monitoring (default enabled)])],
[true],[with_sensors=$ddauto])
if test "x$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
driverlist="$driverlist bitforce"
AC_ARG_ENABLE([bitforce],
[AC_HELP_STRING([--disable-bitforce],[Compile support for BitForce (default enabled)])],
[bitforce=$enableval],
[bitforce=$ddyes]
)
if test "x$bitforce" = xyes; then
AC_DEFINE([USE_BITFORCE], [1], [Defined to 1 if BitForce support is wanted])
driverlist="$driverlist bitforce:pci/need_lowl_pci"
if test "x$lowl_pci" = "xyes"; then
need_lowl_pci=yes
fi
need_lowl_vcom=yes
has_fpga=yes
has_asic=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_BITFORCE], [test x$bitforce = xyes])
driverlist="$driverlist icarus cairnsmore/icarus erupter/icarus antminer/icarus"
AC_ARG_ENABLE([icarus],
[AC_HELP_STRING([--disable-icarus],[Compile support for Icarus (default enabled)])],
[icarus=$enableval],
[icarus=$ddyes]
)
if test "x$icarus" = xyes; then
AC_DEFINE([USE_ICARUS], [1], [Defined to 1 if Icarus support is wanted])
need_dynclock=yes
need_lowl_vcom=yes
has_fpga=yes
has_asic=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_ICARUS], [test x$icarus = xyes])
driverlist="$driverlist dualminer"
AC_ARG_ENABLE([dualminer],
[AC_HELP_STRING([--disable-dualminer],[Compile support for DualMiner (default enabled)])],
[dualminer=$enableval],
[dualminer=$ddauto]
)
if test "x$dualminer" = "xno"; then
true
elif test "x$icarus" = "xyes"; then
dualminer=yes
elif test "x$dualminer" = "xyes"; then
AC_MSG_ERROR([You explicitly disabled Icarus and explicitly enabled DualMiner])
else
dualminer=no
fi
if test "x$dualminer" = "xyes"; then
AC_DEFINE([USE_DUALMINER], [1], [Defined to 1 if DualMiner support is wanted])
need_gc3355=yes
fi
AM_CONDITIONAL([USE_DUALMINER], [test x$dualminer = xyes])
driverlist="$driverlist zeusminer"
AC_ARG_ENABLE([zeusminer],
[AC_HELP_STRING([--disable-zeusminer],[Compile support for ZeusMiner (default enabled with scrypt)])],
[zeusminer=$enableval],
[zeusminer=$ddauto])
if test "x$zeusminer" = "xno"; then
true
elif test "x$icarus$scrypt" = "xyesyes"; then
zeusminer=yes
elif test "x$zeusminer" = "xauto"; then
zeusminer=no
elif test "x$scrypt" = "xno"; then
AC_MSG_ERROR([You explicitly enabled ZeusMiner, but did not enable scrypt])
elif test "x$icarus" = "xno"; then
AC_MSG_ERROR([You explicitly disabled Icarus and explicitly enabled ZeusMiner])
fi
if test "x$zeusminer" = "xyes"; then
AC_DEFINE([USE_ZEUSMINER], [1], [Defined to 1 if ZeusMiner support is wanted])
has_asic=yes
fi
AM_CONDITIONAL([USE_ZEUSMINER], [test x$zeusminer = xyes])
driverlist="$driverlist gridseed"
AC_ARG_ENABLE([gridseed],
[AC_HELP_STRING([--disable-gridseed],[Compile support for GridSeed (default enabled with scrypt)])],
[gridseed=$enableval],
[gridseed=$scrypt])
if test "x$gridseed" = "xyes"; then
if test "x$scrypt" = "xno"; then
AC_MSG_ERROR([You explicitly enabled GridSeed, but did not enable scrypt (SHA2 not supported)])
fi
AC_DEFINE([USE_GRIDSEED], [1], [Defined to 1 if GridSeed support is wanted])
need_gc3355=yes
need_lowl_vcom=yes
has_asic=yes
fi
AM_CONDITIONAL([USE_GRIDSEED], [test x$gridseed = xyes])
driverlist="$driverlist avalon"
avalon="no"
AC_ARG_ENABLE([avalon],
[AC_HELP_STRING([--disable-avalon],[Compile support for Avalon (default enabled)])],
[avalon=$enableval],
[avalon=$ddyes]
)
if test "x$avalon" = xyes; then
AC_DEFINE([USE_AVALON], [1], [Defined to 1 if Avalon support is wanted])
need_lowl_vcom=yes
has_asic=yes
fi
AM_CONDITIONAL([HAS_AVALON], [test x$avalon = xyes])
driverlist="$driverlist knc"
AC_ARG_ENABLE([knc],
[AC_HELP_STRING([--enable-knc],[Compile support for KnC (default disabled)])],
[knc=$enableval],
[knc=$ddno]
)
if test "x$knc" = xyes; then
AC_CHECK_HEADERS([linux/i2c-dev-user.h])
AC_CHECK_DECL([i2c_smbus_read_word_data],[true],[
AC_MSG_ERROR([linux/i2c-dev.h header from i2c-tools (NOT linux headers) is required for knc driver])
],[
#include <stddef.h>
#ifdef HAVE_LINUX_I2C_DEV_USER_H
#include <linux/i2c-dev-user.h>
#else
#ifdef NEED_LINUX_I2C_H
#include <linux/i2c.h>
#endif
#include <linux/i2c-dev.h>
#endif
])
AC_DEFINE([USE_KNC], [1], [Defined to 1 if KnC support is wanted])
need_lowl_spi=yes
fi
AM_CONDITIONAL([USE_KNC], [test x$knc = xyes])
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],[
AC_DEFINE([USE_LIBEVENT],[1],[Defined to 1 if libevent support is wanted])
libevent=yes
],[
libevent=no
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
])
if test "x$libevent" = "xyes"; then
need_work2d=yes
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])
driverlist="$driverlist modminer"
AC_ARG_ENABLE([modminer],
[AC_HELP_STRING([--disable-modminer],[Compile support for ModMiner (default enabled)])],
[modminer=$enableval],
[modminer=$ddyes]
)
if test "x$modminer" = xyes; then
AC_DEFINE([USE_MODMINER], [1], [Defined to 1 if ModMiner support is wanted])
need_dynclock=yes
need_lowl_vcom=yes
need_binloader=yes
has_fpga=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_MODMINER], [test x$modminer = xyes])
PKG_PROG_PKG_CONFIG()
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
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],[
libusb=yes
],[
for usb_lib in usb-1.0 usb; do
AC_CHECK_LIB($usb_lib, libusb_init, [
libusb=yes
break
])
done
if test "x$libusb" = xyes; then
AC_CHECK_DECL([libusb_init],[
LIBUSB_LIBS="-l$usb_lib"
],[
AC_MSG_CHECKING([whether libusb_init is declared in subdirectory])
libusb_include_path=`echo '#include <libusb-1.0/libusb.h>' | ${CPP} -M - 2>/dev/null | sed -E -e 's/^[^:]+:[[:space:]]*(([^[:space:]]|\\\\[[:space:]])*)libusb\\.h([[:space:]].*|$)$/\\1/' -e 't my' -e d -e ': my' -e 's/\\\\?([\\\\[:space:]])/\\\\\\1/g'`
if test "x$libusb_include_path" != "x"; then
LIBUSB_LIBS="-l$usb_lib"
LIBUSB_CFLAGS="-I$libusb_include_path"
AC_MSG_RESULT([yes])
else
libusb=no
AC_MSG_RESULT([no])
fi
],[#include <libusb.h>])
fi
])
fi
driverlist="$driverlist klondike hashbusteravalon/klondike"
AC_ARG_ENABLE([klondike],
[AC_HELP_STRING([--disable-klondike],[Compile support for Klondike (default enabled)])],
[klondike=$enableval],
[klondike=$ddauto]
)
if test "x$klondike$want_libusb" = xyesno; then
AC_MSG_ERROR([You disabled libusb, required for Klondike support])
elif test "x$klondike$libusb" = xyesno; then
AC_MSG_ERROR([Could not find libusb, required for Klondike support])
elif test "x$klondike" = xauto; then
klondike="$libusb"
if test "x$libusb" = xno; then
AC_MSG_WARN([Could not find libusb, required for Klondike support])
klondike_enableaction="install libusb 1.0+"
fi
fi
if test "x$klondike" = xyes; then
AC_DEFINE([USE_KLONDIKE], [1], [Defined to 1 if Klondike support is wanted])
need_lowl_usb=yes
has_asic=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_KLONDIKE], [test x$klondike = xyes])
driverlist="$driverlist x6500"
AC_ARG_ENABLE([x6500],
[AC_HELP_STRING([--disable-x6500],[Compile support for X6500 (default if libusb)])],
[x6500=$enableval],
[x6500=$ddauto]
)
if test "x$x6500$want_libusb" = xyesno; then
AC_MSG_ERROR([You disabled libusb, required for X6500 support])
elif test "x$x6500$libusb" = xyesno; then
AC_MSG_ERROR([Could not find libusb, required for X6500 support])
elif test "x$x6500" = xauto; then
x6500="$libusb"
if test "x$libusb" = xno; then
AC_MSG_WARN([Could not find libusb, required for X6500 support])
x6500_enableaction="install libusb 1.0+"
fi
fi
if test "x$x6500" = xyes; then
AC_DEFINE([USE_X6500], [1], [Defined to 1 if X6500 support is wanted])
need_dynclock=yes
need_lowl_ftdi=yes
need_binloader=yes
has_fpga=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_X6500], [test x$x6500 = xyes])
driverlist="$driverlist ztex"
AC_ARG_ENABLE([ztex],
[AC_HELP_STRING([--disable-ztex],[Compile support for ZTEX (default if libusb)])],
[ztex=$enableval],
[ztex=$ddauto]
)
if test "x$ztex$want_libusb" = xyesno; then
AC_MSG_ERROR([You disabled libusb, required for ZTEX support])
elif test "x$ztex$libusb" = xyesno; then
AC_MSG_ERROR([Could not find libusb, required for ZTEX support])
elif test "x$ztex" = xauto; then
ztex="$libusb"
if test "x$libusb" = xno; then
AC_MSG_WARN([Could not find libusb, required for ZTEX support])
ztex_enableaction="install libusb 1.0+"
fi
fi
if test "x$ztex" = xyes; then
AC_DEFINE([USE_ZTEX], [1], [Defined to 1 if ZTEX support is wanted])
need_dynclock=yes
need_lowl_usb=yes
need_binloader=yes
has_fpga=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_ZTEX], [test x$ztex = xyes])
driverlist="$driverlist bifury"
AC_ARG_ENABLE([bifury],
[AC_HELP_STRING([--disable-bifury],[Compile support for Bi*Fury (default enabled)])],
[bifury=$enableval],
[bifury=$ddyes]
)
if test "x$bifury" = "xyes"; then
AC_DEFINE([USE_BIFURY], [1], [Defined to 1 if Bi*Fury support is wanted])
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
fi
AM_CONDITIONAL([USE_BIFURY], [test x$bifury = xyes])
driverlist="$driverlist bitfury_gpio/bitfury"
AC_ARG_ENABLE([bitfury],
[AC_HELP_STRING([--disable-bitfury],[Compile support for Bitfury (default enabled)])],
[bitfury=$enableval],
[bitfury=$ddyes]
)
if test "x$bitfury" = xyes; then
AC_DEFINE([USE_BITFURY], [1], [Defined to 1 if Bitfury support is wanted])
need_lowl_spi=yes
fi
AM_CONDITIONAL([HAS_BITFURY], [test x$bitfury = xyes])
driverlist="$driverlist bfsb"
AC_ARG_ENABLE([bfsb],
[AC_HELP_STRING([--enable-bfsb],[Compile support for BFSB (default disabled)])],
[bfsb=$enableval],
[bfsb=$ddno]
)
if test "x$bfsb" = "xyes"; then
if test "x$bitfury" = "xno"; then
AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled BFSB])
fi
AC_DEFINE([USE_BFSB], [1], [Defined to 1 if BFSB support is wanted])
fi
AM_CONDITIONAL([HAS_BFSB], [test x$bfsb = xyes])
driverlist="$driverlist bigpic"
AC_ARG_ENABLE([bigpic],
[AC_HELP_STRING([--disable-bigpic],[Compile support for Big Picture Mining USB (default enabled)])],
[bigpic=$enableval],
[bigpic=$ddauto]
)
if test "x$bigpic" = "xno"; then
true
elif test "x$bitfury" = "xyes"; then
bigpic=yes
elif test "x$bigpic" = "xyes"; then
AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled BigPic])
else
bigpic=no
fi
if test "x$bigpic" = "xyes"; then
AC_DEFINE([USE_BIGPIC], [1], [Defined to 1 if Big Picture Mining USB support is wanted])
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_BIGPIC], [test x$bigpic = xyes])
driverlist="$driverlist bfx"
AC_ARG_ENABLE([bfx],
[AC_HELP_STRING([--disable-bfx],[Compile support for BFx2 (default if libusb)])],
[bfx=$enableval],
[bfx=$ddauto]
)
if test "x$bfx" = "xno"; then
true
elif test "x$bitfury$libusb" = "xyesyes"; then
bfx=yes
elif test "x$bfx" = "xyes"; then
if test "x$want_libusb" = "xno"; then
AC_MSG_ERROR([You disabled libusb, required for BFx2 support])
elif test "x$libusb" = "xno"; then
AC_MSG_ERROR([Could not find libusb, required for BFx2 support])
else
AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled BFx2])
fi
elif test "x$bfx" = "xauto"; then
bfx="$libusb"
if test "x$libusb" = xno; then
AC_MSG_WARN([Could not find libusb, required for BFx2 support])
bfx_enableaction="install libusb 1.0+"
fi
fi
if test "x$bfx" = xyes; then
AC_DEFINE([USE_BFX], [1], [Defined to 1 if BFx2 support is wanted])
need_lowl_ftdi=yes
has_asic=yes
fi
AM_CONDITIONAL([USE_BFX], [test x$bfx = xyes])
driverlist="$driverlist drillbit"
AC_ARG_ENABLE([drillbit],
[AC_HELP_STRING([--disable-drillbit],[Compile support for DrillBit (default enabled)])],
[drillbit=$enableval],
[drillbit=$ddauto]
)
if test "x$drillbit" = "xno"; then
true
elif test "x$bitfury" = "xyes"; then
drillbit=yes
elif test "x$drillbit" = "xyes"; then
AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled DrillBit])
else
drillbit=no
fi
if test "x$drillbit" = "xyes"; then
AC_DEFINE([USE_DRILLBIT], [1], [Defined to 1 if DrillBit support is wanted])
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
fi
AM_CONDITIONAL([USE_DRILLBIT], [test x$drillbit = xyes])
driverlist="$driverlist twinfury"
AC_ARG_ENABLE([twinfury],
[AC_HELP_STRING([--disable-twinfury],[Compile support for Twinfury USB miner (default enabled)])],
[twinfury=$enableval],
[twinfury=$ddauto]
)
if test "x$twinfury" = "xno"; then
true
elif test "x$bitfury" = "xyes"; then
twinfury=yes
elif test "x$twinfury" = "xyes"; then
AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled Twinfury])
else
twinfury=no
fi
if test "x$twinfury" = "xyes"; then
AC_DEFINE([USE_TWINFURY], [1], [Defined to 1 if Twinfury USB miner support is wanted])
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_TWINFURY], [test x$twinfury = xyes])
driverlist="$driverlist littlefury"
AC_ARG_ENABLE([littlefury],
[AC_HELP_STRING([--disable-littlefury],[Compile support for LittleFury (default enabled)])],
[littlefury=$enableval],
[littlefury=$ddauto]
)
if test "x$littlefury" = "xno"; then
true
elif test "x$bitfury" = "xyes"; then
littlefury=yes
elif test "x$littlefury" = "xyes"; then
AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled LittleFury])
else
littlefury=no
fi
if test "x$littlefury" = "xyes"; then
AC_DEFINE([USE_LITTLEFURY], [1], [Defined to 1 if LittleFury support is wanted])
need_lowl_vcom=yes
has_asic=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_LITTLEFURY], [test x$littlefury = xyes])
found_hidapi=false
for _hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
PKG_CHECK_MODULES([hidapi],[$_hidapi_lib],[
found_hidapi=true
break
],[
true
])
done
driverlist="$driverlist nanofury"
AC_ARG_ENABLE([nanofury],
[AC_HELP_STRING([--disable-nanofury],[Compile support for NanoFury (default enabled)])],
[nanofury=$enableval],
[nanofury=$ddauto]
)
if test "x$nanofury" = "xno"; then
true
elif test "x$bitfury" = "xyes"; then
if test x$found_hidapi = xtrue; then
nanofury=yes
else
if test x$nanofury = xauto; then
nanofury=no
nanofury_enableaction="install hidapi"
else
AC_MSG_ERROR([Could not find hidapi, required for NanoFury support])
fi
fi
elif test "x$nanofury" = "xyes"; then
AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled NanoFury])
else
nanofury=no
fi
if test "x$nanofury" = "xyes"; then
AC_DEFINE([USE_NANOFURY], [1], [Defined to 1 if NanoFury support is wanted])
need_lowl_hid=yes
has_asic=yes
have_udevrules=true
fi
AM_CONDITIONAL([HAS_NANOFURY], [test x$nanofury = xyes])
driverlist="$driverlist hashbuster"
AC_ARG_ENABLE([hashbuster],
[AC_HELP_STRING([--disable-hashbuster],[Compile support for HashBuster Nano (default enabled)])],
[hashbuster=$enableval],
[hashbuster=$ddauto],
)
if test "x$hashbuster" = "xno"; then
true
elif test "x$bitfury" = "xyes"; then
if test x$found_hidapi = xtrue; then
hashbuster=yes
else
if test x$hashbuster = xauto; then
hashbuster=no
hashbuster_enableaction="install hidapi"
else
AC_MSG_ERROR([Could not find hidapi, required for HashBuster Nano support])
fi
fi
elif test "x$hashbuster" = "xyes"; then
AC_MSG_ERROR([You explicitly disabled Bitfury and explicitly enabled HashBuster Nano])
else
hashbuster=no
fi
if test "x$hashbuster" = "xyes"; then
AC_DEFINE([USE_HASHBUSTER], [1], [Defined to 1 if HashBuster Nano support is wanted])
need_lowl_hid=yes