1
dnl Process this file with autoconf to produce a configure script.
4
dnl Must come before AC_PROG_CC
5
if test -z "$CFLAGS"; then
6
dnl Default value for CFLAGS if not specified.
7
CFLAGS="-Wall -O4 -fexpensive-optimizations -funroll-loops"
10
dnl Checks for programs.
16
AC_ARG_ENABLE(kernel-linux,
17
[AS_HELP_STRING([--enable-kernel-linux],
18
[build library to run in Linux kernel context])],
19
[], enable_kernel_linux=no)
20
AC_MSG_CHECKING(whether to build for Linux kernel context)
21
if test "$enable_kernel_linux" = "yes"; then
22
AC_DEFINE(SRTP_KERNEL, 1,
23
[Define to compile for kernel contexts.])
24
AC_DEFINE(SRTP_KERNEL_LINUX, 1,
25
[Define to compile for Linux kernel context.])
27
AC_MSG_RESULT($enable_kernel_linux)
29
if test "$cross_compiling" != yes; then
30
dnl Check for /dev/urandom
31
AC_CHECK_FILE(/dev/urandom, DEV_URANDOM=/dev/urandom,
32
[AC_CHECK_FILE(/dev/random, DEV_URANDOM=/dev/random)])
35
AC_MSG_CHECKING(which random device to use)
36
if test "$enable_kernel_linux" = "yes"; then
37
RNG_OBJS=rand_linux_kernel.o
38
AC_MSG_RESULT([Linux kernel builtin])
40
RNG_OBJS=rand_source.o
41
if test -n "$DEV_URANDOM"; then
42
AC_DEFINE_UNQUOTED(DEV_URANDOM, "$DEV_URANDOM",[Path to random device])
43
AC_MSG_RESULT([$DEV_URANDOM])
45
AC_MSG_RESULT([standard rand() function...])
51
dnl Checks for header files.
53
AC_CHECK_HEADERS(stdlib.h)
54
AC_CHECK_HEADERS(unistd.h)
55
AC_CHECK_HEADERS(byteswap.h)
56
AC_CHECK_HEADERS(stdint.h)
57
AC_CHECK_HEADERS(sys/uio.h)
58
AC_CHECK_HEADERS(inttypes.h)
59
AC_CHECK_HEADERS(sys/types.h)
60
AC_CHECK_HEADERS(machine/types.h)
61
AC_CHECK_HEADERS(sys/int_types.h)
63
dnl socket() and friends
64
AC_CHECK_HEADERS(sys/socket.h netinet/in.h arpa/inet.h)
65
AC_CHECK_HEADERS(windows.h, [AC_CHECK_HEADERS(winsock2.h)])
67
AC_CHECK_HEADERS(syslog.h)
69
AC_CHECK_TYPES([int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,uint64_t])
70
AC_CHECK_SIZEOF(unsigned long)
71
AC_CHECK_SIZEOF(unsigned long long)
73
dnl Checks for typedefs, structures, and compiler characteristics.
78
dnl Checks for library functions.
79
AC_CHECK_FUNCS(socket inet_aton usleep)
81
dnl Find socket function if not found yet.
82
if test "x$ac_cv_func_socket" = "xno"; then
83
AC_CHECK_LIB(socket, socket)
84
AC_MSG_CHECKING([for socket in -lwsock32])
86
LIBS="$LIBS -lwsock32"
98
dnl Check the byte order
103
dnl check host_cpu type, set defines appropriately
106
AC_DEFINE(CPU_CISC, 1,
107
[Define if building for a CISC machine (e.g. Intel).])
108
AC_DEFINE(HAVE_X86, 1,
109
[Define to use X86 inlined assembly code]);;
111
# CPU_RISC is only supported for big endian machines.
112
if test "$ac_cv_c_bigendian" = "yes"; then
113
AC_DEFINE(CPU_RISC, 1,
114
[Define if building for a RISC machine (assume slow byte access).])
116
AC_DEFINE(CPU_CISC, 1)
121
dnl Check if we're on a Windows platform.
128
AC_SUBST(EXE) # define executable suffix; this is needed for `make clean'
130
AC_MSG_CHECKING(whether to compile in debugging)
132
[AS_HELP_STRING([--disable-debug],
133
[do not compile in dynamic debugging system])],
134
[], enable_debug=yes)
135
if test "$enable_debug" = "yes"; then
136
AC_DEFINE(ENABLE_DEBUGGING, 1,
137
[Define to compile in dynamic debugging system.])
139
AC_MSG_RESULT($enable_debug)
141
AC_MSG_CHECKING(whether to use ISMAcryp code)
142
AC_ARG_ENABLE(generic-aesicm,
143
[AS_HELP_STRING([--enable-generic-aesicm],
144
[compile in changes for ISMAcryp])],
145
[], enable_generic_aesicm=no)
146
if test "$enable_generic_aesicm" = "yes"; then
147
AC_DEFINE(GENERIC_AESICM, 1, [Define this to use ISMAcryp code.])
149
AC_MSG_RESULT($enable_generic_aesicm)
151
AC_MSG_CHECKING(whether to use syslog for error reporting)
152
AC_ARG_ENABLE(syslog,
153
[AS_HELP_STRING([--enable-syslog], [use syslog for error reporting])],
154
[], enable_syslog=no)
155
if test "$enable_syslog" = "yes"; then
156
AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog logging.])
158
AC_MSG_RESULT($enable_syslog)
160
AC_MSG_CHECKING(whether to use stdout for error reporting)
161
AC_ARG_ENABLE(stdout,
162
[AS_HELP_STRING([--disable-stdout], [don't use stdout for error reporting])],
163
[], enable_stdout=yes)
164
if test "$enable_stdout" = "yes"; then
165
AC_DEFINE(ERR_REPORTING_STDOUT, 1, [Define to use logging to stdout.])
167
AC_MSG_RESULT($enable_stdout)
169
AC_MSG_CHECKING(whether to use /dev/console for error reporting)
170
AC_ARG_ENABLE(console,
171
[AS_HELP_STRING([--enable-console], [use /dev/console for error reporting])],
172
[], enable_console=no)
173
if test "$enable_console" = "yes"; then
174
AC_DEFINE(USE_ERR_REPORTING_FILE, 1, [Write errors to this file])
175
AC_DEFINE(ERR_REPORTING_FILE, "/dev/console", [Report errors to this file.])
177
AC_MSG_RESULT($enable_console)
179
AC_MSG_CHECKING(whether to use GDOI key management)
181
[AS_HELP_STRING([--enable-gdoi], [enable GDOI key management])],
183
if test "$enable_gdoi" = "yes"; then
184
AC_DEFINE(SRTP_GDOI, 1, [Define to use GDOI.])
185
GDOI_OBJS=gdoi/srtp+gdoi.o
188
AC_MSG_RESULT($enable_gdoi)
190
AC_CONFIG_HEADER(crypto/include/config.h:config_in.h)
192
AC_OUTPUT(Makefile crypto/Makefile doc/Makefile)
194
# This is needed when building outside the source dir.
195
AS_MKDIR_P(crypto/ae_xfm)
196
AS_MKDIR_P(crypto/cipher)
197
AS_MKDIR_P(crypto/hash)
198
AS_MKDIR_P(crypto/kernel)
199
AS_MKDIR_P(crypto/math)
200
AS_MKDIR_P(crypto/replay)
201
AS_MKDIR_P(crypto/rng)
202
AS_MKDIR_P(crypto/test)