(set-word-help-file): Renamed from set-help-file.
[bpt/emacs.git] / config.bat
CommitLineData
3382cd59
RS
1@echo off\r
2rem ----------------------------------------------------------------------\r
3rem Configuration script for MSDOS\r
331fdf1e
RS
4rem Copyright (C) 1994 Free Software Foundation, Inc.\r
5\r
3382cd59
RS
6rem This file is part of GNU Emacs.\r
7\r
8rem GNU Emacs is free software; you can redistribute it and/or modify\r
9rem it under the terms of the GNU General Public License as published by\r
10rem the Free Software Foundation; either version 2, or (at your option)\r
11rem any later version.\r
12\r
13rem GNU Emacs is distributed in the hope that it will be useful,\r
14rem but WITHOUT ANY WARRANTY; without even the implied warranty of\r
15rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
16rem GNU General Public License for more details.\r
17\r
18rem You should have received a copy of the GNU General Public License\r
1fb87c77
KH
19rem along with GNU Emacs; see the file COPYING. If not, write to the\r
20rem Free Software Foundation, Inc., 59 Temple Place - Suite 330,\r
21rem Boston, MA 02111-1307, USA.\r
3382cd59
RS
22rem ----------------------------------------------------------------------\r
23rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r
24rem\r
331fdf1e 25rem + msdos version 3 or better.\r
f56c5217 26rem + djgpp version 1.12maint1 or later (version 2.0 or later recommended).\r
331fdf1e
RS
27rem + make utility that allows breaking of the 128 chars limit on\r
28rem command lines. ndmake (as of version 4.5) won't work due to a\r
293e5aa6 29rem line length limit. The make that comes with djgpp does work.\r
f56c5217
RS
30rem + rm and mv (from GNU file utilities).\r
31rem + sed (you can use the port that comes with DJGPP).\r
331fdf1e 32rem\r
f56c5217
RS
33rem You should be able to get all the above utilities from any SimTel\r
34rem repository, e.g. ftp.coast.net, in the directories\r
35rem "SimTel/vendors/djgpp" and "SimTel/vendors/gnu/gnuish/dos_only". As\r
36rem usual, please use your local mirroring site to reduce trans-Atlantic\r
37rem traffic.\r
3382cd59 38rem ----------------------------------------------------------------------\r
ddff705b
MW
39set X11=\r
40set nodebug=\r
b696f860 41set djgpp_ver=\r
ddff705b
MW
42:again\r
43if "%1" == "" goto usage\r
44if "%1" == "--with-x" goto withx\r
45if "%1" == "--no-debug" goto nodebug\r
3382cd59
RS
46if "%1" == "msdos" goto msdos\r
47:usage\r
ddff705b
MW
48echo Usage: config [--with-x] [--no-debug] msdos\r
49echo [Read the script before you run it.]\r
3382cd59
RS
50goto end\r
51rem ----------------------------------------------------------------------\r
ddff705b
MW
52:withx\r
53set X11=Y\r
54shift\r
55goto again\r
331fdf1e 56rem ----------------------------------------------------------------------\r
ddff705b
MW
57:nodebug\r
58set nodebug=Y\r
59shift\r
60goto again\r
3382cd59 61rem ----------------------------------------------------------------------\r
ddff705b 62:msdos\r
2f3e7987
RS
63Echo Checking whether 'sed' is available...\r
64sed -e "w junk.$$$" <Nul\r
ddff705b 65If Exist junk.$$$ Goto sedOk\r
2f3e7987 66Echo To configure 'Emacs' you need to have 'sed'!\r
ddff705b
MW
67Goto End\r
68:sedOk\r
2f3e7987 69Echo Checking whether 'rm' is available...\r
ddff705b
MW
70rm -f junk.$$$\r
71If Not Exist junk.$$$ Goto rmOk\r
2f3e7987 72Echo To configure 'Emacs' you need to have 'rm'!\r
ddff705b
MW
73Goto End\r
74:rmOk\r
2f3e7987 75Echo Checking whether 'mv' is available...\r
ddff705b
MW
76rm -f junk.1 junk.2\r
77echo foo >junk.1\r
9663837a 78mv junk.1 ./junk.2\r
ddff705b 79If Exist junk.2 Goto mvOk\r
2f3e7987 80Echo To configure 'Emacs' you need to have 'mv'!\r
ddff705b
MW
81rm -f junk.1\r
82Goto End\r
83:mvOk\r
84rm -f junk.2\r
2f3e7987 85Echo Checking whether 'gcc' is available...\r
ddff705b
MW
86echo main(){} >junk.c\r
87gcc -c junk.c\r
88if exist junk.o goto gccOk\r
2f3e7987 89Echo To configure 'Emacs' you need to have 'gcc'!\r
ddff705b
MW
90rm -f junk.c\r
91Goto End\r
92:gccOk\r
8cdaacaf 93rm -f junk.c junk.o junk junk.exe\r
f56c5217
RS
94Echo Checking what version of DJGPP is installed...\r
95If Not "%DJGPP%" == "" goto djgppOk\r
96Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!\r
97Goto End\r
98:djgppOk\r
99echo int main() >junk.c\r
100echo #ifdef __DJGPP__ >>junk.c\r
101echo {return (__DJGPP__)*10;} >>junk.c\r
102echo #else >>junk.c\r
103echo #ifdef __GO32__ >>junk.c\r
104echo {return 10;} >>junk.c\r
105echo #else >>junk.c\r
106echo {return 0;} >>junk.c\r
107echo #endif >>junk.c\r
108echo #endif >>junk.c\r
8cdaacaf
RS
109gcc -o junk junk.c\r
110if not exist junk.exe coff2exe junk\r
f56c5217
RS
111junk\r
112If ErrorLevel 10 Goto go32Ok\r
113rm -f junk.c junk junk.exe\r
114Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!\r
115Goto End\r
116:go32Ok\r
b696f860
RS
117set djgpp_ver=1\r
118If ErrorLevel 20 set djgpp_ver=2\r
f56c5217 119rm -f junk.c junk junk.exe\r
b696f860 120Echo Configuring for DJGPP Version %DJGPP_VER% ...\r
ddff705b 121Rem ----------------------------------------------------------------------\r
3382cd59
RS
122Echo Configuring the source directory...\r
123cd src\r
3382cd59
RS
124\r
125rem Create "paths.h"\r
2f3e7987 126sed -f ../msdos/sed4.inp <paths.in >paths.tmp\r
ddff705b
MW
127update paths.tmp paths.h >nul\r
128rm -f paths.tmp\r
3382cd59
RS
129\r
130rem Create "config.h"\r
ddff705b 131rm -f config.h2 config.tmp\r
2f3e7987 132cp config.in config.tmp\r
331fdf1e 133if "%X11%" == "" goto src4\r
2f3e7987 134sed -f ../msdos/sed2x.inp <config.in >config.tmp\r
331fdf1e 135:src4\r
ddff705b
MW
136sed -f ../msdos/sed2.inp <config.tmp >config.h2\r
137update config.h2 config.h >nul\r
138rm -f config.tmp config.h2\r
3382cd59
RS
139\r
140rem On my system dir.h gets in the way. It's a VMS file so who cares.\r
141if exist dir.h ren dir.h vmsdir.h\r
142\r
2f3e7987 143rem Create "makefile" from "makefile.in".\r
dd0d2cf3 144rm -f makefile junk.c\r
2f3e7987 145sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c\r
b696f860 146If "%DJGPP_VER%" == "1" Goto mfV1\r
f56c5217
RS
147gcc -E junk.c | sed -f ../msdos/sed1v2.inp >makefile\r
148goto mfDone\r
149:mfV1\r
3382cd59 150gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile\r
f56c5217 151:mfDone\r
dd0d2cf3 152rm -f junk.c\r
2f3e7987 153\r
ddff705b
MW
154if "%X11%" == "" goto src5\r
155mv makefile makefile.tmp\r
156sed -f ../msdos/sed1x.inp <makefile.tmp >makefile\r
157rm -f makefile.tmp\r
158:src5\r
159\r
160if "%nodebug%" == "" goto src6\r
161sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r
f56c5217
RS
162sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >makefile\r
163rm -f makefile.tmp\r
ddff705b 164:src6\r
3382cd59
RS
165cd ..\r
166rem ----------------------------------------------------------------------\r
167Echo Configuring the library source directory...\r
168cd lib-src\r
169rem Create "makefile" from "makefile.in".\r
2f3e7987
RS
170sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c\r
171gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ \f]*$/d" >makefile.new\r
b696f860 172If "%DJGPP_VER%" == "2" goto libsrc-v2\r
331fdf1e 173sed -f ../msdos/sed3.inp <makefile.new >makefile\r
f56c5217
RS
174Goto libsrc2\r
175:libsrc-v2\r
176sed -f ../msdos/sed3v2.inp <makefile.new >makefile\r
177:libsrc2\r
ddff705b 178rm -f makefile.new junk.c\r
f56c5217 179if "%nodebug%" == "" goto libsrc3\r
ddff705b 180sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r
f56c5217
RS
181sed -e "/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp >makefile\r
182rm -f makefile.tmp\r
183:libsrc3\r
ddff705b
MW
184cd ..\r
185rem ----------------------------------------------------------------------\r
186if "%X11%" == "" goto oldx1\r
187Echo Configuring the oldxmenu directory...\r
188cd oldxmenu\r
189sed -f ../msdos/sed5x.inp <makefile.in >makefile\r
190if "%nodebug%" == "" goto oldx2\r
191sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r
192mv -f makefile.tmp makefile\r
193:oldx2\r
3382cd59 194cd ..\r
ddff705b 195:oldx1\r
3382cd59
RS
196rem ----------------------------------------------------------------------\r
197Echo Configuring the main directory...\r
809e1789
RS
198If "%DJGPP_VER%" == "1" goto mainv1\r
199Echo Looking for the GDB init file...\r
200If Exist src\_gdbinit goto gdbinitOk\r
201Echo ERROR:\r
202Echo I cannot find the GDB init file. It was called ".gdbinit" in\r
203Echo the Emacs distribution, but was probably renamed to some other\r
204Echo name without the leading dot when you untarred the archive.\r
205Echo It should be in the "src/" subdirectory. Please make sure this\r
206Echo file exists and is called "_gdbinit" with a leading underscore.\r
207Echo Then run CONFIG.BAT again with the same arguments you did now.\r
208goto End\r
209:gdbinitOk\r
210Echo Looking for the GDB init file...found\r
211copy msdos\mainmake.v2 makefile >nul\r
212:mainv1\r
b696f860 213If "%DJGPP_VER%" == "1" copy msdos\mainmake makefile >nul\r
3382cd59
RS
214rem ----------------------------------------------------------------------\r
215:end\r
331fdf1e 216set X11=\r
ddff705b 217set nodebug=\r
b696f860 218set djgpp_ver=\r