X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/59a4fc6dfcc842cc9efb5c9f53b8f3b2d0f3d401..3dae76a8bdd0f3cc278a1a80b1f148b865ba189a:/win32/prepare.bat diff --git a/win32/prepare.bat b/win32/prepare.bat index 371ce3ac..9ae404fe 100644 --- a/win32/prepare.bat +++ b/win32/prepare.bat @@ -1,4 +1,5 @@ @echo OFF +:: License: CC0 :: :: Setup wget first - this has to be done manually :: http://gnuwin32.sourceforge.net/packages/wget.htm @@ -26,7 +27,7 @@ set BIN_UTILS=binutils-2.19.1-mingw32-bin.tar.gz set GCC_CORE=gcc-core-3.4.5-20060117-3.tar.gz set GCC_GPP=gcc-g++-3.4.5-20060117-3.tar.gz set MINGWRTDLL=mingwrt-3.15.2-mingw32-dll.tar.gz -set MINGWRTDEV=mingwrt-3.15.2-mingw32-dll.tar.gz +set MINGWRTDEV=mingwrt-3.15.2-mingw32-dev.tar.gz set W32API=w32api-3.13-mingw32-dev.tar.gz if not exist "%MINGW_BIN%" ( @@ -223,6 +224,106 @@ if not exist "%MINGW_BIN%\libstdc++-6.dll" ( del %STDCPP_TAR% ) +echo =+=+= +echo Checking libbz2 header... +echo =+=+= +set BZ2_TAR=bzip2-1.0.6-4-mingw32-dev.tar +set BZ2_LZ=%BZ2_TAR%.lzma +if not exist "%MINGW%\include\bzlib.h" ( + if not exist %BZ2_LZ% ( + wget "http://sourceforge.net/projects/mingw/files/MinGW/Extension/bzip2/bzip2-1.0.6-4/%BZ2_LZ%" + ) + echo Extracting libbz2 header... + 7z e %BZ2_LZ% + 7z x %BZ2_TAR% -o"%MinGW%" + if ERRORLEVEL 1 goto Error + del %BZ2_TAR% +) + +echo =+=+= +echo Checking libbz2... +echo =+=+= +set BZ2DLL_TAR=libbz2-1.0.6-4-mingw32-dll-2.tar +set BZ2DLL_LZ=%BZ2DLL_TAR%.lzma +if not exist "%MINGW_BIN%\libbz2-2.dll" ( + if not exist %BZ2DLL_LZ% ( + wget "http://sourceforge.net/projects/mingw/files/MinGW/Extension/bzip2/bzip2-1.0.6-4/%BZ2DLL_LZ%" + ) + echo Extracting libbz2... + 7z e %BZ2DLL_LZ% + 7z x %BZ2DLL_TAR% -o"%MinGW%" + if ERRORLEVEL 1 goto Error + del %BZ2DLL_TAR% +) + +echo =+=+= +echo Checking magic dev... +echo =+=+= +set MAGIC_ZIP=file-5.03-lib.zip +if not exist "%MINGW%\include\magic.h" ( + if not exist %MAGIC_ZIP% ( + wget http://downloads.sourceforge.net/gnuwin32/%MAGIC_ZIP% + ) + 7z x %MAGIC_ZIP% -o"%MinGW%" + if ERRORLEVEL 1 goto Error +) + +echo =+=+= +echo Checking magic DLL... +echo =+=+= +set MAGICDLL_ZIP=file-5.03-bin.zip +if not exist "%MINGW_BIN%\magic1.dll" ( + if not exist %MAGICDLL_ZIP% ( + wget http://downloads.sourceforge.net/gnuwin32/%MAGICDLL_ZIP% + ) + 7z x %MAGICDLL_ZIP% -o"%MinGW%" + if ERRORLEVEL 1 goto Error +) + +echo =+=+= +echo Checking regex DLL (required by magic)... +echo =+=+= +set REGDLL_ZIP=regex-2.7-bin.zip +if not exist "%MINGW_BIN%\regex2.dll" ( + if not exist %REGDLL_ZIP% ( + wget http://downloads.sourceforge.net/gnuwin32/%REGDLL_ZIP% + ) + 7z x %REGDLL_ZIP% -o"%MinGW%" + if ERRORLEVEL 1 goto Error +) + +echo =+=+= +echo Checking SQLite dev... +echo =+=+= +set SQL_ZIP=sqlite-amalgamation-3080002.zip +if not exist "%MINGW%\include\sqlite3.h" ( + if not exist %SQL_ZIP% ( + wget http://www.sqlite.org/2013/%SQL_ZIP% + ) + 7z x %SQL_ZIP% + if ERRORLEVEL 1 goto Error + copy /Y sqlite-amalgamation-3080002\s* "%MinGW%\include" + rmdir /S /Q sqlite-amalgamation-3080002 +) + +echo =+=+= +echo Checking SQL DLL... +echo =+=+= +set SQLDLL_ZIP=sqlite-dll-win32-x86-3080002.zip +if not exist "%MINGW_BIN%\sqlite3.dll" ( + if not exist %SQLDLL_ZIP% ( + wget http://www.sqlite.org/2013/%SQLDLL_ZIP% + ) + 7z x %SQLDLL_ZIP% -o"%MinGW_BIN%" + if ERRORLEVEL 1 goto Error + REM Annoyingly SQL doesn't come with a .lib file so have to generate it ourselves: + REM Possibly need to insert the line 'LIBRARY sqlite3.dll' at the beginning of the def file? + REM but this may not be needed as the --dllname option may suffice + popd %MinGW_BIN% + dlltool -d sqlite3.def --dllname sqlite3.dll -l ..\lib\sqlite3.lib + pushd +) + :: :: Ideally building the code on Windows shouldn't need Doc Utils or the Help processor stuff :: But ATM it's too hard to avoid.