Skip to content

Commit

Permalink
Update to support the compiler buidl
Browse files Browse the repository at this point in the history
svn path=/trunk/mono/; revision=133436
  • Loading branch information
migueldeicaza committed May 3, 2009
1 parent 7ed2e32 commit 0dbf004
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 22 deletions.
2 changes: 1 addition & 1 deletion msvc/scripts/System.Xml.pre
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(ProjectDir)\..\..\..\mono\msvc\scripts\prepare.exe $(ProjectDir)..\..
$(ProjectDir)\..\..\..\mono\msvc\scripts\prepare.exe $(ProjectDir)..\.. xml
$(ProjectDir)\..\..\jay\jay.exe -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\System.Xml.XPath\Parser.jay > $(ProjectDir)\System.Xml.XPath\Parser.cs
echo #define XSLT_PATTERN > $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs
$(ProjectDir)\..\..\jay\jay.exe -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Mono.Xml.Xsl\PatternParser.jay >> $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs
Expand Down
25 changes: 19 additions & 6 deletions msvc/scripts/genproj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,20 @@ public void Generate (XElement xproject)
}

var refs = new StringBuilder ();
//
// mcs is different that csc in this regard, somehow with -noconfig we still import System and System.XML
//
if (dir == "mcs" && !load_default_config){
references.Add ("System.dll");
references.Add ("System.Xml.dll");
}

if (references.Count > 0 || reference_aliases.Count > 0){
refs.Append ("<ItemGroup>\n");
string last = mono_paths [0].Substring (mono_paths [0].LastIndexOf ('/') + 1);

string hint_path = class_dir + "\\lib\\" + last;

foreach (string r in references){
refs.Append (" <Reference Include=\"" + r + "\">\n");
refs.Append (" <SpecificVersion>False</SpecificVersion>\n");
Expand All @@ -601,9 +608,15 @@ public void Generate (XElement xproject)
refs.Append (" <Aliases>" + alias + "</Aliases>\n");
refs.Append (" </Reference>\n");
}

refs.Append (" </ItemGroup>\n");
}

try {
Path.GetDirectoryName (library_output);
} catch {
Console.WriteLine ("Error in path: {0} while processing {1}", library_output, library);
}

//
// Replace the template values
Expand Down Expand Up @@ -652,11 +665,11 @@ static void Main (string [] args)
if (!(dir.StartsWith ("class") || dir.StartsWith ("mcs")))
continue;

Console.WriteLine ("dir={0} lib={1}", dir, library);
//
// Do not do 2.1 for now, it is not working yet
// Do not do 2.1, it is not working yet
// Do not do basic, as there is no point (requires a system mcs to be installed).
//
if (library.Contains ("net_2_1"))
if (library.Contains ("net_2_1") || library.Contains ("-basic"))
continue;

