Skip to content

Instantly share code, notes, and snippets.

@cryptozeny
Last active February 21, 2019 12:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cryptozeny/a7c04fe14dd60de8f1806451742bba83 to your computer and use it in GitHub Desktop.
Save cryptozeny/a7c04fe14dd60de8f1806451742bba83 to your computer and use it in GitHub Desktop.
win64/32 crossbuild on ubuntu 16.04

Crossbuild on Ubuntu 16.04

참고: https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md
리눅스 빌드와 별개의 폴더를 만들어야함. HOST 설정때문에 리눅스 빌드가 안나옴

Win64

cd && \
git clone https://github.com/bitcoin/bitcoin.git && \
\
sudo apt install \
build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git g++-mingw-w64-x86-64 && \
sudo update-alternatives --set \
x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix && \
\
cd bitcoin/depends && \
make HOST=x86_64-w64-mingw32 -j$(grep -c ^processor /proc/cpuinfo) && \
cd .. && \
\
make clean && 
./autogen.sh && \
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure && \
make -j$(grep -c ^processor /proc/cpuinfo) && \
find src -name "*.exe" -exec x86_64-w64-mingw32-strip {} + && \
find src -name "*.exe"

Win32

cd && \
git clone https://github.com/bitcoin/bitcoin.git && \
\
sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev && \
sudo update-alternatives --config i686-w64-mingw32-g++  # Set the default mingw32 g++ compiler option to posix. && \
\
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var && \
\
cd depends && \
make HOST=i686-w64-mingw32 && \
\
cd .. && \
./autogen.sh # not required when building from tarball && \
CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --prefix=/ && \
make -j4 && \
\
find src -name "*.exe" -exec i686-w64-mingw32-strip {} + && \
find src -name "*.exe"

옵션: exe파일 따로 뽑아내기

find src -name "*.exe" -exec cp {} ../ \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment