blob: b90b7e92da08660d4e727a6dcf1f5290dff9e913 [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>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.co.jp/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 value="ja" name="hl" type="hidden"><input value="UTF-8" name="ie" 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="検索" type="submit">
<br>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="../index.html">はじめに</a>
</div>
<div class="menuItem">
<a href="../news.html">お知らせ</a>
</div>
<div class="menuItem">
<a href="http://wiki.apache.org/ws/ja/axis">FAQ/Wiki</a>
</div>
<div class="menu">
<span class="menuLabel">活動に参加</span>
<div class="menuItem">
<a href="../overview.html">概要</a>
</div>
<div class="menuItem">
<a href="../cvs.html">CVS リポジトリ</a>
</div>
<div class="menuItem">
<a href="../mail.html">メーリングリスト</a>
</div>
<div class="menuItem">
<a href="../ref.html">リファレンスライブラリ</a>
</div>
<div class="menuItem">
<a href="../bugs.html">バグ</a>
</div>
<div class="menuItem">
<a href="../howtobuild.html">サイト構築方法</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Axis (Java)</span>
<div class="menuItem">
<a href="../java/index.html">ドキュメント</a>
</div>
<div class="menuItem">
<a href="../java/install.html">インストール</a>
</div>
<div class="menuItem">
<a href="../java/user-guide.html">ユーザガイド</a>
</div>
<div class="menuItem">
<a href="../java/developers-guide.html">開発者ガイド</a>
</div>
<div class="menuItem">
<a href="../java/integration-guide.html">統合ガイド</a>
</div>
<div class="menuItem">
<a href="../java/architecture-guide.html">アーキテクチャガイド</a>
</div>
<div class="menuItem">
<a href="../java/reference.html">リファレンスガイド</a>
</div>
<div class="menuItem">
<a href="../java/reading.html">読書ガイド</a>
</div>
<div class="menuItem">
<a href="../java/requirements.html">要件</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Axis (C++)</span>
<div class="menuItem">
<a href="../cpp/index.html">Axis C++ 最新版</a>
</div>
<div class="menuItem">
<a href="../cpp/documentation.html">ドキュメント</a>
</div>
<div class="menuItem">
<a href="../cpp/download.html">ダウンロード</a>
</div>
<div class="menuItem">
<a href="http://wiki.apache.org/ws/FrontPage/AxisCPP">Wiki ページ [英語]</a>
</div>
<div class="menuItem">
<a href="../cpp/who.html">メンバ紹介</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">ダウンロード</span>
<div class="menuItem">
<a href="../releases.html">リリース</a>
</div>
<div class="menuItem">
<a href="../interim.html">暫定版</a>
</div>
<div class="menuItem">
<a href="http://cvs.apache.org/viewcvs/ws-axis/">ソースコード [英語]</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">翻訳</span>
<div class="menuItem">
<a href="http://ws.apache.org/axis/jp/">日本語</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">関連プロジェクト</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">その他</span>
<div class="menuItem">
<a href="../who.html">メンバ紹介</a>
</div>
<div class="menuItem">
<a href="../contact.html">連絡先</a>
</div>
<div class="menuItem">
<a href="../legal.html">法関連</a>
</div>
<div class="menuItem">
<a href="../docs.html">メモ/ドキュメント</a>
</div>
</div>
</div>
</div>
</div>
</td><td>
<div id="bodycol">
<div class="app">
<div align="center">
<h1>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>
<p>
<a href="#prepareSystem">Preparing system</a>
<br>
<a href="#thirdPartySoftware">Getting necessary third party software</a>
<br>
<a href="#PropertyFiles">Property Files</a>
<br>
<a href="#cvsExtract">Getting a CVS checkout</a>
<br>
<a href="#SettingTheEnvironment">Setting the Environment</a>
<br>
<a href="#runningTheBuild">Running the ANT build</a>
<br>
<a href="#EnablingTraceAndDebug">Enabling Trace and Debug</a>
<br>
<a href="#addingExtraPlatform">Adding an extra platform</a>
</p>
<div class="h4">
<h4>Preparing system</h4>
</div>
<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 and cpptasks</li>
</ul>
</li>
<li>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>
</ul>
</li>
</ul>
<div class="h4">
<h4>Getting necessary third party software</h4>
</div>
<p>Axis Cpp Developers can use either Xerces-c or the Expat XML 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>Expat XML Parser</strong>
</p>
<p>You can get expat binaries from <a href="http://sourceforge.net/projects/expat/">http://sourceforge.net/projects/expat/</a>.</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>
<div class="h4">
<h4>Property Files</h4>
</div>
<p>To aid in the portability of the ANT scripts, a number of property files are used. The script will decide which to use based on the platform in which it is currently running. The property files are found in <span class="codefrag">ws-axis/c</span> with the following naming convention:</p>
<pre class="code">build.[platform].properties</pre>
<p>A number of example property files are provided for Windows, Linux, AIX and Solaris, it is intended that you update these files to suit your development and buid environment. This includes 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 XML Parsers to use: <ul>
<li>For each one to be built, set the following to true:<br>
<span class="codefrag">xmlParser.xml4c</span>
<br>
<span class="codefrag">xmlParser.xerces</span>
<br>
<span class="codefrag">xmlParser.expat</span>
</li>
</ul>
</li>
<li>Select which transport implementation to use:<ul>
<li>For each one to be built, set the following to true:<br>
<span class="codefrag">transport.axis</span>
<br>
<span class="codefrag">transport.axis2</span>
<br>
<span class="codefrag">transport.libwww</span>
</li>
</ul>
</li>
<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 Xerces as XML parser, axis2 transport implementation and both the Apache 1.3 and Apache 2.0 modules.</p>
<div class="h4">
<h4>Setting the Environment</h4>
</div>
<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">EXPAT_HOME</span> - location of Expat installation <em>(if using Expat</em>)</li>
<li>
<span class="codefrag">XERCES_HOME</span> - location of Xerces installation (<em>if using Xerces</em>)</li>
<li>
<span class="codefrag">XML4C_HOME</span> - location of XML4C installation (<em>if using XML4C</em>)</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>
<div class="h4">
<h4>Getting a CVS checkout</h4>
</div>
<p>Visit <a href="windows/cpp/">http://ws.apache.org/</a> Click on &ldquo;axis&rdquo; and then on &ldquo;CVS Repository&rdquo; to find details on how to access the CVS Repository.<br>In short summary:<br>Anyone can checkout the source code from our anonymous CVS server. To do so, simply use the following commands (if you are using a GUI CVS client, configure it appropriately):</p>
<pre class="code">cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic loginpassword: anoncvs cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic checkout ws-axis</pre>
<p>The checkout of the repository will be created in the current directory in a folder named &ldquo;<span class="codefrag">ws-axis</span>&rdquo;<br>
<br>The checked out folder ws-axis/c will be referred to as <span class="codefrag">[CHECKOUT_HOME]</span> from this point on.</p>
<div class="h4">
<h4>Running the ANT build</h4>
</div>
<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 carry out the following:</p>
<ul>
<li>Build Axis C Client library</li>
<li>Build Axis C Transport library <ul>
<li>Axis, axis2, libwww configurable through the property files</li>
</ul>
</li>
<li>Build Axis C XML Parser library <ul>
<li>Expat, Xerces-C, etc configurable through the property files</li>
</ul>
</li>
<li>Build Axis C Server library</li>
<li>Build Axis C Apache module<ul>
<li>Apache 1.3 or Apache 2.0 configurable through the property files</li>
</ul>
</li>
<li>Build Axis C Simple Server Executable<ul>
<li>Configurable through the property files</li>
</ul>
</li>
<li>Build and package WSDL2Ws tool</li>
<li>Generate API Documentation</li>
<li>Package artefacts into a distributable structure <ul>
<li>This structure is configurable through the property files</li>
</ul>
</li>
<li>Validate all artefacts have been correctly generated</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 carry out the following:</p>
<ul>
<li>Package artefacts in to a binary release distributable</li>
<li>Package artefacts in to a source release distributable</li>
</ul>
<p>To remove artefacts from a previous build use the following command:</p>
<pre class="code">ant clean</pre>
<div class="h4">
<h4>Enabling Trace and Debug</h4>
</div>
<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. Although it the source release package will automatically select the trace instrumented source code.</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 axiscpp.conf, set ClientLogPath to a file in a directory somewhere and Axis C++ will write out trace to that file. Omitting ClientLogPath from axiscpp.conf switches trace off.</p>
<div class="h4">
<h4>Adding an extra platform</h4>
</div>
<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 <span class="codefrag">cc</span> task within each of <span class="codefrag">compileAxisClient</span>, <span class="codefrag">compileAxisTransport</span>, <span class="codefrag">compileAxisXMLParser</span>, <span class="codefrag">compileSimpleAxisServer</span>, <span class="codefrag">compileAxisServerEngine</span>, <span class="codefrag">compileApache13Module</span> and <span class="codefrag">compileApache20Module</span> targets, 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 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>