summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cleeland <chris.cleeland@gmail.com>2010-07-23 21:50:04 +0000
committerChris Cleeland <chris.cleeland@gmail.com>2010-07-23 21:50:04 +0000
commit7db7f7f2591f95247d60ba3c52a724723ce1bec3 (patch)
tree17f2f1d58abff54db256a1d9c5b9ac0624293ffe
parent0b3fcc5ef4677f0ec63ef49b8cad9442594e2778 (diff)
downloadMPC-7db7f7f2591f95247d60ba3c52a724723ce1bec3.tar.gz
Merge out cross-compile and PIC changes from branch. Still experimental.
-rw-r--r--ChangeLog19
-rw-r--r--docs/html/CDT6.html82
-rw-r--r--templates/cdt6cproject.mpd14
-rw-r--r--templates/cdt6dll.mpt1
-rw-r--r--templates/cdt6platforms.mpt16
5 files changed, 114 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 282ed39a..70ed3f09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+Wed Jul 21 20:34:03 UTC 2010 Chris Cleeland <cleeland@ociweb.com>
+
+ Merge out the following changes from the eclipse branch:
+
+ * templates/cdt6cproject.mpd:
+ * templates/cdt6dll.mpt:
+ * templates/cdt6platforms.mpt:
+
+ Initial work for supporting a cross-compile platform. Fix for RT
+ 14228 related to the lack of -fPIC option.
+
+ * templates/cdt6cproject.mpd, templates/cdt6platforms.mpt:
+
+ Fixed issue where linker exe names could not be overridden.
+
+ * docs/html/CDT6.html:
+
+ Update documentation.
+
Wed Jul 14 05:00:11 UTC 2010 James H. Hill <hillj at cs dot iupui dot edu>
* config/wix.mpb:
diff --git a/docs/html/CDT6.html b/docs/html/CDT6.html
index adf53cda..32a011ec 100644
--- a/docs/html/CDT6.html
+++ b/docs/html/CDT6.html
@@ -158,18 +158,78 @@ $ mwc.pl -type cdt6 TAO_ACE.mwc
projects. If you didn't uncheck <strong>Build
Automatically</strong>, then builds will start. Regardless, the
C++ indexer will run in the background across the source of all projects.</li>
+ </ol>
+
+ <h4>Building A Project</h4>
+ To build a project or set of projects, select the project (or
+ projects) in the <em>Project</em> pane, then select
+ <strong>Project->Build Project</strong>. Eclipse will evaluate
+ <em>ALL</em> dependencies automatically, though not necessarily
+ quickly.
+ <p>
+ <em>Hint:</em> a good choice to get all of ACE/TAO built is to
+ choose the <em>Naming Service</em> project.
- <h4>Building A Project</h4>
- To build a project or set of projects, select the project (or
- projects) in the <em>Project</em> pane, then select
- <strong>Project->Build Project</strong>. Eclipse will evaluate
- <em>ALL</em> dependencies automatically, though not necessarily
- quickly.
- <p>
- <em>Hint:</em> a good choice to get all of ACE/TAO built is to
- choose the <em>Naming Service</em> project.
- </div>
+</div>
+<div>
+ <h3 class="Head2">Multiple Platforms</h3>
+ Just as a project created within CDT can be set up to support
+ multiple platforms, so too can projects generated via MPC. To the
+ extent possible, the platforms are represented in generated projects
+ in the same way as they are in "native" projects (though there will
+ be some differences).
+
+ <h4>Generating Projects with Multiple Platform Support</h4>
+ <p>
+ Platforms are named in a list called <samp>platforms</samp> in the
+ CDT6 template (much like other MPC templates). The list defaults to
+ the platform on which <samp>mwc.pl</samp> is run. To generate for
+ another platforms, or for additional platforms, you must provide
+ <samp>platforms</samp> with the list of platforms to generate.
+ </p>
+ <p>
+ Generate projects using a similar incantation to the default (from
+ above) using <samp>-type cdt6</samp> and <samp>-value_template
+ platform="&lt;platform_list&gt;"</samp>, insuring the
+ use of <samp>mwc.pl</samp> from within ACE, e.g.,
+ <blockquote><pre>
+$ cd $TAO_ROOT
+$ mwc.pl -type cdt6 -value_template platforms="linux cellppu" TAO_ACE.mwc
+</pre></blockquote>
+ </p>
+ <p>
+ Platforms are defined as scopes in <tt>templates/cdt6platforms.mpt</tt>.
+ </p>
+
+ <h4>Cross-Compilation</h4>
+ <p>
+ Cross-compilation is handled the same as a platform; the target is
+ the platform. If you want to generate for cross-compilation, the
+ cross-compiler information must be defined in a scope (typically
+ named for the target type) in
+ <tt>templates/cdt6platforms.mpt</tt>. If a scope does not exist for
+ the target, follow <a href="#addplatform">the instructions for adding
+ a new platform.</a>
+ </p>
+ <p>
+ In the example given above, <samp>cellppu</samp> is the name of the
+ platform for cross-compilation.
+ </p>
+
+ <h4>Adding a New Platform<a name="addplatform"></a></h4>
+ To add a new platform, particularly one for cross-compilation, it's
+ probably easiest to start from an existing scope, e.g.,
+ <samp>cellppu</samp>. For cross-compilation where the cross-compiler
+ toolchain is GNU Compiler-based, you will need to provide the names
+ of the various executables in the toolchain in the values
+ <samp>as</samp>, <samp>ar</samp>, <samp>cc</samp>, and
+ <samp>cxx</samp>. And, optionally, <samp>ccld</samp> and/or
+ <samp>cxxld</samp> if the linker used for linking C and C++
+ executables, respectively, is different from the respective
+ compiler. CDT expects these to be in the path.
+
+</div>
<div>
<h3 class="Head2">Notes</h3>
<ol>
@@ -224,5 +284,5 @@ $ mwc.pl -type cdt6 TAO_ACE.mwc
<hr>
<address></address>
-<!-- hhmts start --> Last modified: Sun Jun 27 21:00:32 CDT 2010 <!-- hhmts end -->
+<!-- hhmts start --> Last modified: Thu Jul 22 11:14:15 CDT 2010 <!-- hhmts end -->
</body> </html>
diff --git a/templates/cdt6cproject.mpd b/templates/cdt6cproject.mpd
index abc1fad6..9a00ac49 100644
--- a/templates/cdt6cproject.mpd
+++ b/templates/cdt6cproject.mpd
@@ -78,12 +78,12 @@
<%if(custom_only)%>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.<%platform%>.<%configuration%>" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs" />
<%else%>
-<tool id="<%c_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>.1311461244" name="<%tool_name_prefix%> C Linker" superClass="<%c_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>">
+<tool <%if(ccld)%>command="<%ccld%>"<%else%><%if(cc)%>command="<%cc%>"<%endif%><%endif%> id="<%c_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>.1311461244" name="<%tool_name_prefix%> C Linker" superClass="<%c_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>">
<%if(type_is_dynamic)%>
<option defaultValue="true" id="<%c_linker_dynamiclib_superclass%>.1" name="Shared/Dynamic" superClass="<%c_linker_dynamiclib_superclass%>" valueType="boolean"/>
<%endif%>
</tool>
-<tool id="<%cpp_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>.335515345" name="<%tool_name_prefix%> C++ Linker" superClass="<%cpp_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>">
+<tool <%if(cxxld)%>command="<%cxxld%>"<%else%><%if(cxx)%>command="<%cxx%>"<%endif%><%endif%> id="<%cpp_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>.335515345" name="<%tool_name_prefix%> C++ Linker" superClass="<%cpp_linker_tool_superclass_root%>.<%project_type%>.<%configuration%>">
<option id="mpc.generated.link.libpaths.1" superClass="<%linker_option_superclass%>.paths" valueType="libPaths">
<%foreach(libpaths)%>
<listOptionValue builtIn="false" value="<%if(!starts_with(libpath, [/\\\$]))%>../../<%endif%><%translate_vars(libpath, 1)%>"/>
@@ -106,17 +106,17 @@
<outputType id="mpc.generated.cpp.linker.output.so.1" outputPrefix="<%lib_prefix%>" superClass="<%outputtype_superclass%>"/>
<%endif%>
</tool>
-<tool id="cdt.managedbuild.tool.gnu.assembler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.897965604" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>">
+<tool <%if(as)%>command="<%as%>"<%endif%> id="cdt.managedbuild.tool.gnu.assembler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.897965604" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.706221217" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
-<tool id="cdt.managedbuild.tool.gnu.archiver.<%if(platform_specializer)%><%platform_specializer%>.<%endif%>base.134329701" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.<%if(platform_specializer)%><%platform_specializer%>.<%endif%>base"/>
-<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.1373363011" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>">
+<tool <%if(ar)%>command="<%ar%>"<%endif%> id="cdt.managedbuild.tool.gnu.archiver.<%if(platform_specializer)%><%platform_specializer%>.<%endif%>base.134329701" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.<%if(platform_specializer)%><%platform_specializer%>.<%endif%>base"/>
+<tool <%if(cxx)%>command="<%cxx%>"<%endif%> id="cdt.managedbuild.tool.gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.1373363011" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>">
<option id="mpc.generated.cc.include.paths.1" superClass="<%cpp_compiler_option_superclass%>.include.paths" valueType="includePath">
<%foreach(includes)%>
<listOptionValue builtIn="false" value="<%if(!starts_with(include, [/\\\$]))%>../../<%endif%><%translate_vars(include, 1)%>"/>
<%endfor%>
</option>
-<option id="gnu.cpp.compiler.option.other.other.375481234" superClass="gnu.cpp.compiler.option.other.other" value="-c <%comment(here's where we can put in all the extra compiler flags)%><%cxxflags%><%if(use_threads)%> <%threadflags%><%endif%>" valueType="string"/>
+<option id="gnu.cpp.compiler.option.other.other.375481234" superClass="gnu.cpp.compiler.option.other.other" value="-c <%comment(here's where we can put in all the extra compiler flags)%><%cxxflags%><%if(use_threads)%> <%threadflags%><%endif%><%if(dll_ext && pic)%><%pic%><%endif%>" valueType="string"/>
<option id="gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.optimization.level.886842330" name="Optimization Level" superClass="gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.optimization.level" value="gnu.cpp.compiler.optimization.level.<%optimization_level%>" valueType="enumerated"/>
<option id="gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.debugging.level.63360527" name="Debug Level" superClass="gnu.cpp.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.option.debugging.level" value="gnu.cpp.compiler.debugging.level.<%debugging_level%>" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.preprocessor.def.1310953196" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
@@ -137,7 +137,7 @@
-->
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1095450641" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
-<tool id="cdt.managedbuild.tool.gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.1634417374" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>">
+<tool <%if(cc)%>command="<%cc%>"<%endif%> id="cdt.managedbuild.tool.gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>.1634417374" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.<%if(platform_specializer)%><%platform_specializer%>.<%endif%><%project_type%>.<%configuration%>">
<option id="mpc.generated.c.compiler.option.include.paths.1" superClass="<%c_compiler_option_superclass%>.include.paths" valueType="includePath">
<%foreach(includes)%>
<listOptionValue builtIn="false" value="<%if(!starts_with(include, [/\\\$]))%>../../<%endif%><%translate_vars(include, 1)%>"/>
diff --git a/templates/cdt6dll.mpt b/templates/cdt6dll.mpt
index 31234ce6..a0a3d41f 100644
--- a/templates/cdt6dll.mpt
+++ b/templates/cdt6dll.mpt
@@ -7,3 +7,4 @@ configurations = debug release
project_type_name = "Shared Library"
project_type = so
build_artefact_type = org.eclipse.cdt.build.core.buildArtefactType.sharedLib
+pic = -fPIC
diff --git a/templates/cdt6platforms.mpt b/templates/cdt6platforms.mpt
index c8c93f29..670af60a 100644
--- a/templates/cdt6platforms.mpt
+++ b/templates/cdt6platforms.mpt
@@ -48,6 +48,22 @@ linux {
platform_libs += rt dl
}
+// cellppu is an example for how to do a cross-compile (or, really, any compile using
+// tools with non-standard names).
+cellppu {
+ as = ppu-as
+ ar = ppu-ar
+ cc = ppu-gcc
+ // can set ccld to name of C Linker if different from cc
+ cxx = ppu-g++
+ // can set cxxld to name of C++ Linker if different from cxx
+
+ binary_parsers = org.eclipse.cdt.core.ELF
+ error_parsers = org.eclipse.cdt.core.GASErrorParser org.eclipse.cdt.core.GLDErrorParser org.eclipse.cdt.core.GCCErrorParser
+ threadflags = -pthread
+ platform_libs += rt dl
+}
+
// This scope serves as an example of a custom platform. On 64-bit linux,
// you can compile a 32-bit binary by passing -m32 to gcc. Using this custom
// platform, MPC can generate CDT projects that have "Build Configurations"