pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   // -*- Pike -*-   //   // Master Control Program for Pike.   //   // This file is part of Pike. For copyright information see COPYRIGHT.   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information.   // - // $Id: master.pike.in,v 1.217 2002/09/05 15:26:15 marcus Exp $ + // $Id: master.pike.in,v 1.218 2002/09/05 15:42:19 marcus Exp $      #pike __REAL_VERSION__      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "¤/" != "\244/"   #error "master.pike.in is corrupted."   #endif      // --- Some configurable parameters
pike.git/lib/master.pike.in:1565:   #endif      //! This function is called when all the driver is done with all setup   //! of modules, efuns, tables etc. etc. and is ready to start executing   //! _real_ programs. It receives the arguments not meant for the driver   //! and an array containing the environment variables on the same form as   //! a C program receives them.   void _main(array(string) orig_argv, array(string) env)   {    array(string) argv=copy_value(orig_argv); -  int i,debug,trace; +  int i,debug,trace,run_tool;    object tmp;    string a,b;    array q; -  string postparseaction=0, run_tool=0; +  string postparseaction=0;    mixed v;       predefines = _static_modules.Builtin()->_take_over_initial_predefines();    _pike_file_name = orig_argv[0];   #if constant(thread_create)    _backend_thread = this_thread();   #endif       foreach(env,a)    {
pike.git/lib/master.pike.in:1654:    ({"autoreload",tmp->NO_ARG,({"--autoreload"})}),   #endif    ({"master",tmp->HAS_ARG,"-m"}),    ({"compiler_trace",tmp->NO_ARG,"--compiler-trace"}),    ({"assembler_debug",tmp->MAY_HAVE_ARG,"--assembler-debug"}),    ({"optimizer_debug",tmp->MAY_HAVE_ARG,"--optimizer-debug"}),    ({"debug",tmp->MAY_HAVE_ARG,"--debug",0,1}),    ({"trace",tmp->MAY_HAVE_ARG,"--trace",0,1}),    ({"ignore",tmp->MAY_HAVE_ARG,"-Dqdatplr",0,1}),    ({"ignore",tmp->HAS_ARG,"-s"}), -  ({"run_tool",tmp->HAS_ARG,"-x"}), +  ({"run_tool",tmp->NO_ARG,"-x"}),    }), 1);       /* Parse -M and -I backwards */    for(i=sizeof(q)-1;i>=0;i--)    {    switch(q[i][0])    {    case "compat_version":    sscanf(q[i][1],"%d.%d",compat_major,compat_minor);    break;
pike.git/lib/master.pike.in:1746:       case "no-warnings":    want_warnings--;    break;       case "master":    _master_file_name = q[i][1];    break;       case "run_tool": -  run_tool = q[i][1]; +  run_tool = 1;    break;    }    }       foreach(q, array opts)    {    switch(opts[0])    {    case "version":    werror(version() + " Copyright © 1994-2002 Linköping University\n"
pike.git/lib/master.pike.in:1845:    w( format_paths() + "\n");       w("Features......"+    main_resolv( "Tools.Install.features"/"." )()*"\n "+    "\n");    exit(0);    }       random_seed(time() ^ (getpid()<<8));    -  if(run_tool) -  ; -  else if(sizeof(argv)==1) +  if(sizeof(argv)==1)    { -  +  if(run_tool) +  _error( "Pike: -x specified without tool name.\n");    main_resolv( ({ "Tools", "Hilfe" }) )->StdinHilfe();    exit(0);    }    else    argv=argv[1..];       program prog;       if(run_tool) {    mixed err = catch { -  prog=main_resolv( ({ "Tools", "Standalone", run_tool }) ); +  prog=main_resolv( ({ "Tools", "Standalone", argv[0] }) );    };       if (err)    _error( "Pike: Failed to load tool %s:\n" -  "%s\n", run_tool, +  "%s\n", argv[0],    stringp(err[0])?err[0]:describe_backtrace(err) );    -  argv[0] = search(master()->programs, prog) || run_tool; +  argv[0] = search(master()->programs, prog) || argv[0];    } else {    argv[0]=combine_path_with_cwd(argv[0]);       mixed err = catch {    prog=(program)argv[0];    };       if (err)    _error( "Pike: Failed to compile script:\n"    "%s\n", stringp(err[0])?err[0]:describe_backtrace(err) );