pike.git / lib / modules / Process.pmod

version» Context lines:

pike.git/lib/modules/Process.pmod:431:   }      protected array(string) runpike;      //! Spawn a new pike process similar to the current.   //!   //! @param argv   //! Arguments for the new process.   //!   //! @param options - //! Process creation options. See @[Process.Process] for details. + //! Process creation options. See @[Process.Process] for details. May also + //! specify "add_predefines", "add_program_path", or "add_include_path" in + //! order to include these components in command path (module path is + //! included by default.)   //!   //! @seealso   //! @[Process.Process]   Process spawn_pike(array(string) argv, void|mapping(string:mixed) options)   {    if (!runpike) {    array(string) res = ({    master()->_pike_file_name,    });    if (master()->_master_file_name)    res+=({"-m"+master()->_master_file_name});    foreach (master()->pike_module_path;;string path)    res+=({"-M"+path});    -  // FIXME: Defines? pike_program_path? +  if(options && options->add_predefines) +  { +  foreach (master()->predefines; string key; string value) +  res+=({"-D" + key + "=" + value}); +  } +  if(options && options->add_program_path) +  { +  foreach (master()->pike_program_path;; string value) +  res+=({"-P" + value}); +  } +  if(options && options->add_include_path) +  { +  foreach (master()->pike_include_path;; string value) +  res+=({"-I" + value}); +  }       if (sizeof(res) && !has_value(res[0],"/")   #ifdef __NT__    && !has_value(res[0], "\\")   #endif /* __NT__ */    )    res[0] = locate_binary(getenv("PATH")/   #if defined(__NT__) || defined(__amigaos__)    ";"   #else