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 |
f56c5217 | 25 | rem + djgpp version 1.12maint1 or later (version 2.0 or later recommended).\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 |
f56c5217 RS |
29 | rem + rm and mv (from GNU file utilities).\r |
30 | rem + sed (you can use the port that comes with DJGPP).\r | |
331fdf1e | 31 | rem\r |
f56c5217 RS |
32 | rem You should be able to get all the above utilities from any SimTel\r |
33 | rem repository, e.g. ftp.coast.net, in the directories\r | |
34 | rem "SimTel/vendors/djgpp" and "SimTel/vendors/gnu/gnuish/dos_only". As\r | |
35 | rem usual, please use your local mirroring site to reduce trans-Atlantic\r | |
36 | rem traffic.\r | |
3382cd59 | 37 | rem ----------------------------------------------------------------------\r |
ddff705b MW |
38 | set X11=\r |
39 | set nodebug=\r | |
b696f860 | 40 | set djgpp_ver=\r |
ddff705b MW |
41 | :again\r |
42 | if "%1" == "" goto usage\r | |
43 | if "%1" == "--with-x" goto withx\r | |
44 | if "%1" == "--no-debug" goto nodebug\r | |
3382cd59 RS |
45 | if "%1" == "msdos" goto msdos\r |
46 | :usage\r | |
ddff705b MW |
47 | echo Usage: config [--with-x] [--no-debug] msdos\r |
48 | echo [Read the script before you run it.]\r | |
3382cd59 RS |
49 | goto end\r |
50 | rem ----------------------------------------------------------------------\r | |
ddff705b MW |
51 | :withx\r |
52 | set X11=Y\r | |
53 | shift\r | |
54 | goto again\r | |
331fdf1e | 55 | rem ----------------------------------------------------------------------\r |
ddff705b MW |
56 | :nodebug\r |
57 | set nodebug=Y\r | |
58 | shift\r | |
59 | goto again\r | |
3382cd59 | 60 | rem ----------------------------------------------------------------------\r |
ddff705b | 61 | :msdos\r |
2f3e7987 RS |
62 | Echo Checking whether 'sed' is available...\r |
63 | sed -e "w junk.$$$" <Nul\r | |
ddff705b | 64 | If Exist junk.$$$ Goto sedOk\r |
2f3e7987 | 65 | Echo To configure 'Emacs' you need to have 'sed'!\r |
ddff705b MW |
66 | Goto End\r |
67 | :sedOk\r | |
2f3e7987 | 68 | Echo Checking whether 'rm' is available...\r |
ddff705b MW |
69 | rm -f junk.$$$\r |
70 | If Not Exist junk.$$$ Goto rmOk\r | |
2f3e7987 | 71 | Echo To configure 'Emacs' you need to have 'rm'!\r |
ddff705b MW |
72 | Goto End\r |
73 | :rmOk\r | |
2f3e7987 | 74 | Echo Checking whether 'mv' is available...\r |
ddff705b MW |
75 | rm -f junk.1 junk.2\r |
76 | echo foo >junk.1\r | |
77 | mv junk.1 junk.2\r | |
78 | If Exist junk.2 Goto mvOk\r | |
2f3e7987 | 79 | Echo To configure 'Emacs' you need to have 'mv'!\r |
ddff705b MW |
80 | rm -f junk.1\r |
81 | Goto End\r | |
82 | :mvOk\r | |
83 | rm -f junk.2\r | |
2f3e7987 | 84 | Echo Checking whether 'gcc' is available...\r |
ddff705b MW |
85 | echo main(){} >junk.c\r |
86 | gcc -c junk.c\r | |
87 | if exist junk.o goto gccOk\r | |
2f3e7987 | 88 | Echo To configure 'Emacs' you need to have 'gcc'!\r |
ddff705b MW |
89 | rm -f junk.c\r |
90 | Goto End\r | |
91 | :gccOk\r | |
92 | rm -f junk.c junk.o\r | |
f56c5217 RS |
93 | Echo Checking what version of DJGPP is installed...\r |
94 | If Not "%DJGPP%" == "" goto djgppOk\r | |
95 | Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!\r | |
96 | Goto End\r | |
97 | :djgppOk\r | |
98 | echo int main() >junk.c\r | |
99 | echo #ifdef __DJGPP__ >>junk.c\r | |
100 | echo {return (__DJGPP__)*10;} >>junk.c\r | |
101 | echo #else >>junk.c\r | |
102 | echo #ifdef __GO32__ >>junk.c\r | |
103 | echo {return 10;} >>junk.c\r | |
104 | echo #else >>junk.c\r | |
105 | echo {return 0;} >>junk.c\r | |
106 | echo #endif >>junk.c\r | |
107 | echo #endif >>junk.c\r | |
108 | gcc -o junk.exe junk.c\r | |
109 | junk\r | |
110 | If ErrorLevel 10 Goto go32Ok\r | |
111 | rm -f junk.c junk junk.exe\r | |
112 | Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!\r | |
113 | Goto End\r | |
114 | :go32Ok\r | |
b696f860 RS |
115 | set djgpp_ver=1\r |
116 | If ErrorLevel 20 set djgpp_ver=2\r | |
f56c5217 | 117 | rm -f junk.c junk junk.exe\r |
b696f860 | 118 | Echo Configuring for DJGPP Version %DJGPP_VER% ...\r |
ddff705b | 119 | Rem ----------------------------------------------------------------------\r |
3382cd59 RS |
120 | Echo Configuring the source directory...\r |
121 | cd src\r | |
3382cd59 RS |
122 | \r |
123 | rem Create "paths.h"\r | |
2f3e7987 | 124 | sed -f ../msdos/sed4.inp <paths.in >paths.tmp\r |
ddff705b MW |
125 | update paths.tmp paths.h >nul\r |
126 | rm -f paths.tmp\r | |
3382cd59 RS |
127 | \r |
128 | rem Create "config.h"\r | |
ddff705b | 129 | rm -f config.h2 config.tmp\r |
2f3e7987 | 130 | cp config.in config.tmp\r |
331fdf1e | 131 | if "%X11%" == "" goto src4\r |
2f3e7987 | 132 | sed -f ../msdos/sed2x.inp <config.in >config.tmp\r |
331fdf1e | 133 | :src4\r |
ddff705b MW |
134 | sed -f ../msdos/sed2.inp <config.tmp >config.h2\r |
135 | update config.h2 config.h >nul\r | |
136 | rm -f config.tmp config.h2\r | |
3382cd59 RS |
137 | \r |
138 | rem On my system dir.h gets in the way. It's a VMS file so who cares.\r | |
139 | if exist dir.h ren dir.h vmsdir.h\r | |
140 | \r | |
2f3e7987 | 141 | rem Create "makefile" from "makefile.in".\r |
dd0d2cf3 | 142 | rm -f makefile junk.c\r |
2f3e7987 | 143 | sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c\r |
b696f860 | 144 | If "%DJGPP_VER%" == "1" Goto mfV1\r |
f56c5217 RS |
145 | gcc -E junk.c | sed -f ../msdos/sed1v2.inp >makefile\r |
146 | goto mfDone\r | |
147 | :mfV1\r | |
3382cd59 | 148 | gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile\r |
f56c5217 | 149 | :mfDone\r |
dd0d2cf3 | 150 | rm -f junk.c\r |
2f3e7987 | 151 | \r |
ddff705b MW |
152 | if "%X11%" == "" goto src5\r |
153 | mv makefile makefile.tmp\r | |
154 | sed -f ../msdos/sed1x.inp <makefile.tmp >makefile\r | |
155 | rm -f makefile.tmp\r | |
156 | :src5\r | |
157 | \r | |
158 | if "%nodebug%" == "" goto src6\r | |
159 | sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r | |
f56c5217 RS |
160 | sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >makefile\r |
161 | rm -f makefile.tmp\r | |
ddff705b | 162 | :src6\r |
3382cd59 RS |
163 | cd ..\r |
164 | rem ----------------------------------------------------------------------\r | |
165 | Echo Configuring the library source directory...\r | |
166 | cd lib-src\r | |
167 | rem Create "makefile" from "makefile.in".\r | |
2f3e7987 RS |
168 | sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c\r |
169 | gcc -E -I. -I../src junk.c | sed -e "s/^ / /" -e "/^#/d" -e "/^[ \f]*$/d" >makefile.new\r | |
b696f860 | 170 | If "%DJGPP_VER%" == "2" goto libsrc-v2\r |
331fdf1e | 171 | sed -f ../msdos/sed3.inp <makefile.new >makefile\r |
f56c5217 RS |
172 | Goto libsrc2\r |
173 | :libsrc-v2\r | |
174 | sed -f ../msdos/sed3v2.inp <makefile.new >makefile\r | |
175 | :libsrc2\r | |
ddff705b | 176 | rm -f makefile.new junk.c\r |
f56c5217 | 177 | if "%nodebug%" == "" goto libsrc3\r |
ddff705b | 178 | sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r |
f56c5217 RS |
179 | sed -e "/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp >makefile\r |
180 | rm -f makefile.tmp\r | |
181 | :libsrc3\r | |
ddff705b MW |
182 | cd ..\r |
183 | rem ----------------------------------------------------------------------\r | |
184 | if "%X11%" == "" goto oldx1\r | |
185 | Echo Configuring the oldxmenu directory...\r | |
186 | cd oldxmenu\r | |
187 | sed -f ../msdos/sed5x.inp <makefile.in >makefile\r | |
188 | if "%nodebug%" == "" goto oldx2\r | |
189 | sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp\r | |
190 | mv -f makefile.tmp makefile\r | |
191 | :oldx2\r | |
3382cd59 | 192 | cd ..\r |
ddff705b | 193 | :oldx1\r |
3382cd59 RS |
194 | rem ----------------------------------------------------------------------\r |
195 | Echo Configuring the main directory...\r | |
b696f860 RS |
196 | If "%DJGPP_VER%" == "2" copy msdos\mainmake.v2 makefile >nul\r |
197 | If "%DJGPP_VER%" == "1" copy msdos\mainmake makefile >nul\r | |
3382cd59 RS |
198 | rem ----------------------------------------------------------------------\r |
199 | :end\r | |
331fdf1e | 200 | set X11=\r |
ddff705b | 201 | set nodebug=\r |
b696f860 | 202 | set djgpp_ver=\r |