-
Notifications
You must be signed in to change notification settings - Fork 18
/
configure.in
108 lines (92 loc) · 3.57 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 2011 Olaf Bergmann <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
AC_PREREQ([2.65])
AC_INIT([tinydtls], [0.0.1])
AC_CONFIG_SRCDIR([netq.c])
dnl AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_RANLIB
AC_PATH_PROG(DOXYGEN, doxygen, [:])
AC_C_BIGENDIAN
# Checks for libraries.
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([socket], [socket])
AC_CHECK_LIB([dl], [dlopen])
# custom check for openssl
AC_ARG_WITH(openssl,
[AS_HELP_STRING([--without-openssl],
[disable openssl (use --with-openssl=PATH to specify a custom path for your OpenSSL installation)])],
[with_openssl=$withval],
[with_openssl=auto])
AS_IF([test "x$with_openssl" = "xauto" -o "x$with_openssl" = "xyes"],
[AC_CHECK_LIB([ssl], [DTLSv1_method])
AC_CHECK_LIB([crypto], [BIO_new])] ,
[test "x$with_openssl" != "xno"],
[LIBS="${LIBS} -L${withval}/lib -lssl -lcrypto"
CPPFLAGS="${CPPFLAGS} -I${withval}/include"],
[AC_DEFINE([DSRV_NO_DTLS], [],
[Define if you do not want DTLS support])
CPPFLAGS="${CPPFLAGS} -DDSRV_NO_DTLS"]
)
AC_ARG_WITH(protocol_demux,
[AS_HELP_STRING([--without-protocol-demux],
[disable protocol demultiplexing (i.e. forbid cleartext on DTLS-enabled sockets)])]
)
AS_IF([test "x$with_protocol_demux" = "xno"],
[AC_DEFINE([DSRV_NO_PROTOCOL_DEMUX], [],
[Define if you do not want intermix cleartext with DTLS])
CPPFLAGS="${CPPFLAGS} -DDSRV_NO_PROTOCOL_DEMUX"]
)
AC_ARG_WITH(sha256,
[AS_HELP_STRING([--without-sha256],[disable use of SHA256])],
[],
[CPPFLAGS="${CPPFLAGS} -DWITH_SHA256"])
AC_ARG_WITH(sha384,
[AS_HELP_STRING([--with-sha384],[enable use of SHA384])],
[CPPFLAGS="${CPPFLAGS} -DWITH_SHA384"])
AC_ARG_WITH(sha512,
[AS_HELP_STRING([--with-sha512],[enable use of SHA512])],
[CPPFLAGS="${CPPFLAGS} -DWITH_SHA521"])
# Checks for header files.
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 sys/param.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_SIZE_T
dnl AC_TYPE_UINT8_T
dnl AC_TYPE_UINT16_T
dnl AC_TYPE_UINT32_T
dnl AC_TYPE_UINT64_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset select socket strdup strerror])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile
doc/Makefile
doc/Doxyfile
tests/Makefile
sha2/Makefile])
AC_OUTPUT