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.12maint1 or later (version 2.0 or later recommended).
\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. The make that comes with djgpp does work.
\r
29 rem + rm and mv (from GNU file utilities).
\r
30 rem + sed (you can use the port that comes with DJGPP).
\r
32 rem You should be able to get all the above utilities from any SimTel
\r
33 rem repository, e.g. ftp.coast.net, in the directories
\r
34 rem "SimTel/vendors/djgpp" and "SimTel/vendors/gnu/gnuish/dos_only". As
\r
35 rem usual, please use your local mirroring site to reduce trans-Atlantic
\r
37 rem ----------------------------------------------------------------------
\r
42 if "%1" == "" goto usage
\r
43 if "%1" == "--with-x" goto withx
\r
44 if "%1" == "--no-debug" goto nodebug
\r
45 if "%1" == "msdos" goto msdos
\r
47 echo Usage: config [--with-x] [--no-debug] msdos
\r
48 echo [Read the script before you run it.]
\r
50 rem ----------------------------------------------------------------------
\r
55 rem ----------------------------------------------------------------------
\r
60 rem ----------------------------------------------------------------------
\r
62 Echo Checking whether 'sed' is available...
\r
63 sed -e "w junk.$$$" <Nul
\r
64 If Exist junk.$$$ Goto sedOk
\r
65 Echo To configure 'Emacs' you need to have 'sed'!
\r
68 Echo Checking whether 'rm' is available...
\r
70 If Not Exist junk.$$$ Goto rmOk
\r
71 Echo To configure 'Emacs' you need to have 'rm'!
\r
74 Echo Checking whether 'mv' is available...
\r
78 If Exist junk.2 Goto mvOk
\r
79 Echo To configure 'Emacs' you need to have 'mv'!
\r
84 Echo Checking whether 'gcc' is available...
\r
85 echo main(){} >junk.c
\r
87 if exist junk.o goto gccOk
\r
88 Echo To configure 'Emacs' you need to have 'gcc'!
\r
92 rm -f junk.c junk.o junk junk.exe
\r
93 Echo Checking what version of DJGPP is installed...
\r
94 If Not "%DJGPP%" == "" goto djgppOk
\r
95 Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!
\r
98 echo int main() >junk.c
\r
99 echo #ifdef __DJGPP__ >>junk.c
\r
100 echo {return (__DJGPP__)*10;} >>junk.c
\r
101 echo #else >>junk.c
\r
102 echo #ifdef __GO32__ >>junk.c
\r
103 echo {return 10;} >>junk.c
\r
104 echo #else >>junk.c
\r
105 echo {return 0;} >>junk.c
\r
106 echo #endif >>junk.c
\r
107 echo #endif >>junk.c
\r
109 if not exist junk.exe coff2exe junk
\r
111 If ErrorLevel 10 Goto go32Ok
\r
112 rm -f junk.c junk junk.exe
\r
113 Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!
\r
117 If ErrorLevel 20 set djgpp_ver=2
\r
118 rm -f junk.c junk junk.exe
\r
119 Echo Configuring for DJGPP Version %DJGPP_VER% ...
\r
120 Rem ----------------------------------------------------------------------
\r
121 Echo Configuring the source directory...
\r
124 rem Create "paths.h"
\r
125 sed -f ../msdos/sed4.inp <paths.in >paths.tmp
\r
126 update paths.tmp paths.h >nul
\r
129 rem Create "config.h"
\r
130 rm -f config.h2 config.tmp
\r
131 cp config.in config.tmp
\r
132 if "%X11%" == "" goto src4
\r
133 sed -f ../msdos/sed2x.inp <config.in >config.tmp
\r
135 sed -f ../msdos/sed2.inp <config.tmp >config.h2
\r
136 update config.h2 config.h >nul
\r
137 rm -f config.tmp config.h2
\r
139 rem On my system dir.h gets in the way. It's a VMS file so who cares.
\r
140 if exist dir.h ren dir.h vmsdir.h
\r
142 rem Create "makefile" from "makefile.in".
\r
143 rm -f makefile junk.c
\r
144 sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c
\r
145 If "%DJGPP_VER%" == "1" Goto mfV1
\r
146 gcc -E junk.c | sed -f ../msdos/sed1v2.inp >makefile
\r
149 gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile
\r
153 if "%X11%" == "" goto src5
\r
154 mv makefile makefile.tmp
\r
155 sed -f ../msdos/sed1x.inp <makefile.tmp >makefile
\r
159 if "%nodebug%" == "" goto src6
\r
160 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
\r
161 sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >makefile
\r
165 rem ----------------------------------------------------------------------
\r
166 Echo Configuring the library source directory...
\r
168 rem Create "makefile" from "makefile.in".
\r
169 sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c
\r
170 gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[
\f]*$/d" >makefile.new
\r
171 If "%DJGPP_VER%" == "2" goto libsrc-v2
\r
172 sed -f ../msdos/sed3.inp <makefile.new >makefile
\r
175 sed -f ../msdos/sed3v2.inp <makefile.new >makefile
\r
177 rm -f makefile.new junk.c
\r
178 if "%nodebug%" == "" goto libsrc3
\r
179 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
\r
180 sed -e "/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp >makefile
\r
184 rem ----------------------------------------------------------------------
\r
185 if "%X11%" == "" goto oldx1
\r
186 Echo Configuring the oldxmenu directory...
\r
188 sed -f ../msdos/sed5x.inp <makefile.in >makefile
\r
189 if "%nodebug%" == "" goto oldx2
\r
190 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
\r
191 mv -f makefile.tmp makefile
\r
195 rem ----------------------------------------------------------------------
\r
196 Echo Configuring the main directory...
\r
197 If "%DJGPP_VER%" == "1" goto mainv1
\r
198 Echo Looking for the GDB init file...
\r
199 If Exist src\_gdbinit goto gdbinitOk
\r
201 Echo I cannot find the GDB init file. It was called ".gdbinit" in
\r
202 Echo the Emacs distribution, but was probably renamed to some other
\r
203 Echo name without the leading dot when you untarred the archive.
\r
204 Echo It should be in the "src/" subdirectory. Please make sure this
\r
205 Echo file exists and is called "_gdbinit" with a leading underscore.
\r
206 Echo Then run CONFIG.BAT again with the same arguments you did now.
\r
209 Echo Looking for the GDB init file...found
\r
210 copy msdos\mainmake.v2 makefile >nul
\r
212 If "%DJGPP_VER%" == "1" copy msdos\mainmake makefile >nul
\r
213 rem ----------------------------------------------------------------------
\r