changeset 14976:63951d3f3995

Set djgpp-ver, and unset it at the end. Add a number ofconditionals for DJGPP version 2. Rename label libsrc2 to libsrc3. Substitute for LDFLAGS in src/Makefile. Substitute for ALL_CFLAGS in lib-src/Makefile.
author Richard M. Stallman <rms@gnu.org>
date Wed, 10 Apr 1996 05:29:39 +0000
parents 7b91ceb19771
children 2910a512c515
files config.bat
diffstat 1 files changed, 54 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/config.bat	Wed Apr 10 04:15:13 1996 +0000
+++ b/config.bat	Wed Apr 10 05:29:39 1996 +0000
@@ -22,20 +22,22 @@
 rem   YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
 rem
 rem   + msdos version 3 or better.
-rem   + djgpp version 1,11 maint 4 or better (but not version 2).
+rem   + djgpp version 1.12maint1 or later (version 2.0 or later recommended).
 rem   + make utility that allows breaking of the 128 chars limit on
 rem     command lines.  ndmake (as of version 4.5) won't work due to a
 rem     line length limit.  The make that comes with djgpp does work.
-rem   + rm, mv, chmod (From GNU file utilities).
-rem   + sed.
+rem   + rm and mv (from GNU file utilities).
+rem   + sed (you can use the port that comes with DJGPP).
 rem
-rem   You should be able to get all the above utilities from
-rem   oak.oakland.edu in the directories
-rem   "/pub/msdos/djgpp" and "/pub/msdos/gnuish".  There are other mirror
-rem   sites as well.
+rem   You should be able to get all the above utilities from any SimTel
+rem   repository, e.g. ftp.coast.net, in the directories
+rem   "SimTel/vendors/djgpp" and "SimTel/vendors/gnu/gnuish/dos_only".  As
+rem   usual, please use your local mirroring site to reduce trans-Atlantic
+rem   traffic.
 rem   ----------------------------------------------------------------------
 set X11=
 set nodebug=
+set djgpp-ver=
 :again
 if "%1" == "" goto usage
 if "%1" == "--with-x" goto withx
@@ -88,6 +90,32 @@
 Goto End
 :gccOk
 rm -f junk.c junk.o
+Echo Checking what version of DJGPP is installed...
+If Not "%DJGPP%" == "" goto djgppOk
+Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!
+Goto End
+:djgppOk
+echo int main()           >junk.c
+echo #ifdef __DJGPP__    >>junk.c
+echo {return (__DJGPP__)*10;} >>junk.c
+echo #else               >>junk.c
+echo #ifdef __GO32__     >>junk.c
+echo {return 10;}         >>junk.c
+echo #else               >>junk.c
+echo {return 0;}         >>junk.c
+echo #endif              >>junk.c
+echo #endif              >>junk.c
+gcc -o junk.exe junk.c
+junk
+If ErrorLevel 10 Goto go32Ok
+rm -f junk.c junk junk.exe
+Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!
+Goto End
+:go32Ok
+set djgpp-ver=1
+If ErrorLevel 20 set djgpp-ver=2
+rm -f junk.c junk junk.exe
+Echo Configuring for DJGPP Version %DJGPP-VER% ...
 Rem   ----------------------------------------------------------------------
 Echo Configuring the source directory...
 cd src
@@ -113,7 +141,12 @@
 rem   Create "makefile" from "makefile.in".
 rm -f makefile junk.c
 sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c
+If "%DJGPP-VER%" == "1" Goto mfV1
+gcc -E junk.c | sed -f ../msdos/sed1v2.inp >makefile
+goto mfDone
+:mfV1
 gcc -E junk.c | sed -f ../msdos/sed1.inp >makefile
+:mfDone
 rm -f junk.c
 
 if "%X11%" == "" goto src5
@@ -124,7 +157,8 @@
 
 if "%nodebug%" == "" goto src6
 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
-mv -f makefile.tmp makefile
+sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >makefile
+rm -f makefile.tmp
 :src6
 cd ..
 rem   ----------------------------------------------------------------------
@@ -133,12 +167,18 @@
 rem   Create "makefile" from "makefile.in".
 sed -e "1,/cpp stuff/s@^# .*$@@" <makefile.in >junk.c
 gcc -E -I. -I../src junk.c | sed -e "s/^ /	/" -e "/^#/d" -e "/^[ 	]*$/d" >makefile.new
+If "%DJGPP-VER%" == "2" goto libsrc-v2
 sed -f ../msdos/sed3.inp <makefile.new >makefile
+Goto libsrc2
+:libsrc-v2
+sed -f ../msdos/sed3v2.inp <makefile.new >makefile
+:libsrc2
 rm -f makefile.new junk.c
-if "%nodebug%" == "" goto libsrc2
+if "%nodebug%" == "" goto libsrc3
 sed -e "/^CFLAGS *=/s/ *-g//" <makefile >makefile.tmp
-mv -f makefile.tmp makefile
-:libsrc2
+sed -e "/^ALL_CFLAGS *=/s/=/= -s/" <makefile.tmp >makefile
+rm -f makefile.tmp
+:libsrc3
 cd ..
 rem   ----------------------------------------------------------------------
 if "%X11%" == "" goto oldx1
@@ -153,8 +193,10 @@
 :oldx1
 rem   ----------------------------------------------------------------------
 Echo Configuring the main directory...
-copy msdos\mainmake makefile >nul
+If "%DJGPP-VER%" == "2" copy msdos\mainmake.v2 makefile >nul
+If "%DJGPP-VER%" == "1" copy msdos\mainmake makefile >nul
 rem   ----------------------------------------------------------------------
 :end
 set X11=
 set nodebug=
+set djgpp-ver=