pike.git / NT / tools / rntecl

version» Context lines:

pike.git/NT/tools/rntecl:1:   #!/usr/local/bin/pike   // -*- Pike -*-    - // $Id: rntecl,v 1.6 2000/08/17 20:17:53 grubba Exp $ + // $Id: rntecl,v 1.7 2000/08/20 12:37:56 grubba Exp $      // RNTECL, a front-end to Intel ECL with options similar to GCC   // Written by Fredrik Hubinette & Henrik Grubbström.      inherit "lib.pike";      // Verbose is default for now, this can be turned off one this   // frontend has been refined to where it does not require more   // debugging.   
pike.git/NT/tools/rntecl:68:    int debug,optimize,share;    string output, wantfile;       mixed *opts=Getopt.find_all_options(argv, aggregate(    ({"oper_pre",Getopt.NO_ARG, ({"-E"}) }),    ({"oper_asm",Getopt.NO_ARG, ({"-S"}) }),    ({"oper_comp",Getopt.NO_ARG, ({"-c"}) }),    ({"verbose",Getopt.NO_ARG, ({"-v"}) }),    ({"debug",Getopt.MAY_HAVE_ARG, ({"-g"}) }),    ({"optimize",Getopt.MAY_HAVE_ARG, ({"-O"}) }), +  ({"inline", Getopt.MAY_HAVE_ARG, ({"-Q"}) }),    ({"include",Getopt.HAS_ARG, ({"-I"}) }),    ({"link",Getopt.HAS_ARG, ({"-l"}) }),    ({"share",Getopt.MAY_HAVE_ARG, ({"-s"}) }),    ({"ignore",Getopt.MAY_HAVE_ARG, ({"-t"}) }),    ({"ignore",Getopt.HAS_ARG, ({"-R","-L","-r"}) }),    ({"warn",Getopt.MAY_HAVE_ARG, ({"-W"}) }),    ({"define",Getopt.HAS_ARG, ({"-D"}) }),    ({"undefine",Getopt.HAS_ARG, ({"-U"})}),    ({"output",Getopt.HAS_ARG, ({"-o"}) }),    ({"export",Getopt.HAS_ARG, ({"--export"}) })
pike.git/NT/tools/rntecl:142:    switch(optimize=(int)option[1])    {    case 0: optimize=0; break;    case 1: cflags+=({"-O1"}); break;    case 2: cflags+=({"-O2"}); break;    case 3..:    break;    }    break;    +  case "inline": +  if (option[1] == "ip") { +  cflags+=({"-Qip"}); +  } +  break; +     case "include":    // Avoid searching 'local' include dirs.    // This is not a very pretty solution.    if(sscanf(option[1],"/usr/include/%*s") ||    sscanf(option[1],"/usr/local/%*s"))    break;       cflags+=({"-I"+fixpath(option[1])});    break;   
pike.git/NT/tools/rntecl:184:       cflags+=({tmp});    break;    }    }       // More options should be recognized, options which are not    // recognized should generate warning/error messages.    switch(option[1])    { -  case "all": cflags+=({"-W4"}); break; +  case "all": case "4": +  cflags+=({"-W4"}); break; +  // Not supported, but in the manual... +  // case "X": cflags+=({"-WX"}); break;    default: cflags+=({"-W3"}); break;    }    break;       case "define": cflags+=({"-D"+option[1]}); break;    case "undefine": cflags+=({"-U"+option[1]}); break;    case "output":    output=option[1];    break;    }
pike.git/NT/tools/rntecl:280:   // "-PDB:NONE",    "-DEBUGTYPE:BOTH",    "-DEBUG",    })    +ldopts;    }    }          int ret; -  if(verbose && target!="-") -  { -  ret=do_cmd(cmd); -  }else{ +     int first_line=1; -  +  int prototype_error=0; +  string trailer = "";    // ecl.exe echoes the file name of the file we are compiling -  // first, we need to get rid of that to make configure behave -  ret=silent_do_cmd(cmd, lambda(string line) +  // first, we need to get rid of that to make configure behave. +  // We also convert warning 147 into an error. +  ret = silent_do_cmd(cmd, +  lambda(string output)    { -  +  trailer += output; +  array(string) lines = trailer/"\n"; +  if (sizeof(lines) < 2) return;    if(first_line)    { -  array x=line/"\n"; -  if(sizeof(x)>1) -  { -  line=x[1..]*"\n"; -  first_line=0; -  }else{ -  return; +  if (verbose && (target != "-")) { +  write(lines[0]+"\n");    } -  +  lines = lines[1..]; +  first_line = 0;    } -  write(line); -  },1); +  trailer = lines[-1]; +  lines = lines[..sizeof(lines)-2]; +  for(int i; i < sizeof(lines); i++) { +  // Warning 147 is prototype mismatch. +  // for some reason this isn't an error. +  // We make it an error... +  if (search(lines[i], "warning #147:") != -1) { +  prototype_error = 1; +  lines[i] = replace(lines[i], +  "warning #147:", +  "error #147:");    } -  +  } +  write(lines*"\n" + "\n"); +  }, 1); +  if (sizeof(trailer)) { +  // Shouldn't happen, but... +  write(trailer); +  } +  ret = ret || prototype_error;       if(ret)    {    werror("ECL returned error code %d.\n",ret);    exit(ret);    }       if(wantfile)    {    if (target == "obj") {