X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/b1a8def84f1b68b40500f8dfaef23f5537d1a8cd..3dae76a8bdd0f3cc278a1a80b1f148b865ba189a:/win32/prepare.bat diff --git a/win32/prepare.bat b/win32/prepare.bat index 250c0570..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%" ( @@ -181,6 +182,7 @@ if not exist "%MINGW_BIN%\libcurl.dll" ( copy /Y libcurl\bin\*.* "%MinGW_BIN%" copy /Y libcurl\lib\*.* "%MinGW%\lib" copy /Y libcurl\docs\*.* "%MinGW%\doc" + copy /Y COPYING.txt "%MinGW%\COPYING_curl.txt" rmdir /S /Q libcurl del %CURL_TAR% @echo OFF @@ -222,6 +224,110 @@ 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. +:: echo =+=+= echo Checking Gnome Doc Utils... echo =+=+= @@ -235,6 +341,54 @@ if not exist "%MINGW_BIN%\gnome-doc-prepare" ( if ERRORLEVEL 1 goto Error ) +echo =+=+= +echo Checking xsltproc... +echo =+=+= +set XLST=libxslt-1.1.26.win32 +set XLST_ZIP=%XLST%.zip +if not exist "%MINGW_BIN%\xsltproc.exe" ( + if not exist %XLST_ZIP% ( + wget ftp://ftp.zlatkovic.com/libxml/%XLST_ZIP% + ) + echo Extracting XLST... + 7z x %XLST_ZIP% + xcopy /Y /S "%XLST%\bin\*" "%MinGW_BIN%" + if ERRORLEVEL 1 goto Error + rmdir /Q /S %XLST% +) + +echo =+=+= +echo Checking xmllint... +echo =+=+= +set XML2=libxml2-2.7.8.win32 +set XML2_ZIP=%XML2%.zip +if not exist "%MINGW_BIN%\xmllint.exe" ( + if not exist %XML2_ZIP% ( + wget ftp://ftp.zlatkovic.com/libxml/%XML2_ZIP% + ) + echo Extracting xmllint... + 7z x %XML2_ZIP% + xcopy /Y /S "%XML2%\bin\*" "%MinGW_BIN%" + if ERRORLEVEL 1 goto Error + rmdir /Q /S %XML2% +) + +echo =+=+= +echo Checking iconv... +echo =+=+= +set ICONV=iconv-1.9.2.win32 +set ICONV_ZIP=%ICONV%.zip +if not exist "%MINGW_BIN%\iconv.dll" ( + if not exist %ICONV_ZIP% ( + wget ftp://ftp.zlatkovic.com/libxml/%ICONV_ZIP% + ) + echo Extracting iconv... + 7z x %ICONV_ZIP% + xcopy /Y /S "%ICONV%\bin\*" "%MinGW_BIN%" + if ERRORLEVEL 1 goto Error + rmdir /Q /S %ICONV% +) + :: Note GPSBabel can not be directly downloaded via wget :: ATM get it manually from here: :: http://www.gpsbabel.org/download.html