4 :: Setup wget first - this has to be done manually
\r
5 :: http://gnuwin32.sourceforge.net/packages/wget.htm
\r
6 :: http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-setup.exe
\r
8 :: Simple script to check required built environment in default locations
\r
9 :: Versions downloaded are specified absolutely as otherwise it's tricky to try and work out the latest/stable version
\r
10 :: In principal the idea is to try and automate the process as much as possible
\r
12 set PATH=%PATH%;%ProgramFiles%\GnuWin32\bin
\r
14 set MINGW=%SystemDrive%\MinGW
\r
15 set MINGW_BIN=%MinGW%\bin
\r
19 if not exist cache mkdir cache
\r
23 echo Checking mingw...
\r
25 set MINGW_EXE=MinGW-5.1.6.exe
\r
26 set BIN_UTILS=binutils-2.19.1-mingw32-bin.tar.gz
\r
27 set GCC_CORE=gcc-core-3.4.5-20060117-3.tar.gz
\r
28 set GCC_GPP=gcc-g++-3.4.5-20060117-3.tar.gz
\r
29 set MINGWRTDLL=mingwrt-3.15.2-mingw32-dll.tar.gz
\r
30 set MINGWRTDEV=mingwrt-3.15.2-mingw32-dev.tar.gz
\r
31 set W32API=w32api-3.13-mingw32-dev.tar.gz
\r
33 if not exist "%MINGW_BIN%" (
\r
34 :: Here we download all default components manually in an attempt to get autoinstall to work...
\r
35 if not exist %MINGW_EXE% (
\r
36 wget "http://sourceforge.net/projects/mingw/files/OldFiles/MinGW 5.1.6/%MINGW_EXE%"
\r
38 if not exist %BIN_UTILS% (
\r
39 wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/binutils/binutils-2.19.1/%BIN_UTILS%/download"
\r
41 if not exist %GCC_CORE% (
\r
42 wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version3/Current Release_ gcc-3.4.5-20060117-3/%GCC_CORE%/download"
\r
44 if not exist %GCC_GPP% (
\r
45 wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version3/Current Release_ gcc-3.4.5-20060117-3/%GCC_GPP%/download"
\r
47 if not exist %MINGWRTDEV% (
\r
48 wget http://sourceforge.net/projects/mingw/files/MinGW/Base/mingw-rt/mingwrt-3.15.2/%MINGWRTDEV%/download
\r
50 if not exist %MINGWRTDLL% (
\r
51 wget http://sourceforge.net/projects/mingw/files/MinGW/Base/mingw-rt/mingwrt-3.15.2/%MINGWRTDLL%/download
\r
53 if not exist %W32API% (
\r
54 wget http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/w32api-3.13/%W32API%/download
\r
56 :: Can't get it to silent install. As a NSIS installer it supports /S, but it doesn't seem to work - it just hangs
\r
57 :: Have to click through manually
\r
59 if ERRORLEVEL 1 goto Error
\r
63 echo Checking MSYS...
\r
65 set MSYS_EXE=MSYS-1.0.11.exe
\r
66 if not exist "%SystemDrive%\msys" (
\r
67 if not exist %MSYS_EXE% (
\r
68 wget http://downloads.sourceforge.net/mingw/%MSYS_EXE%
\r
70 if not [%WINELOADER%]==[] (
\r
71 echo Running under WINE - Requires MSYS install fixes: run msys-pi-wine.sh when msys install halts..."
\r
72 echo Ctrl-C to stop and then rerun the installation if necessary
\r
74 %MSYS_EXE% /sp- /silent
\r
75 if ERRORLEVEL 1 goto Error
\r
78 :: We need a program to be able to extract not only zips, but bz2 and *lzma*
\r
79 set PATH=%PATH%;%ProgramFiles%\7-Zip
\r
81 echo Checking 7Zip is Available...
\r
83 set ZIP_INST=7z920.exe
\r
84 if not exist "%ProgramFiles%\7-Zip\7z.exe" (
\r
85 if not exist %ZIP_INST% (
\r
86 wget http://downloads.sourceforge.net/sevenzip/%ZIP_INST%
\r
89 if ERRORLEVEL 1 goto Error
\r
94 echo Checking gtk+-bundle...
\r
96 set GTK_ZIP=gtk+-bundle_2.24.10-20120208_win32.zip
\r
97 if not exist "%MINGW_BIN%\gtk-update-icon-cache.exe" (
\r
98 if not exist %GTK_ZIP% (
\r
99 wget http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/%GTK_ZIP%
\r
101 7z x %GTK_ZIP% -o"%MinGW%"
\r
102 if ERRORLEVEL 1 goto Error
\r
105 set EXPAT_ZIP=expat-dev_2.0.1-1_win32.zip
\r
107 echo Checking expat-dev...
\r
109 if not exist "%MINGW%\include\expat.h" (
\r
110 if not exist %EXPAT_ZIP% (
\r
111 wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%EXPAT_ZIP%
\r
113 7z x %EXPAT_ZIP% -o"%MinGW%"
\r
114 if ERRORLEVEL 1 goto Error
\r
117 set GTT_ZIP=gettext-tools-dev_0.18.1.1-2_win32.zip
\r
119 echo Checking gettext-tools-dev...
\r
121 if not exist "%MINGW_BIN%\libgettextlib-0-18-1.dll" (
\r
122 if not exist %GTT_ZIP% (
\r
123 wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%GTT_ZIP%
\r
125 7z x -y %GTT_ZIP% -o"%MinGW%"
\r
126 if ERRORLEVEL 1 goto Error
\r
130 echo Checking intltool...
\r
132 set INTLTOOL_ZIP=intltool_0.40.4-1_win32.zip
\r
133 if not exist "%MINGW_BIN%\intltoolize" (
\r
134 if not exist %INTLTOOL_ZIP% (
\r
135 wget http://ftp.acc.umu.se/pub/GNOME/binaries/win32/intltool/0.40/%INTLTOOL_ZIP%
\r
137 7z x %INTLTOOL_ZIP% -o"%MinGW%"
\r
138 if ERRORLEVEL 1 goto Error
\r
142 echo Checking iconv...
\r
144 set ICONV_ZIP=libiconv-1.9.2-1-bin.zip
\r
145 if not exist "%MINGW_BIN%\iconv.exe" (
\r
146 if not exist %ICONV_ZIP% (
\r
147 wget http://sourceforge.net/projects/gnuwin32/files/libiconv/1.9.2-1/%ICONV_ZIP%
\r
149 7z x -y %ICONV_ZIP% -o"%MinGW%"
\r
150 if ERRORLEVEL 1 goto Error
\r
154 echo Checking libintl...
\r
157 set LIBINTL_ZIP=libintl-0.14.4-bin.zip
\r
158 if not exist "%MINGW_BIN%\libintl3.dll" (
\r
159 if not exist %LIBINTL_ZIP% (
\r
160 wget http://sourceforge.net/projects/gnuwin32/files/libintl/0.14.4/%LIBINTL_ZIP%
\r
162 7z x -y %LIBINTL_ZIP% -o"%MinGW%"
\r
163 if ERRORLEVEL 1 goto Error
\r
167 echo Checking libcurl...
\r
169 set CURL_TAR=libcurl-7.14.0_nossl-1sid.tar
\r
170 set CURL_BZ2=%CURL_TAR%.bz2
\r
171 if not exist "%MINGW_BIN%\libcurl.dll" (
\r
172 if not exist %CURL_BZ2% (
\r
173 wget http://downloads.sourceforge.net/devpaks/libcurl-7.14.0_nossl-1sid.DevPak?download
\r
174 move libcurl-7.14.0_nossl-1sid.DevPak %CURL_BZ2%
\r
176 echo Extracting libcurl...
\r
178 7z x %CURL_TAR% -o"libcurl"
\r
179 if ERRORLEVEL 1 goto Error
\r
181 move libcurl\include "%MinGW%\include\curl
\r
182 copy /Y libcurl\bin\*.* "%MinGW_BIN%"
\r
183 copy /Y libcurl\lib\*.* "%MinGW%\lib"
\r
184 copy /Y libcurl\docs\*.* "%MinGW%\doc"
\r
185 copy /Y COPYING.txt "%MinGW%\COPYING_curl.txt"
\r
186 rmdir /S /Q libcurl
\r
192 echo Checking libexif...
\r
194 set EXIF=libexif-0.6.20_winxp_mingw
\r
195 set EXIF_7Z=%EXIF%.7z
\r
196 if not exist "%MINGW_BIN%\libexif-12.dll" (
\r
197 if not exist %EXIF_7Z% (
\r
198 wget "http://sourceforge.net/projects/maille/files/Extern libs/%EXIF_7Z%/download"
\r
200 echo Extracting libexif...
\r
202 if ERRORLEVEL 1 goto Error
\r
204 echo Using *xcopy* (to get all subdirs) libexif into place...
\r
206 xcopy /Y /S %EXIF%\*.* "%MinGW%"
\r
212 echo Checking libstdc++...
\r
214 set STDCPP_TAR=libstdc++-4.6.2-1-mingw32-dll-6.tar
\r
215 set STDCPP_LZ=%STDCPP_TAR%.lzma
\r
216 if not exist "%MINGW_BIN%\libstdc++-6.dll" (
\r
217 if not exist %STDCPP_LZ% (
\r
218 wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.6.2-1/%STDCPP_LZ%
\r
220 echo Extracting lidstdc++...
\r
222 7z x %STDCPP_TAR% -o"%MinGW%"
\r
223 if ERRORLEVEL 1 goto Error
\r
228 echo Checking libbz2 header...
\r
230 set BZ2_TAR=bzip2-1.0.6-4-mingw32-dev.tar
\r
231 set BZ2_LZ=%BZ2_TAR%.lzma
\r
232 if not exist "%MINGW%\include\bzlib.h" (
\r
233 if not exist %BZ2_LZ% (
\r
234 wget "http://sourceforge.net/projects/mingw/files/MinGW/Extension/bzip2/bzip2-1.0.6-4/%BZ2_LZ%"
\r
236 echo Extracting libbz2 header...
\r
238 7z x %BZ2_TAR% -o"%MinGW%"
\r
239 if ERRORLEVEL 1 goto Error
\r
244 echo Checking libbz2...
\r
246 set BZ2DLL_TAR=libbz2-1.0.6-4-mingw32-dll-2.tar
\r
247 set BZ2DLL_LZ=%BZ2DLL_TAR%.lzma
\r
248 if not exist "%MINGW_BIN%\libbz2-2.dll" (
\r
249 if not exist %BZ2DLL_LZ% (
\r
250 wget "http://sourceforge.net/projects/mingw/files/MinGW/Extension/bzip2/bzip2-1.0.6-4/%BZ2DLL_LZ%"
\r
252 echo Extracting libbz2...
\r
254 7z x %BZ2DLL_TAR% -o"%MinGW%"
\r
255 if ERRORLEVEL 1 goto Error
\r
260 echo Checking magic dev...
\r
262 set MAGIC_ZIP=file-5.03-lib.zip
\r
263 if not exist "%MINGW%\include\magic.h" (
\r
264 if not exist %MAGIC_ZIP% (
\r
265 wget http://downloads.sourceforge.net/gnuwin32/%MAGIC_ZIP%
\r
267 7z x %MAGIC_ZIP% -o"%MinGW%"
\r
268 if ERRORLEVEL 1 goto Error
\r
272 echo Checking magic DLL...
\r
274 set MAGICDLL_ZIP=file-5.03-bin.zip
\r
275 if not exist "%MINGW_BIN%\magic1.dll" (
\r
276 if not exist %MAGICDLL_ZIP% (
\r
277 wget http://downloads.sourceforge.net/gnuwin32/%MAGICDLL_ZIP%
\r
279 7z x %MAGICDLL_ZIP% -o"%MinGW%"
\r
280 if ERRORLEVEL 1 goto Error
\r
284 echo Checking regex DLL (required by magic)...
\r
286 set REGDLL_ZIP=regex-2.7-bin.zip
\r
287 if not exist "%MINGW_BIN%\regex2.dll" (
\r
288 if not exist %REGDLL_ZIP% (
\r
289 wget http://downloads.sourceforge.net/gnuwin32/%REGDLL_ZIP%
\r
291 7z x %REGDLL_ZIP% -o"%MinGW%"
\r
292 if ERRORLEVEL 1 goto Error
\r
296 echo Checking SQLite dev...
\r
298 set SQL_ZIP=sqlite-amalgamation-3080002.zip
\r
299 if not exist "%MINGW%\include\sqlite3.h" (
\r
300 if not exist %SQL_ZIP% (
\r
301 wget http://www.sqlite.org/2013/%SQL_ZIP%
\r
304 if ERRORLEVEL 1 goto Error
\r
305 copy /Y sqlite-amalgamation-3080002\s* "%MinGW%\include"
\r
306 rmdir /S /Q sqlite-amalgamation-3080002
\r
310 echo Checking SQL DLL...
\r
312 set SQLDLL_ZIP=sqlite-dll-win32-x86-3080002.zip
\r
313 if not exist "%MINGW_BIN%\sqlite3.dll" (
\r
314 if not exist %SQLDLL_ZIP% (
\r
315 wget http://www.sqlite.org/2013/%SQLDLL_ZIP%
\r
317 7z x %SQLDLL_ZIP% -o"%MinGW_BIN%"
\r
318 if ERRORLEVEL 1 goto Error
\r
319 REM Annoyingly SQL doesn't come with a .lib file so have to generate it ourselves:
\r
320 REM Possibly need to insert the line 'LIBRARY sqlite3.dll' at the beginning of the def file?
\r
321 REM but this may not be needed as the --dllname option may suffice
\r
323 dlltool -d sqlite3.def --dllname sqlite3.dll -l ..\lib\sqlite3.lib
\r
328 :: Ideally building the code on Windows shouldn't need Doc Utils or the Help processor stuff
\r
329 :: But ATM it's too hard to avoid.
\r
332 echo Checking Gnome Doc Utils...
\r
334 set GNOME_DOC_ZIP=gnome-doc-utils-0.12.0.zip
\r
335 if not exist "%MINGW_BIN%\gnome-doc-prepare" (
\r
336 if not exist %GNOME_DOC_ZIP% (
\r
337 wget http://ftp.gnome.org/pub/gnome/binaries/win32/gnome-doc-utils/0.12/%GNOME_DOC_ZIP%
\r
339 echo Extracting Gnome Doc Utils...
\r
340 7z x %GNOME_DOC_ZIP% -o"%MinGW%"
\r
341 if ERRORLEVEL 1 goto Error
\r
345 echo Checking xsltproc...
\r
347 set XLST=libxslt-1.1.26.win32
\r
348 set XLST_ZIP=%XLST%.zip
\r
349 if not exist "%MINGW_BIN%\xsltproc.exe" (
\r
350 if not exist %XLST_ZIP% (
\r
351 wget ftp://ftp.zlatkovic.com/libxml/%XLST_ZIP%
\r
353 echo Extracting XLST...
\r
355 xcopy /Y /S "%XLST%\bin\*" "%MinGW_BIN%"
\r
356 if ERRORLEVEL 1 goto Error
\r
361 echo Checking xmllint...
\r
363 set XML2=libxml2-2.7.8.win32
\r
364 set XML2_ZIP=%XML2%.zip
\r
365 if not exist "%MINGW_BIN%\xmllint.exe" (
\r
366 if not exist %XML2_ZIP% (
\r
367 wget ftp://ftp.zlatkovic.com/libxml/%XML2_ZIP%
\r
369 echo Extracting xmllint...
\r
371 xcopy /Y /S "%XML2%\bin\*" "%MinGW_BIN%"
\r
372 if ERRORLEVEL 1 goto Error
\r
377 echo Checking iconv...
\r
379 set ICONV=iconv-1.9.2.win32
\r
380 set ICONV_ZIP=%ICONV%.zip
\r
381 if not exist "%MINGW_BIN%\iconv.dll" (
\r
382 if not exist %ICONV_ZIP% (
\r
383 wget ftp://ftp.zlatkovic.com/libxml/%ICONV_ZIP%
\r
385 echo Extracting iconv...
\r
387 xcopy /Y /S "%ICONV%\bin\*" "%MinGW_BIN%"
\r
388 if ERRORLEVEL 1 goto Error
\r
389 rmdir /Q /S %ICONV%
\r
392 :: Note GPSBabel can not be directly downloaded via wget
\r
393 :: ATM get it manually from here:
\r
394 :: http://www.gpsbabel.org/download.html
\r
395 set GPSBABEL_INST=GPSBabel-1.4.4-Setup.exe
\r
396 if not exist "%ProgramFiles%\GPSBabel" (
\r
397 echo Installing GPSBabel...
\r
398 if exist %GPSBABEL_INST% (
\r
399 %GPSBABEL_INST% /silent
\r
400 if ERRORLEVEL 1 goto Error
\r
405 echo Checking Perl Installation...
\r
407 set PERL_MSI=ActivePerl-5.14.3.1404-MSWin32-x86-296513.msi
\r
408 if not exist "%SystemDrive%\Perl" (
\r
409 if not exist %PERL_MSI% (
\r
410 wget http://downloads.activestate.com/ActivePerl/releases/5.14.3.1404/%PERL_MSI%
\r
412 echo Installing Perl takes a little time...
\r
413 msiexec /qb /i %PERL_MSI% PERL_PATH=Yes PERL_EXT=Yes
\r
414 if ERRORLEVEL 1 goto Error
\r
418 echo Checking NSIS installed...
\r
420 set NSIS_INST=nsis-2.46-setup.exe
\r
421 if not exist "%ProgramFiles%\NSIS" (
\r
422 if not exist %NSIS_INST% (
\r
423 wget http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download
\r
425 echo Installing NSIS...
\r
427 if ERRORLEVEL 1 goto Error
\r
431 echo Checking NSIS Plugins installed...
\r
433 set FPDLLZIP=FindProc.zip
\r
434 if not exist "%ProgramFiles%\NSIS\Plugins\FindProcDLL.dll" (
\r
435 if not exist %FPDLLZIP% (
\r
436 wget http://nsis.sourceforge.net/mediawiki/images/3/3c/%FPDLLZIP%
\r
438 echo Extracting NSIS Plugins...
\r
439 7z e %FPDLLZIP% -o"%ProgramFiles%\NSIS\Plugins"
\r
440 if ERRORLEVEL 1 goto Error
\r
445 echo Fixing Perl reference
\r
446 REM Sadly '-i' for in place changes doesn't seem available with Windows sed 3.02
\r
447 set PATH=%PATH%;C:\msys\1.0\bin
\r
448 sed -e 's:#! /bin/perl:#! /opt/perl/bin/perl:' %MINGW_BIN%\glib-mkenums > tmp.enums
\r
449 if ERRORLEVEL 1 goto Error
\r
450 xcopy /Y tmp.enums %MINGW_BIN%\glib-mkenums
\r
451 if ERRORLEVEL 1 goto Error
\r
454 :: Potentially Clean Up
\r
455 :: If any parameters given on the command line then remove all downloaded items
\r
458 echo Removing downloaded files
\r
459 if exist cache rmdir /S /Q cache
\r
465 echo exitting due to error: %ERRORLEVEL%
\r