2 rem ----------------------------------------------------------------------
3 rem Configuration script for MSDOS
4 rem Copyright (C) 1994 Free Software Foundation, Inc.
6 rem This file is part of GNU Emacs.
8 rem GNU Emacs is free software; you can redistribute it and/or modify
9 rem it under the terms of the GNU General Public License as published by
10 rem the Free Software Foundation; either version 2, or (at your option)
11 rem any later version.
13 rem GNU Emacs is distributed in the hope that it will be useful,
14 rem but WITHOUT ANY WARRANTY; without even the implied warranty of
15 rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 rem GNU General Public License for more details.
18 rem You should have received a copy of the GNU General Public License
19 rem along with GNU Emacs; see the file COPYING. If not, write to
20 rem the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21 rem ----------------------------------------------------------------------
22 rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
24 rem + msdos version 3 or better.
25 rem + djgpp version 1.12maint1 or later (version 2.0 or later recommended).
26 rem + make utility that allows breaking of the 128 chars limit on
27 rem command lines. ndmake (as of version 4.5) won't work due to a
28 rem line length limit. The make that comes with djgpp does work.
29 rem + rm and mv (from GNU file utilities).
30 rem + sed (you can use the port that comes with DJGPP).
32 rem You should be able to get all the above utilities from any SimTel
33 rem repository, e.g. ftp.coast.net, in the directories
34 rem "SimTel/vendors/djgpp" and "SimTel/vendors/gnu/gnuish/dos_only". As
35 rem usual, please use your local mirroring site to reduce trans-Atlantic
37 rem ----------------------------------------------------------------------
42 if "%1" == "" goto usage
43 if "%1" == "--with-x" goto withx
44 if "%1" == "--no-debug" goto nodebug
45 if "%1" == "msdos" goto msdos
47 echo Usage
: config
[--with
-x
] [--no
-debug] msdos
48 echo [Read the script before you
run it.
]
50 rem ----------------------------------------------------------------------
55 rem ----------------------------------------------------------------------
60 rem ----------------------------------------------------------------------
62 Echo Checking whether
'sed' is available...
63 sed
-e
"w junk.$$$" <Nul
64 If Exist junk.$$$
Goto sedOk
65 Echo To configure
'Emacs' you need to have
'sed'!
68 Echo Checking whether
'rm' is available...
70 If Not Exist junk.$$$
Goto rmOk
71 Echo To configure
'Emacs' you need to have
'rm'!
74 Echo Checking whether
'mv' is available...
78 If Exist junk
.2 Goto mvOk
79 Echo To configure
'Emacs' you need to have
'mv'!
84 Echo Checking whether
'gcc' is available...
87 if exist junk.o
goto gccOk
88 Echo To configure
'Emacs' you need to have
'gcc'!
93 Echo Checking what version of DJGPP is installed...
94 If Not "%DJGPP%" == "" goto djgppOk
95 Echo To compile
'Emacs' under MS
-DOS you MUST have DJGPP installed
!
98 echo int main
() >junk.c
99 echo #ifdef __DJGPP__
>>junk.c
100 echo {return (__DJGPP__
)*10;} >>junk.c
102 echo #ifdef __GO32__
>>junk.c
103 echo {return 10;} >>junk.c
105 echo {return 0;} >>junk.c
108 gcc
-o junk.exe junk.c
110 If ErrorLevel 10 Goto go32Ok
111 rm
-f junk.c junk junk.exe
112 Echo To compile
'Emacs' under MS
-DOS you MUST have DJGPP installed
!
116 If ErrorLevel 20 set djgpp
-ver=2
117 rm
-f junk.c junk junk.exe
118 Echo Configuring
for DJGPP Version
%DJGPP
-VER% ...
119 Rem ----------------------------------------------------------------------
120 Echo Configuring the source directory...
124 sed
-f ..
/msdos
/sed4.inp
<paths.in
>paths.tmp
125 update paths.tmp paths.h
>nul
128 rem Create "config.h"
129 rm
-f config.h2 config.tmp
130 cp config.in config.tmp
131 if "%X11%" == "" goto src4
132 sed
-f ..
/msdos
/sed2x.inp
<config.in
>config.tmp
134 sed
-f ..
/msdos
/sed2.inp
<config.tmp
>config.h2
135 update config.h2 config.h
>nul
136 rm
-f config.tmp config.h2
138 rem On my system dir.h gets in the way. It's a VMS file so who cares.
139 if exist dir.h
ren dir.h vmsdir.h
141 rem Create "makefile" from "makefile.in".
142 rm
-f makefile junk.c
143 sed
-e
"1,/cpp stuff/s@^# .*$@@" <makefile.in
>junk.c
144 If "%DJGPP-VER%" == "1" Goto mfV1
145 gcc
-E junk.c | sed
-f ..
/msdos
/sed1v2.inp
>makefile
148 gcc
-E junk.c | sed
-f ..
/msdos
/sed1.inp
>makefile
152 if "%X11%" == "" goto src5
153 mv makefile makefile.tmp
154 sed
-f ..
/msdos
/sed1x.inp
<makefile.tmp
>makefile
158 if "%nodebug%" == "" goto src6
159 sed
-e
"/^CFLAGS *=/s/ *-g//" <makefile
>makefile.tmp
160 sed
-e
"/^LDFLAGS *=/s/=/=-s/" <makefile.tmp
>makefile
164 rem ----------------------------------------------------------------------
165 Echo Configuring the library source directory...
167 rem Create "makefile" from "makefile.in".
168 sed
-e
"1,/cpp stuff/s@^# .*$@@" <makefile.in
>junk.c
169 gcc
-E
-I.
-I..
/src junk.c | sed
-e
"s/^ / /" -e
"/^#/d" -e
"/^[ \f]*$/d" >makefile.new
170 If "%DJGPP-VER%" == "2" goto libsrc
-v2
171 sed
-f ..
/msdos
/sed3.inp
<makefile.new
>makefile
174 sed
-f ..
/msdos
/sed3v2.inp
<makefile.new
>makefile
176 rm
-f makefile.new junk.c
177 if "%nodebug%" == "" goto libsrc3
178 sed
-e
"/^CFLAGS *=/s/ *-g//" <makefile
>makefile.tmp
179 sed
-e
"/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp
>makefile
183 rem ----------------------------------------------------------------------
184 if "%X11%" == "" goto oldx1
185 Echo Configuring the oldxmenu directory...
187 sed
-f ..
/msdos
/sed5x.inp
<makefile.in
>makefile
188 if "%nodebug%" == "" goto oldx2
189 sed
-e
"/^CFLAGS *=/s/ *-g//" <makefile
>makefile.tmp
190 mv
-f makefile.tmp makefile
194 rem ----------------------------------------------------------------------
195 Echo Configuring the main directory...
196 If "%DJGPP-VER%" == "2" copy msdos\mainmake.v2 makefile
>nul
197 If "%DJGPP-VER%" == "1" copy msdos\mainmake makefile
>nul
198 rem ----------------------------------------------------------------------