netwerk/srtp/src/configure.in

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/srtp/src/configure.in	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,209 @@
     1.4 +dnl Process this file with autoconf to produce a configure script.
     1.5 +AC_INIT(srtp)
     1.6 +
     1.7 +dnl Must come before AC_PROG_CC
     1.8 +if test -z "$CFLAGS"; then
     1.9 +   dnl Default value for CFLAGS if not specified.
    1.10 +   CFLAGS="-Wall -O4 -fexpensive-optimizations -funroll-loops"
    1.11 +fi
    1.12 +
    1.13 +dnl Checks for programs.
    1.14 +AC_PROG_RANLIB
    1.15 +AC_PROG_CC
    1.16 +AC_PROG_INSTALL
    1.17 +
    1.18 +dnl Check the byte order
    1.19 +AC_C_BIGENDIAN
    1.20 +
    1.21 +AC_CANONICAL_HOST
    1.22 +
    1.23 +dnl check host_cpu type, set defines appropriately
    1.24 +case $host_cpu in
    1.25 +     i*86 | x86_64 )
    1.26 +	AC_DEFINE(CPU_CISC, 1,
    1.27 +	   [Define if building for a CISC machine (e.g. Intel).])
    1.28 +        AC_DEFINE(HAVE_X86, 1,
    1.29 +	   [Define to use X86 inlined assembly code]);; 
    1.30 +	* )
    1.31 +	# CPU_RISC is only supported for big endian machines.
    1.32 +	if test "$ac_cv_c_bigendian" = "yes"; then
    1.33 +	   AC_DEFINE(CPU_RISC, 1,
    1.34 +	    [Define if building for a RISC machine (assume slow byte access).])
    1.35 +	else
    1.36 +	   AC_DEFINE(CPU_CISC, 1)
    1.37 +	fi
    1.38 +	;;
    1.39 +esac	
    1.40 +
    1.41 +dnl Check if we are on a Windows platform.
    1.42 +case $host_os in
    1.43 +    *cygwin*|*mingw* ) 
    1.44 +	EXE=.exe
    1.45 +	HOST_IS_WINDOWS=yes
    1.46 +	;;
    1.47 +    * )
    1.48 +	EXE=""
    1.49 +	;;
    1.50 +esac
    1.51 +AC_SUBST(EXE)   # define executable suffix; this is needed for `make clean'
    1.52 +
    1.53 +
    1.54 +AC_ARG_ENABLE(kernel-linux,
    1.55 +  [AS_HELP_STRING([--enable-kernel-linux],
    1.56 +		  [build library to run in Linux kernel context])],
    1.57 +  [], enable_kernel_linux=no)
    1.58 +AC_MSG_CHECKING(whether to build for Linux kernel context)
    1.59 +if test "$enable_kernel_linux" = "yes"; then
    1.60 +   AC_DEFINE(SRTP_KERNEL, 1,
    1.61 +	[Define to compile for kernel contexts.])
    1.62 +   AC_DEFINE(SRTP_KERNEL_LINUX, 1,
    1.63 +	[Define to compile for Linux kernel context.])
    1.64 +fi
    1.65 +AC_MSG_RESULT($enable_kernel_linux)
    1.66 +
    1.67 +if test "$cross_compiling" != yes -a "$HOST_IS_WINDOWS" != yes; then
    1.68 +   dnl Check for /dev/urandom
    1.69 +   AC_CHECK_FILE(/dev/urandom, DEV_URANDOM=/dev/urandom,
    1.70 +      [AC_CHECK_FILE(/dev/random, DEV_URANDOM=/dev/random)])
    1.71 +fi
    1.72 +
    1.73 +AC_MSG_CHECKING(which random device to use)
    1.74 +if test "$enable_kernel_linux" = "yes"; then
    1.75 +   RNG_OBJS=rand_linux_kernel.o
    1.76 +   AC_MSG_RESULT([Linux kernel builtin])
    1.77 +else
    1.78 +   RNG_OBJS=rand_source.o
    1.79 +   if test -n "$DEV_URANDOM"; then
    1.80 +      AC_DEFINE_UNQUOTED(DEV_URANDOM, "$DEV_URANDOM",[Path to random device])
    1.81 +      AC_MSG_RESULT([$DEV_URANDOM])
    1.82 +   else
    1.83 +      AC_MSG_RESULT([standard rand() function...])
    1.84 +   fi
    1.85 +fi
    1.86 +AC_SUBST(RNG_OBJS)
    1.87 +
    1.88 +
    1.89 +dnl Checks for header files.
    1.90 +AC_HEADER_STDC
    1.91 +AC_CHECK_HEADERS(stdlib.h)
    1.92 +AC_CHECK_HEADERS(unistd.h)
    1.93 +AC_CHECK_HEADERS(byteswap.h)
    1.94 +AC_CHECK_HEADERS(stdint.h)
    1.95 +AC_CHECK_HEADERS(sys/uio.h)
    1.96 +AC_CHECK_HEADERS(inttypes.h)
    1.97 +AC_CHECK_HEADERS(sys/types.h)
    1.98 +AC_CHECK_HEADERS(machine/types.h)
    1.99 +AC_CHECK_HEADERS(sys/int_types.h)
   1.100 +
   1.101 +dnl socket() and friends
   1.102 +AC_CHECK_HEADERS(sys/socket.h netinet/in.h arpa/inet.h)
   1.103 +AC_CHECK_HEADERS(windows.h, [AC_CHECK_HEADERS(winsock2.h)])
   1.104 +
   1.105 +AC_CHECK_HEADERS(syslog.h)
   1.106 +
   1.107 +AC_CHECK_TYPES([int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,uint64_t])
   1.108 +AC_CHECK_SIZEOF(unsigned long)
   1.109 +AC_CHECK_SIZEOF(unsigned long long)
   1.110 +
   1.111 +dnl Checks for typedefs, structures, and compiler characteristics.
   1.112 +AC_C_CONST
   1.113 +AC_C_INLINE
   1.114 +AC_TYPE_SIZE_T
   1.115 +
   1.116 +dnl Checks for library functions.
   1.117 +AC_CHECK_FUNCS(socket inet_aton usleep sigaction)
   1.118 +
   1.119 +dnl Find socket function if not found yet.
   1.120 +if test "x$ac_cv_func_socket" = "xno"; then
   1.121 +  AC_CHECK_LIB(socket, socket)
   1.122 +  AC_MSG_CHECKING([for socket in -lwsock32])
   1.123 +  SAVELIBS="$LIBS"
   1.124 +  LIBS="$LIBS -lwsock32"
   1.125 +  AC_TRY_LINK([
   1.126 +#include <winsock2.h>
   1.127 +],[
   1.128 +socket(0, 0, 0);
   1.129 +],
   1.130 +    ac_cv_func_socket=yes
   1.131 +    AC_MSG_RESULT(yes),
   1.132 +    LIBS="$SAVELIBS"
   1.133 +    AC_MSG_RESULT(no))
   1.134 +fi
   1.135 +
   1.136 +AC_MSG_CHECKING(whether to compile in debugging)
   1.137 +AC_ARG_ENABLE(debug,
   1.138 +  [AS_HELP_STRING([--disable-debug],
   1.139 +		  [do not compile in dynamic debugging system])],
   1.140 +  [], enable_debug=yes)
   1.141 +if test "$enable_debug" = "yes"; then
   1.142 +   AC_DEFINE(ENABLE_DEBUGGING, 1,
   1.143 +      [Define to compile in dynamic debugging system.])
   1.144 +fi
   1.145 +AC_MSG_RESULT($enable_debug)
   1.146 +
   1.147 +AC_MSG_CHECKING(whether to use ISMAcryp code)
   1.148 +AC_ARG_ENABLE(generic-aesicm,
   1.149 +  [AS_HELP_STRING([--enable-generic-aesicm],
   1.150 +		  [compile in changes for ISMAcryp])],
   1.151 +  [], enable_generic_aesicm=no)
   1.152 +if test "$enable_generic_aesicm" = "yes"; then
   1.153 +   AC_DEFINE(GENERIC_AESICM, 1, [Define this to use ISMAcryp code.])
   1.154 +fi
   1.155 +AC_MSG_RESULT($enable_generic_aesicm)
   1.156 +
   1.157 +AC_MSG_CHECKING(whether to use syslog for error reporting)
   1.158 +AC_ARG_ENABLE(syslog,
   1.159 +  [AS_HELP_STRING([--enable-syslog], [use syslog for error reporting])],
   1.160 +  [], enable_syslog=no)
   1.161 +if test "$enable_syslog" = "yes"; then
   1.162 +   AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog logging.])
   1.163 +fi
   1.164 +AC_MSG_RESULT($enable_syslog)
   1.165 +
   1.166 +AC_MSG_CHECKING(whether to use stdout for error reporting)
   1.167 +AC_ARG_ENABLE(stdout,
   1.168 +  [AS_HELP_STRING([--disable-stdout], [don't use stdout for error reporting])],
   1.169 +  [], enable_stdout=yes)
   1.170 +if test "$enable_stdout" = "yes"; then
   1.171 +   AC_DEFINE(ERR_REPORTING_STDOUT, 1, [Define to use logging to stdout.])
   1.172 +fi
   1.173 +AC_MSG_RESULT($enable_stdout)
   1.174 +
   1.175 +AC_MSG_CHECKING(whether to use /dev/console for error reporting)
   1.176 +AC_ARG_ENABLE(console,
   1.177 +  [AS_HELP_STRING([--enable-console], [use /dev/console for error reporting])],
   1.178 +  [], enable_console=no)
   1.179 +if test "$enable_console" = "yes"; then
   1.180 +   AC_DEFINE(USE_ERR_REPORTING_FILE, 1, [Write errors to this file])
   1.181 +   AC_DEFINE(ERR_REPORTING_FILE, "/dev/console", [Report errors to this file.])
   1.182 +fi
   1.183 +AC_MSG_RESULT($enable_console)
   1.184 +
   1.185 +AC_MSG_CHECKING(whether to use GDOI key management)
   1.186 +AC_ARG_ENABLE(gdoi,
   1.187 +  [AS_HELP_STRING([--enable-gdoi], [enable GDOI key management])],
   1.188 +  [], enable_gdoi=no)
   1.189 +if test "$enable_gdoi" = "yes"; then
   1.190 +   AC_DEFINE(SRTP_GDOI, 1, [Define to use GDOI.])
   1.191 +   GDOI_OBJS=gdoi/srtp+gdoi.o
   1.192 +   AC_SUBST(GDOI_OBJS)                              
   1.193 +fi
   1.194 +AC_MSG_RESULT($enable_gdoi)
   1.195 +
   1.196 +AC_CONFIG_HEADER(crypto/include/config.h:config_in.h)
   1.197 +
   1.198 +AC_OUTPUT(Makefile crypto/Makefile doc/Makefile)
   1.199 +
   1.200 +# This is needed when building outside the source dir.
   1.201 +AS_MKDIR_P(crypto/ae_xfm)
   1.202 +AS_MKDIR_P(crypto/cipher)
   1.203 +AS_MKDIR_P(crypto/hash)
   1.204 +AS_MKDIR_P(crypto/kernel)
   1.205 +AS_MKDIR_P(crypto/math)
   1.206 +AS_MKDIR_P(crypto/replay)
   1.207 +AS_MKDIR_P(crypto/rng)
   1.208 +AS_MKDIR_P(crypto/test)
   1.209 +AS_MKDIR_P(doc)
   1.210 +AS_MKDIR_P(srtp)
   1.211 +AS_MKDIR_P(tables)
   1.212 +AS_MKDIR_P(test)

mercurial