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 the
\r
20 rem Free Software Foundation, Inc., 59 Temple Place - Suite 330,
\r
21 rem Boston, MA 02111-1307, USA.
\r
22 rem ----------------------------------------------------------------------
\r
23 rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
\r
25 rem + msdos version 3 or better.
\r
26 rem + djgpp version 1.12maint1 or later (version 2.0 or later recommended).
\r
27 rem + make utility that allows breaking of the 128 chars limit on
\r
28 rem command lines. ndmake (as of version 4.5) won't work due to a
\r
29 rem line length limit. The make that comes with djgpp does work.
\r
30 rem + rm and mv (from GNU file utilities).
\r
31 rem + sed (you can use the port that comes with DJGPP).
\r
33 rem You should be able to get all the above utilities from any SimTel
\r
34 rem repository, e.g. ftp.coast.net, in the directories
\r
35 rem "SimTel/vendors/djgpp" and "SimTel/vendors/gnu/gnuish/dos_only". As
\r
36 rem usual, please use your local mirroring site to reduce trans-Atlantic
\r
38 rem ----------------------------------------------------------------------
\r
43 if "%1" == "" goto usage
\r
44 if "%1" == "--with-x" goto withx
\r
45 if "%1" == "--no-debug" goto nodebug
\r
46 if "%1" == "msdos" goto msdos
\r
48 echo Usage: config [--with-x] [--no-debug] msdos
\r
49 echo [Read the script before you run it.]
\r
51 rem ----------------------------------------------------------------------
\r
56 rem ----------------------------------------------------------------------
\r
61 rem ----------------------------------------------------------------------
\r
63 Echo Checking whether 'sed' is available...
\r
64 sed -e "w junk.$$$" <Nul
\r
65 If Exist junk.$$$ Goto sedOk
\r
66 Echo To configure 'Emacs' you need to have 'sed'!
\r
69 Echo Checking whether 'rm' is available...
\r
71 If Not Exist junk.$$$ Goto rmOk
\r
72 Echo To configure 'Emacs' you need to have 'rm'!
\r
75 Echo Checking whether 'mv' is available...
\r
79 If Exist junk.2 Goto mvOk
\r
80 Echo To configure 'Emacs' you need to have 'mv'!
\r
85 Echo Checking whether 'gcc' is available...
\r
86 echo main(){} >junk.c
\r
88 if exist junk.o goto gccOk
\r
89 Echo To configure 'Emacs' you need to have 'gcc'!
\r
93 rm -f junk.c junk.o junk junk.exe
\r
94 Echo Checking what version of DJGPP is installed...
\r
95 If Not "%DJGPP%" == "" goto djgppOk
\r
96 Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!
\r
99 echo int main() >junk.c
\r
100 echo #ifdef __DJGPP__ >>junk.c
\r
101 echo {return (__DJGPP__)*10;} >>junk.c
\r
102 echo #else >>junk.c
\r
103 echo #ifdef __GO32__ >>junk.c
\r
104 echo {return 10;} >>junk.c
\r
105 echo #else >>junk.c
\r
106 echo {return 0;} >>junk.c
\r
107 echo #endif >>junk.c
\r
108 echo #endif >>junk.c
\r
110 if not exist junk.exe coff2exe junk
\r
112 If ErrorLevel 10 Goto go32Ok
\r
113 rm -f junk.c junk junk.exe
\r
114 Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!
\r
118 If ErrorLevel 20 set djgpp_ver=2
\r
119 rm -f junk.c junk junk.exe
\r
120 Echo Configuring for DJGPP Version %DJGPP_VER% ...
\r
121 Rem ----------------------------------------------------------------------
\r
122 Echo Configuring the source directory...
\r
125 rem Create "paths.h"
\r
126 sed -f ../msdos/sed4.inp <paths.in >paths.tmp
\r
127 update paths.tmp paths.h >nul
\r
130 rem Create "config.h"
\r
131 rm -f config.h2 config.tmp
\r
132 sed -e '' config.in > config.tmp
\r
133 if "%X11%" == "" goto src4
\r
134 sed -f ../msdos/sed2x.inp <config.in >config.tmp
\r
136 sed -f ../msdos/sed2.inp <config.tmp >config.h2
\r
137 update config.h2 config.h >nul
\r
138 rm -f config.tmp config.h2
\r
140 rem On my system dir.h gets in the way. It's a VMS file so who cares.
\r
141 if exist dir.h ren dir.h vmsdir.h
\r
143 rem Create "makefile" from "makefile.in".
\r
144 rm -f Makefile junk.c
\r
145 sed -e "1,/cpp stuff/s@^# .*$@@" <Makefile.in >junk.c
\r
146 If "%DJGPP_VER%" == "1" Goto mfV1
\r
147 gcc -E junk.c | sed -f ../msdos/sed1v2.inp >Makefile
\r
150 gcc -E junk.c | sed -f ../msdos/sed1.inp >Makefile
\r
154 if "%X11%" == "" goto src5
\r
155 mv Makefile makefile.tmp
\r
156 sed -f ../msdos/sed1x.inp <makefile.tmp >Makefile
\r
160 if "%nodebug%" == "" goto src6
\r
161 sed -e "/^CFLAGS *=/s/ *-g//" <Makefile >makefile.tmp
\r
162 sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >Makefile
\r
166 rem ----------------------------------------------------------------------
\r
167 Echo Configuring the library source directory...
\r
169 rem Create "makefile" from "makefile.in".
\r
170 sed -e "1,/cpp stuff/s@^# .*$@@" <Makefile.in >junk.c
\r
171 gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[
\f]*$/d" >makefile.new
\r
172 If "%DJGPP_VER%" == "2" goto libsrc-v2
\r
173 sed -f ../msdos/sed3.inp <makefile.new >Makefile
\r
176 sed -f ../msdos/sed3v2.inp <makefile.new >Makefile
\r
178 rm -f makefile.new junk.c
\r
179 if "%nodebug%" == "" goto libsrc3
\r
180 sed -e "/^CFLAGS *=/s/ *-g//" <Makefile >makefile.tmp
\r
181 sed -e "/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp >Makefile
\r
185 rem ----------------------------------------------------------------------
\r
186 if "%X11%" == "" goto oldx1
\r
187 Echo Configuring the oldxmenu directory...
\r
189 sed -f ../msdos/sed5x.inp <Makefile.in >Makefile
\r
190 if "%nodebug%" == "" goto oldx2
\r
191 sed -e "/^CFLAGS *=/s/ *-g//" <Makefile >makefile.tmp
\r
192 mv -f makefile.tmp Makefile
\r
196 rem ----------------------------------------------------------------------
\r
197 Echo Configuring the manual directory...
\r
199 sed -f ../msdos/sed6.inp < Makefile.in > Makefile
\r
201 rem ----------------------------------------------------------------------
\r
202 Echo Configuring the main directory...
\r
203 If "%DJGPP_VER%" == "1" goto mainv1
\r
204 Echo Looking for the GDB init file...
\r
205 If not Exist src\_gdbinit If Exist src\.gdbinit update src/.gdbinit src/_gdbinit
\r
206 If Exist src\_gdbinit goto gdbinitOk
\r
208 Echo I cannot find the GDB init file. It was called ".gdbinit" in
\r
209 Echo the Emacs distribution, but was probably renamed to some other
\r
210 Echo name without the leading dot when you untarred the archive.
\r
211 Echo It should be in the "src/" subdirectory. Please make sure this
\r
212 Echo file exists and is called "_gdbinit" with a leading underscore.
\r
213 Echo Then run CONFIG.BAT again with the same arguments you did now.
\r
216 Echo Looking for the GDB init file...found
\r
217 copy msdos\mainmake.v2 Makefile >nul
\r
219 If "%DJGPP_VER%" == "1" copy msdos\mainmake Makefile >nul
\r
220 rem ----------------------------------------------------------------------
\r