Revision: emacs@sv.gnu.org/gnus--devo--0--patch-70
[gnus] / make.bat
1 @echo off\r
2 \r
3 rem Written by Frank Schmitt (ich@frank-schmitt.net)\r
4 rem based on the work by David Charlap (shamino@writeme.com)\r
5 rem .\r
6 rem .\r
7 rem From http://my.gnus.org/node/343:\r
8 rem   A comment on installing Gnus on Windows 98 SE that might help others: When\r
9 rem   I ran the "make.bat" file in the 5.10.6 tarball I got a bunch of "Out of\r
10 rem   environment space" messages. The solution was to (1) make a shortcut to\r
11 rem   the make.bat file, and (2) right-click on the shortcut, setting "Cmd line"\r
12 rem   in the "Program" tab in "properties" to include the parameters make.bat\r
13 rem   requires, and "initial environment" in the "memories" tab, to the maximum\r
14 rem   (in my case, anyway, 2560).\r
15 rem .\r
16 rem Clear PWD so emacs doesn't get confused\r
17 set GNUS_PWD_SAVE=%PWD%\r
18 set PWD=\r
19 set ERROR=:\r
20 \r
21 if "%1" == "" goto usage\r
22 \r
23 rem Emacs 20.7 no longer includes emacs.bat. Use emacs.exe if the batch file is\r
24 rem not present -- this also fixes the problem about too many parameters on Win9x.\r
25 if exist %1\emacs.bat goto ebat\r
26 if exist %1\emacs.exe goto eexe\r
27 if exist %1\xemacs.exe goto xemacs\r
28 goto noemacs\r
29 \r
30 :ebat\r
31 set EMACS=emacs.bat\r
32 echo.\r
33 echo ***************************************************************************\r
34 echo * Using emacs.bat  (If you've got Emacs 20.3 or higher please remove\r
35 echo * Emacs.bat, it isn't needed anymore.)\r
36 echo ***************************************************************************\r
37 echo.\r
38 goto emacs\r
39 \r
40 :eexe\r
41 set EMACS=emacs.exe\r
42 echo.\r
43 echo ***************************************************************************\r
44 echo * Using emacs.exe\r
45 echo ***************************************************************************\r
46 echo.\r
47 goto emacs\r
48 \r
49 :emacs\r
50 if not "%2" == "/copy" goto emacsnocopy\r
51 if not exist %1\..\site-lisp\nul mkdir %1\..\site-lisp\r
52 if not exist %1\..\site-lisp\gnus\nul mkdir %1\..\site-lisp\gnus\r
53 if not exist %1\..\site-lisp\subdirs.el set subdirwarning=yes\r
54 :emacsnocopy\r
55 set EMACS_ARGS=-batch -q -no-site-file\r
56 set GNUS_INFO_DIR=%1\..\info\r
57 set GNUS_LISP_DIR=%1\..\site-lisp\gnus\lisp\r
58 set GNUS_ETC_DIR=%1\..\site-lisp\gnus\etc\r
59 goto lisp\r
60 \r
61 :xemacs\r
62 set EMACS=xemacs.exe\r
63 if not "%2" == "/copy" goto xemacsnocopy\r
64 if not exist %1\..\..\site-packages\nul mkdir %1\..\..\site-packages\\r
65 if not exist %1\..\..\site-packages\info\nul mkdir %1\..\..\site-packages\info\r
66 if not exist %1\..\..\site-packages\lisp\nul mkdir %1\..\..\site-packages\lisp\r
67 if not exist %1\..\..\site-packages\etc\nul mkdir %1\..\..\site-packages\etc\r
68 :xemacsnocopy\r
69 set EMACS_ARGS=-batch -no-autoloads\r
70 set GNUS_INFO_DIR=%1\..\..\site-packages\info\r
71 set GNUS_LISP_DIR=%1\..\..\site-packages\lisp\gnus\r
72 set GNUS_ETC_DIR=%1\..\..\site-packages\etc\r
73 echo.\r
74 echo ***************************************************************************\r
75 echo * Using xemacs.exe\r
76 echo ***************************************************************************\r
77 echo.\r
78 goto lisp\r
79 \r
80 :lisp\r
81 set EMACSBATCH=call %1\%EMACS% %EMACS_ARGS%\r
82 cd lisp\r
83 attrib -r gnus-load.el\r
84 if exist gnus-load.el del gnus-load.el\r
85 echo.\r
86 echo Stand by while generating autoloads.\r
87 echo.\r
88 %EMACSBATCH% -l ./dgnushack.el -f dgnushack-make-cus-load .\r
89 if ErrorLevel 1 set ERROR=make-cus-load\r
90 %EMACSBATCH% -l ./dgnushack.el -f dgnushack-make-auto-load .\r
91 if ErrorLevel 1 set ERROR=%ERROR%,make-auto-load\r
92 %EMACSBATCH% -l ./dgnushack.el -f dgnushack-make-load\r
93 if ErrorLevel 1 set ERROR=%ERROR%,make-load\r
94 echo.\r
95 echo Stand by while compiling lisp files.\r
96 echo.\r
97 %EMACSBATCH% -l ./dgnushack.el -f dgnushack-compile\r
98 if ErrorLevel 1 set ERROR=%ERROR%,compile\r
99 \r
100 if not "%2" == "/copy" goto infotest\r
101 echo.\r
102 echo Stand by while copying lisp files.\r
103 echo.\r
104 if not exist %GNUS_LISP_DIR%\nul mkdir %GNUS_LISP_DIR%\r
105 xcopy /R /Q /Y *.el* %GNUS_LISP_DIR%\r
106 if ErrorLevel 1 set ERROR=%ERROR%,copy-lisp\r
107 goto infotest\r
108 \r
109 :infotest\r
110 cd ..\texi\r
111 attrib -r sieve\r
112 if exist sieve del sieve\r
113 \r
114 makeinfo sieve.texi\r
115 if exist sieve goto minfo\r
116 REM It seems that makeinfo isn't available\r
117 set EMACSINFO=%EMACSBATCH% -l infohack.el -f batch-makeinfo\r
118 echo.\r
119 echo ***************************************************************************\r
120 echo * Using infohack.el, if you've got makeinfo.exe put it in PATH.\r
121 echo ***************************************************************************\r
122 echo.\r
123 goto info\r
124 \r
125 :minfo\r
126 set EMACSINFO=makeinfo\r
127 echo.\r
128 echo ***************************************************************************\r
129 echo * Using makeinfo\r
130 echo ***************************************************************************\r
131 echo.\r
132 goto info\r
133 \r
134 :info\r
135 echo.\r
136 echo Stand by while generating info files.\r
137 echo.\r
138 %EMACSINFO% emacs-mime.texi\r
139 if ErrorLevel 1 set ERROR=%ERROR%,emacs-mime.texi\r
140 %EMACSINFO% gnus.texi\r
141 if ErrorLevel 1 set ERROR=%ERROR%,gnus.texi\r
142 %EMACSINFO% sieve.texi\r
143 if ErrorLevel 1 set ERROR=%ERROR%,sieve.texi\r
144 %EMACSINFO% pgg.texi\r
145 if ErrorLevel 1 set ERROR=%ERROR%,pgg.texi\r
146 %EMACSINFO% message.texi\r
147 if ErrorLevel 1 set ERROR=%ERROR%,message.texi\r
148 %EMACSINFO% sasl.texi\r
149 if ErrorLevel 1 set ERROR=%ERROR%,sasl.texi\r
150 \r
151 if not "%2" == "/copy" goto nocopy\r
152 if not exist %GNUS_INFO_DIR%\nul mkdir %GNUS_INFO_DIR%\r
153 \r
154 echo.\r
155 echo Stand by while copying info files.\r
156 echo.\r
157 xcopy /R /Q /Y gnus       %GNUS_INFO_DIR%\r
158 if ErrorLevel 1 set ERROR=%ERROR%,copy-gnus-info\r
159 xcopy /R /Q /Y gnus-?     %GNUS_INFO_DIR%\r
160 if ErrorLevel 1 set ERROR=%ERROR%,copy-gnus-x-info\r
161 xcopy /R /Q /Y gnus-??    %GNUS_INFO_DIR%\r
162 if ErrorLevel 1 set ERROR=%ERROR%,copy-gnus-xx-info\r
163 xcopy /R /Q /Y message    %GNUS_INFO_DIR%\r
164 if ErrorLevel 1 set ERROR=%ERROR%,copy-message-info\r
165 if exist message-1 xcopy /R /Q /Y message-?  %GNUS_INFO_DIR%\r
166 if ErrorLevel 1 set ERROR=%ERROR%,copy-message-x-info\r
167 xcopy /R /Q /Y emacs-mime %GNUS_INFO_DIR%\r
168 if ErrorLevel 1 set ERROR=%ERROR%,copy-emacs-mime-info\r
169 xcopy /R /Q /Y sieve      %GNUS_INFO_DIR%\r
170 if ErrorLevel 1 set ERROR=%ERROR%,copy-sieve-info\r
171 xcopy /R /Q /Y pgg        %GNUS_INFO_DIR%\r
172 if ErrorLevel 1 set ERROR=%ERROR%,copy-pgg-info\r
173 xcopy /R /Q /Y sasl        %GNUS_INFO_DIR%\r
174 if ErrorLevel 1 set ERROR=%ERROR%,copy-sasl-info\r
175 \r
176 echo.\r
177 echo ***************************************************************************\r
178 echo * You should add the following lines to\r
179 echo * %GNUS_INFO_DIR%\dir\r
180 echo * if they aren't already there:\r
181 echo *\r
182 echo * * PGG: (pgg).    Emacs interface to various PGP implementations.\r
183 echo * * Sieve: (sieve).        Managing Sieve scripts in Emacs.\r
184 echo * * SASL: (sasl).  The Emacs SASL library.\r
185 echo ***************************************************************************\r
186 echo.\r
187 \r
188 :etc\r
189 cd ..\etc\r
190 echo.\r
191 echo Stand by while copying etc files.\r
192 echo.\r
193 if not exist %GNUS_ETC_DIR%\nul mkdir %GNUS_ETC_DIR%\r
194 xcopy /R /Q /Y gnus-tut.txt %GNUS_ETC_DIR%\r
195 if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-gnus-tut-txt\r
196 if not exist %GNUS_ETC_DIR%\gnus\nul mkdir %GNUS_ETC_DIR%\gnus\r
197 xcopy /R /Q /Y .\gnus\* %GNUS_ETC_DIR%\gnus\\r
198 if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-gnus-*\r
199 if not exist %GNUS_ETC_DIR%\images\nul mkdir %GNUS_ETC_DIR%\images\r
200 xcopy /R /Q /Y .\images\*.??? %GNUS_ETC_DIR%\images\r
201 if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-images-*\r
202 if not exist %GNUS_ETC_DIR%\images\gnus\nul mkdir %GNUS_ETC_DIR%\images\gnus\r
203 xcopy /R /Q /Y .\images\gnus\* %GNUS_ETC_DIR%\images\gnus\\r
204 if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-images-gnus-*\r
205 if not exist %GNUS_ETC_DIR%\images\mail\nul mkdir %GNUS_ETC_DIR%\images\mail\r
206 xcopy /R /Q /Y .\images\mail\* %GNUS_ETC_DIR%\images\mail\\r
207 if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-images-mail-*\r
208 if not exist %GNUS_ETC_DIR%\images\smilies\nul mkdir %GNUS_ETC_DIR%\images\smilies\r
209 xcopy /R /Q /Y .\images\smilies\* %GNUS_ETC_DIR%\images\smilies\\r
210 if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-images-smilies-*\r
211 goto warnings\r
212 \r
213 :nocopy\r
214 echo.\r
215 echo ***************************************************************************\r
216 echo * You chose not to copy the files, therefore you should add the\r
217 echo * following lines to the TOP of your [X]emacs customization file:\r
218 echo *\r
219 echo * (add-to-list 'load-path "/Path/to/gnus/lisp")\r
220 echo * (if (featurep 'xemacs)\r
221 echo *     (add-to-list 'Info-directory-list "c:/Path/to/gnus/texi/")\r
222 echo *   (add-to-list 'Info-default-directory-list "c:/Path/to/gnus/texi/"))\r
223 echo * (require 'gnus-load)\r
224 echo *\r
225 echo * Replace c:/Path/to/gnus with the Path where your new Gnus is (that's here\r
226 echo * and yes, you've got to use forward slashes).\r
227 echo ***************************************************************************\r
228 echo.\r
229 \r
230 :warnings\r
231 if not "%subdirwarning%" == "yes" goto warngnusload\r
232 echo.\r
233 echo ***************************************************************************\r
234 echo * There's no subdirs.el file in your site-lisp directory, you should\r
235 echo * therefor add the following line to the TOP of your Emacs\r
236 echo * customization file:\r
237 echo *\r
238 echo * (add-to-list 'load-path "/Path/to/emacs-site-lisp-directory/gnus/lisp")\r
239 echo * (require 'gnus-load)\r
240 echo * Yes, it must be forward slashes.\r
241 echo ***************************************************************************\r
242 echo.\r
243 goto warnerrors\r
244 \r
245 :warngnusload\r
246 echo.\r
247 echo ***************************************************************************\r
248 echo * You should add the following line to the TOP of your Emacs\r
249 echo * customization file:\r
250 echo *\r
251 echo * (require 'gnus-load)\r
252 echo ***************************************************************************\r
253 echo.\r
254 \r
255 :warnerrors\r
256 if "%ERROR%"==":" goto noerrors\r
257 set errorlevel=1\r
258 echo.\r
259 echo ***************************************************************************\r
260 echo * WARNING ERRORS OCCURRED!\r
261 echo * You should look for error messages in the output of the called programs\r
262 echo * and try to find out what exactly went wrong.\r
263 echo * Errors occured in the following modules:\r
264 echo * %ERROR%\r
265 echo ***************************************************************************\r
266 echo.\r
267 goto done\r
268 \r
269 :noerrors\r
270 set errorlevel=0\r
271 \r
272 :done\r
273 cd ..\r
274 goto end\r
275 \r
276 :noemacs\r
277 echo.\r
278 echo ***************************************************************************\r
279 echo * Unable to find emacs.exe or xemacs.exe on the path you specified!\r
280 echo * STOP!\r
281 echo ***************************************************************************\r
282 echo.\r
283 goto usage\r
284 \r
285 :usage\r
286 echo.\r
287 echo ***************************************************************************\r
288 echo * Usage: make.bat :[X]Emacs-exe-dir: [/copy]\r
289 echo *\r
290 echo * where: :[X]Emacs-exe-dir: is the directory your\r
291 echo *           emacs.exe respectively xemacs.exe resides in,\r
292 echo *           e.g. G:\Programme\XEmacs\XEmacs-21.4.11\i586-pc-win32\\r
293 echo *           or G:\Emacs\bin\r
294 echo *        /copy indicates that the compiled files should be copied to your\r
295 echo *           emacs lisp, info, and etc site directories.\r
296 echo *\r
297 echo * Note: If you have Emacs/w3 you should set the environment variable\r
298 echo *       W3DIR to the directory where w3 is installed eg.\r
299 echo *                set W3DIR=d:\lisp\w3-4.0pre46\lisp\r
300 echo ***************************************************************************\r
301 echo.\r
302 \r
303 :end\r
304 rem Restore environment variables\r
305 set PWD=%GNUS_PWD_SAVE%\r
306 set GNUS_PWD_SAVE=\r
307 set EMACSBATCH=\r
308 set GNUS_LISP_DIR=\r
309 set GNUS_INFO_DIR=\r
310 set GNUS_ETC_DIR=\r
311 set subdirwarning=\r
312 set ERROR=\r
313 \r
314 goto skipArchTag\r
315    arch-tag: 502dd14c-acde-4f69-8e82-43203b12a82c\r
316 :skipArchTag\r