Imported Upstream version 2.1.24~rc1.dfsg1
Ondřej Surý
12 years ago
0 | #Can this be autogenerated? | |
1 | #Keep in sync with include/sasl.h and win32/include/config.h | |
2 | SASL_VERSION_MAJOR=2 | |
3 | SASL_VERSION_MINOR=1 | |
4 | SASL_VERSION_STEP=24 | |
5 | ||
6 | !IF "$(STATIC)" == "" | |
7 | STATIC=yes | |
8 | !ENDIF | |
9 | ||
10 | # Uncomment the following line, if you want to use Visual Studio 6 | |
11 | #VCVER=6 | |
12 | ||
13 | # Use in Visual Studio 6 & 7: | |
14 | #EXCEPTHANDLING=/GX | |
15 | ||
16 | # Use in Visual Studio 8: | |
17 | EXCEPTHANDLING=/EHsc | |
18 | ||
19 | # Define compiler/linker/etc. | |
20 | ||
21 | CPP=cl.exe /nologo | |
22 | LINK32=link.exe /nologo | |
23 | LINK32DLL=$(LINK32) /dll | |
24 | LINK32EXE=$(LINK32) | |
25 | # It seems that -lib must be the first parameter | |
26 | LINK32LIB=link.exe /lib /nologo | |
27 | ||
28 | SYS_LIBS=ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib | |
29 | ||
30 | !IF "$(BITS)" == "64" | |
31 | SYS_LIBS=$(SYS_LIBS) bufferoverflowU.lib | |
32 | !ENDIF | |
33 | ||
34 | # Define the minimal Windows OS you want to run on:40 (NT), 50 (W2K), 51 (XP) | |
35 | # Default is no restrictions. Currently we only check for 51 or later. | |
36 | #TARGET_WIN_SYSTEM=51 | |
37 | ||
38 | !IF "$(TARGET_WIN_SYSTEM)" == "" | |
39 | !IF "$(VERBOSE)" != "0" | |
40 | !MESSAGE Applications and libraries should run on any Win32 system. | |
41 | !ENDIF | |
42 | TARGET_WIN_SYSTEM=0 | |
43 | !ENDIF | |
44 | ||
45 | # prefix variable is currently only being used by install target | |
46 | !IF "$(prefix)" == "" | |
47 | prefix=C:\CMU | |
48 | !IF "$(VERBOSE)" != "0" | |
49 | !MESSAGE Default installation directory is $(prefix). | |
50 | !ENDIF | |
51 | !ENDIF | |
52 | ||
53 | !IF "$(CFG)" == "" | |
54 | CFG=Release | |
55 | !IF "$(VERBOSE)" != "0" | |
56 | !MESSAGE No configuration specified. Defaulting to $(CFG). | |
57 | !ENDIF | |
58 | !ENDIF | |
59 | ||
60 | !IF "$(DB_LIB)" == "" | |
61 | DB_LIB=libdb41s.lib | |
62 | !IF "$(VERBOSE)" != "0" | |
63 | !MESSAGE Defaulting SleepyCat library name to $(DB_LIB). | |
64 | !ENDIF | |
65 | !ENDIF | |
66 | ||
67 | !IF "$(DB_INCLUDE)" == "" | |
68 | DB_INCLUDE=c:\work\isode\db\build_win32 | |
69 | !IF "$(VERBOSE)" != "0" | |
70 | !MESSAGE Defaulting SleepyCat include path to $(DB_INCLUDE). | |
71 | !ENDIF | |
72 | !ENDIF | |
73 | ||
74 | !IF "$(DB_LIBPATH)" == "" | |
75 | DB_LIBPATH=c:\work\isode\db\build_win32\Release_static | |
76 | !IF "$(VERBOSE)" != "0" | |
77 | !MESSAGE Defaulting SleepyCat library path to $(DB_LIBPATH). | |
78 | !ENDIF | |
79 | !ENDIF | |
80 | ||
81 | !IF "$(OPENSSL_INCLUDE)" == "" | |
82 | OPENSSL_INCLUDE="D:\openssl\engine-0.9.6g-md3\include" | |
83 | !IF "$(VERBOSE)" != "0" | |
84 | !MESSAGE Defaulting OpenSSL Include path to $(OPENSSL_INCLUDE). | |
85 | !ENDIF | |
86 | !ENDIF | |
87 | ||
88 | !IF "$(OPENSSL_LIBPATH)" == "" | |
89 | OPENSSL_LIBPATH="D:\openssl\engine-0.9.6g-md3\lib" | |
90 | !IF "$(VERBOSE)" != "0" | |
91 | !MESSAGE Defaulting OpenSSL library path to $(OPENSSL_LIBPATH). | |
92 | !ENDIF | |
93 | !ENDIF | |
94 | ||
95 | !IF "$(GSSAPI_INCLUDE)" == "" | |
96 | GSSAPI_INCLUDE="C:\Program Files\CyberSafe\Developer Pack\ApplicationSecuritySDK\include" | |
97 | !IF "$(VERBOSE)" != "0" | |
98 | !MESSAGE Defaulting GSSAPI Include path to $(GSSAPI_INCLUDE). | |
99 | !ENDIF | |
100 | !ENDIF | |
101 | ||
102 | !IF "$(GSSAPI_LIBPATH)" == "" | |
103 | GSSAPI_LIBPATH="C:\Program Files\CyberSafe\Developer Pack\ApplicationSecuritySDK\lib" | |
104 | !IF "$(VERBOSE)" != "0" | |
105 | !MESSAGE Defaulting GSSAPI library path to $(GSSAPI_LIBPATH). | |
106 | !ENDIF | |
107 | !ENDIF | |
108 | ||
109 | !IF "$(SQLITE_INCLUDE)" == "" | |
110 | SQLITE_INCLUDES=/I"C:\work\open_source\sqllite\sqlite\src" /I"C:\work\open_source\sqllite\sqlite\win32" | |
111 | !IF "$(VERBOSE)" != "0" | |
112 | !MESSAGE Defaulting SQLITE_INCLUDES includes to $(SQLITE_INCLUDES). | |
113 | !ENDIF | |
114 | !ENDIF | |
115 | ||
116 | !IF "$(SQLITE_LIBPATH)" == "" | |
117 | SQLITE_LIBPATH="C:\work\open_source\sqllite\sqlite\objs" | |
118 | !IF "$(VERBOSE)" != "0" | |
119 | !MESSAGE Defaulting SQLITE library path to $(SQLITE_LIBPATH). | |
120 | !ENDIF | |
121 | !ENDIF | |
122 | ||
123 | !IF "$(SQLITE_INCLUDE3)" == "" | |
124 | SQLITE_INCLUDES3=/I"c:\work\sqlite\generated" | |
125 | !IF "$(VERBOSE)" != "0" | |
126 | !MESSAGE Defaulting SQLITE_INCLUDES3 includes to $(SQLITE_INCLUDES3). | |
127 | !ENDIF | |
128 | !ENDIF | |
129 | ||
130 | !IF "$(SQLITE_LIBPATH3)" == "" | |
131 | SQLITE_LIBPATH3="c:\work\sqlite\objs.NT" | |
132 | !IF "$(VERBOSE)" != "0" | |
133 | !MESSAGE Defaulting SQLITE library path to $(SQLITE_LIBPATH3). | |
134 | !ENDIF | |
135 | !ENDIF | |
136 | ||
137 | !IF "$(LDAP_LIB_BASE)" == "" | |
138 | LDAP_LIB_BASE = c:\work\open_source\openldap\openldap-head\ldap\Debug | |
139 | !IF "$(VERBOSE)" != "0" | |
140 | !MESSAGE Defaulting LDAP library path to $(LDAP_LIB_BASE). | |
141 | !ENDIF | |
142 | !ENDIF | |
143 | ||
144 | !IF "$(LDAP_INCLUDE)" == "" | |
145 | LDAP_INCLUDE = c:\work\open_source\openldap\openldap-head\ldap\include | |
146 | !IF "$(VERBOSE)" != "0" | |
147 | !MESSAGE Defaulting LDAP include path to $(LDAP_INCLUDE). | |
148 | !ENDIF | |
149 | !ENDIF | |
150 | ||
151 | !IF "$(OS)" == "Windows_NT" | |
152 | NULL= | |
153 | !ELSE | |
154 | NULL=nul | |
155 | !ENDIF | |
156 | ||
157 | ||
158 | !IF "$(CFG)" == "Release" | |
159 | ||
160 | !IF "$(CODEGEN)" == "" | |
161 | !IF "$(STATIC)" == "yes" | |
162 | CODEGEN=/MT | |
163 | !ELSE | |
164 | CODEGEN=/MD | |
165 | !ENDIF | |
166 | !IF "$(VERBOSE)" != "0" | |
167 | !MESSAGE Codegeneration defaulting to $(CODEGEN). | |
168 | !ENDIF | |
169 | !ENDIF | |
170 | ||
171 | !IF "$(VCVER)" != "6" | |
172 | ENABLE_WIN64_WARNINGS=/Wp64 | |
173 | !ENDIF | |
174 | ||
175 | CPP_PROJ= $(CODEGEN) /W3 $(EXCEPTHANDLING) /O2 $(ENABLE_WIN64_WARNINGS) /Zi /D "NDEBUG" $(CPPFLAGS) /FD /c | |
176 | ||
177 | incremental=no | |
178 | ||
179 | # This use to contain /machine:I386. This breaks cross compiling to Windows 64. | |
180 | # It doesn't seem that the /machine option is needed anyway. | |
181 | LINK32_FLAGS=/debug | |
182 | ||
183 | !ELSEIF "$(CFG)" == "Debug" | |
184 | ||
185 | !IF "$(CODEGEN)" == "" | |
186 | !IF "$(STATIC)" == "yes" | |
187 | CODEGEN=/MTd | |
188 | !ELSE | |
189 | CODEGEN=/MDd | |
190 | !ENDIF | |
191 | !IF "$(VERBOSE)" != "0" | |
192 | !MESSAGE Codegeneration defaulting to $(CODEGEN). | |
193 | !ENDIF | |
194 | !ENDIF | |
195 | ||
196 | CPP_PROJ=$(CODEGEN) /W3 /Gm $(EXCEPTHANDLING) /ZI /Od /D "_DEBUG" $(CPPFLAGS) /FD /GZ /c | |
197 | ||
198 | incremental=yes | |
199 | ||
200 | # This use to contain /machine:I386. This breaks cross compiling to Windows 64. | |
201 | # It doesn't seem that the /machine option is needed anyway. | |
202 | LINK32_FLAGS=/debug /pdbtype:sept | |
203 | ||
204 | !ENDIF | |
205 | ||
206 | LINK32DLL_FLAGS=/incremental:$(incremental) $(LINK32_FLAGS) $(SYS_LIBS) $(EXTRA_LIBS) | |
207 | ||
208 | # Assume we are only building console applications | |
209 | LINK32EXE_FLAGS=/subsystem:console /incremental:$(incremental) $(LINK32_FLAGS) $(SYS_LIBS) $(EXTRA_LIBS) | |
210 | ||
211 | # Assume we are only building console applications | |
212 | LINK32EXE_FLAGS=/subsystem:console /incremental:$(incremental) $(LINK32_FLAGS) $(SYS_LIBS) $(EXTRA_LIBS) | |
213 | ||
214 | LINK32LIB_FLAGS=$(LINK32_FLAGS) |
0 | /* config.h--SASL configuration for win32 | |
1 | * Ryan Troll | |
2 | */ | |
3 | /* | |
4 | * Copyright (c) 1998-2004 Carnegie Mellon University. All rights reserved. | |
5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | |
9 | * | |
10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | |
12 | * | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in | |
15 | * the documentation and/or other materials provided with the | |
16 | * distribution. | |
17 | * | |
18 | * 3. The name "Carnegie Mellon University" must not be used to | |
19 | * endorse or promote products derived from this software without | |
20 | * prior written permission. For permission or any other legal | |
21 | * details, please contact | |
22 | * Office of Technology Transfer | |
23 | * Carnegie Mellon University | |
24 | * 5000 Forbes Avenue | |
25 | * Pittsburgh, PA 15213-3890 | |
26 | * (412) 268-4387, fax: (412) 268-7395 | |
27 | * tech-transfer@andrew.cmu.edu | |
28 | * | |
29 | * 4. Redistributions of any form whatsoever must retain the following | |
30 | * acknowledgment: | |
31 | * "This product includes software developed by Computing Services | |
32 | * at Carnegie Mellon University (http://www.cmu.edu/computing/)." | |
33 | * | |
34 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO | |
35 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | |
36 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE | |
37 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
38 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN | |
39 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING | |
40 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
41 | */ | |
42 | ||
43 | #ifndef CONFIG_H | |
44 | #define CONFIG_H | |
45 | ||
46 | #include <stddef.h> | |
47 | ||
48 | /* winsock2 includes windows.h. | |
49 | Note that we can't include both winsock.h and winsock2.h as | |
50 | they conflict */ | |
51 | #include <winsock2.h> | |
52 | ||
53 | /* Our package */ | |
54 | #define PACKAGE "cyrus-sasl" | |
55 | ||
56 | /* Our version */ | |
57 | #define VERSION "2.1.24" | |
58 | ||
59 | /* Visual Studio supports prototypes */ | |
60 | #define PROTOTYPES 1 | |
61 | ||
62 | #ifndef HAVE_CADDR_T | |
63 | #ifndef caddr_t | |
64 | typedef unsigned char *caddr_t; | |
65 | #define HAVE_CADDR_T 1 | |
66 | #endif | |
67 | #endif | |
68 | ||
69 | #ifndef _INTPTR_T_DEFINED | |
70 | ||
71 | #ifdef _WIN64 | |
72 | typedef __int64 intptr_t; | |
73 | #else | |
74 | typedef int intptr_t; | |
75 | #endif | |
76 | ||
77 | #endif | |
78 | ||
79 | /* Registry key that contains the locations of the plugins */ | |
80 | #define SASL_ROOT_KEY "SOFTWARE\\Carnegie Mellon\\Project Cyrus\\SASL Library" | |
81 | #define SASL_PLUGIN_PATH_ATTR "SearchPath" | |
82 | #define SASL_CONF_PATH_ATTR "ConfFile" | |
83 | ||
84 | /* : This should probably be replaced with a call to a function | |
85 | : that gets the proper value from Registry */ | |
86 | #define SASL_DB_PATH "c:\\CMU\\sasldb2" | |
87 | ||
88 | /* what db package are we using? */ | |
89 | /* #undef SASL_GDBM */ | |
90 | /* #undef SASL_NDBM */ | |
91 | #define SASL_BERKELEYDB 1 | |
92 | ||
93 | /* which mechs can we link staticly? */ | |
94 | #define STATIC_ANONYMOUS 1 | |
95 | #define STATIC_CRAMMD5 1 | |
96 | #define STATIC_DIGESTMD5 1 | |
97 | #define STATIC_GSSAPIV2 1 | |
98 | /* #undef STATIC_KERBEROS4 */ | |
99 | #define STATIC_LOGIN 1 | |
100 | /* #undef STATIC_MYSQL */ | |
101 | #define STATIC_OTP 1 | |
102 | #define STATIC_PLAIN 1 | |
103 | #define STATIC_SASLDB 1 | |
104 | #define STATIC_SRP 1 | |
105 | ||
106 | /* ------------------------------------------------------------ */ | |
107 | ||
108 | /* Things that are fetched via autoconf under Unix | |
109 | */ | |
110 | #define HAVE_MEMCPY 1 | |
111 | ||
112 | #define PLUGINDIR "C:\\CMU\\bin\\sasl2" | |
113 | #define CONFIGDIR "C:\\CMU\\bin\\sasl2" | |
114 | ||
115 | /* Windows calls these functions something else | |
116 | */ | |
117 | #define strcasecmp stricmp | |
118 | #define snprintf _snprintf | |
119 | #define strncasecmp strnicmp | |
120 | ||
121 | #define MAXHOSTNAMELEN 1024 | |
122 | ||
123 | /* ------------------------------------------------------------ */ | |
124 | ||
125 | #define WITHOUT_NANA | |
126 | #define L_DEFAULT_GUARD (0) | |
127 | #define I_DEFAULT_GUARD (0) | |
128 | #define I(foo) | |
129 | #define VL(foo) printf foo; | |
130 | #define VLP(foo,bar) | |
131 | ||
132 | /* we're not gcc */ | |
133 | #define __attribute__(foo) | |
134 | ||
135 | /* : Same as in tpipv6.h */ | |
136 | #ifndef HAVE_SOCKLEN_T | |
137 | typedef int socklen_t; | |
138 | #endif /* HAVE_SOCKLEN_T */ | |
139 | ||
140 | /* If we expect to run on XP and later, we have IPv6 support natively */ | |
141 | #if TARGET_WIN_SYSTEM >= 51 | |
142 | #if !defined(_WIN32_WINNT) | |
143 | /* This forces the inclusion of OS supported functions, with no fallback */ | |
144 | #define _WIN32_WINNT 0x0510 | |
145 | #endif | |
146 | #endif | |
147 | ||
148 | #if defined(_MSC_VER) && (_MSC_VER >= 1300) | |
149 | /* The following two defines will prevent our own definitions below */ | |
150 | #define HAVE_GETADDRINFO | |
151 | #define HAVE_GETNAMEINFO | |
152 | #define HAVE_STRUCT_SOCKADDR_STORAGE | |
153 | /* Unless _WIN32_WINNT > 0x0500, Ws2tcpip.h will try to find OS provided | |
154 | getaddrinfo at runtime. It will fallback to Microsoft emulation, | |
155 | if not found */ | |
156 | #include <Ws2tcpip.h> | |
157 | #endif | |
158 | ||
159 | #if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && !defined(_SS_MAXSIZE) | |
160 | #define _SS_MAXSIZE 128 /* Implementation specific max size */ | |
161 | #define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr)) | |
162 | ||
163 | struct sockaddr_storage { | |
164 | struct sockaddr ss_sa; | |
165 | char __ss_pad2[_SS_PADSIZE]; | |
166 | }; | |
167 | # define ss_family ss_sa.sa_family | |
168 | #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */ | |
169 | ||
170 | #ifndef AF_INET6 | |
171 | /* Define it to something that should never appear */ | |
172 | #define AF_INET6 AF_MAX | |
173 | #endif | |
174 | ||
175 | #ifndef HAVE_GETADDRINFO | |
176 | #define getaddrinfo sasl_getaddrinfo | |
177 | #define freeaddrinfo sasl_freeaddrinfo | |
178 | #define gai_strerror sasl_gai_strerror | |
179 | #endif | |
180 | ||
181 | #ifndef HAVE_GETNAMEINFO | |
182 | #define getnameinfo sasl_getnameinfo | |
183 | #endif | |
184 | ||
185 | #if !defined(HAVE_GETNAMEINFO) || !defined(HAVE_GETADDRINFO) | |
186 | #include "gai.h" | |
187 | #endif | |
188 | ||
189 | #ifndef AI_NUMERICHOST /* support glibc 2.0.x */ | |
190 | #define AI_NUMERICHOST 4 | |
191 | #define NI_NUMERICHOST 2 | |
192 | #define NI_NAMEREQD 4 | |
193 | #define NI_NUMERICSERV 8 | |
194 | #endif | |
195 | ||
196 | #include <time.h> | |
197 | ||
198 | /* Keep in sync with SleepyCat definitions */ | |
199 | typedef int int32_t; | |
200 | typedef __int64 int64_t; | |
201 | #ifdef _WIN64 | |
202 | typedef int64_t ssize_t; | |
203 | #else | |
204 | typedef int32_t ssize_t; | |
205 | #endif | |
206 | ||
207 | #define HIER_DELIMITER '\\' | |
208 | ||
209 | #ifndef sleep | |
210 | #define sleep(seconds) plug_sleep(seconds) | |
211 | unsigned int plug_sleep(unsigned int seconds); | |
212 | #endif | |
213 | ||
214 | #endif /* CONFIG_H */ |