select * from section<?xml version='1.0' encoding='iso-8859-1' ?>
<article>
<id><![CDATA[43]]>></id>
<author><nick><![CDATA[Juan M. Casillas]]>></nick>
<email><![CDATA[juanm.casillas@jmcresearch.com]]>></email>
></author>
<title><![CDATA[Setting up libnetcomm]]>></title>
<subtitle><![CDATA[Overview]]>></subtitle>
<body><![CDATA[&lt;p&gt;
&lt;h2&gt;Index&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;configure.html#1&quot;&gt;Introduction&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;configure.html#2&quot;&gt;Arch &amp; compiler overview&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;configure.html#3&quot;&gt;Requirements&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;configure.html#4&quot;&gt;Uncompress distro&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;configure.html#5&quot;&gt;Choose install directory&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;configure.html#6&quot;&gt;Configuring Makefile&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;configure.html#7&quot;&gt;Compiling and installing&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;configure.html#8&quot;&gt;Using the library&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;configure.html#9&quot;&gt;Bugs &amp; support&lt;/a&gt;
&lt;/ol&gt;
&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;#1&quot;&gt;Introduction&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;

This library provides the required class and framework to manage TCP,
TCPSSL and UDP connections. This library is part of a bigger project
called IT/m, but you can use it as a framework for new developements.
This section describes the installation and configuration steps of the
library.
&lt;/p&gt;


&lt;h2&gt;&lt;a name=&quot;#2&quot;&gt;Arch &amp; compiler overview&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;
This library has been developed using a g++ 2.95.2 version. Also, It has 
been tested in a 2.95.3 version, and it works. My libc library version is
2.1.3. The distribution is a Debian potato 2.2. Finally, my arch is a
intel 686 processor, with a 2.2.17 kernel.
&lt;/p&gt;


&lt;h2&gt;&lt;a name=&quot;#3&quot;&gt;Requirements&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;
You need at least the 2.95.2 g++ compiler, a gnu makefile and the linux threads
installed. If you plan to mess up with the tcpssl class, you need also a
working openssl environment, with all the include and library files
propertly installed. For install and setup openssl, see the openssl
&lt;a href=&quot;http://www.openssl.org&quot;&gt; web site&lt;/a&gt;. The version of openssl used for test
and developement is 0.9.5a.
&lt;/p&gt;

&lt;p&gt;
The developement platform is a linux (intel) box, so if you plan to migrate 
this library to other platform, please send me the patches to include them 
in the main developement tree.
&lt;/p&gt;

&lt;p&gt;
This library depends on libtool (at least version 0.85) so you need to have
it installed in your system. You can download it
&lt;a href=&quot;libtool/&quot;&gt;from the web site&lt;/a&gt; Also, you can find the setup and
installation instructions there.
&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;#4&quot;&gt;Uncompress distro&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;
The first thing is uncompress the distribution in a directory. For example,
I will use the /tmp directory:
&lt;/p&gt;

&lt;pre&gt;
        halt% tar xfz libnetcomm-0_94.tar.gz 
        halt% cd libnetcomm_0_94
        halt% pwd
        /tmp/libnetcomm_0_94
        halt%
&lt;/pre&gt;

&lt;p&gt;
Ok, remember this directory, because we need it in the following step.
&lt;/p&gt;


&lt;h2&gt;&lt;a name=&quot;#5&quot;&gt;Choose install directory&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;
We have to plan where to install the library. For developement pourpouses,
is better having this libraries separated from the ?production? ones, so
I usually create a directory in my home, called ?devel?. The only drawback
of this configuration, is that you need to setup the LD_LIBRARY_PATH
environment variable propertly to handle this directory. If you don?t
want to set this variable, you can insert the directory in the 
/etc/ld.so.conf file and issue a ?ldconfig? command.
&lt;/p&gt;

&lt;p&gt;
In this example, I choose as install directory /home/assman/devel. So I
create it first:
&lt;/p&gt;

&lt;pre&gt;
        halt% mkdir -p /home/assman/devel/{include,lib}
&lt;/pre&gt;


&lt;h2&gt;&lt;a name=&quot;#6&quot;&gt;Configuring Makefile&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;
Now we go to the libnetcomm directory and edit the Makefile file. In the example,
the libnetcomm directory is /tmp/libnetcomm_0_94 so:
&lt;/p&gt;

&lt;pre&gt;
        halt% cd /tmp/libnetcomm_0_94
        halt% vi Makefile
&lt;/pre&gt;

&lt;p&gt;
First, we find the first variable in the file, BASEDIR and set up to the 
libnetcomm directory:
&lt;/p&gt;

&lt;pre&gt;
        export BASEDIR=/tmp/libnetcomm_0_94
&lt;/pre&gt;

&lt;p&gt;
Second, we find the second variable, INSTALLDIR, and set up to the installation
directory:
&lt;/p&gt;

&lt;pre&gt;
        INSTALLDIR=/home/assman/devel
&lt;/pre&gt;

&lt;p&gt;
Third, we need to point to the libtool header files, so find the variable
LIBTOOL_INCLUDE and point it to this place. In this example, I assume that
libtool is installed under /home/assman/devel/include, so I setup this
variable in the Makefile:
&lt;/p&gt;

&lt;pre&gt;
        export LIBTOOL_INCLUDE = /home/assman/devel/include
&lt;/pre&gt;

&lt;p&gt;
Now, if you want to add the sslhelper to the library, you have to install the
openssl?s developement enviroment and uncomment the OPTIONAL_ELEMENTS
entry in the makefile. For proper work, this makefile assumes that the
include files are installed in a place that the compiler can found them
(/usr/include) If not, you have to insert the include directories in the
INCLUDE variable of the Makefile.
&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;#7&quot;&gt;Compiling and installing&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;
Now issue a ?make? command to compile all the elements of the library, and to
build it. If no problem is found, you can install the library in the choosed
directory. Note that you need to have write permissions in this directory,
so you should become root if you want to install it in a system directory
(e.g. /usr/local). Now, issue a ?make install?. This will copy and create
all the links and required files. 
&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;#8&quot;&gt;Using the library&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;
If you plan to use the library for developement, you need to include the
header files in your programs, and link with the library to proper work
Also, you need to setup the LD_LIBRARY_PATH if you want to run the 
programs you compile. In our example, a setup for the LD_LIBRARY_PATH
can be:
&lt;/p&gt;

&lt;pre&gt;
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/assman/devel
&lt;/pre&gt;


&lt;h2&gt;&lt;a name=&quot;#9&quot;&gt;Bugs &amp; support&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;
This library has been in-deep tested, but some bugs can arised. Also, you
can have some ideas, or improvements for this library. Please send me
an email if you found some bug, if you need support installing this 
library, of if you port this library to a different platform. Thanks for
your help. 
&lt;/p&gt;
]]>></body>
<keywords><![CDATA[configure ]]>></keywords>
<stamp><![CDATA[1068988215]]>></stamp>
<updated><![CDATA[1070911507]]>></updated>
<language><![CDATA[0]]>></language>
<sections><section><![CDATA[LibNetComm]]></section>
></sections>
<site><![CDATA[http://www.jmcresearch.com]]>></site>
<url><![CDATA[http://www.jmcresearch.com//src/articlehelper.php?action=preview&amp;id=43]]>></url>
</article>