If you write code in HP aC++ and distribute any of
the following C++ files to your customers, read all of the following
sections for recommendations and legal requirements.
- shared libraries containing C++ code
- executable files produced by HP aC++
and applications that use shared libraries provided with HP aC++
- object files produced by HP aC++
- archived libraries containing C++ code
- any combination of the above
NOTE:
If you choose to distribute archive libraries or object files,
your customer must have purchased HP aC++.
We strongly recommend that you distribute your products in such a way
that your customer does not need to use the HP aC++ compiler or driver.
That is, only distribute executables and shared libraries.
Be sure your customer has read this distribution information.
NOTE:
If you choose to distribute archive libraries or object files,
your customer must have purchased HP aC++.
This section explains what you need to do to ensure that your customers can
use your code correctly.
If your application uses any of the shared libraries that come with HP aC++
your customer must have those libraries installed on their system
to run the application. If your customer already has the necessary
HP aC++ shared libraries installed, the application will work.
The following
HP aC++ run-time libraries are provided as a patch. Note, these libraries
are not part of the HP-UX 10.x core system.
If you search for the patch on the patch machine,
look for the patch name "HP aC++ runtime libraries."
For more information about the patch, refer to the
HP aC++ Release Notes.
- /usr/lib/libCsup.sl
- /usr/lib/libstd.sl
- /usr/lib/librwtool.sl
- /usr/lib/libstream.sl
CAUTION:
If you distribute either executable files or shared libraries
as part of your product, you should not ship the above HP aC++
run-time libraries with your product in such a way that it results in
overwriting a newer library version with an older, incompatible version.
If you ship any HP aC++ run-time library, then it is your responsibility
to ensure that an old library version is not installed over a new one.
Refer also to the CAUTION
in the section Installing your Application.
This section discusses what you and your customers need to do if your product
is an HP aC++ library to be called with another language.
The C++ language requires that nonlocal static objects be initialized
before any function or object is used.
HP aC++ initializes nonlocal static objects in all object files,
including shared libraries, before the first statement in main() executes.
If you distribute HP aC++ libraries that your customers will use, they must
do the following to ensure that nonlocal static objects are correctly
initialized and destroyed:
- Your customer must have purchased HP aC++ and must
link their code with the aCC command.
- If your customer's
main program is written in a language
other than C++, your customer's main program must
first call _main() before doing anything else.
_main() calls all nonlocal static constructors.
- HP aC++ runtime libraries and /usr/lib/dld.sl patches must be
installed by your customer.
If your libraries are C++ shared libraries, the above restrictions can be
relaxed as follows:
-
At least the A.01.07 HP aC++ runtime patch is needed along the with either
the /usr/lib/aCC/dld.sl patch or the /usr/lib/dld.sl patch.
-
_main() must still be called, before any use of aC++ code.
It could be placed in the C++ library itself.
-
The a.out must be linked with:
/usr/lib/libcl.sl (or on the link line -lcl)
-
Except when dynamically loading the C++ shared library, the a.out
must be linked with the HP aC++ runtime libraries in the following order:
-lstd -lstream -lCsup -lm -lcl -ldld
-
If the library does not use libstd (STL) or libstream (iostreams), then
they can be eliminated. If tools.h++ is used, then add -lrwtool to the
left.
-
The following stub file needs to be linked into the shared library or
every a.out.
Assemble as follows:
as cpprt0_stub.s
or
cc -c cpprt0_stub.s
A copy of the stub file cpprt0_stub.s can be shipped.
================ cpprt0_stub.s ===================
.code
; stubs for static constructors in a.out
.export __StaticCtorTable_Start,data
.export __StaticCtorTable_End,data
__StaticCtorTable_Start
__StaticCtorTable_End
.data
; stubs for static constructors in a.out, compiled with +z/+Z
.export __ZStaticCtorTable_Start,data
.export __ZStaticCtorTable_End,data
__ZStaticCtorTable_Start
__ZStaticCtorTable_End
In addition, your customers should review Mixing C++ with other Languages
for information on linking HP aC++ modules with HP C,
HP Pascal, and HP FORTRAN 77.
NOTE:
HP aC++ code cannot be mixed with HP C++ code.
HP aC++ releases are usually forward compatible, but HP cannot guarantee
that this will be true for all releases. If you have questions about the
compatibility of HP aC++ releases, you should contact your HP support
representative.
Normally your customer will already have the correct runtime installed.
If your product requires a newer version, it is recommended that the
customer install the latest patch.
Your application's installation procedure should install the appropriate
HP aC++ components in the standard places on your
customer's systems. This will ensure that the aCC command can find them.
CAUTION:
If your customer already has HP aC++ installed and their version is newer
than yours, you should never overwrite any of the existing HP aC++
components. In addition, you should not install your product on a system that
has a newer version of HP aC++ if that newer version is incompatible with
your version.
You should also warn your customers not to install a version of HP aC++
after installing your product if their version of HP aC++ is incompatible
with your version.
For this release, Hewlett-Packard grants you permission to package
and redistribute the following subset of HP aC++ components to your
customers.
The following
HP aC++ run-time libraries are provided as a patch. Note, these libraries
are not part of the HP-UX 10.x core system.
If you search for the patch on the patch machine,
look for the patch name "HP aC++ runtime libraries."
For more information about the patch, refer to the
HP aC++ Release Notes.
- /usr/lib/libCsup.sl
- /usr/lib/libstd.sl
- /usr/lib/librwtool.sl
- /usr/lib/libstream.sl
Refer to the CAUTION
in the prior section
Applications that use HP aC++ Shared Libraries.
Permission to distribute the above mentioned HP aC++ runtime shared
libraries is based on the following terms and conditions:
- These HP aC++ components cannot be redistributed as part of a C++
compiler, linker, or interpreter product.
- All copyright notices in the code must be retained.
- The HP aC++ executable components can only be redistributed by
HP aC++ customers.