]> code.delx.au - gnu-emacs/blob - config.bat
Doc fix.
[gnu-emacs] / config.bat
1 @echo off
2 rem ----------------------------------------------------------------------
3 rem Configuration script for MSDOS
4 rem Copyright (C) 1994 Free Software Foundation, Inc.
5
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
24 rem + msdos version 3 or better.
25 rem + djgpp version 1,11 maint 4 or better.
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.
29 rem + rm, mv, chmod (From GNU file utilities).
30 rem + sed.
31 rem
32 rem You must install in directory c:/emacs or change this script, the
33 rem files msdos/sed*.inp, and lisp/dos-fns.el. (The latter must be
34 rem recompiled.)
35 rem ----------------------------------------------------------------------
36 if not "%2" == "" goto usage
37 if "%1" == "msdos" goto msdos
38 if "%1" == "msdos-X11" goto msdos11
39 :usage
40 echo Usage: config msdos
41 rem echo or config msdos-X11 -- don't even think about it
42 echo [Read the script before you run it; also check that you have all the
43 echo necessary utilities.]
44 goto end
45 rem ----------------------------------------------------------------------
46 :msdos11
47 set X11=y
48 goto msdoscommon
49 rem ----------------------------------------------------------------------
50 :msdos
51 set X11=
52 :msdoscommon
53 rem Change to the Emacs root -- assume we are there
54 rem cd c:\emacs
55 rem ----------------------------------------------------------------------
56 Echo Configuring the source directory...
57 cd src
58 set PATHSH=paths-h.in
59 if exist %PATHSH% goto src1
60 set PATHSH=paths.h-in
61 if exist %PATHSH% goto src1
62 echo config: *** The file originally called "src/paths.h.in" cannot be found.
63 cd ..
64 goto end
65 :src1
66 set CONFIGH=config-h.in
67 if exist %CONFIGH% goto src2
68 set CONFIGH=config.h-in
69 if exist %CONFIGH% goto src2
70 echo config: *** The file originally called "src/config.h.in" cannot be found.
71 cd ..
72 goto end
73 :src2
74 set MAKEFILEIN=makefile.in-in
75 if exist %MAKEFILEIN% goto src3
76 set MAKEFILEIN=makefile-in.in
77 if exist %MAKEFILEIN% goto src3
78 echo makefile: *** The file originally called "src/makefile.in.in" cannot be found.
79 cd ..
80 goto end
81 :src3
82
83 rem Create "paths.h"
84 rm -f paths.h
85 sed -e "s!/lib/emacs!!" -e "s!/usr/local!c:/emacs!" -e "s!/data!/etc!" <%PATHSH% >paths.h
86
87 rem Create "config.h"
88 rm -f config.h config.tmp
89 cp %CONFIGH% config.tmp
90 if "%X11%" == "" goto src4
91 sed -f ../msdos/sed4.inp <%CONFIGH% >config.tmp
92 :src4
93 sed -f ../msdos/sed2.inp <config.tmp >config.h
94 rm -f config.tmp
95
96 rem On my system dir.h gets in the way. It's a VMS file so who cares.
97 if exist dir.h ren dir.h vmsdir.h
98
99 rem Create "makefile" from "makefile.in.in" using a context patch.
100 rm -f makefile junk.c
101 sed -e "1,/cpp stuff/s@^# .*$@@" <%MAKEFILEIN% >junk.c
102 gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile
103 rm -f junk.c
104 cd ..
105 rem ----------------------------------------------------------------------
106 Echo Configuring the library source directory...
107 cd lib-src
108 set MAKEFILEIN=makefile.in-in
109 if exist %MAKEFILEIN% goto libsrc1
110 set MAKEFILEIN=makefile-in.in
111 if exist %MAKEFILEIN% goto libsrc1
112 echo makefile: *** The file originally called "lib-src/Makefile.in.in" cannot be found.
113 cd ..
114 goto end
115 :libsrc1
116 rem Create "makefile" from "makefile.in".
117 sed -e "1,/cpp stuff/s@^# .*$@@" <%MAKEFILEIN% >junk.c
118 gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ \f]*$/d" >Makefile.new
119 sed -f ../msdos/sed3.inp <makefile.new >makefile
120 cd ..
121 rem ----------------------------------------------------------------------
122 Echo Configuring the main directory...
123 copy msdos\mainmake makefile >nul
124 rem ----------------------------------------------------------------------
125 :end
126 set X11=
127 set MAKEFILEIN=
128 set PATHSH=
129 set CONFIGH=
130