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
22 :: We need a program to be able to extract not only zips, but bz2 and *lzma*
23 set PATH=%PATH%;%ProgramFiles%\7-Zip
25 echo Checking 7Zip is Available...
27 set ZIP_INST=7z920.exe
28 if not exist "%ProgramFiles%\7-Zip\7z.exe" (
29 call :Download %ZIP_INST% http://downloads.sourceforge.net/sevenzip/%ZIP_INST%
31 if ERRORLEVEL 1 goto Error
35 echo Checking mingw...
\r
37 set MINGW_BASE_URL=http://sourceforge.net/projects/mingw/files/MinGW/Base
38 set BIN_UTILS_LZ=binutils-2.23.2-1-mingw32-bin.tar.lzma
39 set BIN_UTILS_URL=%MINGW_BASE_URL%/binutils/binutils-2.23.2-1/%BIN_UTILS_LZ%/download
41 set MPC_DEV_LZ=mpc-1.0.1-2-mingw32-dev.tar.lzma
42 set MPC_DEV_URL=%MINGW_BASE_URL%/mpc/mpc-1.0.1-2/%MPC_DEV_LZ%/download
43 set MPC_DLL_LZ=mpc-1.0.1-2-mingw32-dll.tar.lzma
44 set MPC_DLL_URL=%MINGW_BASE_URL%/mpc/mpc-1.0.1-2/%MPC_DLL_LZ%/download
45 set MPFR_DEV_LZ=mpfr-3.1.2-2-mingw32-dev.tar.lzma
46 set MPFR_DEV_URL=%MINGW_BASE_URL%/mpfr/mpfr-3.1.2-2/%MPFR_DEV_LZ%/download
47 set MPFR_DLL_LZ=mpfr-3.1.2-2-mingw32-dll.tar.lzma
48 set MPFR_DLL_URL=%MINGW_BASE_URL%/mpfr/mpfr-3.1.2-2/%MPFR_DLL_LZ%/download
49 set GMP_DEV_LZ=gmp-5.1.2-1-mingw32-dev.tar.lzma
50 set GMP_DEV_URL=%MINGW_BASE_URL%/gmp/gmp-5.1.2/%GMP_DEV_LZ%/download
51 set GMP_DLL_LZ=gmp-5.1.2-1-mingw32-dll.tar.lzma
52 set GMP_DLL_URL=%MINGW_BASE_URL%/gmp/gmp-5.1.2/%GMP_DLL_LZ%/download
53 set PTHREADS_DEV_LZ=pthreads-w32-2.9.1-1-mingw32-dev.tar.lzma
54 set PTHREADS_DEV_URL=%MINGW_BASE_URL%/pthreads-w32/pthreads-w32-2.9.1/%PTHREADS_DEV_LZ%/download
55 set PTHREADS_DLL_LZ=pthreads-w32-2.9.1-1-mingw32-dll.tar.lzma
56 set PTHREADS_DLL_URL=%MINGW_BASE_URL%/pthreads-w32/pthreads-w32-2.9.1/%PTHREADS_DLL_LZ%/download
57 set ICONV_DEV_LZ=libiconv-1.14-3-mingw32-dev.tar.lzma
58 set ICONV_DEV_URL=%MINGW_BASE_URL%/libiconv/libiconv-1.14-3/%ICONV_DEV_LZ%/download
59 set ICONV_DLL_LZ=libiconv-1.14-3-mingw32-dll.tar.lzma
60 set ICONV_DLL_URL=%MINGW_BASE_URL%/libiconv/libiconv-1.14-3/%ICONV_DLL_LZ%/download
61 set GCC_CORE_BIN_LZ=gcc-core-4.8.1-4-mingw32-bin.tar.lzma
62 set GCC_CORE_BIN_URL=%MINGW_BASE_URL%/gcc/Version4/gcc-4.8.1-4/%GCC_CORE_BIN_LZ%/download
63 set GCC_CORE_DEV_LZ=gcc-core-4.8.1-4-mingw32-dev.tar.lzma
64 set GCC_CORE_DEV_URL=%MINGW_BASE_URL%/gcc/Version4/gcc-4.8.1-4/%GCC_CORE_DEV_LZ%/download
65 set GCC_CORE_DLL_LZ=gcc-core-4.8.1-4-mingw32-dll.tar.lzma
66 set GCC_CORE_DLL_URL=%MINGW_BASE_URL%/gcc/Version4/gcc-4.8.1-4/%GCC_CORE_DLL_LZ%/download
67 set MINGWRTDLL_LZ=mingwrt-4.0.3-1-mingw32-dll.tar.lzma
68 set MINGWRTDLL_URL=%MINGW_BASE_URL%/mingw-rt/mingwrt-4.0.3/%MINGWRTDLL_LZ%/download
69 set MINGWRTDEV_LZ=mingwrt-4.0.3-1-mingw32-dev.tar.lzma
70 set MINGWRTDEV_URL=%MINGW_BASE_URL%/mingw-rt/mingwrt-4.0.3/%MINGWRTDEV_LZ%/download
71 set W32API_LZ=w32api-4.0.3-1-mingw32-dev.tar.lzma
72 set W32API_URL=%MINGW_BASE_URL%/w32api/w32api-4.0.3/%W32API_LZ%/download
73 set ZLIB_LZ=zlib-1.2.8-1-mingw32-dll.tar.lzma
74 set ZLIB_URL=%MINGW_BASE_URL%/zlib/zlib-1.2.8/%ZLIB_LZ%/download
75 set GETTEXT_LZ=gettext-0.18.3.1-1-mingw32-dll.tar.lzma
76 set GETTEXT_URL=%MINGW_BASE_URL%/gettext/gettext-0.18.3.1-1/%GETTEXT_LZ%/download
78 if not exist "%MINGW_BIN%" (
\r
79 :: Here we download all default components manually in an attempt to get autoinstall to work...
\r
80 call :Download "%BIN_UTILS_LZ%" "%BIN_UTILS_URL%"
81 call :InstallLZMA "%BIN_UTILS_LZ%"
83 call :Download "%MPC_DLL_LZ%" "%MPC_DLL_URL%"
84 call :InstallLZMA "%MPC_DLL_LZ%"
86 call :Download "%MPC_DEV_LZ%" "%MPC_DEV_URL%"
87 call :InstallLZMA "%MPC_DEV_LZ%"
89 call :Download "%MPFR_DLL_LZ%" "%MPFR_DLL_URL%"
90 call :InstallLZMA "%MPFR_DLL_LZ%"
92 call :Download "%MPFR_DEV_LZ%" "%MPFR_DEV_URL%"
93 call :InstallLZMA "%MPFR_DEV_LZ%"
95 call :Download "%GMP_DEV_LZ%" "%GMP_DEV_URL%"
96 call :InstallLZMA "%GMP_DEV_LZ%"
98 call :Download "%GMP_DLL_LZ%" "%GMP_DLL_URL%"
99 call :InstallLZMA "%GMP_DLL_LZ%"
101 call :Download "%PTHREADS_DLL_LZ%" "%PTHREADS_DLL_URL%"
102 call :InstallLZMA "%PTHREADS_DLL_LZ%"
104 call :Download "%PTHREADS_DEV_LZ%" "%PTHREADS_DEV_URL%"
105 call :InstallLZMA "%PTHREADS_DEV_LZ%"
107 call :Download "%ICONV_DEV_LZ%" "%ICONV_DEV_URL%"
108 call :InstallLZMA "%ICONV_DEV_LZ%"
110 call :Download "%ICONV_DLL_LZ%" "%ICONV_DLL_URL%"
111 call :InstallLZMA "%ICONV_DLL_LZ%"
113 call :Download "%GCC_CORE_DEV_LZ%" "%GCC_CORE_DEV_URL%"
114 call :InstallLZMA "%GCC_CORE_DEV_LZ%"
116 call :Download "%GCC_CORE_DLL_LZ%" "%GCC_CORE_DLL_URL%"
117 call :InstallLZMA "%GCC_CORE_DLL_LZ%"
119 call :Download "%GCC_CORE_BIN_LZ%" "%GCC_CORE_BIN_URL%"
120 call :InstallLZMA "%GCC_CORE_BIN_LZ%"
122 call :Download "%MINGWRTDEV_LZ%" "%MINGWRTDEV_URL%"
123 call :InstallLZMA "%MINGWRTDEV_LZ%"
125 call :Download "%MINGWRTDLL_LZ%" "%MINGWRTDLL_URL%"
126 call :InstallLZMA "%MINGWRTDLL_LZ%"
128 call :Download "%W32API_LZ%" "%W32API_URL%"
129 call :InstallLZMA "%W32API_LZ%"
131 call :Download "%ZLIB_LZ%" "%ZLIB_URL%"
132 call :InstallLZMA "%ZLIB_LZ%"
134 call :Download "%GETTEXT_LZ%" "%GETTEXT_URL%"
135 call :InstallLZMA "%GETTEXT_LZ%"
139 echo Checking MSYS...
\r
141 set MSYS_EXE=MSYS-1.0.11.exe
\r
142 if not exist "%SystemDrive%\msys" (
\r
143 if not exist %MSYS_EXE% (
\r
144 wget http://downloads.sourceforge.net/mingw/%MSYS_EXE%
\r
146 if not [%WINELOADERNOEXEC%]==[] (
147 echo Running under WINE - Requires MSYS install fixes: run msys-pi-wine.sh when msys install halts..."
\r
148 echo Ctrl-C to stop and then rerun the installation if necessary
\r
150 %MSYS_EXE% /sp- /silent
\r
151 if ERRORLEVEL 1 goto Error
\r
156 echo Checking gtk+-bundle...
\r
158 set GTK_ZIP=gtk+-bundle_2.24.10-20120208_win32.zip
\r
159 if not exist "%MINGW_BIN%\gtk-update-icon-cache.exe" (
\r
160 call :Download %GTK_ZIP% http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/%GTK_ZIP%
161 7z x %GTK_ZIP% -o"%MinGW%" -y
162 if ERRORLEVEL 1 goto Error
\r
165 set EXPAT_ZIP=expat-dev_2.0.1-1_win32.zip
\r
167 echo Checking expat-dev...
\r
169 if not exist "%MINGW%\include\expat.h" (
\r
170 call :Download %EXPAT_ZIP% http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%EXPAT_ZIP%
171 7z x %EXPAT_ZIP% -o"%MinGW%"
\r
172 if ERRORLEVEL 1 goto Error
\r
175 ::set GTT_ZIP=gettext-tools-dev_0.18.1.1-2_win32.zip
177 ::echo Checking gettext-tools-dev...
179 ::if not exist "%MINGW_BIN%\libgettextlib-0-18-1.dll" (
180 :: if not exist %GTT_ZIP% (
181 :: wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%GTT_ZIP%
183 :: 7z x -y %GTT_ZIP% -o"%MinGW%"
184 :: if ERRORLEVEL 1 goto Error
188 echo Checking intltool...
\r
190 set INTLTOOL_ZIP=intltool_0.40.4-1_win32.zip
\r
191 if not exist "%MINGW_BIN%\intltoolize" (
\r
192 call :Download %INTLTOOL_ZIP% http://ftp.acc.umu.se/pub/GNOME/binaries/win32/intltool/0.40/%INTLTOOL_ZIP%
193 7z x %INTLTOOL_ZIP% -o"%MinGW%"
\r
194 if ERRORLEVEL 1 goto Error
\r
198 echo Checking iconv...
\r
200 set ICONV_ZIP=libiconv-1.9.2-1-bin.zip
\r
201 if not exist "%MINGW_BIN%\iconv.exe" (
\r
202 call :Download %ICONV_ZIP% http://sourceforge.net/projects/gnuwin32/files/libiconv/1.9.2-1/%ICONV_ZIP%
203 7z x -y %ICONV_ZIP% -o"%MinGW%"
\r
204 if ERRORLEVEL 1 goto Error
\r
208 echo Checking libintl...
\r
211 set LIBINTL_ZIP=libintl-0.14.4-bin.zip
\r
212 if not exist "%MINGW_BIN%\libintl3.dll" (
\r
213 call :Download %LIBINTL_ZIP% http://sourceforge.net/projects/gnuwin32/files/libintl/0.14.4/%LIBINTL_ZIP%
214 7z x -y %LIBINTL_ZIP% -o"%MinGW%"
\r
215 if ERRORLEVEL 1 goto Error
\r
219 echo Checking gettext tools...
221 :: Needed by intltool
222 set GETTEXT_BIN_LZ=gettext-0.18.3.1-1-mingw32-bin.tar.lzma
223 set GETTEXT_BIN_URL=%MINGW_BASE_URL%/gettext/gettext-0.18.3.1-1/%GETTEXT_BIN_LZ%/download
224 if not exist "%MINGW_BIN%\xgettext.exe" (
225 call :Download %GETTEXT_BIN_LZ% %GETTEXT_BIN_URL%
226 call :InstallLZMA "%GETTEXT_BIN_LZ%"
230 echo Checking libcurl...
\r
232 set CURL_TAR=libcurl-7.14.0_nossl-1sid.tar
\r
233 set CURL_BZ2=%CURL_TAR%.bz2
\r
234 if not exist "%MINGW_BIN%\libcurl.dll" (
\r
235 if not exist %CURL_BZ2% (
\r
236 wget http://downloads.sourceforge.net/devpaks/libcurl-7.14.0_nossl-1sid.DevPak?download
\r
237 move libcurl-7.14.0_nossl-1sid.DevPak %CURL_BZ2%
\r
239 echo Extracting libcurl...
\r
241 7z x %CURL_TAR% -o"libcurl"
\r
242 if ERRORLEVEL 1 goto Error
\r
244 move libcurl\include "%MinGW%\include\curl
\r
245 copy /Y libcurl\bin\*.* "%MinGW_BIN%"
\r
246 copy /Y libcurl\lib\*.* "%MinGW%\lib"
\r
247 copy /Y libcurl\docs\*.* "%MinGW%\doc"
\r
248 copy /Y COPYING.txt "%MinGW%\COPYING_curl.txt"
\r
249 rmdir /S /Q libcurl
\r
255 echo Checking libexif...
\r
257 set EXIF=libexif-0.6.21.1_winxp_mingw
258 set EXIF_7Z=%EXIF%.7z
\r
259 if not exist "%MINGW_BIN%\libexif-12.dll" (
\r
260 :: Space in URL so function call doesn't work ATM
261 ::call :Download %EXIF_7Z% "http://sourceforge.net/projects/maille/files/Extern libs/%EXIF_7Z%/download"
262 if not exist "%EXIF_7Z%" (
263 wget "http://sourceforge.net/projects/maille/files/Extern libs/%EXIF_7Z%/download"
\r
264 if ERRORLEVEL 1 goto Error
267 echo Extracting libexif...
\r
269 if ERRORLEVEL 1 goto Error
\r
271 echo Using xcopy to get all subdirs of libexif into place...
273 xcopy /Y /S %EXIF%\*.* "%MinGW%"
\r
279 echo Checking libstdc++...
\r
281 set STDCPP_TAR=gcc-c++-4.8.1-4-mingw32-dll.tar
282 set STDCPP_LZ=%STDCPP_TAR%.lzma
\r
283 if not exist "%MINGW_BIN%\libstdc++-6.dll" (
\r
284 call :Download "%STDCPP_LZ%" "http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.8.1-4/%STDCPP_LZ%/download"
285 call :InstallLZMA "%STDCPP_LZ%"
289 echo Checking libbz2 header...
\r
291 set BZ2_TAR=bzip2-1.0.6-4-mingw32-dev.tar
\r
292 set BZ2_LZ=%BZ2_TAR%.lzma
\r
293 if not exist "%MINGW%\include\bzlib.h" (
\r
294 call :Download %BZ2_LZ% "http://sourceforge.net/projects/mingw/files/MinGW/Extension/bzip2/bzip2-1.0.6-4/%BZ2_LZ%"
295 call :InstallLZMA "%BZ2_LZ%"
299 echo Checking libbz2...
\r
301 set BZ2DLL_TAR=libbz2-1.0.6-4-mingw32-dll-2.tar
\r
302 set BZ2DLL_LZ=%BZ2DLL_TAR%.lzma
\r
303 if not exist "%MINGW_BIN%\libbz2-2.dll" (
\r
304 call :Download %BZ2DLL_LZ% "http://sourceforge.net/projects/mingw/files/MinGW/Extension/bzip2/bzip2-1.0.6-4/%BZ2DLL_LZ%"
305 call :InstallLZMA "%BZ2DLL_LZ%"
309 echo Checking magic dev...
\r
311 set MAGIC_ZIP=file-5.03-lib.zip
\r
312 if not exist "%MINGW%\include\magic.h" (
\r
313 call :Download %MAGIC_ZIP% http://downloads.sourceforge.net/gnuwin32/%MAGIC_ZIP%
314 7z x %MAGIC_ZIP% -o"%MinGW%"
\r
315 if ERRORLEVEL 1 goto Error
\r
319 echo Checking magic DLL...
\r
321 set MAGICDLL_ZIP=file-5.03-bin.zip
\r
322 if not exist "%MINGW_BIN%\magic1.dll" (
\r
323 call :Download %MAGICDLL_ZIP% http://downloads.sourceforge.net/gnuwin32/%MAGICDLL_ZIP%
324 7z x %MAGICDLL_ZIP% -o"%MinGW%"
\r
325 if ERRORLEVEL 1 goto Error
\r
329 echo Checking regex DLL (required by magic)...
\r
331 set REGDLL_ZIP=regex-2.7-bin.zip
\r
332 if not exist "%MINGW_BIN%\regex2.dll" (
\r
333 call :Download %REGDLL_ZIP% http://downloads.sourceforge.net/gnuwin32/%REGDLL_ZIP%
334 7z x %REGDLL_ZIP% -o"%MinGW%"
\r
335 if ERRORLEVEL 1 goto Error
\r
339 echo Checking SQLite dev...
\r
341 set SQL_ZIP=sqlite-amalgamation-3080002.zip
\r
342 if not exist "%MINGW%\include\sqlite3.h" (
\r
343 call :Download %SQL_ZIP% http://www.sqlite.org/2013/%SQL_ZIP%
345 if ERRORLEVEL 1 goto Error
\r
346 copy /Y sqlite-amalgamation-3080002\s* "%MinGW%\include"
\r
347 rmdir /S /Q sqlite-amalgamation-3080002
\r
351 echo Checking SQL DLL...
\r
353 set SQLDLL_ZIP=sqlite-dll-win32-x86-3080002.zip
\r
354 if not exist "%MINGW_BIN%\sqlite3.dll" (
\r
355 call :Download %SQLDLL_ZIP% http://www.sqlite.org/2013/%SQLDLL_ZIP%
356 7z x %SQLDLL_ZIP% -o"%MinGW_BIN%"
\r
357 if ERRORLEVEL 1 goto Error
\r
358 REM Annoyingly SQL doesn't come with a .lib file so have to generate it ourselves:
\r
359 REM Possibly need to insert the line 'LIBRARY sqlite3.dll' at the beginning of the def file?
\r
360 REM but this may not be needed as the --dllname option may suffice
\r
361 set PATH=%PATH%;%MinGW_BIN%
362 dlltool.exe -d %MinGW_BIN%\sqlite3.def --dllname %MinGW_BIN%\sqlite3.dll -l %MinGW%\lib\sqlite3.lib
363 if ERRORLEVEL 1 goto Error
367 :: Ideally building the code on Windows shouldn't need Doc Utils or the Help processor stuff
\r
368 :: But ATM it's too hard to avoid.
\r
371 echo Checking Gnome Doc Utils...
\r
373 set GNOME_DOC_ZIP=gnome-doc-utils-0.12.0.zip
\r
374 if not exist "%MINGW_BIN%\gnome-doc-prepare" (
\r
375 call :Download %GNOME_DOC_ZIP% http://ftp.gnome.org/pub/gnome/binaries/win32/gnome-doc-utils/0.12/%GNOME_DOC_ZIP%
376 echo Extracting Gnome Doc Utils...
\r
377 7z x %GNOME_DOC_ZIP% -o"%MinGW%"
\r
378 if ERRORLEVEL 1 goto Error
\r
382 echo Checking xsltproc...
\r
384 set XLST=libxslt-1.1.26.win32
\r
385 set XLST_ZIP=%XLST%.zip
\r
386 if not exist "%MINGW_BIN%\xsltproc.exe" (
\r
387 call :Download %XLST_ZIP% ftp://ftp.zlatkovic.com/libxml/%XLST_ZIP%
388 echo Extracting XLST...
\r
390 xcopy /Y /S "%XLST%\bin\*" "%MinGW_BIN%"
\r
391 if ERRORLEVEL 1 goto Error
\r
396 echo Checking xmllint...
\r
398 set XML2=libxml2-2.7.8.win32
\r
399 set XML2_ZIP=%XML2%.zip
\r
400 if not exist "%MINGW_BIN%\xmllint.exe" (
\r
401 call :Download %XML2_ZIP% ftp://ftp.zlatkovic.com/libxml/%XML2_ZIP%
402 echo Extracting xmllint...
\r
404 xcopy /Y /S "%XML2%\bin\*" "%MinGW_BIN%"
\r
405 if ERRORLEVEL 1 goto Error
\r
410 echo Checking iconv...
\r
412 set ICONV=iconv-1.9.2.win32
\r
413 set ICONV_ZIP=%ICONV%.zip
\r
414 if not exist "%MINGW_BIN%\iconv.dll" (
\r
415 call :Download %ICONV_ZIP% ftp://ftp.zlatkovic.com/libxml/%ICONV_ZIP%
416 echo Extracting iconv...
\r
418 xcopy /Y /S "%ICONV%\bin\*" "%MinGW_BIN%"
\r
419 if ERRORLEVEL 1 goto Error
\r
420 rmdir /Q /S %ICONV%
\r
423 :: Note GPSBabel can not be directly downloaded via wget
\r
424 :: ATM get it manually from here:
\r
425 :: http://www.gpsbabel.org/download.html
\r
426 set GPSBABEL_INST=GPSBabel-1.4.4-Setup.exe
\r
427 if not exist "%ProgramFiles%\GPSBabel" (
\r
428 echo Installing GPSBabel...
\r
429 if exist %GPSBABEL_INST% (
\r
430 %GPSBABEL_INST% /silent
\r
431 if ERRORLEVEL 1 goto Error
\r
433 echo Required %GPSBABEL_INST% not found. Exitting
439 echo Checking Perl Installation...
\r
441 set PERL_MSI=ActivePerl-5.18.2.1802-MSWin32-x86-64int-298023.msi
442 if not exist "%SystemDrive%\Perl" (
\r
443 call :Download %PERL_MSI% http://downloads.activestate.com/ActivePerl/releases/5.18.2.1802/%PERL_MSI%
444 echo Installing Perl takes a little time...
\r
445 msiexec /qb /i %PERL_MSI% PERL_PATH=Yes PERL_EXT=Yes
\r
446 if ERRORLEVEL 1 goto Error
\r
450 echo Checking NSIS installed...
\r
452 set NSIS_INST=nsis-2.46-setup.exe
\r
453 if not exist "%ProgramFiles%\NSIS" (
\r
454 call :Download %NSIS_INST% http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download
455 echo Installing NSIS...
\r
457 if ERRORLEVEL 1 goto Error
\r
461 echo Checking NSIS Plugins installed...
\r
463 set FPDLLZIP=FindProc.zip
\r
464 if not exist "%ProgramFiles%\NSIS\Plugins\FindProcDLL.dll" (
\r
465 call :Download %FPDLLZIP% http://nsis.sourceforge.net/mediawiki/images/3/3c/%FPDLLZIP%
466 echo Extracting NSIS Plugins...
\r
467 7z e %FPDLLZIP% -o"%ProgramFiles%\NSIS\Plugins"
\r
468 if ERRORLEVEL 1 goto Error
\r
473 echo Fixing Perl reference
\r
475 set PATH=%PATH%;C:\msys\1.0\bin
\r
477 call :FixPerlRef %MINGW_BIN%\glib-mkenums s:/bin/perl:perl:
478 call :FixPerlRef %MINGW_BIN%\intltool-extract s:/opt/perl/bin/perl:perl:
479 call :FixPerlRef %MINGW_BIN%\intltool-merge s:/opt/perl/bin/perl:perl:
480 call :FixPerlRef %MINGW_BIN%\intltool-prepare s:/opt/perl/bin/perl:perl:
481 call :FixPerlRef %MINGW_BIN%\intltool-update s:/opt/perl/bin/perl:perl:
487 :: Param %2 = sed command
488 :: Sadly '-i' for in place changes doesn't seem available with Windows sed 3.02
489 sed -e '%2' %1 > %1.tmp
490 if ERRORLEVEL 1 goto Error
\r
492 if ERRORLEVEL 1 goto Error
\r
497 :: Potentially Clean Up
\r
498 :: If any parameters given on the command line then remove all downloaded items
\r
501 echo Removing downloaded files
\r
502 if exist cache rmdir /S /Q cache
\r
508 ::Function to try to download something via wget
509 :: (obviously needs 7zip to be installed first and available on the path!)
511 :: Param %2 = URL (which should retrieve %1) [ URL can't contain a space or %20:( ]
515 if ERRORLEVEL 1 goto Error
520 ::Function to install something via 7zip
521 :: (obviously needs 7zip to be installed first and available on the path!)
522 :: Param %1 = LZMA file
523 :: Param %2 = Internal file (normally the .tar file)
525 echo Extracting "%1" from "%2"
527 if ERRORLEVEL 1 goto Error
528 7z x "%2" -o"%MinGW%"
529 if ERRORLEVEL 1 goto Error
531 if ERRORLEVEL 1 goto Error
535 ::Function to install LZMA file containing a tar file (via 7zip)
536 :: (obviously needs 7zip to be installed first and available on the path!)
537 :: Param %1 = LZMA file
540 if ERRORLEVEL 1 goto Error
542 :: Remove the .lzma extension to get the tar file
543 set file=%param:.lzma=%
544 7z x "%file%" -o"%MinGW%" -y
545 if ERRORLEVEL 1 goto Error
547 if ERRORLEVEL 1 goto Error
552 echo exitting due to error: %ERRORLEVEL%
\r