summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac335
1 files changed, 171 insertions, 164 deletions
diff --git a/configure.ac b/configure.ac
index ae5c8a83cf..02a1655099 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,11 @@
dnl Copyright (c) 2001-2004, Roger Dingledine
dnl Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
-dnl Copyright (c) 2007-2017, The Tor Project, Inc.
+dnl Copyright (c) 2007-2018, The Tor Project, Inc.
dnl See LICENSE for licensing information
AC_PREREQ([2.63])
-AC_INIT([tor],[0.3.4.6-rc-dev])
-AC_CONFIG_SRCDIR([src/or/main.c])
+AC_INIT([tor],[0.3.5.0-alpha-dev])
+AC_CONFIG_SRCDIR([src/app/main/tor_main.c])
AC_CONFIG_MACRO_DIR([m4])
# "foreign" means we don't follow GNU package layout standards
@@ -21,18 +21,8 @@ AC_CANONICAL_HOST
PKG_PROG_PKG_CONFIG
-if test -f "/etc/redhat-release"; then
- if test -f "/usr/kerberos/include"; then
- CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
- fi
-fi
-
-# Not a no-op; we want to make sure that CPPFLAGS is set before we use
-# the += operator on it in src/or/Makefile.am
-CPPFLAGS="$CPPFLAGS -I\${top_srcdir}/src/common"
-
AC_ARG_ENABLE(openbsd-malloc,
- AS_HELP_STRING(--enable-openbsd-malloc, [use malloc code from OpenBSD. Linux only]))
+ AS_HELP_STRING(--enable-openbsd-malloc, [use malloc code from OpenBSD. Linux only. Deprecated: see --with-malloc]))
AC_ARG_ENABLE(static-openssl,
AS_HELP_STRING(--enable-static-openssl, [link against a static openssl library. Requires --with-openssl-dir]))
AC_ARG_ENABLE(static-libevent,
@@ -92,8 +82,6 @@ if test "$enable_memory_sentinels" = "no"; then
[Defined if we're turning off memory safety code to look for bugs])
fi
-AM_CONDITIONAL(USE_OPENBSD_MALLOC, test "x$enable_openbsd_malloc" = "xyes")
-
AC_ARG_ENABLE(asciidoc,
AS_HELP_STRING(--disable-asciidoc, [don't use asciidoc (disables building of manpages)]),
[case "${enableval}" in
@@ -432,7 +420,7 @@ AH_BOTTOM([
#endif
])
-
+AM_CONDITIONAL(WIN32, test "x$bwin32" = "xtrue")
AM_CONDITIONAL(BUILD_NT_SERVICES, test "x$bwin32" = "xtrue")
AM_CONDITIONAL(BUILD_LIBTORRUNNER, test "x$bwin32" != "xtrue")
@@ -582,55 +570,59 @@ AM_CONDITIONAL(THREADS_WIN32, test "$bwin32" = "true")
AM_CONDITIONAL(THREADS_PTHREADS, test "$bwin32" = "false")
AC_CHECK_FUNCS(
- _NSGetEnviron \
+ _NSGetEnviron \
RtlSecureZeroMemory \
SecureZeroMemory \
- accept4 \
- backtrace \
- backtrace_symbols_fd \
+ accept4 \
+ backtrace \
+ backtrace_symbols_fd \
eventfd \
explicit_bzero \
timingsafe_memcmp \
- flock \
- ftime \
- get_current_dir_name \
- getaddrinfo \
- getifaddrs \
- getpass \
- getrlimit \
- gettimeofday \
- gmtime_r \
+ flock \
+ ftime \
+ get_current_dir_name \
+ getaddrinfo \
+ getdelim \
+ getifaddrs \
+ getline \
+ getpass \
+ getrlimit \
+ gettimeofday \
+ gmtime_r \
gnu_get_libc_version \
htonll \
- inet_aton \
- ioctl \
- issetugid \
- llround \
- localtime_r \
- lround \
- memmem \
- memset_s \
- mmap \
+ inet_aton \
+ ioctl \
+ issetugid \
+ llround \
+ localtime_r \
+ lround \
+ memmem \
+ memset_s \
+ mmap \
pipe \
pipe2 \
- prctl \
+ prctl \
readpassphrase \
- rint \
- sigaction \
- socketpair \
+ rint \
+ sigaction \
+ socketpair \
statvfs \
- strlcat \
- strlcpy \
+ strncasecmp \
+ strcasecmp \
+ strlcat \
+ strlcpy \
strnlen \
- strptime \
- strtok_r \
- strtoull \
- sysconf \
+ strptime \
+ strtok_r \
+ strtoull \
+ sysconf \
sysctl \
truncate \
- uname \
+ uname \
usleep \
- vasprintf \
+ vasprintf \
_vscprintf
)
@@ -934,6 +926,7 @@ AC_CHECK_MEMBERS([struct ssl_method_st.get_cipher_by_char], , ,
])
AC_CHECK_FUNCS([ \
+ ERR_load_KDF_strings \
SSL_SESSION_get_master_key \
SSL_get_server_random \
SSL_get_client_ciphers \
@@ -1398,60 +1391,58 @@ AC_SUBST(CURVE25519_LIBS)
dnl Make sure to enable support for large off_t if available.
AC_SYS_LARGEFILE
-AC_CHECK_HEADERS([assert.h \
- errno.h \
- fcntl.h \
- signal.h \
- string.h \
- sys/capability.h \
- sys/fcntl.h \
- sys/stat.h \
- sys/time.h \
- sys/types.h \
- time.h \
- unistd.h \
- arpa/inet.h \
- crt_externs.h \
- execinfo.h \
- gnu/libc-version.h \
- grp.h \
- ifaddrs.h \
- inttypes.h \
- limits.h \
- linux/types.h \
- machine/limits.h \
- malloc.h \
- malloc/malloc.h \
- malloc_np.h \
- netdb.h \
- netinet/in.h \
- netinet/in6.h \
- pwd.h \
- readpassphrase.h \
- stdint.h \
- stdatomic.h \
- sys/eventfd.h \
- sys/file.h \
- sys/ioctl.h \
- sys/limits.h \
- sys/mman.h \
- sys/param.h \
- sys/prctl.h \
+AC_CHECK_HEADERS([errno.h \
+ fcntl.h \
+ signal.h \
+ string.h \
+ sys/capability.h \
+ sys/fcntl.h \
+ sys/stat.h \
+ sys/time.h \
+ sys/types.h \
+ time.h \
+ unistd.h \
+ arpa/inet.h \
+ crt_externs.h \
+ execinfo.h \
+ gnu/libc-version.h \
+ grp.h \
+ ifaddrs.h \
+ inttypes.h \
+ limits.h \
+ linux/types.h \
+ machine/limits.h \
+ malloc.h \
+ malloc/malloc.h \
+ malloc_np.h \
+ netdb.h \
+ netinet/in.h \
+ netinet/in6.h \
+ pwd.h \
+ readpassphrase.h \
+ stdatomic.h \
+ sys/eventfd.h \
+ sys/file.h \
+ sys/ioctl.h \
+ sys/limits.h \
+ sys/mman.h \
+ sys/param.h \
+ sys/prctl.h \
sys/random.h \
- sys/resource.h \
- sys/select.h \
- sys/socket.h \
- sys/statvfs.h \
- sys/syscall.h \
- sys/sysctl.h \
- sys/syslimits.h \
- sys/time.h \
- sys/types.h \
- sys/un.h \
- sys/utime.h \
- sys/wait.h \
- syslog.h \
- utime.h])
+ sys/resource.h \
+ sys/select.h \
+ sys/socket.h \
+ sys/statvfs.h \
+ sys/syscall.h \
+ sys/sysctl.h \
+ sys/syslimits.h \
+ sys/time.h \
+ sys/types.h \
+ sys/un.h \
+ sys/utime.h \
+ sys/wait.h \
+ syslog.h \
+ utime.h])
AC_CHECK_HEADERS(sys/param.h)
@@ -1552,22 +1543,6 @@ AC_CHECK_MEMBERS([struct timeval.tv_sec], , ,
#include <sys/time.h>
#endif])
-dnl In case we aren't given a working stdint.h, we'll need to grow our own.
-dnl Watch out.
-
-AC_CHECK_SIZEOF(int8_t)
-AC_CHECK_SIZEOF(int16_t)
-AC_CHECK_SIZEOF(int32_t)
-AC_CHECK_SIZEOF(int64_t)
-AC_CHECK_SIZEOF(uint8_t)
-AC_CHECK_SIZEOF(uint16_t)
-AC_CHECK_SIZEOF(uint32_t)
-AC_CHECK_SIZEOF(uint64_t)
-AC_CHECK_SIZEOF(intptr_t)
-AC_CHECK_SIZEOF(uintptr_t)
-
-dnl AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, intptr_t, uintptr_t])
-
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
@@ -1832,43 +1807,75 @@ if test "$tor_cv_uint8_uchar" = "no"; then
AC_MSG_ERROR([We assume that uint8_t is the same type as unsigned char, but your compiler disagrees.])
fi
-# Whether we should use the dmalloc memory allocation debugging library.
-AC_MSG_CHECKING(whether to use dmalloc (debug memory allocation library))
-AC_ARG_WITH(dmalloc,
-AS_HELP_STRING(--with-dmalloc, [use debug memory allocation library]),
-[if [[ "$withval" = "yes" ]]; then
- dmalloc=1
- AC_MSG_RESULT(yes)
-else
- dmalloc=1
- AC_MSG_RESULT(no)
-fi], [ dmalloc=0; AC_MSG_RESULT(no) ]
-)
-
-if [[ $dmalloc -eq 1 ]]; then
- AC_CHECK_HEADERS(dmalloc.h, , AC_MSG_ERROR(dmalloc header file not found. Do you have the development files for dmalloc installed?))
- AC_SEARCH_LIBS(dmalloc_malloc, [dmallocth dmalloc], , AC_MSG_ERROR(Libdmalloc library not found. If you enable it you better have it installed.))
- AC_DEFINE(USE_DMALLOC, 1, [Debug memory allocation library])
- AC_CHECK_FUNCS(dmalloc_strdup dmalloc_strndup)
-fi
-
AC_ARG_WITH(tcmalloc,
-AS_HELP_STRING(--with-tcmalloc, [use tcmalloc memory allocation library]),
+AS_HELP_STRING(--with-tcmalloc, [use tcmalloc memory allocation library. Deprecated; see --with-malloc]),
[ tcmalloc=yes ], [ tcmalloc=no ])
-if test "x$tcmalloc" = "xyes"; then
- LDFLAGS="-ltcmalloc $LDFLAGS"
-fi
+default_malloc=system
-using_custom_malloc=no
-if test "x$enable_openbsd_malloc" = "xyes"; then
- using_custom_malloc=yes
+if test "x$enable_openbsd_malloc" = "xyes" ; then
+ AC_MSG_NOTICE([The --enable-openbsd-malloc argument is deprecated; use --with-malloc=openbsd instead.])
+ default_malloc=openbsd
fi
+
if test "x$tcmalloc" = "xyes"; then
- using_custom_malloc=yes
+ AC_MSG_NOTICE([The --with-tcmalloc argument is deprecated; use --with-malloc=tcmalloc instead.])
+ default_malloc=tcmalloc
fi
-if test "$using_custom_malloc" = "no"; then
- AC_CHECK_FUNCS(mallinfo)
+
+AC_ARG_WITH(malloc,
+ AS_HELP_STRING([--with-malloc=[system,jemalloc,tcmalloc,openbsd]],
+ [select special malloc implementation [system]]),
+ [ malloc="$with_malloc" ], [ malloc="$default_malloc" ])
+
+AS_CASE([$malloc],
+ [tcmalloc], [
+ PKG_CHECK_MODULES([TCMALLOC],
+ [libtcmalloc],
+ have_tcmalloc=yes,
+ have_tcmalloc=no)
+
+ if test "x$have_tcmalloc" = "xno" ; then
+ AC_MSG_ERROR([Unable to find tcmalloc requested by --with-malloc.])
+ fi
+
+ CFLAGS="$CFLAGS $TCMALLOC_CFLAGS"
+ LIBS="$TCMALLOC_LIBS $LIBS"
+ ],
+
+ [jemalloc], [
+ PKG_CHECK_MODULES([JEMALLOC],
+ [jemalloc],
+ have_jemalloc=yes,
+ have_jemalloc=no)
+
+ if test "x$have_tcmalloc" = "xno" ; then
+ AC_MSG_ERROR([Unable to find jemalloc requested by --with-malloc.])
+ fi
+
+ CFLAGS="$CFLAGS $JEMALLOC_CFLAGS"
+ LIBS="$JEMALLOC_LIBS $LIBS"
+ using_custom_malloc=yes
+ ],
+
+ [openbsd], [
+ AC_MSG_WARN([The openbsd malloc port is deprecated in Tor 0.3.5 and will be removed in a future version.])
+ enable_openbsd_malloc=yes
+ ],
+
+ [system], [
+ # handle this later, including the jemalloc fallback
+ AC_CHECK_FUNCS(mallinfo)
+ ],
+
+ [AC_MSG_ERROR([--with-malloc=`$with_malloc' not supported, see --help])
+])
+
+AM_CONDITIONAL(USE_OPENBSD_MALLOC, test "x$enable_openbsd_malloc" = "xyes")
+
+if test "$malloc" != "system"; then
+ # Tell the C compiler not to use the system allocator functions.
+ TOR_CHECK_CFLAGS([-fno-builtin-malloc -fno-builtin-realloc -fno-builtin-calloc -fno-builtin-free])
fi
if test "$using_custom_malloc" = "yes"; then
# Tell the C compiler not to use the system allocator functions.
@@ -2368,20 +2375,20 @@ fi
CPPFLAGS="$CPPFLAGS $TOR_CPPFLAGS_libevent $TOR_CPPFLAGS_openssl $TOR_CPPFLAGS_zlib"
AC_CONFIG_FILES([
- Doxyfile
- Makefile
- config.rust
- link_rust.sh
- 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
+ Doxyfile
+ Makefile
+ config.rust
+ link_rust.sh
+ 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
])
if test "x$asciidoc" = "xtrue" && test "$ASCIIDOC" = "none"; then