/[ascend]/trunk/tcltk/generic/interface/Driver.c
ViewVC logotype

Diff of /trunk/tcltk/generic/interface/Driver.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 588 by johnpye, Thu May 11 02:06:46 2006 UTC revision 589 by johnpye, Thu May 11 03:10:43 2006 UTC
# Line 525  static void printenv(){ Line 525  static void printenv(){
525      <utilities/config.h>. The following comments assume that you      <utilities/config.h>. The following comments assume that you
526      use the usual names for each of these:      use the usual names for each of these:
527    
528      ASCENDDIST defaults to @ASC_DATADIR@ (also in config.h)      ASCENDDIST defaults to $PROGDIR/@ASC_DATADIR_REL_BIN@ (also in config.h)
529      ASCENDTK defaults to $ASCENDDIST/@ASC_TK_SUBDIR_NAME@ (latter is from config.h)      ASCENDTK defaults to $ASCENDDIST/@ASC_TK_SUBDIR_NAME@ (latter is from config.h)
530      ASCENDBITMAPS defaults $ASCENDTK/bitmaps      ASCENDBITMAPS defaults $ASCENDTK/bitmaps
531      ASCENDLIBRARY defaults to $ASCENDDIST/models      ASCENDLIBRARY defaults to $ASCENDDIST/models
# Line 539  static int AscCheckEnvironVars(Tcl_Inter Line 539  static int AscCheckEnvironVars(Tcl_Inter
539      struct FilePath *fp, *fp1, *distfp, *tkfp, *bitmapsfp, *libraryfp;      struct FilePath *fp, *fp1, *distfp, *tkfp, *bitmapsfp, *libraryfp;
540      char envcmd[MAX_ENV_VAR_LENGTH];      char envcmd[MAX_ENV_VAR_LENGTH];
541      char s1[PATH_MAX];      char s1[PATH_MAX];
542        int err;
543    
544      Tcl_DString buffer;      Tcl_DString buffer;
545    
546      Tcl_DStringInit(&buffer);      Tcl_DStringInit(&buffer);
547    
548      /*      /* import these into the environment */
549      Asc_ImportPathList(ASC_ENV_DIST);      err = env_import(ASC_ENV_DIST,getenv,PUTENV);
550      Asc_ImportPathList(ASC_ENV_TK);      if(err)CONSOLE_DEBUG("No %s var imported, error %d",ASC_ENV_DIST,err);
551      Asc_ImportPathList(ASC_ENV_BITMAPS);      env_import(ASC_ENV_TK,getenv,PUTENV);
552      Asc_ImportPathList(ASC_ENV_LIBRARY);      env_import(ASC_ENV_BITMAPS,getenv,PUTENV);
553      */      env_import(ASC_ENV_LIBRARY,getenv,PUTENV);
554    
555      CONSOLE_DEBUG("IMPORTING VARS");      CONSOLE_DEBUG("IMPORTING VARS");
556    
# Line 574  static int AscCheckEnvironVars(Tcl_Inter Line 575  static int AscCheckEnvironVars(Tcl_Inter
575          CONSOLE_DEBUG("PROGNAME = %s",s1);          CONSOLE_DEBUG("PROGNAME = %s",s1);
576    
577          // get the directory name from the exe path          // get the directory name from the exe path
         CONSOLE_DEBUG("Calculating dir...");  
578          fp1 = ospath_getdir(fp);          fp1 = ospath_getdir(fp);
         CONSOLE_DEBUG("Done calculating dir...");  
