From e909c376098c953741a887797561e7e1ca9e3fb4 Mon Sep 17 00:00:00 2001
From: coryan
-Cross-compiling TAO is not much different than building it for
-self-host. The one major difference is that TAO's IDL compiler must
-be built and run on the host; it's not necessary to run it on the
-target. It's easiest to set this up by using a symlink (Unix) or copy
-of
+ Cross-compiling TAO is not much different than building it for
+ self-host. The one major difference is that TAO's IDL compiler
+ must be built and run on the host; it's not necessary to run it
+ on the target.
+ There are several ways to do this, below we document the two
+ most common approaches:
+ By default TAO assumes that the IDL compiler is located in:
+ You can override the default values by adding two lines in your
+ platform_macros.GNU file, as follows:
+tao_idl
(NT). By way of example, here is how I setup
-my Unix (SunOS5, using g++) workspace to support cross-compilation
-(for VxWorks). It assumes that the ACE+TAO distribution has been
-unpacked, with TAO below ACE_wrappers. It uses the
-ACE_wrappers/bin/create_ace_build script to create a shadow build
-tree:Modifying the default location for the IDL compiler
+
+ $TAO_ROOT/TAO_IDL/tao_idl
and that the GPERF tool
+ is located in $ACE_ROOT/bin/gperf
, this is fine for
+ hosted builds, but not for cross-compilation.
+ Unfortunately there is no good default for cross-compilation
+ builds because different sites choose a different location for
+ their tools.
+
+$ echo 'TAO_IDL := /your/path/tao_idl' \
+ >> platform_macros.GNU
+$ echo 'TAO_IDLFLAGS := -g /your/path/gperf' \
+
+
You could even use: +
+$ echo 'TAO_IDL := tao_idl' \ + >> platform_macros.GNU +$ echo 'TAO_IDLFLAGS := -g gperf' \ ++ if the tools are in your path. + + +
Obviously you must first build the tools for the host platform, + typically you would do this as follows: +
+# (1) Create a clone directory for the host: + +$ cd ACE_wrappers +$ mkdir -p build/HOST +$ ./bin/create_ace_build build/HOST + +# (2) Configure the host build: + +$ echo '#include "ace/config-HOST.h"' > build/HOST/ace/config.h +$ echo 'include $(ACE_ROOT)/include/makeinclude/platform_HOST.GNU' \ + > build/HOST/include/makeinclude/platform_macros.GNU + +# Often host builds are static: +$ echo 'static_libs_only=1' \ + >> build/HOST/include/makeinclude/platform_macros.GNU + +# (3) Build the host tools + +$ cd build/HOST +$ export ACE_ROOT=$PWD +$ make -C ace +$ make -C apps/gperf +$ make -C TAO/TAO_IDL ++ +
Then configuring the location of the tools for the target + could be done as shown here: +
+# (4) Create a clone directory for the target: + +$ cd ACE_wrappers +$ mkdir -p build/TARGET +$ ./bin/create_ace_build build/TARGET + +# (5) Configure the target build: + +$ echo '#include "ace/config-TARGET.h"' > build/HOST/ace/config.h +$ echo 'include $(ACE_ROOT)/include/makeinclude/platform_TARGET.GNU' \ + > build/TARGET/include/makeinclude/platform_macros.GNU + +# (6) Configure the TARGET build to use the HOST IDL compiler and +# gperf tools, as described above. ++ +
Some developers prefer to set up the host tools using symbolic
+ links (Unix) or copy of tao_idl
(NT).
+ By way of example, here is how you could setup a
+ croos-compilation environment for Unix,
+ the host is SunOS5/g++
,
+ the target is VxWorks
.
+ It assumes that the ACE+TAO distribution has been
+ unpacked, with TAO below ACE_wrappers. It uses the
+ ACE_wrappers/bin/create_ace_build script to create a shadow
+ build
+ tree:
cd ACE_wrappers
bin/create_ace_build SunOS5_g++
@@ -149,9 +234,10 @@ tree:
cd build/vxworks/TAO
/bin/rm -r TAO_IDL
ln -s ../../SunOS5_g++/TAO/TAO_IDL
-+ +
-To build on the host: +To build on the host:
cd build/SunOS5_g++
export ACE_ROOT=`pwd`;
@@ -162,24 +248,38 @@ To build on the host:
export ACE_ROOT=`pwd`
(cd ace; make && cd ../tests; make && cd ../TAO; make) >
make.log
-
- -For NT hosts, please see the detailed instructions for building and -installing ACE and TAO in ../ACE-INSTALL.html. For -NT hosts, see Building -ACE on Tornado/NT hosts for VxWorks targets
- -Please note that dynamic loading of libraries is not supported by TAO -for any cross-compiled target. Therefore, dynamic service -configuration of the TAO ORB is not supported.
-
-If using perfect hashing, TAO_IDL needs gperf to be built on the host.
-That's the default on many platforms. First, build gperf
-in the ACE_wrappers/apps/gperf/src/
directory. Then, add
-a symlink or copy to the bin/
directory for the
-target.
- +
+ +For NT hosts, please see the detailed instructions for building + and installing ACE and TAO in + ../ACE-INSTALL.html, + and + Building ACE on + Tornado/NT hosts for VxWorks targets +
+ +Please note that dynamic loading of libraries is not supported + by TAO for any cross-compiled target. Therefore, dynamic + service configuration of the TAO ORB is not supported. +
+ +If using perfect hashing, TAO_IDL needs gperf to be built on
+ the host. That's the default on many platforms. First, build
+ gperf
in the
+ ACE_wrappers/apps/gperf/src/
directory. Then, add
+ a symlink or copy to the bin/
directory for the
+ target.
+
Using links to cross-compile TAO may appear simpler at first
+ glance. However, storing the location in the
+ platform_macros.GNU
is more amenable for
+ sites where many developers share the same configuration files,
+ or where ACE+TAO are compiled once and used by a medium or large
+ size group.
+