GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / doc / windows.html
1 <html><head>
2 <title>Building Cyrus SASL on Windows</title>
3
4 </head>
5
6 <body>
7 <h1>Building Cyrus SASL on Windows</h1>
8
9 Note, that Cyrus SASL on Windows is still laregely a "work in progress".
10 So far only the main library, plugins (SASLDB using SleepyCat, no MySQL)
11 and several applications (see the list below) can be built. In particular,
12 saslauthd doesn't compile on Windows.
13
14 <h2>Prerequisites</h2>
15
16 <ul>
17 <li>Visual Studio. We have tested Visual Studio 6 and Visual Studio 7 (.NET).
18 By default we are using Visual Studio 7 (both 2002 and 2003 versions were tested). If you want to use Visual Studio 6,
19 you need to remove the leading # character from the line containing "<tt>#VCVER=6</tt>" in win32/common.mak.
20
21 <li>The latest Platform SDK. We are currently using March 2006. (The earliest tested version was November 2001.)
22
23 <li>SleepyCat include files and libraries are required to buil SASLDB plugin,
24 saslpasswd2.exe and sasldblistusers2.exe. We have tested SleepyCat 4.1.X-4.4.X.
25
26 <li>If you are building directly from CVS, you'll need the <a
27 href="http://www.cygwin.com/">Cygwin</a> Unix-compatibility
28 environment to create the <tt>_init.c</tt> files needed for dynamic
29 loading. Cygwin is <em>not</em> required for building from our tar
30 distribution.  
31
32 </ul>
33
34 <h2>Step by step</h2>
35
36 These directions assume that you've untarred the library or used CVS
37 and the sources are in <tt>C:\SASL</tt>.
38
39 <h3>preparing to build (cvs only!)</h3>
40
41 Start a cygwin shell and create the dynamic loading stubs:
42
43 <pre>
44 % cd /cygdrive/c/sasl/plugins
45 % sh makeinit.sh
46 </pre>
47
48 <h3>building using NMake</h3>
49
50 Open a "Windows 2000 build environment" from the SDK's Start Menu and
51 use "<tt>nmake /f NTMakefile</tt>" to build.
52
53 <p>To build a debug verison, use "<tt>nmake /f NTMakefile
54 CFG=Debug</tt>". For a production version, "<tt>nmake /f NTMakefile
55 CFG=Release</tt>". If you don't specify CFG parameter, production
56 version will be built by default.
57
58 <p>As Windows build requires SleepyCat, there are additional options
59 that has to be provided to NMake on the command line.
60 If SleepyCat sources are located in <tt>c:\packages\db\4.1.24</tt>
61 and built library in <tt>c:\packages\db\4.1.24\build_win32\Release_static</tt>,
62 you should add something like
63 <tt>DB_INCLUDE=c:\packages\db\4.1.24\build_win32</tt>
64 and <tt>DB_LIBPATH=c:\packages\db\4.1.24\build_win32\Release_static</tt>.
65 <br>Also note, that the <tt>DB_LIB</tt> defines the name of the SleepyCat library
66 to link against. It defaults to libdb41s.lib.
67 <br>If you don't pass the parameters described above, NMake will pick the
68 defaults, which is probably not what you want. 
69
70 <p>Another option of interest is <tt>STATIC</tt>.
71 It specifies which version of the standard C library
72 to use. The default is "no", meaning that the standard C library
73 from the MSVCRT.DLL will be used.
74
75 <p>Example:
76 <pre>
77 Targeting Windows 2000 and IE 5.0 RETAIL
78
79 C:\Program Files\Microsoft SDK> cd \sasl
80
81 C:\sasl> nmake /f NTMakefile DB_INCLUDE=c:\packages\db\4.1.24\build_win32
82 DB_LIBPATH=c:\packages\db\4.1.24\build_win32\Release_static
83
84 No configuration specified. Defaulting to Release.
85 Using MSVCRT.dll as C library by default.
86 Defaulting SleepyCat library name to libdb41s.lib.
87 Codegeneration defaulting to /MD.
88 ...
89
90 </pre>
91
92 <p>SASL NTMakefile also understands "clean" target that you can use to clean all files generated by the compiler.
93
94 <pre>
95 C:\sasl> nmake /f NTMakefile clean
96
97 Microsoft (R) Program Maintenance Utility Version 7.00.9466
98 Copyright (C) Microsoft Corporation.  All rights reserved.
99
100         cd lib && nmake /f NTMakefile                    clean
101
102 Microsoft (R) Program Maintenance Utility Version 7.00.9466
103 Copyright (C) Microsoft Corporation.  All rights reserved.
104
105 No configuration specified. Defaulting to Release.
106 Using MSVCRT.dll as C library by default.
107 Defaulting SleepyCat library name to libdb41s.lib.
108 Defaulting SleepyCat include path to c:\work\isode\db\build_win32.
109 Defaulting SleepyCat library path to c:\work\isode\db\build_win32\Release_static.
110 ...
111
112 </pre>
113
114 <h3>building additional plugins</h3>
115
116 <p>Specify "GSSAPI=&lt;type&gt;" parameter if you want to enable GSSAPI plugin.
117 Currently only &lt;type&gt;=CyberSafe is supported and this will build the plugin
118 that links against CyberSafe Kerberos.
119
120 GSSAPI depends on <tt>GSSAPI_INCLUDE</tt> and <tt>GSSAPI_LIBPATH</tt> parameters.
121 You can either specify them on the command line or edit the defaults in win32\common.mak
122
123 <p>Specify "SQL=&lt;type&gt;" parameter if you want to enable SQL plugin.
124 Currently only &lt;type&gt;=SQLITE is supported and this will build the plugin
125 that links against SQLITE (www.sqlite.org).
126
127 SQL=&lt;SQLITE&gt; depends on <tt>SQLITE_INCLUDES</tt> and <tt>SQLITE_LIBPATH</tt> parameters.
128 You can either specify them on the command line or edit the defaults in win32\common.mak
129
130 <p>Specify "NTLM=1" parameter if you want to enable NTLM plugin.
131 I.e. "<tt>nmake /f NTMakefile NTLM=1</tt>"
132
133 <p>Specify "SRP=1" parameter if you want to enable SRP plugin.
134 You can also specify "DO_SRP_SETPASS=1" if you want to enable SRP setpass functionality.
135
136 <p>Specify "OTP=1" parameter if you want to enable OTP plugin.
137
138 <p>NTLM, SRP and OTP plugins depend on OpenSSL. You can either specify
139 <tt>OPENSSL_INCLUDE</tt> and <tt>OPENSSL_LIBPATH</tt> parameters on the command
140 line or edit the defaults in win32\common.mak
141 Note, that unless you are building one of those plugins, OpenSSL is not required!
142
143 <p>If you want to build multiple additional plugins at once, you can specify
144 multiple parameters described above, for example "<tt>nmake /f NTMakefile NTLM=1 SRP=1 OPT=1</tt>"
145
146 <h3>limitations</h3>
147
148 Currently all plugins but KerberosV4 (kerberos4.c) and PASSDSS (passdss.c) can be built on Windows.
149 However limited testings was done for some plugins as listed below:
150
151 <ul>
152 <li>GSSAPI - tested using CyberSafe,
153 <li>SASLDB - only SleepyCat version can be built,
154 <li>SQL - using SQLITE, not tested
155 </ul>
156
157 The following executables were built and tested (to some extend):
158 In sample:
159 <ul>
160 <li>sample-client
161 <li>sample-server
162 </ul>
163 In utils:
164 <ul>
165 <li>sasldblistusers2
166 <li>saslpasswd2
167 <li>testsuite
168 <li>pluginviewer
169 </ul>
170
171 Note that saslauthd is <em>NOT</em> in this list.
172
173 <h3>testing</h3>
174
175
176 <h3>creating an MSI</h3>
177
178 </body>
179
180 </html>