Closed PtDragon closed 11 years ago
P.S. --enable-shared=no does not build fully static binary. it still depends on openssl...
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.
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)?
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.
Can you tell me what exactly should I do(including what to type in command line) to build static binary?
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)
Where did you install openssl static library?
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).
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.
Reopen if you still have problem
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?