Define STDC_HEADERS.
[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
RS
24rem + msdos version 3 or better.\r
25rem + djgpp version 1,11 maint 4 or better.\r
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
28rem line length limit.\r
3382cd59
RS
29rem + rm, mv, chmod (From GNU file utilities).\r
30rem + sed.\r
331fdf1e 31rem\r
ddff705b
MW
32rem You should be able to get all the above utilities from all\r
33rem Simtel repositories, e.g., oak.oakland.edu in the directories\r
34rem "/pub/msdos/djgpp" and "/pub/msdos/gnuish". As usual, please\r
35rem use your local mirroring site to reduce trans-Atlantic traffic.\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
MW
59:msdos\r
60Echo Checking whether `sed' is available...\r
61Sed -e "w junk.$$$" <Nul\r
62If Exist junk.$$$ Goto sedOk\r
63Echo To configure `Emacs' you need to have `sed'!\r
64Goto End\r
65:sedOk\r
66Echo Checking whether `rm' is available...\r
67rm -f junk.$$$\r
68If Not Exist junk.$$$ Goto rmOk\r
69Echo To configure `Emacs' you need to have `rm'!\r
70Goto End\r
71:rmOk\r
72Echo Checking whether `mv' is available...\r
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
77Echo To configure `Emacs' you need to have `mv'!\r
78rm -f junk.1\r
79Goto End\r
80:mvOk\r
81rm -f junk.2\r
82Echo Checking whether `gcc' is available...\r
83echo main(){} >junk.c\r
84gcc -c junk.c\r
85if exist junk.o goto gccOk\r
86Echo To configure `Emacs' you need to have `gcc'!\r
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
94set PATHSH=paths-h.in\r
95if exist %PATHSH% goto src1\r
96set PATHSH=paths.h-in\r
97if exist %PATHSH% goto src1\r
98echo config: *** The file originally called "src/paths.h.in" cannot be found.\r
99cd ..\r
100goto end\r
101:src1\r
102set CONFIGH=config-h.in\r
103if exist %CONFIGH% goto src2\r
104set CONFIGH=config.h-in\r
105if exist %CONFIGH% goto src2\r
106echo config: *** The file originally called "src/config.h.in" cannot be found.\r
107cd ..\r
108goto end\r
109:src2\r
110set MAKEFILEIN=makefile.in-in\r
111if exist %MAKEFILEIN% goto src3\r
112set MAKEFILEIN=makefile-in.in\r
113if exist %MAKEFILEIN% goto src3\r
114echo makefile: *** The file originally called "src/makefile.in.in" cannot be found.\r
115cd ..\r
116goto end\r
117:src3\r
118\r
119rem Create "paths.h"\r
ddff705b
MW
120sed -f ../msdos/sed4.inp <%PATHSH% >paths.tmp\r
121update paths.tmp paths.h >nul\r
122rm -f paths.tmp\r
3382cd59
RS
123\r
124rem Create "config.h"\r
ddff705b 125rm -f config.h2 config.tmp\r
331fdf1e
RS
126cp %CONFIGH% config.tmp\r
127if "%X11%" == "" goto src4\r
ddff705b 128sed -f ../msdos/sed2x.inp <%CONFIGH% >config.tmp\r
331fdf1e 129:src4\r
ddff705b
MW
130sed -f ../msdos/sed2.inp <config.tmp >config.h2\r
131update config.h2 config.h >nul\r
132rm -f config.tmp config.h2\r
3382cd59
RS
133\r
134rem On my system dir.h gets in the way. It's a VMS file so who cares.\r
135if exist dir.h ren dir.h vmsdir.h\r
136\r
ddff705b 137rem Create "makefile" from "makefile.in.in".\r
dd0d2cf3 138rm -f makefile junk.c\r
02b81698 139sed -e "1,/cpp stuff/s@^# .*$@@" <%MAKEFILEIN% >junk.c\r
3382cd59 140gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile\r
dd0d2cf3 141rm -f junk.c\r
ddff705b
MW
142if "%X11%" == "" goto src5\r
143mv makefile makefile.tmp\r
144sed -f ../msdos/sed1x.inp <makefile.tmp >makefile\r
145rm -f makefile.tmp\r
146:src5\r
147\r
148if "%nodebug%" == "" goto src6\r
149sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r
150mv -f makefile.tmp makefile\r
151:src6\r
3382cd59
RS
152cd ..\r
153rem ----------------------------------------------------------------------\r
154Echo Configuring the library source directory...\r
155cd lib-src\r
315ebba3
RS
156set MAKEFILEIN=makefile.in-in\r
157if exist %MAKEFILEIN% goto libsrc1\r
158set MAKEFILEIN=makefile-in.in\r
159if exist %MAKEFILEIN% goto libsrc1\r
160echo makefile: *** The file originally called "lib-src/Makefile.in.in" cannot be found.\r
161cd ..\r
162goto end\r
163:libsrc1\r
3382cd59 164rem Create "makefile" from "makefile.in".\r
02b81698 165sed -e "1,/cpp stuff/s@^# .*$@@" <%MAKEFILEIN% >junk.c\r
331fdf1e
RS
166gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ \f]*$/d" >Makefile.new\r
167sed -f ../msdos/sed3.inp <makefile.new >makefile\r
ddff705b
MW
168rm -f makefile.new junk.c\r
169if "%nodebug%" == "" goto libsrc2\r
170sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r
171mv -f makefile.tmp makefile\r
172:libsrc2\r
173cd ..\r
174rem ----------------------------------------------------------------------\r
175if "%X11%" == "" goto oldx1\r
176Echo Configuring the oldxmenu directory...\r
177cd oldxmenu\r
178sed -f ../msdos/sed5x.inp <makefile.in >makefile\r
179if "%nodebug%" == "" goto oldx2\r
180sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r
181mv -f makefile.tmp makefile\r
182:oldx2\r
3382cd59 183cd ..\r
ddff705b 184:oldx1\r
3382cd59
RS
185rem ----------------------------------------------------------------------\r
186Echo Configuring the main directory...\r
187copy msdos\mainmake makefile >nul\r
188rem ----------------------------------------------------------------------\r
189:end\r
331fdf1e 190set X11=\r
ddff705b 191set nodebug=\r
331fdf1e
RS
192set MAKEFILEIN=\r
193set PATHSH=\r
194set CONFIGH=\r