2
AC_INIT([crypto++], 5.1)
2
AC_INIT([crypto++],[5.2])
3
3
AC_CONFIG_SRCDIR(configure.in)
4
4
AM_INIT_AUTOMAKE([no-define])
5
AM_CONFIG_HEADER([cryptopp_config.h])
5
AC_CONFIG_HEADERS([cryptopp_config.h])
9
AC_CHECK_FUNCS([gethostbyname])
10
AC_CHECK_FUNCS([gettimeofday])
11
AC_CHECK_FUNCS([memmove])
12
AC_CHECK_FUNCS([memset])
14
AC_CHECK_FUNCS([select])
15
AC_CHECK_FUNCS([socket])
16
AC_CHECK_HEADERS([arpa/inet.h])
17
AC_CHECK_HEADERS([fcntl.h])
18
AC_CHECK_HEADERS([limits.h])
19
AC_CHECK_HEADERS([malloc.h])
20
AC_CHECK_HEADERS([netdb.h])
21
AC_CHECK_HEADERS([netinet/in.h])
22
AC_CHECK_HEADERS([stddef.h])
23
AC_CHECK_HEADERS([sys/ioctl.h])
24
AC_CHECK_HEADERS([sys/socket.h])
25
AC_CHECK_HEADERS([sys/time.h])
26
AC_CHECK_TYPES([ptrdiff_t])
31
AC_FUNC_SELECT_ARGTYPES
35
AC_PROG_GCC_TRADITIONAL
13
46
AC_DEFINE(IS_BIG_ENDIAN, [], [Big-endian architecture]),
14
47
AC_DEFINE(IS_LITTLE_ENDIAN, [], [Little-endian architecture]),
15
AC_ERROR([Can't tell endianess of platform]))
48
AC_MSG_ERROR([Can't tell endianess of platform]))
50
dnl From xemacs-21.2.43/configure.in
51
dnl check for Unix98 socklen_t
52
AC_MSG_CHECKING(for socklen_t)
53
AC_TRY_COMPILE([#include <sys/socket.h>
55
],[],[AC_MSG_RESULT(yes)],[
56
AC_TRY_COMPILE([#include <sys/socket.h>
57
int accept (int, struct sockaddr *, size_t *);
59
AC_MSG_RESULT(::socklen_t)
60
AC_DEFINE(TYPE_OF_SOCKLEN_T,::socklen_t,[socklent_t socket])], [
62
AC_DEFINE(TYPE_OF_SOCKLEN_T,int,[int socket])])])
18
66
#ifndef CRYPTOPP_CONFIG_H
103
147
// Defining this will cause Crypto++ to make only one call to CryptAcquireContext.
104
148
#define WORKAROUND_MS_BUG_Q258000
150
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
106
151
// Avoid putting "CryptoPP::" in front of everything in Doxygen output
107
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
108
152
# define CryptoPP
109
153
# define NAMESPACE_BEGIN(x)
110
154
# define NAMESPACE_END
155
// Get Doxygen to generate better documentation for these typedefs
156
# define DOCUMENTED_TYPEDEF(x, y) class y : public x {};
112
158
# define NAMESPACE_BEGIN(x) namespace x {
113
159
# define NAMESPACE_END }
160
# define DOCUMENTED_TYPEDEF(x, y) typedef x y;
115
162
#define ANONYMOUS_NAMESPACE_BEGIN namespace {
116
163
#define USING_NAMESPACE(x) using namespace x;
117
164
#define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
118
165
#define DOCUMENTED_NAMESPACE_END }
120
// What is the type of the third parameter to bind?
121
// For Unix, the new standard is ::socklen_t (typically unsigned int), and the old standard is int.
122
// Unfortunately there is no way to tell whether or not socklen_t is defined.
123
// To work around this, TYPE_OF_SOCKLEN_T is a macro so that you can change it from the makefile.
124
168
#ifndef TYPE_OF_SOCKLEN_T
125
# if defined(_WIN32) || defined(__CYGWIN__) || defined(__MACH__)
126
# define TYPE_OF_SOCKLEN_T int
128
# define TYPE_OF_SOCKLEN_T ::socklen_t
169
# if defined(_WIN32) || defined(__CYGWIN__) || defined(__MACH__)
170
# define TYPE_OF_SOCKLEN_T int
172
# define TYPE_OF_SOCKLEN_T ::socklen_t
132
176
#if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
133
177
# define __USE_W32_SOCKETS
136
typedef unsigned char byte; // moved outside namespace for Borland C++Builder 5
180
typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs
138
182
NAMESPACE_BEGIN(CryptoPP)
140
184
typedef unsigned short word16;
141
#if !defined(_MSC_VER) && (SIZEOF_LONG != 4)
142
typedef unsigned int word32;
144
typedef unsigned long word32;
185
typedef unsigned int word32;
147
187
#if defined(__GNUC__) || defined(__MWERKS__)
148
# define WORD64_AVAILABLE
188
#define WORD64_AVAILABLE
149
189
typedef unsigned long long word64;
150
# define W64LIT(x) x##LL
190
#define W64LIT(x) x##LL
151
191
#elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
152
# define WORD64_AVAILABLE
192
#define WORD64_AVAILABLE
153
193
typedef unsigned __int64 word64;
154
# define W64LIT(x) x##ui64
157
// defined this if your CPU is not 64-bit
158
#if defined(WORD64_AVAILABLE) && (SIZEOF_LONG != 8)
162
// word should have the same size as your CPU registers
163
// dword should be twice as big as word
165
#if (defined(__GNUC__) && (SIZEOF_LONG == 4)) || defined(__MWERKS__)
166
typedef unsigned long word;
167
typedef unsigned long long dword;
168
#elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
169
typedef unsigned __int32 word;
170
typedef unsigned __int64 dword;
172
typedef unsigned int word;
173
typedef unsigned long dword;
194
#define W64LIT(x) x##ui64
197
// define largest word type
198
#ifdef WORD64_AVAILABLE
199
typedef word64 lword;
201
typedef word32 lword;
204
#if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64)
205
// These platforms have 64-bit CPU registers. Unfortunately most C++ compilers doesn't
206
// allow any way to access the 64-bit by 64-bit multiply instruction without using
207
// assembly, so in order to use word64 as word, the assembly instruction must be defined
208
// in Dword::Multiply().
209
typedef word32 hword;
212
#define CRYPTOPP_NATIVE_DWORD_AVAILABLE
213
#ifdef WORD64_AVAILABLE
214
#define CRYPTOPP_SLOW_WORD64 // defined this if your CPU is not 64-bit to use alternative code that avoids word64
215
typedef word16 hword;
217
typedef word64 dword;
221
typedef word32 dword;
176
225
const unsigned int WORD_SIZE = sizeof(word);
177
226
const unsigned int WORD_BITS = WORD_SIZE * 8;
179
#define LOW_WORD(x) (word)(x)
183
dword_union (const dword &dw) : dw(dw) {}
188
#ifdef IS_LITTLE_ENDIAN
189
# define HIGH_WORD(x) (dword_union(x).w[1])
191
# define HIGH_WORD(x) (dword_union(x).w[0])
194
// if the above HIGH_WORD macro doesn't work (if you are not sure, compile it
195
// and run the validation tests), try this:
196
// #define HIGH_WORD(x) (word)((x)>>WORD_BITS)
198
228
#if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
199
# define INTEL_INTRINSICS
229
#define INTEL_INTRINSICS
201
231
#elif defined(__MWERKS__) && TARGET_CPU_PPC
202
# define PPC_INTRINSICS
232
#define PPC_INTRINSICS
204
234
#elif defined(__GNUC__) && defined(__i386__)
205
235
// GCC does peephole optimizations which should result in using rotate instructions
249
#define CRYPTOPP_NO_VTABLE __declspec(novtable)
251
#define CRYPTOPP_NO_VTABLE
255
// 4231: nonstandard extension used : 'extern' before template explicit instantiation
219
256
// 4250: dominance
257
// 4251: member needs to have dll-interface
258
// 4275: base needs to have dll-interface
220
259
// 4660: explicitly instantiating a class that's already implicitly instantiated
221
260
// 4661: no suitable definition provided for explicit template instantiation request
222
261
// 4786: identifer was truncated in debug information
223
262
// 4355: 'this' : used in base member initializer list
224
# pragma warning(disable: 4250 4660 4661 4786 4355)
263
# pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355)
266
#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION)
267
#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
270
#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
271
#define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
274
// CodeWarrior defines _MSC_VER
275
#if !defined(CRYPTOPP_DISABLE_X86ASM) && ((defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86)) || (defined(__GNUC__) && defined(__i386__)))
276
#define CRYPTOPP_X86ASM_AVAILABLE
227
279
// ***************** determine availability of OS features ********************
280
332
# define THREADS_AVAILABLE
335
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
336
# define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
339
#if defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
340
# define CRYPTOPP_MEMALIGN_AVAILABLE
283
343
#endif // NO_OS_DEPENDENCE
345
// ***************** DLL related ********************
347
#ifdef CRYPTOPP_WIN32_AVAILABLE
349
#ifdef CRYPTOPP_EXPORTS
350
#define CRYPTOPP_IS_DLL
351
#define CRYPTOPP_DLL __declspec(dllexport)
352
#elif defined(CRYPTOPP_IMPORTS)
353
#define CRYPTOPP_IS_DLL
354
#define CRYPTOPP_DLL __declspec(dllimport)
359
#define CRYPTOPP_API __stdcall
360
#define CRYPTOPP_CDECL __cdecl
362
#else // CRYPTOPP_WIN32_AVAILABLE
366
#define CRYPTOPP_CDECL
368
#endif // CRYPTOPP_WIN32_AVAILABLE
370
#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS)
371
#define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
372
#elif defined(__MWERKS__)
373
#define CRYPTOPP_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL
375
#define CRYPTOPP_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL
378
#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS)
379
#define CRYPTOPP_STATIC_TEMPLATE_CLASS template class
380
#elif defined(__MWERKS__)
381
#define CRYPTOPP_STATIC_TEMPLATE_CLASS extern class
383
#define CRYPTOPP_STATIC_TEMPLATE_CLASS extern template class