pike.git / NT / tools / rntcc

version» Context lines:

pike.git/NT/tools/rntcc:7:      // Verbose is default for now, this can be turned off one this   // frontend has been refined to where it does not require more   // debugging.      int verbose=0;      // Temporary variable   int linking_failed;    + // Files to remove upon exit + string *tmpfiles=({}); +  + void exit(int code) + { +  if(getenv("CLEANUP")!="no") +  Array.map(tmpfiles,rm); +  +  predef::exit(code); + } +    string get_ext(string file)   {    sscanf(file=lower_case(reverse(file)),"%s.",file);    return reverse(file);   }      int compile(string *sources,    string dest,    string errorfile,    string *cflags)
pike.git/NT/tools/rntcc:126:       case "share":    share=1;    ldopts=({"SYSTEM","nt_dll","initinstance","terminstance"})+ldopts;    cflags+=({"-bd"});    break;       case "oper_pre": operation="preprocess"; break;    case "oper_comp": operation="compile"; break;    case "debug": - // cflags+=({"-d2"}); - // ldopts+=({"DEBUG","WATCOM","ALL"}); +  cflags+=({"-d2"}); +  ldopts+=({"DEBUG","WATCOM","ALL"});    -  cflags+=({"-d2","-hd"}); -  ldopts+=({"DEBUG","DWARF"}); + // cflags+=({"-d2","-hd"}); + // ldopts+=({"DEBUG","DWARF"});      // cflags+=({"-d2","-hc"});   // ldopts+=({"DEBUG","CODEVIEW","OPTION","CVPACK"});    debug=1;    break;       case "optimize":    if(!option[1]) option[1]=1;    switch(optimize=(int)option[1])    {
pike.git/NT/tools/rntcc:236:       default:    sources+=({tmp});    }    }       if(output) rm(output);       string errorfile="tmp"+getpid()+".err";    rm(errorfile); +  tmpfiles+=({errorfile});       // Flags required to make the compiler behave well    cflags+=({"-bm","-zq","-sg","-5","-fpi87","-fp3"});       switch(operation)    {    default:    werror("Unknown operation "+operation+".\n");    exit(1);   
pike.git/NT/tools/rntcc:268:       case "cc":    case "cpp":    int ret=silent_do_cmd( ({"wpp386","-p","-fr"+errorfile}) + cflags + Array.map(sources, fixpath));    break;    }    break;    }       case "link": +  int objnum;    foreach(sources, string source)    { -  string obj=reverse(source); -  sscanf(obj,"%*s.%s",obj); -  obj=reverse(obj)+".obj"; -  +  string obj=sprintf("TMP%dX%d.obj",getpid(),objnum++);    compile( ({source}), obj, errorfile, cflags);    objects+=({obj}); -  +  tmpfiles+=({obj});    check_errorfile(errorfile);    }      // objects+=({"BINMODE.OBJ"});    string ldfile="TMP"+getpid()+".lk"; -  +  tmpfiles+=({ldfile});    if(!output) output="a.out";    rm(ldfile);    -  +     target=output;    if(!share) target+=".exe";       string linkopts=("NAME "+target+" " +    ldopts*" "+" "+    "FILE "+Array.map(objects,fixpath)*","+" "+    sprintf("%{LIBRARY %s %}",libraries));    Stdio.write_file(ldfile,linkopts);    if(verbose)    werror("DOING wlink "+linkopts+"\n");
pike.git/NT/tools/rntcc:308:    write("\n");   #endif    linking_failed=0;       silent_do_cmd( ({"wlink","@"+ldfile }), lambda(string data)    {    if(search(data," W1008:")!=-1)    linking_failed++;    });    -  if(getenv("CLEANUP")!="no") -  rm(ldfile); +        if(linking_failed) exit(1);    }       check_errorfile(errorfile);       if(target)    {    if(!file_stat(target))    {