Newer
Older
<?xml version="1.0" standalone="no"?>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
<s1 title="Build Instructions">
Boris Kolpackov
committed
<s2 title="Build Instructions">
Boris Kolpackov
committed
<p>Build instructions are provided for the following platforms and
compilers:</p>
<ul>
Boris Kolpackov
committed
<li><link anchor="UNIX">UNIX/Linux/Mac OS X/Cygwin/MinGW</link></li>
<li><link anchor="Windows">Windows using Microsoft Visual C++</link></li>
<li><link anchor="BorlandCC">Windows using Borland C++</link></li>
<li><link anchor="BorlandBuilder">Windows using Borland C++ Builder</link></li>
</ul>
Boris Kolpackov
committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<anchor name="UNIX"/>
<s3 title="Building on UNIX/Linux/Mac OS X/Cygwin/MinGW platforms">
<p>For building on UNIX and UNIX-like (GNU/Linux, Max OS X,
Cygwin, MinGW-MSYS) platforms &XercesCName; uses the
GNU automake-based build systems and requires that you
have <jump href="http://www.gnu.org/software/make/make.html">GNU
make</jump> installed. On some platforms GNU make is called gmake
instead of make.</p>
<p>As with all automake-based projects the build process is divided
into two parts: configuration and building. The configuration
part is performed using the <code>configure</code> script that
can be found in the <code>&XercesC3SrcInstallDir;</code> directory.
The build part is performed by invoking <code>make</code>.</p>
<p>Besides the standard <code>configure</code> options which
you can view by running <code>configure --help</code>,
&XercesCName; provides a number of project-specific options
that are worth mentioning. You can specify one option for
each category outlined below. If you do not specify anything
for a particular category then <code>configure</code> will
select the most appropriate default. At the end of its
execution <code>configure</code> prints the selected
values for each category.</p>
<p>Net Accessor (used to access network resources):</p>
<table>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
<tr>
<td><code>--enable-netaccessor-curl</code></td>
<td>use the libcurl library</td>
</tr>
<tr>
<td><code>--enable-netaccessor-socket</code></td>
<td>use plain sockets</td>
</tr>
<tr>
<td><code>--enable-netaccessor-cfurl</code></td>
<td>use the CFURL API (only on Mac OS X)</td>
</tr>
<tr>
<td><code>--enable-netaccessor-winsock</code></td>
<td>use WinSock (only on Windows, Cygwin, MinGW)</td>
</tr>
<tr>
<td><code>--disable-network</code></td>
<td>disable network support</td>
</tr>
</table>
<p>Transcoder (used to convert between internal UTF-16 and other encodings):</p>
<table>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
<tr>
<td><code>--enable-transcoder-gnuiconv</code></td>
<td>use the GNU iconv library</td>
</tr>
<tr>
<td><code>--enable-transcoder-iconv</code></td>
<td>use the iconv library</td>
</tr>
<tr>
<td><code>--enable-transcoder-icu</code></td>
<td>use the ICU library</td>
</tr>
<tr>
<td><code>--enable-transcoder-macosunicodeconverter</code></td>
<td>use Mac OS X APIs (only on Mac OS X)</td>
</tr>
<tr>
<td><code>--enable-transcoder-windows</code></td>
<td>use Windows APIs (only on Windows, Cygwin, MinGW)</td>
</tr>
</table>
<p>Message Loader (used to access diagnostics messages):</p>
<table>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
<tr>
<td><code>--enable-msgloader-inmemory</code></td>
<td>store the messages in memory</td>
</tr>
<tr>
<td><code>--enable-msgloader-icu</code></td>
<td>store the messages using the ICU resource bundles</td>
</tr>
<tr>
<td><code>--enable-msgloader-iconv</code></td>
<td>store the messages in the iconv message catalog</td>
</tr>
</table>
<p>Thread support is enabled by default and can be disabled with the
<code>--disable-threads</code> option.</p>
<p>By default <code>configure</code> selects both shared and static
libraries. You can use the <code>--disable-shared</code> and
<code>--disable-static</code> options to avoid building the
version you don't need.</p>
<p>Finally, to make the build process cleaner the &XercesCName;
build system hides actual compiler commands being executed
by <code>make</code>. If you would like to see those then you
can specify the <code>--disable-pretty-make</code> option.</p>
Boris Kolpackov
committed
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<p>If you need to specify compiler executables that should be
used to build &XercesCName;, you can set the CC and CXX
variables when invoking <code>configure</code>. Similarly,
if you need to specify additional compiler or linker options,
you can set the CFLAGS, CXXFLAGS, and LDFLAGS variables.
For example:</p>
<source>./configure --disable-static CC=gcc-4.3 CXX=g++-4.3 CFLAGS=-O3 CXXFLAGS=-O3</source>
<p>Once the configuration part is complete you can run
<code>make</code> (or <code>gmake</code>). Running
<code>make</code> from the <code>&XercesC3SrcInstallDir;</code>
directory builds &XercesCName; library and examples. If
you like to build only the library, you can run make from
<code>&XercesC3SrcInstallDir;/src</code>.</p>
<p>If you would like to build the tests and run the
automated test suite, run <code>make check</code>
from the <code>&XercesC3SrcInstallDir;</code>
directory. The automated test suite required
Perl and the <code>diff</code> command.</p>
<p>Some platforms and configurations require extra
<code>configure</code> and <code>make</code> options
which are shown in the following table.</p>
<table>
<tr>
<th>Platform</th>
<th>Compiler</th>
<th>Options</th>
</tr>
<tr>
<td>Solaris x86</td>
<td>Sun CC</td>
<td><code>./configure CXX=CC CC=cc</code></td>
</tr>
<tr>
<td>Solaris x86-64</td>
<td>Sun CC</td>
<td><code>./configure CXX=CC CC=cc CFLAGS=-xarch=amd64 CXXFLAGS=-xarch=amd64</code></td>
</tr>
<tr>
<td>Solaris SPARC</td>
<td>Sun CC</td>
<td><code>/configure CXX=CC CC=cc</code></td>
</tr>
<tr>
<td>Solaris SPARCv9</td>
<td>Sun CC</td>
<td><code>./configure CXX=CC CC=cc CFLAGS=-xarch=v9 CXXFLAGS=-xarch=v9</code></td>
</tr>
<tr>
<td>AIX PowerPC</td>
<td>IBM XL C++</td>
<td><code>./configure CXX=xlC_r CC=xlc_r</code><br/>
<code>gmake libxerces_c_la_LDFLAGS=-qmkshrobj</code></td>
</tr>
<tr>
<td>AIX PowerPC-64</td>
<td>IBM XL C++</td>
<td><code>export OBJECT_MODE=64</code><br/>
<code>./configure CXX=xlC_r CC=xlc_r CXXFLAGS=-q64 CFLAGS=-q64</code><br/>
<code>gmake libxerces_c_la_LDFLAGS=-qmkshrobj</code></td>
</tr>
<tr>
<td>HP-UX IA-64-32</td>
<td>HP aCC</td>
<td><code>./configure CXX=aCC CC=aCC CFLAGS=-mt CXXFLAGS=-mt LDFLAGS=-mt</code></td>
</tr>
<tr>
<td>HP-UX IA-64</td>
<td>HP aCC</td>
<td><code>./configure CXX=aCC CC=aCC CFLAGS="-mt +DD64" CXXFLAGS="-mt +DD64" LDFLAGS="-mt +DD64"</code></td>
</tr>
<tr>
<td>Mac OS X x86-64</td>
<td>GCC</td>
<td><code>/configure CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" </code></td>
</tr>
<tr>
<td>Mac OS X PowerPC-64</td>
<td>GCC</td>
<td><code>./configure CFLAGS="-arch ppc64" CXXFLAGS="-arch ppc64"</code></td>
</tr>
<tr>
<td>Mac OS X x86/PowerPC</td>
<td>GCC</td>
<td><code>./configure --disable-dependency-tracking CFLAGS="-arch i386 -arch ppc" CXXFLAGS="-arch i386 -arch ppc"</code></td>
</tr>
<tr>
<td>Mingw x86</td>
<td>GCC</td>
<td><code>./configure LDFLAGS=-no-undefined</code></td>
</tr>
<tr>
<td>Cygwin x86</td>
<td>GCC</td>
<td><code>./configure LDFLAGS=-no-undefined</code></td>
</tr>
</table>
<p/>
<note>
Note that different UNIX platforms use different system
environment variable for finding libraries. On Linux
and Solaris, the environment variable name is
<code>LD_LIBRARY_PATH</code>, on AIX it is
<code>LIBPATH</code>, on Mac OS X it is
<code>DYLD_LIBRARY_PATH</code>, and on HP-UX
it is <code>SHLIB_PATH</code>.
</note>
<note>
Note that Cygwin and MinGW are different from the UNIX platforms
in the way they find libraries at run time. While UNIX platforms
may use the <code>LD_LIBRARY_PATH</code> environment variable,
Cygwin and MinGW use the <code>PATH</code> environment variable.
</note>
<note>
On the MinGW platform when linking against the static
&XercesCName; library, make sure you compile your application
with the <code>-DXML_LIBRARY</code> preprocessor flag. Otherwise
the functions in the header files will be marked as to be
imported from a DLL and the linker will be unable to resolve
the &XercesCName; symbols.
</note>
</s3>
<anchor name="Windows"/>
<s3 title="Building on Windows using Microsoft Visual C++">
<p>&XercesCName; source distribution comes with Microsoft Visual C++ projects and solutions.
The following describes the steps you need to build with this compiler.</p>
<p>To build &XercesCName; from the source distribution you will
need to open the solution containing the project. The solutions
containing the &XercesCName; project files are in the following
sub-directories in the <code>&XercesC3SrcInstallDir;</code>
directory:</p>
<source>
(For VC6) projects\Win32\VC6\xerces-all\xerces-all.dsw
(For VC7.1) projects\Win32\VC7.1\xerces-all\xerces-all.sln
(For VC8) projects\Win32\VC8\xerces-all\xerces-all.sln
(For VC9) projects\Win32\VC9\xerces-all\xerces-all.sln
</source>
<p>Once you have the solution open, you need to build the
project named <code>XercesLib</code>. You can select
Debug/Release, Static/DLL, and, for VC8 and VC9, 32/64 bit
builds using the Configuration Manager dialog. You
can also select whether the &XercesCName; library
should use ICU for transcoding.</p>
<p>When building your own applications you need to make sure
that you are linking your application with the
&XercesC3WindowsLib;.lib library (or Debug/Static version of it)
and also that the associated DLL is somewhere in the
executable/DLL search path (<code>PATH</code>).</p>
<note>If you are linking your application to a static library,
then you will need to compile your application with the
XML_LIBRARY preprocessor define in order
to turn off the DLL import/export mechanism. This is
also the case for the MinGW platform.</note>
<p>If you would also like to build tests and/or samples, inside
the solution files mentioned above (<code>xerces-all.dsw</code>
or <code>xerces-all.sln</code>), you'll find several other
projects which are for the tests and samples. Select all
the tests/samples that you would like to build and then
right click on the selection. Choose "Build (selection
only)" to build all the selected projects in one shot.</p>
</s3>
<anchor name="BorlandBuilder"/>
<s3 title="Building on Windows using Borland C++ Builder">
<p>&XercesCName; source distribution comes with the
Borland C++ Builder 6 projects. The following describes the steps you
need to build with this compiler.</p>
<p>The library and example projects are all contained in the
Xerces-all project group:
<code>&XercesC3SrcInstallDir;\projects\Win32\BCB6\Xerces-all\Xerces-all.bpg</code>.
Each project in the group refers a directory below <code>Xerces-all\</code>.
For example, the XercesLib project files are contained in the directory
<code>&XercesC3SrcInstallDir;\projects\Win32\BCB6\Xerces-all\XercesLib</code>.</p>
<p>To build a project, open the project manager, double click on the project
name, and select "Project -> Build" from the menu. For example, double click
on XercesLib.dll in the manager then select "Project -> Build XercesLib" from
the menu.
</p>
</s3>
<anchor name="BorlandCC"/>
<s3 title="Building on Windows using Borland C++">
<p>&XercesCName; source distribution comes with the Borland C++ makefiles. The
following describes the steps you need to build &XercesCName; with this compiler.</p>
<ol>
<li>Change to the <code>&XercesC3SrcInstallDir;\projects\Win32\BCC.551\Xerces-all</code> directory</li>
<li>Run <code>MakeBuildDirs.bat</code></li>
<li><code>make -f Xerces-all.mak</code> to build the library, examples, and tests.</li>
</ol>
</s3>
</s2>