[컴] windows 에서bitcoin build - MinGW



Contents

  1. [컴] windows 에서bitcoin build - VM 이용
  2. [컴] windows 에서bitcoin build - MinGW

windows 7 에서 mingw 를 이용하여 설치

MinGW 설치

일단 내 경우에는 MinGW 가 설치되어있던 것을 지우고, 새롭게 설치했다.

  1. d:\MinGW32
  2. 아래 package 만 설치한다. 
    • msys-base-bin
    • msys-autoconf-bin
    • msys-automake-bin
    • msys-libtool-bin
  3. Installation -> Apply 


MinGW-w64



openssl

  1. download openssl-1.0.1l.tar.gz
  2. MinGW shell 실행(d:\MinGW32\msys\1.0\msys.bat)
  3. tar xvfz openssl-1.0.1l.tar.gz (꼭 mingw shell 에서 tar 로 압축을 풀어야 symlink issue 를 피해갈 수 있다.)
  4. cd /d/coindeps/openssl-1.0.1l
  5. ./Configure no-zlib no-shared no-dso no-krb5 no-camellia no-capieng no-cast no-cms no-dtls1 no-gost no-gmp no-heartbeats no-idea no-jpake no-md2 no-mdc2 no-rc5 no-rdrand no-rfc3779 no-rsax no-sctp no-seed no-sha0 no-static_engine no-whirlpool no-rc2 no-rc4 no-ssl2 no-ssl3 mingw
  6. make depend
  7. d:\coindeps\openssl-1.0.1l\apps\openssl.exe

berkeley-db-4.8

  1. download berkeley-db/db-4.8.30.NC.tar.gz
  2. d:\coindeps\db-4.8.30.NC\ 에 풀어놓는다.
  3. MinGW shell 실행(d:\MinGW32\msys\1.0\msys.bat)
  4. cd /d/coindeps/db-4.8.30.NC/build_unix
  5. ../dist/configure --enable-mingw --enable-cxx --disable-shared --disable-replication
  6. make

boost

  1. download boost/1.57.0/
  2. d:\coindeps\boost_1_57_0> bootstrap.bat mingw
  3. d:\coindeps\boost_1_57_0> b2 --build-type=complete --with-chrono --with-filesystem --with-program_options --with-system --with-thread toolset=gcc variant=release link=static threading=multi runtime-link=static stage

minupnpc


download miniupnpc-1.9.20150206.tar.gz
d:\coindeps\minupnpc 에 풀어놓는다.
d:\coindeps\miniupnpc>mingw32-make -f Makefile.mingw init upnpc-static

protobuf

  1. download v2.6.1/protobuf-2.6.1.tar.gz
  2. d:\coindeps\protobuf-2.6.1\ 에 풀어놓는다.
  3. MinGW shell 실행(d:\MinGW32\msys\1.0\msys.bat)
  4. cd /d/coindeps/protobuf-2.6.1
  5. configure --disable-shared
  6. make
libevent
d:\coindeps\libevent-2.0.22-stable\ 에 풀어놓는다.
MinGW shell 실행(d:\MinGW32\msys\1.0\msys.bat)
configure
make


qrencode

libpng

  1. download libpng-1.6.16.tar.gz
  2. d:\coindeps\libpng-1.6.16\ 에 풀어놓는다.
  3. MinGW shell 실행(d:\MinGW32\msys\1.0\msys.bat)
  4. cd /d/coindeps/libpng-1.6.16
  5. configure --disable-shared
  6. make
  7. cp .libs/libpng16.a .libs/libpng.a

qrencode

  1. download qrencode-3.4.4.tar.gz
  2. d:\coindeps\qrencode-3.4.4\ 에 풀어놓는다.
  3. MinGW shell 실행(d:\MinGW32\msys\1.0\msys.bat)
  4. cd /d/coindeps/qrencode-3.4.4
  5. LIBS="../libpng-1.6.16/.libs/libpng.a ../../mingw32/i686-w64-mingw32/lib/libz.a" \
    png_CFLAGS="-I../libpng-1.6.16" \
    png_LIBS="-L../libpng-1.6.16/.libs" \
    configure --enable-static --disable-shared --without-tools
  6. make

Qt5

