+:msdos\r
+Echo Checking whether 'sed' is available...\r
+sed -e "w junk.$$$" <Nul\r
+If Exist junk.$$$ Goto sedOk\r
+Echo To configure 'Emacs' you need to have 'sed'!\r
+Goto End\r
+:sedOk\r
+Echo Checking whether 'rm' is available...\r
+rm -f junk.$$$\r
+If Not Exist junk.$$$ Goto rmOk\r
+Echo To configure 'Emacs' you need to have 'rm'!\r
+Goto End\r
+:rmOk\r
+Echo Checking whether 'mv' is available...\r
+rm -f junk.1 junk.2\r
+echo foo >junk.1\r
+mv junk.1 ./junk.2\r
+If Exist junk.2 Goto mvOk\r
+Echo To configure 'Emacs' you need to have 'mv'!\r
+rm -f junk.1\r
+Goto End\r
+:mvOk\r
+rm -f junk.2\r
+Echo Checking whether 'gcc' is available...\r
+echo main(){} >junk.c\r
+gcc -c junk.c\r
+if exist junk.o goto gccOk\r
+Echo To configure 'Emacs' you need to have 'gcc'!\r
+rm -f junk.c\r
+Goto End\r
+:gccOk\r
+rm -f junk.c junk.o junk junk.exe\r
+Echo Checking what version of DJGPP is installed...\r
+If Not "%DJGPP%" == "" goto djgppOk\r
+Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!\r
+Goto End\r
+:djgppOk\r
+echo int main() >junk.c\r
+echo #ifdef __DJGPP__ >>junk.c\r
+echo {return (__DJGPP__)*10;} >>junk.c\r
+echo #else >>junk.c\r
+echo #ifdef __GO32__ >>junk.c\r
+echo {return 10;} >>junk.c\r
+echo #else >>junk.c\r
+echo {return 0;} >>junk.c\r
+echo #endif >>junk.c\r
+echo #endif >>junk.c\r
+gcc -o junk junk.c\r
+if not exist junk.exe coff2exe junk\r
+junk\r
+If ErrorLevel 10 Goto go32Ok\r
+rm -f junk.c junk junk.exe\r
+Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!\r
+Goto End\r
+:go32Ok\r
+set djgpp_ver=1\r
+If ErrorLevel 20 set djgpp_ver=2\r
+rm -f junk.c junk junk.exe\r
+rem The v1.x build does not need djecho\r
+if "%DJGPP_VER%" == "1" Goto djechoOk\r
+rem DJECHO is used by the top-level Makefile in the v2.x build\r
+Echo Checking whether 'djecho' is available...\r
+redir -o Nul -eo djecho -o junk.$$$ foo\r
+If Exist junk.$$$ Goto djechoOk\r
+Echo To build 'Emacs' you need the 'djecho.exe' program!\r
+Echo 'djecho.exe' is part of 'djdevNNN.zip' basic DJGPP development kit.\r
+Echo Versions of DJGPP before 2.02 called this program 'echo.exe'.\r
+Echo Either unpack 'djecho.exe' from the 'djdevNNN.zip' archive,\r
+Echo or, if you have 'echo.exe', copy it to 'djecho.exe'.\r
+Echo Then run CONFIG.BAT again with the same arguments you did now.\r
+Goto End\r
+:djechoOk\r
+rm -f junk.$$$\r
+Echo Configuring for DJGPP Version %DJGPP_VER% ...\r
+Rem ----------------------------------------------------------------------\r