(shell-strip-ctrl-m): Strip multiple ^Ms.
[bpt/emacs.git] / config.bat
... / ...
CommitLineData
1@echo off\r
2rem ----------------------------------------------------------------------\r
3rem Configuration script for MSDOS\r
4rem Copyright (C) 1994 Free Software Foundation, Inc.\r
5\r
6rem This file is part of GNU Emacs.\r
7\r
8rem GNU Emacs is free software; you can redistribute it and/or modify\r
9rem it under the terms of the GNU General Public License as published by\r
10rem the Free Software Foundation; either version 2, or (at your option)\r
11rem any later version.\r
12\r
13rem GNU Emacs is distributed in the hope that it will be useful,\r
14rem but WITHOUT ANY WARRANTY; without even the implied warranty of\r
15rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
16rem GNU General Public License for more details.\r
17\r
18rem You should have received a copy of the GNU General Public License\r
19rem along with GNU Emacs; see the file COPYING. If not, write to\r
20rem the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
21rem ----------------------------------------------------------------------\r
22rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r
23rem\r
24rem + msdos version 3 or better.\r
25rem + djgpp version 1,11 maint 4 or better.\r
26rem + make utility that allows breaking of the 128 chars limit on\r
27rem command lines. ndmake (as of version 4.5) won't work due to a\r
28rem line length limit.\r
29rem + rm, mv, chmod (From GNU file utilities).\r
30rem + sed.\r
31rem\r
32rem You must install in directory c:/emacs or change this script.\r
33rem ----------------------------------------------------------------------\r
34if not "%2" == "" goto usage\r
35if "%1" == "msdos" goto msdos\r
36if "%1" == "msdos-X11" goto msdos11\r
37:usage\r
38echo Usage: config msdos\r
39rem echo or config msdos-X11 -- don't even think about it\r
40echo [Read the script before you run it; also check that you have all the\r
41echo necessary utilities.]\r
42goto end\r
43rem ----------------------------------------------------------------------\r
44:msdos11\r
45set X11=y\r
46goto msdoscommon\r
47rem ----------------------------------------------------------------------\r
48:msdos\r
49set X11=\r
50:msdoscommon\r
51rem Change to the Emacs root -- assume we are there\r
52rem cd c:\emacs\r
53rem ----------------------------------------------------------------------\r
54Echo Configuring the source directory...\r
55cd src\r
56set PATHSH=paths-h.in\r
57if exist %PATHSH% goto src1\r
58set PATHSH=paths.h-in\r
59if exist %PATHSH% goto src1\r
60echo config: *** The file originally called "src/paths.h.in" cannot be found.\r
61cd ..\r
62goto end\r
63:src1\r
64set CONFIGH=config-h.in\r
65if exist %CONFIGH% goto src2\r
66set CONFIGH=config.h-in\r
67if exist %CONFIGH% goto src2\r
68echo config: *** The file originally called "src/config.h.in" cannot be found.\r
69cd ..\r
70goto end\r
71:src2\r
72set MAKEFILEIN=makefile.in-in\r
73if exist %MAKEFILEIN% goto src3\r
74set MAKEFILEIN=makefile-in.in\r
75if exist %MAKEFILEIN% goto src3\r
76echo makefile: *** The file originally called "src/makefile.in.in" cannot be found.\r
77cd ..\r
78goto end\r
79:src3\r
80\r
81rem Create "paths.h"\r
82rm -f paths.h\r
83sed -e "s!/lib/emacs!!" -e "s!/usr/local!c:/emacs!" -e "s!/data!/etc!" <%PATHSH% >paths.h\r
84\r
85rem Create "config.h"\r
86rm -f config.h config.tmp\r
87cp %CONFIGH% config.tmp\r
88if "%X11%" == "" goto src4\r
89sed -f ../msdos/sed4.inp <%CONFIGH% >config.tmp\r
90:src4\r
91sed -f ../msdos/sed2.inp <config.tmp >config.h\r
92rm -f config.tmp\r
93\r
94rem On my system dir.h gets in the way. It's a VMS file so who cares.\r
95if exist dir.h ren dir.h vmsdir.h\r
96\r
97rem Create "makefile" from "makefile.in.in" using a context patch.\r
98rm -f makefile junk.c\r
99sed -e "1,/cpp stuff/s@^# .*$@@" <%MAKEFILEIN% >junk.c\r
100gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile\r
101rm -f junk.c\r
102cd ..\r
103rem ----------------------------------------------------------------------\r
104Echo Configuring the library source directory...\r
105cd lib-src\r
106set MAKEFILEIN=makefile.in-in\r
107if exist %MAKEFILEIN% goto libsrc1\r
108set MAKEFILEIN=makefile-in.in\r
109if exist %MAKEFILEIN% goto libsrc1\r
110echo makefile: *** The file originally called "lib-src/Makefile.in.in" cannot be found.\r
111cd ..\r
112goto end\r
113:libsrc1\r
114rem Create "makefile" from "makefile.in".\r
115sed -e "1,/cpp stuff/s@^# .*$@@" <%MAKEFILEIN% >junk.c\r
116gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ \f]*$/d" >Makefile.new\r
117sed -f ../msdos/sed3.inp <makefile.new >makefile\r
118cd ..\r
119rem ----------------------------------------------------------------------\r
120Echo Configuring the main directory...\r
121copy msdos\mainmake makefile >nul\r
122rem ----------------------------------------------------------------------\r
123:end\r
124set X11=\r
125set MAKEFILEIN=\r
126set PATHSH=\r
127set CONFIGH=\r
128\r