forked from dlundquist/sniproxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
86 lines (69 loc) · 2.46 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.60])
AC_INIT([sniproxy], [0.4.0+git.25.g35faa92])
AC_CONFIG_SRCDIR([src/sni2torproxy.c])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([subdir-objects])
# Checks for programs.
AC_PROG_CC_C99
# Required by automake < 1.14
AM_PROG_CC_C_O
# Checks for libraries.
PKG_CHECK_MODULES([LIBEV], [libev], HAVE_LIBEV=yes; AC_DEFINE(HAVE_LIBEV, 1),
[AC_LIB_HAVE_LINKFLAGS(ev,, [#include <ev.h>], [ev_run(0,0);])
if test x$ac_cv_libev = xyes; then
AC_SUBST([LIBEV_LIBS], [$LIBEV])
else
AC_MSG_ERROR([[***
*** libev4 was not found.
***]])
fi
])
PKG_CHECK_MODULES([LIBPCRE], [libpcre], HAVE_LIBPCRE=yes; AC_DEFINE(HAVE_LIBPCRE, 1),
[AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre.h>], [pcre_exec(0,0,0,0,0,0,0,0);])
if test x$ac_cv_libpcre = xyes; then
AC_SUBST([LIBPCRE_LIBS], [$LIBPCRE])
else
AC_MSG_ERROR([[***
*** libpcre was not found.
***]])
fi
])
AC_ARG_ENABLE([dns],
[AS_HELP_STRING([--disable-dns], [Disable DNS resolution])],
[dns="$withval"], [dns=yes])
AM_CONDITIONAL([DNS_ENABLED], [test "x$dns" = "xyes"])
AS_IF([test "x$dns" = "xyes"],
[PKG_CHECK_MODULES([LIBUDNS], [libudns], HAVE_LIBUDNS=yes; AC_DEFINE(HAVE_LIBUDNS, 1),
[AC_LIB_HAVE_LINKFLAGS(udns,, [#include <udns.h>], [dns_init(0, 0);])
AS_IF([test x$ac_cv_libudns = xyes], [AC_SUBST([LIBUDNS_LIBS], [$LIBUDNS])])
])
])
AC_ARG_ENABLE([rfc3339-timestamps],
[AS_HELP_STRING([--enable-rfc3339-timestamps], [Enable RFC3339 timestamps])],
[rfc3339_timestamps=${enableval}], [rfc3339_timestamps=no])
AS_IF([test "x$rfc3339_timestamps" = "xyes"],
[AC_DEFINE([RFC3339_TIMESTAMP], 1, [RFC3339 timestamps enabled])])
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h],,
AC_MSG_ERROR([required header(s) not found]))
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([daemon memset socket strcasecmp strdup strerror strncasecmp],,
AC_MSG_ERROR([required functions(s) not found]))
# Enable large file support (so we can log more than 2GB)
AC_SYS_LARGEFILE
AC_CONFIG_FILES([Makefile
src/Makefile
man/Makefile
tests/Makefile])
AC_OUTPUT