build_bfgminer.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. echo "Bfgminer Win32 builder:"
  3. echo ""
  4. export folder=$(pwd)
  5. function libraries {
  6. cd ~
  7. pkg-config --libs libevent_pthreads PKG_CONFIG_PATH=/home/wareck/event
  8. rm -r -f temp
  9. mkdir temp
  10. cd temp
  11. wget http://wareck.free.fr/cross_compilation/uthash-2.3.0.tar.gz
  12. wget http://wareck.free.fr/cross_compilation/event.tar.gz
  13. tar xfz uthash-2.3.0.tar.gz
  14. tar xfz event.tar.gz
  15. cd uthash-2.3.0
  16. sudo cp src/* /opt/mxe/usr/i686-w64-mingw32.static/include/
  17. cd ~
  18. }
  19. function compilation {
  20. git clone https://github.com/wareck/bfgminer.git
  21. cd bfgminer
  22. git submodule init
  23. git submodule update
  24. ./autogen.sh
  25. CFLAGS="-O2 -msse2" ./configure --host=i686-w64-mingw32.static libevent_CFLAGS="-I/home/wareck/event/include/" libevent_LIBS="-I/home/wareck/event/lib" --enable-scrypt --without-libevent --prefix=/home/wareck/zob
  26. make
  27. }
  28. function pack {
  29. cd ~/bfgminer
  30. rm -r -f /tmp/bfgminer
  31. mkdir /tmp/bfgminer
  32. cp bfgminer.exe /tmp/bfgminer/
  33. cp $folder/packages/bfgminer/* /tmp/bfgminer/
  34. cd /tmp/
  35. version="5.5.0"
  36. 7z a -tzip bfgminer-win32-$version.zip bfgminer
  37. lftp -u wareck,zorn692611 ftpperso.free.fr <<EOF
  38. put bfgminer-win32-$version.zip -o /crypto/bfgminer-win32-$version.zip
  39. EOF
  40. if ! [ -d /home/$USER/Bureau/win32_build/ ]; then mkdir /home/$USER/Bureau/win32_build ;fi
  41. cp bfgminer-win32-$version.zip /home/$USER/Bureau/win32_build/
  42. cd /tmp
  43. rm -r -f /tmp/bfgminer
  44. }
  45. libraries
  46. compilation
  47. pack