Author: vlad
Date: 2005-05-25 23:15:59 -0400 (Wed, 25 May 2005)
New Revision: 45028

Modified:
   trunk/tao/rules.mk
   trunk/tao/src/Tao.GlPostProcess/GlPostProcess.cs
   trunk/tao/src/Tao.OpenGl/Makefile
Log:
tao: more strongname fixes; build should work both STRONG=1 and without on 
windows and mono

Modified: trunk/tao/rules.mk
===================================================================
--- trunk/tao/rules.mk  2005-05-26 02:24:40 UTC (rev 45027)
+++ trunk/tao/rules.mk  2005-05-26 03:15:59 UTC (rev 45028)
@@ -73,9 +73,17 @@
 
 else
 
-# Postprocess
+# Postprocess; note that the initially-compiled library must have the same
+# name as the resulting library -- ilasm doesn't change the .assembly name
+# embedded in the assembly.
+ifneq (,$(STRONG))
+ STRONGFLAG = /key:$(LIBRARY).snk
+else
+ STRONGFLAG =
+endif
+
 $(LIBRARY_DEST)/$(LIBRARY).dll: $(LIBRARY)-pre.dll.pp.il
-       $(ILASM) /dll $< /out:$@
+       $(ILASM) $(STRONGFLAG) /dll $< /out:$@
 
 $(LIBRARY)-pre.dll.pp.il: $(PROGRAM_DEST)/Tao.PostProcess.exe 
$(LIBRARY)-pre.dll.il
        $(RUN_EXE) $(PROGRAM_DEST)/Tao.PostProcess.exe $(LIBRARY)-pre.dll.il 
$(LIBRARY)-pre.dll.pp.il /R /Y

Modified: trunk/tao/src/Tao.GlPostProcess/GlPostProcess.cs
===================================================================
--- trunk/tao/src/Tao.GlPostProcess/GlPostProcess.cs    2005-05-26 02:24:40 UTC 
(rev 45027)
+++ trunk/tao/src/Tao.GlPostProcess/GlPostProcess.cs    2005-05-26 03:15:59 UTC 
(rev 45028)
@@ -11,6 +11,7 @@
 
 
 using System;
+using System.IO;
 using System.Collections;
 using System.Reflection;
 using System.Reflection.Emit;
@@ -40,19 +41,22 @@
                /// <param name="args"></param>
                public static void Main(string [] args) 
                {
-                       if (args.Length < 3 || args.Length > 4) 
+                       if (args.Length < 4 || args.Length > 5) 
                        {
-                               Console.WriteLine ("Usage: GlPostProcess.exe 
in.dll out.dll Tao.OpenGl.Gl [Tao.OpenGl.ContextGl]");
+                               Console.WriteLine ("Usage: GlPostProcess.exe 
in.dll out.dll Tao.OpenGl.snk Tao.OpenGl.Gl [Tao.OpenGl.ContextGl]");
                                return;
                        }
 
                        string inName = args[0];
                        string outName = args[1];
-                       string typeName = args[2];
+                       string typeName = args[3];
+                       string snkFile = null;
+                       if (args[2] != "")
+                               snkFile = args[2];
                        string instanceTypeName = null;
 
-                       if (args.Length == 4)
-                               instanceTypeName = args[3];
+                       if (args.Length == 5)
+                               instanceTypeName = args[4];
 
                        string outDir = 
System.IO.Path.GetDirectoryName(outName);
                        string outDll = System.IO.Path.GetFileName(outName);
@@ -71,6 +75,9 @@
 
                        AssemblyName outAsName = new AssemblyName();
                        outAsName.Name = outNameBase;
+                       if (snkFile != null)
+                               outAsName.KeyPair = new 
StrongNameKeyPair(File.Open(snkFile, FileMode.Open, FileAccess.Read));
+
                        // create a dynamic assembly
                        AssemblyBuilder abuilder = 
AppDomain.CurrentDomain.DefineDynamicAssembly
                                (outAsName, AssemblyBuilderAccess.Save, outDir 
!= null && outDir.Length > 0 ? outDir : null,

Modified: trunk/tao/src/Tao.OpenGl/Makefile
===================================================================
--- trunk/tao/src/Tao.OpenGl/Makefile   2005-05-26 02:24:40 UTC (rev 45027)
+++ trunk/tao/src/Tao.OpenGl/Makefile   2005-05-26 03:15:59 UTC (rev 45028)
@@ -23,8 +23,14 @@
 
 gl_build: $(LIBRARY_DEST)/Tao.OpenGl.dll
 
+ifneq (,$(STRONG))
+ SNKFILE = $(LIBRARY).snk
+else
+ SNKFILE=
+endif
+
 $(LIBRARY_DEST)/Tao.OpenGl.dll: Tao.OpenGl-pre.dll
-       $(RUN_EXE) $(PROGRAM_DEST)/Tao.GlPostProcess.exe $< $@ Tao.OpenGl.Gl 
Tao.OpenGl.ContextGl
+       $(RUN_EXE) $(PROGRAM_DEST)/Tao.GlPostProcess.exe $< $@ "$(SNKFILE)" 
Tao.OpenGl.Gl Tao.OpenGl.ContextGl
 
 Tao.OpenGl-pre.dll: $(SRCS)
        $(CSC) /target:library $(CSFLAGS) /out:$@ $^ /lib:$(LIBRARY_DEST) 
$(REFFLAGS)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to