var gen = new MsbuildGenerator (dir);
Expand All @@ -668,4 +681,4 @@ static void Main (string [] args)
}
}

}
}
1 change: 1 addition & 0 deletions msvc/scripts/mcs.pre
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(ProjectDir)\..\jay\jay.exe -ct &lt; $(ProjectDir)\..\jay\skeleton.cs $(ProjectDir)\cs-parser.jay > $(ProjectDir)\cs-parser.cs
12 changes: 6 additions & 6 deletions msvc/scripts/order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<mcs>mcs</mcs>
<flags>/codepage:65001 -optimize -d:NET_1_1 -d:ONLY_1_1 -d:BOOTSTRAP_WITH_OLDLIB /noconfig</flags>
<output>./../class/lib/basic/mcs.exe</output>
<built_sources></built_sources>
<built_sources>cs-parser.cs</built_sources>
<library_output>./../class/lib/basic/mcs.exe</library_output>
<response>mcs.exe.sources</response>
</project>
Expand Down Expand Up @@ -50,7 +50,7 @@
<mcs>MONO_PATH=./../class/lib/basic: /cvs/mono/runtime/mono-wrapper ./../class/lib/basic/mcs.exe</mcs>
<flags>/codepage:65001 -optimize -d:NET_1_1 -d:ONLY_1_1 /noconfig</flags>
<output>./../class/lib/net_1_1_bootstrap/mcs.exe</output>
<built_sources></built_sources>
<built_sources>cs-parser.cs</built_sources>
<library_output>./../class/lib/net_1_1_bootstrap/mcs.exe</library_output>
<response>mcs.exe.sources</response>
</project>
Expand Down Expand Up @@ -176,7 +176,7 @@
<mcs>MONO_PATH=./../class/lib/net_1_1_bootstrap: /cvs/mono/runtime/mono-wrapper ./../class/lib/net_1_1_bootstrap/mcs.exe</mcs>
<flags>/codepage:65001 -optimize -d:NET_1_1 -d:ONLY_1_1 -debug /noconfig</flags>
<output>./../class/lib/net_1_1/mcs.exe</output>
<built_sources></built_sources>
<built_sources>cs-parser.cs</built_sources>
<library_output>./../class/lib/net_1_1/mcs.exe</library_output>
<response>mcs.exe.sources</response>
</project>
Expand Down Expand Up @@ -1364,7 +1364,7 @@
<mcs>MONO_PATH=./../class/lib/net_2_0_bootstrap: /cvs/mono/runtime/mono-wrapper ./../class/lib/net_2_0_bootstrap/gmcs.exe</mcs>
<flags>/codepage:65001 -d:GMCS_SOURCE -optimize -d:NET_1_1 -d:NET_2_0 -debug /noconfig</flags>
<output>./../class/lib/net_2_0/gmcs.exe</output>
<built_sources></built_sources>
<built_sources>cs-parser.cs</built_sources>
<library_output>./../class/lib/net_2_0/gmcs.exe</library_output>
<response>gmcs.exe.sources</response>
</project>
Expand Down Expand Up @@ -2570,7 +2570,7 @@
<mcs>MONO_PATH=./../class/lib/net_2_0: /cvs/mono/runtime/mono-wrapper ./../mcs/gmcs.exe</mcs>
<flags>/codepage:65001 -d:GMCS_SOURCE -d:SMCS_SOURCE -optimize -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -debug /noconfig</flags>
<output>./../class/lib/net_2_1_bootstrap/smcs.exe</output>
<built_sources></built_sources>
<built_sources>cs-parser.cs</built_sources>
<library_output>./../class/lib/net_2_1_bootstrap/smcs.exe</library_output>
<response>smcs.exe.sources</response>
</project>
Expand Down Expand Up @@ -2606,7 +2606,7 @@
<mcs>MONO_PATH=./../class/lib/net_2_1_bootstrap: /cvs/mono/runtime/mono-wrapper --security=temporary-smcs-hack ./../class/lib/net_2_1_bootstrap/smcs.exe</mcs>
<flags>/codepage:65001 -d:GMCS_SOURCE -d:SMCS_SOURCE -optimize -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -debug /noconfig</flags>
<output>./../class/lib/net_2_1_raw/smcs.exe</output>
<built_sources></built_sources>
<built_sources>cs-parser.cs</built_sources>
<library_output>./../class/lib/net_2_1_raw/smcs.exe</library_output>
<response>smcs.exe.sources</response>
</project>
Expand Down
23 changes: 16 additions & 7 deletions msvc/scripts/prepare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,23 @@ static void Main (string [] args)
Console.Error.WriteLine ("The directory {0} does not contain class at {1}", Path.GetFullPath (bdir), Environment.CurrentDirectory);
Environment.Exit (1);
}

Filter (bdir + "/class/System.XML/System.Xml.XPath/Parser.jay",
bdir + "/class/System.XML/Mono.Xml.Xsl/PatternParser.jay",
(i, o) => o.Write (i.ReadToEnd ().Replace ("%start Expr", "%start Pattern")));

Filter (bdir + "/build/common/Consts.cs.in",
bdir + "/build/common/Consts.cs",
(i, o) => o.Write (i.ReadToEnd ().Replace ("@MONO_VERSION@", "Mono-VSBuild")));
switch (args [1]){
case "xml":
Filter (bdir + "/class/System.XML/System.Xml.XPath/Parser.jay",
bdir + "/class/System.XML/Mono.Xml.Xsl/PatternParser.jay",
(i, o) => o.Write (i.ReadToEnd ().Replace ("%start Expr", "%start Pattern")));

Filter (bdir + "/build/common/Consts.cs.in",
bdir + "/build/common/Consts.cs",
(i, o) => o.Write (i.ReadToEnd ().Replace ("@MONO_VERSION@", "Mono-VSBuild")));
break;

default:
Console.Error.WriteLine ("Unknonw option to prepare.exe {0}", args [1]);
Environment.Exit (1);
break;
}
}

}
11 changes: 9 additions & 2 deletions msvc/setup-solution.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
@echo off
csc -debug -out:scripts\monowrap.exe scripts\monowrap.cs
if errorlevel 1 goto error
csc -nowarn:414 -debug -out:scripts\genproj.exe scripts\genproj.cs
if errorlevel 1 goto error
csc -debug -out:scripts\prepare.exe scripts\prepare.cs
if errorlevel 1 goto error
cd scripts
prepare.exe
if errorlevel 1 goto error
genproj.exe
if errorlevel 1 goto error
cd ..
echo Setup complete, you need at least a mcs\class\lib\basic directory with
echo mcs.exe mscorlib.dll System.dll System.Xml.dll
echo to bootstrap

goto end
: error
echo Error: solution is not configured.
:end

0 comments on commit 0dbf004

Please sign in to comment.