From: Michael Meissner Date: Fri, 22 Jul 1994 13:55:40 +0000 (+0000) Subject: DJ patches for MSDOS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2fdae8ecd11ead7baa727d0d6cf9e2802793d77;p=gcc.git DJ patches for MSDOS From-SVN: r7792 --- diff --git a/gcc/config/msdos/configur.bat b/gcc/config/msdos/configur.bat new file mode 100644 index 00000000000..3e202e8d509 --- /dev/null +++ b/gcc/config/msdos/configur.bat @@ -0,0 +1,33 @@ +@echo off +echo Configuring GCC for go32 +rem This batch file assumes a unix-type "sed" program + +if not exist config\msdos\configure.bat chdir ..\.. + +update config\i386\xm-dos.h config.h +update config\i386\xm-dos.h hconfig.h +update config\i386\xm-dos.h tconfig.h +update config\i386\go32.h tm.h +update config\i386\i386.md md +update config\i386\i386.c aux-output.c + +echo # Makefile generated by "configure.bat"> Makefile +echo all.dos: cccp cc1 cc1obj xgcc s-objlist >> Makefile +sed -f config/msdos/top.sed Makefile.in >> Makefile + +set LANG= + +if not exist cp\make-lang.in goto no_cp +sed -f config/msdos/top.sed cp\make-lang.in >> Makefile +sed -f config/msdos/top.sed cp\makefile.in > cp\Makefile +set LANG=%LANG% c++.& +:no_cp + +echo lang.mostlyclean: %LANG% | sed "s/&/mostlyclean/g" >> Makefile +echo lang.clean: %LANG% | sed "s/&/clean/g" >> Makefile +echo lang.distclean: %LANG% | sed "s/&/distclean/g" >> Makefile +echo lang.realclean: %LANG% | sed "s/&/realclean/g" >> Makefile + +echo #define MULTILIB_SELECT ". ;" > multilib.h1 +update multilib.h1 multilib.h +del multilib.h1 diff --git a/gcc/config/msdos/top.sed b/gcc/config/msdos/top.sed new file mode 100644 index 00000000000..68636504da5 --- /dev/null +++ b/gcc/config/msdos/top.sed @@ -0,0 +1,38 @@ +/\.o[ ]*:/ s/config.status// +/^multilib.h/ s/multilib/not-multilib/ +/^target=/ c\ +target=go32 +/^xmake_file=/ d +/^tmake_file=/ d +/^version=/ c\ +version=2.6.0 +s/CC = cc/CC = gcc/ +s/:\$/: \$/g +s/^ \ *\.\// go32 / +s/<\ *\$(srcdir)\//< $(srcdir)\\/g +s/^ \$(srcdir)\/move-if-change/ update/ +s/^USE_/# USE_/ +s/`echo \$(srcdir)\///g +s/ | sed 's,\^\\\.\/,,'`//g +s/^ cd \$(srcdir)[ ]*;/ / +/^# USE_HOST_OBSTACK/ i\ +USE_HOST_OBSTACK=obstack.o +/^stamp-attrtab/,/update/ { + /\\/d + /fi/d + /update/ i\ + go32 genattrtab md > t-attrtab.c +} +/^enquire[ ]*:/ s/\$(GCC_PARTS)//g +/^enquire.o[ ]*:/ s/\$(GCC_PASSES)//g +/^GCC_FOR_TARGET =/ c\ +GCC_FOR_TARGET = gcc +s/; *@true// +s/stamp-/s-/g +s/tmp-/t-/g +/> *s-objlist/ c\ + echo.exe -o s-objlist $(addprefix ../,$(OBJS) $(BC_OBJS)) +/^OBJS.*s-objlist/ s?`cat ../s-objlist`?@../s-objlist? +s/^\(SUBDIR_OBSTACK *=\).*$/\1 ..\/obstack.o/ +s/^\(SUBDIR_USE_ALLOCA *=\).*$/\1/ +s/^\(SUBDIR_MALLOC *=\).*$/\1/ diff --git a/gcc/configure.bat b/gcc/configure.bat index 8aeb04ad149..bbe72e73bb2 100644 --- a/gcc/configure.bat +++ b/gcc/configure.bat @@ -1,54 +1,2 @@ -@echo off -echo Configuring GCC for go32 -rem This batch file assumes a unix-type "sed" program - -update config\i386\xm-dos.h config.h -update config\i386\xm-dos.h hconfig.h -update config\i386\xm-dos.h tconfig.h -update config\i386\go32.h tm.h -update config\i386\i386.md md -update config\i386\i386.c aux-output.c - -echo # Makefile generated by "configure.bat"> Makefile -echo all.dos: cccp cc1 cc1plus cc1obj xgcc>> Makefile - -if exist config.sed del config.sed - -echo "/\.o[ ]*:/ s/config.status// ">> config.sed -echo "/^target=/ c\ ">> config.sed -echo "target=go32 ">> config.sed -echo "/^version=/ c\ ">> config.sed -sed -e "s/.*\"\([^ \"]*\)[ \"].*/version=\1/" version.c >> config.sed -echo "s/CC = cc/CC = gcc/ ">> config.sed -echo "s/:\$/: \$/g ">> config.sed -echo "s/^ \ *\.\// go32 / ">> config.sed -echo "s/<\ *\$(srcdir)\//< $(srcdir)\\/g ">> config.sed -echo "s/^ \$(srcdir)\/move-if-change/ update/ ">> config.sed -echo "s/^USE_/# USE_/ ">> config.sed -echo "s/`echo \$(srcdir)\///g ">> config.sed -echo "s/ | sed 's,\^\\\.\/,,'`//g ">> config.sed -echo "s/^ cd \$(srcdir)[ ]*;/ / ">> config.sed - -echo "/^# USE_HOST_OBSTACK/ i\ ">> config.sed -echo "USE_HOST_OBSTACK=obstack.o ">> config.sed - -echo "/^stamp-attrtab/,/update/ { ">> config.sed -echo " /\\/d ">> config.sed -echo " /fi/d ">> config.sed -echo " /update/ i\ ">> config.sed -echo " go32 genattrtab md > t-attrtab.c ">> config.sed -echo "} ">> config.sed - -echo "/^enquire[ ]*:/ s/\$(GCC_PARTS)//g ">> config.sed -echo "/^enquire.o[ ]*:/ s/\$(GCC_PASSES)//g ">> config.sed -echo "/^GCC_FOR_TARGET =/ c\ ">> config.sed -echo "GCC_FOR_TARGET = gcc ">> config.sed - -echo "s/; *@true// ">> config.sed -echo "s/stamp-/s-/g ">> config.sed -echo "s/tmp-/t-/g ">> config.sed - -sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed -sed -f config2.sed Makefile.in >> Makefile -del config.sed -del config2.sed +@echo off +config\msdos\configure %1 %2 %3 %4 diff --git a/gcc/gcc.c b/gcc/gcc.c index 1568935a43c..52e38ff9231 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1873,10 +1873,7 @@ static int last_pipe_input; #ifndef OS2 #ifdef __MSDOS__ -/* Declare these to avoid compilation error. They won't be called. */ -int execv(const char *a, const char **b){} -int execvp(const char *a, const char **b){} - +#include static int pexecute (search_flag, program, argv, not_last) int search_flag; @@ -1884,6 +1881,9 @@ pexecute (search_flag, program, argv, not_last) char *argv[]; int not_last; { +#ifdef __GO32__ + int i = (search_flag ? spawnv : spawnvp) (1, program, argv); +#else char *scmd, *rf; FILE *argfile; int i, el = search_flag ? 0 : 4; @@ -1912,13 +1912,13 @@ pexecute (search_flag, program, argv, not_last) i = system (scmd); remove (rf); +#endif if (i == -1) { perror_exec (program); return MIN_FATAL_STATUS << 8; } - return i << 8; }