ec18e30c98b6dd2f872a495029a86a17893cafb1
[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-irssi</tt><br />
82 <tt>--without-silcd</tt>
83
84 <br />&nbsp;<br />
85 By default the SILC Toolkit will also build the Irssi SILC client and
86 the SILC Server which use the SILC Toolkit as well.  If you do not
87 wish to compile these applications you can give --without-irssi to
88 not compile Irssi SILC client (irssi/ directory) and/or --without-silcd
89 to not compile SILC Server (silcd/ directory).  Other applications
90 the Toolkit does not build automatically.
91
92 <br />&nbsp;<br />
93 <tt>--without-pthreads</tt>
94
95 <br />&nbsp;<br />
96 If you do not want to compile the programs with POSIX multi-threads support
97 you can give --without-pthreads option.  This will disable the SILC Thread
98 API and SILC Mutex API.  Furthermore if SILC Thread API is used when this
99 option is used, the routines work, but do not work in threads (are run
100 in the calling process and can block the process).
101
102 <br />&nbsp;<br />
103 <tt>--disable-asm</tt>
104
105 <br />&nbsp;<br />
106 If you have trouble compiling the assembler optimized code in the
107 package or does not want to use them, you can give the --disable-asm
108 option to the `configure' script.  This will assure that assembler
109 optimized code is not compiled in.
110
111 <br />&nbsp;<br />
112 <tt>--enable-ipv6</tt>
113
114 <br />&nbsp;<br />
115 The `configure' will attempt to check for IPv6 support in your system.
116 However, if it fails, but you still want to compile in the IPv6 support
117 you can give --enable-ipv6 option to force the IPv6 support.
118
119 <br />&nbsp;<br />
120 After compilation you can install the Toolkit into your system by giving
121 the command:
122
123 <br />&nbsp;<br />
124 <tt>make install</tt>
125
126
127 <br />&nbsp;<br />&nbsp;<br />
128 <b><a name="windows"></a>Building on Windows</b>
129
130 <br />&nbsp;<br />
131 The Toolkit can be compiled several different ways on Windows.  However,
132 this document describes the method to build the Toolkit to produce native
133 Win32 binaries.  The Toolkit package can also be compiled on Cygwin and
134 MinGW.  For these systems please refer to the README.WIN32 file in the
135 Toolkit package.
136
137 <br />&nbsp;<br />
138 The Toolkit package includes ready MSVC++ Workspace files, that will 
139 automatically compile the Toolkit.  The MSVC++ workspace and project files
140 resides in the win32/ subdirectory of the Toolkit package.  The `silc.dsw'
141 file is the workspace file that automatically supports compiling the Toolkit
142 and to generate the SILC Core DLL and SILC Client DLL libraries.
143
144 <br />&nbsp;<br />
145 The SILC Core DLL is named as libsilc and will generate libsilc.dll, and
146 the SILC Client DLL is named as libsilcclient and will generate
147 libsilcclient.dll.  Both of the projects also automatically generates
148 libsilc.lib and libsilcclient.lib import libraries that may be used to
149 link against a client application.
150
151 <br />&nbsp;<br />
152 Generally you do not need to do any specific settings to compile the
153 Toolkit.  However, you must compile the libsilc before compiling the
154 libsilclient, since the SILC Client DLL depends on the SILC Core DLL.
155 You may compile the DLLs as either Release or Debug version.  Just select
156 the preferred method of compilation.  The Debug version will compile the
157 SILC Toolkit with run-time debugging support, which is recommended when
158 doing development with the Toolkit.
159
160 <br />&nbsp;<br />&nbsp;<br />
161 <b><a name="macosx"></a>Building on Mac OS X</b>
162
163 <br />&nbsp;<br />
164 Building the Toolkit on Mac OS X is almost identical on compiling on Unix
165 system.  The reason for this is that the Mac OS X is Unix based operating
166 system.  To build the Toolkit on Mac OS X, give the following commands:
167
168 <br />&nbsp;<br />
169 <tt>
170 setenv CFLAGS -no-cpp-precomp<br />
171 ./configure powerpc<br />
172 make
173 </tt>
174
175 <br />&nbsp;<br />
176 The ./configure can take several options as arguments.  To see them all give
177 command:
178
179 <br />&nbsp;<br />
180 <tt>./configure --help</tt>
181
182 <br />&nbsp;<br />
183 If you do not want to compile the applications, or they do not compile on
184 your system, you can also choose to compile only the libraries, and skip
185 all applications.  In this case, before giving the "make" command, go
186 to the lib/ subdirectory, and give "make" command there:
187
188 <br />&nbsp;<br />
189 <tt>
190 cd lib/<br />
191 make
192 </tt>
193
194 <br />&nbsp;<br />
195 After compilation you can install the Toolkit into your system by giving
196 the command:
197
198 <br />&nbsp;<br />
199 <tt>make install</tt>