tatsuhiro-t / spdylay

The experimental SPDY protocol version 2, 3 and 3.1 implementation in C
http://tatsuhiro-t.github.io/spdylay/
MIT License
603 stars 102 forks source link

CentOS 5/6 build instructions? #78

Closed PtDragon closed 10 years ago

PtDragon commented 11 years ago

I tried to build it on CentOS, but it still can't find OpenSSL & libevent-openssl. Can you please make instructions on how to build it on CentOS? Or maybe make static binaries?

PtDragon commented 11 years ago

P.S. --enable-shared=no does not build fully static binary. it still depends on openssl...

tatsuhiro-t commented 11 years ago

There are several variables to find dependent libraries. Run ./configure -h and you can see them. For openssl, and libevent-openssl, following variables are available:

OPENSSL_CFLAGS
          C compiler flags for OPENSSL, overriding pkg-config
OPENSSL_LIBS
          linker flags for OPENSSL, overriding pkg-config
LIBEVENT_OPENSSL_CFLAGS
          C compiler flags for LIBEVENT_OPENSSL, overriding pkg-config
LIBEVENT_OPENSSL_LIBS
          linker flags for LIBEVENT_OPENSSL, overriding pkg-config

Currently, static build is limited to the library itself and is not so greatly considered in programs in src. If you really want to build static binary, build dependent library in static only and compile spdylay again.

PtDragon commented 11 years ago

I tried that on Debian 7(recompiled as static(with static options found in ./configure --help for each library) these libraries: libevent-2.0.21-stable libxml2-2.9.1 openssl-1.0.1e zlib-1.2.8), but openssl is still linked as dynamic... root@debian:/build/spdylay-1.0.0/src# ldd shrpx linux-vdso.so.1 => (0x00007fffb9bc5000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff3a9bd3000) libssl.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007ff3a9974000) libcrypto.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007ff3a958f000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff3a9387000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff3a9080000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff3a8dfd000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff3a8be7000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff3a89cb000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff3a8640000) /lib64/ld-linux-x86-64.so.2 (0x00007ff3a9ddf000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff3a8429000) Can you help me to build fully static x86_64 binaries for /src (or build them and give me link to download)?

tatsuhiro-t commented 11 years ago

configure may not detect the static libraries you built. The configure script detects libraries using pkg-config. And the those .pc files should be in PKG_CONFIG_LIBDIR (or PKG_CONFIG_PATH) environment variable.

PtDragon commented 11 years ago

Can you tell me what exactly should I do(including what to type in command line) to build static binary?

PtDragon commented 11 years ago

Tried again to build static binary. Clean system,Debian 7. All libraries were built from source(not installed from packages) with static and without dynamic options. openssl is still linked dynamically what am I doing wrong? command line to configure: ./configure --enable-src --enable-examples --enable-shared=no --enable-static=yes

root@proxy:/build/spdylay-1.0.0/src# ldd shrpx linux-vdso.so.1 => (0x00007fff8839b000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fac9f157000) libssl.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fac9eef8000) libcrypto.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fac9eb13000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fac9e90b000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fac9e604000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fac9e381000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fac9e16b000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fac9df4f000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fac9dbc4000) /lib64/ld-linux-x86-64.so.2 (0x00007fac9f361000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fac9d9ad000)

tatsuhiro-t commented 11 years ago

Where did you install openssl static library?

PtDragon commented 11 years ago

2013/8/18 Tatsuhiro Tsujikawa notifications@github.com

Where did you install openssl static library?

Default path(there was no other version, package from repository was not installed at all).

tatsuhiro-t commented 11 years ago

You mean the default path is under /usr/lib/x86_64-linux-gnu/ ?

From the ldd output libssl.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fac9eef8000) libcrypto.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fac9eb13000)

It seems to me that library is compiled as shared library. Try first uninstall openssl and compile it as static library only and install again.

tatsuhiro-t commented 10 years ago

Reopen if you still have problem