qtbase

  1. download qtbase-opensource-src-5.3.2.7z
  2. d:\coindeps\qt\qtbase-5.3.2\ 에 풀어놓자.
  3. configure.bat 실행(아래 code 참조)
  4. mingw32-make
set INCLUDE=d:\coindeps\libpng-1.6.16;d:\coindeps\openssl-1.0.1l\include
set LIB=d:\coindeps\libpng-1.6.16\.libs;d:\coindeps\openssl-1.0.1l

cd d:\coindeps\qt\qtbase-5.3.2
configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -system-zlib -qt-pcre -no-icu -no-gif -system-libpng -no-libjpeg -no-freetype -no-angle -no-vcproj -openssl -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug

qttools

  1. download qttools-opensource-src-5.3.2.7z
  2. d:\coindeps\qt\qttools-opensource-src-5.3.2\ 에 풀어놓자.
  3. qmake qttolls.pro
  4. mingw32-make 실행(아래 참조)
set PATH=%PATH%;d:\qt\5.3.2\bin

cd d:\qt\qttools-opensource-src-5.3.2\
qmake qttools.pro
mingw32-make

gmp


  1. download gmp-6.1.0.tar.bz2
  2. d:\coindeps\gmp-6.1.0\ 에 풀어놓자.
  3. MinGW shell 실행(d:\MinGW32\msys\1.0\msys.bat)
  4. cd /d/coindep/gmp-6.1.0
  5. ./configure --disable-shared



Build Bitcoin

  1. download bitcoin releases
  2. d:\mine\programming\cplusplus\bitcoin\bitcoin-0.12.0 에 풀어놓는다.
  3. MinGW shell 실행(d:\MinGW32\msys\1.0\msys.bat)
  4. cd /d/mine/programming/cplusplus/bitcoin/bitcoin-0.12.0
  5. ./autogen.sh
  6. ./configure (아래 코드 참고)
  7. make


./configure BOOST_ROOT=/d/coindeps/boost_1_57_0 \
CPPFLAGS="-I/d/coindeps/libevent-2.0.22-stable/include \
-I/d/coindeps/db-4.8.30.NC/build_unix \
-I/d/coindeps/openssl-1.0.1l/include \
-I/d/coindeps \
-I/d/coindeps/protobuf-2.6.1/src \
-I/d/coindeps/libpng-1.6.16 \
-I/d/coindeps/qrencode-3.4.4 \
-I/usr/local/BerkeleyDB.4.8/inlcude \
-I/d/coindeps/gmp-6.1.0" \
LDFLAGS="-L/d/coindeps/libevent-2.0.22-stable/.libs \
-L/d/coindeps/db-4.8.30.NC/build_unix \
-L/d/coindeps/openssl-1.0.1l \
-L/d/coindeps/miniupnpc \
-L/d/coindeps/protobuf-2.6.1/src/.libs \
-L/d/coindeps/libpng-1.6.16/.libs \
-L/d/coindeps/qrencode-3.4.4/.libs \
-L/usr/local/BerkeleyDB.4.8/lib \
-L/d/coindeps/gmp-6.1.0/.libs" \
--disable-upnp-default --disable-tests --with-qt-incdir=/d/coindeps/qt/qtbase-5.3.2/include --with-qt-libdir=/d/coindeps/qt/qtbase-5.3.2/lib --with-qt-plugindir=/d/coindeps/qt/qtbase-5.3.2/plugins --with-qt-bindir=/d/coindeps/qt/qtbase-5.3.2/bin --with-protoc-bindir=/d/coindeps/protobuf-2.6.1/src


build 결과

0.9.4 버전 / 0.10.4 버전 에서는 잘 compile 된다.




0.12.0 버전에서는
아래 같은 error 가 발생했다.
...
d:\mine\programming\cplusplus\bitcoin\bitcoin-0.12.0\src/wallet/crypter.cpp:96:
undefined reference to `EVP_CIPHER_CTX_cleanup'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [bitcoind.exe] Error 1
make[2]: Leaving directory `/d/mine/programming/cplusplus/bitcoin/bitcoin-0.12.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/d/mine/programming/cplusplus/bitcoin/bitcoin-0.12.0/src'
make: *** [all-recursive] Error 1



Reference

  1. Building headless Bitcoin and Bitcoin-qt on Windows


댓글 없음:

댓글 쓰기