[tor-talk] Tor build failed - can't find libevent..

2012-04-04 Thread Airosoβicz fb .
Hello everyone,

I go by the name of Air0s  this is my first post to the list so pls bear
with me..
I've got a problem building Tor from source which has to do with libevent..

Check-out the response I got from Nick Mathewson..

 Also downloaded the 0.2.2.35  0.2.3.13-alpha sources but
  again 2 no avail.. It just doesn't want to build..

 It isn't building because it isn't finding the right libevent:

 ./libtor.a(main.o)(.text+
 0x9bf): In function `handle_signals':
 /tmp/tor/tor/src/or/main.c:2197: undefined reference to `event_new'

 You've got two libevents installed: a 1.4 one and a 2.0 one.  It's
 finding the 2.0 one from your headers, and deciding that it can use
 2.0 functionality.  But when it goes to link, it's only linking
 against the 1.4 one.

 Your best bet there might be to either look into the
 --with-libevent-dir option, or into setting your CFLAGS and LDFLAGS
 variables manually to specify the right includes and the right
 libraries.  Folks on tor-talk or on the #tor IRC channel should be
 able to walk you through that.

---

 peggy# pwd
 /tmp/tor/tor-0.2.3.13-alpha

 peggy# ./configure
 ...
 checking for libevent directory... configure: WARNING: Could not find a
 linkable libevent.  If you have it installed somewhere unusual, you can
 specify an explicit path using --with-libevent-dir
 configure: error: Missing libraries; unable to proceed.

---

 peggy# make
 make  all-recursive
 Making all in src
 Making all in common
 Making all in or
 gcc -DHAVE_CONFIG_H -I. -I../..  -DSHARE_DATADIR=\/usr/local/share\
 -DLOCALSTATEDIR=\/usr/local/var\  -DBINDIR=\/usr/local/bin\
 -I../../src/common -I/usr/local/include  -g -O2 -Wall -fno-strict-aliasing
 -MT tor_main.o -MD -MP -MF .deps/tor_main.Tpo -c -o tor_main.o tor_main.c
 mv -f .deps/tor_main.Tpo .deps/tor_main.Po
 gcc  -g -O2 -Wall -fno-strict-aliasing -L/usr/local/lib  -o  tor
 tor_main.o ./libtor.a ../common/libor.a ../common/libor-crypto.a
 ../common/libor-event.a  -lz -lm -levent -lssl -lcrypto -lpthread
 /usr/bin/ld: cannot find -levent
 *** Error code 1

---

So here I am.. I've removed the 1.4 version of libevent but now
I need to set the --with-libevent-dir option or change the CFLAGS/LDFLAGS..

# pkg_version -v | grep libevent
 libevent2-2.0.16

# locate libevent
 /usr/local/lib  = This is the location of the old 1.4
library
 /usr/local/lib/event2  = This is the new 2.0 library

Question is how  where do I set these flags..?

Much obliged for any feedback..

Regards,
E.
___
tor-talk mailing list
tor-talk@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk


Re: [tor-talk] Tor build failed - can't find libevent..

2012-04-04 Thread Robert Ransom
On 2012-04-04, Airosoβicz fb. airosov...@gmail.com wrote:
 Hello everyone,

 I go by the name of Air0s  this is my first post to the list so pls bear
 with me..
 I've got a problem building Tor from source which has to do with libevent..

 # pkg_version -v | grep libevent
 libevent2-2.0.16

Oh, you're using FreeBSD.  Their goofy libevent2 port screws
everything up.  Build Tor using the security/tor-devel port.


If you insist on not using the port, you need to run:

  export CFLAGS=-I/usr/local/include/event2
  export LDFLAGS=-L/usr/local/lib/event2

before compiling Tor.  But if you couldn't figure that out on your
own, you really *really* should be using the FreeBSD port for Tor.


Robert Ransom
___
tor-talk mailing list
tor-talk@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk