aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac97
1 files changed, 84 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index fbe6450e88..3b1a6c0081 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ dnl Copyright (c) 2007-2017, The Tor Project, Inc.
dnl See LICENSE for licensing information
AC_PREREQ([2.63])
-AC_INIT([tor],[0.3.3.6])
+AC_INIT([tor],[0.3.4.1-alpha-dev])
AC_CONFIG_SRCDIR([src/or/main.c])
AC_CONFIG_MACRO_DIR([m4])
@@ -61,6 +61,8 @@ AC_ARG_ENABLE(cargo-online-mode,
AS_HELP_STRING(--enable-cargo-online-mode, [Allow cargo to make network requests to fetch crates. For builds with rust only.]))
AC_ARG_ENABLE(restart-debugging,
AS_HELP_STRING(--enable-restart-debugging, [Build Tor with support for debugging in-process restart. Developers only.]))
+AC_ARG_ENABLE(zstd-advanced-apis,
+ AS_HELP_STRING(--disable-zstd-advanced-apis, [Build without support for zstd's "static-only" APIs.]))
if test "x$enable_coverage" != "xyes" -a "x$enable_asserts_in_tests" = "xno" ; then
AC_MSG_ERROR([Can't disable assertions outside of coverage build])
@@ -114,6 +116,10 @@ if test "$enable_restart_debugging" = "yes"; then
[Defined if we're building with support for in-process restart debugging.])
fi
+if test "$enable_zstd_advanced_apis" != "no"; then
+ AC_DEFINE(ENABLE_ZSTD_ADVANCED_APIS, 1,
+ [Defined if we're going to try to use zstd's "static-only" APIs.])
+fi
# systemd support
if test "x$enable_systemd" = "xno"; then
@@ -224,6 +230,31 @@ if test "x$enable_android" = "xyes"; then
fi
+dnl ---
+dnl Tor modules options. These options are namespaced with --disable-module-XXX
+dnl ---
+
+dnl All our modules.
+m4_define(MODULES, dirauth)
+
+dnl Directory Authority module.
+AC_ARG_ENABLE([module-dirauth],
+ AS_HELP_STRING([--disable-module-dirauth],
+ [Do not build tor with the dirauth module]),
+ [], dnl Action if-given
+ AC_DEFINE([HAVE_MODULE_DIRAUTH], [1],
+ [Compile with Directory Authority feature support]))
+AM_CONDITIONAL(BUILD_MODULE_DIRAUTH, [test "x$enable_module_dirauth" != "xno"])
+
+dnl Helper variables.
+TOR_MODULES_ALL_ENABLED=
+AC_DEFUN([ADD_MODULE], [
+ MODULE=m4_toupper($1)
+ TOR_MODULES_ALL_ENABLED="${TOR_MODULES_ALL_ENABLED} -DHAVE_MODULE_${MODULE}=1"
+])
+m4_foreach_w([module], MODULES, [ADD_MODULE([module])])
+AC_SUBST(TOR_MODULES_ALL_ENABLED)
+
dnl check for the correct "ar" when cross-compiling.
dnl (AM_PROG_AR was new in automake 1.11.2, which we do not yet require,
dnl so kludge up a replacement for the case where it isn't there yet.)
@@ -275,7 +306,10 @@ fi
AM_CONDITIONAL(USEPYTHON, [test "x$PYTHON" != "x"])
dnl List all external rust crates we depend on here. Include the version
-rust_crates="libc-0.2.39"
+rust_crates=" \
+ digest-0.7.2 \
+ libc-0.2.39 \
+"
AC_SUBST(rust_crates)
ifdef([AC_C_FLEXIBLE_ARRAY_MEMBER], [
@@ -547,6 +581,7 @@ AC_CHECK_FUNCS(
mach_approximate_time \
memmem \
memset_s \
+ mmap \
pipe \
pipe2 \
prctl \
@@ -615,6 +650,21 @@ fi
AM_CONDITIONAL(BUILD_READPASSPHRASE_C,
test "x$ac_cv_func_readpassphrase" = "xno" && test "$bwin32" = "false")
+AC_MSG_CHECKING([whether free(NULL) works])
+AC_RUN_IFELSE([AC_LANG_PROGRAM([
+ #include <stdlib.h>
+], [
+char *p = NULL;
+free(p);
+])],
+[free_null_ok=true; AC_MSG_RESULT(yes)],
+[free_null_ok=false; AC_MSG_RESULT(no)],
+[free_null_ok=cross; AC_MSG_RESULT(cross)])
+
+if test "$free_null_ok" = "false"; then
+ AC_MSG_ERROR([Your libc implementation doesn't allow free(NULL), as required by C99.])
+fi
+
dnl ------------------------------------------------------
dnl Where do you live, libevent? And how do we call you?
@@ -766,9 +816,18 @@ AC_ARG_WITH(ssl-dir,
AC_MSG_NOTICE([Now, we'll look for OpenSSL >= 1.0.1])
TOR_SEARCH_LIBRARY(openssl, $tryssldir, [-lssl -lcrypto $TOR_LIB_GDI $TOR_LIB_WS32],
- [#include <openssl/ssl.h>],
- [struct ssl_method_st; const struct ssl_method_st *TLSv1_1_method(void);],
- [TLSv1_1_method();], [],
+ [#include <openssl/ssl.h>
+ char *getenv(const char *);],
+ [struct ssl_cipher_st;
+ unsigned SSL_CIPHER_get_id(const struct ssl_cipher_st *);
+ char *getenv(const char *);],
+ dnl This funny-looking test program calls getenv, so that the compiler
+ dnl will neither make code that call SSL_CIPHER_get_id(NULL) [producing
+ dnl a crash], nor optimize out the call to SSL_CIPHER_get_id().
+ dnl We look for SSL_cipher_get_id() because it is present in
+ dnl OpenSSL >=1.0.1, because it is not deprecated, and because Tor
+ dnl depends on it.
+ [if (getenv("THIS_SHOULDNT_BE_SET_X201803")) SSL_CIPHER_get_id((void *)0);], [],
[/usr/local/opt/openssl /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /opt/openssl])
dnl XXXX check for OPENSSL_VERSION_NUMBER == SSLeay()
@@ -835,6 +894,10 @@ AC_CHECK_MEMBERS([SSL.state], , ,
[#include <openssl/ssl.h>
])
+AC_CHECK_SIZEOF(SHA_CTX, , [AC_INCLUDES_DEFAULT()
+#include <openssl/sha.h>
+])
+
dnl Define the set of checks for KIST scheduler support.
AC_DEFUN([CHECK_KIST_SUPPORT],[
dnl KIST needs struct tcp_info and for certain members to exist.
@@ -953,6 +1016,16 @@ if test "x$have_zstd" = "xyes"; then
AC_DEFINE(HAVE_ZSTD,1,[Have Zstd])
TOR_ZSTD_CFLAGS="${ZSTD_CFLAGS}"
TOR_ZSTD_LIBS="${ZSTD_LIBS}"
+
+ dnl now check for zstd functions
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$LIBS $ZSTD_LIBS"
+ CFLAGS="$CFLAGS $ZSTD_CFLAGS"
+ AC_CHECK_FUNCS(ZSTD_estimateCStreamSize \
+ ZSTD_estimateDCtxSize)
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
fi
AC_SUBST(TOR_ZSTD_CFLAGS)
AC_SUBST(TOR_ZSTD_LIBS)
@@ -1705,14 +1778,6 @@ AC_CHECK_DECLS([mlockall], , , [
#include <sys/mman.h>
#endif])
-# Some MinGW environments don't have getpagesize in unistd.h. We don't use
-# AC_CHECK_FUNCS(getpagesize), because other environments rename getpagesize
-# using macros
-AC_CHECK_DECLS([getpagesize], , , [
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif])
-
# Allow user to specify an alternate syslog facility
AC_ARG_WITH(syslog-facility,
AS_HELP_STRING(--with-syslog-facility=LOG, [syslog facility to use (default=LOG_DAEMON)]),
@@ -1850,6 +1915,12 @@ AC_SUBST(BUILDDIR)
AH_TEMPLATE([BUILDDIR],[tor's build directory])
AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
+if test "x$SRCDIR" = "x"; then
+ SRCDIR=$(cd "$srcdir"; pwd)
+fi
+AH_TEMPLATE([SRCDIR],[tor's sourcedir directory])
+AC_DEFINE_UNQUOTED(SRCDIR,"$SRCDIR")
+
if test "x$CONFDIR" = "x"; then
CONFDIR=`eval echo $sysconfdir/tor`
fi