blob: 6651c8ce5486053cd9844554b2b5a2882e0c14de [file] [log] [blame]
dnl Process this file with autoconf to produce a configure script.
AC_INIT(srtp)
dnl Must come before AC_PROG_CC
if test -z "$CFLAGS"; then
dnl Default value for CFLAGS if not specified.
CFLAGS="-Wall -O4 -fexpensive-optimizations -funroll-loops"
fi
dnl Checks for programs.
AC_PROG_RANLIB
AC_PROG_CC
AC_PROG_INSTALL
dnl Check for /dev/urandom
AC_CHECK_FILE(/dev/urandom, DEV_URANDOM=/dev/urandom,
[AC_CHECK_FILE(/dev/random, DEV_URANDOM=/dev/random)])
AC_MSG_CHECKING(which random device to use)
if test -n "$DEV_URANDOM"; then
AC_DEFINE_UNQUOTED(DEV_URANDOM, "$DEV_URANDOM", [Path to random device])
RNG_OBJS=crypto/rng/rand_source.c
fi
AC_SUBST(RNG_OBJS)
AC_MSG_RESULT([$DEV_URANDOM])
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(stdlib.h)
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(stdint.h)
AC_CHECK_HEADERS(sys/uio.h)
AC_CHECK_HEADERS(inttypes.h)
AC_CHECK_HEADERS(machine/types.h)
AC_CHECK_HEADERS(sys/int_types.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_TYPES([int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,uint64_t])
AC_CHECK_TYPE(unsigned long long, HAVE_U_LONG_LONG=1, HAVE_U_LONG_LONG=0)
if test $HAVE_U_LONG_LONG = 1; then
AC_DEFINE(HAVE_U_LONG_LONG)
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_CHECK_FUNCS(socket inet_aton)
dnl Checks for libraries.
AC_CHECK_LIB(socket, socket)
dnl Check the byte order
AC_C_BIGENDIAN
AC_CANONICAL_HOST
dnl check host_cpu type, set defines appropriately
case $host_cpu in
i*86 )
AC_DEFINE(CPU_CISC, 1,
[Define if building for a CISC machine (e.g. Intel).])
AC_DEFINE(HAVE_X86, 1,
[Define to use X86 inlined assembly code]);;
* )
AC_DEFINE(CPU_RISC, 1,
[Define if building for a RISC machine (with slow byte access)]);;
esac
dnl Check if we're on a cygwin (GNU on MSWin) platform, set HAVE_MS_TYPES
case $host_os in
*cygwin* )
AC_DEFINE(HAVE_MS_TYPES, 1,
[Define to use microsoft integer definitions (e.g. cygwin).])
EXE=.exe;;
* ) EXE="";;
esac
AC_SUBST(EXE) # define executable suffix; this is needed for `make clean'
AC_MSG_CHECKING(whether to compile in debugging)
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--disable-debug],
[do not compile in dynamic debugging system])],
[], enable_debug=yes)
if test "$enable_debug" = "yes"; then
AC_DEFINE(ENABLE_DEBUGGING, 1,
[Define to compile in dynamic debugging system.])
fi
AC_MSG_RESULT($enable_debug)
AC_MSG_CHECKING(whether to use ISMAcryp code)
AC_ARG_ENABLE(generic-aesicm,
[AS_HELP_STRING([--enable-generic-aesicm],
[compile in changes for ISMAcryp])],
[], enable_generic_aesicm=no)
if test "$enable_generic_aesicm" = "yes"; then
AC_DEFINE(GENERIC_AESICM, 1, [Define this to use ISMAcryp code.])
fi
AC_MSG_RESULT($enable_generic_aesicm)
AC_MSG_CHECKING(whether to use syslog for error reporting)
AC_ARG_ENABLE(syslog,
[AS_HELP_STRING([--enable-syslog], [use syslog for error reporting])],
[], enable_syslog=no)
if test "$enable_syslog" = "yes"; then
AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog logging.])
fi
AC_MSG_RESULT($enable_syslog)
AC_MSG_CHECKING(whether to use stdout for error reporting)
AC_ARG_ENABLE(stdout,
[AS_HELP_STRING([--disable-stdout], [don't use stdout for error reporting])],
[], enable_stdout=yes)
if test "$enable_stdout" = "yes"; then
AC_DEFINE(ERR_REPORTING_STDOUT, 1, [Define to use logging to stdout.])
fi
AC_MSG_RESULT($enable_stdout)
AC_MSG_CHECKING(whether to use /dev/console for error reporting)
AC_ARG_ENABLE(console,
[AS_HELP_STRING([--enable-console], [use /dev/console for error reporting])],
[], enable_console=no)
if test "$enable_console" = "yes"; then
AC_DEFINE(USE_ERR_REPORTING_FILE, 1, [Write errors to this file])
AC_DEFINE(ERR_REPORTING_FILE, "/dev/console", [Report errors to this file.])
fi
AC_MSG_RESULT($enable_console)
AC_MSG_CHECKING(whether to use GDOI key management)
AC_ARG_ENABLE(gdoi,
[AS_HELP_STRING([--enable-gdoi], [enable GDOI key management])],
[], enable_gdoi=no)
if test "$enable_gdoi" = "yes"; then
AC_DEFINE(SRTP_GDOI, 1, [Define to use GDOI.])
GDOI_OBJS=gdoi/srtp+gdoi.o
AC_SUBST(GDOI_OBJS)
fi
AC_MSG_RESULT($enable_gdoi)
AC_CONFIG_HEADER(crypto/include/config.h:config_in.h)
AC_OUTPUT(Makefile crypto/Makefile doc/Makefile)
# This is needed when building outside the source dir.
AS_MKDIR_P(crypto/ae_xfm)
AS_MKDIR_P(crypto/cipher)
AS_MKDIR_P(crypto/hash)
AS_MKDIR_P(crypto/kernel)
AS_MKDIR_P(crypto/math)
AS_MKDIR_P(crypto/replay)
AS_MKDIR_P(crypto/rng)
AS_MKDIR_P(crypto/test)
AS_MKDIR_P(doc)
AS_MKDIR_P(srtp)
AS_MKDIR_P(tables)
AS_MKDIR_P(test)