diff options
author | Sean Dague | 2007-07-16 15:40:11 +0000 |
---|---|---|
committer | Sean Dague | 2007-07-16 15:40:11 +0000 |
commit | 2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch) | |
tree | e3f80ad51736cf17e856547b1bcf956010927434 /Prebuild/src/Core/Targets/AutotoolsTarget.cs | |
parent | *Trunk compiles now (diff) | |
download | opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2 opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz |
changed to native line ending encoding
Diffstat (limited to 'Prebuild/src/Core/Targets/AutotoolsTarget.cs')
-rw-r--r-- | Prebuild/src/Core/Targets/AutotoolsTarget.cs | 1852 |
1 files changed, 926 insertions, 926 deletions
diff --git a/Prebuild/src/Core/Targets/AutotoolsTarget.cs b/Prebuild/src/Core/Targets/AutotoolsTarget.cs index 2b4a678..cf575e3 100644 --- a/Prebuild/src/Core/Targets/AutotoolsTarget.cs +++ b/Prebuild/src/Core/Targets/AutotoolsTarget.cs | |||
@@ -1,926 +1,926 @@ | |||
1 | #region BSD License | 1 | #region BSD License |
2 | /* | 2 | /* |
3 | 3 | ||
4 | Copyright (c) 2004 - 2006 | 4 | Copyright (c) 2004 - 2006 |
5 | Matthew Holmes (matthew@wildfiregames.com), | 5 | Matthew Holmes (matthew@wildfiregames.com), |
6 | Dan Moorehead (dan05a@gmail.com), | 6 | Dan Moorehead (dan05a@gmail.com), |
7 | Dave Hudson (jendave@yahoo.com), | 7 | Dave Hudson (jendave@yahoo.com), |
8 | C.J. Adams-Collier (cjcollier@colliertech.org), | 8 | C.J. Adams-Collier (cjcollier@colliertech.org), |
9 | 9 | ||
10 | Redistribution and use in source and binary forms, with or without | 10 | Redistribution and use in source and binary forms, with or without |
11 | modification, are permitted provided that the following conditions are | 11 | modification, are permitted provided that the following conditions are |
12 | met: | 12 | met: |
13 | 13 | ||
14 | * Redistributions of source code must retain the above copyright | 14 | * Redistributions of source code must retain the above copyright |
15 | notice, this list of conditions and the following disclaimer. | 15 | notice, this list of conditions and the following disclaimer. |
16 | 16 | ||
17 | * Redistributions in binary form must reproduce the above copyright | 17 | * Redistributions in binary form must reproduce the above copyright |
18 | notice, this list of conditions and the following disclaimer in the | 18 | notice, this list of conditions and the following disclaimer in the |
19 | documentation and/or other materials provided with the distribution. | 19 | documentation and/or other materials provided with the distribution. |
20 | 20 | ||
21 | * The name of the author may not be used to endorse or promote | 21 | * The name of the author may not be used to endorse or promote |
22 | products derived from this software without specific prior written | 22 | products derived from this software without specific prior written |
23 | permission. | 23 | permission. |
24 | 24 | ||
25 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 25 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
26 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 26 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
28 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | 28 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, |
29 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 29 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
32 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 32 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
33 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 33 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
34 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 34 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
35 | POSSIBILITY OF SUCH DAMAGE. | 35 | POSSIBILITY OF SUCH DAMAGE. |
36 | 36 | ||
37 | */ | 37 | */ |
38 | #endregion | 38 | #endregion |
39 | 39 | ||
40 | #region CVS Information | 40 | #region CVS Information |
41 | /* | 41 | /* |
42 | * $Source$ | 42 | * $Source$ |
43 | * $Author: jendave $ | 43 | * $Author: jendave $ |
44 | * $Date: 2006-07-28 22:43:24 -0700 (Fri, 28 Jul 2006) $ | 44 | * $Date: 2006-07-28 22:43:24 -0700 (Fri, 28 Jul 2006) $ |
45 | * $Revision: 136 $ | 45 | * $Revision: 136 $ |
46 | */ | 46 | */ |
47 | #endregion | 47 | #endregion |
48 | 48 | ||
49 | using System; | 49 | using System; |
50 | using System.Collections; | 50 | using System.Collections; |
51 | using System.Collections.Specialized; | 51 | using System.Collections.Specialized; |
52 | using System.IO; | 52 | using System.IO; |
53 | using System.Reflection; | 53 | using System.Reflection; |
54 | using System.Text; | 54 | using System.Text; |
55 | using System.Text.RegularExpressions; | 55 | using System.Text.RegularExpressions; |
56 | 56 | ||
57 | using Prebuild.Core.Attributes; | 57 | using Prebuild.Core.Attributes; |
58 | using Prebuild.Core.Interfaces; | 58 | using Prebuild.Core.Interfaces; |
59 | using Prebuild.Core.Nodes; | 59 | using Prebuild.Core.Nodes; |
60 | using Prebuild.Core.Parse; | 60 | using Prebuild.Core.Parse; |
61 | using Prebuild.Core.Utilities; | 61 | using Prebuild.Core.Utilities; |
62 | 62 | ||
63 | namespace Prebuild.Core.Targets | 63 | namespace Prebuild.Core.Targets |
64 | { | 64 | { |
65 | /// <summary> | 65 | /// <summary> |
66 | /// | 66 | /// |
67 | /// </summary> | 67 | /// </summary> |
68 | [Target("autotools")] | 68 | [Target("autotools")] |
69 | public class AutotoolsTarget : ITarget | 69 | public class AutotoolsTarget : ITarget |
70 | { | 70 | { |
71 | #region Fields | 71 | #region Fields |
72 | 72 | ||
73 | private Kernel m_Kernel; | 73 | private Kernel m_Kernel; |
74 | 74 | ||
75 | #endregion | 75 | #endregion |
76 | 76 | ||
77 | #region Private Methods | 77 | #region Private Methods |
78 | 78 | ||
79 | private static string PrependPath(string path) | 79 | private static string PrependPath(string path) |
80 | { | 80 | { |
81 | string tmpPath = Helper.NormalizePath(path, '/'); | 81 | string tmpPath = Helper.NormalizePath(path, '/'); |
82 | Regex regex = new Regex(@"(\w):/(\w+)"); | 82 | Regex regex = new Regex(@"(\w):/(\w+)"); |
83 | Match match = regex.Match(tmpPath); | 83 | Match match = regex.Match(tmpPath); |
84 | if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') | 84 | if(match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') |
85 | { | 85 | { |
86 | tmpPath = Helper.NormalizePath(tmpPath); | 86 | tmpPath = Helper.NormalizePath(tmpPath); |
87 | } | 87 | } |
88 | else | 88 | else |
89 | { | 89 | { |
90 | tmpPath = Helper.NormalizePath("./" + tmpPath); | 90 | tmpPath = Helper.NormalizePath("./" + tmpPath); |
91 | } | 91 | } |
92 | 92 | ||
93 | return tmpPath; | 93 | return tmpPath; |
94 | } | 94 | } |
95 | 95 | ||
96 | private static string BuildReference(SolutionNode solution, ReferenceNode refr) | 96 | private static string BuildReference(SolutionNode solution, ReferenceNode refr) |
97 | { | 97 | { |
98 | string ret = ""; | 98 | string ret = ""; |
99 | if(solution.ProjectsTable.ContainsKey(refr.Name)) | 99 | if(solution.ProjectsTable.ContainsKey(refr.Name)) |
100 | { | 100 | { |
101 | ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name]; | 101 | ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name]; |
102 | string fileRef = FindFileReference(refr.Name, project); | 102 | string fileRef = FindFileReference(refr.Name, project); |
103 | string finalPath = Helper.NormalizePath(Helper.MakeFilePath(project.FullPath + "/$(BUILD_DIR)/$(CONFIG)/", refr.Name, "dll"), '/'); | 103 | string finalPath = Helper.NormalizePath(Helper.MakeFilePath(project.FullPath + "/$(BUILD_DIR)/$(CONFIG)/", refr.Name, "dll"), '/'); |
104 | ret += finalPath; | 104 | ret += finalPath; |
105 | return ret; | 105 | return ret; |
106 | } | 106 | } |
107 | else | 107 | else |
108 | { | 108 | { |
109 | ProjectNode project = (ProjectNode)refr.Parent; | 109 | ProjectNode project = (ProjectNode)refr.Parent; |
110 | string fileRef = FindFileReference(refr.Name, project); | 110 | string fileRef = FindFileReference(refr.Name, project); |
111 | 111 | ||
112 | if(refr.Path != null || fileRef != null) | 112 | if(refr.Path != null || fileRef != null) |
113 | { | 113 | { |
114 | string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path + "/" + refr.Name + ".dll", '/') : fileRef; | 114 | string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path + "/" + refr.Name + ".dll", '/') : fileRef; |
115 | ret += Path.Combine(project.Path, finalPath); | 115 | ret += Path.Combine(project.Path, finalPath); |
116 | return ret; | 116 | return ret; |
117 | } | 117 | } |
118 | 118 | ||
119 | try | 119 | try |
120 | { | 120 | { |
121 | //Assembly assem = Assembly.Load(refr.Name); | 121 | //Assembly assem = Assembly.Load(refr.Name); |
122 | //if (assem != null) | 122 | //if (assem != null) |
123 | //{ | 123 | //{ |
124 | // int index = refr.Name.IndexOf(","); | 124 | // int index = refr.Name.IndexOf(","); |
125 | // if ( index > 0) | 125 | // if ( index > 0) |
126 | // { | 126 | // { |
127 | // ret += assem.Location; | 127 | // ret += assem.Location; |
128 | // //Console.WriteLine("Location1: " + assem.Location); | 128 | // //Console.WriteLine("Location1: " + assem.Location); |
129 | // } | 129 | // } |
130 | // else | 130 | // else |
131 | // { | 131 | // { |
132 | // ret += (refr.Name + ".dll"); | 132 | // ret += (refr.Name + ".dll"); |
133 | // //Console.WriteLine("Location2: " + assem.Location); | 133 | // //Console.WriteLine("Location2: " + assem.Location); |
134 | // } | 134 | // } |
135 | //} | 135 | //} |
136 | //else | 136 | //else |
137 | //{ | 137 | //{ |
138 | int index = refr.Name.IndexOf(","); | 138 | int index = refr.Name.IndexOf(","); |
139 | if ( index > 0) | 139 | if ( index > 0) |
140 | { | 140 | { |
141 | ret += refr.Name.Substring(0, index) + ".dll"; | 141 | ret += refr.Name.Substring(0, index) + ".dll"; |
142 | //Console.WriteLine("Location3: " + assem.Location); | 142 | //Console.WriteLine("Location3: " + assem.Location); |
143 | } | 143 | } |
144 | else | 144 | else |
145 | { | 145 | { |
146 | ret += (refr.Name + ".dll"); | 146 | ret += (refr.Name + ".dll"); |
147 | //Console.WriteLine("Location4: " + assem.Location); | 147 | //Console.WriteLine("Location4: " + assem.Location); |
148 | } | 148 | } |
149 | //} | 149 | //} |
150 | } | 150 | } |
151 | catch (System.NullReferenceException e) | 151 | catch (System.NullReferenceException e) |
152 | { | 152 | { |
153 | e.ToString(); | 153 | e.ToString(); |
154 | int index = refr.Name.IndexOf(","); | 154 | int index = refr.Name.IndexOf(","); |
155 | if ( index > 0) | 155 | if ( index > 0) |
156 | { | 156 | { |
157 | ret += refr.Name.Substring(0, index) + ".dll"; | 157 | ret += refr.Name.Substring(0, index) + ".dll"; |
158 | //Console.WriteLine("Location5: " + assem.Location); | 158 | //Console.WriteLine("Location5: " + assem.Location); |
159 | } | 159 | } |
160 | else | 160 | else |
161 | { | 161 | { |
162 | ret += (refr.Name + ".dll"); | 162 | ret += (refr.Name + ".dll"); |
163 | //Console.WriteLine("Location6: " + assem.Location); | 163 | //Console.WriteLine("Location6: " + assem.Location); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | } | 166 | } |
167 | return ret; | 167 | return ret; |
168 | } | 168 | } |
169 | 169 | ||
170 | private static string BuildReferencePath(SolutionNode solution, ReferenceNode refr) | 170 | private static string BuildReferencePath(SolutionNode solution, ReferenceNode refr) |
171 | { | 171 | { |
172 | string ret = ""; | 172 | string ret = ""; |
173 | if(solution.ProjectsTable.ContainsKey(refr.Name)) | 173 | if(solution.ProjectsTable.ContainsKey(refr.Name)) |
174 | { | 174 | { |
175 | ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name]; | 175 | ProjectNode project = (ProjectNode)solution.ProjectsTable[refr.Name]; |
176 | string finalPath = Helper.NormalizePath(Helper.MakeReferencePath(project.FullPath + "/${build.dir}/"), '/'); | 176 | string finalPath = Helper.NormalizePath(Helper.MakeReferencePath(project.FullPath + "/${build.dir}/"), '/'); |
177 | ret += finalPath; | 177 | ret += finalPath; |
178 | return ret; | 178 | return ret; |
179 | } | 179 | } |
180 | else | 180 | else |
181 | { | 181 | { |
182 | ProjectNode project = (ProjectNode)refr.Parent; | 182 | ProjectNode project = (ProjectNode)refr.Parent; |
183 | string fileRef = FindFileReference(refr.Name, project); | 183 | string fileRef = FindFileReference(refr.Name, project); |
184 | 184 | ||
185 | 185 | ||
186 | if(refr.Path != null || fileRef != null) | 186 | if(refr.Path != null || fileRef != null) |
187 | { | 187 | { |
188 | string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path, '/') : fileRef; | 188 | string finalPath = (refr.Path != null) ? Helper.NormalizePath(refr.Path, '/') : fileRef; |
189 | ret += finalPath; | 189 | ret += finalPath; |
190 | return ret; | 190 | return ret; |
191 | } | 191 | } |
192 | 192 | ||
193 | try | 193 | try |
194 | { | 194 | { |
195 | Assembly assem = Assembly.Load(refr.Name); | 195 | Assembly assem = Assembly.Load(refr.Name); |
196 | if (assem != null) | 196 | if (assem != null) |
197 | { | 197 | { |
198 | ret += ""; | 198 | ret += ""; |
199 | } | 199 | } |
200 | else | 200 | else |
201 | { | 201 | { |
202 | ret += ""; | 202 | ret += ""; |
203 | } | 203 | } |
204 | } | 204 | } |
205 | catch (System.NullReferenceException e) | 205 | catch (System.NullReferenceException e) |
206 | { | 206 | { |
207 | e.ToString(); | 207 | e.ToString(); |
208 | ret += ""; | 208 | ret += ""; |
209 | } | 209 | } |
210 | } | 210 | } |
211 | return ret; | 211 | return ret; |
212 | } | 212 | } |
213 | 213 | ||
214 | private static string FindFileReference(string refName, ProjectNode project) | 214 | private static string FindFileReference(string refName, ProjectNode project) |
215 | { | 215 | { |
216 | foreach(ReferencePathNode refPath in project.ReferencePaths) | 216 | foreach(ReferencePathNode refPath in project.ReferencePaths) |
217 | { | 217 | { |
218 | string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); | 218 | string fullPath = Helper.MakeFilePath(refPath.Path, refName, "dll"); |
219 | 219 | ||
220 | if(File.Exists(fullPath)) | 220 | if(File.Exists(fullPath)) |
221 | { | 221 | { |
222 | return fullPath; | 222 | return fullPath; |
223 | } | 223 | } |
224 | } | 224 | } |
225 | 225 | ||
226 | return null; | 226 | return null; |
227 | } | 227 | } |
228 | 228 | ||
229 | /// <summary> | 229 | /// <summary> |
230 | /// Gets the XML doc file. | 230 | /// Gets the XML doc file. |
231 | /// </summary> | 231 | /// </summary> |
232 | /// <param name="project">The project.</param> | 232 | /// <param name="project">The project.</param> |
233 | /// <param name="conf">The conf.</param> | 233 | /// <param name="conf">The conf.</param> |
234 | /// <returns></returns> | 234 | /// <returns></returns> |
235 | public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) | 235 | public static string GetXmlDocFile(ProjectNode project, ConfigurationNode conf) |
236 | { | 236 | { |
237 | if( conf == null ) | 237 | if( conf == null ) |
238 | { | 238 | { |
239 | throw new ArgumentNullException("conf"); | 239 | throw new ArgumentNullException("conf"); |
240 | } | 240 | } |
241 | if( project == null ) | 241 | if( project == null ) |
242 | { | 242 | { |
243 | throw new ArgumentNullException("project"); | 243 | throw new ArgumentNullException("project"); |
244 | } | 244 | } |
245 | string docFile = (string)conf.Options["XmlDocFile"]; | 245 | string docFile = (string)conf.Options["XmlDocFile"]; |
246 | // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified | 246 | // if(docFile != null && docFile.Length == 0)//default to assembly name if not specified |
247 | // { | 247 | // { |
248 | // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; | 248 | // return Path.GetFileNameWithoutExtension(project.AssemblyName) + ".xml"; |
249 | // } | 249 | // } |
250 | return docFile; | 250 | return docFile; |
251 | } | 251 | } |
252 | 252 | ||
253 | /// <summary> | 253 | /// <summary> |
254 | /// Normalizes the path. | 254 | /// Normalizes the path. |
255 | /// </summary> | 255 | /// </summary> |
256 | /// <param name="path">The path.</param> | 256 | /// <param name="path">The path.</param> |
257 | /// <returns></returns> | 257 | /// <returns></returns> |
258 | public static string NormalizePath(string path) | 258 | public static string NormalizePath(string path) |
259 | { | 259 | { |
260 | if(path == null) | 260 | if(path == null) |
261 | { | 261 | { |
262 | return ""; | 262 | return ""; |
263 | } | 263 | } |
264 | 264 | ||
265 | StringBuilder tmpPath; | 265 | StringBuilder tmpPath; |
266 | 266 | ||
267 | if (Core.Parse.Preprocessor.GetOS() == "Win32") | 267 | if (Core.Parse.Preprocessor.GetOS() == "Win32") |
268 | { | 268 | { |
269 | tmpPath = new StringBuilder(path.Replace('\\', '/')); | 269 | tmpPath = new StringBuilder(path.Replace('\\', '/')); |
270 | tmpPath.Replace("/", @"\\"); | 270 | tmpPath.Replace("/", @"\\"); |
271 | } | 271 | } |
272 | else | 272 | else |
273 | { | 273 | { |
274 | tmpPath = new StringBuilder(path.Replace('\\', '/')); | 274 | tmpPath = new StringBuilder(path.Replace('\\', '/')); |
275 | tmpPath = tmpPath.Replace('/', Path.DirectorySeparatorChar); | 275 | tmpPath = tmpPath.Replace('/', Path.DirectorySeparatorChar); |
276 | } | 276 | } |
277 | return tmpPath.ToString(); | 277 | return tmpPath.ToString(); |
278 | } | 278 | } |
279 | 279 | ||
280 | private void WriteProject(SolutionNode solution, ProjectNode project) | 280 | private void WriteProject(SolutionNode solution, ProjectNode project) |
281 | { | 281 | { |
282 | string projFile = Helper.MakeFilePath(project.FullPath, "Include", "am"); | 282 | string projFile = Helper.MakeFilePath(project.FullPath, "Include", "am"); |
283 | StreamWriter ss = new StreamWriter(projFile); | 283 | StreamWriter ss = new StreamWriter(projFile); |
284 | ss.NewLine = "\n"; | 284 | ss.NewLine = "\n"; |
285 | 285 | ||
286 | m_Kernel.CurrentWorkingDirectory.Push(); | 286 | m_Kernel.CurrentWorkingDirectory.Push(); |
287 | Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); | 287 | Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); |
288 | 288 | ||
289 | using(ss) | 289 | using(ss) |
290 | { | 290 | { |
291 | ss.WriteLine(Helper.AssemblyFullName(project.AssemblyName, project.Type) + ":"); | 291 | ss.WriteLine(Helper.AssemblyFullName(project.AssemblyName, project.Type) + ":"); |
292 | ss.WriteLine("\tmkdir -p " + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/"); | 292 | ss.WriteLine("\tmkdir -p " + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/"); |
293 | foreach(string file in project.Files) | 293 | foreach(string file in project.Files) |
294 | { | 294 | { |
295 | if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) | 295 | if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) |
296 | { | 296 | { |
297 | ss.Write("\tresgen "); | 297 | ss.Write("\tresgen "); |
298 | ss.Write(Helper.NormalizePath(Path.Combine(project.Path, file.Substring(0, file.LastIndexOf('.')) + ".resx "), '/')); | 298 | ss.Write(Helper.NormalizePath(Path.Combine(project.Path, file.Substring(0, file.LastIndexOf('.')) + ".resx "), '/')); |
299 | if (project.Files.GetResourceName(file) != "") | 299 | if (project.Files.GetResourceName(file) != "") |
300 | { | 300 | { |
301 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources"), '/')); | 301 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources"), '/')); |
302 | } | 302 | } |
303 | else | 303 | else |
304 | { | 304 | { |
305 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources"), '/')); | 305 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources"), '/')); |
306 | } | 306 | } |
307 | } | 307 | } |
308 | } | 308 | } |
309 | ss.WriteLine("\t$(CSC)\t/out:" + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/" + Helper.AssemblyFullName(project.AssemblyName, project.Type) + " \\"); | 309 | ss.WriteLine("\t$(CSC)\t/out:" + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/" + Helper.AssemblyFullName(project.AssemblyName, project.Type) + " \\"); |
310 | ss.WriteLine("\t\t/target:" + project.Type.ToString().ToLower() + " \\"); | 310 | ss.WriteLine("\t\t/target:" + project.Type.ToString().ToLower() + " \\"); |
311 | if (project.References.Count > 0) | 311 | if (project.References.Count > 0) |
312 | { | 312 | { |
313 | ss.Write("\t\t/reference:"); | 313 | ss.Write("\t\t/reference:"); |
314 | bool firstref = true; | 314 | bool firstref = true; |
315 | foreach(ReferenceNode refr in project.References) | 315 | foreach(ReferenceNode refr in project.References) |
316 | { | 316 | { |
317 | if (firstref) | 317 | if (firstref) |
318 | { | 318 | { |
319 | firstref = false; | 319 | firstref = false; |
320 | } | 320 | } |
321 | else | 321 | else |
322 | { | 322 | { |
323 | ss.Write(","); | 323 | ss.Write(","); |
324 | } | 324 | } |
325 | ss.Write("{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(solution.FullPath, BuildReference(solution, refr)), '/')); | 325 | ss.Write("{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(solution.FullPath, BuildReference(solution, refr)), '/')); |
326 | } | 326 | } |
327 | ss.WriteLine(" \\"); | 327 | ss.WriteLine(" \\"); |
328 | } | 328 | } |
329 | //ss.WriteLine("\t\tProperties/AssemblyInfo.cs \\"); | 329 | //ss.WriteLine("\t\tProperties/AssemblyInfo.cs \\"); |
330 | 330 | ||
331 | foreach(string file in project.Files) | 331 | foreach(string file in project.Files) |
332 | { | 332 | { |
333 | switch(project.Files.GetBuildAction(file)) | 333 | switch(project.Files.GetBuildAction(file)) |
334 | { | 334 | { |
335 | case BuildAction.EmbeddedResource: | 335 | case BuildAction.EmbeddedResource: |
336 | ss.Write("\t\t/resource:"); | 336 | ss.Write("\t\t/resource:"); |
337 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, file), '/') + " \\"); | 337 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, file), '/') + " \\"); |
338 | break; | 338 | break; |
339 | default: | 339 | default: |
340 | if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) | 340 | if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) |
341 | { | 341 | { |
342 | ss.Write("\t\t/resource:"); | 342 | ss.Write("\t\t/resource:"); |
343 | if (project.Files.GetResourceName(file) != "") | 343 | if (project.Files.GetResourceName(file) != "") |
344 | { | 344 | { |
345 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources"), '/') + "," + project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources" + " \\"); | 345 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources"), '/') + "," + project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources" + " \\"); |
346 | } | 346 | } |
347 | else | 347 | else |
348 | { | 348 | { |
349 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources"), '/') + "," + project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources" + " \\"); | 349 | ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources"), '/') + "," + project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources" + " \\"); |
350 | } | 350 | } |
351 | } | 351 | } |
352 | break; | 352 | break; |
353 | } | 353 | } |
354 | } | 354 | } |
355 | 355 | ||
356 | foreach(ConfigurationNode conf in project.Configurations) | 356 | foreach(ConfigurationNode conf in project.Configurations) |
357 | { | 357 | { |
358 | if (conf.Options.KeyFile !="") | 358 | if (conf.Options.KeyFile !="") |
359 | { | 359 | { |
360 | ss.WriteLine("\t\t/keyfile:" + Helper.NormalizePath(Path.Combine(project.Path, conf.Options.KeyFile), '/') + " \\"); | 360 | ss.WriteLine("\t\t/keyfile:" + Helper.NormalizePath(Path.Combine(project.Path, conf.Options.KeyFile), '/') + " \\"); |
361 | break; | 361 | break; |
362 | } | 362 | } |
363 | } | 363 | } |
364 | foreach(ConfigurationNode conf in project.Configurations) | 364 | foreach(ConfigurationNode conf in project.Configurations) |
365 | { | 365 | { |
366 | if (conf.Options.AllowUnsafe) | 366 | if (conf.Options.AllowUnsafe) |
367 | { | 367 | { |
368 | ss.WriteLine("\t\t/unsafe \\"); | 368 | ss.WriteLine("\t\t/unsafe \\"); |
369 | break; | 369 | break; |
370 | } | 370 | } |
371 | } | 371 | } |
372 | if (project.AppIcon != "") | 372 | if (project.AppIcon != "") |
373 | { | 373 | { |
374 | ss.WriteLine("\t\t/win32icon:" + Helper.NormalizePath(Path.Combine(project.Path, project.AppIcon), '/') + " \\"); | 374 | ss.WriteLine("\t\t/win32icon:" + Helper.NormalizePath(Path.Combine(project.Path, project.AppIcon), '/') + " \\"); |
375 | } | 375 | } |
376 | 376 | ||
377 | foreach(ConfigurationNode conf in project.Configurations) | 377 | foreach(ConfigurationNode conf in project.Configurations) |
378 | { | 378 | { |
379 | ss.WriteLine("\t\t/define:{0}", conf.Options.CompilerDefines.Replace(';', ',') + " \\"); | 379 | ss.WriteLine("\t\t/define:{0}", conf.Options.CompilerDefines.Replace(';', ',') + " \\"); |
380 | break; | 380 | break; |
381 | } | 381 | } |
382 | 382 | ||
383 | foreach(ConfigurationNode conf in project.Configurations) | 383 | foreach(ConfigurationNode conf in project.Configurations) |
384 | { | 384 | { |
385 | if (GetXmlDocFile(project, conf) !="") | 385 | if (GetXmlDocFile(project, conf) !="") |
386 | { | 386 | { |
387 | ss.WriteLine("\t\t/doc:" + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/" + project.Name + ".xml \\"); | 387 | ss.WriteLine("\t\t/doc:" + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/" + project.Name + ".xml \\"); |
388 | break; | 388 | break; |
389 | } | 389 | } |
390 | } | 390 | } |
391 | foreach(string file in project.Files) | 391 | foreach(string file in project.Files) |
392 | { | 392 | { |
393 | switch(project.Files.GetBuildAction(file)) | 393 | switch(project.Files.GetBuildAction(file)) |
394 | { | 394 | { |
395 | case BuildAction.Compile: | 395 | case BuildAction.Compile: |
396 | ss.WriteLine("\t\t\\"); | 396 | ss.WriteLine("\t\t\\"); |
397 | ss.Write("\t\t" + NormalizePath(Path.Combine(Helper.MakePathRelativeTo(solution.FullPath, project.Path), file))); | 397 | ss.Write("\t\t" + NormalizePath(Path.Combine(Helper.MakePathRelativeTo(solution.FullPath, project.Path), file))); |
398 | break; | 398 | break; |
399 | default: | 399 | default: |
400 | break; | 400 | break; |
401 | } | 401 | } |
402 | } | 402 | } |
403 | ss.WriteLine(); | 403 | ss.WriteLine(); |
404 | ss.WriteLine(); | 404 | ss.WriteLine(); |
405 | 405 | ||
406 | if (project.Type == ProjectType.Library) | 406 | if (project.Type == ProjectType.Library) |
407 | { | 407 | { |
408 | ss.WriteLine("install-data-local:"); | 408 | ss.WriteLine("install-data-local:"); |
409 | ss.WriteLine(" echo \"$(GACUTIL) /i bin/Release/" + project.Name + ".dll /f $(GACUTIL_FLAGS)\"; \\"); | 409 | ss.WriteLine(" echo \"$(GACUTIL) /i bin/Release/" + project.Name + ".dll /f $(GACUTIL_FLAGS)\"; \\"); |
410 | ss.WriteLine(" $(GACUTIL) /i bin/Release/" + project.Name + ".dll /f $(GACUTIL_FLAGS) || exit 1;"); | 410 | ss.WriteLine(" $(GACUTIL) /i bin/Release/" + project.Name + ".dll /f $(GACUTIL_FLAGS) || exit 1;"); |
411 | ss.WriteLine(); | 411 | ss.WriteLine(); |
412 | ss.WriteLine("uninstall-local:"); | 412 | ss.WriteLine("uninstall-local:"); |
413 | ss.WriteLine(" echo \"$(GACUTIL) /u " + project.Name + " $(GACUTIL_FLAGS)\"; \\"); | 413 | ss.WriteLine(" echo \"$(GACUTIL) /u " + project.Name + " $(GACUTIL_FLAGS)\"; \\"); |
414 | ss.WriteLine(" $(GACUTIL) /u " + project.Name + " $(GACUTIL_FLAGS) || exit 1;"); | 414 | ss.WriteLine(" $(GACUTIL) /u " + project.Name + " $(GACUTIL_FLAGS) || exit 1;"); |
415 | ss.WriteLine(); | 415 | ss.WriteLine(); |
416 | } | 416 | } |
417 | ss.WriteLine("CLEANFILES = $(BUILD_DIR)/$(CONFIG)/" + Helper.AssemblyFullName(project.AssemblyName, project.Type) + " $(BUILD_DIR)/$(CONFIG)/" + project.AssemblyName + ".mdb $(BUILD_DIR)/$(CONFIG)/" + project.AssemblyName + ".pdb " + project.AssemblyName + ".xml"); | 417 | ss.WriteLine("CLEANFILES = $(BUILD_DIR)/$(CONFIG)/" + Helper.AssemblyFullName(project.AssemblyName, project.Type) + " $(BUILD_DIR)/$(CONFIG)/" + project.AssemblyName + ".mdb $(BUILD_DIR)/$(CONFIG)/" + project.AssemblyName + ".pdb " + project.AssemblyName + ".xml"); |
418 | ss.WriteLine("EXTRA_DIST = \\"); | 418 | ss.WriteLine("EXTRA_DIST = \\"); |
419 | ss.Write(" $(FILES)"); | 419 | ss.Write(" $(FILES)"); |
420 | foreach(ConfigurationNode conf in project.Configurations) | 420 | foreach(ConfigurationNode conf in project.Configurations) |
421 | { | 421 | { |
422 | if (conf.Options.KeyFile != "") | 422 | if (conf.Options.KeyFile != "") |
423 | { | 423 | { |
424 | ss.Write(" \\"); | 424 | ss.Write(" \\"); |
425 | ss.WriteLine("\t" + conf.Options.KeyFile); | 425 | ss.WriteLine("\t" + conf.Options.KeyFile); |
426 | } | 426 | } |
427 | break; | 427 | break; |
428 | } | 428 | } |
429 | } | 429 | } |
430 | m_Kernel.CurrentWorkingDirectory.Pop(); | 430 | m_Kernel.CurrentWorkingDirectory.Pop(); |
431 | } | 431 | } |
432 | bool hasLibrary = false; | 432 | bool hasLibrary = false; |
433 | 433 | ||
434 | private void WriteCombine(SolutionNode solution) | 434 | private void WriteCombine(SolutionNode solution) |
435 | { | 435 | { |
436 | 436 | ||
437 | /* TODO: These vars should be pulled from the prebuild.xml file */ | 437 | /* TODO: These vars should be pulled from the prebuild.xml file */ |
438 | string releaseVersion = "2.0.0"; | 438 | string releaseVersion = "2.0.0"; |
439 | string assemblyVersion = "2.1.0.0"; | 439 | string assemblyVersion = "2.1.0.0"; |
440 | string description = | 440 | string description = |
441 | "Tao Framework " + solution.Name + " Binding For .NET"; | 441 | "Tao Framework " + solution.Name + " Binding For .NET"; |
442 | 442 | ||
443 | hasLibrary = false; | 443 | hasLibrary = false; |
444 | m_Kernel.Log.Write("Creating Autotools make files"); | 444 | m_Kernel.Log.Write("Creating Autotools make files"); |
445 | foreach(ProjectNode project in solution.Projects) | 445 | foreach(ProjectNode project in solution.Projects) |
446 | { | 446 | { |
447 | if(m_Kernel.AllowProject(project.FilterGroups)) | 447 | if(m_Kernel.AllowProject(project.FilterGroups)) |
448 | { | 448 | { |
449 | m_Kernel.Log.Write("...Creating makefile: {0}", project.Name); | 449 | m_Kernel.Log.Write("...Creating makefile: {0}", project.Name); |
450 | WriteProject(solution, project); | 450 | WriteProject(solution, project); |
451 | } | 451 | } |
452 | } | 452 | } |
453 | 453 | ||
454 | m_Kernel.Log.Write(""); | 454 | m_Kernel.Log.Write(""); |
455 | string combFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am"); | 455 | string combFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am"); |
456 | StreamWriter ss = new StreamWriter(combFile); | 456 | StreamWriter ss = new StreamWriter(combFile); |
457 | ss.NewLine = "\n"; | 457 | ss.NewLine = "\n"; |
458 | 458 | ||
459 | m_Kernel.CurrentWorkingDirectory.Push(); | 459 | m_Kernel.CurrentWorkingDirectory.Push(); |
460 | Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); | 460 | Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); |
461 | 461 | ||
462 | using(ss) | 462 | using(ss) |
463 | { | 463 | { |
464 | foreach(ProjectNode project in solution.ProjectsTableOrder) | 464 | foreach(ProjectNode project in solution.ProjectsTableOrder) |
465 | { | 465 | { |
466 | if (project.Type == ProjectType.Library) | 466 | if (project.Type == ProjectType.Library) |
467 | { | 467 | { |
468 | hasLibrary = true; | 468 | hasLibrary = true; |
469 | break; | 469 | break; |
470 | } | 470 | } |
471 | } | 471 | } |
472 | 472 | ||
473 | if (hasLibrary) | 473 | if (hasLibrary) |
474 | { | 474 | { |
475 | ss.Write("pkgconfig_in_files = "); | 475 | ss.Write("pkgconfig_in_files = "); |
476 | foreach(ProjectNode project in solution.ProjectsTableOrder) | 476 | foreach(ProjectNode project in solution.ProjectsTableOrder) |
477 | { | 477 | { |
478 | if (project.Type == ProjectType.Library) | 478 | if (project.Type == ProjectType.Library) |
479 | { | 479 | { |
480 | string combFilepc = Helper.MakeFilePath(solution.FullPath, project.Name, "pc.in"); | 480 | string combFilepc = Helper.MakeFilePath(solution.FullPath, project.Name, "pc.in"); |
481 | ss.Write(" " + project.Name + ".pc.in "); | 481 | ss.Write(" " + project.Name + ".pc.in "); |
482 | StreamWriter sspc = new StreamWriter(combFilepc); | 482 | StreamWriter sspc = new StreamWriter(combFilepc); |
483 | sspc.NewLine = "\n"; | 483 | sspc.NewLine = "\n"; |
484 | using(sspc) | 484 | using(sspc) |
485 | { | 485 | { |
486 | sspc.WriteLine("prefix=@prefix@"); | 486 | sspc.WriteLine("prefix=@prefix@"); |
487 | sspc.WriteLine("exec_prefix=${prefix}"); | 487 | sspc.WriteLine("exec_prefix=${prefix}"); |
488 | sspc.WriteLine("libdir=${exec_prefix}/lib"); | 488 | sspc.WriteLine("libdir=${exec_prefix}/lib"); |
489 | sspc.WriteLine(); | 489 | sspc.WriteLine(); |
490 | sspc.WriteLine("Name: @PACKAGE_NAME@"); | 490 | sspc.WriteLine("Name: @PACKAGE_NAME@"); |
491 | sspc.WriteLine("Description: @DESCRIPTION@"); | 491 | sspc.WriteLine("Description: @DESCRIPTION@"); |
492 | sspc.WriteLine("Version: @ASSEMBLY_VERSION@"); | 492 | sspc.WriteLine("Version: @ASSEMBLY_VERSION@"); |
493 | sspc.WriteLine("Libs: -r:${libdir}/mono/gac/@PACKAGE_NAME@/@ASSEMBLY_VERSION@__@PUBKEY@/@PACKAGE_NAME@.dll"); | 493 | sspc.WriteLine("Libs: -r:${libdir}/mono/gac/@PACKAGE_NAME@/@ASSEMBLY_VERSION@__@PUBKEY@/@PACKAGE_NAME@.dll"); |
494 | } | 494 | } |
495 | } | 495 | } |
496 | } | 496 | } |
497 | 497 | ||
498 | ss.WriteLine(); | 498 | ss.WriteLine(); |
499 | ss.WriteLine("pkgconfigdir=$(prefix)/lib/pkgconfig"); | 499 | ss.WriteLine("pkgconfigdir=$(prefix)/lib/pkgconfig"); |
500 | ss.WriteLine("pkgconfig_DATA=$(pkgconfig_in_files:.pc.in=.pc)"); | 500 | ss.WriteLine("pkgconfig_DATA=$(pkgconfig_in_files:.pc.in=.pc)"); |
501 | } | 501 | } |
502 | ss.WriteLine(); | 502 | ss.WriteLine(); |
503 | foreach(ProjectNode project in solution.ProjectsTableOrder) | 503 | foreach(ProjectNode project in solution.ProjectsTableOrder) |
504 | { | 504 | { |
505 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); | 505 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); |
506 | ss.WriteLine("-include x {0}", | 506 | ss.WriteLine("-include x {0}", |
507 | Helper.NormalizePath(Helper.MakeFilePath(path, "Include", "am"),'/')); | 507 | Helper.NormalizePath(Helper.MakeFilePath(path, "Include", "am"),'/')); |
508 | } | 508 | } |
509 | ss.WriteLine(); | 509 | ss.WriteLine(); |
510 | ss.WriteLine("all: \\"); | 510 | ss.WriteLine("all: \\"); |
511 | ss.Write("\t"); | 511 | ss.Write("\t"); |
512 | foreach(ProjectNode project in solution.ProjectsTableOrder) | 512 | foreach(ProjectNode project in solution.ProjectsTableOrder) |
513 | { | 513 | { |
514 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); | 514 | string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); |
515 | ss.Write(Helper.AssemblyFullName(project.AssemblyName, project.Type) + " "); | 515 | ss.Write(Helper.AssemblyFullName(project.AssemblyName, project.Type) + " "); |
516 | 516 | ||
517 | } | 517 | } |
518 | ss.WriteLine(); | 518 | ss.WriteLine(); |
519 | if (hasLibrary) | 519 | if (hasLibrary) |
520 | { | 520 | { |
521 | ss.WriteLine("EXTRA_DIST = \\"); | 521 | ss.WriteLine("EXTRA_DIST = \\"); |
522 | ss.WriteLine("\t$(pkgconfig_in_files)"); | 522 | ss.WriteLine("\t$(pkgconfig_in_files)"); |
523 | } | 523 | } |
524 | else | 524 | else |
525 | { | 525 | { |
526 | ss.WriteLine("EXTRA_DIST = "); | 526 | ss.WriteLine("EXTRA_DIST = "); |
527 | } | 527 | } |
528 | ss.WriteLine(); | 528 | ss.WriteLine(); |
529 | ss.WriteLine("DISTCLEANFILES = \\"); | 529 | ss.WriteLine("DISTCLEANFILES = \\"); |
530 | ss.WriteLine("\tconfigure \\"); | 530 | ss.WriteLine("\tconfigure \\"); |
531 | ss.WriteLine("\tMakefile.in \\"); | 531 | ss.WriteLine("\tMakefile.in \\"); |
532 | ss.WriteLine("\taclocal.m4"); | 532 | ss.WriteLine("\taclocal.m4"); |
533 | } | 533 | } |
534 | combFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac"); | 534 | combFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac"); |
535 | StreamWriter ts = new StreamWriter(combFile); | 535 | StreamWriter ts = new StreamWriter(combFile); |
536 | ts.NewLine = "\n"; | 536 | ts.NewLine = "\n"; |
537 | using(ts) | 537 | using(ts) |
538 | { | 538 | { |
539 | if (this.hasLibrary) | 539 | if (this.hasLibrary) |
540 | { | 540 | { |
541 | foreach(ProjectNode project in solution.ProjectsTableOrder) | 541 | foreach(ProjectNode project in solution.ProjectsTableOrder) |
542 | { | 542 | { |
543 | if (project.Type == ProjectType.Library) | 543 | if (project.Type == ProjectType.Library) |
544 | { | 544 | { |
545 | ts.WriteLine("AC_INIT(" + project.Name + ".pc.in)"); | 545 | ts.WriteLine("AC_INIT(" + project.Name + ".pc.in)"); |
546 | break; | 546 | break; |
547 | } | 547 | } |
548 | } | 548 | } |
549 | } | 549 | } |
550 | else | 550 | else |
551 | { | 551 | { |
552 | ts.WriteLine("AC_INIT(Makefile.am)"); | 552 | ts.WriteLine("AC_INIT(Makefile.am)"); |
553 | } | 553 | } |
554 | ts.WriteLine("AC_PREREQ(2.53)"); | 554 | ts.WriteLine("AC_PREREQ(2.53)"); |
555 | ts.WriteLine("AC_CANONICAL_SYSTEM"); | 555 | ts.WriteLine("AC_CANONICAL_SYSTEM"); |
556 | 556 | ||
557 | ts.WriteLine("PACKAGE_NAME={0}", solution.Name); | 557 | ts.WriteLine("PACKAGE_NAME={0}", solution.Name); |
558 | ts.WriteLine("PACKAGE_VERSION={0}", releaseVersion); | 558 | ts.WriteLine("PACKAGE_VERSION={0}", releaseVersion); |
559 | ts.WriteLine("DESCRIPTION=\"{0}\"", description); | 559 | ts.WriteLine("DESCRIPTION=\"{0}\"", description); |
560 | ts.WriteLine("AC_SUBST(DESCRIPTION)"); | 560 | ts.WriteLine("AC_SUBST(DESCRIPTION)"); |
561 | ts.WriteLine("AM_INIT_AUTOMAKE([$PACKAGE_NAME],[$PACKAGE_VERSION],[$DESCRIPTION])"); | 561 | ts.WriteLine("AM_INIT_AUTOMAKE([$PACKAGE_NAME],[$PACKAGE_VERSION],[$DESCRIPTION])"); |
562 | 562 | ||
563 | ts.WriteLine("ASSEMBLY_VERSION={0}", assemblyVersion); | 563 | ts.WriteLine("ASSEMBLY_VERSION={0}", assemblyVersion); |
564 | ts.WriteLine("AC_SUBST(ASSEMBLY_VERSION)"); | 564 | ts.WriteLine("AC_SUBST(ASSEMBLY_VERSION)"); |
565 | 565 | ||
566 | ts.WriteLine("PUBKEY=`sn -t $PACKAGE_NAME.snk | grep 'Public Key Token' | awk -F: '{print $2}' | sed -e 's/^ //'`"); | 566 | ts.WriteLine("PUBKEY=`sn -t $PACKAGE_NAME.snk | grep 'Public Key Token' | awk -F: '{print $2}' | sed -e 's/^ //'`"); |
567 | ts.WriteLine("AC_SUBST(PUBKEY)"); | 567 | ts.WriteLine("AC_SUBST(PUBKEY)"); |
568 | 568 | ||
569 | ts.WriteLine(); | 569 | ts.WriteLine(); |
570 | ts.WriteLine("AM_MAINTAINER_MODE"); | 570 | ts.WriteLine("AM_MAINTAINER_MODE"); |
571 | ts.WriteLine(); | 571 | ts.WriteLine(); |
572 | ts.WriteLine("dnl AC_PROG_INTLTOOL([0.25])"); | 572 | ts.WriteLine("dnl AC_PROG_INTLTOOL([0.25])"); |
573 | ts.WriteLine(); | 573 | ts.WriteLine(); |
574 | ts.WriteLine("AC_PROG_INSTALL"); | 574 | ts.WriteLine("AC_PROG_INSTALL"); |
575 | ts.WriteLine(); | 575 | ts.WriteLine(); |
576 | ts.WriteLine("MONO_REQUIRED_VERSION=1.1"); | 576 | ts.WriteLine("MONO_REQUIRED_VERSION=1.1"); |
577 | ts.WriteLine(); | 577 | ts.WriteLine(); |
578 | ts.WriteLine("AC_MSG_CHECKING([whether we're compiling from CVS])"); | 578 | ts.WriteLine("AC_MSG_CHECKING([whether we're compiling from CVS])"); |
579 | ts.WriteLine("if test -f \"$srcdir/.cvs_version\" ; then"); | 579 | ts.WriteLine("if test -f \"$srcdir/.cvs_version\" ; then"); |
580 | ts.WriteLine(" from_cvs=yes"); | 580 | ts.WriteLine(" from_cvs=yes"); |
581 | ts.WriteLine("else"); | 581 | ts.WriteLine("else"); |
582 | ts.WriteLine(" if test -f \"$srcdir/.svn\" ; then"); | 582 | ts.WriteLine(" if test -f \"$srcdir/.svn\" ; then"); |
583 | ts.WriteLine(" from_cvs=yes"); | 583 | ts.WriteLine(" from_cvs=yes"); |
584 | ts.WriteLine(" else"); | 584 | ts.WriteLine(" else"); |
585 | ts.WriteLine(" from_cvs=no"); | 585 | ts.WriteLine(" from_cvs=no"); |
586 | ts.WriteLine(" fi"); | 586 | ts.WriteLine(" fi"); |
587 | ts.WriteLine("fi"); | 587 | ts.WriteLine("fi"); |
588 | ts.WriteLine(); | 588 | ts.WriteLine(); |
589 | ts.WriteLine("AC_MSG_RESULT($from_cvs)"); | 589 | ts.WriteLine("AC_MSG_RESULT($from_cvs)"); |
590 | ts.WriteLine(); | 590 | ts.WriteLine(); |
591 | ts.WriteLine("AC_PATH_PROG(MONO, mono)"); | 591 | ts.WriteLine("AC_PATH_PROG(MONO, mono)"); |
592 | ts.WriteLine("AC_PATH_PROG(GMCS, gmcs)"); | 592 | ts.WriteLine("AC_PATH_PROG(GMCS, gmcs)"); |
593 | ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil)"); | 593 | ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil)"); |
594 | ts.WriteLine(); | 594 | ts.WriteLine(); |
595 | ts.WriteLine("AC_MSG_CHECKING([for mono])"); | 595 | ts.WriteLine("AC_MSG_CHECKING([for mono])"); |
596 | ts.WriteLine("dnl if test \"x$MONO\" = \"x\" ; then"); | 596 | ts.WriteLine("dnl if test \"x$MONO\" = \"x\" ; then"); |
597 | ts.WriteLine("dnl AC_MSG_ERROR([Can't find \"mono\" in your PATH])"); | 597 | ts.WriteLine("dnl AC_MSG_ERROR([Can't find \"mono\" in your PATH])"); |
598 | ts.WriteLine("dnl else"); | 598 | ts.WriteLine("dnl else"); |
599 | ts.WriteLine(" AC_MSG_RESULT([found])"); | 599 | ts.WriteLine(" AC_MSG_RESULT([found])"); |
600 | ts.WriteLine("dnl fi"); | 600 | ts.WriteLine("dnl fi"); |
601 | ts.WriteLine(); | 601 | ts.WriteLine(); |
602 | ts.WriteLine("AC_MSG_CHECKING([for gmcs])"); | 602 | ts.WriteLine("AC_MSG_CHECKING([for gmcs])"); |
603 | ts.WriteLine("dnl if test \"x$GMCS\" = \"x\" ; then"); | 603 | ts.WriteLine("dnl if test \"x$GMCS\" = \"x\" ; then"); |
604 | ts.WriteLine("dnl AC_MSG_ERROR([Can't find \"gmcs\" in your PATH])"); | 604 | ts.WriteLine("dnl AC_MSG_ERROR([Can't find \"gmcs\" in your PATH])"); |
605 | ts.WriteLine("dnl else"); | 605 | ts.WriteLine("dnl else"); |
606 | ts.WriteLine(" AC_MSG_RESULT([found])"); | 606 | ts.WriteLine(" AC_MSG_RESULT([found])"); |
607 | ts.WriteLine("dnl fi"); | 607 | ts.WriteLine("dnl fi"); |
608 | ts.WriteLine(); | 608 | ts.WriteLine(); |
609 | //ts.WriteLine("AC_MSG_CHECKING([for gacutil])"); | 609 | //ts.WriteLine("AC_MSG_CHECKING([for gacutil])"); |
610 | //ts.WriteLine("if test \"x$GACUTIL\" = \"x\" ; then"); | 610 | //ts.WriteLine("if test \"x$GACUTIL\" = \"x\" ; then"); |
611 | //ts.WriteLine(" AC_MSG_ERROR([Can't find \"gacutil\" in your PATH])"); | 611 | //ts.WriteLine(" AC_MSG_ERROR([Can't find \"gacutil\" in your PATH])"); |
612 | //ts.WriteLine("else"); | 612 | //ts.WriteLine("else"); |
613 | //ts.WriteLine(" AC_MSG_RESULT([found])"); | 613 | //ts.WriteLine(" AC_MSG_RESULT([found])"); |
614 | //ts.WriteLine("fi"); | 614 | //ts.WriteLine("fi"); |
615 | ts.WriteLine(); | 615 | ts.WriteLine(); |
616 | ts.WriteLine("AC_SUBST(PATH)"); | 616 | ts.WriteLine("AC_SUBST(PATH)"); |
617 | ts.WriteLine("AC_SUBST(LD_LIBRARY_PATH)"); | 617 | ts.WriteLine("AC_SUBST(LD_LIBRARY_PATH)"); |
618 | ts.WriteLine(); | 618 | ts.WriteLine(); |
619 | ts.WriteLine("dnl CSFLAGS=\"-debug -nowarn:1574\""); | 619 | ts.WriteLine("dnl CSFLAGS=\"-debug -nowarn:1574\""); |
620 | ts.WriteLine("CSFLAGS=\"\""); | 620 | ts.WriteLine("CSFLAGS=\"\""); |
621 | ts.WriteLine("AC_SUBST(CSFLAGS)"); | 621 | ts.WriteLine("AC_SUBST(CSFLAGS)"); |
622 | ts.WriteLine(); | 622 | ts.WriteLine(); |
623 | // ts.WriteLine("AC_MSG_CHECKING(--disable-sdl argument)"); | 623 | // ts.WriteLine("AC_MSG_CHECKING(--disable-sdl argument)"); |
624 | // ts.WriteLine("AC_ARG_ENABLE(sdl,"); | 624 | // ts.WriteLine("AC_ARG_ENABLE(sdl,"); |
625 | // ts.WriteLine(" [ --disable-sdl Disable Sdl interface.],"); | 625 | // ts.WriteLine(" [ --disable-sdl Disable Sdl interface.],"); |
626 | // ts.WriteLine(" [disable_sdl=$disableval],"); | 626 | // ts.WriteLine(" [disable_sdl=$disableval],"); |
627 | // ts.WriteLine(" [disable_sdl=\"no\"])"); | 627 | // ts.WriteLine(" [disable_sdl=\"no\"])"); |
628 | // ts.WriteLine("AC_MSG_RESULT($disable_sdl)"); | 628 | // ts.WriteLine("AC_MSG_RESULT($disable_sdl)"); |
629 | // ts.WriteLine("if test \"$disable_sdl\" = \"yes\"; then"); | 629 | // ts.WriteLine("if test \"$disable_sdl\" = \"yes\"; then"); |
630 | // ts.WriteLine(" AC_DEFINE(FEAT_SDL)"); | 630 | // ts.WriteLine(" AC_DEFINE(FEAT_SDL)"); |
631 | // ts.WriteLine("fi"); | 631 | // ts.WriteLine("fi"); |
632 | ts.WriteLine(); | 632 | ts.WriteLine(); |
633 | ts.WriteLine("dnl Find pkg-config"); | 633 | ts.WriteLine("dnl Find pkg-config"); |
634 | ts.WriteLine("AC_PATH_PROG(PKGCONFIG, pkg-config, no)"); | 634 | ts.WriteLine("AC_PATH_PROG(PKGCONFIG, pkg-config, no)"); |
635 | ts.WriteLine("if test \"x$PKG_CONFIG\" = \"xno\"; then"); | 635 | ts.WriteLine("if test \"x$PKG_CONFIG\" = \"xno\"; then"); |
636 | ts.WriteLine(" AC_MSG_ERROR([You need to install pkg-config])"); | 636 | ts.WriteLine(" AC_MSG_ERROR([You need to install pkg-config])"); |
637 | ts.WriteLine("fi"); | 637 | ts.WriteLine("fi"); |
638 | ts.WriteLine(); | 638 | ts.WriteLine(); |
639 | ts.WriteLine("PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)"); | 639 | ts.WriteLine("PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)"); |
640 | ts.WriteLine("BUILD_DIR=\"bin\""); | 640 | ts.WriteLine("BUILD_DIR=\"bin\""); |
641 | ts.WriteLine("AC_SUBST(BUILD_DIR)"); | 641 | ts.WriteLine("AC_SUBST(BUILD_DIR)"); |
642 | ts.WriteLine("CONFIG=\"Release\""); | 642 | ts.WriteLine("CONFIG=\"Release\""); |
643 | ts.WriteLine("AC_SUBST(CONFIG)"); | 643 | ts.WriteLine("AC_SUBST(CONFIG)"); |
644 | ts.WriteLine(); | 644 | ts.WriteLine(); |
645 | ts.WriteLine("if test \"x$has_mono\" = \"xtrue\"; then"); | 645 | ts.WriteLine("if test \"x$has_mono\" = \"xtrue\"; then"); |
646 | ts.WriteLine(" AC_PATH_PROG(RUNTIME, mono, no)"); | 646 | ts.WriteLine(" AC_PATH_PROG(RUNTIME, mono, no)"); |
647 | ts.WriteLine(" AC_PATH_PROG(CSC, gmcs, no)"); | 647 | ts.WriteLine(" AC_PATH_PROG(CSC, gmcs, no)"); |
648 | ts.WriteLine(" if test `uname -s` = \"Darwin\"; then"); | 648 | ts.WriteLine(" if test `uname -s` = \"Darwin\"; then"); |
649 | ts.WriteLine(" LIB_PREFIX="); | 649 | ts.WriteLine(" LIB_PREFIX="); |
650 | ts.WriteLine(" LIB_SUFFIX=.dylib"); | 650 | ts.WriteLine(" LIB_SUFFIX=.dylib"); |
651 | ts.WriteLine(" else"); | 651 | ts.WriteLine(" else"); |
652 | ts.WriteLine(" LIB_PREFIX=.so"); | 652 | ts.WriteLine(" LIB_PREFIX=.so"); |
653 | ts.WriteLine(" LIB_SUFFIX="); | 653 | ts.WriteLine(" LIB_SUFFIX="); |
654 | ts.WriteLine(" fi"); | 654 | ts.WriteLine(" fi"); |
655 | ts.WriteLine("else"); | 655 | ts.WriteLine("else"); |
656 | ts.WriteLine(" AC_PATH_PROG(CSC, csc.exe, no)"); | 656 | ts.WriteLine(" AC_PATH_PROG(CSC, csc.exe, no)"); |
657 | ts.WriteLine(" if test x$CSC = \"xno\"; then"); | 657 | ts.WriteLine(" if test x$CSC = \"xno\"; then"); |
658 | ts.WriteLine(" AC_MSG_ERROR([You need to install either mono or .Net])"); | 658 | ts.WriteLine(" AC_MSG_ERROR([You need to install either mono or .Net])"); |
659 | ts.WriteLine(" else"); | 659 | ts.WriteLine(" else"); |
660 | ts.WriteLine(" RUNTIME="); | 660 | ts.WriteLine(" RUNTIME="); |
661 | ts.WriteLine(" LIB_PREFIX="); | 661 | ts.WriteLine(" LIB_PREFIX="); |
662 | ts.WriteLine(" LIB_SUFFIX=.dylib"); | 662 | ts.WriteLine(" LIB_SUFFIX=.dylib"); |
663 | ts.WriteLine(" fi"); | 663 | ts.WriteLine(" fi"); |
664 | ts.WriteLine("fi"); | 664 | ts.WriteLine("fi"); |
665 | ts.WriteLine(); | 665 | ts.WriteLine(); |
666 | ts.WriteLine("AC_SUBST(LIB_PREFIX)"); | 666 | ts.WriteLine("AC_SUBST(LIB_PREFIX)"); |
667 | ts.WriteLine("AC_SUBST(LIB_SUFFIX)"); | 667 | ts.WriteLine("AC_SUBST(LIB_SUFFIX)"); |
668 | ts.WriteLine(); | 668 | ts.WriteLine(); |
669 | ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_CFLAGS)"); | 669 | ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_CFLAGS)"); |
670 | ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_LIBS)"); | 670 | ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_LIBS)"); |
671 | ts.WriteLine(); | 671 | ts.WriteLine(); |
672 | ts.WriteLine("dnl Find monodoc"); | 672 | ts.WriteLine("dnl Find monodoc"); |
673 | ts.WriteLine("MONODOC_REQUIRED_VERSION=1.0"); | 673 | ts.WriteLine("MONODOC_REQUIRED_VERSION=1.0"); |
674 | ts.WriteLine("AC_SUBST(MONODOC_REQUIRED_VERSION)"); | 674 | ts.WriteLine("AC_SUBST(MONODOC_REQUIRED_VERSION)"); |
675 | ts.WriteLine("PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, enable_monodoc=yes, enable_monodoc=no)"); | 675 | ts.WriteLine("PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, enable_monodoc=yes, enable_monodoc=no)"); |
676 | ts.WriteLine(); | 676 | ts.WriteLine(); |
677 | ts.WriteLine("if test \"x$enable_monodoc\" = \"xyes\"; then"); | 677 | ts.WriteLine("if test \"x$enable_monodoc\" = \"xyes\"; then"); |
678 | ts.WriteLine(" AC_PATH_PROG(MONODOC, monodoc, no)"); | 678 | ts.WriteLine(" AC_PATH_PROG(MONODOC, monodoc, no)"); |
679 | ts.WriteLine(" if test x$MONODOC = xno; then"); | 679 | ts.WriteLine(" if test x$MONODOC = xno; then"); |
680 | ts.WriteLine(" enable_monodoc=no"); | 680 | ts.WriteLine(" enable_monodoc=no"); |
681 | ts.WriteLine(" fi"); | 681 | ts.WriteLine(" fi"); |
682 | ts.WriteLine("else"); | 682 | ts.WriteLine("else"); |
683 | ts.WriteLine(" MONODOC="); | 683 | ts.WriteLine(" MONODOC="); |
684 | ts.WriteLine("fi"); | 684 | ts.WriteLine("fi"); |
685 | ts.WriteLine(); | 685 | ts.WriteLine(); |
686 | ts.WriteLine("AC_SUBST(MONODOC)"); | 686 | ts.WriteLine("AC_SUBST(MONODOC)"); |
687 | ts.WriteLine("AM_CONDITIONAL(ENABLE_MONODOC, test \"x$enable_monodoc\" = \"xyes\")"); | 687 | ts.WriteLine("AM_CONDITIONAL(ENABLE_MONODOC, test \"x$enable_monodoc\" = \"xyes\")"); |
688 | ts.WriteLine(); | 688 | ts.WriteLine(); |
689 | ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil, no)"); | 689 | ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil, no)"); |
690 | ts.WriteLine("if test \"x$GACUTIL\" = \"xno\" ; then"); | 690 | ts.WriteLine("if test \"x$GACUTIL\" = \"xno\" ; then"); |
691 | ts.WriteLine(" AC_MSG_ERROR([No gacutil tool found])"); | 691 | ts.WriteLine(" AC_MSG_ERROR([No gacutil tool found])"); |
692 | ts.WriteLine("fi"); | 692 | ts.WriteLine("fi"); |
693 | ts.WriteLine(); | 693 | ts.WriteLine(); |
694 | // foreach(ProjectNode project in solution.ProjectsTableOrder) | 694 | // foreach(ProjectNode project in solution.ProjectsTableOrder) |
695 | // { | 695 | // { |
696 | // if (project.Type == ProjectType.Library) | 696 | // if (project.Type == ProjectType.Library) |
697 | // { | 697 | // { |
698 | // } | 698 | // } |
699 | // } | 699 | // } |
700 | ts.WriteLine("GACUTIL_FLAGS='/package $(PACKAGE_NAME) /gacdir $(DESTDIR)$(prefix)'"); | 700 | ts.WriteLine("GACUTIL_FLAGS='/package $(PACKAGE_NAME) /gacdir $(DESTDIR)$(prefix)'"); |
701 | ts.WriteLine("AC_SUBST(GACUTIL_FLAGS)"); | 701 | ts.WriteLine("AC_SUBST(GACUTIL_FLAGS)"); |
702 | ts.WriteLine(); | 702 | ts.WriteLine(); |
703 | ts.WriteLine("winbuild=no"); | 703 | ts.WriteLine("winbuild=no"); |
704 | ts.WriteLine("case \"$host\" in"); | 704 | ts.WriteLine("case \"$host\" in"); |
705 | ts.WriteLine(" *-*-mingw*|*-*-cygwin*)"); | 705 | ts.WriteLine(" *-*-mingw*|*-*-cygwin*)"); |
706 | ts.WriteLine(" winbuild=yes"); | 706 | ts.WriteLine(" winbuild=yes"); |
707 | ts.WriteLine(" ;;"); | 707 | ts.WriteLine(" ;;"); |
708 | ts.WriteLine("esac"); | 708 | ts.WriteLine("esac"); |
709 | ts.WriteLine("AM_CONDITIONAL(WINBUILD, test x$winbuild = xyes)"); | 709 | ts.WriteLine("AM_CONDITIONAL(WINBUILD, test x$winbuild = xyes)"); |
710 | ts.WriteLine(); | 710 | ts.WriteLine(); |
711 | // ts.WriteLine("dnl Check for SDL"); | 711 | // ts.WriteLine("dnl Check for SDL"); |
712 | // ts.WriteLine(); | 712 | // ts.WriteLine(); |
713 | // ts.WriteLine("AC_PATH_PROG([SDL_CONFIG], [sdl-config])"); | 713 | // ts.WriteLine("AC_PATH_PROG([SDL_CONFIG], [sdl-config])"); |
714 | // ts.WriteLine("have_sdl=no"); | 714 | // ts.WriteLine("have_sdl=no"); |
715 | // ts.WriteLine("if test -n \"${SDL_CONFIG}\"; then"); | 715 | // ts.WriteLine("if test -n \"${SDL_CONFIG}\"; then"); |
716 | // ts.WriteLine(" have_sdl=yes"); | 716 | // ts.WriteLine(" have_sdl=yes"); |
717 | // ts.WriteLine(" SDL_CFLAGS=`$SDL_CONFIG --cflags`"); | 717 | // ts.WriteLine(" SDL_CFLAGS=`$SDL_CONFIG --cflags`"); |
718 | // ts.WriteLine(" SDL_LIBS=`$SDL_CONFIG --libs`"); | 718 | // ts.WriteLine(" SDL_LIBS=`$SDL_CONFIG --libs`"); |
719 | // ts.WriteLine(" #"); | 719 | // ts.WriteLine(" #"); |
720 | // ts.WriteLine(" # sdl-config sometimes emits an rpath flag pointing at its library"); | 720 | // ts.WriteLine(" # sdl-config sometimes emits an rpath flag pointing at its library"); |
721 | // ts.WriteLine(" # installation directory. We don't want this, as it prevents users from"); | 721 | // ts.WriteLine(" # installation directory. We don't want this, as it prevents users from"); |
722 | // ts.WriteLine(" # linking sdl-viewer against, for example, a locally compiled libGL when a"); | 722 | // ts.WriteLine(" # linking sdl-viewer against, for example, a locally compiled libGL when a"); |
723 | // ts.WriteLine(" # version of the library also exists in SDL's library installation"); | 723 | // ts.WriteLine(" # version of the library also exists in SDL's library installation"); |
724 | // ts.WriteLine(" # directory, typically /usr/lib."); | 724 | // ts.WriteLine(" # directory, typically /usr/lib."); |
725 | // ts.WriteLine(" #"); | 725 | // ts.WriteLine(" #"); |
726 | // ts.WriteLine(" SDL_LIBS=`echo $SDL_LIBS | sed 's/-Wl,-rpath,[[^ ]]* //'`"); | 726 | // ts.WriteLine(" SDL_LIBS=`echo $SDL_LIBS | sed 's/-Wl,-rpath,[[^ ]]* //'`"); |
727 | // ts.WriteLine("fi"); | 727 | // ts.WriteLine("fi"); |
728 | // ts.WriteLine("AC_SUBST([SDL_CFLAGS])"); | 728 | // ts.WriteLine("AC_SUBST([SDL_CFLAGS])"); |
729 | // ts.WriteLine("AC_SUBST([SDL_LIBS])"); | 729 | // ts.WriteLine("AC_SUBST([SDL_LIBS])"); |
730 | ts.WriteLine(); | 730 | ts.WriteLine(); |
731 | ts.WriteLine("AC_OUTPUT(["); | 731 | ts.WriteLine("AC_OUTPUT(["); |
732 | ts.WriteLine("Makefile"); | 732 | ts.WriteLine("Makefile"); |
733 | // TODO: this does not work quite right. | 733 | // TODO: this does not work quite right. |
734 | //ts.WriteLine("Properties/AssemblyInfo.cs"); | 734 | //ts.WriteLine("Properties/AssemblyInfo.cs"); |
735 | foreach(ProjectNode project in solution.ProjectsTableOrder) | 735 | foreach(ProjectNode project in solution.ProjectsTableOrder) |
736 | { | 736 | { |
737 | if (project.Type == ProjectType.Library) | 737 | if (project.Type == ProjectType.Library) |
738 | { | 738 | { |
739 | ts.WriteLine(project.Name + ".pc"); | 739 | ts.WriteLine(project.Name + ".pc"); |
740 | } | 740 | } |
741 | // string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); | 741 | // string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); |
742 | // ts.WriteLine(Helper.NormalizePath(Helper.MakeFilePath(path, "Include"),'/')); | 742 | // ts.WriteLine(Helper.NormalizePath(Helper.MakeFilePath(path, "Include"),'/')); |
743 | } | 743 | } |
744 | ts.WriteLine("])"); | 744 | ts.WriteLine("])"); |
745 | ts.WriteLine(); | 745 | ts.WriteLine(); |
746 | ts.WriteLine("#po/Makefile.in"); | 746 | ts.WriteLine("#po/Makefile.in"); |
747 | ts.WriteLine(); | 747 | ts.WriteLine(); |
748 | ts.WriteLine("echo \"---\""); | 748 | ts.WriteLine("echo \"---\""); |
749 | ts.WriteLine("echo \"Configuration summary\""); | 749 | ts.WriteLine("echo \"Configuration summary\""); |
750 | ts.WriteLine("echo \"\""); | 750 | ts.WriteLine("echo \"\""); |
751 | ts.WriteLine("echo \" * Installation prefix: $prefix\""); | 751 | ts.WriteLine("echo \" * Installation prefix: $prefix\""); |
752 | ts.WriteLine("echo \" * compiler: $CSC\""); | 752 | ts.WriteLine("echo \" * compiler: $CSC\""); |
753 | ts.WriteLine("echo \" * Documentation: $enable_monodoc ($MONODOC)\""); | 753 | ts.WriteLine("echo \" * Documentation: $enable_monodoc ($MONODOC)\""); |
754 | ts.WriteLine("echo \" * Package Name: $PACKAGE_NAME\""); | 754 | ts.WriteLine("echo \" * Package Name: $PACKAGE_NAME\""); |
755 | ts.WriteLine("echo \" * Version: $PACKAGE_VERSION\""); | 755 | ts.WriteLine("echo \" * Version: $PACKAGE_VERSION\""); |
756 | ts.WriteLine("echo \" * Public Key: $PUBKEY\""); | 756 | ts.WriteLine("echo \" * Public Key: $PUBKEY\""); |
757 | ts.WriteLine("echo \"\""); | 757 | ts.WriteLine("echo \"\""); |
758 | ts.WriteLine("echo \"---\""); | 758 | ts.WriteLine("echo \"---\""); |
759 | ts.WriteLine(); | 759 | ts.WriteLine(); |
760 | } | 760 | } |
761 | 761 | ||
762 | ts.NewLine = "\n"; | 762 | ts.NewLine = "\n"; |
763 | foreach (ProjectNode project in solution.ProjectsTableOrder) | 763 | foreach (ProjectNode project in solution.ProjectsTableOrder) |
764 | { | 764 | { |
765 | if (project.GenerateAssemblyInfoFile) | 765 | if (project.GenerateAssemblyInfoFile) |
766 | { | 766 | { |
767 | GenerateAssemblyInfoFile(solution, combFile); | 767 | GenerateAssemblyInfoFile(solution, combFile); |
768 | } | 768 | } |
769 | } | 769 | } |
770 | } | 770 | } |
771 | 771 | ||
772 | private static void GenerateAssemblyInfoFile(SolutionNode solution, string combFile) | 772 | private static void GenerateAssemblyInfoFile(SolutionNode solution, string combFile) |
773 | { | 773 | { |
774 | System.IO.Directory.CreateDirectory(Helper.MakePathRelativeTo(solution.FullPath, "Properties")); | 774 | System.IO.Directory.CreateDirectory(Helper.MakePathRelativeTo(solution.FullPath, "Properties")); |
775 | combFile = Helper.MakeFilePath(solution.FullPath + "/Properties/", "AssemblyInfo.cs", "in"); | 775 | combFile = Helper.MakeFilePath(solution.FullPath + "/Properties/", "AssemblyInfo.cs", "in"); |
776 | StreamWriter ai = new StreamWriter(combFile); | 776 | StreamWriter ai = new StreamWriter(combFile); |
777 | 777 | ||
778 | using (ai) | 778 | using (ai) |
779 | { | 779 | { |
780 | ai.WriteLine("#region License"); | 780 | ai.WriteLine("#region License"); |
781 | ai.WriteLine("/*"); | 781 | ai.WriteLine("/*"); |
782 | ai.WriteLine("MIT License"); | 782 | ai.WriteLine("MIT License"); |
783 | ai.WriteLine("Copyright (c)2003-2006 Tao Framework Team"); | 783 | ai.WriteLine("Copyright (c)2003-2006 Tao Framework Team"); |
784 | ai.WriteLine("http://www.taoframework.com"); | 784 | ai.WriteLine("http://www.taoframework.com"); |
785 | ai.WriteLine("All rights reserved."); | 785 | ai.WriteLine("All rights reserved."); |
786 | ai.WriteLine(""); | 786 | ai.WriteLine(""); |
787 | ai.WriteLine("Permission is hereby granted, free of charge, to any person obtaining a copy"); | 787 | ai.WriteLine("Permission is hereby granted, free of charge, to any person obtaining a copy"); |
788 | ai.WriteLine("of this software and associated documentation files (the \"Software\"), to deal"); | 788 | ai.WriteLine("of this software and associated documentation files (the \"Software\"), to deal"); |
789 | ai.WriteLine("in the Software without restriction, including without limitation the rights"); | 789 | ai.WriteLine("in the Software without restriction, including without limitation the rights"); |
790 | ai.WriteLine("to use, copy, modify, merge, publish, distribute, sublicense, and/or sell"); | 790 | ai.WriteLine("to use, copy, modify, merge, publish, distribute, sublicense, and/or sell"); |
791 | ai.WriteLine("copies of the Software, and to permit persons to whom the Software is"); | 791 | ai.WriteLine("copies of the Software, and to permit persons to whom the Software is"); |
792 | ai.WriteLine("furnished to do so, subject to the following conditions:"); | 792 | ai.WriteLine("furnished to do so, subject to the following conditions:"); |
793 | ai.WriteLine(""); | 793 | ai.WriteLine(""); |
794 | ai.WriteLine("The above copyright notice and this permission notice shall be included in all"); | 794 | ai.WriteLine("The above copyright notice and this permission notice shall be included in all"); |
795 | ai.WriteLine("copies or substantial portions of the Software."); | 795 | ai.WriteLine("copies or substantial portions of the Software."); |
796 | ai.WriteLine(""); | 796 | ai.WriteLine(""); |
797 | ai.WriteLine("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR"); | 797 | ai.WriteLine("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR"); |
798 | ai.WriteLine("IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,"); | 798 | ai.WriteLine("IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,"); |
799 | ai.WriteLine("FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE"); | 799 | ai.WriteLine("FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE"); |
800 | ai.WriteLine("AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER"); | 800 | ai.WriteLine("AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER"); |
801 | ai.WriteLine("LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,"); | 801 | ai.WriteLine("LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,"); |
802 | ai.WriteLine("OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE"); | 802 | ai.WriteLine("OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE"); |
803 | ai.WriteLine("SOFTWARE."); | 803 | ai.WriteLine("SOFTWARE."); |
804 | ai.WriteLine("*/"); | 804 | ai.WriteLine("*/"); |
805 | ai.WriteLine("#endregion License"); | 805 | ai.WriteLine("#endregion License"); |
806 | ai.WriteLine(""); | 806 | ai.WriteLine(""); |
807 | ai.WriteLine("using System;"); | 807 | ai.WriteLine("using System;"); |
808 | ai.WriteLine("using System.Reflection;"); | 808 | ai.WriteLine("using System.Reflection;"); |
809 | ai.WriteLine("using System.Runtime.InteropServices;"); | 809 | ai.WriteLine("using System.Runtime.InteropServices;"); |
810 | ai.WriteLine("using System.Security;"); | 810 | ai.WriteLine("using System.Security;"); |
811 | ai.WriteLine("using System.Security.Permissions;"); | 811 | ai.WriteLine("using System.Security.Permissions;"); |
812 | ai.WriteLine(""); | 812 | ai.WriteLine(""); |
813 | ai.WriteLine("[assembly: AllowPartiallyTrustedCallers]"); | 813 | ai.WriteLine("[assembly: AllowPartiallyTrustedCallers]"); |
814 | ai.WriteLine("[assembly: AssemblyCompany(\"Tao Framework -- http://www.taoframework.com\")]"); | 814 | ai.WriteLine("[assembly: AssemblyCompany(\"Tao Framework -- http://www.taoframework.com\")]"); |
815 | ai.WriteLine("[assembly: AssemblyConfiguration(\"Retail\")]"); | 815 | ai.WriteLine("[assembly: AssemblyConfiguration(\"Retail\")]"); |
816 | ai.WriteLine("[assembly: AssemblyCopyright(\"Copyright (c)2003-2006 Tao Framework Team. All rights reserved.\")]"); | 816 | ai.WriteLine("[assembly: AssemblyCopyright(\"Copyright (c)2003-2006 Tao Framework Team. All rights reserved.\")]"); |
817 | ai.WriteLine("[assembly: AssemblyCulture(\"\")]"); | 817 | ai.WriteLine("[assembly: AssemblyCulture(\"\")]"); |
818 | ai.WriteLine("[assembly: AssemblyDefaultAlias(\"@PACKAGE_NAME@\")]"); | 818 | ai.WriteLine("[assembly: AssemblyDefaultAlias(\"@PACKAGE_NAME@\")]"); |
819 | ai.WriteLine("[assembly: AssemblyDelaySign(false)]"); | 819 | ai.WriteLine("[assembly: AssemblyDelaySign(false)]"); |
820 | ai.WriteLine("[assembly: AssemblyDescription(\"@DESCRIPTION@\")]"); | 820 | ai.WriteLine("[assembly: AssemblyDescription(\"@DESCRIPTION@\")]"); |
821 | ai.WriteLine("[assembly: AssemblyFileVersion(\"@ASSEMBLY_VERSION@\")]"); | 821 | ai.WriteLine("[assembly: AssemblyFileVersion(\"@ASSEMBLY_VERSION@\")]"); |
822 | ai.WriteLine("[assembly: AssemblyInformationalVersion(\"@ASSEMBLY_VERSION@\")]"); | 822 | ai.WriteLine("[assembly: AssemblyInformationalVersion(\"@ASSEMBLY_VERSION@\")]"); |
823 | ai.WriteLine("[assembly: AssemblyKeyName(\"\")]"); | 823 | ai.WriteLine("[assembly: AssemblyKeyName(\"\")]"); |
824 | ai.WriteLine("[assembly: AssemblyProduct(\"@PACKAGE_NAME@.dll\")]"); | 824 | ai.WriteLine("[assembly: AssemblyProduct(\"@PACKAGE_NAME@.dll\")]"); |
825 | ai.WriteLine("[assembly: AssemblyTitle(\"@DESCRIPTION@\")]"); | 825 | ai.WriteLine("[assembly: AssemblyTitle(\"@DESCRIPTION@\")]"); |
826 | ai.WriteLine("[assembly: AssemblyTrademark(\"Tao Framework -- http://www.taoframework.com\")]"); | 826 | ai.WriteLine("[assembly: AssemblyTrademark(\"Tao Framework -- http://www.taoframework.com\")]"); |
827 | ai.WriteLine("[assembly: AssemblyVersion(\"@ASSEMBLY_VERSION@\")]"); | 827 | ai.WriteLine("[assembly: AssemblyVersion(\"@ASSEMBLY_VERSION@\")]"); |
828 | ai.WriteLine("[assembly: CLSCompliant(true)]"); | 828 | ai.WriteLine("[assembly: CLSCompliant(true)]"); |
829 | ai.WriteLine("[assembly: ComVisible(false)]"); | 829 | ai.WriteLine("[assembly: ComVisible(false)]"); |
830 | ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.Execution)]"); | 830 | ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.Execution)]"); |
831 | ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.SkipVerification)]"); | 831 | ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.SkipVerification)]"); |
832 | ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.UnmanagedCode)]"); | 832 | ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.UnmanagedCode)]"); |
833 | 833 | ||
834 | } | 834 | } |
835 | //return combFile; | 835 | //return combFile; |
836 | } | 836 | } |
837 | 837 | ||
838 | private void CleanProject(ProjectNode project) | 838 | private void CleanProject(ProjectNode project) |
839 | { | 839 | { |
840 | m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); | 840 | m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); |
841 | string projectFile = Helper.MakeFilePath(project.FullPath, "Include", "am"); | 841 | string projectFile = Helper.MakeFilePath(project.FullPath, "Include", "am"); |
842 | Helper.DeleteIfExists(projectFile); | 842 | Helper.DeleteIfExists(projectFile); |
843 | } | 843 | } |
844 | 844 | ||
845 | private void CleanSolution(SolutionNode solution) | 845 | private void CleanSolution(SolutionNode solution) |
846 | { | 846 | { |
847 | m_Kernel.Log.Write("Cleaning Autotools make files for", solution.Name); | 847 | m_Kernel.Log.Write("Cleaning Autotools make files for", solution.Name); |
848 | 848 | ||
849 | string slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am"); | 849 | string slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am"); |
850 | Helper.DeleteIfExists(slnFile); | 850 | Helper.DeleteIfExists(slnFile); |
851 | 851 | ||
852 | slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "in"); | 852 | slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "in"); |
853 | Helper.DeleteIfExists(slnFile); | 853 | Helper.DeleteIfExists(slnFile); |
854 | 854 | ||
855 | slnFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac"); | 855 | slnFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac"); |
856 | Helper.DeleteIfExists(slnFile); | 856 | Helper.DeleteIfExists(slnFile); |
857 | 857 | ||
858 | slnFile = Helper.MakeFilePath(solution.FullPath, "configure"); | 858 | slnFile = Helper.MakeFilePath(solution.FullPath, "configure"); |
859 | Helper.DeleteIfExists(slnFile); | 859 | Helper.DeleteIfExists(slnFile); |
860 | 860 | ||
861 | slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile"); | 861 | slnFile = Helper.MakeFilePath(solution.FullPath, "Makefile"); |
862 | Helper.DeleteIfExists(slnFile); | 862 | Helper.DeleteIfExists(slnFile); |
863 | 863 | ||
864 | foreach(ProjectNode project in solution.Projects) | 864 | foreach(ProjectNode project in solution.Projects) |
865 | { | 865 | { |
866 | CleanProject(project); | 866 | CleanProject(project); |
867 | } | 867 | } |
868 | 868 | ||
869 | m_Kernel.Log.Write(""); | 869 | m_Kernel.Log.Write(""); |
870 | } | 870 | } |
871 | 871 | ||
872 | #endregion | 872 | #endregion |
873 | 873 | ||
874 | #region ITarget Members | 874 | #region ITarget Members |
875 | 875 | ||
876 | /// <summary> | 876 | /// <summary> |
877 | /// Writes the specified kern. | 877 | /// Writes the specified kern. |
878 | /// </summary> | 878 | /// </summary> |
879 | /// <param name="kern">The kern.</param> | 879 | /// <param name="kern">The kern.</param> |
880 | public void Write(Kernel kern) | 880 | public void Write(Kernel kern) |
881 | { | 881 | { |
882 | if( kern == null ) | 882 | if( kern == null ) |
883 | { | 883 | { |
884 | throw new ArgumentNullException("kern"); | 884 | throw new ArgumentNullException("kern"); |
885 | } | 885 | } |
886 | m_Kernel = kern; | 886 | m_Kernel = kern; |
887 | foreach(SolutionNode solution in kern.Solutions) | 887 | foreach(SolutionNode solution in kern.Solutions) |
888 | { | 888 | { |
889 | WriteCombine(solution); | 889 | WriteCombine(solution); |
890 | } | 890 | } |
891 | m_Kernel = null; | 891 | m_Kernel = null; |
892 | } | 892 | } |
893 | 893 | ||
894 | /// <summary> | 894 | /// <summary> |
895 | /// Cleans the specified kern. | 895 | /// Cleans the specified kern. |
896 | /// </summary> | 896 | /// </summary> |
897 | /// <param name="kern">The kern.</param> | 897 | /// <param name="kern">The kern.</param> |
898 | public virtual void Clean(Kernel kern) | 898 | public virtual void Clean(Kernel kern) |
899 | { | 899 | { |
900 | if( kern == null ) | 900 | if( kern == null ) |
901 | { | 901 | { |
902 | throw new ArgumentNullException("kern"); | 902 | throw new ArgumentNullException("kern"); |
903 | } | 903 | } |
904 | m_Kernel = kern; | 904 | m_Kernel = kern; |
905 | foreach(SolutionNode sol in kern.Solutions) | 905 | foreach(SolutionNode sol in kern.Solutions) |
906 | { | 906 | { |
907 | CleanSolution(sol); | 907 | CleanSolution(sol); |
908 | } | 908 | } |
909 | m_Kernel = null; | 909 | m_Kernel = null; |
910 | } | 910 | } |
911 | 911 | ||
912 | /// <summary> | 912 | /// <summary> |
913 | /// Gets the name. | 913 | /// Gets the name. |
914 | /// </summary> | 914 | /// </summary> |
915 | /// <value>The name.</value> | 915 | /// <value>The name.</value> |
916 | public string Name | 916 | public string Name |
917 | { | 917 | { |
918 | get | 918 | get |
919 | { | 919 | { |
920 | return "autotools"; | 920 | return "autotools"; |
921 | } | 921 | } |
922 | } | 922 | } |
923 | 923 | ||
924 | #endregion | 924 | #endregion |
925 | } | 925 | } |
926 | } | 926 | } |