xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abag...@locus.apache.org
Subject cvs commit: xml-site/sources/xerces-c build.xml
Date Wed, 12 Jan 2000 00:54:43 GMT
abagchi     00/01/11 16:54:43

  Added:       sources/xerces-c build.xml
  Log:
  Added Build section
  
  Revision  Changes    Path
  1.1                  xml-site/sources/xerces-c/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
  
  <s1 title="Building &XercesCName;">
      <s2 title="Building on Windows NT/98">
  				&XercesCName; comes with Microsoft Visual C++ projects and workspaces to
  				help you build &XercesCName;. The following describes the steps you need
  				to build &XercesCName;
      		<s3 title="Building &XercesCName; library">
          <p>
  				To build &XercesCName; from it source (using MSVC), you will need to
  				open the workspace containing the project.
  				If you are building your application, you may want to add the &XercesCName;
  				project inside your applications's workspace.
  				</p>
  				<p>
          The workspace containing the &XercesCName; project file and all other samples
is:
  				</p>
  				<source>
  &XercesCSrcInstallDir;\Projects\Win32\VC6\xerces-all\xerces-all.dsw</source>
  				<p>Once you are inside MSVC, you need to build the project marked <em>XercesLib</em>.</p>
          <p>If you want to include the &XercesCName; project separately, you need
to
  				pick up:
  				</p>
          <source>
  &XercesCSrcInstallDir;\Projects\Win32\VC6\xerces-all\XercesLib\XercesLib.dsp</source>

  
          <p>You must make sure that you are linking your application with the &XercesCWindowsLib;.lib
          library and also make sure that the associated DLL is somewhere in your path.
  				</p>
  				<note>If you are working on the AlphaWorks version which uses ICU, you must 
  				either have the environment variable ICU_DATA set, or keep the
          international converter files relative to the &XercesCProjectName; DLL
  				(as it came with  the original binary drop) for the program to find it.
  				For finding out where you can get ICU from and build it, look at the last
  				section of this page.
  				</note>
  				</s3>				
      		<s3 title="Building samples">
  				<p>Inside the same workspace (xerces-all.dsw), you'll find several other
  				projects. These are for the samples. Select all the samples and right click
  				on the selection. Then choose "Build (selection only)" to build all the 
  				samples in one shot.</p>
  				</s3>				
      </s2>
  
      <s2 title="Building on UNIX platforms">
          <p>
          &XercesCName; uses GNU tools like <em>autoconf</em> and <em>gmake</em>
  				to build the system. You must first make sure you have these tools installed
  				on your system before proceeding. If you don't have all required tools,
  				ask your system administrator to get it for you. These tools are free
  				under the GNU Public Licence and may be obtained from <jump href="http://www.gnu.org">
  				http://www.gnu.org</jump>.
          </p>
  				<p><em>Also, do not jump into the build directly before reading this</em>.
Spending
  				some time reading the following instructions will save you a lot of wasted
  				time and support-related Email communication. The &XercesCName; build
  				instructions are a little different from normal product builds. Specifically,
  				there are some wrapper-scripts that have been written to make life easier
  				for you. You are free not to use these scripts and use <em>autoconf</em>
and
  				<em>gmake</em> directly (like other products), but we want to make sure
  				you know what you are by-passing and what risks you are taking. So read
  				the following instructions carefully before attempting to build it yourself.
  				</p>
  				<p>Besides having all necessary build tools, you also need to know what
  				compilers we have tested &XercesCName; on. The following table lists the
  				relevant platforms and compilers.</p>
  				
  			 <table>
          <tr><td><em>Operating System</em></td><td><em>Compiler</em></td></tr>
          <tr><td>Redhat Linux 6.0</td><td>gcc</td></tr>
          <tr><td>AIX 4.1.4  and higher</td><td>xlC 3.1</td></tr>
          <tr><td>Solaris 2.6</td><td>CC version 4.2</td></tr>
          <tr><td>HP-UX B10.2</td><td>aCC and CC</td></tr>
          <tr><td>HP-UX B11</td><td>aCC and CC</td></tr>
        </table>
  
  			<p>If you are not using any of these compilers, you are taking a calculated risk
  			by exploring new grounds. Your effort in making &XercesCName; work on this
  			new compiler is greatly appreciated and any problems you face can be addressed
  			on the &XercesCName; <jump href="mailto:&XercesCEmailAddress;">mailing
list</jump>.
  			</p>
  			
  			<p><em>Differences between the UNIX platforms:</em> The description
below is 
  			generic for all UNIX platforms, but as every
  			programmer is aware, there are minor differences within the various UNIX
  			flavors the world has been bestowed with.	The one difference that you need
  			to watch out in the discussion below, pertains to the system environment
  			variable for finding libraries. On <em>Linux and Solaris</em>, the environment
  			variable name is called <em>LD_LIBRARY_PATH</em>, on <em>AIX</em>
it is <em>LIBPATH</em>, while on 
  			<em>HP-UX</em> it is <em>SHLIB_PATH</em>. The following discussion
assumes
  			you are working on Linux, but it is with subtle understanding that you know
  			how to interpret it for the other UNIX flavors.</p>
  
  			<note>If you wish to build &XercesCName; with ICU, look at the last
  			section of this page. It tells you where you can find ICU and how you
  			can build it.</note>
  				
      	<s3 title="Setting build environment variables">
  			<p>Before doing the build, you must first set your environment variables
  			to pick-up the compiler and also specify where you extracted &XercesCName;
  			on your machine.
  			While the first one is probably set for you by the system administrator, just
  			make sure you can invoke the compiler. You may do so by typing the
  			compiler invocation command without any parameters (e.g. xlc_r, or g++, or cc)
  			and check if you get a proper response back.</p>
  			<p>Next set your &XercesCName; root path as follows:</p>
  			<source>
  export XERCESCROOT=&lt;full path to &XercesCSrcInstallDir;&gt;</source>
  
  			<p>This should be the full path of the directory where you extracted &XercesCName;.</p>
  			</s3>
  				
      	<s3 title="Building &XercesCName; library">
  			<p>As mentioned earlier, you must be ready with the GNU tools like <em>autoconf</em>
  			and <em>gmake</em> before you attempt the build.</p>
  			
  			<p>The autoconf tool is
  			required on only one platform and produces a set of portable scripts (configure) that
  			you can run on all other platforms without actually having the autoconf tool 
  			installed everywhere. In all probability the autoconf-generated script (called 
  			<em>configure</em>) is already in your <code>src</code> directory.
