aboutsummaryrefslogtreecommitdiff
path: root/INSTALL
blob: 1007b431fee744dd013f122f9b1f6e8bdbf9e7e2 (plain)
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
Most users who realize that INSTALL files still exist should simply
follow the directions at
https://www.torproject.org/docs/tor-doc-unix

If you got the source from git, run "./autogen.sh", which will
run the various auto* programs. Then you can run ./configure, and
refer to the above instructions.

If it doesn't build for you:

  If you have problems finding libraries, try
    CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" \
    ./configure
  or
    ./configure --with-libevent-dir=/usr/local
  rather than simply ./configure.

  If you have mysterious autoconf failures while linking openssl,
  consider setting your LD_LIBRARY_PATH to the openssl lib directory.
  For example, "setenv LD_LIBRARY_PATH /usr/athena/lib".

  Lastly, check out
  https://www.torproject.org/docs/faq#DoesntWork

An example of how to build a mostly static Tor:

Libevent should be built with:
% ./configure --disable-shared --enable-static --with-pic

An example of how to build a mostly static Tor:
./configure --enable-static-libevent \
            --enable-static-openssl  \
            --enable-static-zlib     \
            --with-libevent-dir=/tmp/static-tor/libevent-1.4.14b-stable \
            --with-openssl-dir=/tmp/static-tor/openssl-0.9.8r/ \
            --with-zlib-dir=/tmp/static-tor/zlib-1.2.5

An example of how to build an entirely static Tor (no Mac OS X support, sorry):
./configure --enable-static-tor \
            --enable-static-libevent \
            --enable-static-openssl  \
            --enable-static-zlib     \
            --with-libevent-dir=/tmp/static-tor/libevent-1.4.14b-stable \
            --with-openssl-dir=/tmp/static-tor/openssl-0.9.8r/ \
            --with-zlib-dir=/tmp/static-tor/zlib-1.2.5

This currently does not work with --enable-gcc-hardening because of libevent issues:

configure:6176: gcc -o conftest  -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIE -Wstack-protector
--param ssp-buffer-size=1 -I/tmp/static-tor/libevent-1.4.14b-stable  -I${top_srcdir}/src/common -
L/tmp/static-tor/libevent-1.4.14b-stable  -pie conftest.c -lpthread -ldl  -levent -lrt  >&5
/usr/bin/ld: /tmp/static-tor/libevent-1.4.14b-stable/libevent.a(event.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/tmp/static-tor/libevent-1.4.14b-stable/libevent.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    configure:6176: $? = 1

This produces the following Tor binaries on Gnu/Linux x86-64:

% file src/or/tor
src/or/tor: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.15, not stripped

% ldd src/or/tor
    not a dynamic executable