(customize-face-other-window, customize-face):
[bpt/emacs.git] / config.bat
... / ...
CommitLineData
1@echo off\r
2rem ----------------------------------------------------------------------\r
3rem Configuration script for MSDOS\r
4rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001\r
5rem Free Software Foundation, Inc.\r
6\r
7rem This file is part of GNU Emacs.\r
8\r
9rem GNU Emacs is free software; you can redistribute it and/or modify\r
10rem it under the terms of the GNU General Public License as published by\r
11rem the Free Software Foundation; either version 2, or (at your option)\r
12rem any later version.\r
13\r
14rem GNU Emacs is distributed in the hope that it will be useful,\r
15rem but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
17rem GNU General Public License for more details.\r
18\r
19rem You should have received a copy of the GNU General Public License\r
20rem along with GNU Emacs; see the file COPYING. If not, write to the\r
21rem Free Software Foundation, Inc., 59 Temple Place - Suite 330,\r
22rem Boston, MA 02111-1307, USA.\r
23rem ----------------------------------------------------------------------\r
24rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r
25rem\r
26rem + msdos version 3 or better.\r
27rem + djgpp version 1.12maint1 or later (version 2.0 or later recommended).\r
28rem + make utility that allows breaking of the 128 chars limit on\r
29rem command lines. ndmake (as of version 4.5) won't work due to a\r
30rem line length limit. The make that comes with djgpp does work.\r
31rem + rm and mv (from GNU file utilities).\r
32rem + sed (you can use the port that comes with DJGPP).\r
33rem\r
34rem You should be able to get all the above utilities from any SimTel\r
35rem repository, e.g. ftp.simtel.net, in the directory\r
36rem "pub/simtelnet/gnu/djgpp/v2gnu". As usual, please use your local\r
37rem mirroring site to reduce trans-Atlantic traffic.\r
38rem ----------------------------------------------------------------------\r
39set X11=\r
40set nodebug=\r
41set djgpp_ver=\r
42if "%1" == "" goto usage\r
43rem ----------------------------------------------------------------------\r
44rem See if their environment is large enough. We need 28 bytes.\r
45set $foo$=789012345678901234567\r
46if not "%$foo$%" == "789012345678901234567" goto SmallEnv\r
47set $foo$=\r
48:again\r
49if "%1" == "" goto usage\r
50if "%1" == "--with-x" goto withx\r
51if "%1" == "--no-debug" goto nodebug\r
52if "%1" == "msdos" goto msdos\r
53:usage\r
54echo Usage: config [--with-x] [--no-debug] msdos\r
55echo [Read the script before you run it.]\r
56goto end\r
57rem ----------------------------------------------------------------------\r
58:withx\r
59set X11=Y\r
60shift\r
61goto again\r
62rem ----------------------------------------------------------------------\r
63:nodebug\r
64set nodebug=Y\r
65shift\r
66goto again\r
67rem ----------------------------------------------------------------------\r
68:msdos\r
69Echo Checking whether 'sed' is available...\r
70sed -e "w junk.$$$" <Nul\r
71If Exist junk.$$$ Goto sedOk\r
72Echo To configure 'Emacs' you need to have 'sed'!\r
73Goto End\r
74:sedOk\r
75Echo Checking whether 'rm' is available...\r
76rm -f junk.$$$\r
77If Not Exist junk.$$$ Goto rmOk\r
78Echo To configure 'Emacs' you need to have 'rm'!\r
79Goto End\r
80:rmOk\r
81Echo Checking whether 'mv' is available...\r
82rm -f junk.1 junk.2\r
83echo foo >junk.1\r
84mv junk.1 ./junk.2\r
85If Exist junk.2 Goto mvOk\r
86Echo To configure 'Emacs' you need to have 'mv'!\r
87rm -f junk.1\r
88Goto End\r
89:mvOk\r
90rm -f junk.2\r
91Echo Checking whether 'gcc' is available...\r
92echo main(){} >junk.c\r
93gcc -c junk.c\r
94if exist junk.o goto gccOk\r
95Echo To configure 'Emacs' you need to have 'gcc'!\r
96rm -f junk.c\r
97Goto End\r
98:gccOk\r
99rm -f junk.c junk.o junk junk.exe\r
100Echo Checking what version of DJGPP is installed...\r
101If Not "%DJGPP%" == "" goto djgppOk\r
102Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!\r
103Goto End\r
104:djgppOk\r
105echo int main() >junk.c\r
106echo #ifdef __DJGPP__ >>junk.c\r
107echo {return (__DJGPP__)*10;} >>junk.c\r
108echo #else >>junk.c\r
109echo #ifdef __GO32__ >>junk.c\r
110echo {return 10;} >>junk.c\r
111echo #else >>junk.c\r
112echo {return 0;} >>junk.c\r
113echo #endif >>junk.c\r
114echo #endif >>junk.c\r
115gcc -o junk junk.c\r
116if not exist junk.exe coff2exe junk\r
117junk\r
118If ErrorLevel 10 Goto go32Ok\r
119rm -f junk.c junk junk.exe\r
120Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!\r
121Goto End\r
122:go32Ok\r
123set djgpp_ver=1\r
124If ErrorLevel 20 set djgpp_ver=2\r
125rm -f junk.c junk junk.exe\r
126rem DJECHO is used by the top-level Makefile\r
127Echo Checking whether 'djecho' is available...\r
128redir -o Nul -eo djecho -o junk.$$$ foo\r
129If Exist junk.$$$ Goto djechoOk\r
130Echo To build 'Emacs' you need the 'djecho.exe' program!\r
131Echo 'djecho.exe' is part of 'djdevNNN.zip' basic DJGPP development kit.\r
132Echo Versions of DJGPP before 2.02 called this program 'echo.exe'.\r
133Echo Either unpack 'djecho.exe' from the 'djdevNNN.zip' archive,\r
134Echo or, if you have 'echo.exe', copy it to 'djecho.exe'.\r
135Echo Then run CONFIG.BAT again with the same arguments you did now.\r
136Goto End\r
137:djechoOk\r
138rm -f junk.$$$\r
139Echo Configuring for DJGPP Version %DJGPP_VER% ...\r
140Rem ----------------------------------------------------------------------\r
141Echo Configuring the source directory...\r
142cd src\r
143\r
144rem Create "epaths.h"\r
145sed -f ../msdos/sed4.inp <epaths.in >epaths.tmp\r
146update epaths.tmp epaths.h >nul\r
147rm -f epaths.tmp\r
148\r
149rem Create "config.h"\r
150rm -f config.h2 config.tmp\r
151sed -e '' config.in > config.tmp\r
152if "%X11%" == "" goto src4\r
153sed -f ../msdos/sed2x.inp <config.in >config.tmp\r
154:src4\r
155if "%DJGPP_VER%" == "2" Goto src41\r
156sed -f ../msdos/sed2.inp <config.tmp >config.h2\r
157goto src42\r
158:src41\r
159sed -f ../msdos/sed2v2.inp <config.tmp >config.h2\r
160:src42\r
161update config.h2 config.h >nul\r
162rm -f config.tmp config.h2\r
163\r
164rem On my system dir.h gets in the way. It's a VMS file so who cares.\r
165if exist dir.h ren dir.h vmsdir.h\r
166\r
167rem Create "makefile" from "makefile.in".\r
168rm -f Makefile junk.c\r
169sed -e "1,/== start of cpp stuff ==/s@^# .*$@@" <Makefile.in >junk.c\r
170If "%DJGPP_VER%" == "1" Goto mfV1\r
171gcc -E -traditional junk.c | sed -f ../msdos/sed1v2.inp >Makefile\r
172goto mfDone\r
173:mfV1\r
174gcc -E -traditional junk.c | sed -f ../msdos/sed1.inp >Makefile\r
175:mfDone\r
176rm -f junk.c\r
177\r
178if "%X11%" == "" goto src5\r
179mv Makefile makefile.tmp\r
180sed -f ../msdos/sed1x.inp <makefile.tmp >Makefile\r
181rm -f makefile.tmp\r
182:src5\r
183\r
184if "%nodebug%" == "" goto src6\r
185sed -e "/^CFLAGS *=/s/ *-gcoff//" <Makefile >makefile.tmp\r
186sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >Makefile\r
187rm -f makefile.tmp\r
188:src6\r
189cd ..\r
190rem ----------------------------------------------------------------------\r
191Echo Configuring the library source directory...\r
192cd lib-src\r
193rem Create "makefile" from "makefile.in".\r
194sed -e "1,/== start of cpp stuff ==/s@^# .*$@@" <Makefile.in >junk.c\r
195gcc -E -traditional -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ \f]*$/d" >makefile.new\r
196If "%DJGPP_VER%" == "2" goto libsrc-v2\r
197sed -f ../msdos/sed3.inp <makefile.new >Makefile\r
198Goto libsrc2\r
199:libsrc-v2\r
200sed -f ../msdos/sed3v2.inp <makefile.new >Makefile\r
201:libsrc2\r
202rm -f makefile.new junk.c\r
203if "%nodebug%" == "" goto libsrc3\r
204sed -e "/^CFLAGS *=/s/ *-gcoff//" <Makefile >makefile.tmp\r
205sed -e "/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp >Makefile\r
206rm -f makefile.tmp\r
207:libsrc3\r
208cd ..\r
209rem ----------------------------------------------------------------------\r
210if "%X11%" == "" goto oldx1\r
211Echo Configuring the oldxmenu directory...\r
212cd oldxmenu\r
213sed -f ../msdos/sed5x.inp <Makefile.in >Makefile\r
214if "%nodebug%" == "" goto oldx2\r
215sed -e "/^CFLAGS *=/s/ *-gcoff//" <Makefile >makefile.tmp\r
216mv -f makefile.tmp Makefile\r
217:oldx2\r
218cd ..\r
219:oldx1\r
220rem ----------------------------------------------------------------------\r
221Echo Configuring the manual directory...\r
222cd man\r
223sed -f ../msdos/sed6.inp < Makefile.in > Makefile\r
224cd ..\r
225rem ----------------------------------------------------------------------\r
226Echo Configuring the ELisp manual directory...\r
227cd lispref\r
228sed -f ../msdos/sed6.inp < Makefile.in > Makefile\r
229cd ..\r
230rem ----------------------------------------------------------------------\r
231Echo Configuring the ELisp Introduction manual directory...\r
232cd lispintro\r
233sed -f ../msdos/sed6.inp < Makefile.in > Makefile\r
234cd ..\r
235rem ----------------------------------------------------------------------\r
236Echo Configuring the lisp directory...\r
237cd lisp\r
238sed -f ../msdos/sedlisp.inp < Makefile.in > Makefile\r
239cd ..\r
240rem ----------------------------------------------------------------------\r
241If not Exist leim\quail\latin-pre.el goto maindir\r
242Echo Configuring the leim directory...\r
243cd leim\r
244sed -f ../msdos/sedleim.inp < Makefile.in > Makefile\r
245cd ..\r
246rem ----------------------------------------------------------------------\r
247:maindir\r
248Echo Configuring the main directory...\r
249If "%DJGPP_VER%" == "1" goto mainv1\r
250Echo Looking for the GDB init file...\r
251If Exist src\.gdbinit update src/.gdbinit src/_gdbinit\r
252If Exist src\_gdbinit goto gdbinitOk\r
253Echo ERROR:\r
254Echo I cannot find the GDB init file. It was called ".gdbinit" in\r
255Echo the Emacs distribution, but was probably renamed to some other\r
256Echo name without the leading dot when you untarred the archive.\r
257Echo It should be in the "src/" subdirectory. Please make sure this\r
258Echo file exists and is called "_gdbinit" with a leading underscore.\r
259Echo Then run CONFIG.BAT again with the same arguments you did now.\r
260goto End\r
261:gdbinitOk\r
262Echo Looking for the GDB init file...found\r
263copy msdos\mainmake.v2 Makefile >nul\r
264:mainv1\r
265If "%DJGPP_VER%" == "1" copy msdos\mainmake Makefile >nul\r
266rem ----------------------------------------------------------------------\r
267goto End\r
268:SmallEnv\r
269echo Your environment size is too small. Please enlarge it and run me again.\r
270echo For example, type "command.com /e:2048" to have 2048 bytes available.\r
271set $foo$=\r
272:end\r
273set X11=\r
274set nodebug=\r
275set djgpp_ver=\r