Bitcoin Forum
June 19, 2021, 07:28:27 PM *
News: Latest Bitcoin Core release: 0.21.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / [Automatic] Building windows bitcoin client from sources on: July 14, 2011, 11:20:02 AM
Here is the script to grab and compile latest sources.
Only mingw is pre-built, everything else is built from scratch.
  • Fully automatic!
  • No prerequisites.
  • Just create .bat and run it.
  • It downloads and builds everything in current folder.
You can delete C:\msysgit afterwards.
Upnp not included.
Tested on Windows 2008 R2 and Windows 7, 32 and 64 bit.

Code:
if exist msysGit.exe goto unpack
echo Downloading msysgit
echo Set x=CreateObject("Microsoft.XMLHTTP"):x.Open "GET","http://msysgit.googlecode.com/files/msysGit-fullinstall-1.7.6-preview20110708.exe",0:x.Send() >d.vbs
echo Set s=CreateObject("ADODB.Stream"):s.Type=1:s.Open():s.Write(x.responseBody):s.SaveToFile "msysGit.exe",2 >>d.vbs
cscript /nologo d.vbs
if not exist msysGit.exe goto e1
:unpack
msysGit.exe -y -nr
xcopy /E C:\msysgit
echo Compiling GIT
msysgit\bin\bash.exe --login echo DONE

:setpath
for /F "delims=" %%I in ("%~dp0") do set install_root=%%~fI
set PATH=%install_root%\msysgit\bin;%install_root%\msysgit\mingw\bin;%PATH%

:wxWidgets
svn co http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets
cd wxWidgets\build\msw
bash -c 'mingw32-make -f makefile.gcc BUILD=release'
cd %install_root%

:Boost
svn co http://svn.boost.org/svn/boost/trunk boost
cd boost
call bootstrap.bat mingw
bjam.exe toolset=gcc address-model=32 variant=release link=static threading=multi runtime-link=shared --build-type=complete stage
cd %install_root%

:OpenSSL
curl http://openssl.org/source/openssl-1.0.0d.tar.gz --O openssl-1.0.0d.tar.gz
md5sum openssl-1.0.0d.tar.gz >check.md5
grep 40b6ea380cc8a5bf9734c2f8bf7e701e check.md5
if not %errorlevel%==0 goto e1
tar xzf openssl-1.0.0d.tar.gz
cd openssl-1.0.0d
bash -i -c './config;make'
perl util/mkdef.pl 32 libeay enable-static-engine > libeay32.def
dllwrap --dllname libeay32.dll --output-lib libeay32.a --def libeay32.def libcrypto.a -lws2_32 -lgdi32
cd %install_root%

:BerkeleyDB
if exist db-4.7.25.NC goto BerkeleyDBUnpacked
curl http://download.oracle.com/berkeley-db/db-4.7.25.NC.zip --O db-4.7.25.NC.zip
unzip db-4.7.25.NC.zip
:BerkeleyDBUnpacked
cd db-4.7.25.NC/build_unix
bash -i -c '../dist/configure --enable-mingw --enable-cxx;make'
cd %install_root%

:Bitcoin
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin/src
bash -i -c 'make -f makefile.mingw INCLUDEPATHS="-I../../boost -I../../db-4.7.25.NC/build_unix -I../../openssl-1.0.0d/include -I../../wxWidgets/lib/gcc_lib/mswu -I../../wxWidgets/include -DBOOST_THREAD_USE_LIB -UUSE_UPNP" LIBPATHS="-L../../boost/stage/lib -L../../db-4.7.25.NC/build_unix -L../../openssl-1.0.0d -L../../wxWidgets/lib/gcc_lib" WXLIBS="-lwxmsw29u_html -lwxmsw29u_core -lwxmsw29u_adv -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib" LIBS="-lboost_system-mgw44-mt-1_48 -lboost_filesystem-mgw44-mt-1_48 -lboost_program_options-mgw44-mt-1_48 -lboost_thread-mgw44-mt-1_48 -ldb_cxx -lssl -lcrypto -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi"'
strip bitcoin.exe
copy ..\..\msysgit\mingw\bin\mingwm10.dll
exit

:e1
echo failed!
Thanks for Windows Build Instructions:http://forum.bitcoin.org/index.php?topic=5851.msg86700#msg86700
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!