Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libevent failed #118

Open
zshliao opened this issue Aug 11, 2014 · 9 comments
Open

libevent failed #118

zshliao opened this issue Aug 11, 2014 · 9 comments

Comments

@zshliao
Copy link

zshliao commented Aug 11, 2014

Hi I was following your instruction but it keeps failing when I tried to make install libevent (type.h was missing).. Is there any good instructions on how to install libevent? Also I'm wondering if you are willing to share the shrpx binary file?

@zshliao
Copy link
Author

zshliao commented Aug 13, 2014

when I ran ./android-make i got following errors:

/home/zisheng/toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: http-parser/http_parser.o: incompatible target
/home/zisheng/toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: spdycat.o: in function spdylay::update_html_parser(spdylay::SpdySession_, spdylay::Request_, unsigned char const_, unsigned int, int):spdycat.cc:407: error: undefined reference to 'http_parser_parse_url'
/home/zisheng/toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: spdycat.o: in function spdylay::run(char_*, int):spdycat.cc:883: error: undefined reference to 'http_parser_parse_url'

@tatsuhiro-t
Copy link
Owner

It looks like http_parser.o was compiled targeted for unexpected architecture.
Please first run make clean and re-run ./android-make again.

@zshliao
Copy link
Author

zshliao commented Aug 14, 2014

Thank you so much for the reply now the compilation works.. But I did not see the shrpx binary under src folder, did i miss something there?

@tatsuhiro-t
Copy link
Owner

Iibevent may not be detected by configure script (./android-config for NDK).
Configuring libevent is very similar to spdylay since libevent uses autotools too. I think following would work for libevent:

$ ./configure
    --disable-shared \
    --host=arm-linux-androideabi \
    --prefix=$ANDROID_HOME/usr/local
    CPPFLAGS="-I$ANDROID_HOME/usr/local/include" \
    LDFLAGS="-L$ANDROID_HOME/usr/local/lib"

And build libevent:

$ PATH=$ANDROID_HOME/toolchain/bin:$PATH make

@zshliao
Copy link
Author

zshliao commented Aug 14, 2014

Thanks for the reply..
I used your command to configure the build system for libevent however it does not recognize the siable-shared option
./libevent.sh: 4: ./libevent.sh: --disable-shared: not found
We are using the source from http://libevent.org/ libevent-2.0.21-stable
Any help on how to solve this issue would be greatly appreciated..
Thanks

@tatsuhiro-t
Copy link
Owner

Some formatting mistake in configure cmd line. It should be read as:

$ ./configure \
    --disable-shared \
    --host=arm-linux-androideabi \
    --prefix=$ANDROID_HOME/usr/local \
    CPPFLAGS="-I$ANDROID_HOME/usr/local/include" \
    LDFLAGS="-L$ANDROID_HOME/usr/local/lib"

@zshliao
Copy link
Author

zshliao commented Aug 14, 2014

Awesome! Thank you so much for that now libevent is built and detected by ./android-config

but running ./android-make still gives one erorr:

/home/zisheng/toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lrt
collect2: ld returned 1 exit status
make[2]: *** [spdycat] Error 1
make[2]: Leaving directory /home/zisheng/spdylay-1.2.5/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/zisheng/spdylay-1.2.5'
make: *** [all] Error 2

This is the summary of configuration:

configure: summary of build options:

Version:        1.2.5 shared 7:3:0
Host type:      arm-unknown-linux-androideabi
Install prefix: /usr/local
C compiler:     arm-linux-androideabi-gcc
CFLAGS:         -g -O2
LDFLAGS:        -L/home/zisheng//usr/local/lib
LIBS:           -lz 
CPPFLAGS:       -I/home/zisheng//usr/local/include
C preprocessor: arm-linux-androideabi-gcc -E
C++ compiler:   arm-linux-androideabi-g++
CXXFLAGS:       -g -O2
CXXCPP:         arm-linux-androideabi-g++ -E
Library types:  Shared=no, Static=yes
CUnit:          no
OpenSSL:        yes
Libxml2:        no
Libevent(SSL):  yes
Src:            yes
Examples:       yes

Not sure what I missed at this point.

Thank you very much in advance.

@tatsuhiro-t
Copy link
Owner

We use android NDK r9d gcc 4.8 and it compiles spdylay fine. No error related to -lrt.

@tatsuhiro-t
Copy link
Owner

Please check out this article if you haven't: http://tatsuhiro-t.github.io/spdylay/android-spdy-proxy.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants