2003-10-07 16:57:18 +00:00
2007-10-18 23:14:58 +00:00
Most users who realize that INSTALL files still exist should simply
follow the directions at
https://www.torproject.org/docs/tor-doc-unix
2003-10-07 16:57:18 +00:00
2010-12-22 00:54:29 -05:00
If you got the source from git, run "./autogen.sh", which will
2008-01-23 19:08:53 +00:00
run the various auto* programs. Then you can run ./configure, and
refer to the above instructions.
2003-10-07 16:57:18 +00:00
2006-03-28 07:28:52 +00:00
If it doesn't build for you:
2005-03-29 01:03:07 +00:00
2004-11-10 01:20:17 +00:00
If you have problems finding libraries, try
2003-10-07 21:27:33 +00:00
CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" \
./configure
2006-02-18 01:14:28 +00:00
or
./configure --with-libevent-dir=/usr/local
2003-10-07 21:27:33 +00:00
rather than simply ./configure.
2004-08-25 19:07:51 +00:00
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".
2006-03-28 07:28:52 +00:00
Lastly, check out
2010-12-22 00:54:29 -05:00
https://www.torproject.org/docs/faq#DoesntWork
2002-06-28 23:26:42 +00:00
2011-03-10 01:22:32 -08:00
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