/
configure.ac
131 lines (106 loc) · 3.38 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
AC_INIT([main.c])
AC_PROG_CC
AC_LANG_C
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_HEADER_STDC
AC_SYS_LARGEFILE
AC_ARG_ENABLE(xattr, [ --enable-xattr enable extended file attributes support], cf_enable_xattr=$enableval )
if test "$cf_enable_xattr" = "yes"
then
AC_CHECK_HEADER([sys/extattr.h],[cf_extended_attribs=extattr],[])
AC_CHECK_HEADER([sys/xattr.h],[cf_extended_attribs=xattr],[])
fi
if test "$cf_extended_attribs" = "extattr"
then
AC_DEFINE([USE_EXTATTR], [1])
elif test "$cf_extended_attribs" = "xattr"
then
AC_CHECK_LIB(c,getxattr,,)
cf_have_getxattr=$ac_cv_lib_c_getxattr
if test "$cf_have_getxattr" = "yes"
then
AC_DEFINE([USE_XATTR], [1])
fi
fi
AC_ARG_ENABLE(ssl, [ --enable-ssl use Secure Sockets Layer], cf_use_ssl=$enableval, cf_use_ssl=yes )
if test "$cf_use_ssl" = "yes"
then
AC_CHECK_HEADER([openssl/crypto.h], cf_have_crypto_h="Y")
AC_CHECK_HEADER([openssl/ssl.h], cf_have_ssl_h="Y")
if test "$cf_have_crypto_h" = "Y" -a "$cf_have_ssl_h" = "Y"
then
AC_CHECK_LIB(crypto,EVP_CIPHER_CTX_init,,)
cf_have_libcrypto=$ac_cv_lib_crypto_EVP_CIPHER_CTX_init
dnl New versions of openssl seem to lack EVP_CIPHER_CTX_init, so let's look for another function. I've no idea what's going on with openssl, this is why I use libressl instead.
if test "$cf_have_libcrypto" != "yes"
then
AC_CHECK_LIB(crypto,EVP_CIPHER_CTX_new)
cf_have_libcrypto=$ac_cv_lib_crypto_EVP_CIPHER_CTX_new
fi
AC_CHECK_LIB(ssl,SSL_library_init,,)
cf_have_libssl=$ac_cv_lib_ssl_SSL_library_init
dnl New versions of openssl seem to lack SSL_library_init, so let's look for another function. I've no idea what's going on with openssl, this is why I use libressl instead.
if test "$cf_have_libssl" != "yes"
then
AC_CHECK_LIB(ssl,OPENSSL_init_ssl)
cf_have_libssl=$ac_cv_lib_ssl_OPENSSL_init_ssl
fi
fi
fi
AC_ARG_WITH(system-libuseful, [ --with-system-libuseful use systemwide libUseful.so rather than bundled version], cf_with_libuseful=$withval )
if test "$cf_with_libuseful" != "no" -a "$cf_with_libuseful" != ""
then
AC_CHECK_LIB(Useful,[GetToken])
AC_CHECK_LIB(Useful,[TOTP])
fi
if test "$ac_cv_lib_Useful_GetToken" == "yes" -a "$ac_cv_lib_Useful_TOTP" == "yes"
then
echo "Found suitable installed libUseful."
AC_CHECK_LIB([Useful],[OpenSSLVerifyCallback],
[AC_CHECK_LIB([ssl],[SSL_new],,,[-lcrypto -lz])]
[AC_CHECK_LIB([crypto],[ERR_load_CRYPTO_strings],,,[-lz])]
[AC_CHECK_LIB([z],[inflate])]
,,[-lssl -lcrypto -lz])
LUSEFUL="system"
else
if test "$ac_cv_lib_Useful_GetToken" == "yes"
then
echo "Installed libUseful too old, lacks base32 and TOTP functions. Using bundled libUseful."
else
echo "No installed libUseful found, using bundled version."
fi
LUSEFUL="bundled"
STATIC_LIBS="libUseful-5/libUseful.a"
AC_SUBST(STATIC_LIBS)
AC_CONFIG_SUBDIRS([libUseful-5])
fi
echo
echo
echo "############# Hashrat Build Config: #############"
echo "Using $LUSEFUL libUseful"
if test "$ac_cv_sys_file_offset_bits" = "64"
then
echo "Largefiles ( > 2GB ) enabled"
else
echo "Largefiles ( > 2GB ) NOT enabled"
fi
if test "$cf_extended_attribs" = "xattr"
then
echo "File system attributes (xattr) enabled"
elif test "$cf_extended_attribs" = "extattr"
then
echo "File system attributes (extattr) enabled"
else
echo "File system attributes NOT enabled"
fi
if test "$cf_have_libssl" = "yes"
then
echo "SSL/TLS enabled"
else
echo "SSL/TLS NOT enabled"
fi
echo
echo
dnl read Makefile.in and write Makefile
AC_OUTPUT(Makefile)