Commit | Line | Data |
---|---|---|
3382cd59 RS |
1 | @echo off\r |
2 | rem ----------------------------------------------------------------------\r | |
3 | rem Configuration script for MSDOS\r | |
331fdf1e RS |
4 | rem Copyright (C) 1994 Free Software Foundation, Inc.\r |
5 | \r | |
3382cd59 RS |
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 | |
12 | \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 | |
17 | \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 | |
331fdf1e | 24 | rem + msdos version 3 or better.\r |
293e5aa6 | 25 | rem + djgpp version 1,11 maint 4 or better (but not version 2).\r |
331fdf1e RS |
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 | |
293e5aa6 | 28 | rem line length limit. The make that comes with djgpp does work.\r |
3382cd59 RS |
29 | rem + rm, mv, chmod (From GNU file utilities).\r |
30 | rem + sed.\r | |
331fdf1e | 31 | rem\r |
293e5aa6 RS |
32 | rem You should be able to get all the above utilities from\r |
33 | rem oak.oakland.edu in the directories\r | |
34 | rem "/pub/msdos/djgpp" and "/pub/msdos/gnuish". There are other mirror | |
35 | rem sites as well.\r | |
3382cd59 | 36 | rem ----------------------------------------------------------------------\r |
ddff705b MW |
37 | set X11=\r |
38 | set nodebug=\r | |
39 | :again\r | |
40 | if "%1" == "" goto usage\r | |
41 | if "%1" == "--with-x" goto withx\r | |
42 | if "%1" == "--no-debug" goto nodebug\r | |
3382cd59 RS |
43 | if "%1" == "msdos" goto msdos\r |
44 | :usage\r | |
ddff705b MW |
45 | echo Usage: config [--with-x] [--no-debug] msdos\r |
46 | echo [Read the script before you run it.]\r | |
3382cd59 RS |
47 | goto end\r |
48 | rem ----------------------------------------------------------------------\r | |
ddff705b MW |
49 | :withx\r |
50 | set X11=Y\r | |
51 | shift\r | |
52 | goto again\r | |
331fdf1e | 53 | rem ----------------------------------------------------------------------\r |
ddff705b MW |
54 | :nodebug\r |
55 | set nodebug=Y\r | |
56 | shift\r | |
57 | goto again\r | |
3382cd59 | 58 | rem ----------------------------------------------------------------------\r |
ddff705b | 59 | :msdos\r |
2f3e7987 RS |
60 | Echo Checking whether 'sed' is available...\r |
61 | sed -e "w junk.$$$" <Nul\r | |
ddff705b | 62 | If Exist junk.$$$ Goto sedOk\r |
2f3e7987 | 63 | Echo To configure 'Emacs' you need to have 'sed'!\r |
ddff705b MW |
64 | Goto End\r |
65 | :sedOk\r | |
2f3e7987 | 66 | Echo Checking whether 'rm' is available...\r |
ddff705b MW |
67 | rm -f junk.$$$\r |
68 | If Not Exist junk.$$$ Goto rmOk\r | |
2f3e7987 | 69 | Echo To configure 'Emacs' you need to have 'rm'!\r |
ddff705b MW |
70 | Goto End\r |
71 | :rmOk\r | |
2f3e7987 | 72 | Echo Checking whether 'mv' is available...\r |
ddff705b MW |
73 | rm -f junk.1 junk.2\r |
74 | echo foo >junk.1\r | |
75 | mv junk.1 junk.2\r | |
76 | If Exist junk.2 Goto mvOk\r | |
2f3e7987 | 77 | Echo To configure 'Emacs' you need to have 'mv'!\r |
ddff705b MW |
78 | rm -f junk.1\r |
79 | Goto End\r | |
80 | :mvOk\r | |
81 | rm -f junk.2\r | |
2f3e7987 | 82 | Echo Checking whether 'gcc' is available...\r |
ddff705b MW |
83 | echo main(){} >junk.c\r |
84 | gcc -c junk.c\r | |
85 | if exist junk.o goto gccOk\r | |
2f3e7987 | 86 | Echo To configure 'Emacs' you need to have 'gcc'!\r |
ddff705b MW |
87 | rm -f junk.c\r |
88 | Goto End\r | |
89 | :gccOk\r | |
90 | rm -f junk.c junk.o\r | |
91 | Rem ----------------------------------------------------------------------\r | |
3382cd59 RS |
92 | Echo Configuring the source directory...\r |
93 | cd src\r | |
3382cd59 RS |
94 | \r |
95 | rem Create "paths.h"\r | |
2f3e7987 | 96 | sed -f ../msdos/sed4.inp <paths.in >paths.tmp\r |
ddff705b MW |
97 | update paths.tmp paths.h >nul\r |
98 | rm -f paths.tmp\r | |
3382cd59 RS |
99 | \r |
100 | rem Create "config.h"\r | |
ddff705b | 101 | rm -f config.h2 config.tmp\r |
2f3e7987 | 102 | cp config.in config.tmp\r |
331fdf1e | 103 | if "%X11%" == "" goto src4\r |
2f3e7987 | 104 | sed -f ../msdos/sed2x.inp <config.in >config.tmp\r |
331fdf1e | 105 | :src4\r |
ddff705b MW |
106 | sed -f ../msdos/sed2.inp <config.tmp >config.h2\r |
107 | update config.h2 config.h >nul\r | |
108 | rm -f config.tmp config.h2\r | |
3382cd59 RS |
109 | \r |
110 | rem On my system dir.h gets in the way. It's a VMS file so who cares.\r | |
111 | if exist dir.h ren dir.h vmsdir.h\r | |
112 | \r | |
2f3e7987 | 113 | rem Create "makefile" from "makefile.in".\r |
dd0d2cf3 | 114 | rm -f makefile junk.c\r |
2f3e7987 | 115 | sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c\r |
3382cd59 | 116 | gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile\r |
dd0d2cf3 | 117 | rm -f junk.c\r |
2f3e7987 | 118 | \r |
ddff705b MW |
119 | if "%X11%" == "" goto src5\r |
120 | mv makefile makefile.tmp\r | |
121 | sed -f ../msdos/sed1x.inp <makefile.tmp >makefile\r | |
122 | rm -f makefile.tmp\r | |
123 | :src5\r | |
124 | \r | |
125 | if "%nodebug%" == "" goto src6\r | |
126 | sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r | |
127 | mv -f makefile.tmp makefile\r | |
128 | :src6\r | |
3382cd59 RS |
129 | cd ..\r |
130 | rem ----------------------------------------------------------------------\r | |
131 | Echo Configuring the library source directory...\r | |
132 | cd lib-src\r | |
133 | rem Create "makefile" from "makefile.in".\r | |
2f3e7987 RS |
134 | sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c\r |
135 | gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ \f]*$/d" >makefile.new\r | |
331fdf1e | 136 | sed -f ../msdos/sed3.inp <makefile.new >makefile\r |
ddff705b MW |
137 | rm -f makefile.new junk.c\r |
138 | if "%nodebug%" == "" goto libsrc2\r | |
139 | sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r | |
140 | mv -f makefile.tmp makefile\r | |
141 | :libsrc2\r | |
142 | cd ..\r | |
143 | rem ----------------------------------------------------------------------\r | |
144 | if "%X11%" == "" goto oldx1\r | |
145 | Echo Configuring the oldxmenu directory...\r | |
146 | cd oldxmenu\r | |
147 | sed -f ../msdos/sed5x.inp <makefile.in >makefile\r | |
148 | if "%nodebug%" == "" goto oldx2\r | |
149 | sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r | |
150 | mv -f makefile.tmp makefile\r | |
151 | :oldx2\r | |
3382cd59 | 152 | cd ..\r |
ddff705b | 153 | :oldx1\r |
3382cd59 RS |
154 | rem ----------------------------------------------------------------------\r |
155 | Echo Configuring the main directory...\r | |
156 | copy msdos\mainmake makefile >nul\r | |
157 | rem ----------------------------------------------------------------------\r | |
158 | :end\r | |
331fdf1e | 159 | set X11=\r |
ddff705b | 160 | set nodebug=\r |