From f56c521706a739309e6df5a8f81da1c6445461c5 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 10 Apr 1996 05:29:39 +0000 Subject: [PATCH] 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. --- config.bat | 66 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/config.bat b/config.bat index 2799f545b67..5b8cc2a6cd6 100644 --- a/config.bat +++ b/config.bat @@ -22,20 +22,22 @@ rem ---------------------------------------------------------------------- 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 @@ rm -f junk.c 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 @@ if exist dir.h ren dir.h vmsdir.h rem Create "makefile" from "makefile.in". rm -f makefile junk.c sed -e "1,/cpp stuff/s@^# .*$@@" 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 @@ rm -f makefile.tmp if "%nodebug%" == "" goto src6 sed -e "/^CFLAGS *=/s/ *-g//" makefile.tmp -mv -f makefile.tmp makefile +sed -e "/^LDFLAGS *=/s/=/=-s/" makefile +rm -f makefile.tmp :src6 cd .. rem ---------------------------------------------------------------------- @@ -133,12 +167,18 @@ cd lib-src rem Create "makefile" from "makefile.in". sed -e "1,/cpp stuff/s@^# .*$@@" 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 +Goto libsrc2 +:libsrc-v2 +sed -f ../msdos/sed3v2.inp makefile +:libsrc2 rm -f makefile.new junk.c -if "%nodebug%" == "" goto libsrc2 +if "%nodebug%" == "" goto libsrc3 sed -e "/^CFLAGS *=/s/ *-g//" makefile.tmp -mv -f makefile.tmp makefile -:libsrc2 +sed -e "/^ALL_CFLAGS *=/s/=/= -s/" makefile +rm -f makefile.tmp +:libsrc3 cd .. rem ---------------------------------------------------------------------- if "%X11%" == "" goto oldx1 @@ -153,8 +193,10 @@ cd .. :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= -- 2.39.2