-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
117 lines (95 loc) · 3.41 KB
/
configure.ac
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
109
110
111
112
113
114
115
116
117
AC_PREREQ(2.68)
AC_INIT([pktanon], [2.0-beta], [[email protected]])
AM_INIT_AUTOMAKE([-Wall, -Werror foreign])
AC_CONFIG_SRCDIR([src/Main.cpp])
AC_CONFIG_MACRO_DIRS([m4])
## by default non-verbose output, override with make V=1
AM_SILENT_RULES
#################################################################################
# Source Code Config
#################################################################################
AC_PROG_CXX
AM_PROG_AR
AC_PROG_RANLIB
AC_PROG_INSTALL
PKG_PROG_PKG_CONFIG
AC_CHECK_HEADERS([stddef.h],[],[AC_MSG_ERROR(["missing required headers"])])
AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
#xerces-c is required for configuration
PKG_CHECK_MODULES([xerces], [xerces-c])
# libnettle is required for hash functions
PKG_CHECK_MODULES([libnettle], [nettle],
[havenettle=true],
[AC_MSG_WARN([[
*****
libnettle was not found... AnonHashSha* will not be available
*****
]])]
)
AM_CONDITIONAL([USE_NETTLE], [test x$havenettle = xtrue])
# include bytewise hash primitives (disabled by default)
AC_ARG_ENABLE(bytewisehashanons,
[[
--enable-bytewisehashanons enables AnonBytewiseHashSha1 and AnonBytewiseHashHmacSha1
** WARNING ** these primitives are likely not secure!!
]],
[case "${enableval}" in
yes)
# check if crypto library is present
if [test x$havenettle = xtrue];
then
bytewisehashanons=true
else
AC_MSG_ERROR([[
*****
cannot enable AnonBytewiseHash* primitives... crypto library not found...
please disable bytewisehashanons
*****
]])
fi
;;
no)
bytewisehashanons=false ;;
*)
AC_MSG_ERROR(bad value ${enableval} for --enable-bytewisehashanons) ;;
esac],
[bytewisehashanons=false])
AM_CONDITIONAL(BYTEWISEHASHANONS, test x$bytewisehashanons = xtrue)
# check requirements for raw sockets
# check requirements for (inet) sockets
AC_CHECK_FUNCS([socket],[],[AC_MSG_ERROR(["require sockets"])])
AC_CHECK_HEADERS([sys/socket.h arpa/inet.h],[],[AC_MSG_ERROR(["missing headers required for sockets"])])
# TODO: include conditionally #
# AM_CONDITIONAL([USE_SOCKETOUTPUT], [test "ac_cv_func_socket" = yes -a "ac_cv_header_sys_socket_h" = yes ])
# check requirements for raw sockets
AC_CHECK_HEADERS([sys/ioctl.h netinet/in.h linux/if_ether.h netpacket/packet.h net/if.h sys/ioctl.h fcntl.h],[],[AC_MSG_ERROR(["missing headers required for raw sockets"])])
# TODO: include conditionally #
# check libpcap
AC_CHECK_HEADERS([pcap/pcap.h])
AC_CHECK_LIB([pcap],[pcap_create],[echo $ac_cv_lib_pcap_pcap_create])
AM_CONDITIONAL([USE_LIBPCAP], [test "$ac_cv_lib_pcap_pcap_create" = yes])
# libhogweed is a part of libnettle that depends on glib for bigint values, it might be needed for
# public key cryptography
# PKG_CHECK_MODULES([libhogweed], [hogweed],
# [HAVE_HOGWEED=1],
# [AC_MSG_WARN([[
# *****
# libnettle/libhogweed was not found... AnonHashHmac* will not be available
# *****
# ]])]
# )
# AM_CONDITIONAL([INC_NETTLE_HMACS], [test "$cryptolib" -eq "hogweed"])
#################################################################################
# Testing
#####################################################################
#AC_ARG_ENABLE(debug)
#################################################################################
# Last
#####################################################################
AC_CONFIG_FILES([
Makefile
src/Makefile
libpktanon/Makefile
tests/Makefile
])
AC_OUTPUT