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