aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac133
1 files changed, 90 insertions, 43 deletions
diff --git a/configure.ac b/configure.ac
index f30a7efa91..af143e44ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,10 +4,19 @@ dnl Copyright (c) 2007-2019, The Tor Project, Inc.
dnl See LICENSE for licensing information
AC_PREREQ([2.63])
-AC_INIT([tor],[0.3.5.11-dev])
+AC_INIT([tor],[0.4.2.8-dev])
AC_CONFIG_SRCDIR([src/app/main/tor_main.c])
AC_CONFIG_MACRO_DIR([m4])
+# DO NOT EDIT THIS DEFINITION BY HAND UNLESS YOU KNOW WHAT YOU'RE DOING.
+#
+# The update_versions.py script updates this definition when the
+# version number changes. Tor uses it to make sure that it
+# only shuts down for missing "required protocols" when those protocols
+# are listed as required by a consensus after this date.
+AC_DEFINE(APPROX_RELEASE_DATE, ["2020-07-09"], # for 0.4.2.8-dev
+ [Approximate date when this software was released. (Updated when the version changes.)])
+
# "foreign" means we don't follow GNU package layout standards
# "1.11" means we require automake version 1.11 or newer
# "subdir-objects" means put .o files in the same directory as the .c files
@@ -20,6 +29,18 @@ AC_USE_SYSTEM_EXTENSIONS
AC_CANONICAL_HOST
PKG_PROG_PKG_CONFIG
+if test "x$PKG_CONFIG" = "x" ; then
+ pkg_config_user_action="install pkg-config, and check the PKG_CONFIG_PATH environment variable"
+ AC_MSG_NOTICE([Some libraries need pkg-config, including systemd, nss, lzma, zstd, and custom mallocs.])
+ AC_MSG_NOTICE([To use those libraries, $pkg_config_user_action.])
+else
+ pkg_config_user_action="check the PKG_CONFIG_PATH environment variable"
+fi
+
+if test "x$PKG_CONFIG_PATH" = "x" && test "x$prefix" != "xNONE" && test "$host" != "$build"; then
+ export PKG_CONFIG_PATH=$prefix/lib/pkgconfig
+ AC_MSG_NOTICE([set PKG_CONFIG_PATH=$PKG_CONFIG_PATH to support cross-compiling])
+fi
AC_ARG_ENABLE(openbsd-malloc,
AS_HELP_STRING(--enable-openbsd-malloc, [use malloc code from OpenBSD. Linux only. Deprecated: see --with-malloc]))
@@ -96,6 +117,12 @@ if test "$enable_memory_sentinels" = "no"; then
[Defined if we're turning off memory safety code to look for bugs])
fi
+AC_ARG_ENABLE(manpage,
+ AS_HELP_STRING(--disable-manpage, [Disable manpage generation.]))
+
+AC_ARG_ENABLE(html-manual,
+ AS_HELP_STRING(--disable-html-manual, [Disable HTML documentation.]))
+
AC_ARG_ENABLE(asciidoc,
AS_HELP_STRING(--disable-asciidoc, [don't use asciidoc (disables building of manpages)]),
[case "${enableval}" in
@@ -145,13 +172,13 @@ if test "x$have_systemd" = "xyes"; then
TOR_SYSTEMD_CFLAGS="${SYSTEMD_CFLAGS}"
TOR_SYSTEMD_LIBS="${SYSTEMD_LIBS}"
PKG_CHECK_MODULES(LIBSYSTEMD209, [libsystemd >= 209],
- [AC_DEFINE(HAVE_SYSTEMD_209,1,[Have systemd v209 or more])], [])
+ [AC_DEFINE(HAVE_SYSTEMD_209,1,[Have systemd v209 or greater])], [])
fi
AC_SUBST(TOR_SYSTEMD_CFLAGS)
AC_SUBST(TOR_SYSTEMD_LIBS)
if test "x$enable_systemd" = "xyes" -a "x$have_systemd" != "xyes" ; then
- AC_MSG_ERROR([Explicitly requested systemd support, but systemd not found])
+ AC_MSG_ERROR([Explicitly requested systemd support, but systemd not found, $pkg_config_user_action, or set SYSTEMD_CFLAGS and SYSTEMD_LIBS.])
fi
case "$host" in
@@ -236,11 +263,11 @@ 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"])
+ [Build tor without the Directory Authority module: tor can not run as a directory authority or bridge authority]))
+AM_CONDITIONAL(BUILD_MODULE_DIRAUTH,[test "x$enable_module_dirauth" != "xno"])
+AM_COND_IF(BUILD_MODULE_DIRAUTH,
+ AC_DEFINE([HAVE_MODULE_DIRAUTH], [1],
+ [Compile with Directory Authority feature support]))
dnl Helper variables.
TOR_MODULES_ALL_ENABLED=
@@ -290,6 +317,8 @@ AC_PATH_PROG([ASCIIDOC], [asciidoc], none)
AC_PATH_PROGS([A2X], [a2x a2x.py], none)
AM_CONDITIONAL(USE_ASCIIDOC, test "x$asciidoc" = "xtrue")
+AM_CONDITIONAL(BUILD_MANPAGE, [test "x$enable_manpage" != "xno"])
+AM_CONDITIONAL(BUILD_HTML_DOCS, [test "x$enable_html_manual" != "xno"])
AM_PROG_CC_C_O
AC_PROG_CC_C99
@@ -519,15 +548,6 @@ if test "x$enable_rust" = "xyes"; then
fi
fi
- dnl This is a workaround for #46797
- dnl (a.k.a https://github.com/rust-lang/rust/issues/46797 ). Once the
- dnl upstream bug is fixed, we can remove this workaround.
- case "$host_os" in
- darwin*)
- TOR_RUST_EXTRA_LIBS="-lresolv"
- ;;
- esac
-
dnl For now both MSVC and MinGW rust libraries will output static libs with
dnl the MSVC naming convention.
if test "$bwin32" = "true"; then
@@ -566,14 +586,12 @@ if test "x$enable_rust" = "xyes"; then
if test "x$RUSTC_VERSION_MAJOR" = "x" -o "x$RUSTC_VERSION_MINOR" = "x"; then
AC_MSG_ERROR([rustc version couldn't be identified])
fi
- if test "$RUSTC_VERSION_MAJOR" -lt 2 -a "$RUSTC_VERSION_MINOR" -lt 14; then
- AC_MSG_ERROR([rustc must be at least version 1.14])
+ if test "$RUSTC_VERSION_MAJOR" -lt 2 -a "$RUSTC_VERSION_MINOR" -lt 31; then
+ AC_MSG_ERROR([rustc must be at least version 1.31.0])
fi
AC_MSG_RESULT([$RUSTC_VERSION])
fi
-AC_SUBST(TOR_RUST_EXTRA_LIBS)
-
AC_SEARCH_LIBS(socket, [socket network])
AC_SEARCH_LIBS(gethostbyname, [nsl])
AC_SEARCH_LIBS(dlopen, [dl])
@@ -623,8 +641,10 @@ AC_CHECK_FUNCS(
llround \
localtime_r \
lround \
+ madvise \
memmem \
memset_s \
+ minherit \
mmap \
pipe \
pipe2 \
@@ -828,6 +848,8 @@ fi
dnl Now check for particular libevent functions.
AC_CHECK_FUNCS([evutil_secure_rng_set_urandom_device_file \
evutil_secure_rng_add_bytes \
+ evdns_base_get_nameserver_addr \
+
])
LIBS="$save_LIBS"
@@ -876,7 +898,7 @@ if test "x$enable_nss" = "xyes"; then
PKG_CHECK_MODULES(NSS,
[nss],
[have_nss=yes],
- [have_nss=no; AC_MSG_ERROR([You asked for NSS but I can't find it.])])
+ [have_nss=no; AC_MSG_ERROR([You asked for NSS but I can't find it, $pkg_config_user_action, or set NSS_CFLAGS and NSS_LIBS.])])
AC_SUBST(NSS_CFLAGS)
AC_SUBST(NSS_LIBS)
fi
@@ -963,21 +985,24 @@ AC_CHECK_MEMBERS([struct ssl_method_st.get_cipher_by_char], , ,
[#include <openssl/ssl.h>
])
+dnl OpenSSL functions which we might not have. In theory, we could just
+dnl check the openssl version number, but in practice that gets pretty
+dnl confusing with LibreSSL, OpenSSL, and various distributions' patches
+dnl to them.
AC_CHECK_FUNCS([ \
ERR_load_KDF_strings \
+ EVP_PBE_scrypt \
+ EVP_sha3_256 \
+ SSL_CIPHER_find \
+ SSL_CTX_set1_groups_list \
+ SSL_CTX_set_security_level \
SSL_SESSION_get_master_key \
+ SSL_get_client_ciphers \
+ SSL_get_client_random \
SSL_get_server_random \
- SSL_get_client_ciphers \
- SSL_get_client_random \
- SSL_CTX_set1_groups_list \
- SSL_CIPHER_find \
- SSL_CTX_set_security_level \
- TLS_method
+ TLS_method \
])
-dnl Check if OpenSSL has scrypt implementation.
-AC_CHECK_FUNCS([ EVP_PBE_scrypt ])
-
dnl Check if OpenSSL structures are opaque
AC_CHECK_MEMBERS([SSL.state], , ,
[#include <openssl/ssl.h>
@@ -989,6 +1014,15 @@ AC_CHECK_SIZEOF(SHA_CTX, , [AC_INCLUDES_DEFAULT()
fi # enable_nss
+dnl We will someday make KECCAK_TINY optional, but for now we still need
+dnl it for SHAKE, since OpenSSL's SHAKE can't be squeezed more than
+dnl once. See comment in the definition of crypto_xof_t.
+
+dnl AM_CONDITIONAL(BUILD_KECCAK_TINY,
+dnl test "x$ac_cv_func_EVP_sha3_256" != "xyes")
+
+AM_CONDITIONAL(BUILD_KECCAK_TINY, true)
+
dnl ======================================================================
dnl Can we use KIST?
@@ -1070,7 +1104,7 @@ else
have_lzma=no)
if test "x$have_lzma" = "xno" ; then
- AC_MSG_WARN([Unable to find liblzma.])
+ AC_MSG_WARN([Unable to find liblzma, $pkg_config_user_action, or set LZMA_CFLAGS and LZMA_LIBS.])
fi
fi
@@ -1102,7 +1136,7 @@ else
have_zstd=no)
if test "x$have_zstd" = "xno" ; then
- AC_MSG_WARN([Unable to find libzstd.])
+ AC_MSG_WARN([Unable to find libzstd, $pkg_config_user_action, or set ZSTD_CFLAGS and ZSTD_LIBS.])
fi
fi
@@ -1190,6 +1224,17 @@ m4_ifdef([AS_VAR_IF],[
TOR_CHECK_LDFLAGS(-pie, "$all_ldflags_for_check", "$all_libs_for_check")
fi
TOR_TRY_COMPILE_WITH_CFLAGS(-fwrapv, also_link, CFLAGS_FWRAPV="-fwrapv", true)
+
+ AC_MSG_CHECKING([whether we can run hardened binaries])
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([dnl
+ We can link with compiler hardening options, but we can't run with them.
+ That's a bad sign! If you must, you can pass --disable-gcc-hardening to
+ configure, but it would be better to figure out what the underlying problem
+ is.])],
+ [AC_MSG_RESULT([cross])])
fi
if test "$fragile_hardening" = "yes"; then
@@ -1212,6 +1257,11 @@ if test "$fragile_hardening" = "yes"; then
AC_MSG_ERROR([The compiler supports -fsanitize=undefined, but for some reason I was not able to link when using it. Are you missing run-time support? With GCC you need libasan.*, and with Clang you need libclang_rt.ubsan*])
fi
+ TOR_TRY_COMPILE_WITH_CFLAGS([-fno-sanitize=float-divide-by-zero], also_link, CFLAGS_UBSAN="-fno-sanitize=float-divide-by-zero", true)
+ if test "$tor_cv_cflags__fno_sanitize_float_divide_by_zero" = "yes" && test "$tor_can_link__fno_sanitize_float_divide_by_zero" != "yes"; then
+ AC_MSG_ERROR([The compiler supports -fno-sanitize=float-divide-by-zero, but for some reason I was not able to link when using it. Are you missing run-time support? With GCC you need libasan.*, and with Clang you need libclang_rt.ubsan*])
+ fi
+
TOR_CHECK_CFLAGS([-fno-omit-frame-pointer])
fi
@@ -1466,6 +1516,7 @@ AC_CHECK_HEADERS([errno.h \
inttypes.h \
limits.h \
linux/types.h \
+ mach/vm_inherit.h \
machine/limits.h \
malloc.h \
malloc/malloc.h \
@@ -1601,6 +1652,7 @@ AC_CHECK_MEMBERS([struct timeval.tv_sec], , ,
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(__int64)
@@ -1863,8 +1915,7 @@ if test "$tor_cv_uint8_uchar" = "no"; then
fi
AC_ARG_WITH(tcmalloc,
-AS_HELP_STRING(--with-tcmalloc, [use tcmalloc memory allocation library. Deprecated; see --with-malloc]),
-[ tcmalloc=yes ], [ tcmalloc=no ])
+AS_HELP_STRING(--with-tcmalloc, [use tcmalloc memory allocation library. Deprecated; see --with-malloc]))
default_malloc=system
@@ -1873,7 +1924,7 @@ if test "x$enable_openbsd_malloc" = "xyes" ; then
default_malloc=openbsd
fi
-if test "x$tcmalloc" = "xyes"; then
+if test "x$with_tcmalloc" = "xyes"; then
AC_MSG_NOTICE([The --with-tcmalloc argument is deprecated; use --with-malloc=tcmalloc instead.])
default_malloc=tcmalloc
fi
@@ -1891,7 +1942,7 @@ AS_CASE([$malloc],
have_tcmalloc=no)
if test "x$have_tcmalloc" = "xno" ; then
- AC_MSG_ERROR([Unable to find tcmalloc requested by --with-malloc.])
+ AC_MSG_ERROR([Unable to find tcmalloc requested by --with-malloc, $pkg_config_user_action, or set TCMALLOC_CFLAGS and TCMALLOC_LIBS.])
fi
CFLAGS="$CFLAGS $TCMALLOC_CFLAGS"
@@ -1904,8 +1955,8 @@ AS_CASE([$malloc],
have_jemalloc=yes,
have_jemalloc=no)
- if test "x$have_tcmalloc" = "xno" ; then
- AC_MSG_ERROR([Unable to find jemalloc requested by --with-malloc.])
+ if test "x$have_jemalloc" = "xno" ; then
+ AC_MSG_ERROR([Unable to find jemalloc requested by --with-malloc, $pkg_config_user_action, or set JEMALLOC_CFLAGS and JEMALLOC_LIBS.])
fi
CFLAGS="$CFLAGS $JEMALLOC_CFLAGS"
@@ -2452,16 +2503,12 @@ AC_CONFIG_FILES([
Doxyfile
Makefile
config.rust
- contrib/dist/suse/tor.sh
contrib/operator-tools/tor.logrotate
- contrib/dist/tor.sh
- contrib/dist/torctl
contrib/dist/tor.service
src/config/torrc.sample
src/config/torrc.minimal
src/rust/.cargo/config
scripts/maint/checkOptionDocs.pl
- scripts/maint/updateVersions.pl
warning_flags
])