]>
Commit | Line | Data |
---|---|---|
b1a8def8 RN |
1 | @echo OFF\r |
2 | ::\r | |
3 | :: Setup wget first - this has to be done manually\r | |
4 | :: http://gnuwin32.sourceforge.net/packages/wget.htm\r | |
5 | :: http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-setup.exe\r | |
6 | ::\r | |
7 | :: Simple script to check required built environment in default locations\r | |
8 | :: Versions downloaded are specified absolutely as otherwise it's tricky to try and work out the latest/stable version\r | |
9 | :: In principal the idea is to try and automate the process as much as possible\r | |
10 | ::\r | |
11 | set PATH=%PATH%;%ProgramFiles%\GnuWin32\bin\r | |
12 | \r | |
13 | set MINGW=%SystemDrive%\MinGW\r | |
14 | set MINGW_BIN=%MinGW%\bin\r | |
15 | \r | |
16 | set ERRORLEVEL=0\r | |
17 | \r | |
18 | if not exist cache mkdir cache\r | |
19 | pushd cache\r | |
20 | \r | |
21 | echo =+=+=\r | |
22 | echo Checking mingw...\r | |
23 | echo =+=+=\r | |
24 | set MINGW_EXE=MinGW-5.1.6.exe\r | |
25 | set BIN_UTILS=binutils-2.19.1-mingw32-bin.tar.gz\r | |
26 | set GCC_CORE=gcc-core-3.4.5-20060117-3.tar.gz\r | |
27 | set GCC_GPP=gcc-g++-3.4.5-20060117-3.tar.gz\r | |
28 | set MINGWRTDLL=mingwrt-3.15.2-mingw32-dll.tar.gz\r | |
29 | set MINGWRTDEV=mingwrt-3.15.2-mingw32-dll.tar.gz\r | |
30 | set W32API=w32api-3.13-mingw32-dev.tar.gz\r | |
31 | \r | |
32 | if not exist "%MINGW_BIN%" (\r | |
33 | :: Here we download all default components manually in an attempt to get autoinstall to work...\r | |
34 | if not exist %MINGW_EXE% (\r | |
35 | wget "http://sourceforge.net/projects/mingw/files/OldFiles/MinGW 5.1.6/%MINGW_EXE%"\r | |
36 | )\r | |
37 | if not exist %BIN_UTILS% (\r | |
38 | wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/binutils/binutils-2.19.1/%BIN_UTILS%/download"\r | |
39 | )\r | |
40 | if not exist %GCC_CORE% (\r | |
41 | wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version3/Current Release_ gcc-3.4.5-20060117-3/%GCC_CORE%/download"\r | |
42 | )\r | |
43 | if not exist %GCC_GPP% (\r | |
44 | wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version3/Current Release_ gcc-3.4.5-20060117-3/%GCC_GPP%/download"\r | |
45 | )\r | |
46 | if not exist %MINGWRTDEV% (\r | |
47 | wget http://sourceforge.net/projects/mingw/files/MinGW/Base/mingw-rt/mingwrt-3.15.2/%MINGWRTDEV%/download\r | |
48 | )\r | |
49 | if not exist %MINGWRTDLL% (\r | |
50 | wget http://sourceforge.net/projects/mingw/files/MinGW/Base/mingw-rt/mingwrt-3.15.2/%MINGWRTDLL%/download\r | |
51 | )\r | |
52 | if not exist %W32API% (\r | |
53 | wget http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/w32api-3.13/%W32API%/download\r | |
54 | )\r | |
55 | :: 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 | |
56 | :: Have to click through manually\r | |
57 | %MINGW_EXE%\r | |
58 | if ERRORLEVEL 1 goto Error\r | |
59 | )\r | |
60 | \r | |
61 | echo =+=+=\r | |
62 | echo Checking MSYS...\r | |
63 | echo =+=+=\r | |
64 | set MSYS_EXE=MSYS-1.0.11.exe\r | |
65 | if not exist "%SystemDrive%\msys" (\r | |
66 | if not exist %MSYS_EXE% (\r | |
67 | wget http://downloads.sourceforge.net/mingw/%MSYS_EXE%\r | |
68 | )\r | |
69 | if not [%WINELOADER%]==[] (\r | |
70 | echo Running under WINE - Requires MSYS install fixes: run msys-pi-wine.sh when msys install halts..."\r | |
71 | echo Ctrl-C to stop and then rerun the installation if necessary\r | |
72 | )\r | |
73 | %MSYS_EXE% /sp- /silent\r | |
74 | if ERRORLEVEL 1 goto Error\r | |
75 | )\r | |
76 | \r | |
77 | :: We need a program to be able to extract not only zips, but bz2 and *lzma*\r | |
78 | set PATH=%PATH%;%ProgramFiles%\7-Zip\r | |
79 | echo =+=+=\r | |
80 | echo Checking 7Zip is Available...\r | |
81 | echo =+=+=\r | |
82 | set ZIP_INST=7z920.exe\r | |
83 | if not exist "%ProgramFiles%\7-Zip\7z.exe" (\r | |
84 | if not exist %ZIP_INST% (\r | |
85 | wget http://downloads.sourceforge.net/sevenzip/%ZIP_INST%\r | |
86 | )\r | |
87 | %ZIP_INST% /S\r | |
88 | if ERRORLEVEL 1 goto Error\r | |
89 | )\r | |
90 | \r | |
91 | ::\r | |
92 | echo =+=+=\r | |
93 | echo Checking gtk+-bundle...\r | |
94 | echo =+=+=\r | |
95 | set GTK_ZIP=gtk+-bundle_2.24.10-20120208_win32.zip\r | |
96 | if not exist "%MINGW_BIN%\gtk-update-icon-cache.exe" (\r | |
97 | if not exist %GTK_ZIP% (\r | |
98 | wget http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/%GTK_ZIP%\r | |
99 | )\r | |
100 | 7z x %GTK_ZIP% -o"%MinGW%"\r | |
101 | if ERRORLEVEL 1 goto Error\r | |
102 | )\r | |
103 | \r | |
104 | set EXPAT_ZIP=expat-dev_2.0.1-1_win32.zip\r | |
105 | echo =+=+=\r | |
106 | echo Checking expat-dev...\r | |
107 | echo =+=+=\r | |
108 | if not exist "%MINGW%\include\expat.h" (\r | |
109 | if not exist %EXPAT_ZIP% (\r | |
110 | wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%EXPAT_ZIP%\r | |
111 | )\r | |
112 | 7z x %EXPAT_ZIP% -o"%MinGW%"\r | |
113 | if ERRORLEVEL 1 goto Error\r | |
114 | )\r | |
115 | \r | |
116 | set GTT_ZIP=gettext-tools-dev_0.18.1.1-2_win32.zip\r | |
117 | echo =+=+=\r | |
118 | echo Checking gettext-tools-dev...\r | |
119 | echo =+=+=\r | |
120 | if not exist "%MINGW_BIN%\libgettextlib-0-18-1.dll" (\r | |
121 | if not exist %GTT_ZIP% (\r | |
122 | wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%GTT_ZIP%\r | |
123 | )\r | |
124 | 7z x -y %GTT_ZIP% -o"%MinGW%"\r | |
125 | if ERRORLEVEL 1 goto Error\r | |
126 | )\r | |
127 | \r | |
128 | echo =+=+=\r | |
129 | echo Checking intltool...\r | |
130 | echo =+=+=\r | |
131 | set INTLTOOL_ZIP=intltool_0.40.4-1_win32.zip\r | |
132 | if not exist "%MINGW_BIN%\intltoolize" (\r | |
133 | if not exist %INTLTOOL_ZIP% (\r | |
134 | wget http://ftp.acc.umu.se/pub/GNOME/binaries/win32/intltool/0.40/%INTLTOOL_ZIP%\r | |
135 | )\r | |
136 | 7z x %INTLTOOL_ZIP% -o"%MinGW%"\r | |
137 | if ERRORLEVEL 1 goto Error\r | |
138 | )\r | |
139 | \r | |
140 | echo =+=+=\r | |
141 | echo Checking iconv...\r | |
142 | echo =+=+=\r | |
143 | set ICONV_ZIP=libiconv-1.9.2-1-bin.zip\r | |
144 | if not exist "%MINGW_BIN%\iconv.exe" (\r | |
145 | if not exist %ICONV_ZIP% (\r | |
146 | wget http://sourceforge.net/projects/gnuwin32/files/libiconv/1.9.2-1/%ICONV_ZIP%\r | |
147 | )\r | |
148 | 7z x -y %ICONV_ZIP% -o"%MinGW%"\r | |
149 | if ERRORLEVEL 1 goto Error\r | |
150 | )\r | |
151 | \r | |
152 | echo =+=+=\r | |
153 | echo Checking libintl...\r | |
154 | echo =+=+=\r | |
155 | :: Needed by iconv\r | |
156 | set LIBINTL_ZIP=libintl-0.14.4-bin.zip\r | |
157 | if not exist "%MINGW_BIN%\libintl3.dll" (\r | |
158 | if not exist %LIBINTL_ZIP% (\r | |
159 | wget http://sourceforge.net/projects/gnuwin32/files/libintl/0.14.4/%LIBINTL_ZIP%\r | |
160 | )\r | |
161 | 7z x -y %LIBINTL_ZIP% -o"%MinGW%"\r | |
162 | if ERRORLEVEL 1 goto Error\r | |
163 | )\r | |
164 | \r | |
165 | echo =+=+=\r | |
166 | echo Checking libcurl...\r | |
167 | echo =+=+=\r | |
168 | set CURL_TAR=libcurl-7.14.0_nossl-1sid.tar\r | |
169 | set CURL_BZ2=%CURL_TAR%.bz2\r | |
170 | if not exist "%MINGW_BIN%\libcurl.dll" (\r | |
171 | if not exist %CURL_BZ2% (\r | |
172 | wget http://downloads.sourceforge.net/devpaks/libcurl-7.14.0_nossl-1sid.DevPak?download\r | |
173 | move libcurl-7.14.0_nossl-1sid.DevPak %CURL_BZ2%\r | |
174 | )\r | |
175 | echo Extracting libcurl...\r | |
176 | 7z e %CURL_BZ2%\r | |
177 | 7z x %CURL_TAR% -o"libcurl"\r | |
178 | if ERRORLEVEL 1 goto Error\r | |
179 | @echo ON\r | |
180 | move libcurl\include "%MinGW%\include\curl\r | |
181 | copy /Y libcurl\bin\*.* "%MinGW_BIN%"\r | |
182 | copy /Y libcurl\lib\*.* "%MinGW%\lib"\r | |
183 | copy /Y libcurl\docs\*.* "%MinGW%\doc"\r | |
184 | rmdir /S /Q libcurl\r | |
185 | del %CURL_TAR%\r | |
186 | @echo OFF\r | |
187 | )\r | |
188 | \r | |
189 | echo =+=+=\r | |
190 | echo Checking libexif...\r | |
191 | echo =+=+=\r | |
192 | set EXIF=libexif-0.6.20_winxp_mingw\r | |
193 | set EXIF_7Z=%EXIF%.7z\r | |
194 | if not exist "%MINGW_BIN%\libexif-12.dll" (\r | |
195 | if not exist %EXIF_7Z% (\r | |
196 | wget "http://sourceforge.net/projects/maille/files/Extern libs/%EXIF_7Z%/download"\r | |
197 | )\r | |
198 | echo Extracting libexif...\r | |
199 | 7z x %EXIF_7Z%\r | |
200 | if ERRORLEVEL 1 goto Error\r | |
201 | \r | |
202 | echo Using *xcopy* (to get all subdirs) libexif into place...\r | |
203 | @echo ON\r | |
204 | xcopy /Y /S %EXIF%\*.* "%MinGW%"\r | |
205 | rmdir /S /Q %EXIF%\r | |
206 | @echo OFF\r | |
207 | )\r | |
208 | \r | |
209 | echo =+=+=\r | |
210 | echo Checking libstdc++...\r | |
211 | echo =+=+=\r | |
212 | set STDCPP_TAR=libstdc++-4.6.2-1-mingw32-dll-6.tar\r | |
213 | set STDCPP_LZ=%STDCPP_TAR%.lzma\r | |
214 | if not exist "%MINGW_BIN%\libstdc++-6.dll" (\r | |
215 | if not exist %STDCPP_LZ% (\r | |
216 | wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.6.2-1/%STDCPP_LZ%\r | |
217 | )\r | |
218 | echo Extracting lidstdc++...\r | |
219 | 7z e %STDCPP_LZ%\r | |
220 | 7z x %STDCPP_TAR% -o"%MinGW%"\r | |
221 | if ERRORLEVEL 1 goto Error\r | |
222 | del %STDCPP_TAR%\r | |
223 | )\r | |
224 | \r | |
225 | echo =+=+=\r | |
226 | echo Checking Gnome Doc Utils...\r | |
227 | echo =+=+=\r | |
228 | set GNOME_DOC_ZIP=gnome-doc-utils-0.12.0.zip\r | |
229 | if not exist "%MINGW_BIN%\gnome-doc-prepare" (\r | |
230 | if not exist %GNOME_DOC_ZIP% (\r | |
231 | wget http://ftp.gnome.org/pub/gnome/binaries/win32/gnome-doc-utils/0.12/%GNOME_DOC_ZIP%\r | |
232 | )\r | |
233 | echo Extracting Gnome Doc Utils...\r | |
234 | 7z x %GNOME_DOC_ZIP% -o"%MinGW%"\r | |
235 | if ERRORLEVEL 1 goto Error\r | |
236 | )\r | |
237 | \r | |
238 | :: Note GPSBabel can not be directly downloaded via wget\r | |
239 | :: ATM get it manually from here:\r | |
240 | :: http://www.gpsbabel.org/download.html\r | |
241 | set GPSBABEL_INST=GPSBabel-1.4.4-Setup.exe\r | |
242 | if not exist "%ProgramFiles%\GPSBabel" (\r | |
243 | echo Installing GPSBabel...\r | |
244 | if exist %GPSBABEL_INST% (\r | |
245 | %GPSBABEL_INST% /silent\r | |
246 | if ERRORLEVEL 1 goto Error\r | |
247 | )\r | |
248 | )\r | |
249 | \r | |
250 | echo =+=+=\r | |
251 | echo Checking Perl Installation...\r | |
252 | echo =+=+=\r | |
253 | set PERL_MSI=ActivePerl-5.14.3.1404-MSWin32-x86-296513.msi\r | |
254 | if not exist "%SystemDrive%\Perl" (\r | |
255 | if not exist %PERL_MSI% (\r | |
256 | wget http://downloads.activestate.com/ActivePerl/releases/5.14.3.1404/%PERL_MSI%\r | |
257 | )\r | |
258 | echo Installing Perl takes a little time...\r | |
259 | msiexec /qb /i %PERL_MSI% PERL_PATH=Yes PERL_EXT=Yes\r | |
260 | if ERRORLEVEL 1 goto Error\r | |
261 | )\r | |
262 | \r | |
263 | echo =+=+=\r | |
264 | echo Checking NSIS installed...\r | |
265 | echo =+=+=\r | |
266 | set NSIS_INST=nsis-2.46-setup.exe\r | |
267 | if not exist "%ProgramFiles%\NSIS" (\r | |
268 | if not exist %NSIS_INST% (\r | |
269 | wget http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download\r | |
270 | )\r | |
271 | echo Installing NSIS...\r | |
272 | %NSIS_INST% /S\r | |
273 | if ERRORLEVEL 1 goto Error\r | |
274 | )\r | |
275 | \r | |
276 | echo =+=+=\r | |
277 | echo Checking NSIS Plugins installed...\r | |
278 | echo =+=+=\r | |
279 | set FPDLLZIP=FindProc.zip\r | |
280 | if not exist "%ProgramFiles%\NSIS\Plugins\FindProcDLL.dll" (\r | |
281 | if not exist %FPDLLZIP% (\r | |
282 | wget http://nsis.sourceforge.net/mediawiki/images/3/3c/%FPDLLZIP%\r | |
283 | )\r | |
284 | echo Extracting NSIS Plugins...\r | |
285 | 7z e %FPDLLZIP% -o"%ProgramFiles%\NSIS\Plugins"\r | |
286 | if ERRORLEVEL 1 goto Error\r | |
287 | )\r | |
288 | \r | |
289 | popd\r | |
290 | \r | |
291 | echo Fixing Perl reference\r | |
292 | REM Sadly '-i' for in place changes doesn't seem available with Windows sed 3.02\r | |
293 | set PATH=%PATH%;C:\msys\1.0\bin\r | |
294 | sed -e 's:#! /bin/perl:#! /opt/perl/bin/perl:' %MINGW_BIN%\glib-mkenums > tmp.enums\r | |
295 | if ERRORLEVEL 1 goto Error\r | |
296 | xcopy /Y tmp.enums %MINGW_BIN%\glib-mkenums\r | |
297 | if ERRORLEVEL 1 goto Error\r | |
298 | del tmp.enums\r | |
299 | \r | |
300 | :: Potentially Clean Up\r | |
301 | :: If any parameters given on the command line then remove all downloaded items\r | |
302 | :Clean\r | |
303 | if not [%1]==[] (\r | |
304 | echo Removing downloaded files\r | |
305 | if exist cache rmdir /S /Q cache\r | |
306 | )\r | |
307 | \r | |
308 | goto End\r | |
309 | \r | |
310 | :Error\r | |
311 | echo exitting due to error: %ERRORLEVEL%\r | |
312 | exit\r | |
313 | \r | |
314 | :End\r | |
315 | echo Finished\r |