2 rem ----------------------------------------------------------------------
\r
3 rem Configuration script for MSDOS
\r
4 rem Copyright (C) 1994 Free Software Foundation, Inc.
\r
6 rem This file is part of GNU Emacs.
\r
8 rem GNU Emacs is free software; you can redistribute it and/or modify
\r
9 rem it under the terms of the GNU General Public License as published by
\r
10 rem the Free Software Foundation; either version 2, or (at your option)
\r
11 rem any later version.
\r
13 rem GNU Emacs is distributed in the hope that it will be useful,
\r
14 rem but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 rem GNU General Public License for more details.
\r
18 rem You should have received a copy of the GNU General Public License
\r
19 rem along with GNU Emacs; see the file COPYING. If not, write to
\r
20 rem the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
\r
21 rem ----------------------------------------------------------------------
\r
22 rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
\r
24 rem + msdos version 3 or better.
\r
25 rem + djgpp version 1,11 maint 4 or better.
\r
26 rem + make utility that allows breaking of the 128 chars limit on
\r
27 rem command lines. ndmake (as of version 4.5) won't work due to a
\r
28 rem line length limit.
\r
29 rem + rm, mv, chmod (From GNU file utilities).
\r
32 rem You should be able to get all the above utilities from all
\r
33 rem Simtel repositories, e.g., oak.oakland.edu in the directories
\r
34 rem "/pub/msdos/djgpp" and "/pub/msdos/gnuish". As usual, please
\r
35 rem use your local mirroring site to reduce trans-Atlantic traffic.
\r
36 rem ----------------------------------------------------------------------
\r
40 if "%1" == "" goto usage
\r
41 if "%1" == "--with-x" goto withx
\r
42 if "%1" == "--no-debug" goto nodebug
\r
43 if "%1" == "msdos" goto msdos
\r
45 echo Usage: config [--with-x] [--no-debug] msdos
\r
46 echo [Read the script before you run it.]
\r
48 rem ----------------------------------------------------------------------
\r
53 rem ----------------------------------------------------------------------
\r
58 rem ----------------------------------------------------------------------
\r
60 Echo Checking whether `sed' is available...
\r
61 Sed -e "w junk.$$$" <Nul
\r
62 If Exist junk.$$$ Goto sedOk
\r
63 Echo To configure `Emacs' you need to have `sed'!
\r
66 Echo Checking whether `rm' is available...
\r
68 If Not Exist junk.$$$ Goto rmOk
\r
69 Echo To configure `Emacs' you need to have `rm'!
\r
72 Echo Checking whether `mv' is available...
\r
76 If Exist junk.2 Goto mvOk
\r
77 Echo To configure `Emacs' you need to have `mv'!
\r
82 Echo Checking whether `gcc' is available...
\r
83 echo main(){} >junk.c
\r
85 if exist junk.o goto gccOk
\r
86 Echo To configure `Emacs' you need to have `gcc'!
\r
91 Rem ----------------------------------------------------------------------
\r
92 Echo Configuring the source directory...
\r
94 set PATHSH=paths-h.in
\r
95 if exist %PATHSH% goto src1
\r
96 set PATHSH=paths.h-in
\r
97 if exist %PATHSH% goto src1
\r
98 echo config: *** The file originally called "src/paths.h.in" cannot be found.
\r
102 set CONFIGH=config-h.in
\r
103 if exist %CONFIGH% goto src2
\r
104 set CONFIGH=config.h-in
\r
105 if exist %CONFIGH% goto src2
\r
106 echo config: *** The file originally called "src/config.h.in" cannot be found.
\r
110 set MAKEFILEIN=makefile.in-in
\r
111 if exist %MAKEFILEIN% goto src3
\r
112 set MAKEFILEIN=makefile-in.in
\r
113 if exist %MAKEFILEIN% goto src3
\r
114 echo makefile: *** The file originally called "src/makefile.in.in" cannot be found.
\r
119 rem Create "paths.h"
\r
120 sed -f ../msdos/sed4.inp <%PATHSH% >paths.tmp
\r
121 update paths.tmp paths.h >nul
\r
124 rem Create "config.h"
\r
125 rm -f config.h2 config.tmp
\r
126 cp %CONFIGH% config.tmp
\r
127 if "%X11%" == "" goto src4
\r
128 sed -f ../msdos/sed2x.inp <%CONFIGH% >config.tmp
\r
130 sed -f ../msdos/sed2.inp <config.tmp >config.h2
\r
131 update config.h2 config.h >nul
\r
132 rm -f config.tmp config.h2
\r
134 rem On my system dir.h gets in the way. It's a VMS file so who cares.
\r
135 if exist dir.h ren dir.h vmsdir.h
\r
137 rem Create "makefile" from "makefile.in.in".
\r
138 rm -f makefile junk.c
\r
139 sed -e "1,/cpp stuff/s@^# .*$@@" <%MAKEFILEIN% >junk.c
\r
140 gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile
\r
142 if "%X11%" == "" goto src5
\r
143 mv makefile makefile.tmp
\r
144 sed -f ../msdos/sed1x.inp <makefile.tmp >makefile
\r
148 if "%nodebug%" == "" goto src6
\r
149 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
\r
150 mv -f makefile.tmp makefile
\r
153 rem ----------------------------------------------------------------------
\r
154 Echo Configuring the library source directory...
\r
156 set MAKEFILEIN=makefile.in-in
\r
157 if exist %MAKEFILEIN% goto libsrc1
\r
158 set MAKEFILEIN=makefile-in.in
\r
159 if exist %MAKEFILEIN% goto libsrc1
\r
160 echo makefile: *** The file originally called "lib-src/Makefile.in.in" cannot be found.
\r
164 rem Create "makefile" from "makefile.in".
\r
165 sed -e "1,/cpp stuff/s@^# .*$@@" <%MAKEFILEIN% >junk.c
\r
166 gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[
\f]*$/d" >Makefile.new
\r
167 sed -f ../msdos/sed3.inp <makefile.new >makefile
\r
168 rm -f makefile.new junk.c
\r
169 if "%nodebug%" == "" goto libsrc2
\r
170 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
\r
171 mv -f makefile.tmp makefile
\r
174 rem ----------------------------------------------------------------------
\r
175 if "%X11%" == "" goto oldx1
\r
176 Echo Configuring the oldxmenu directory...
\r
178 sed -f ../msdos/sed5x.inp <makefile.in >makefile
\r
179 if "%nodebug%" == "" goto oldx2
\r
180 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
\r
181 mv -f makefile.tmp makefile
\r
185 rem ----------------------------------------------------------------------
\r
186 Echo Configuring the main directory...
\r
187 copy msdos\mainmake makefile >nul
\r
188 rem ----------------------------------------------------------------------
\r