579          ospath_free(fp);          ospath_free(fp);
580    
581          ospath_strcpy(fp1,s1,PATH_MAX);          ospath_strcpy(fp1,s1,PATH_MAX);
582          CONSOLE_DEBUG("DIR = %s",s1);          CONSOLE_DEBUG("DIR = %s",s1);
583    
584          // append the contents of ASC_DISTDIR to this path          // append the contents of ASC_DISTDIR_REL_BIN to this path
585          fp = ospath_new_noclean(ASC_DISTDIR);          fp = ospath_new_noclean(ASC_DISTDIR_REL_BIN);
586          distfp = ospath_concat(fp1,fp);          distfp = ospath_concat(fp1,fp);
587          ospath_cleanup(distfp);          ospath_cleanup(distfp);
588    
# Line 606  static int AscCheckEnvironVars(Tcl_Inter Line 605  static int AscCheckEnvironVars(Tcl_Inter
605      }      }
606    
607      if(tkdir == NULL){      if(tkdir == NULL){
608          CONSOLE_DEBUG("NO " ASC_ENV_TK " VAR DEFINED");          CONSOLE_DEBUG("USING DEFAULT %s = %s",ASC_ENV_TK,ASC_ENV_TK_DEFAULT);
   
609          guessedtk=1;          guessedtk=1;
610          /* Create a path $ASCENDDIST/tcltk */          tkfp = ospath_new_expand_env(ASC_ENV_TK_DEFAULT, &GETENV);
         strcpy(envcmd,"$ASCENDDIST/");  
         strcat(envcmd,ASC_TK_SUBDIR_NAME);  
         CONSOLE_DEBUG("TK RAW = %s",envcmd);  
         tkfp = ospath_new_expand_env(envcmd, &GETENV);  
611          tkdir = ospath_str(tkfp);          tkdir = ospath_str(tkfp);
612    
613          ospath_strcpy(tkfp,envcmd,MAX_ENV_VAR_LENGTH);          ospath_strcpy(tkfp,envcmd,MAX_ENV_VAR_LENGTH);
614          CONSOLE_DEBUG("TK = %s",envcmd);          CONSOLE_DEBUG("TK = %s",envcmd);
615    
616          OSPATH_PUTENV(ASC_ENV_TK,tkfp);          OSPATH_PUTENV(ASC_ENV_TK,tkfp);
617        }else{
618            tkfp = ospath_new_expand_env(tkdir, &GETENV);
619            tkdir = ospath_str(tkfp);
620            OSPATH_PUTENV(ASC_ENV_TK,tkfp);
621      }      }
622    
623      if(bitmapsdir == NULL){      if(bitmapsdir == NULL){
624          CONSOLE_DEBUG("NO  " ASC_ENV_BITMAPS " VAR DEFINED");          CONSOLE_DEBUG("NO " ASC_ENV_BITMAPS " VAR DEFINED");
625          /* Create a path $ASCENDTK/bitmaps */          /* Create a path $ASCENDTK/bitmaps */
626          bitmapsfp = ospath_new_expand_env("$ASCENDTK/bitmaps", &GETENV);          bitmapsfp = ospath_new_expand_env("$ASCENDTK/bitmaps", &GETENV);
627          OSPATH_PUTENV(ASC_ENV_BITMAPS,bitmapsfp);          OSPATH_PUTENV(ASC_ENV_BITMAPS,bitmapsfp);
# Line 637  static int AscCheckEnvironVars(Tcl_Inter Line 635  static int AscCheckEnvironVars(Tcl_Inter
635          @TODO Also, what about ASCEND_DEFAULTLIBRARY ?          @TODO Also, what about ASCEND_DEFAULTLIBRARY ?
636      */      */
637      if(librarydir == NULL){      if(librarydir == NULL){
638          CONSOLE_DEBUG("NO  " ASC_ENV_LIBRARY " VAR DEFINED");          CONSOLE_DEBUG("NO " ASC_ENV_LIBRARY " VAR DEFINED");
639          libraryfp = ospath_new_expand_env("$ASCENDDIST/models", &GETENV);          libraryfp = ospath_new_expand_env("$ASCENDDIST/models", &GETENV);
640          ospath_free(fp);          CONSOLE_DEBUG("CREATED LIBRARY VAL");
641          OSPATH_PUTENV(ASC_ENV_LIBRARY,libraryfp);          OSPATH_PUTENV(ASC_ENV_LIBRARY,libraryfp);
642          librarydir = ospath_str(libraryfp);          librarydir = ospath_str(libraryfp);
643      }      }

Legend:
Removed from v.588  
changed lines
  Added in v.589

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22