]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/blob - configure.ac
Disable RC4.
[tlsproxy/tlsproxy.git] / configure.ac
1 dnl Copyright (C) 2011-2014  Simon Ruderich
2 dnl
3 dnl This program is free software: you can redistribute it and/or modify
4 dnl it under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation, either version 3 of the License, or
6 dnl (at your option) any later version.
7 dnl
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 dnl GNU General Public License for more details.
12 dnl
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16
17 AC_PREREQ([2.69])
18 AC_INIT([tlsproxy],[0.2],[simon@ruderich.org])
19
20 AC_CONFIG_AUX_DIR([build-aux])
21 AC_CONFIG_MACRO_DIR([m4])
22 AC_CONFIG_HEADERS([config.h])
23 AC_CONFIG_SRCDIR([src/tlsproxy.c])
24
25 AM_INIT_AUTOMAKE([foreign -Wall -Werror])
26 LT_INIT([disable-static])
27
28 AC_PROG_CC
29
30 # Do this before setting additional flags as the code from AX_PTHREAD fails to
31 # build with -Werror.
32 AX_PTHREAD([],[AC_MSG_ERROR([pthread is required])])
33 LIBS="$PTHREAD_LIBS $LIBS"
34 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
35 CC="$PTHREAD_CC"
36
37 if test "x$GCC" = xyes; then
38     CFLAGS="-std=c89 -pedantic -Wall -Wextra $CFLAGS"
39     CFLAGS="-Wno-error=int-to-pointer-cast $CFLAGS"
40     CPPFLAGS="-D_XOPEN_SOURCE=600 $CPPFLAGS"
41     # Additional hardening flags.
42     CFLAGS="-fPIE -fstack-protector-all -Wformat -Werror=format-security $CFLAGS"
43     CPPFLAGS="-D_FORTIFY_SOURCE=2 $CPPFLAGS"
44     LDFLAGS="-fPIE -pie -Wl,-z,relro -Wl,-z,now $LDFLAGS"
45 fi
46
47 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([dlsym() is required])])
48
49 AC_CHECK_LIB([gnutls], [gnutls_certificate_verify_peers2],
50              [], [AC_MSG_ERROR([GnuTLS is required])])
51 dnl Check for additional GnuTLS functions.
52 AX_CHECK_LIB_FUNC([gnutls],[gnutls_transport_set_int2])
53
54 AC_ARG_ENABLE([debug],
55               [AS_HELP_STRING([--enable-debug],[enable debug output])],
56               [if test "x$enableval" = xyes; then
57                    AC_DEFINE([DEBUG], 1, [Define to enable debug output.])
58                fi])
59
60 AC_ARG_ENABLE([ipv6],
61               [AS_HELP_STRING([--disable-ipv6],
62                               [disable IPv6, for IPv4 only network stacks])],
63               [if test "x$enableval" = xno; then
64                    AC_DEFINE([USE_IPV4_ONLY], 1, [Define to not use IPv6.])
65                fi])
66
67 AC_CONFIG_FILES([Makefile man/Makefile src/Makefile lib/Makefile tests/Makefile])
68 AC_OUTPUT