blob: 0183f471fbef98944e841aa186f17300edd3d34d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../skin/tigris.css" type="text/css">
<link rel="stylesheet" href="../skin/mysite.css" type="text/css">
<link rel="stylesheet" href="../skin/site.css" type="text/css">
<link media="print" rel="stylesheet" href="../skin/print.css" type="text/css">
<title>Axis CPP - ANT Build Guide</title>
</head>
<body bgcolor="white" class="composite">
<div id="banner">
<table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0">
<tbody>
<tr>
<td align="left">
<div class="groupLogo">
<a href="http://ws.apache.org/"><img border="0" class="logoImage" alt="The Apache WebServices Project" src="../images/project-logo.jpg"></a>
</div>
</td><td align="right">
<div class="projectLogo">
<a href="http://ws.apache.org/axis/"><img border="0" class="logoImage" alt="The Apache Axis Project" src="../images/axis.jpg"></a>
</div>
</td><td valign="top" rowspan="2" align="right" class="search">
<form target="_blank" action="http://www.google.com/search" method="get">
<table summary="search" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#a5b6c6" colspan="3"><img height="10" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td colspan="3"><img height="8" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"><input value="ws.apache.org" name="sitesearch" type="hidden"><input size="10" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../skin/images/spacer.gif" class="spacer"><input name="Search" value="GO" type="submit">
<br>
Search WS</td><td><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td colspan="3"><img height="7" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td class="bottom-left-thick"></td><td bgcolor="#a5b6c6"><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td class="bottom-right-thick"></td>
</tr>
</table>
</form>
</td>
</tr>
</tbody>
</table>
</div>
<table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs">
<tbody>
<tr class="status">
<td><a href="http://www.apache.org/">Apache</a> | <a href="http://ws.apache.org/">WS</a><a href=""></a></td><td id="tabs">
<div class="tab">
<span class="selectedTab"><a class="base-selected" href="../index.html">WebServices-Axis</a></span>
</div>
</td>
</tr>
</tbody>
</table>
<table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0">
<tbody>
<tr valign="top">
<td id="leftcol">
<div id="navcolumn">
<div class="menuBar">
<div class="menu">
<span class="menuLabel">Axis</span>
<div class="menuItem">
<a href="http://ws.apache.org/axis/index.html">Introduction</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/news.html">News</a>
</div>
<div class="menuItem">
<a href="http://wiki.apache.org/ws/FrontPage/Axis">FAQ/Wiki</a>
</div>
<div class="menu">
<span class="menuLabel">Get Involved</span>
<div class="menuItem">
<a href="http://ws.apache.org/axis/overview.html">Overview</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/cvs.html">CVS Repository</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/mail.html">Mailing Lists</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/ref.html">Reference Library</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/bugs.html">Bugs</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/howtobuild.html">HowToBuildSite</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Axis (Java)</span>
<div class="menuItem">
<a href="http://ws.apache.org/axis/java/index.html">Documentation</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/java/install.html">Installation</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/java/user-guide.html">User's Guide</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/java/developers-guide.html">Developer's Guide</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/java/integration-guide.html">Integration Guide</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/java/architecture-guide.html">Architecture Guide</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/java/reference.html">Reference Guide</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/java/reading.html">Reading Guide</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/java/requirements.html">Requirements</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Axis (C++)</span>
<div class="menuItem">
<a href="../cpp/index.html">Home</a>
</div>
<div class="menuItem">
<a href="../cpp/documentation.html">Documentation</a>
</div>
<div class="menuItem">
<a href="../cpp/download.html">Download</a>
</div>
<div class="menuItem">
<a href="http://wiki.apache.org/ws/FrontPage/AxisCPP">Wiki Pages</a>
</div>
<div class="menuItem">
<a href="../cpp/who.html">Who we are</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Downloads</span>
<div class="menuItem">
<a href="http://ws.apache.org/axis/releases.html">Releases</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/interim.html">Interim Drops</a>
</div>
<div class="menuItem">
<a href="http://cvs.apache.org/viewcvs/ws-axis/">Source Code</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Translation</span>
<div class="menuItem">
<a href="http://ws.apache.org/axis/ja/index.html">Japanese</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Related Projects</span>
<div class="menuItem">
<a href="http://ws.apache.org/wsif/">WSIF</a>
</div>
<div class="menuItem">
<a href="http://cvs.apache.org/viewcvs/*checkout*/ws-wsil/java/README.htm">WSIL</a>
</div>
<div class="menuItem">
<a href="http://www-124.ibm.com/developerworks/projects/wsdl4j/">WSDL4J</a>
</div>
<div class="menuItem">
<a href="http://www.uddi4j.org/">UDDI4J</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Misc</span>
<div class="menuItem">
<a href="http://ws.apache.org/axis/who.html">Who We Are</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/contact.html">Contact</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/legal.html">Legal</a>
</div>
<div class="menuItem">
<a href="http://ws.apache.org/axis/docs.html">Notes/Docs</a>
</div>
</div>
</div>
</div>
</div>
</td><td>
<div id="bodycol">
<div class="app">
<div align="center">
<h1>Axis CPP - ANT Build Guide</h1>
</div>
<div class="h3">
<div class="h3">
<h3>Axis C++ ANT Build Guide</h3>
</div>
<p>This document provides instructions for using and extending the ANT based build for the AXIS C++ project.</p>
<div style="margin-left: 2em">
<h2>Contents</h2>
<ul>
<li>
<a href="#prepareSystem">Preparing system</a>
</li>
<li>
<a href="#thirdPartySoftware">Getting necessary third party software</a>
</li>
<li>
<a href="#PropertyFiles">Property Files</a>
</li>
<li>
<a href="#cvsExtract">Getting the source code</a>
</li>
<li>
<a href="#SettingTheEnvironment">Setting the Environment</a>
</li>
<li>
<a href="#runningTheBuild">Running the ANT build</a>
</li>
<li>
<a href="#EnablingTraceAndDebug">Enabling Trace and Debug</a>
</li>
<li>
<a href="#addingExtraPlatform"><a href="#addingExtraPlatform">Adding an extra platform</a></a>
</li>
</ul>
<a href="#addingExtraPlatform"></a>
<h2>
<a name="prepareSystem"></a>Preparing system</h2>
<p>To use the ANT based build you will need to install the following:</p>
<ul>
<li>Apache ANT <ul>
<li>Available from <a href="http://ant.apache.org">http://ant.apache.org</a>
</li>
<li>These scripts have been developed and tested using version 1.6.x</li>
</ul>
</li>
<li>Java SDK - required for running of ANT scripts, and the compilation of WSDL2Ws tool <ul>
<li>Require version 1.4+</li>
</ul>
</li>
<li>Ant-Contrib - provide numerous extensions to ANT, including the compilation of C/C++. <ul>
<li>Available from <a href="http://ant-contrib.sourceforge.net">http://ant-contrib.sourceforge.net</a>
</li>
<li>Place JARs into <span class="codefrag">[ANT INSTALL DIR]/lib</span>.</li>
<li>Require both ant-contrib (v0.6) and cpptasks (v1.0b3)</li>
</ul>
</li>
<li>(Optional) Doxygen - Used for generating API documentation <ul>
<li>Available from <a href="http://www.doxygen.org">http://www.doxygen.org</a>
</li>
</ul>
</li>
<li>Compiler / Linker <ul>
<li>For Windows - Microsoft Visual C++ v6</li>
<li>For Linux - gcc / g++</li>
<li>For AIX - IBM Visual Age for C++</li>
<li>For Solaris - cc</li>
<li>For HP-UX - aC++</li>
<li>For OS400 - icc</li>
</ul>
</li>
</ul>
<h2>
<a name="thirdPartySoftware"></a>Getting necessary third party software</h2>
<p>Axis Cpp Developers use the Xerces-cXML Parsers to build the Axis Cpp. Additionally, you can opt to build Apache mod files for Apache 1.3 or 2.0.</p>
<p>
<strong>Xerces-C XML Parser</strong>
</p>
<p>You can get Xerces-C binaries from <a href="http://xerces.apache.org">http://xerces.apache.org</a>.</p>
<p>
<strong>Apache</strong>
</p>
<p>You can get Apache 1.3 or 2.0 from <a href="http://httpd.apache.org/">http://httpd.apache.org/</a>
</p>
<h2>
<a name="PropertyFiles"></a>Property Files</h2>
<p>The behaviour of the ANT scripts is controlled by the values specified in <span class="codefrag">build.common.properies</span>. To aid in the portability of the ANT scripts, there are also a number of platform specific property files which override properties as required. The ANT scripts will automatically determine the correct file to be used based on the platform in which it is currently running. The property files are found in <span class="codefrag">ws-axis/c/build</span> with the following naming convention:</p>
<pre class="code">build.common.properties build.[platform].properties</pre>
<p>A number of example property files are provided for Windows, Linux, AIX and Solaris. It is intended you update these files to suit your development and build environment, including location of third party software dependencies and target packaging structure.</p>
<p>These property files also allow you to make some selection on which artefacts will be produced by the build:</p>
<ul>
<li>Select which Apache module to produce: <ul>
<li>For each one to be built, set the following to true:<br>
<span class="codefrag">server.apache13</span>
<br>
<span class="codefrag">server.apache20</span>
</li>
</ul>
</li>
<li>Select whether to build Simple Axis Server executable: <ul>
<li>If you wish to build this, set the following to true:<br>
<span class="codefrag">server.simpleAxisServer</span>
</li>
</ul>
</li>
</ul>
<p>The default selections are for both the Apache 1.3 and Apache 2.0 modules.</p>
<h2>
<a name="SettingTheEnvironment"></a>Setting the Environment</h2>
<p>Before running ANT the following environment variables must be set:</p>
<ul>
<li>
<span class="codefrag">ANT_HOME</span> - location of ant installation</li>
<li>
<span class="codefrag">JAVA_HOME</span> - location of java installation</li>
<li>
<span class="codefrag">PATH</span> - to include <span class="codefrag">[ANT_HOME]/bin</span> and <span class="codefrag">[JAVA_HOME]/bin</span>. <ul>
<li>Also ensure doxygen and compilers are available on the system path.</li>
</ul>
</li>
</ul>
<p>The default property files make use of the following environment variables to locate the various third party software dependencies.</p>
<ul>
<li>
<span class="codefrag">AXISJAVA_LIB</span> - location of Axis Java JAR files, as required for WSDL2Ws tool</li>
<li>
<span class="codefrag">XERCES_HOME</span> - location of Xerces installation</li>
<li>
<span class="codefrag">APACHE_HOME</span> - location of Apache 1.3 installation (<em>if building Apache 1.3 module</em>)</li>
<li>
<span class="codefrag">APACHE2_HOME</span> - location of Apache 2.0 installation (<em>if building Apache 2.0 module</em>)</li>
</ul>
<h2>
<a name="cvsExtract"></a>Getting the source code</h2>
<p>See <a href="developers-guide.html#checkingOut">here</a> for more detail on gaining access to the code in SVN.</p>
<p>Note: The ANT scripts were written based on the previous CVS structure and have not been updated to the SVN structure, so you will need to ensure your checkout is into the following structure:</p>
<pre class="code">[build root]\ws-axis\c</pre>
<p>The checked out folder <span class="codefrag">ws-axis\c</span> will be referred to as <span class="codefrag">[CHECKOUT_HOME]</span> from this point on.</p>
<h2>
<a name="runningTheBuild"></a>Running the ANT build</h2>
<p>Once you have configured your environment and property files the build is a simple two step process. The first step is to build all the generated artefacts. At the comment prompt change to <span class="codefrag">[CHECKOUT_HOME]</span> and run:</p>
<pre class="code">ant</pre>
<p>This will build the following:</p>
<ul>
<li>Client library</li>
<li>Transport libraries</li>
<li>XML Parser library</li>
<li>Server library</li>
<li>Apache modules<ul>
<li>Apache 1.3 or Apache 2.0 configurable through the property files</li>
</ul>
</li>
<li>Simple Server Executable<ul>
<li>Configurable through the property files</li>
</ul>
</li>
<li>WSDL2Ws tool</li>
<li>API Documentation</li>
</ul>
<p>The second step is to package the generated artefacts. From <span class="codefrag">[CHECKOUT_HOME]</span> run:</p>
<pre class="code">ant -f package.xml</pre>
<p>This will package into two distributables:</p>
<ul>
<li>binary</li>
<li>source</li>
</ul>
<h2>
<a name="EnablingTraceAndDebug"></a>Enabling Trace and Debug</h2>
<p>By default, the ANT build scripts do not produce libraries with trace or debug symbols. To include these make use of one of the following to build:</p>
<pre class="code">ant buildWithTrace</pre>
<pre class="code">ant buildWithDebug</pre>
<pre class="code">ant buildWithTraceAndDebug</pre>
<p>The packaging step remains the same, but when packaging the source distributable it will automatically select the trace instrumented source code if available.</p>
<p>When trace is selected, the ant build adds in trace entry and exit statements into many of the methods in Axis C++. Then at runtime, in <span class="codefrag">axiscpp.conf</span>, set <span class="codefrag">ClientLogPath</span> to a file and Axis C++ will write out trace to that file. Omitting <span class="codefrag">ClientLogPath</span> from <span class="codefrag">axiscpp.conf</span> switches trace off.</p>
<h2>
<a name="addingExtraPlatform"></a>Adding an extra platform</h2>
<p>The AXIS community would greatly appreciate your input, if you're working on a platform not currently supported by the ANT scripts.<br>Below, are the steps required to add an additional platform;</p>
<ol>
<li>Add platform detection to <span class="codefrag">pre-init</span> target in <span class="codefrag">buildIntialize.xml</span>, eg: <pre>&lt;condition property="linux"&gt;<br> &lt;os name="Linux"/&gt;<br>&lt;/condition&gt;</pre>
</li>
<li>Update platform property within <span class="codefrag">initialize</span> target in <span class="codefrag">buildIntialize.xml</span>, eg: <pre>&lt;condition property="platform" value="Linux"&gt;<br> &lt;isset property="linux"/&gt;<br>&lt;/condition&gt;</pre>
</li>
<li>Provide an additional property file in <span class="codefrag">ws-axis/c</span> to match your platform. This uses the naming convention <span class="codefrag">build.[platform].properties</span>, where platform is as specified in step 2.</li>
<li>Provide <span class="codefrag">compiler</span> definition for platform in <span class="codefrag">buildIntialize.xml</span>, include a condition check for the correct platform and any debug flags should be conditional on the debug property being set, eg: <pre>&lt;compiler id="Linuxgcc" name="g++" if="linux"&gt;<br> &lt;compilerarg value="-g" if="debug"/&gt;
&lt;compilerarg value="-Wall"/&gt;<br> &lt;compilerarg value="-Wshadow"/&gt;<br> &lt;compilerarg value="-O2"/&gt;<br> &lt;defineset&gt;<br> &lt;define name="ENABLE_AXIS_EXCEPTION"/&gt;<br> &lt;define name="HAVE_CONFIG_H"/&gt;<br> &lt;define name="PIC"/&gt;<br> &lt;/defineset&gt;<br> &lt;includepath path="${dir.include}"/&gt;<br>&lt;/compiler&gt;</pre>Note: Compilers may extend one another, which can be useful if an additional platform uses the same compiler, but maybe only small variations in the parameters.</li>
<li>Provide <span class="codefrag">linker</span> definition for platform in <span class="codefrag">buildIntialize.xml</span>, include a condition check for the correct platform and any debug flags should be conditional on the debug property being set, eg: <pre>&lt;linker id="LinuxLinker" name="g++" libtool="true" if="linux"&gt;<br> &lt;linkerarg value="-g" if="debug"/&gt;<br> &lt;libset libs="stdc++"/&gt;<br>&lt;/linker&gt;</pre>Note: As for compilers, linkers may extend one another.</li>
<li>Add new <span class="codefrag">compiler</span> and <span class="codefrag">linker</span> to the various <span class="codefrag">cc</span> tasks used within the ANT scripts, eg: <pre>&lt;cc outfile="${dir.bin}/${transportLibraryName}" objdir="${dir.objects}"<br> exceptions="true" failonerror="false" outtype="shared" multithreaded="true"&gt;<br> &lt;!-- Compilers --&gt;<br> &lt;compiler refid="Linuxgcc"/&gt;<br> &lt;compiler refid="AIXxlc"/&gt;
...<br> &lt;!-- Linkers --&gt;<br> &lt;linker refid="LinuxLinker"/&gt;<br> &lt;linker refid="AIXLinker"/&gt;<br> ...<br>&lt;/cc&gt;</pre>
</li>
</ol>
</div>
<div id="pdf" align="right">
<a href="antbuild-guide.pdf"><img alt="PDF" src="../skin/images/pdfdoc.gif" class="skin"><br>
PDF</a>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div id="footer">
<table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0">
<tbody>
<tr>
<td colspan="2">
<div align="center">
<div class="copyright">
Copyright &copy; 2000-2005&nbsp;The Apache Software Foundation. All rights reserved.
</div>
</div>
</td>
</tr>
<tr>
<td align="left"></td><td align="right">
<div align="right">
<div class="credit"></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>