aboutsummaryrefslogtreecommitdiffstats
path: root/config.bat
diff options
context:
space:
mode:
authorKatsumi Yamaoka2010-12-03 14:45:09 +0000
committerKatsumi Yamaoka2010-12-03 14:45:09 +0000
commit067d23c97ab3a4135388d8dd87f1dd04c6248572 (patch)
tree4f3d4b2df245bf920c066f80923b3adda1585468 /config.bat
parent19b9c467ea2ef3838f3bf2231d21d999db67fe59 (diff)
downloademacs-067d23c97ab3a4135388d8dd87f1dd04c6248572.tar.gz
emacs-067d23c97ab3a4135388d8dd87f1dd04c6248572.zip
Restore files that I seem to have mistakenly deleted.
Diffstat (limited to 'config.bat')
-rw-r--r--config.bat321
1 files changed, 321 insertions, 0 deletions
diff --git a/config.bat b/config.bat
new file mode 100644
index 00000000000..63f9c5d5865
--- /dev/null
+++ b/config.bat
@@ -0,0 +1,321 @@
1@echo off
2rem ----------------------------------------------------------------------
3rem Configuration script for MSDOS
4rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003
5rem 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6
7rem This file is part of GNU Emacs.
8
9rem GNU Emacs is free software: you can redistribute it and/or modify
10rem it under the terms of the GNU General Public License as published by
11rem the Free Software Foundation, either version 3 of the License, or
12rem (at your option) any later version.
13
14rem GNU Emacs is distributed in the hope that it will be useful,
15rem but WITHOUT ANY WARRANTY; without even the implied warranty of
16rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17rem GNU General Public License for more details.
18
19rem You should have received a copy of the GNU General Public License
20rem along with GNU Emacs. If not, see http://www.gnu.org/licenses/.
21
22rem ----------------------------------------------------------------------
23rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
24rem
25rem + msdos version 3 or better.
26rem + DJGPP version 2.0 or later (version 2.03 or later recommended).
27rem + make utility that allows breaking of the 128 chars limit on
28rem command lines. ndmake (as of version 4.5) won't work due to a
29rem line length limit. The make that comes with DJGPP does work (and is
30rem recommended).
31rem + rm, mv, and cp (from GNU file utilities).
32rem + sed (you can use the port that comes with DJGPP).
33rem
34rem You should be able to get all the above utilities from the DJGPP FTP
35rem site, ftp.delorie.com, in the directory "pub/djgpp/current/v2gnu".
36rem ----------------------------------------------------------------------
37set X11=
38set nodebug=
39set djgpp_ver=
40set sys_malloc=
41set libxml=
42if "%1" == "" goto usage
43rem ----------------------------------------------------------------------
44rem See if their environment is large enough. We need 28 bytes.
45set $foo$=789012345678901234567
46if not "%$foo$%" == "789012345678901234567" goto SmallEnv
47set $foo$=
48:again
49if "%1" == "" goto usage
50if "%1" == "--with-x" goto withx
51if "%1" == "--no-debug" goto nodebug
52if "%1" == "msdos" goto msdos
53if "%1" == "--with-system-malloc" goto sysmalloc
54:usage
55echo Usage: config [--no-debug] [--with-system-malloc] [--with-x] msdos
56echo [Read the script before you run it.]
57goto end
58rem ----------------------------------------------------------------------
59:withx
60set X11=Y
61shift
62goto again
63rem ----------------------------------------------------------------------
64:nodebug
65set nodebug=Y
66shift
67goto again
68rem ----------------------------------------------------------------------
69:sysmalloc
70set sys_malloc=Y
71shift
72goto again
73rem ----------------------------------------------------------------------
74:msdos
75Echo Checking whether 'sed' is available...
76sed -e "w junk.$$$" <Nul
77If Exist junk.$$$ Goto sedOk
78Echo To configure 'Emacs' you need to have 'sed'!
79Goto End
80:sedOk
81Echo Checking whether 'rm' is available...
82rm -f junk.$$$
83If Not Exist junk.$$$ Goto rmOk
84Echo To configure 'Emacs' you need to have 'rm'!
85Goto End
86:rmOk
87Echo Checking whether 'mv' is available...
88rm -f junk.1 junk.2
89echo foo >junk.1
90mv junk.1 ./junk.2
91If Exist junk.2 Goto mvOk
92Echo To configure 'Emacs' you need to have 'mv'!
93rm -f junk.1
94Goto End
95:mvOk
96rm -f junk.2
97Echo Checking whether 'gcc' is available...
98echo main(){} >junk.c
99gcc -c junk.c
100if exist junk.o goto gccOk
101Echo To configure 'Emacs' you need to have 'gcc'!
102rm -f junk.c
103Goto End
104:gccOk
105rm -f junk.c junk.o junk junk.exe
106Echo Checking what version of DJGPP is installed...
107If Not "%DJGPP%" == "" goto djgppOk
108Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!
109Goto End
110:djgppOk
111echo int main() >junk.c
112echo #ifdef __DJGPP__ >>junk.c
113echo {return (__DJGPP__)*10;} >>junk.c
114echo #else >>junk.c
115echo #ifdef __GO32__ >>junk.c
116echo {return 10;} >>junk.c
117echo #else >>junk.c
118echo {return 0;} >>junk.c
119echo #endif >>junk.c
120echo #endif >>junk.c
121gcc -o junk junk.c
122if not exist junk.exe coff2exe junk
123junk
124If ErrorLevel 10 Goto go32Ok
125rm -f junk.c junk junk.exe
126Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!
127Goto End
128:go32Ok
129set djgpp_ver=2
130If Not ErrorLevel 20 Echo To build 'Emacs' you need DJGPP v2.0 or later!
131If Not ErrorLevel 20 Goto End
132rm -f junk.c junk junk.exe
133rem DJECHO is used by the top-level Makefile in the v2.x build
134Echo Checking whether 'djecho' is available...
135redir -o Nul -eo djecho -o junk.$$$ foo
136If Exist junk.$$$ Goto djechoOk
137Echo To build 'Emacs' you need the 'djecho.exe' program!
138Echo 'djecho.exe' is part of 'djdevNNN.zip' basic DJGPP development kit.
139Echo Versions of DJGPP before 2.02 called this program 'echo.exe'.
140Echo Either unpack 'djecho.exe' from the 'djdevNNN.zip' archive,
141Echo or, if you have 'echo.exe', copy it to 'djecho.exe'.
142Echo Then run CONFIG.BAT again with the same arguments you did now.
143Goto End
144:djechoOk
145rm -f junk.$$$
146Echo Configuring for DJGPP Version %DJGPP_VER% ...
147Rem ----------------------------------------------------------------------
148Echo Configuring the source directory...
149cd src
150
151rem Create "epaths.h"
152sed -f ../msdos/sed4.inp <epaths.in >epaths.tmp
153update epaths.tmp epaths.h >nul
154rm -f epaths.tmp
155
156rem Create "config.h"
157rm -f config.h2 config.tmp
158sed -e '' config.in > config.tmp
159if "%X11%" == "" goto src4
160sed -f ../msdos/sed2x.inp <config.in >config.tmp
161:src4
162sed -f ../msdos/sed2v2.inp <config.tmp >config.h2
163Rem See if DECL_ALIGN can be supported with this GCC
164rm -f junk.c junk.o junk junk.exe
165echo struct { int i; char *p; } __attribute__((__aligned__(8))) foo; >junk.c
166rem Two percent signs because it is a special character for COMMAND.COM/CMD
167rem Filter thru Sed because "&" is special for CMD.EXE
168echo int main(void) { return (unsigned long)"&"foo %% 8; } | sed "s/.&./\&/" >>junk.c
169gcc -o junk junk.c
170if not exist junk.exe coff2exe junk
171junk
172If Not ErrorLevel 1 Goto alignOk
173Echo WARNING: Your GCC does not support 8-byte aligned variables.
174Echo WARNING: Therefore Emacs cannot support buffers larger than 128MB.
175rem The following line disables DECL_ALIGN which in turn disables USE_LSB_TAG
176rem For details see lisp.h where it defines USE_LSB_TAG
177echo #define NO_DECL_ALIGN >>config.h2
178:alignOk
179Rem See if they have libxml2 later than v2.2.0 installed
180Echo Checking whether libxml2 v2.2.1 or later is installed ...
181rm -f junk.c junk.o junk junk.exe
182rem Use djecho here because we need to quote brackets
183djecho "#include <libxml/xmlversion.h>" >junk.c
184djecho "int main()" >>junk.c
185djecho "{return (LIBXML_VERSION > 20200 ? 0 : 1);}" >>junk.c
186redir -o Nul -eo gcc -I/dev/env/DJDIR/include/libxml2 -o junk junk.c
187if not exist junk Goto xmlDone
188if not exist junk.exe coff2exe junk
189junk
190If ErrorLevel 1 Goto xmlDone
191Echo Configuring with libxml2 ...
192sed -e "/#undef HAVE_LIBXML2/s/^.*$/#define HAVE_LIBXML2 1/" <config.h2 >config.h3
193mv config.h3 config.h2
194set libxml=1
195:xmlDone
196rm -f junk.c junk junk.exe
197Rem See if they requested a SYSTEM_MALLOC build
198if "%sys_malloc%" == "" Goto cfgDone
199rm -f config.tmp
200ren config.h2 config.tmp
201sed -f ../msdos/sedalloc.inp <config.tmp >config.h2
202
203:cfgDone
204rm -f junk.c junk junk.exe
205update config.h2 config.h >nul
206rm -f config.tmp config.h2
207
208rem On my system dir.h gets in the way. It's a VMS file so who cares.
209if exist dir.h ren dir.h vmsdir.h
210
211rem Create "makefile" from "makefile.in".
212rm -f Makefile makefile.tmp
213copy Makefile.in+deps.mk makefile.tmp
214sed -f ../msdos/sed1v2.inp <makefile.tmp >Makefile
215rm -f makefile.tmp
216
217if "%X11%" == "" goto src5
218mv Makefile makefile.tmp
219sed -f ../msdos/sed1x.inp <makefile.tmp >Makefile
220rm -f makefile.tmp
221:src5
222
223if "%sys_malloc%" == "" goto src5a
224sed -e "/^GMALLOC_OBJ *=/s/gmalloc.o//" <Makefile >makefile.tmp
225sed -e "/^VMLIMIT_OBJ *=/s/vm-limit.o//" <makefile.tmp >makefile.tmp2
226sed -e "/^RALLOC_OBJ *=/s/ralloc.o//" <makefile.tmp2 >Makefile
227rm -f makefile.tmp makefile.tmp2
228:src5a
229
230if "%nodebug%" == "" goto src6
231sed -e "/^CFLAGS *=/s/ *-gcoff//" <Makefile >makefile.tmp
232sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >Makefile
233rm -f makefile.tmp
234:src6
235
236if "%libxml%" == "" goto src7
237sed -e "/^LIBXML2_LIBS *=/s/=/= -lxml2 -lz -liconv/" <Makefile >makefile.tmp
238sed -e "/^LIBXML2_CFLAGS *=/s|=|= -I/dev/env/DJDIR/include/libxml2|" <makefile.tmp >Makefile
239rm -f makefile.tmp
240:src7
241cd ..
242rem ----------------------------------------------------------------------
243Echo Configuring the library source directory...
244cd lib-src
245sed -f ../msdos/sed3v2.inp <Makefile.in >Makefile
246if "%X11%" == "" goto libsrc2a
247mv Makefile makefile.tmp
248sed -f ../msdos/sed3x.inp <makefile.tmp >Makefile
249rm -f makefile.tmp
250:libsrc2a
251if "%nodebug%" == "" goto libsrc3
252sed -e "/^CFLAGS *=/s/ *-gcoff//" <Makefile >makefile.tmp
253sed -e "/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp >Makefile
254rm -f makefile.tmp
255:libsrc3
256cd ..
257rem ----------------------------------------------------------------------
258if "%X11%" == "" goto oldx1
259Echo Configuring the oldxmenu directory...
260cd oldxmenu
261sed -f ../msdos/sed5x.inp <Makefile.in >Makefile
262if "%nodebug%" == "" goto oldx2
263sed -e "/^CFLAGS *=/s/ *-gcoff//" <Makefile >makefile.tmp
264mv -f makefile.tmp Makefile
265:oldx2
266cd ..
267:oldx1
268rem ----------------------------------------------------------------------
269Echo Configuring the doc directory, expect one "File not found" message...
270cd doc
271Rem The two variants for lispintro below is for when the shell
272Rem supports long file names but DJGPP does not
273for %%d in (emacs lispref lispintro lispintr misc) do sed -f ../msdos/sed6.inp < %%d\Makefile.in > %%d\Makefile
274cd ..
275rem ----------------------------------------------------------------------
276Echo Configuring the lisp directory...
277cd lisp
278If Exist gnus\.dir-locals.el update gnus/.dir-locals.el gnus/_dir-locals.el
279sed -f ../msdos/sedlisp.inp < Makefile.in > Makefile
280cd ..
281rem ----------------------------------------------------------------------
282If not Exist leim\quail\latin-pre.el goto maindir
283Echo Configuring the leim directory...
284cd leim
285sed -f ../msdos/sedleim.inp < Makefile.in > Makefile
286cd ..
287rem ----------------------------------------------------------------------
288:maindir
289Echo Configuring the main directory...
290If Exist .dir-locals.el update .dir-locals.el _dir-locals.el
291If Exist src\.dbxinit update src/.dbxinit src/_dbxinit
292Echo Looking for the GDB init file...
293If Exist src\.gdbinit update src/.gdbinit src/_gdbinit
294If Exist src\_gdbinit goto gdbinitOk
295Echo ERROR:
296Echo I cannot find the GDB init file. It was called ".gdbinit" in
297Echo the Emacs distribution, but was probably renamed to some other
298Echo name without the leading dot when you untarred the archive.
299Echo It should be in the "src/" subdirectory. Please make sure this
300Echo file exists and is called "_gdbinit" with a leading underscore.
301Echo Then run CONFIG.BAT again with the same arguments you did now.
302goto End
303:gdbinitOk
304Echo Looking for the GDB init file...found
305copy msdos\mainmake.v2 Makefile >nul
306rem ----------------------------------------------------------------------
307goto End
308:SmallEnv
309echo Your environment size is too small. Please enlarge it and run me again.
310echo For example, type "command.com /e:2048" to have 2048 bytes available.
311set $foo$=
312:end
313set X11=
314set nodebug=
315set djgpp_ver=
316set sys_malloc=
317set libxml=
318
319goto skipArchTag
320 arch-tag: 2d2fed23-4dc6-4006-a2e4-49daf0031f33
321:skipArchTag