step1.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. echo -e "\e[93mWin32 Cross-compiler Builder v1.0:\e[0m"
  3. sudo apt-get update
  4. sudo apt-get upgrade -y
  5. sudo apt-get install -y lzip build-essential git autoconf autopoint bison flex gperf libtool libtool-bin python ruby scons unzip intltool p7zip-full libgtk2.0-dev libssl-dev -y
  6. sudo apt-get install -y lftp zip pv pixz upx
  7. sudo apt-get install -y samba
  8. cat <<'EOF'>> smb.conf
  9. [global]
  10. workgroup = WORKGROUP
  11. server string = %h server (Samba, Ubuntu)
  12. log file = /var/log/samba/log.%m
  13. max log size = 2000
  14. logging = file
  15. panic action = /usr/share/samba/panic-action %d
  16. server role = standalone server
  17. obey pam restrictions = yes
  18. unix password sync = yes
  19. passwd program = /usr/bin/passwd %u
  20. pam password change = yes
  21. map to guest = bad user
  22. usershare allow guests = yes
  23. [Shared]
  24. public = yes
  25. delete readonly = yes
  26. writeable = yes
  27. path = /home/wareck/Bureau/win32_build/
  28. EOF
  29. sudo cp smb.conf /etc/samba/smb.conf
  30. sudo rm smb.conf
  31. sudo /etc/init.d/smbd restart
  32. if [ ! -f /home/wareck/Bureau/win32_build/ ]; then mkdir /home/wareck/Bureau/win32_build/;fi
  33. sudo chmod 777 /home/wareck/Bureau/win32_build/
  34. cd /opt
  35. sudo git clone https://github.com/mxe/mxe.git
  36. cd mxe
  37. sudo git reset --hard 64b283d64891348c92154b8d7eace6a9bff23411
  38. export MXE_DIR=/opt/mxe
  39. export MXE_TARGETS='i686-w64-mingw32.shared'
  40. sudo make -j 2 -C $MXE_DIR MXE_TARGETS="$MXE_TARGETS" curl pthreads pdcurses ncurses jansson libmicrohttpd libzip
  41. if ! grep "export PKG_CONFIG_PATH=/opt/mxe/usr/i686-w64-mingw32.shared/lib/pkgconfig/" ~/.profile >/dev/null
  42. then
  43. echo 'export PATH=/opt/mxe/usr/bin:$PATH' >> ~/.profile
  44. echo 'export PKG_CONFIG_PATH=/opt/mxe/usr/i686-w64-mingw32.shared/lib/pkgconfig/' >> ~/.profile
  45. fi
  46. export PATH=/opt/mxe/usr/bin:$PATH
  47. export PKG_CONFIG_PATH=/opt/mxe/usr/i686-w64-mingw32.shared/lib/pkgconfig/
  48. cd ~
  49. echo ""
  50. echo "Cross compilation environement ok."
  51. echo "Need reboot before step2"