pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.168 2001/08/31 07:18:19 hubbe Exp $ +  * $Id: master.pike.in,v 1.169 2001/09/02 01:36:13 marcus Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      // Some configurable parameters useful for debugging      #pike __REAL_VERSION__   #define PIKE_AUTORELOAD
pike.git/lib/master.pike.in:26:   #define OUT_OF_DATE_WARNING 1   #endif /* OUT_OF_DATE_WARNING */   constant out_of_date_warning = OUT_OF_DATE_WARNING;      //! @decl constant out_of_date_warning = int(0..1)      #ifndef PIKE_WARNINGS   #define PIKE_WARNINGS 0   #endif /* PIKE_WARNINGS */    + #undef PIKE_MODULE_RELOC +    /*    * Functions begin here.    */      #ifdef PIKE_FAKEROOT   object o;   string fakeroot(string s)   {    string tmp1=combine_path_with_cwd(s);   #ifdef PIKE_FAKEROOT_OMIT    foreach(PIKE_FAKEROOT_OMIT/":", string x)    if(glob(x,tmp1))    return s;   #endif    return PIKE_FAKEROOT+tmp1;   }   #else   #define fakeroot(X) X   #endif    -  + #ifdef PIKE_MODULE_RELOC + string relocate_module(string s) + { +  if(s[..1]=="/$" && (s+"/")[..20] == "/${PIKE_MODULE_PATH}/") { +  string tmp = s[21..]; +  foreach(pike_module_path, string path) { +  string s2 = fakeroot(sizeof(tmp)? combine_path(path, tmp) : path); +  if(master_file_stat(s2)) +  return s2; +  } +  } +  return fakeroot(s); + }    -  + string unrelocate_module(string s) + { +  if(s[..1]=="/$" && (s+"/")[..20] == "/${PIKE_MODULE_PATH}/") +  return s; +  +  foreach(pike_module_path, string path) +  if(s == path) +  return "/${PIKE_MODULE_PATH}"; +  else { +  string s2 = combine_path(path, ""); +  if(s[..sizeof(s2)-1] == s2) +  return "/${PIKE_MODULE_PATH}/"+s[sizeof(s2)..]; +  } +  return s; + } + #ifdef fakeroot + #undef fakeroot + #endif + #define fakeroot relocate_module + #endif +  +    //! @appears is_absolute_path   //! Check if a path @[p] is fully qualified (ie not relative).   //!   //! @returns   //! Returns 1 if the path is absolute, 0 otherwise.   int is_absolute_path(string p)   {   #ifdef __NT__    p=replace(p,"\\","/");    if(sscanf(p,"%[a-zA-Z]:%*c",string s)==2 && sizeof(s)==1)
pike.git/lib/master.pike.in:385:    // (compile() disables threads).    mixed err = catch {    key=compilation_mutex->lock(2);    };    if (err) {    werror(sprintf("low_findprog: Caught spurious error:\n"    "%s\n", describe_backtrace(err)));    }   #endif    + #ifdef PIKE_MODULE_RELOC +  fname = unrelocate_module(fname); + #endif +    #ifdef PIKE_AUTORELOAD    if(!autoreload_on || load_time[fname]>=time())   #endif    {    if(!zero_type (ret=programs[fname])) return ret;    }      #ifdef __NT__    // Ugly kluge to work better with cygwin32    if(getenv("OSTYPE")=="cygwin32")
pike.git/lib/master.pike.in:1676:      mixed get_inhibit_compile_errors()   {    return inhibit_compile_errors;   }   #endif /* constant(thread_local) */      static private function(string:string) _trim_file_name_cb=0;   string trim_file_name(string s)   { + #ifdef PIKE_MODULE_RELOC +  s = relocate_module(s); + #endif    if(getenv("LONG_PIKE_ERRORS")) return s;    if(getenv("SHORT_PIKE_ERRORS")) return BASENAME(s);       if (_trim_file_name_cb) return _trim_file_name_cb(s);       /* getcwd() can fail, but since this is called from handle_error(),    * we don't want to fail, so we don't care about that.    */    catch {    string cwd=getcwd();