If not, type:
  			</p>
  			
  			<source>
  cd $XERCESCROOT/src
  autoconf</source>
  
  			<p>This generates a shell-script called configure. It is tempting to run
  			this script directly as is normally the case, but wait a minute. If you are
  			using the default compilers like gcc and g++ you do not have a problem. But
  			if you are not on the standard GNU compilers, you need to export a few more
  			environment variables before you can invoke configure.</p>
  			
  			<p>Rather than allow you to figure out what strange environment variables you
  			need to use, we have provided you with a wrapper script that does the job
  			for you. All you need to tell the script is what your compiler is, and
  			what options you are going to use inside your build, and the script does 
  			everything for you. Here is what the script takes as input:</p>
  			
  			<source>
  runConfigure
  runConfigure: Helper script to run "configure" for one of the supported platforms
  Usage: runConfigure "options"
         where options may be any of the following:
         -p &lt;platform&gt; (accepts 'aix', 'linux', 'solaris', 'hp-10', 'hp-11',
'irix', 'unixware')
         -c &lt;C compiler name&gt; (e.g. gcc, cc, xlc)
         -x &lt;C++ compiler name&gt; (e.g. g++, CC, xlC)
         -d (specifies that you want to build debug version)
         -m &lt;message loader&gt; can be 'inmem', 'icu', 'iconv'
         -n &lt;net accessor&gt; can be 'fileonly', 'libwww'
         -t &lt;transcoder&gt; can be 'icu' or 'native'
         -r &lt;thread option&gt; can be 'pthread' or 'dce' (only used on HP-11)
         -l &lt;extra linker options&gt;
         -z &lt;extra compiler options&gt;
         -h (to get help on the above commands)
  </source>
  
  			<note>&XercesCName; builds as a standalone library and also as a library
  			dependent on IBM's International Classes for Unicode (ICU). For simplicity,
  			the following discussion only targets standalone builds.</note>
  			
  			<p>One of the common ways to build &XercesCName; is as follows:</p>
  			
  			<source>
  runConfigure -plinux -cgcc -xg++ -minmem -nfileonly -tnative
  </source>
  
  			<p>The response will be something like this:</p>
  			<source>
  Platform: linux
  C Compiler: gcc
  C++ Compiler: g++
  Extra compile options: 
  Extra link options: 
  Message Loader: inmem
  Net Accessor: fileonly
  Transcoder: native
  Thread option: 
  Debug is OFF
  
  creating cache ./config.cache
  checking for gcc... gcc
  checking whether the C compiler (gcc -O -DXML_USE_NATIVE_TRANSCODER 
                     -DXML_USE_INMEM_MESSAGELOADER   ) works... yes
  checking whether the C compiler (gcc -O -DXML_USE_NATIVE_TRANSCODER 
                     -DXML_USE_INMEM_MESSAGELOADER   ) is a cross-compiler... no
  checking whether we are using GNU C... yes
  checking whether gcc accepts -g... yes
  checking for c++... g++
  checking whether the C++ compiler (g++ -O -DXML_USE_NATIVE_TRANSCODER 
                     -DXML_USE_INMEM_MESSAGELOADER   ) works... yes
  checking whether the C++ compiler (g++ -O -DXML_USE_NATIVE_TRANSCODER 
                     -DXML_USE_INMEM_MESSAGELOADER   ) is a cross-compiler... no
  checking whether we are using GNU C++... yes
  checking whether g++ accepts -g... yes
  checking for a BSD compatible install... /usr/bin/install -c
  checking for autoconf... autoconf
  checking for floor in -lm... yes
  checking how to run the C preprocessor... gcc -E
  checking for ANSI C header files... yes
  checking for XMLByte... no
  checking host system type... i686-pc-linux-gnu
  updating cache ./config.cache
  creating ./config.status
  creating Makefile
  creating util/Makefile
  creating util/Transcoders/ICU/Makefile
  creating util/Transcoders/Iconv/Makefile
  creating util/Transcoders/Iconv400/Makefile
  creating util/Platforms/Makefile
  creating util/Compilers/Makefile
  creating util/MsgLoaders/InMemory/Makefile
  creating util/MsgLoaders/ICU/Makefile
  creating util/MsgLoaders/MsgCatalog/Makefile
  creating util/MsgLoaders/MsgFile/Makefile
  creating validators/DTD/Makefile
  creating framework/Makefile
  creating dom/Makefile
  creating parsers/Makefile
  creating internal/Makefile
  creating sax/Makefile
  creating ../obj/Makefile
  creating conf.h
  conf.h is unchanged
  
  In future, you may also directly type the following commands to create the Makefiles.
  
  export TRANSCODER=NATIVE
  export MESSAGELOADER=INMEM
  export USELIBWWW=0
  export CC=gcc
  export CXX=g++
  export CXXFLAGS=-O -DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER  
  export CFLAGS=-O -DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER  
  export LIBS= -lpthread 
  configure
  
  If the result of the above commands look OK to you, go to the directory
  $XERCESCROOT/src and type "gmake" to make the XERCES-C system.			
  </source>
  
  			<p>So now you see what the wrapper script has actually been doing! It has 
  			invoked <code>configure</code>
  			to create the Makefiles in the individual sub-directories, but in addition
  			to that, it has set a few environment variables to correctly configure 
  			your compiler and compiler flags too.</p>
  			
  			<p>Now that the Makefiles are all created, you are ready to do the actual build.</p>
  			
  			<source>
  gmake			
  </source>
  
  <p>Is that it? Yes, that's all you need to build &XercesCName;.</p>
  			</s3>
  			
  			<s3 title="Building samples">
  			<p>Similarly, you can build the samples by giving the same commands in the
  			<code>samples</code> directory.</p>
  			
  			<source>
  cd $XERCESCROOT/samples
  runConfigure -plinux -cgcc -xg++
  gmake
  </source>
  
  			<p>The samples get built in the <code>bin</code> directory. Before
you run the
  			samples, you must make sure that your library path is set to pick up
  			libraries from <code>$XERCESCROOT/lib</code>. If not, type the following
to
  			set your library path properly.</p>
  			
  			<source>
  export LD_LIBRARY_PATH=$XERCESCROOT/lib:$LD_LIBRARY_PATH
  </source>		
  				<p>You are now set to run the sample applications.</p>
  
  			</s3>
     </s2>
  
  
      <s2 title="Building on Windows using Visual Age C++">
  				<p>A few unsupported projects are also packaged with &XercesCName;. Due to
  				origins of &XercesCName; inside IBM labs, we do have projects for IBM's
  				Visual Age C++ compiler on Windows. The following describes the steps you need
  				to build &XercesCName; using Visual Age C++.</p>
      		<s3 title="Building &XercesCName; library">
          <p><em>Requirements</em></p> 
  
          <ol><li>VisualAge C++ Version 4.0 with Fixpak 1:   Download the Fixpak
from the IBM
                  VisualAge C++ Professional home page at
  								<jump href="http://www.software.ibm.com/ad/VisualAge_c++/service/csd.html">
  								http://www.software.ibm.com/ad/VisualAge_c++/service/csd.html</jump></li>

                  <li>ICU Build: You should have the ICU Library in the same directory
as the xml4c
                      library. For example if xml4c is at the top level of the d drive, put
                      the ICU library at the top level of d e.g. d:/xml4c, d:/icu.</li>
  				</ol>
  				<note>You need to heed item 2 only if you are using ICU in your builds.</note>

  
          <p><em>Instructions</em></p>
  				<ol>
             <li>Change directory to  d:\xml4c\Projects\Win32</li> 
             <li>If a d:\xml4c\Project\Win32\VACPP40 directory does not exist, create
it.</li> 
             <li>Copy the IBM VisualAge project file, XML4C2X.icc, to the VACPP40 directory.</li>

             <li>From the VisualAge main menu enter the project file name and path.</li>

             <li>When the build finishes the status bar displays this message: Last
Compile
                 completed Successfully with warnings on date.</li>
  				</ol>
          <note>These instructions assume that you install in drive d:\. Replace d with
the
                appropriate drive letter.</note> 
  				</s3>				
      </s2>
  
  
      <s2 title="Building on OS/2 using Visual Age C++">
  				<p>OS/2 is one of IBM's favourite PC platforms for old customers. The only 
  				option in	this platform is to use Visual Age for C++. The following 
  				describes the steps you need to build &XercesCName; using Visual Age C++ on OS/2.</p>
      		<s3 title="Building &XercesCName; library">
          <p><em>Requirements</em></p> 
  
          <ol><li>VisualAge C++ Version 4.0 with Fixpak 1:   Download the Fixpak
from the IBM
                  VisualAge C++ Professional home page at
  								<jump href="http://www.software.ibm.com/ad/VisualAge_c++/service/csd.html">
  								http://www.software.ibm.com/ad/VisualAge_c++/service/csd.html</jump></li>

                  <li>ICU Build:You should have the ICU Library in the same directory
as the xml4c
                      library. For example if xml4c is at the top level of the d drive, put
                      the ICU library at the top level of d e.g. d:/xml4c, d:/icu.</li>
  				</ol>
  				<note>You need to heed item 2 only if you are using ICU in your builds.</note>

  
          <p><em>Instructions</em></p>
  				<ol>
             <li>Change directory to  d:\xml4c\Projects\OS2</li> 
             <li>If a d:\xml4c\Project\OS2\VACPP40 directory does not exist, create
