configure.ac: add proper check for libcurl + curl/curl.h

Both util/clixon_util_stream.c and lib/src/clixon_stream.c depend on
libcurl.  The latter has `#ifdef CLIXON_PUBLISH_STREAMS` but the former
does not.  So `make util` fails without `--enable-publish` if libcurl
is not installed.

To preserve the original behavior (libcurl is an implicit dependency),
this patch adds a `--without-libcurl` option to indicate this default.
The check for libcurl and curl/curl.h is factored out as a separate
check before checking for `--enable-publish`.  If the two build options
are in conflict we exit with a clear error code.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg 2023-02-07 18:30:33 +01:00
parent a7693c8856
commit e84d43c8e3
4 changed files with 60 additions and 29 deletions

View file

@ -46,6 +46,7 @@ localstatedir = @localstatedir@
sysconfdir = @sysconfdir@
HOST_VENDOR = @host_vendor@
with_restconf = @with_restconf@
with_libcurl = @with_libcurl@
LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
SH_SUFFIX = @SH_SUFFIX@
@ -102,7 +103,9 @@ APPSRC += clixon_util_dispatcher.c
APPSRC += clixon_netconf_ssh_callhome.c
APPSRC += clixon_netconf_ssh_callhome_client.c
ifdef with_restconf
APPSRC += clixon_util_stream.c # Needs curl
ifdef with_libcurl
APPSRC += clixon_util_stream.c
endif
ifeq ($(with_restconf), native)
APPSRC += clixon_restconf_callhome_client.c
endif