Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 058bd62f54850fdc6f0231b268975025 > files > 2752

antlr3-C-docs-3.4-17.mga7.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ANTLR3C: Building From Source</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ANTLR3C
   &#160;<span id="projectnumber">3.3.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('build.html','');});
/* @license-end */
</script>
<div id="doc-content">
<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Building From Source </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The C runtime is provided in source code form only as there are too many binary versions to sensibly maintain binaries on www.antlr.org.</p>
<p>The runtime code is provided with .sln and .vcproj files for Visual Studio 2005 and 2008, and <b>configure</b> files for building and installation on UNIX or other systems that support this tool. If your system is neither Windows nor <b>configure</b> compatible, then you should find it reasonable to build the code manually (see section "Building Manually".)</p>
<h1><a class="anchor" id="src"></a>
Source Code Organization</h1>
<p>The source code expands from a tar/zip file to give you the following directories:</p>
<ul>
<li><b>./</b> The location of the configure script and the antlr3config.h file generated by the running the configure script.This directory also contains the solution and project files for visual studio 2005 and 2008.</li>
<li><b>./src</b> The location of all the C files in the project.</li>
<li><b>./include</b> The location of all the header files for the project</li>
<li><b>./doxygen</b> The location of documentation files such as the one that generates this page</li>
<li>Other ancillary directories used by the build or documentation process.</li>
</ul>
<h1><a class="anchor" id="winbuild"></a>
Building for Windows</h1>
<p>If you are building for Cygwin, or a similar UNIX on Windows System, follow the "Building With Configure" instructions below.</p>
<p>Note that the runtime is no longer compatible with the VC6 Microsoft compiler. If you absolutely need to build with this compiler, you can probably hack the source code to deall with the pieces that VC6 cannot handle such as the ULL suffix for constants.</p>
<p>If you wish to build the binaries for Windows using Visual Studio 2005, or 2008 you may build using the IDE:</p><ol type="1">
<li>Open the C.sln file</li>
<li>Select batch Build from the Build menu</li>
<li>Select all configurations and press the build button.</li>
</ol>
<p>If you wish or need to build the libraries from the command line, then you must use a Windows command shell configured for access to VS2005/VS2008 compilers, such as the one that is started from:</p>
<p><em>Start-&gt;Microsoft Visual Studio 2005-&gt;Visual Studio Tools-&gt;Visual Studio 2005 Command Prompt</em></p>
<p>There appears to be no way to build all targets at once in a batch mode from the command line, so you may build one or all of the following: </p><pre class="fragment">   C:\antlrsrc\code\antlr\main\runtime\C&gt; DEVENV C.sln /Build ReleaseDLL
   C:\antlrsrc\code\antlr\main\runtime\C&gt; DEVENV C.sln /Build Release
   C:\antlrsrc\code\antlr\main\runtime\C&gt; DEVENV C.sln /Build DebugDLL
   C:\antlrsrc\code\antlr\main\runtime\C&gt; DEVENV C.sln /Build Debug
</pre> <pre class="fragment">After the build is complete you will find the \c.\cDLL and \c.\cLIB files under the directory containing C.sln, 
in a subdirectory named after the /Build target. In the Release and Debug targets, you will find that there is only a \c.\cLIB archive file, 
which you can link directly into your own projects if you wish to avoid the DLL. In \c ReleaseDLL and \c DebugDLL you will find both a 
\c .LIB file which you should link your projects with and a DLL. The library and names on Windows are as follows:

\verbatim
</pre><ul>
<li>ReleaseDLL : ANTLR3C.DLL and ANTLR3C_DLL.LIB</li>
<li>DebugDLL : ANTLR3CD.DLL and ANTLR3CD_DLL.LIB</li>
<li>Release : ANTLR3C.LIB</li>
<li>Debug : ANTLR3CD.LIB  <pre class="fragment">There currently no .msi modules or other installs built for Windows, so you must place the DLLs in a directory referenced 
by the PATH environment variable and make the include directory available to your project configurations.


\section configure Building with configure

Before starting, make sure that you are using a source code distribution and not the source code directly from the
Perforce repository. If you use the source from the perforce tree directly, you will find that there is no configure
script as this is generated as part of the distribution build by the maintainers. If you feel the need to build from
the distribution tree then you must have all the autobuild packages available on your system and can generate the
configure script using autoreconf. If you are not familiar with these tools, then please use the tgz files in the
dist subdirectory (or downloaded from the ANTLR web site).

The source code file should be expanded in a directory of your choice (probably your working directory) using the command:

\verbatim
</pre> gzip -dc antlrtgzname.tar.gz | tar xvf -  <pre class="fragment">Where: &lt;b&gt;antlrtgzname.tar.gz&lt;/b&gt; is of course the name of the tar when you downloaded it. You should find a \b configure script in the sub directory thus created.

The configure script accepts the usual options, such as --prefix= but the default is to build in the source directory and to place libraries in 
&lt;b&gt;/usr/local/lib&lt;/b&gt; and include files (for building your recognizers) in &lt;b&gt;/usr/local/include&lt;/b&gt;. There are also a number of antlr specific options, which you may wish to utilize. The command:
\verbatim
</pre> ./configure &ndash;help  <pre class="fragment">Will document the latest incarnations of these options in case this documentation is ever out of date. At this time the options are:

\verbatim
</pre> &ndash;enable-debuginfo Compiles debug info into the library (default no) &ndash;enable-64bit Turns on flags that produce 64 bit object code if any are required (default no)  <pre class="fragment">Unless you need 64 bit builds, or a change in library types, you will generally use the configure command without options:

Here is a sample configure output:

\verbatim
</pre> [jimi@localhost dist]$ tar zvxf libantlr3c-3.0.0-rc8.tar.gz</li>
</ul>
<p>libantlr3c-3.0.0-rc8/ libantlr3c-3.0.0-rc8/antlr3config.h libantlr3c-3.0.0-rc8/src/ libantlr3c-3.0.0-rc8/src/antlr3stringstream.c ... libantlr3c-3.0.0-rc8/antlr3config.h.in  </p><pre class="fragment">[jimi@localhost dist]$ cd libantlr3c-3.0.0-rc 
</pre> <pre class="fragment">[jimi@localhost libantlr3c-3.0.0-rc8]$ ./configure

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for xlc... no
checking for aCC... no
checking for gcc... gcc
...
checking for strdup... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating antlr3config.h
config.status: antlr3config.h is unchanged
config.status: executing depfiles commands
</pre> <pre class="fragment">Having configured the library successfully, you need only make it, and install it:

\verbatim
</pre><p> [jimi@localhost libantlr3c-3.0.0-rc8]$ make  </p><pre class="fragment">make  all-am
make[1]: Entering directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8'
/bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -Iinclude -Iinclude    -O2  -MT antlr3baserecognizer.lo -MD -MP -MF .deps/antlr3baserecognizer.Tpo -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo './'`src/antlr3baserecognizer.c
...
gcc  -shared  .libs/antlr3baserecognizer.o .libs/antlr3basetree.o .libs/antlr3basetreeadaptor.o .libs/antlr3bitset.o .libs/antlr3collections.o .libs/antlr3commontoken.o .libs/antlr3commontree.o .libs/antlr3commontreeadaptor.o .libs/antlr3commontreenodestream.o .libs/antlr3cyclicdfa.o .libs/antlr3encodings.o .libs/antlr3exception.o .libs/antlr3filestream.o .libs/antlr3inputstream.o .libs/antlr3intstream.o .libs/antlr3lexer.o .libs/antlr3parser.o .libs/antlr3string.o .libs/antlr3stringstream.o .libs/antlr3tokenstream.o .libs/antlr3treeparser.o .libs/antlr3rewritestreams.o .libs/antlr3ucs2inputstream.o   -Wl,-soname -Wl,libantlr3c.so -o .libs/libantlr3c.so
ar cru .libs/libantlr3c.a  antlr3baserecognizer.o antlr3basetree.o antlr3basetreeadaptor.o antlr3bitset.o antlr3collections.o antlr3commontoken.o antlr3commontree.o antlr3commontreeadaptor.o antlr3commontreenodestream.o antlr3cyclicdfa.o antlr3encodings.o antlr3exception.o antlr3filestream.o antlr3inputstream.o antlr3intstream.o antlr3lexer.o antlr3parser.o antlr3string.o antlr3stringstream.o antlr3tokenstream.o antlr3treeparser.o antlr3rewritestreams.o antlr3ucs2inputstream.o
ranlib .libs/libantlr3c.a
creating libantlr3c.la

(cd .libs &amp;&amp; rm -f libantlr3c.la &amp;&amp; ln -s ../libantlr3c.la libantlr3c.la)
make[1]: Leaving directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8' 
</pre> <pre class="fragment">[jimi@localhost libantlr3c-3.0.0-rc8]$ sudo make install
</pre> <pre class="fragment">make[1]: Entering directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8'
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
 /bin/sh ./libtool --mode=install /usr/bin/install -c  'libantlr3c.la' '/usr/local/lib/libantlr3c.la'
/usr/bin/install -c .libs/libantlr3c.so /usr/local/lib/libantlr3c.so
/usr/bin/install -c .libs/libantlr3c.lai /usr/local/lib/libantlr3c.la
/usr/bin/install -c .libs/libantlr3c.a /usr/local/lib/libantlr3c.a
...
 /usr/bin/install -c -m 644 'include/antlr3stringstream.h' '/usr/local/include/antlr3stringstream.h'
...
 /usr/bin/install -c -m 644 'antlr3config.h' '/usr/local/include/antlr3config.h'
make[1]: Leaving directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8'

[jimi@localhost libantlr3c-3.0.0-rc8]$
</pre> <pre class="fragment">You are now ready to generate C recognizers and compile and link them with the ANTLR 3 C Runtime.


\section buildman Building Manually

The only step that configure performs that cannot be done
manually (without effort) is to produce the header file
\c antlr3config.h, which contains typedefs of the fundamental types
that your local C compiler supports. The easiest way to produce
this file for your system, if you cannot port \b automake and \b configure
to the system is:

-# Run configure on a system that does support configure
-# Copy the generated \c antlr3config.h file to the target system
-# Edit the file locally and change any types that differ on this
  system to the target systems. There are only a few types and you should
  find this relatively easy.

Having produced a compatible antlr3config.h file, then you should be able to
compile the source files in the \c ./src subdirectory, providing an include path
to the location of \c antlr3config.h and the \c ./include subdirectory. Something akin
to:
\verbatim
</pre><p>~/C/src: cc -c -O -I.. -I../include *.c</p>
<pre class="fragment">Having produced the .o (or equivalent) files for the local system you can then
build an archive or shared library for the C runtime.

When you wish to build and link with the C runtime, specify the path to the
supplied header files, and the path to the library that you built.
</pre> </div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="index.html">ANTLR3 C Runtime API and Usage Guide.</a></li>
    <li class="footer">Generated on Fri May 3 2019 05:59:12 for ANTLR3C by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>