ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
62 stars 58 forks source link

Makefile: add {CURL,XML2}_CONFIG #121

Closed ffontaine closed 2 years ago

ffontaine commented 2 years ago

Add CURL_CONFIG and XML2_CONFIG to allow the user to configure the binaries used in check-dep-libkmipclient

This will allow the user to avoid the following build failures raised since version 2.17.0 and https://github.com/ibm-s390-linux/s390-tools/commit/56fecf1832c3ebc4626ddf5c598762833c362d5e:

/bin/sh: 1: curl-config: not found
Error: libcurl is not built with the OpenSSL backend
make[2]: *** [Makefile:54: check-dep-libekmfweb] Error 1

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com

yann-morin-1998 commented 2 years ago

For consistency, shouldn't we also use CURL_CONFIG in libekmfweb/Makefile too?

ffontaine commented 2 years ago

Thanks @yann-morin-1998, I updated the PR.

ifranzki commented 2 years ago

Looks good to me.

sharkcz commented 2 years ago

There are other tools requiring eg. curl, so it would be good to have a consistency among them. dasdview, genprotimg and zdsfs all use pkg-config for retrieving the compiler and linker flags for the curl library.

ffontaine commented 2 years ago

So what is your suggestion? Replace curl-config and xml2-config calls by pkg-config?

sharkcz commented 2 years ago

So what is your suggestion? Replace curl-config and xml2-config calls by pkg-config?

yes, I would standardize around pkg-config

ifranzki commented 2 years ago

pkg-config is not always available, that's why these other tools have logic to check if pkg-config is available or not. Example from dasdview:

ifneq ($(shell sh -c 'command -v pkg-config'),)
CURL_CFLAGS = $(shell pkg-config --silence-errors --cflags libcurl)
CURL_LDLIBS = $(shell pkg-config --silence-errors --libs libcurl)
else
CURL_CFLAGS = -I/usr/include/s390x-linux-gnu/curl
CURL_LDLIBS = -lcurl
endif # shell

Not sure If I really like this..... Makes things more complicated actually....

ffontaine commented 2 years ago

Indeed, and there is an other issue, there is no direct equivalent to curl-config --ssl-backends through pkg-config. We could check if -lssl is in Libs but it's a bit ugly.

sharkcz commented 2 years ago

When isn't pkg-config available? I would consider is a distro packaging bug ... I think pkg-config exists to replace random *-config scripts.

sharkcz commented 2 years ago

Indeed, and there is an other issue, there is no direct equivalent to curl-config --ssl-backends through pkg-config. We could check if -lssl is in Libs but it's a bit ugly.

Then the pkgconfig file for curl should be fixed IMO.