Initial revision
[bpt/emacs.git] / config.bat
CommitLineData
3382cd59
RS
1@echo off\r
2rem ----------------------------------------------------------------------\r
3rem Configuration script for MSDOS\r
4rem This file is part of GNU Emacs.\r
5\r
6rem GNU Emacs is free software; you can redistribute it and/or modify\r
7rem it under the terms of the GNU General Public License as published by\r
8rem the Free Software Foundation; either version 2, or (at your option)\r
9rem any later version.\r
10\r
11rem GNU Emacs is distributed in the hope that it will be useful,\r
12rem but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
14rem GNU General Public License for more details.\r
15\r
16rem You should have received a copy of the GNU General Public License\r
17rem along with GNU Emacs; see the file COPYING. If not, write to\r
18rem the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
19rem ----------------------------------------------------------------------\r
20rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r
21rem\r
22rem + djgpp.\r
23rem + make utility that allows breaking of 128 chars limit of commands.\r
24rem ndmake (as of version 4.5) won't work due to a line length limit.\r
25rem + rm, mv, chmod (From GNU file utilities).\r
26rem + sed.\r
27rem + patch (Larry Wall's for instance. I think it's supplied with djgpp).\r
28rem ----------------------------------------------------------------------\r
29if not "%2" == "" goto usage\r
30if "%1" == "msdos" goto msdos\r
31:usage\r
32echo Usage: config msdos\r
33echo [Read the script before you run it; also check that you have all the\r
34echo necessary utilities.]\r
35goto end\r
36rem ----------------------------------------------------------------------\r
37:msdos\r
38rem Change to the Emacs root\r
39cd c:\emacs\r
40rem ----------------------------------------------------------------------\r
41Echo Configuring the source directory...\r
42cd src\r
43set PATHSH=paths-h.in\r
44if exist %PATHSH% goto src1\r
45set PATHSH=paths.h-in\r
46if exist %PATHSH% goto src1\r
47echo config: *** The file originally called "src/paths.h.in" cannot be found.\r
48cd ..\r
49goto end\r
50:src1\r
51set CONFIGH=config-h.in\r
52if exist %CONFIGH% goto src2\r
53set CONFIGH=config.h-in\r
54if exist %CONFIGH% goto src2\r
55echo config: *** The file originally called "src/config.h.in" cannot be found.\r
56cd ..\r
57goto end\r
58:src2\r
59set MAKEFILEIN=makefile.in-in\r
60if exist %MAKEFILEIN% goto src3\r
61set MAKEFILEIN=makefile-in.in\r
62if exist %MAKEFILEIN% goto src3\r
63echo makefile: *** The file originally called "src/makefile.in.in" cannot be found.\r
64cd ..\r
65goto end\r
66:src3\r
67\r
68rem Create "paths.h"\r
69rm -f paths.h\r
70sed -e "s!/lib/emacs!!" -e "s!/usr/local!c:/emacs!" -e "s!/data!/etc!" <%PATHSH% >paths.h\r
71\r
72rem Create "config.h"\r
73rm -f config.h\r
74sed -f ../msdos/sed2.inp <%CONFIGH% >config.h\r
75\r
76rem On my system dir.h gets in the way. It's a VMS file so who cares.\r
77if exist dir.h ren dir.h vmsdir.h\r
78\r
79rem Create "makefile" from "makefile.in.in" using a context patch.\r
80rm -f makefile\r
81cp %MAKEFILEIN% makefile\r
82patch -p1 -B ! -r patch.rjt makefile ../msdos/patch1\r
83echo All hunks above should have passed! If they didn't, you'll have to\r
84echo update manually. That should be easy though.\r
85mv makefile junk.c\r
86gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile\r
87del !makefile\r
88del junk.c\r
89cd ..\r
90rem ----------------------------------------------------------------------\r
91Echo Configuring the library source directory...\r
92cd lib-src\r
93rem Create "makefile" from "makefile.in".\r
94copy makefile makefile.bak >nul\r
95sed -f ../msdos/sed3.inp <makefile.in >makefile\r
96cd ..\r
97rem ----------------------------------------------------------------------\r
98Echo Configuring the main directory...\r
99copy msdos\mainmake makefile >nul\r
100rem ----------------------------------------------------------------------\r
101:end\r