You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

342 lines
14 KiB

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