Skip to content

Error building curl with openssl via pkgconfig #2848

@pszemus

Description

@pszemus

I did this

PKG_CONFIG_PATH=/opt/WP/common.libs/lib/pkgconfig ./configure --with-ssl

I expected the following

Curl will be configured to build with SSL support.
OpenSSL is installed in custom path.

what happened

configure script does not report SSL (HTTPS, FTPS, ...) support:

configure: Configured to build curl/libcurl:

  curl version:     7.61.0
  SSL support:      no
  Protocols:        DICT FILE FTP GOPHER HTTP IMAP POP3 RTSP SMTP TELNET TFTP

OpenSSL static libraries are installed in custom path via ./config --prefix=/opt/WP/common.libs --openssldir=/opt/WP/common.libs no-shared -fPIC
pkgconfig files are also installed in /opt/WP/common.libs/lib/pkgconfig/libssl.pc:

prefix=/opt/WP/common.libs
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: OpenSSL-libssl
Description: Secure Sockets Layer and cryptography libraries
Version: 1.1.0h
Requires.private: libcrypto
Libs: -L${libdir} -lssl
Cflags: -I${includedir}

curl's config.log shows missing 'pthread':

configure:22454: checking for openssl options with pkg-config
configure:22468: result: found
configure:22497: pkg-config: SSL_LIBS: "-lssl -lcrypto  "
configure:22499: pkg-config: SSL_LDFLAGS: "-L/opt/WP/common.libs/lib  "
configure:22501: pkg-config: SSL_CPPFLAGS: "-I/opt/WP/common.libs/include  "
configure:22513: checking for HMAC_Update in -lcrypto
configure:22535: gcc -o conftest -Werror-implicit-function-declaration -O2 -Wno-system-headers    -I/opt/WP/common.libs/include      -L/opt/WP/common.libs/lib   conftest.c -lcrypto  -lssl -lcrypto   -lz  >&5
/opt/WP/common.libs/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_lock_new':
threads_pthread.c:(.text+0x25): undefined reference to `pthread_rwlock_init'

curl/libcurl version

curl-7.61.0

operating system

openssl-1.1.0h
CentOS Linux release 7.5.1804 (Core)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions