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'!
92 rm
-f junk.c junk.o junk junk.exe
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
109 if not exist junk.exe coff2exe junk
111 If ErrorLevel 10 Goto go32Ok
112 rm
-f junk.c junk junk.exe
113 Echo To compile
'Emacs' under MS
-DOS you MUST have DJGPP installed
!
117 If ErrorLevel 20 set djgpp_ver
=2
118 rm
-f junk.c junk junk.exe
119 Echo Configuring
for DJGPP Version
%DJGPP_VER% ...
120 Rem ----------------------------------------------------------------------
121 Echo Configuring the source directory...
125 sed
-f ..
/msdos
/sed4.inp
<paths.in
>paths.tmp
126 update paths.tmp paths.h
>nul
129 rem Create "config.h"
130 rm
-f config.h2 config.tmp
131 cp config.in config.tmp
132 if "%X11%" == "" goto src4
133 sed
-f ..
/msdos
/sed2x.inp
<config.in
>config.tmp
135 sed
-f ..
/msdos
/sed2.inp
<config.tmp
>config.h2
136 update config.h2 config.h
>nul
137 rm
-f config.tmp config.h2
139 rem On my system dir.h gets in the way. It's a VMS file so who cares.
140 if exist dir.h
ren dir.h vmsdir.h
142 rem Create "makefile" from "makefile.in".
143 rm
-f makefile junk.c
144 sed
-e
"1,/cpp stuff/s@^# .*$@@" <makefile.in
>junk.c
145 If "%DJGPP_VER%" == "1" Goto mfV1
146 gcc
-E junk.c | sed
-f ..
/msdos
/sed1v2.inp
>makefile
149 gcc
-E junk.c | sed
-f ..
/msdos
/sed1.inp
>makefile
153 if "%X11%" == "" goto src5
154 mv makefile makefile.tmp
155 sed
-f ..
/msdos
/sed1x.inp
<makefile.tmp
>makefile
159 if "%nodebug%" == "" goto src6
160 sed
-e
"/^CFLAGS *=/s/ *-g//" <makefile
>makefile.tmp
161 sed
-e
"/^LDFLAGS *=/s/=/=-s/" <makefile.tmp
>makefile
165 rem ----------------------------------------------------------------------
166 Echo Configuring the library source directory...
168 rem Create "makefile" from "makefile.in".
169 sed
-e
"1,/cpp stuff/s@^# .*$@@" <makefile.in
>junk.c
170 gcc
-E
-I.
-I..
/src junk.c | sed
-e
"s/^ / /" -e
"/^#/d" -e
"/^[ \f]*$/d" >makefile.new
171 If "%DJGPP_VER%" == "2" goto libsrc
-v2
172 sed
-f ..
/msdos
/sed3.inp
<makefile.new
>makefile
175 sed
-f ..
/msdos
/sed3v2.inp
<makefile.new
>makefile
177 rm
-f makefile.new junk.c
178 if "%nodebug%" == "" goto libsrc3
179 sed
-e
"/^CFLAGS *=/s/ *-g//" <makefile
>makefile.tmp
180 sed
-e
"/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp
>makefile
184 rem ----------------------------------------------------------------------
185 if "%X11%" == "" goto oldx1
186 Echo Configuring the oldxmenu directory...
188 sed
-f ..
/msdos
/sed5x.inp
<makefile.in
>makefile
189 if "%nodebug%" == "" goto oldx2
190 sed
-e
"/^CFLAGS *=/s/ *-g//" <makefile
>makefile.tmp
191 mv
-f makefile.tmp makefile
195 rem ----------------------------------------------------------------------
196 Echo Configuring the main directory...
197 If "%DJGPP_VER%" == "2" copy msdos\mainmake.v2 makefile
>nul
198 If "%DJGPP_VER%" == "1" copy msdos\mainmake makefile
>nul
199 rem ----------------------------------------------------------------------