From 464ec99a629f72fce28b39cf09f9603321d4b4ad Mon Sep 17 00:00:00 2001
From: Fred Hornsey
-
-
-
- Because TAO_IDL doesn't have any code to implement a preprocessor, it has
to use an external one. For convenience, it uses a built-in name for an external
preprocessor to call. During compilation, this is how that default is set: And the same behavior occurs for the TAO_IDL_PREPROCESSOR_ARGS and
-ACE_CC_PREPROCESSOR_ARGS macros. And the same behavior occurs for the Case 1 is used by the Makefile on most machines to specify the preprocessor.
Case 2 is used on Windows and platforms that need special arguments passed
to the preprocessor (MVS, HPUX, etc.). And case 3 isn't used at all,
but is included as a default case. Since the default preprocessor may not always work when TAO_IDL is moved to
+ Since the default preprocessor may not always work when TAO_IDL is moved to
another machine or used in cross-compilation, it can be overridden at runtime
-by setting the environment variables TAO_IDL_PREPROCESSOR and
-TAO_IDL_PREPROCESSOR_ARGS.
-
-TAO IDL Compiler User's Guide
+TAO IDL Compiler User's Guide
- Scope
This document describes the options and features of
+Scope
+This document describes the options and features of
TAO IDL compiler. It is not a reference manual or tutorial on OMG
IDL. For more information on OMG IDL see the
@@ -27,8 +51,8 @@ Scope
This document describes the options and features of
available in the OCI TAO
Developer's Guide.Optional CIAO Functionality
+
+Optional CIAO Functionality
For users of the Component Integrated ACE ORB
( CIAO), it is
@@ -40,50 +64,50 @@ Optional CIAO Functionality
by additional functionality in the TAO IDL compiler. All the additional files
generated and command line options used are described below.
-Generated Files
+
+Generated Files
-The IDL compiler generates up to 16 files from each .idl file. The
+The IDL compiler generates up to 16 files from each .idl file. The
file names are obtained by taking the IDL basename and
appending the following suffixes (see the list of TAO's IDL compiler
options on how to get different suffixes for
these files:)
-
-TAO's IDL compiler creates separate *.inl and *S_T.*
+TAO's IDL compiler creates separate *C.h,
+ *C.inl, and *C.cpp. Pure client applications
only need to #include and link with these files.
- #include and link
- with these files. Generation of these files may be suppressed with the -SS option.
- *S.h, and
+ *S.cpp. Servers need to #include and link
+ with these files. Generation of these files may be suppressed with the ‑SS option.
+ *S_T.h, S_T.inl,
+ and *S_T.cpp. Some C++ compilers do not like template
and non-template code in the same files, so TAO's IDL compiler
generates these files separately. These files define tie classes,
used to enable servant inheritance trees, and are not generated by
default.
- *A.h,
+ and *A.cpp. Optionally generated files containing
typecode and Any insertion/extraction operator definitions.
This option enables the contents of these files to remain
unlinked if not used.
- *_svnt.h,
+ and *_svnt.cpp. Optionally generated files, containing component
and home servant implementations, as well as factory functions to create
components and homes.
- *E.idl.
IDL file containing local interfaces used for component and home
executors, optionally generated.
- *_exec.h,
+ and *_exec.cpp. Optionally generated files containing executor implementation classes
with empty function bodies for facet, supported and inherited operations,
as well as factory functions to create component and home executors.
- *_conn.h,
+ and *_conn.cpp. Optionally generated files containing connector implementation classes
with complete function bodies. The function implementations are specialized
for DDS at present, but will be configurable to other connection mechanisms
in the future.
- *_export.h.
Optionally generated files defining export/import macros as well as
corresponding macros related to singletons and tracing, all in terms of
existing ACE macros. Note that, while these files must have the
@@ -91,71 +115,76 @@ Generated Files
from the IDL filename, as is the stem of the other file groups above.
There can be as many as 4 of these files per build, for stub, skeleton,
servant, and executor export macros, and they may also be generated by
- the Perl script generate_export_file.pl, located in
- $ACE_ROOT/bin.
+ the Perl script generate_export_file.pl, located in
+ $ACE_ROOT/bin.
*.inl and *S_T.*
files to improve the performance of the generated code. For example,
-the *.inl files enable you to compile with inlining enabled or
+the *.inl files enable you to compile with inlining enabled or
not, which is useful for trading-off compile-time and run-time
-performance. Fortunately, you need to #include only the
-client stubs declared in the *C.h file and the skeletons in
-the *S.h file in your code. Inline files are not generated
+performance. Fortunately, you need to #include only the
+client stubs declared in the *C.h file and the skeletons in
+the *S.h file in your code. Inline files are not generated
for CIAO servant or executor implementation code.
-
Variable
- Usage
-
- TAO_IDL_PREPROCESSOR
- Used to override the program name of the preprocessor that TAO_IDL
- uses.
-
-
+ TAO_IDL_PREPROCESSOR_ARGS
- Used to override the flags passed to the preprocessor that TAO_IDL
+
+Environment Variables
+
+
+
+
+
+ Variable
+ Usage
+
+
+
+ TAO_IDL_PREPROCESSORUsed to override the program name of the preprocessor that TAO_IDL
+ uses.
+
+
+ TAO_IDL_PREPROCESSOR_ARGSUsed to override the flags passed to the preprocessor that TAO_IDL
uses. This can be used to alter the default options for the
preprocessor and specify things like include directories and how
- the preprocessor is invoked. Two flags that will always be passed to
- the preprocessor are -DIDL and -I..
-
- TAO_ROOT
- Used to determine where orb.idl is located.
-
- ACE_ROOT
- Used to determine where orb.idl is located.
-
-
-CIAO_ROOT
- Used to determine where
+ the preprocessor is invoked.
- Components.idl is located.
+
+
+ TAO_ROOTUsed to determine where
+ orb.idl is located.
+
+
+ ACE_ROOTUsed to determine where
+ gperf is located.
+
+
+ CIAO_ROOTUsed to determine where
+ Components.idl is located.
-
+
+
-TAO_IDL_PREPROCESSOR is defined, then it will use that.ACE_CC_PREPROCESSOR is defined, then it will use that.ccTAO_IDL_PREPROCESSOR_ARGS and
+ACE_CC_PREPROCESSOR_ARGS macros.TAO_IDL_PREPROCESSOR and
+TAO_IDL_PREPROCESSOR_ARGS.
In previous versions, the environment variables CPP_LOCATION and TAO_IDL_DEFAULT_CPP_FLAGS were used for this purpose. Both will still work, @@ -169,8 +198,8 @@
-
ACE_HAS_GPERF when building ACE and TAO.
- This macro has been defined for the platforms where gperf
+ ACE_HAS_GPERF when building ACE and TAO.
+ This macro has been defined for the platforms where gperf
has been tested, which includes most platforms
- that ACE runs on. + that ACE runs on.
gperf in $ACE_ROOT/apps/gperf. This build
+ gperf in $ACE_ROOT/apps/gperf. This build
also leaves a copy/link of the ace_gperf program at the $ACE_ROOT/bin
- directory.+ directory.
+
$ACE_ROOT appropriately or add
+ $ACE_ROOT/bin to your search path.-g option for the TAO IDL compiler or set
- your search path accordingly to install ace_gperf in a
- directory other than $ACE_ROOT/bin.
+ ‑g option for the TAO IDL compiler or set
+ your search path accordingly to install ace_gperf in a
+ directory other than $ACE_ROOT/bin.
-
-
-
TAO_IDL can generate collocated stubs using two different collocation
strategies. It also allows you to suppress/enable the generation of
the stubs of a particular strategy. To gain great flexibility at
run-time, you can generate stubs for both collocation strategies
-(using both '-Gp' and '-Gd' flags at the same time) and defer the
+(using both '‑Gp' and '‑Gd' flags at the same time) and defer the
determination of collocation strategy until run-time. On the other
hand, if you want to minimize the footprint of your program, you might
want to pre-determine the collocation strategy you want and only
generate the right collocated stubs (or not generating any at all using
-both '-Sp' and '-Sd' flags at the same time if
+both '‑Sp' and '‑Sd' flags at the same time if
it's a pure client.) See our collocation
paper for a detail discussion on the collocation support in
-TAO.
+TAO.
--
+TAO's IDL compiler invokes your C (or C++) preprocessor to resolve included IDL files. It receives the common -options for preprocessors (such as -D or -I). It -also receives other options that are specific to it.
+options for preprocessors (such as ‑D or ‑I). It
+also receives other options that are specific to it.
‑‑preprocessor‑input KINDSet the C preprocessor file input method. KIND must be
+ guess, direct‑with‑e,
+ direct‑without‑e, direct‑gcc,
+ or copy (default).
direct-without-e passes the IDL file path to the
+ preprocessor directly. Most, if not all, standalone C preprocessors like
+ GNU and Clang cpp or mcpp can use this.
direct-with-e is the same as
+ direct-without-e except ‑E is also
+ passed. CL, the Visual Studio C++ compiler can use this.
direct‑gcc is same as
+ direct‑with‑e, but it's for g++ and
+ clang++ which also require ‑x c++ to be
+ passed.
copy makes a copy of the IDL file to a temporary location
+ and passes that to the preprocessor.
guess picks one of the previous based on the name of the
+ preprocessor.
copy should work with all compilers, it only
+ approximates relative includes using ‑I., which fails under
+ certain conditions. Therefore the direct kinds are preferred by
+ guess. For compatibility, in TAO 2 copy is the
+ default since that was the bevaior before. In TAO 3 guess is
+ the default.
+