ldns icon indicating copy to clipboard operation
ldns copied to clipboard

Use pkg-config for SSL detection

Open kallisti5 opened this issue 2 years ago • 2 comments

There's a long complex set of build system code to detect OpenSSL on systems. It's failing under Haiku as nothing is within includes.

checking for SSL... configure: error: Cannot find the SSL libraries in /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/local/opt/openssl /usr/sfw /usr
./configure --with-ssl=/packages/openssl-1.1.1k-1/.self/develop/lib/
checking for SSL... configure: error: Cannot find the SSL libraries in /packages/openssl-1.1.1k-1/.self/develop/lib/

ls -la /packages/openssl-1.1.1k-1/.self/develop/lib/*ssl*
lr-xr-xr-x 1 user root      27 Jun  7 10:46 /packages/openssl-1.1.1k-1/.self/develop/lib/libgnutls-openssl.so -> libgnutls-openssl.so.27.0.2
lr-xr-xr-x 1 user root      27 Jun  7 10:46 /packages/openssl-1.1.1k-1/.self/develop/lib/libgnutls-openssl.so.27 -> libgnutls-openssl.so.27.0.2
lr-xr-xr-x 1 user root      37 Jun  7 10:46 /packages/openssl-1.1.1k-1/.self/develop/lib/libgnutls-openssl.so.27.0.2 -> ../../lib/libgnutls-openssl.so.27.0.2
-r--r--r-- 1 user root 6141304 Apr  1 05:19 /packages/openssl-1.1.1k-1/.self/develop/lib/libssl.a
lr-xr-xr-x 1 user root      13 Apr  1 05:19 /packages/openssl-1.1.1k-1/.self/develop/lib/libssl.so -> libssl.so.1.1
lr-xr-xr-x 1 user root      23 Apr  1 05:21 /packages/openssl-1.1.1k-1/.self/develop/lib/libssl.so.1.1 -> ../../lib/libssl.so.1.1

Why isn't ldns just using pkg-config? That's what it is for.

kallisti5 avatar Aug 03 '21 17:08 kallisti5

$ pkg-config --cflags openssl
-I/packages/openssl-1.1.1k-1/.self/develop/headers
$ pkg-config --libs openssl
-L/packages/openssl-1.1.1k-1/.self/develop/lib -lssl -lcrypto

kallisti5 avatar Aug 03 '21 17:08 kallisti5

You need to pass the configure option ./configure --with-ssl=/packages/openssl-1.1.1k-1/.self/develop

This is because the configure script then appends include and lib for those parts it needs.

pkg-config is not something that we need as a build dependency. Because then it is harder to build the software. But I see from pkg-config output that you pasted that the headers are in headers and not in the include directory. That is going to be hard to configure. Maybe edit the Makefile after running configure, or pass CFLAGS and LDFLAGS and LIBS on the commandline to configure with the settings that you want.

wcawijngaards avatar Aug 04 '21 07:08 wcawijngaards