-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathwinbuild-cross.sh
executable file
·85 lines (75 loc) · 2.68 KB
/
winbuild-cross.sh
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
#!/bin/bash
# LOCAL_LIB="$HOME/usr/lib"
LOCAL_LIB="$PWD/depends"
RELEASE=cpuminer-opt-sugarchain-v3.8.8.1.7-w64
# export LDFLAGS="-L$LOCAL_LIB/curl/lib/.libs -L$LOCAL_LIB/gmp/.libs -L$LOCAL_LIB/openssl"
export LDFLAGS="-L$LOCAL_LIB/zlib-1.2.11 -L$LOCAL_LIB/curl-7.47.0/lib/.libs -L$LOCAL_LIB/gmp-6.1.0/.libs -L$LOCAL_LIB/openssl-1.0.2g"
COMMON_PATH="-I$LOCAL_LIB"
GMP_PATH="-I$LOCAL_LIB/gmp"
DLL_PATH="-I$LOCAL_LIB/dll"
# F="--with-curl=$LOCAL_LIB/curl --with-crypto=$LOCAL_LIB/openssl --host=x86_64-w64-mingw32"
F="--with-curl=$LOCAL_LIB/curl-7.47.0 --with-crypto=$LOCAL_LIB/openssl-1.0.2g --host=x86_64-w64-mingw32"
sed -i 's#"-lpthread"#"-lpthreadGC2"#g' configure.ac
YESPOWER="-Wall -O2 -fomit-frame-pointer"
SSE2="-msse2"
mkdir $RELEASE
cp README.txt $RELEASE/
# cp /usr/x86_64-w64-mingw32/lib/zlib1.dll $RELEASE/
cp $LOCAL_LIB/dll/zlib1.dll $RELEASE/
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll $RELEASE/
cp /usr/lib/gcc/x86_64-w64-mingw32/5.3-win32/libstdc++-6.dll $RELEASE/
cp /usr/lib/gcc/x86_64-w64-mingw32/5.3-win32/libgcc_s_seh-1.dll $RELEASE/
cp $LOCAL_LIB/dll/libcrypto-1_1-x64.dll $RELEASE/
cp $LOCAL_LIB/dll/libcurl-4.dll $RELEASE/
cp $LOCAL_LIB/dll/libeay32.dll $RELEASE/
# batch for easy mining
cp $LOCAL_LIB/bat/run*.bat $RELEASE/
make distclean || echo clean
rm -f config.status
./autogen.sh || echo done
# CFLAGS="-O3 -march=core-avx2 -msha -Wall" ./configure $F
CFLAGS="$YESPOWER $SSE2 $COMMON_PATH $GMP_PATH $DLL_PATH" ./configure $F
make -j$(nproc)
strip -s cpuminer.exe
mv cpuminer.exe $RELEASE/cpuminer.exe
# make distclean || echo clean
# rm -f config.status
# ./autogen.sh || echo done
# CFLAGS="-O3 -march=core-avx2 -msha -Wall" ./configure $F
# make -j$(nproc)
# strip -s cpuminer.exe
# mv cpuminer.exe $RELEASE/cpuminer-avx2-sha.exe
#
# make clean || echo clean
# rm -f config.status
# CFLAGS="-O3 -march=core-avx2 -Wall" ./configure $F
# make -j$(nproc)
# strip -s cpuminer.exe
# mv cpuminer.exe $RELEASE/cpuminer-avx2.exe
#
# make clean || echo clean
# rm -f config.status
# CFLAGS="-O3 -march=corei7-avx -Wall" ./configure $F
# make -j$(nproc)
# strip -s cpuminer.exe
# mv cpuminer.exe $RELEASE/cpuminer-avx.exe
#
# # -march=westmere is supported in gcc5
# make clean || echo clean
# rm -f config.status
# CFLAGS="-O3 -march=westmere -Wall" ./configure $F
# #CFLAGS="-O3 -maes -msse4.2 -Wall" ./configure $F
# make -j$(nproc)
# strip -s cpuminer.exe
# mv cpuminer.exe $RELEASE/cpuminer-aes-sse42.exe
#
# make clean || echo clean
# rm -f config.status
# CFLAGS="-O3 -msse2 -Wall" ./configure $F
# make -j$(nproc)
# strip -s cpuminer.exe
# mv cpuminer.exe $RELEASE/cpuminer-sse2.exe
# make clean || echo clean
# RESTORE after build
git checkout -- configure.ac
git checkout -- configure