it.</li> 
             <li>Copy the IBM VisualAge project file, XML4C2X.icc, to the VACPP40 directory.</li>

             <li>From the VisualAge main menu enter the project file name and path.</li>

             <li>When the build finishes the status bar displays this message: Last
Compile
                 completed Successfully with warnings on date.</li>
  				</ol>
          <note>These instructions assume that you install in drive d:\. Replace d with
the
                appropriate drive letter.</note> 
  				</s3>				
      </s2>
  		
  
      <s2 title="Building on Macintosh using CodeWarrior">
  				<p>The directions in this file cover installing and building &XercesCName;
  				 and ICU under the MacOS  using CodeWarrior.</p>
      		<s3 title="Building &XercesCName; library">
  
          <ol>
  				<li>Create a folder that will contain the &XercesCName; and ICU distributions.
For future
              reference I will refer to this folder as "src drop". </li>
  				<li>Download and uncompress the ICU source distribution and the &XercesCName;
source
              distribution.  You might also want to download the binary distributions because
              they may contain documentation not present in the source distribution.  This
will
              create two additional directories; &XercesCName; and icu124 Folder. Move
these folders
              into the "src drop" folder.</li>
  				<li>Drag the &XercesCName; folder and drop it on to the "rename file" application
located in
              the same folder as this readme.  This is a MacPerl script that renames files
with
              names too long to fit in a HFS/HFS+ filesystem.  It also searches through all
of
              the source code and changes the #include statements to refer to the new file
              names.</li>
  				<li>Move the MacOS folder (in the Projects folder) to "src drop:&XercesCName;:Projects".</li>
  				<li>You should be able to open the CodeWarrior project file "src
              drop:&XercesCName;:Projects:MacOS:&XercesCName;:&XercesCName;" and
build the &XercesCName; library.</li>
  				<li>You should also be able to open the CodeWarrior project file "src
              drop:&XercesCName;:Projects:MacOS:icu:icu" and build the ICU library.</li>
  				<li>If you wish you can create projects for and build the rest of the tools and
test
              suites.  They are not needed if you just want to use &XercesCName;.  I suggest
that you
              use the binary data files distributed with the binary distribution of ICU instead
of
              creating your own from the text data files in the ICE source distribution.</li>
  				</ol>
  				<p>There are some things to be aware of when creating your own projects using
&XercesCName;.</p>
  				<ol>
  				<li>You will need to link against both the ICU and &XercesCName; libraries.</li>
  				<li>The options "Always search user paths" and "Interpret DOS and Unix Paths"
are
              very useful.  Some of the code won't compile without them set.</li>
  				<li>Most of the tools and test code will require slight modification to compile
and run
              correctly (typecasts, command line parameters, etc), but it is possible to get
              them working correctly.</li>
  				<li>You will most likely have to set up the Access Paths.  The access paths in
the
              &XercesCName; projects should serve as a good example.</li>
  				</ol>
  				
  				
  				<note>These instructions were originally contributed by <jump href="mailto:jbellardo@alumni.calpoly.edu">
  				jbellardo@alumni.calpoly.edu</jump>.  &XercesCName; has undergone a lot of
changes after that.
  				So, in all likelihood these instructions are not upto date. But it will give you a jump
start
  				if you are struggling to get it to work for the first time. We will be glad
  				to get your changes in. Please respond to <jump href="mailto:&XercesCEmailAddress;">
  				&XercesCEmailAddress;</jump> with your comments and corrections.</note>

  
  				</s3>				
      </s2>
  		
  		<s2 title="How to Build ICU">
  		<p>As mentioned earlier, &XercesCName; may be built in stand-alone mode using
  		native encoding support and also using ICU where you get support for 100's 
  		of encodings. ICU stands for International Classes for Unicode and is an
  		open source distribution from IBM. You can get ICU libraries from 
  		<jump href="http://www.ibm.com/developerWorks">IBM's developerWorks site</jump>.
  		To go to the source download page of ICU directly, <jump href="http://www10.software.ibm.com/developerworks/opensource/cvs/icu/">
  		click here</jump>.
  		</p>
  		<s3 title="Buiding ICU for &XercesCName;">
  		<p>You can find generic instructions to build ICU in the ICU documentation.
  		What we describe below are the minimal steps needed to build ICU for &XercesCName;.
  		Not all ICU components need to be built to make it work with &XercesCName;.</p>
  		</s3>
  
  		<s3 title="Building ICU on Windows">
  		<p>To build ICU from its source, invoke the project 
  		<code>\icu\source\allinone\allinone.dsw</code>
      and build the sub-project labeled <code>common</code>. You may also want
