-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathconfigure.ac
More file actions
151 lines (139 loc) · 5.7 KB
/
configure.ac
File metadata and controls
151 lines (139 loc) · 5.7 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Copyright (c) 2022 Oracle and/or its affiliates.
dnl
dnl ktls-utils is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU General Public License as
dnl published by the Free Software Foundation; version 2.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
dnl 02110-1301, USA.
dnl
AC_PREREQ([2.69])
AC_INIT([ktls-utils],[1.4.0-rc2],[kernel-tls-handshake@lists.linux.dev])
AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_PREFIX_DEFAULT(/usr)
AC_USE_SYSTEM_EXTENSIONS
AC_LANG(C)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MKDIR_P
unitdir=/usr/lib/systemd/system
AC_ARG_WITH(systemd,
[AS_HELP_STRING([--with-systemd@<:@=unit-dir-path@:>@],
[install systemd unit files @<:@Default: no, and path defaults to /usr/lib/systemd/system if not given@:>@])],
if test "$withval" != "no" ; then
use_systemd=1
if test "$withval" != "yes" ; then
unitdir=$withval
fi
else
use_systemd=0
fi
)
AM_CONDITIONAL(INSTALL_SYSTEMD, [test "$use_systemd" = 1])
AC_SUBST(unitdir)
AC_ARG_ENABLE(session-tags,
[AS_HELP_STRING([--enable-session-tags],
[enable TLS session tags support @<:@Default: no@:>@])],
[enable_session_tags=$enableval],
[enable_session_tags=no])
AM_CONDITIONAL(HAVE_SESSION_TAGS, [test "x$enable_session_tags" = xyes])
if test "x$enable_session_tags" = xyes ; then
AC_DEFINE([HAVE_SESSION_TAGS], [1],
[Define to 1 to enable TLS session tags support])
fi
PKG_PROG_PKG_CONFIG([0.9.0])
PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.3.0])
AC_SUBST([LIBGNUTLS_CFLAGS])
AC_SUBST([LIBGNUTLS_LIBS])
PKG_CHECK_MODULES([LIBKEYUTILS], [libkeyutils])
AC_SUBST([LIBKEYUTILS_CFLAGS])
AC_SUBST([LIBKEYUTILS_LIBS])
PKG_CHECK_MODULES([GLIB], glib-2.0 >= 2.6)
AC_SUBST([GLIB_CFLAGS])
AC_SUBST([GLIB_LIBS])
PKG_CHECK_MODULES([LIBNL3], libnl-3.0 >= 3.1)
AC_SUBST([LIBNL3_CFLAGS])
AC_SUBST([LIBNL3_LIBS])
PKG_CHECK_MODULES([LIBNL_GENL3], libnl-genl-3.0 >= 3.1)
AC_SUBST([LIBNL_GENL3_CFLAGS])
AC_SUBST([LIBNL_GENL3_LIBS])
if test "x$enable_session_tags" = xyes ; then
PKG_CHECK_MODULES([LIBYAML], [yaml-0.1])
AC_SUBST([LIBYAML_CFLAGS])
AC_SUBST([LIBYAML_LIBS])
fi
AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, false)
if test "$DOXYGEN" = false; then
AC_MSG_WARN([Doxygen not found - documentation will not be built])
fi
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$DOXYGEN" != "false"])
AC_CHECK_LIB([gnutls], [gnutls_handshake_set_secret_function],
[AC_DEFINE([HAVE_GNUTLS_QUIC], [1],
[Define to 1 if you have the gnutls_handshake_set_secret_function function.])])
AC_CHECK_LIB([gnutls], [gnutls_transport_is_ktls_enabled],
[AC_DEFINE([HAVE_GNUTLS_TRANSPORT_IS_KTLS_ENABLED], [1],
[Define to 1 if you have the gnutls_transport_is_ktls_enabled function.])])
AC_CHECK_LIB([gnutls], [gnutls_protocol_set_enabled],
[AC_DEFINE([HAVE_GNUTLS_PROTOCOL_SET_ENABLED], [1],
[Define to 1 if you have the gnutls_protocol_set_enabled function.])])
AC_CHECK_LIB([gnutls], [gnutls_get_system_config_file],
[AC_DEFINE([HAVE_GNUTLS_GET_SYSTEM_CONFIG_FILE], [1],
[Define to 1 if you have the gnutls_get_system_config_file function.])])
AC_CHECK_LIB([gnutls], [gnutls_psk_allocate_client_credentials2],
[AC_DEFINE([HAVE_GNUTLS_PSK_ALLOCATE_CREDENTIALS2], [1],
[Define to 1 if you have the gnutls_psk_allocate_client_credentials2 function.])])
AC_CHECK_LIB([gnutls], [gnutls_record_get_max_send_size],
[AC_DEFINE([HAVE_GNUTLS_RECORD_GET_MAX_SEND_SIZE], [1],
[Define to 1 if you have the gnutls_record_get_max_send_size function.])])
AC_CHECK_LIB([glib-2.0], [g_pattern_spec_match],
[AC_DEFINE([HAVE_GLIB_G_PATTERN_SPEC_MATCH], [1],
[Define to 1 if you have the g_pattern_spec_match function.])])
AC_CHECK_LIB([glib-2.0], [g_pattern_spec_match_string],
[AC_DEFINE([HAVE_GLIB_G_PATTERN_SPEC_MATCH_STRING], [1],
[Define to 1 if you have the g_pattern_spec_match_string function.])])
AC_MSG_CHECKING(for ML-DSA support in gnutls)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[ #include <gnutls/gnutls.h> ]],
[[ (void) GNUTLS_SIGN_MLDSA65; ]])],
[ have_mldsa=yes ],
[ have_mldsa=no ])
AC_MSG_RESULT([$have_mldsa])
if test "x$have_mldsa" = xyes ; then
AC_DEFINE([HAVE_GNUTLS_MLDSA], [1], [Define to 1 if gnutls supports ML-DSA])
fi
AC_MSG_CHECKING(for TLS_TX_MAX_PAYLOAD_LEN in linux/tls.h)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[ #include <linux/tls.h> ]],
[[ (void) TLS_TX_MAX_PAYLOAD_LEN; ]])],
[ have_tls_tx_max_payload_len=yes ],
[ have_tls_tx_max_payload_len=no ])
AC_MSG_RESULT([$have_tls_tx_max_payload_len])
if test "x$have_tls_tx_max_payload_len" = xyes ; then
AC_DEFINE([HAVE_TLS_TX_MAX_PAYLOAD_LEN], [1], [Define to 1 if linux/tls.h defines TLS_TX_MAX_PAYLOAD_LEN])
fi
AC_SUBST([AM_CPPFLAGS])
AC_CONFIG_FILES([Makefile \
docs/Doxyfile \
docs/Makefile \
etc/Makefile \
etc/tlshd/Makefile \
man/Makefile \
man/man5/Makefile \
man/man7/Makefile \
man/man8/Makefile \
src/Makefile \
src/tlshd/Makefile \
systemd/Makefile])
AC_OUTPUT