2 # Process this file with autoconf to produce a configure script.
4 # Copyright (C) 2011--2014 Olaf Bergmann <bergmann@tzi.org>
6 # Permission is hereby granted, free of charge, to any person
7 # obtaining a copy of this software and associated documentation
8 # files (the "Software"), to deal in the Software without
9 # restriction, including without limitation the rights to use, copy,
10 # modify, merge, publish, distribute, sublicense, and/or sell copies
11 # of the Software, and to permit persons to whom the Software is
12 # furnished to do so, subject to the following conditions:
14 # The above copyright notice and this permission notice shall be
15 # included in all copies or substantial portions of the Software.
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 AC_INIT([tinydtls], [0.8.1])
28 AC_CONFIG_SRCDIR([dtls.c])
29 dnl AC_CONFIG_HEADERS([config.h])
32 [AS_HELP_STRING([--with-contiki],[build libtinydtls for the Contiki OS])],
33 [AC_DEFINE(WITH_CONTIKI,1,[Define to 1 if building for Contiki.])
37 AC_PATH_PROG(DOXYGEN, doxygen, [:])
38 AC_PATH_PROG(ETAGS, etags, [/bin/false])
40 if test "${with_contiki}" != "yes" ; then
41 # Checks for programs.
48 # Checks for libraries.
49 AC_SEARCH_LIBS([gethostbyname], [nsl])
50 AC_SEARCH_LIBS([socket], [socket])
54 [AS_HELP_STRING([--without-debug],[disable all debug output and assertions])],
55 [CPPFLAGS="${CPPFLAGS} -DNDEBUG"
60 [AS_HELP_STRING([--without-ecc],[disable support for TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8])],
62 [AC_DEFINE(DTLS_ECC, 1, [Define to 1 if building with ECC support.])
63 OPT_OBJS="${OPT_OBJS} ecc/ecc.o"
67 [AS_HELP_STRING([--without-psk],[disable support for TLS_PSK_WITH_AES_128_CCM_8])],
69 [AC_DEFINE(DTLS_PSK, 1, [Define to 1 if building with PSK support])
72 CPPFLAGS="${CPPFLAGS} -DDTLSv12 -DWITH_SHA256"
73 OPT_OBJS="${OPT_OBJS} sha2/sha2.o"
77 AC_SUBST(WITH_CONTIKI)
81 if test "${with_contiki}" = "yes" ; then
82 AC_MSG_NOTICE([skipping header checks for Contiki])
84 # Checks for header files.
85 AC_CHECK_HEADERS([assert.h arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/param.h sys/socket.h unistd.h])
87 AC_CHECK_HEADERS([sys/time.h time.h])
88 AC_CHECK_HEADERS([sys/types.h sys/stat.h])
90 # Checks for typedefs, structures, and compiler characteristics.
94 AC_CHECK_MEMBER([struct sockaddr_in6.sin6_len],
95 [AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_LEN, [1],
96 [Define to 1 if struct sockaddr_in6 has a member sin6_len.])], [],
97 [#include <netinet/in.h>])
99 # Checks for library functions.
101 AC_CHECK_FUNCS([memset select socket strdup strerror strnlen fls vprintf])
104 AC_CONFIG_HEADERS([dtls_config.h tinydtls.h])
106 AC_CONFIG_FILES([Makefile
110 examples/contiki/Makefile
111 platform-specific/Makefile