Merged silc_1_0_branch to trunk.
[silc.git] / lib / doc / building.html
1 <big><b>Building the Toolkit</b></big>
2
3 <br />&nbsp;<br />
4 SILC Toolkit works on various platforms, such as on several Unix systems and 
5 on Windows.  Building of the Toolkit on some platform may differ from the
6 other.  This document describes how to build the Toolkit from the sources,
7 to create linkable libraries and binaries, on all platforms the Toolkit
8 support.
9
10 <br />&nbsp;<br />
11 The building instructions for all platforms are also included in the Toolkit
12 package.  Please refer to the INSTALL file for general building instructions
13 for Unix systems, README.WIN32 for building on Windows systems, and
14 README.MACOSX for building on Mac OS X.
15
16 <br />&nbsp;<br />
17 <li><a href="#unix">Building on Unix & Linux</a><br />
18 <li><a href="#windows">Building on Windows</a><br />
19 <li><a href="#macosx">Building on Mac OS X</a>
20
21 <br />&nbsp;<br />&nbsp;<br />
22 <b><a name="unix"></a>Building on Unix & Linux</b>
23
24 <br />&nbsp;<br />
25 Building the Toolkit on Unix will produce binaries of all libraries, and
26 SILC Client and SILC Server.  The Toolkit package includes also Client and
27 Server as an example applications, and they are compiled automatically.
28 The libraries are compiled to provide staticly linkable libraries.  Two
29 libraries are produced: libsilc.a and libsilcclient.a.  The libsilc.a includes
30 everything else except the Client library.  The libsilcclient.a includes
31 only the Client library.
32
33 <br />&nbsp;<br />
34 To build Toolkit on Unix systems, give commands:
35
36 <br />&nbsp;<br />
37 <tt>
38 ./configure<br />
39 make
40 </tt>
41
42 <br />&nbsp;<br />
43 On some systems you may need to give "gmake" command instead of "make".  The
44 ./configure can take several options as arguments.  To see them all give
45 command:
46
47 <br />&nbsp;<br />
48 <tt>./configure --help</tt>
49
50 <br />&nbsp;<br />
51 The most important configuration options you may consider to use are:
52
53 <br />&nbsp;<br />
54 <tt>--enable-debug</tt>
55
56 <br />&nbsp;<br />
57 If you would like to enable the debugging for the compiled binaries
58 you can give this option to the `configure'.  It is recommended to use
59 this option when you are doing development with Toolkit.  It is helpful
60 to enable run-time debugging.
61
62 <br />&nbsp;<br />
63 <tt>--with-gmp[=DIR]</tt>
64
65 <br />&nbsp;<br />
66 If you wish to use GMP library for arbitrary precision arithmetic
67 library instead of using the MPI library included in the package, you can
68 give the --with-gmp[=DIR] option to the `configure'. The DIR is the upper
69 path in your system which contains lib/ and include/ for GMP library. 
70
71 <br />&nbsp;<br />
72 <tt>--with-iconv[=DIR]</tt>
73
74 <br />&nbsp;<br />
75 If your system doesn't provide iconv() function in its native libraries
76 (usually libc) or if this function is broken (e.g. older Solaris systems),
77 you may want to use libiconv instead.  The DIR is the upper path in your
78 system which contains lib/ and include/ for libiconv (e.g. /usr/local).
79
80 <br />&nbsp;<br />
81 <tt>--without-pthreads</tt>
82
83 <br />&nbsp;<br />
84 If you do not want to compile the programs with POSIX multi-threads support
85 you can give --without-pthreads option.  This will disable the SILC Thread
86 API and SILC Mutex API.  Furthermore if SILC Thread API is used when this
87 option is used, the routines work, but do not work in threads (are run
88 in the calling process and can block the process).
89
90 <br />&nbsp;<br />
91 <tt>--disable-asm</tt>
92
93 <br />&nbsp;<br />
94 If you have trouble compiling the assembler optimized code in the
95 package or does not want to use them, you can give the --disable-asm
96 option to the `configure' script.  This will assure that assembler
97 optimized code is not compiled in.
98
99 <br />&nbsp;<br />
100 <tt>--enable-ipv6</tt>
101
102 <br />&nbsp;<br />
103 The `configure' will attempt to check for IPv6 support in your system.
104 However, if it fails, but you still want to compile in the IPv6 support
105 you can give --enable-ipv6 option to force the IPv6 support.
106
107 <br />&nbsp;<br />
108 After compilation you can install the Toolkit into your system by giving
109 the command:
110
111 <br />&nbsp;<br />
112 <tt>make install</tt>
113
114
115 <br />&nbsp;<br />&nbsp;<br />
116 <b><a name="windows"></a>Building on Windows</b>
117
118 <br />&nbsp;<br />
119 The Toolkit can be compiled several different ways on Windows.  However,
120 this document describes the method to build the Toolkit to produce native
121 Win32 binaries.  The Toolkit package can also be compiled on Cygwin and
122 MinGW.  For these systems please refer to the README.WIN32 file in the
123 Toolkit package.
124
125 <br />&nbsp;<br />
126 The Toolkit package includes ready MSVC++ Workspace files, that will 
127 automatically compile the Toolkit.  The MSVC++ workspace and project files
128 resides in the win32/ subdirectory of the Toolkit package.  The `silc.dsw'
129 file is the workspace file that automatically supports compiling the Toolkit
130 and to generate the SILC Core DLL and SILC Client DLL libraries.
131
132 <br />&nbsp;<br />
133 The SILC Core DLL is named as libsilc and will generate libsilc.dll, and
134 the SILC Client DLL is named as libsilcclient and will generate
135 libsilcclient.dll.  Both of the projects also automatically generates
136 libsilc.lib and libsilcclient.lib import libraries that may be used to
137 link against a client application.
138
139 <br />&nbsp;<br />
140 Generally you do not need to do any specific settings to compile the
141 Toolkit.  However, you must compile the libsilc before compiling the
142 libsilclient, since the SILC Client DLL depends on the SILC Core DLL.
143 You may compile the DLLs as either Release or Debug version.  Just select
144 the preferred method of compilation.  The Debug version will compile the
145 SILC Toolkit with run-time debugging support, which is recommended when
146 doing development with the Toolkit.
147
148 <br />&nbsp;<br />&nbsp;<br />
149 <b><a name="macosx"></a>Building on Mac OS X</b>
150
151 <br />&nbsp;<br />
152 Building the Toolkit on Mac OS X is almost identical on compiling on Unix
153 system.  The reason for this is that the Mac OS X is Unix based operating
154 system.  To build the Toolkit on Mac OS X, give the following commands:
155
156 <br />&nbsp;<br />
157 <tt>
158 setenv CFLAGS -no-cpp-precomp<br />
159 ./configure powerpc<br />
160 make
161 </tt>
162
163 <br />&nbsp;<br />
164 The ./configure can take several options as arguments.  To see them all give
165 command:
166
167 <br />&nbsp;<br />
168 <tt>./configure --help</tt>
169
170 <br />&nbsp;<br />
171 If you do not want to compile the applications, or they do not compile on
172 your system, you can also choose to compile only the libraries, and skip
173 all applications.  In this case, before giving the "make" command, go
174 to the lib/ subdirectory, and give "make" command there:
175
176 <br />&nbsp;<br />
177 <tt>
178 cd lib/<br />
179 make
180 </tt>
181
182 <br />&nbsp;<br />
183 After compilation you can install the Toolkit into your system by giving
184 the command:
185
186 <br />&nbsp;<br />
187 <tt>make install</tt>