to build
      <code>tools/makeconv</code> to make the converter tool. All others are not
required for the &XercesCName;
      build to proceed.</p>
  
      <p>To build &XercesCName; from it source, you will need to include a project
file in your workspace
      to program your application. Otherwise, you can use the provided workspace and add
      your application to it as a separate project.</p>
  
      <p>In the first case the project file is:
      <code>xml4c2\Projects\Win32\VC6\IXXML4C2\IXXML4C2\IXXML4C2.dsp</code></p>
  
      <p>In the second case the workspace is:
      <code>xml4c2\Projects\Win32\VC6\IXXML4C2\IXXML4C2.dsw</code></p> 
  
      <p>You must make sure that you are linking your application with the &XercesCWindowsLib;.lib
      library and also make sure that the associated DLL is somewhere in your path. Note
      that you must either have the environment variable <code>ICU_DATA</code>
set, or keep the
      international converter files relative to the &XercesCProjectName; DLL (as it came
with
      the original binary drop) for the program to find it.</p>
  									
  		</s3>
  		
  		<s3 title="Building ICU on UNIX platforms">
  
  		<p>To build ICU on all UNIX platforms you at least need the <code>autoconf</code>
tool and GNU's
      <code>gmake</code> utility.</p>
  
      <p>First make sure that you have defined the following environment variables:</p>
  
  <source>
  export ICUROOT = &lt;icu_installdir&gt;
  export ICU_DATA = &lt;icu_installdir&gt;/data/</source>
  
      <p>Next, go to the directory,</p>
  
  <source>
  cd $ICUROOT
  cd source 
  autoconf (this will create the shell script called configure)</source>
  
  <p>Commands for specific UNIX platforms are different and are described separately
below.</p>
  
  <p>You will get a more detailed description of the use of configure in the ICU
  documentation. The differences lie in the arguments passed to the configure script,
  which is a platform-independent generated shell-script (through <code>autoconf</code>)
and is used to
  generate platform-specific <code>Makefiles</code> from generic <code>Makefile.in</code>'s.</p>
  
  <p><em>For AIX:</em></p>
  
  <p>Type the following:</p>
  <source>
  env CC="xlc_r -L/usr/lpp/xlC/lib" CXX="xlC_r -L/usr/lpp/xlC/lib" C_FLAGS="-w -O" CXX_FLAGS="-w
-O"
  configure --prefix=$ICUROOT
  cd common
  gmake
  gmake install
  cd ../tools/makeconv
  gmake</source>
  
  <p><em>For Solaris and Linux:</em></p>
  
  <source>
  env CC="cc" CXX="CC" C_FLAGS="-w -O" CXX_FLAGS="-w -O" ./configure --prefix=$ICUROOT</source>
  
  <p><em>For HP-UX:</em></p>
  
  <source>
  env CC="cc" CXX="aCC" C_FLAGS="+DAportable -w -O" CXX_FLAGS="+DAportable -w -O" ./configure
--prefix=$ICUROOT</source>
  
  <p>or</p>
  
  <source>
  env CC="cc" CXX="CC" C_FLAGS="+DAportable -w -O" CXX_FLAGS="+eh +DAportable -w -O" ./configure
--prefix=$ICUROOT</source>
  
  <p>depending on whether you are using aCC or CC to compile your sources.</p>
  
  		</s3>
  		
  		</s2>
  </s1>
  
  

Mime
View raw message