5484
|
1 @echo off
|
|
2 rem ----------------------------------------------------------------------
|
|
3 rem Configuration script for MSDOS
|
7195
|
4 rem Copyright (C) 1994 Free Software Foundation, Inc.
|
|
5
|
5484
|
6 rem This file is part of GNU Emacs.
|
|
7
|
|
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.
|
|
12
|
|
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.
|
|
17
|
|
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:
|
|
23 rem
|
7195
|
24 rem + msdos version 3 or better.
|
14976
|
25 rem + djgpp version 1.12maint1 or later (version 2.0 or later recommended).
|
7195
|
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
|
13927
|
28 rem line length limit. The make that comes with djgpp does work.
|
14976
|
29 rem + rm and mv (from GNU file utilities).
|
|
30 rem + sed (you can use the port that comes with DJGPP).
|
7195
|
31 rem
|
14976
|
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
|
|
36 rem traffic.
|
5484
|
37 rem ----------------------------------------------------------------------
|
9570
|
38 set X11=
|
|
39 set nodebug=
|
15007
|
40 set djgpp_ver=
|
9570
|
41 :again
|
|
42 if "%1" == "" goto usage
|
|
43 if "%1" == "--with-x" goto withx
|
|
44 if "%1" == "--no-debug" goto nodebug
|
5484
|
45 if "%1" == "msdos" goto msdos
|
|
46 :usage
|
9570
|
47 echo Usage: config [--with-x] [--no-debug] msdos
|
|
48 echo [Read the script before you run it.]
|
5484
|
49 goto end
|
|
50 rem ----------------------------------------------------------------------
|
9570
|
51 :withx
|
|
52 set X11=Y
|
|
53 shift
|
|
54 goto again
|
|
55 rem ----------------------------------------------------------------------
|
|
56 :nodebug
|
|
57 set nodebug=Y
|
|
58 shift
|
|
59 goto again
|
7195
|
60 rem ----------------------------------------------------------------------
|
5484
|
61 :msdos
|
12992
|
62 Echo Checking whether 'sed' is available...
|
|
63 sed -e "w junk.$$$" <Nul
|
9570
|
64 If Exist junk.$$$ Goto sedOk
|
12992
|
65 Echo To configure 'Emacs' you need to have 'sed'!
|
9570
|
66 Goto End
|
|
67 :sedOk
|
12992
|
68 Echo Checking whether 'rm' is available...
|
9570
|
69 rm -f junk.$$$
|
|
70 If Not Exist junk.$$$ Goto rmOk
|
12992
|
71 Echo To configure 'Emacs' you need to have 'rm'!
|
9570
|
72 Goto End
|
|
73 :rmOk
|
12992
|
74 Echo Checking whether 'mv' is available...
|
9570
|
75 rm -f junk.1 junk.2
|
|
76 echo foo >junk.1
|
|
77 mv junk.1 junk.2
|
|
78 If Exist junk.2 Goto mvOk
|
12992
|
79 Echo To configure 'Emacs' you need to have 'mv'!
|
9570
|
80 rm -f junk.1
|
|
81 Goto End
|
|
82 :mvOk
|
|
83 rm -f junk.2
|
12992
|
84 Echo Checking whether 'gcc' is available...
|
9570
|
85 echo main(){} >junk.c
|
|
86 gcc -c junk.c
|
|
87 if exist junk.o goto gccOk
|
12992
|
88 Echo To configure 'Emacs' you need to have 'gcc'!
|
9570
|
89 rm -f junk.c
|
|
90 Goto End
|
|
91 :gccOk
|
15020
85feb24c0ac5
With DJGPP v1.x, use `COFF2EXE' to produce JUNK.EXE test program.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
92 rm -f junk.c junk.o junk junk.exe
|
14976
|
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!
|
|
96 Goto End
|
|
97 :djgppOk
|
|
98 echo int main() >junk.c
|
|
99 echo #ifdef __DJGPP__ >>junk.c
|
|
100 echo {return (__DJGPP__)*10;} >>junk.c
|
|
101 echo #else >>junk.c
|
|
102 echo #ifdef __GO32__ >>junk.c
|
|
103 echo {return 10;} >>junk.c
|
|
104 echo #else >>junk.c
|
|
105 echo {return 0;} >>junk.c
|
|
106 echo #endif >>junk.c
|
|
107 echo #endif >>junk.c
|
15020
85feb24c0ac5
With DJGPP v1.x, use `COFF2EXE' to produce JUNK.EXE test program.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
108 gcc -o junk junk.c
|
85feb24c0ac5
With DJGPP v1.x, use `COFF2EXE' to produce JUNK.EXE test program.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
109 if not exist junk.exe coff2exe junk
|
14976
|
110 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!
|
|
114 Goto End
|
|
115 :go32Ok
|
15007
|
116 set djgpp_ver=1
|
|
117 If ErrorLevel 20 set djgpp_ver=2
|
14976
|
118 rm -f junk.c junk junk.exe
|
15007
|
119 Echo Configuring for DJGPP Version %DJGPP_VER% ...
|
9570
|
120 Rem ----------------------------------------------------------------------
|
5484
|
121 Echo Configuring the source directory...
|
|
122 cd src
|
|
123
|
|
124 rem Create "paths.h"
|
12992
|
125 sed -f ../msdos/sed4.inp <paths.in >paths.tmp
|
9570
|
126 update paths.tmp paths.h >nul
|
|
127 rm -f paths.tmp
|
5484
|
128
|
|
129 rem Create "config.h"
|
9570
|
130 rm -f config.h2 config.tmp
|
12992
|
131 cp config.in config.tmp
|
7195
|
132 if "%X11%" == "" goto src4
|
12992
|
133 sed -f ../msdos/sed2x.inp <config.in >config.tmp
|
7195
|
134 :src4
|
9570
|
135 sed -f ../msdos/sed2.inp <config.tmp >config.h2
|
|
136 update config.h2 config.h >nul
|
|
137 rm -f config.tmp config.h2
|
5484
|
138
|
|
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
|
|
141
|
12992
|
142 rem Create "makefile" from "makefile.in".
|
5486
|
143 rm -f makefile junk.c
|
12992
|
144 sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c
|
15007
|
145 If "%DJGPP_VER%" == "1" Goto mfV1
|
14976
|
146 gcc -E junk.c | sed -f ../msdos/sed1v2.inp >makefile
|
|
147 goto mfDone
|
|
148 :mfV1
|
5484
|
149 gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile
|
14976
|
150 :mfDone
|
5486
|
151 rm -f junk.c
|
12992
|
152
|
9570
|
153 if "%X11%" == "" goto src5
|
|
154 mv makefile makefile.tmp
|
|
155 sed -f ../msdos/sed1x.inp <makefile.tmp >makefile
|
|
156 rm -f makefile.tmp
|
|
157 :src5
|
|
158
|
|
159 if "%nodebug%" == "" goto src6
|
|
160 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
|
14976
|
161 sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >makefile
|
|
162 rm -f makefile.tmp
|
9570
|
163 :src6
|
5484
|
164 cd ..
|
|
165 rem ----------------------------------------------------------------------
|
|
166 Echo Configuring the library source directory...
|
|
167 cd lib-src
|
|
168 rem Create "makefile" from "makefile.in".
|
12992
|
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 "/^[ ]*$/d" >makefile.new
|
15007
|
171 If "%DJGPP_VER%" == "2" goto libsrc-v2
|
7195
|
172 sed -f ../msdos/sed3.inp <makefile.new >makefile
|
14976
|
173 Goto libsrc2
|
|
174 :libsrc-v2
|
|
175 sed -f ../msdos/sed3v2.inp <makefile.new >makefile
|
|
176 :libsrc2
|
9570
|
177 rm -f makefile.new junk.c
|
14976
|
178 if "%nodebug%" == "" goto libsrc3
|
9570
|
179 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
|
14976
|
180 sed -e "/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp >makefile
|
|
181 rm -f makefile.tmp
|
|
182 :libsrc3
|
5484
|
183 cd ..
|
|
184 rem ----------------------------------------------------------------------
|
9570
|
185 if "%X11%" == "" goto oldx1
|
|
186 Echo Configuring the oldxmenu directory...
|
|
187 cd oldxmenu
|
|
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
|
|
192 :oldx2
|
|
193 cd ..
|
|
194 :oldx1
|
|
195 rem ----------------------------------------------------------------------
|
5484
|
196 Echo Configuring the main directory...
|
15023
|
197 If "%DJGPP_VER%" == "1" goto mainv1
|
|
198 Echo Looking for the GDB init file...
|
|
199 If Exist src\_gdbinit goto gdbinitOk
|
|
200 Echo ERROR:
|
|
201 Echo I cannot find the GDB init file. It was called ".gdbinit" in
|
|
202 Echo the Emacs distribution, but was probably renamed to some other
|
|
203 Echo name without the leading dot when you untarred the archive.
|
|
204 Echo It should be in the "src/" subdirectory. Please make sure this
|
|
205 Echo file exists and is called "_gdbinit" with a leading underscore.
|
|
206 Echo Then run CONFIG.BAT again with the same arguments you did now.
|
|
207 goto End
|
|
208 :gdbinitOk
|
|
209 Echo Looking for the GDB init file...found
|
|
210 copy msdos\mainmake.v2 makefile >nul
|
|
211 :mainv1
|
15007
|
212 If "%DJGPP_VER%" == "1" copy msdos\mainmake makefile >nul
|
5484
|
213 rem ----------------------------------------------------------------------
|
|
214 :end
|
7195
|
215 set X11=
|
9570
|
216 set nodebug=
|
15007
|
217 set djgpp_ver=
|