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