📄 install.c
字号:
return; } }#endifprintf("%s%*s",str,n,"");}#ifdef MSDOStool_bso(){char *chkfile; tools = "BSODOS"; printf("Enter location of %s tools (/r3000) > ",tools); for (;;) { Gets(buf); printf("\n"); if (strempty(buf)) strcpy(buf,"/r3000"); chkfile = "bin386/cc3.exe"; sprintf(tmp,"%s/%s",buf,chkfile); if (fileExists(tmp)) break; chkfile = "bin/cc3.exe"; sprintf(tmp,"%s/%s",buf,chkfile); if (fileExists(tmp)) break; printf("%s: not found, reenter the path > ",tmp); } fileFixer = do_bso; dlport_def = "com1"; strcpy(COMP_ROOT,buf);}tool_alg(){char *chkfile; tools = "ALGDOS"; printf("Enter location of %s tools (/) > ",tools); for (;;) { Gets(buf); printf("\n"); if (strempty(buf)) strcpy(buf,"/."); chkfile = "bin/gcc-sde.exe"; sprintf(tmp,"%s/%s",buf,chkfile); if (fileExists(tmp)) { printf("Have identified sde2 tools.\n"); break; } chkfile = "bin/sde-gcc.exe"; sprintf(tmp,"%s/%s",buf,chkfile); if (fileExists(tmp)) { printf("Have identified sde3 tools.\n"); tools = "ALGDOS3"; break; } printf("%s: not found, reenter the path > ",tmp); } dlport_def = "com1"; strcpy(COMP_ROOT,buf); if (strequ(tools,"ALGDOS3")) { toolrev = 30000; fileFixer = do_algor3; } else { toolrev = getAlgoToolRev(COMP_ROOT); fileFixer = do_algor; }}tool_cygelf(){char *chkfile;char *p; tools = "CYGELFDOS"; chkfile = "mips-lsi-elf-gcc.exe"; while (1) { printf("Where are the tools located? (\\cygnus) > "); Gets(buf); printf("\n"); if (strempty(buf)) strcpy(buf,"\\cygnus"); findit(buf,chkfile,cygbin,1); if (*cygbin) break; printf("%s/*/%s: File not found.\n",buf,chkfile); } printf("Found %s/%s.\n",cygbin,chkfile); fileFixer = do_cyg; dlport_def = "com1"; strcpy(COMP_ROOT,buf); findit(COMP_ROOT,"man1",manpath,1); findit(buf,"libgcc.a",libgcc,1); p = rstrstr(libgcc,"lsi"); if (p) { /* 981203 */ for (;*p && *p != '/' && *p != '\\';p++) ; *p = 0; } printf("Found %s/%s.\n",libgcc,"libgcc.a");}tool_epi(){char *chkfile; tools = "EPIDOS"; printf("Enter location of %s tools (/) > ",tools); chkfile = "bin/hc.exe"; for (;;) { Gets(buf); printf("\n"); if (strempty(buf)) strcpy(buf,"/."); sprintf(tmp,"%s/%s",buf,chkfile); if (fileExists(tmp)) break; printf("%s: not found, reenter the path > ",tmp); } fileFixer = do_epi; dlport_def = "com1"; strcpy(COMP_ROOT,buf);}tool_ghs(){char *chkfile; tools = "GHSDOS"; printf("Enter location of %s tools (\\green) > ",tools); chkfile = "ccmipe.exe"; for (;;) { Gets(buf); printf("\n"); if (strempty(buf)) strcpy(buf,"\\green"); sprintf(tmp,"%s/%s",buf,chkfile); if (fileExists(tmp)) break; printf("%s: not found, reenter the path > ",tmp); } fileFixer = do_ghs; dlport_def = "com1"; strcpy(COMP_ROOT,buf);}tool_cyg(){char *chkfile;#if 0 /* untested, I don't have these tools */ tools = "CYGNUS"; printf("Enter location of %s tools (/) > ",tools); chkfile = "xxxx/bin/mips-idt-ecoff-as"; for (;;) { Gets(buf); printf("\n"); if (strempty(buf)) strcpy(buf,"/."); sprintf(tmp,"%s/%s",buf,chkfile); if (fileExists(tmp)) break; printf("%s: not found, reenter the path > ",tmp); } fileFixer = do_cygnus; dlport_def = "com1"; strcpy(COMP_ROOT,buf);#endif}#else /* ======================= Unix ========================= */tool_mips(){#if 0 /* assume the user knows what he is doing */ backtick(buf,"uname -m"); if (!strstr(buf,"sun4")) { printf("Are you sure this is a SPARCstation? [y n] (n) >"); Gets(buf); if (striequ(buf,"n") || buf[0] == 0) exit(1); }#endif tools = "MIPSSUN"; MIPSTOOLS = 1; CROSSTOOLS = 1; remote = "/etc/remote.pdbx"; dlport_def = "ttyb"; while (1) { printf("Where are the tools located? > "); Gets(buf); printf("\n"); sprintf(tmp,"%s/usr/bin/ccr3000",buf); if (fileExists(tmp)) { NMOD = "r3000"; break; } sprintf(tmp,"%s/usr/bin/ccx",buf); if (fileExists(tmp)) { NMOD = "x"; break; } printf("%s/usr/bin/cc{r3000,x}: File not found.\n",buf); } strcpy(COMP_ROOT,buf);}tool_bso(){ /* BSO */#if 0 /* assume the user knows what he is doing */ backtick(buf,"uname -m"); if (!strstr(buf,"sun4")) { printf("Are you sure this is a SPARCstation? [y n] (n) >"); Gets(buf); if (striequ(buf,"n") || buf[0] == 0) exit(1); }#endif tools = "BSOUNIX"; CROSSTOOLS = 1; while (1) { printf("Where are the tools located? > "); Gets(buf); printf("\n"); sprintf(tmp,"%s/r3000/bin/cc3",buf); if (fileExists(tmp)) break; printf("%s: File not found.",tmp); } strcpy(COMP_ROOT,buf); dlport_def = "ttyb";}tool_epi(){#if 0 /* assume the user knows what he is doing */ backtick(buf,"uname -m"); if (!strstr(buf,"sun4")) { printf("Are you sure this is a SPARCstation? [y n] (n) >"); Gets(buf); if (striequ(buf,"n") || buf[0] == 0) exit(1); }#endif tools = "EPIUNIX"; CROSSTOOLS = 1; while (1) { printf("Where are the tools located? > "); Gets(buf); printf("\n"); sprintf(tmp,"%s/bin/hc",buf); if (fileExists(tmp)) break; printf("%s: File not found.",tmp); } strcpy(COMP_ROOT,buf); dlport_def = "ttyb";}tool_alg(){ /* ALGUNIX */#if 0 /* assume the user knows what he is doing */ backtick(buf,"uname -m"); if (!strstr(buf,"sun4")) { printf("Are you sure this is a SPARCstation? [y n] (n) >"); Gets(buf); if (striequ(buf,"n") || buf[0] == 0) exit(1); }#endif tools = "ALGUNIX"; CROSSTOOLS = 1; strcpy(COMP_ROOT,"/usr/local/sde"); while (1) { printf("Where are the tools located? (%s) > ", COMP_ROOT); Gets(buf); printf("\n"); if (buf[0] == 0) strcpy(buf,COMP_ROOT); sprintf(tmp,"%s/bin/gcc-sde",buf); if (fileExists(tmp)) { printf("Have identified sde2 tools.\n"); break; } sprintf(tmp,"%s/bin/sde-gcc",buf); if (fileExists(tmp)) { printf("Have identified sde3 tools.\n"); tools = "ALGUNIX3"; break; } printf("%s: File not found.",tmp); } strcpy(COMP_ROOT,buf); dlport_def = "ttyb"; if (strequ(tools,"ALGUNIX3")) toolrev = 30000; else toolrev = getAlgoToolRev(COMP_ROOT);}tool_ghs(){char *chkfile; tools = "GHSUNIX"; CROSSTOOLS = 1; printf("Enter location of %s tools (/) > ",tools); chkfile = "ccmipe"; for (;;) { Gets(buf); printf("\n"); if (strempty(buf)) strcpy(buf,"/"); sprintf(tmp,"%s/%s",buf,chkfile); if (fileExists(tmp)) break; printf("%s: not found, reenter the path > ",tmp); } dlport_def = "ttyb"; strcpy(COMP_ROOT,buf);}tool_cygelf(){char *chkfile,*p; tools = "CYGUNIXELF"; CROSSTOOLS = 1; while (1) { chkfile = "mips-lsi-elf-as"; printf("Where are the tools located? > "); Gets(buf); printf("\n"); findit(buf,chkfile,cygbin,1); if (*cygbin) break; printf("%s/*/%s: File not found.",buf,chkfile); } printf("Found %s/%s.\n",cygbin,chkfile); strcpy(COMP_ROOT,buf); findit(COMP_ROOT,"man1",manpath,1); findit(buf,"libgcc.a",libgcc,1); p = rstrstr(libgcc,"lsi"); for (;*p && *p != '/' && *p != '\\';p++) ; *p = 0; printf("Found %s/%s.\n",libgcc,"libgcc.a");}tool_cygcoff(){char *chkfile;#if 0 /* assume the user knows what he is doing */ backtick(buf,"uname -m"); if (!strstr(buf,"sun4")) { printf("Are you sure this is a SPARCstation? [y n] (n) >"); Gets(buf); if (striequ(buf,"n") || buf[0] == 0) exit(1); }#endif tools = "CYGUNIXCOFF"; CROSSTOOLS = 1; while (1) { chkfile = "mips-idt-ecoff-as"; printf("Where are the tools located? > "); Gets(buf); printf("\n"); findit(buf,chkfile,cygbin,1); if (*cygbin) break; printf("%s/*/%s: File not found.",buf,chkfile); } strcpy(COMP_ROOT,buf); findit(COMP_ROOT,"man1",manpath,1);}tool_mipsnative(){ /* MIPSNATIVE */ backtick(buf,"uname -m"); if (!strstr(buf,"mips")) { printf("Are you sure this is a MIPS computer? [y n] (n) >"); Gets(buf); if (striequ(buf,"n") || buf[0] == 0) exit(1); } backtick(buf,"uname -r"); if (strstr(buf,"4_0")) { printf("uname -r=[%s]\n",buf); printf("Due to problems with the assembler,\n"); printf("this package will not build on RISC/os 4.0\n"); printf("exiting.\n"); exit(1); } if (strstr(buf,"5.")) lstadd(cfg,"RISC5"); if (strstr(buf,"4_5")) lstadd(cfg,"RISC45"); tools = "MIPSNATIVE"; remote = "/etc/remote.pdbx"; dlport_def = "tty1"; strcpy(COMP_ROOT,"native"); MIPSTOOLS = 1;}tool_dec(){ /* DECSTATION */ backtick(buf,"uname -m"); if (!strequ(buf,"RISC")) { printf("Are you sure this is a DecStation? [y n] (n) >"); Gets(buf); if (striequ(buf,"n") || buf[0] == 0) exit(1); } lstadd(cfg,"DECRISC"); tools = "DECSTATION"; remote = "/etc/remote"; dlport_def = "tty01"; strcpy(COMP_ROOT,"native"); MIPSTOOLS = 1;}tool_sgi(){ /* SGI */ backtick(buf,"uname -m"); if (!strequ(buf,"IRIS")) { printf("Are you sure this is an SGI computer? [y n] (n) >"); Gets(buf); if (striequ(buf,"n") || buf[0] == 0) exit(1); } lstadd(cfg,"SGIRISC"); tools = "SGI"; remote = "/etc/remote"; dlport_def = "ttyd2"; strcpy(COMP_ROOT,"native"); MIPSTOOLS = 1;}#endifstruct ToolList { char *name; vFunc *func; } toolList[] = {#ifdef MSDOS {"Algorithmics tools - tested with 3.0",tool_alg}, {"Cygnus Solutions tools (ELF) - tested with lsi-970730",tool_cygelf}, {"Green Hills tools - tested with 1.8.9",tool_ghs}, {"Tasking tools - tested with 4.0rb",tool_bso},#else /* UNIX */ {"Algorithmics tools",tool_alg}, {"Cygnus Solutions tools (ELF)",tool_cygelf}, {"Green Hills tools",tool_ghs}, {"Tasking tools",tool_bso},#if 0 /* no longer supported or untested */ {"EPI tools",tool_epi}, {"EPI tools",tool_epi}, {"Cygnus Solutions tools (COFF)",tool_cygcoff}, {"MIPS tools hosted on a SPARCstation",tool_mips}, {"MIPS tools hosted on a MIPS system",tool_mipsnative}, {"A MIPS-based Decstation",tool_dec}, {"A MIPS-based SGI workstation",tool_sgi},#endif#endif {0}};/************************************************************** SelectTools(cmd)*/VOID SelectTools(cmd)int cmd;{int r,i;char *chkfile;if (cmd) { sprintf(tmp,"Tools: %s",tools); bufprt(tmp); if (toolrev) { sprintf(tmp," (%d)",toolrev); bufprt(tmp); } return; }printf("This package can be built using a number of different MIPS\n");printf("cross compilers. Select one of the following tool types:\n\n");printf("\n");for (i=0;toolList[i].name;i++) printf("%d. %s\n",i+1,toolList[i].name);printf("\nEnter one of the above tool types [1-%d q] (q) > ",i);for (;;) { Gets(buf); printf("\n"); if (*buf == 0) exit(1); if (striequ(buf,"q")) exit(1); sscanf(buf,"%d",&r); if (r >= 1 && r <= i) break; printf("BAD value, reenter your selection > "); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -