vms changes
authorClaus Gittinger <cg@exept.de>
Tue, 16 Sep 1997 04:53:35 +0200
changeset 609 dfae7c6eea05
parent 608 faa97ce2db56
child 610 0aa21dd74161
vms changes
ObjFLoader.st
ObjectFileLoader.st
libInit.cc
vms.mak
--- a/ObjFLoader.st	Sun Sep 07 01:28:18 1997 +0200
+++ b/ObjFLoader.st	Tue Sep 16 04:53:35 1997 +0200
@@ -50,6 +50,11 @@
 # define HAS_DL
 #endif
 
+#ifdef __VMS__
+# undef __new
+# define VMS_DL
+#endif
+
 #ifdef DL1_6    /* dl1.6 COFF loader */
 # define HAS_DL
 #endif
@@ -448,6 +453,9 @@
 # if defined(WIN_DL)
     RETURN ( @symbol(dll));
 # endif
+# if defined(__VMS__)
+    RETURN ( @symbol(exe));
+# endif
 #endif
 
 %}.
@@ -494,6 +502,9 @@
         "/ includes all of win32s, win95, winNT & os/2
         ^ '.dll'
     ].
+    OperatingSystem isVMSlike ifTrue:[
+        ^ '.exe'
+    ].
 
     os := OperatingSystem getSystemType.
     (os = 'sys5_4') ifTrue:[^ '.so'].
@@ -526,6 +537,9 @@
         "/ includes all of win32s, win95, winNT & os/2
         ^ #('.dll')
     ].
+    OperatingSystem isVMSlike ifTrue:[
+	^ #('.exe')
+    ].
 
     os := OperatingSystem getSystemType.
     (os = 'sys5_4') ifTrue:[^ #('.so') ].
@@ -573,7 +587,7 @@
         ^ nil
     ].
 
-    list := self namesMatching:'__GLOBAL_$I*' segment:'[tT]' in:aFileName.
+    list := self namesMatching:'__GLOBAL_$I*' segment:'[tT?]' in:aFileName.
 list size == 1 ifTrue:[
 "/    (self isCPlusPlusObject:handle) ifTrue:[
         Verbose ifTrue:[
@@ -586,7 +600,7 @@
          we search (using nm) for all __GLOBAL_$I* syms, get their values
          and call them each
         "
-"/        list := self namesMatching:'__GLOBAL_$I*' segment:'[tT]' in:aFileName.
+"/        list := self namesMatching:'__GLOBAL_$I*' segment:'[tT?]' in:aFileName.
 
 "/        initAddr := self getFunction:'__CTOR_LIST__' from:handle.
 "/        Verbose ifTrue:[
@@ -1013,7 +1027,7 @@
             Verbose ifTrue:[
                 'no good init functions found; looking for candidates ...' infoPrintCR.
             ].
-            initNames := self namesMatching:'*_Init' segment:'[tT]' in:aFileName.
+            initNames := self namesMatching:'*_Init' segment:'[tT?]' in:aFileName.
             initNames notNil ifTrue:[
                 initNames do:[:aName |
                     initAddr := self getFunction:aName from:handle.
@@ -1057,7 +1071,7 @@
             status == #initFailed ifTrue:[
                 msg := 'LOADER: module not loaded (init function signalled failure).'
             ] ifFalse:[
-                (self namesMatching:'*__sepInitCode__*' segment:'[tT]' in:aFileName) notNil ifTrue:[
+                (self namesMatching:'*__sepInitCode__*' segment:'[tT?]' in:aFileName) notNil ifTrue:[
                     msg := 'LOADER: module not loaded (no _Init entry - looks like an incomplete sepInitCode object).'
                 ] ifFalse:[
                     msg := 'LOADER: module not loaded (no _Init entry in object file ?).'
@@ -1131,15 +1145,18 @@
 findFunction:functionName suffix:suffix in:handle
     "look for the init function and returns its address"
 
-    |initAddr className|
+    |initAddr className nm|
+
+    "/ care for colons, as found in nameSpace classes ...
+    nm := functionName asString copy replaceAll:$: with:$_.
 
     "
      look for explicit init function
     "
-    initAddr := self getFunction:(functionName , suffix) from:handle.
+    initAddr := self getFunction:(nm , suffix) from:handle.
     initAddr notNil ifTrue:[^ initAddr].
 
-    initAddr := self getFunction:('_' , functionName , suffix) from:handle.    
+    initAddr := self getFunction:('_' , nm , suffix) from:handle.    
     initAddr notNil ifTrue:[^ initAddr].
 
     "/
@@ -1147,7 +1164,7 @@
     "/ (will not find symbol with single underscore)
     "/ workaround: add another underscore and retry
     "/
-    initAddr := self getFunction:('__' , functionName , suffix) from:handle.
+    initAddr := self getFunction:('__' , nm , suffix) from:handle.
     initAddr notNil ifTrue:[^ initAddr].
 
     "
@@ -1607,7 +1624,7 @@
     "
      first, expect the classes-name to be the fileName-base
     "
-    name := OperatingSystem baseNameOf:aFileName.
+    name := aFileName asFilename baseName.
     suffixLen := 0.
     self validBinaryExtensions do:[:suffix |
         suffixLen == 0 ifTrue:[
@@ -1689,6 +1706,10 @@
 
     |p l s addr segment name entry|
 
+    OperatingSystem platformName = 'vms' ifTrue:[
+	"/ no nm command
+        ^ nil
+    ].
     OperatingSystem getOSType = 'aix' ifTrue:[
         ^ nil
     ].
@@ -3249,6 +3270,6 @@
 !ObjectFileLoader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Attic/ObjFLoader.st,v 1.147 1997-07-28 10:32:34 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Attic/ObjFLoader.st,v 1.148 1997-09-16 02:53:35 cg Exp $'
 ! !
 ObjectFileLoader initialize!
--- a/ObjectFileLoader.st	Sun Sep 07 01:28:18 1997 +0200
+++ b/ObjectFileLoader.st	Tue Sep 16 04:53:35 1997 +0200
@@ -50,6 +50,11 @@
 # define HAS_DL
 #endif
 
+#ifdef __VMS__
+# undef __new
+# define VMS_DL
+#endif
+
 #ifdef DL1_6    /* dl1.6 COFF loader */
 # define HAS_DL
 #endif
@@ -448,6 +453,9 @@
 # if defined(WIN_DL)
     RETURN ( @symbol(dll));
 # endif
+# if defined(__VMS__)
+    RETURN ( @symbol(exe));
+# endif
 #endif
 
 %}.
@@ -494,6 +502,9 @@
         "/ includes all of win32s, win95, winNT & os/2
         ^ '.dll'
     ].
+    OperatingSystem isVMSlike ifTrue:[
+        ^ '.exe'
+    ].
 
     os := OperatingSystem getSystemType.
     (os = 'sys5_4') ifTrue:[^ '.so'].
@@ -526,6 +537,9 @@
         "/ includes all of win32s, win95, winNT & os/2
         ^ #('.dll')
     ].
+    OperatingSystem isVMSlike ifTrue:[
+	^ #('.exe')
+    ].
 
     os := OperatingSystem getSystemType.
     (os = 'sys5_4') ifTrue:[^ #('.so') ].
@@ -573,7 +587,7 @@
         ^ nil
     ].
 
-    list := self namesMatching:'__GLOBAL_$I*' segment:'[tT]' in:aFileName.
+    list := self namesMatching:'__GLOBAL_$I*' segment:'[tT?]' in:aFileName.
 list size == 1 ifTrue:[
 "/    (self isCPlusPlusObject:handle) ifTrue:[
         Verbose ifTrue:[
@@ -586,7 +600,7 @@
          we search (using nm) for all __GLOBAL_$I* syms, get their values
          and call them each
         "
-"/        list := self namesMatching:'__GLOBAL_$I*' segment:'[tT]' in:aFileName.
+"/        list := self namesMatching:'__GLOBAL_$I*' segment:'[tT?]' in:aFileName.
 
 "/        initAddr := self getFunction:'__CTOR_LIST__' from:handle.
 "/        Verbose ifTrue:[
@@ -1013,7 +1027,7 @@
             Verbose ifTrue:[
                 'no good init functions found; looking for candidates ...' infoPrintCR.
             ].
-            initNames := self namesMatching:'*_Init' segment:'[tT]' in:aFileName.
+            initNames := self namesMatching:'*_Init' segment:'[tT?]' in:aFileName.
             initNames notNil ifTrue:[
                 initNames do:[:aName |
                     initAddr := self getFunction:aName from:handle.
@@ -1057,7 +1071,7 @@
             status == #initFailed ifTrue:[
                 msg := 'LOADER: module not loaded (init function signalled failure).'
             ] ifFalse:[
-                (self namesMatching:'*__sepInitCode__*' segment:'[tT]' in:aFileName) notNil ifTrue:[
+                (self namesMatching:'*__sepInitCode__*' segment:'[tT?]' in:aFileName) notNil ifTrue:[
                     msg := 'LOADER: module not loaded (no _Init entry - looks like an incomplete sepInitCode object).'
                 ] ifFalse:[
                     msg := 'LOADER: module not loaded (no _Init entry in object file ?).'
@@ -1131,15 +1145,18 @@
 findFunction:functionName suffix:suffix in:handle
     "look for the init function and returns its address"
 
-    |initAddr className|
+    |initAddr className nm|
+
+    "/ care for colons, as found in nameSpace classes ...
+    nm := functionName asString copy replaceAll:$: with:$_.
 
     "
      look for explicit init function
     "
-    initAddr := self getFunction:(functionName , suffix) from:handle.
+    initAddr := self getFunction:(nm , suffix) from:handle.
     initAddr notNil ifTrue:[^ initAddr].
 
-    initAddr := self getFunction:('_' , functionName , suffix) from:handle.    
+    initAddr := self getFunction:('_' , nm , suffix) from:handle.    
     initAddr notNil ifTrue:[^ initAddr].
 
     "/
@@ -1147,7 +1164,7 @@
     "/ (will not find symbol with single underscore)
     "/ workaround: add another underscore and retry
     "/
-    initAddr := self getFunction:('__' , functionName , suffix) from:handle.
+    initAddr := self getFunction:('__' , nm , suffix) from:handle.
     initAddr notNil ifTrue:[^ initAddr].
 
     "
@@ -1607,7 +1624,7 @@
     "
      first, expect the classes-name to be the fileName-base
     "
-    name := OperatingSystem baseNameOf:aFileName.
+    name := aFileName asFilename baseName.
     suffixLen := 0.
     self validBinaryExtensions do:[:suffix |
         suffixLen == 0 ifTrue:[
@@ -1689,6 +1706,10 @@
 
     |p l s addr segment name entry|
 
+    OperatingSystem platformName = 'vms' ifTrue:[
+	"/ no nm command
+        ^ nil
+    ].
     OperatingSystem getOSType = 'aix' ifTrue:[
         ^ nil
     ].
@@ -3249,6 +3270,6 @@
 !ObjectFileLoader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.147 1997-07-28 10:32:34 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/ObjectFileLoader.st,v 1.148 1997-09-16 02:53:35 cg Exp $'
 ! !
 ObjectFileLoader initialize!
--- a/libInit.cc	Sun Sep 07 01:28:18 1997 +0200
+++ b/libInit.cc	Tue Sep 16 04:53:35 1997 +0200
@@ -36,5 +36,6 @@
 _UndefinedVariable_Init(pass,__pRT__,snd);
 _VariableNode_Init(pass,__pRT__,snd);
 _Variable_Init(pass,__pRT__,snd);
+_ObjectFileLoader_Init(pass,__pRT__,snd);
  __END_PACKAGE__();
 }
--- a/vms.mak	Sun Sep 07 01:28:18 1997 +0200
+++ b/vms.mak	Tue Sep 16 04:53:35 1997 +0200
@@ -1,5 +1,5 @@
 #
-# $Header: /cvs/stx/stx/libcomp/vms.mak,v 1.1 1997-09-04 21:18:05 cg Exp $
+# $Header: /cvs/stx/stx/libcomp/vms.mak,v 1.2 1997-09-16 02:53:32 cg Exp $
 #
 
 LIBNAME=libcomp
@@ -34,11 +34,12 @@
 	      LazyMethod.$(O)                          \
 	      SrcFLoader.$(O)                          \
 	      ImmArray.$(O)                            \
+	      ObjFLoader.$(O)                          \
 	      ObjFHandle.$(O)                          
 
 theLib:   $(LIBNAME).olb
 	  $(MAKE) objs
-	  $(MAKE) vmsLibInit
+	  $(MAKE) libinit
 	  write sys$output "classlibrary $(LIBNAME).olb made."
 
 $(LIBNAME).olb: