smalltalk.rc
changeset 677 222fd88429a3
parent 672 43a67655f4f2
child 678 728aff120ee7
equal deleted inserted replaced
676:98a21f90890a 677:222fd88429a3
    95 "/ notice, that shell variable names are NOT expanded again in STX_SYSTEMPATH
    95 "/ notice, that shell variable names are NOT expanded again in STX_SYSTEMPATH
    96 "/ Make certain that all relevant files are found along your path - you may see
    96 "/ Make certain that all relevant files are found along your path - you may see
    97 "/ funny viewStyles, colors and stupid strings if wrong.
    97 "/ funny viewStyles, colors and stupid strings if wrong.
    98 "/
    98 "/
    99 
    99 
   100 |path|
   100 |path pathOfSTXExecutable|
   101 
   101 
   102 'systemPath before: ' print.
   102 'systemPath before: ' print. Smalltalk systemPath printCR.
   103 Smalltalk systemPath printCR.
       
   104 
   103 
   105 (path := OperatingSystem getEnvironment:'STX_SYSTEMPATH') notNil ifTrue:[
   104 (path := OperatingSystem getEnvironment:'STX_SYSTEMPATH') notNil ifTrue:[
   106     Smalltalk systemPath:(path asCollectionOfSubstringsSeparatedBy:$:)
   105     Smalltalk systemPath:(path asCollectionOfSubstringsSeparatedBy:$:)
   107 ] ifFalse:[
   106 ] ifFalse:[
   108     "/ look for gnu-smalltalk class files along my PATH.
   107     "/ look for gnu-smalltalk class files along my PATH.
   111     (path := Smalltalk getSystemFileName:'initialize.st') notNil ifTrue:[
   110     (path := Smalltalk getSystemFileName:'initialize.st') notNil ifTrue:[
   112 	path := path asFilename directoryName.
   111 	path := path asFilename directoryName.
   113 	('smalltalk.rc [info]: found gnu-smalltalk sources in ' , path , '; removed from systemPath.') infoPrintCR.
   112 	('smalltalk.rc [info]: found gnu-smalltalk sources in ' , path , '; removed from systemPath.') infoPrintCR.
   114 	Smalltalk systemPath:(Smalltalk systemPath remove:path; yourself).
   113 	Smalltalk systemPath:(Smalltalk systemPath remove:path; yourself).
   115     ].
   114     ].
   116 ].
   115 
   117 
   116     pathOfSTXExecutable := OperatingSystem pathOfSTXExecutable asFilename directoryName.
   118 (Smalltalk systemPath includes:(OperatingSystem pathOfSTXExecutable asFilename directoryName)) ifFalse:[
   117     (Smalltalk systemPath includes:pathOfSTXExecutable) ifFalse:[
   119     Smalltalk systemPath addFirst:(OperatingSystem pathOfSTXExecutable asFilename directoryName).
   118 	Smalltalk systemPath addFirst:pathOfSTXExecutable.
   120 ].
   119     ].
   121 
   120 
   122 '../../../stx/libbasic' asFilename exists ifTrue:[
   121     "/ the current directory should always be first...
   123     (Smalltalk systemPath includes:'../../../stx' asFilename pathName) ifFalse:[
   122     (Smalltalk systemPath includes:'.') ifTrue:[
   124 	Smalltalk systemPath addFirst:'../../../stx' asFilename pathName.
   123 	Smalltalk systemPath remove:'.'.
   125     ]
   124     ].
   126 ].
   125     (Smalltalk systemPath includes:'.' asFilename pathName) ifTrue:[
   127 
   126 	Smalltalk systemPath remove:'.' asFilename pathName.
   128 "/ the current directory should always be first...
   127     ].
   129 (Smalltalk systemPath includes:'.') ifTrue:[
   128     Smalltalk systemPath addFirst:'.' asFilename pathName.
   130     Smalltalk systemPath remove:'.'.
   129 ].
   131 ].
       
   132 (Smalltalk systemPath includes:'.' asFilename pathName) ifTrue:[
       
   133     Smalltalk systemPath remove:'.' asFilename pathName.
       
   134 ].
       
   135 Smalltalk systemPath addFirst:'.' asFilename pathName.
       
   136 
   130 
   137 (path := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[
   131 (path := OperatingSystem getEnvironment:'STX_PACKAGEPATH') notNil ifTrue:[
   138     Smalltalk packagePath:(path asCollectionOfSubstringsSeparatedBy:$:).
   132     Smalltalk packagePath:(path asCollectionOfSubstringsSeparatedBy:$:).
   139     'smalltalk.rc [info]: setting packagePath from STX_PACKAGEPATH' printCR.
   133     'smalltalk.rc [info]: setting packagePath from STX_PACKAGEPATH' printCR.
   140 ] ifFalse:[
   134 ] ifFalse:[
   141     "/
   135     "/
   142     "/ if running in the development environment,
   136     "/ if running in the development environment,
   143     "/ only use the local packages.
   137     "/ only use the local packages.
   144     "/
   138     "/
   145     '../../../stx/projects/smalltalk' asFilename exists ifTrue:[
   139     '../../../stx/projects/smalltalk' asFilename exists ifTrue:[
   146 	Smalltalk packagePath removeAll; add:'../../..'.
   140 	Smalltalk packagePath removeAll; add:'../../..' asFilename pathName.
   147 	'smalltalk.rc [info]: setting packagePath for local operation' printCR.
   141 	'smalltalk.rc [info]: setting packagePath for local operation' printCR.
   148     ].
   142     ].
   149 
   143 
   150     "/
   144     "/
   151     "/ any additional local packages ?.
   145     "/ any additional local packages ?.
   152     "/
   146     "/
   153     'packages' asFilename exists ifTrue:[
   147     'packages' asFilename exists ifTrue:[
   154 	 Smalltalk packagePath addFirst:'./packages'.
   148 	(Smalltalk packagePath includes:'packages' asFilename pathName) ifFalse:[
   155 	 "/ 'additional local packages' printCR.
   149 	    Smalltalk packagePath addFirst:'packages' asFilename pathName.
   156     ].
   150 	].
   157     "/ 'packagePath: ' print. Smalltalk packagePath printCR.
   151     ].
   158 ].
   152 ].
   159 
   153 
   160 'systemPath: ' errorPrint. Smalltalk systemPath errorPrintCR.
   154 'systemPath: ' errorPrint. Smalltalk systemPath errorPrintCR.
   161 'packagePath: ' errorPrint. Smalltalk packagePath errorPrintCR.
   155 'packagePath: ' errorPrint. Smalltalk packagePath errorPrintCR.
   162 
   156