diff options
author | Marc Espie <espie@cvs.openbsd.org> | 1999-05-26 13:38:57 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 1999-05-26 13:38:57 +0000 |
commit | 0126e157b87f137fc08dc7f46f6c291b9d06ac5d (patch) | |
tree | f8555e3e504eb82b4cd3cba5cec20ae4ce8124ff /gnu/egcs/gcc/config/msdos | |
parent | ff8e9a4356e55ed142306c3a375fa280800abc86 (diff) |
egcs projects compiler system
Exact copy of the snapshot, except for the removal of
texinfo/
gcc/ch/
libchill/
Diffstat (limited to 'gnu/egcs/gcc/config/msdos')
-rw-r--r-- | gnu/egcs/gcc/config/msdos/configur.bat | 47 | ||||
-rw-r--r-- | gnu/egcs/gcc/config/msdos/libgcc.mak | 14 | ||||
-rw-r--r-- | gnu/egcs/gcc/config/msdos/mklibgcc.c | 98 | ||||
-rw-r--r-- | gnu/egcs/gcc/config/msdos/top.sed | 57 |
4 files changed, 216 insertions, 0 deletions
diff --git a/gnu/egcs/gcc/config/msdos/configur.bat b/gnu/egcs/gcc/config/msdos/configur.bat new file mode 100644 index 00000000000..03e41091686 --- /dev/null +++ b/gnu/egcs/gcc/config/msdos/configur.bat @@ -0,0 +1,47 @@ +@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 libgcc.a s-objlist >> Makefile
+sed -f config/msdos/top.sed Makefile.in >> Makefile
+
+set LANG=
+
+if not exist ada\make-lang.in goto no_ada
+sed -f config/msdos/top.sed ada\make-lang.in >> Makefile
+sed -f config/msdos/top.sed ada\makefile.in > ada\Makefile
+set LANG=%LANG% ada.&
+:no_ada
+
+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.maintainer-clean: %LANG% | sed "s/&/maintainer-clean/g" >> Makefile
+echo /* options.h */ > options.h
+if exist cp\lang-options.h echo #include "cp/lang-options.h" >> options.h
+if exist ada\lang-options.h echo #include "ada/lang-options.h" >> options.h
+if exist f\lang-options.h echo #include "f/lang-options.h" >> options.h
+echo /* specs.h */ > specs.h
+if exist cp\lang-specs.h echo #include "cp/lang-specs.h" >> specs.h
+if exist ada\lang-specs.h echo #include "ada/lang-specs.h" >> specs.h
+if exist f\lang-specs.h echo #include "f/lang-specs.h" >> specs.h
+
+echo #define MULTILIB_SELECT ". ;" > multilib.h1
+update multilib.h1 multilib.h
+del multilib.h1
diff --git a/gnu/egcs/gcc/config/msdos/libgcc.mak b/gnu/egcs/gcc/config/msdos/libgcc.mak new file mode 100644 index 00000000000..5f480b152d3 --- /dev/null +++ b/gnu/egcs/gcc/config/msdos/libgcc.mak @@ -0,0 +1,14 @@ +# Build libgcc.a
+
+libgcc.a : libgcc1.c libgcc2.c mklibgcc
+ ./mklibgcc -c
+ ./mklibgcc '$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES)' libgcc1.c $(LIB1FUNCS)
+ ./mklibgcc '$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES)' libgcc2.c $(LIB2FUNCS)
+ -command /c mklibnow.bat
+ -command /c del libgcc.a
+ ar rvs libgcc.a lgcctmp/*.o
+
+mklibgcc : config/msdos/mklibgcc.c
+ gcc $(CFLAGS) $^ -o $@
+
+
diff --git a/gnu/egcs/gcc/config/msdos/mklibgcc.c b/gnu/egcs/gcc/config/msdos/mklibgcc.c new file mode 100644 index 00000000000..705b3d5c404 --- /dev/null +++ b/gnu/egcs/gcc/config/msdos/mklibgcc.c @@ -0,0 +1,98 @@ +#include <stdio.h>
+#include <string.h>
+#include <dirent.h>
+
+char *skips[] = {
+ "__main",
+ "_ctors",
+ "_exit",
+ "_ctor_list",
+ "_dtor_list",
+ 0
+};
+
+int
+do_clean()
+{
+ DIR *dir;
+ struct dirent *de;
+ remove("mklibnow.bat");
+
+ dir = opendir("lgcctmp");
+ if (!dir)
+ return 0;
+ while ((de=readdir(dir)))
+ {
+ char buf[30];
+ if (de->d_name[0] == '.')
+ continue;
+ sprintf(buf, "lgcctmp/%s", de->d_name);
+ unlink(buf);
+ }
+ closedir(dir);
+ return 0;
+}
+
+int
+main(int argc, char **argv)
+{
+ char *cc = argv[1];
+ char *csrc=argv[2];
+ int i;
+ FILE *batfile;
+ FILE *cfile;
+
+ if (argc > 1 && strcmp(argv[1], "-c")==0)
+ return do_clean();
+
+ mkdir("lgcctmp", 0755);
+
+ batfile = fopen("mklibnow.bat", "a");
+ if (!batfile)
+ {
+ perror("mklibnow.bat");
+ return 1;
+ }
+ fprintf(batfile, "@echo off\n");
+
+ for (i=3; i<argc; i++)
+ {
+ char basename[30], *bp;
+ int s;
+ for (s=0; skips[s]; s++)
+ if (strcmp(skips[s], argv[i]) == 0)
+ break;
+ if (skips[s])
+ continue;
+ strcpy(basename, "lgcctmp/");
+ if (strncmp(argv[i], "_fix", 4)==0)
+ {
+ strcat(basename, "fx");
+ strcat(basename, argv[i]+4);
+ }
+ else if (strncmp(argv[i], "_float", 4)==0)
+ {
+ strcat(basename, "flt");
+ strcat(basename, argv[i]+6);
+ }
+ else
+ {
+ strcat(basename, argv[i]);
+ }
+ bp = basename + strlen(basename);
+ fprintf(batfile, "%s -c %s.c -o %s.o\n", cc, basename, basename);
+ strcpy(bp, ".c");
+ cfile = fopen(basename, "w");
+ if (cfile)
+ {
+ *bp = 0;
+ fprintf(cfile, "#define L%s\n#include \"%s\"\n", argv[i], csrc);
+ fclose(cfile);
+ }
+ else
+ perror(basename);
+ }
+
+ fclose(batfile);
+ return 0;
+}
diff --git a/gnu/egcs/gcc/config/msdos/top.sed b/gnu/egcs/gcc/config/msdos/top.sed new file mode 100644 index 00000000000..64027f55355 --- /dev/null +++ b/gnu/egcs/gcc/config/msdos/top.sed @@ -0,0 +1,57 @@ +/\.o[ ]*:/ s/config.status// +/^multilib.h/ s/multilib/not-multilib/ +/^target=/ c\ +target=go32 +/^out_file=/ c\ +out_file=config/i386/i386.c +/^out_object_file=/ c\ +out_object_file=i386.o +/^md_file=/ c\ +md_file=config/i386/i386.md +/^tm_file=/ c\ +tm_file=config/i386/go32.h +/^build_xm_file=/ c\ +build_xm_file=config/i386/xm-dos.h +/^host_xm_file=/ c\ +host_xm_file=config/i386/xm-dos.h +/^lang_specs_files=/ d +/^lang_options_files=/ d +/^xmake_file=/ d +/^tmake_file=/ d +/^version=/ c\ +version=2.8.1 +/^mainversion=/ c\ +mainversion=2.8.1 +s/CC = cc/CC = gcc/ +s/:\$/: \$/g +s/^ \ *\.\// / +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 + /[ ]fi$/d + /update/ i\ + 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)) +/^OBJS.*s-objlist/ s?`cat ../s-objlist`?@../s-objlist? +s/^\(SUBDIR_OBSTACK *=\).*$/\1 ..\/obstack.o/ +s/^\(SUBDIR_USE_ALLOCA *=\).*$/\1/ +s/^\(SUBDIR_MALLOC *=\).*$/\1/ +/^# Build libgcc.a/ r config/msdos/libgcc.mak +/^# Build libgcc.a/,// d |