make_environement.sh 1.1 KB

123456789101112131415161718192021222324
  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. cd /opt
  8. sudo git clone -n https://github.com/mxe/mxe.git
  9. cd mxe
  10. sudo git reset --hard 64b283d64891348c92154b8d7eace6a9bff23411
  11. export MXE_DIR=/opt/mxe
  12. export MXE_TARGETS='i686-w64-mingw32.static'
  13. sudo make -j 4 -C $MXE_DIR MXE_TARGETS="$MXE_TARGETS" curl pthreads pdcurses ncurses libusb1 jansson libevent libmicrohttpd libzip
  14. if ! grep "export PKG_CONFIG_PATH=/opt/mxe/usr/i686-w64-mingw32.static/lib/pkgconfig/" ~/.profile >/dev/null
  15. then
  16. echo 'export PATH=/opt/mxe/usr/bin:$PATH' >> ~/.profile
  17. echo 'export PKG_CONFIG_PATH=/opt/mxe/usr/i686-w64-mingw32.static/lib/pkgconfig/' >> ~/.profile
  18. fi
  19. export PATH=/opt/mxe/usr/bin:$PATH
  20. export PKG_CONFIG_PATH=/opt/mxe/usr/i686-w64-mingw32.static/lib/pkgconfig/
  21. cd ~
  22. echo ""
  23. echo "Cross compilation environement ok."
  24. echo "Need reboot before use"