Use custom-asis instead of as-is.
[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
19rem along with GNU Emacs; see the file COPYING. If not, write to\r
20rem the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
21rem ----------------------------------------------------------------------\r
22rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r
23rem\r
331fdf1e 24rem + msdos version 3 or better.\r
293e5aa6 25rem + djgpp version 1,11 maint 4 or better (but not version 2).\r
331fdf1e
RS
26rem + make utility that allows breaking of the 128 chars limit on\r
27rem command lines. ndmake (as of version 4.5) won't work due to a\r
293e5aa6 28rem line length limit. The make that comes with djgpp does work.\r
3382cd59
RS
29rem + rm, mv, chmod (From GNU file utilities).\r
30rem + sed.\r
331fdf1e 31rem\r
293e5aa6
RS
32rem You should be able to get all the above utilities from\r
33rem oak.oakland.edu in the directories\r
34rem "/pub/msdos/djgpp" and "/pub/msdos/gnuish". There are other mirror
35rem sites as well.\r
3382cd59 36rem ----------------------------------------------------------------------\r
ddff705b
MW
37set X11=\r
38set nodebug=\r
39:again\r
40if "%1" == "" goto usage\r
41if "%1" == "--with-x" goto withx\r
42if "%1" == "--no-debug" goto nodebug\r
3382cd59
RS
43if "%1" == "msdos" goto msdos\r
44:usage\r
ddff705b
MW
45echo Usage: config [--with-x] [--no-debug] msdos\r
46echo [Read the script before you run it.]\r
3382cd59
RS
47goto end\r
48rem ----------------------------------------------------------------------\r
ddff705b
MW
49:withx\r
50set X11=Y\r
51shift\r
52goto again\r
331fdf1e 53rem ----------------------------------------------------------------------\r
ddff705b
MW
54:nodebug\r
55set nodebug=Y\r
56shift\r
57goto again\r
3382cd59 58rem ----------------------------------------------------------------------\r
ddff705b 59:msdos\r
2f3e7987
RS
60Echo Checking whether 'sed' is available...\r
61sed -e "w junk.$$$" <Nul\r
ddff705b 62If Exist junk.$$$ Goto sedOk\r
2f3e7987 63Echo To configure 'Emacs' you need to have 'sed'!\r
ddff705b
MW
64Goto End\r
65:sedOk\r
2f3e7987 66Echo Checking whether 'rm' is available...\r
ddff705b
MW
67rm -f junk.$$$\r
68If Not Exist junk.$$$ Goto rmOk\r
2f3e7987 69Echo To configure 'Emacs' you need to have 'rm'!\r
ddff705b
MW
70Goto End\r
71:rmOk\r
2f3e7987 72Echo Checking whether 'mv' is available...\r
ddff705b
MW
73rm -f junk.1 junk.2\r
74echo foo >junk.1\r
75mv junk.1 junk.2\r
76If Exist junk.2 Goto mvOk\r
2f3e7987 77Echo To configure 'Emacs' you need to have 'mv'!\r
ddff705b
MW
78rm -f junk.1\r
79Goto End\r
80:mvOk\r
81rm -f junk.2\r
2f3e7987 82Echo Checking whether 'gcc' is available...\r
ddff705b
MW
83echo main(){} >junk.c\r
84gcc -c junk.c\r
85if exist junk.o goto gccOk\r
2f3e7987 86Echo To configure 'Emacs' you need to have 'gcc'!\r
ddff705b
MW
87rm -f junk.c\r
88Goto End\r
89:gccOk\r
90rm -f junk.c junk.o\r
91Rem ----------------------------------------------------------------------\r
3382cd59
RS
92Echo Configuring the source directory...\r
93cd src\r
3382cd59
RS
94\r
95rem Create "paths.h"\r
2f3e7987 96sed -f ../msdos/sed4.inp <paths.in >paths.tmp\r
ddff705b
MW
97update paths.tmp paths.h >nul\r
98rm -f paths.tmp\r
3382cd59
RS
99\r
100rem Create "config.h"\r
ddff705b 101rm -f config.h2 config.tmp\r
2f3e7987 102cp config.in config.tmp\r
331fdf1e 103if "%X11%" == "" goto src4\r
2f3e7987 104sed -f ../msdos/sed2x.inp <config.in >config.tmp\r
331fdf1e 105:src4\r
ddff705b
MW
106sed -f ../msdos/sed2.inp <config.tmp >config.h2\r
107update config.h2 config.h >nul\r
108rm -f config.tmp config.h2\r
3382cd59
RS
109\r
110rem On my system dir.h gets in the way. It's a VMS file so who cares.\r
111if exist dir.h ren dir.h vmsdir.h\r
112\r
2f3e7987 113rem Create "makefile" from "makefile.in".\r
dd0d2cf3 114rm -f makefile junk.c\r
2f3e7987 115sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c\r
3382cd59 116gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile\r
dd0d2cf3 117rm -f junk.c\r
2f3e7987 118\r
ddff705b
MW
119if "%X11%" == "" goto src5\r
120mv makefile makefile.tmp\r
121sed -f ../msdos/sed1x.inp <makefile.tmp >makefile\r
122rm -f makefile.tmp\r
123:src5\r
124\r
125if "%nodebug%" == "" goto src6\r
126sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r
127mv -f makefile.tmp makefile\r
128:src6\r
3382cd59
RS
129cd ..\r
130rem ----------------------------------------------------------------------\r
131Echo Configuring the library source directory...\r
132cd lib-src\r
133rem Create "makefile" from "makefile.in".\r
2f3e7987
RS
134sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c\r
135gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ \f]*$/d" >makefile.new\r
331fdf1e 136sed -f ../msdos/sed3.inp <makefile.new >makefile\r
ddff705b
MW
137rm -f makefile.new junk.c\r
138if "%nodebug%" == "" goto libsrc2\r
139sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r
140mv -f makefile.tmp makefile\r
141:libsrc2\r
142cd ..\r
143rem ----------------------------------------------------------------------\r
144if "%X11%" == "" goto oldx1\r
145Echo Configuring the oldxmenu directory...\r
146cd oldxmenu\r
147sed -f ../msdos/sed5x.inp <makefile.in >makefile\r
148if "%nodebug%" == "" goto oldx2\r
149sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r
150mv -f makefile.tmp makefile\r
151:oldx2\r
3382cd59 152cd ..\r
ddff705b 153:oldx1\r
3382cd59
RS
154rem ----------------------------------------------------------------------\r
155Echo Configuring the main directory...\r
156copy msdos\mainmake makefile >nul\r
157rem ----------------------------------------------------------------------\r
158:end\r
331fdf1e 159set X11=\r
ddff705b 160set nodebug=\r