summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2021-06-01 13:22:36 +0300
committerGitHub <noreply@github.com>2021-06-01 13:22:36 +0300
commit0d96e0a187ee3419a9939b56970248356d05c1e7 (patch)
treebb9dcde5a16684d2ca2888dba09efc87266605ff
parentbaa53991266b786127aa103add685d2ad23e4271 (diff)
Compile/Link with absolute paths for bundled/vendored deps. (#11129)
* Do not accept a path when using --with-bundled-lws. The bundled library is always placed under externaldeps/libwebsockets, when using the netdata-installer.sh script. When this option is missing, we look for the system-wide installed version. * Do not accept a path when using --with-bundled-libJudy. The bundled library is always placed under externaldeps/libJudy. When the option is not given, we look for the system-wide installed version. * Use absolute header paths for repo-internal deps. * Use absolute library paths for repo-internal deps.
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac39
-rwxr-xr-xcontrib/debian/rules2
-rwxr-xr-xnetdata-installer.sh4
-rw-r--r--netdata.spec.in4
5 files changed, 24 insertions, 29 deletions
diff --git a/Makefile.am b/Makefile.am
index be35215c8f..7b5fcc5c9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -750,7 +750,7 @@ NETDATA_COMMON_LIBS = \
$(NULL)
if LINK_STATIC_JSONC
- NETDATA_COMMON_LIBS += externaldeps/jsonc/libjson-c.a
+ NETDATA_COMMON_LIBS += $(abs_top_srcdir)/externaldeps/jsonc/libjson-c.a
endif
NETDATACLI_FILES = \
@@ -771,7 +771,7 @@ netdata_LDADD = \
if !ACLK_NG
if ENABLE_ACLK
netdata_LDADD += \
- externaldeps/mosquitto/libmosquitto.a \
+ $(abs_top_srcdir)/externaldeps/mosquitto/libmosquitto.a \
$(OPTIONAL_LIBCAP_LIBS) \
$(OPTIONAL_LWS_LIBS) \
$(NETDATA_COMMON_LIBS) \
diff --git a/configure.ac b/configure.ac
index 2f3cac5d48..108056d959 100644
--- a/configure.ac
+++ b/configure.ac
@@ -174,12 +174,8 @@ AC_ARG_ENABLE(
)
AC_ARG_WITH(
[bundled-lws],
- [AS_HELP_STRING([--with-bundled-lws=DIR], [Use a specific Libwebsockets static library @<:@default use system library@:>@])],
- [
- with_bundled_lws="yes"
- bundled_lws_dir="${withval}"
- ],
- [with_bundled_lws="no"]
+ [AS_HELP_STRING([--with-bundled-lws], [Use the bundled version of libwebsockets library @<:@default use system library@:>@])],
+ [with_bundled_lws="yes"], [with_bundled_lws="no"]
)
# -----------------------------------------------------------------------------
@@ -432,15 +428,14 @@ test "${enable_dbengine}" = "yes" -a -z "${LZ4_LIBS}" && \
AC_MSG_ERROR([liblz4 required but not found. Try installing 'liblz4-dev' or 'lz4-devel'.])
-AC_ARG_WITH([libJudy],
- [AS_HELP_STRING([--with-libJudy=PREFIX],[Use a specific Judy library (default is system-library)])],
+AC_ARG_WITH([bundled-libJudy],
+ [AS_HELP_STRING([--with-bundled-libJudy],[Use the bundled version of Judy library (default is system-library)])],
[
- libJudy_dir="$withval"
AC_MSG_CHECKING(for libJudy in $withval)
- if test -f "${libJudy_dir}/libJudy.a" -a -f "${libJudy_dir}/Judy.h"; then
+ if test -f "externaldeps/libJudy/libJudy.a" -a -f "externaldeps/libJudy/Judy.h"; then
LIBS_BACKUP="${LIBS}"
- LIBS="${libJudy_dir}/libJudy.a"
- AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "${libJudy_dir}/Judy.h"
+ LIBS="externaldeps/libJudy/libJudy.a"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/libJudy/Judy.h"
int main (int argc, char **argv) {
Pvoid_t PJLArray = (Pvoid_t) NULL;
Word_t * PValue;
@@ -450,8 +445,8 @@ AC_ARG_WITH([libJudy],
[HAVE_libJudy_a="yes"],
[HAVE_libJudy_a="no"])
LIBS="${LIBS_BACKUP}"
- JUDY_LIBS="${libJudy_dir}/libJudy.a"
- JUDY_CFLAGS="-I${libJudy_dir}"
+ JUDY_LIBS="\$(abs_top_srcdir)/externaldeps/libJudy/libJudy.a"
+ JUDY_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/libJudy"
AC_MSG_RESULT([$HAVE_libJudy_a])
else
libjudy_dir=""
@@ -531,7 +526,7 @@ if test "${enable_jsonc}" != "no" -a -z "${JSONC_LIBS}"; then
if test "${HAVE_libjson_c_a}" = "yes"; then
AC_DEFINE([LINK_STATIC_JSONC], [1], [static json-c should be used])
JSONC_LIBS="static"
- OPTIONAL_JSONC_STATIC_CFLAGS="-I externaldeps/jsonc"
+ OPTIONAL_JSONC_STATIC_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/jsonc"
fi
AC_MSG_RESULT([${HAVE_libjson_c_a}])
fi
@@ -671,9 +666,9 @@ if test "$enable_cloud" != "no" -a "$aclk_ng" != "yes"; then
if test "${with_bundled_lws}" = "yes"; then
AC_MSG_CHECKING([if libwebsockets static lib is present])
- if test -f "${bundled_lws_dir}/libwebsockets.a"; then
- LWS_CFLAGS="-I ${bundled_lws_dir}/include"
- OPTIONAL_LWS_LIBS="${bundled_lws_dir}/libwebsockets.a"
+ if test -f "externaldeps/libwebsockets/libwebsockets.a"; then
+ LWS_CFLAGS="-I \$(abs_top_srcdir)/externaldeps/libwebsockets/include"
+ OPTIONAL_LWS_LIBS="\$(abs_top_srcdir)/externaldeps/libwebsockets/libwebsockets.a"
AC_MSG_RESULT([yes])
AC_DEFINE([BUNDLED_LWS], [1], [using statically linked libwebsockets])
else
@@ -774,7 +769,7 @@ if test "$enable_cloud" != "no" -a "$aclk_ng" != "no"; then
AC_DEFINE([ACLK_NG], [1], [ACLK Next Generation Should be used])
AC_DEFINE([ENABLE_ACLK], [1], [netdata ACLK])
enable_aclk="yes"
- OPTIONAL_ACLK_NG_CFLAGS="-Imqtt_websockets/src/include -Imqtt_websockets/c-rbuf/include -Imqtt_websockets/MQTT-C/include"
+ OPTIONAL_ACLK_NG_CFLAGS="-I \$(abs_top_srcdir)/mqtt_websockets/src/include -I \$(abs_top_srcdir)/mqtt_websockets/c-rbuf/include -I \$(abs_top_srcdir)/mqtt_websockets/MQTT-C/include"
fi
fi
AC_SUBST([enable_cloud])
@@ -1087,8 +1082,8 @@ if test "${build_target}" = "linux" -a "${enable_ebpf}" != "no"; then
if test "${have_libelf}" = "yes" -a \
"${have_bpf}" = "yes" -a \
"${have_libbpf}" = "yes"; then
- OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I externaldeps/libbpf/include"
- OPTIONAL_BPF_LIBS="externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
+ OPTIONAL_BPF_CFLAGS="${LIBELF_CFLAGS} -I \$(abs_top_srcdir)/externaldeps/libbpf/include"
+ OPTIONAL_BPF_LIBS="\$(abs_top_srcdir)/externaldeps/libbpf/libbpf.a ${LIBELF_LIBS}"
AC_DEFINE([HAVE_LIBBPF], [1], [libbpf usability])
enable_ebpf="yes"
else
@@ -1360,7 +1355,7 @@ if test "${enable_backend_prometheus_remote_write}" != "no" -a "${have_libprotob
-a "${have_protoc}" = "yes" -a "${have_CXX_compiler}" = "yes"; then
enable_backend_prometheus_remote_write="yes"
AC_DEFINE([ENABLE_PROMETHEUS_REMOTE_WRITE], [1], [Prometheus remote write API usability])
- OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${PROTOBUF_CFLAGS} ${SNAPPY_CFLAGS} -Iexporting/prometheus/remote_write"
+ OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${PROTOBUF_CFLAGS} ${SNAPPY_CFLAGS} -I \$(abs_top_srcdir)/exporting/prometheus/remote_write"
CXX11FLAG="-std=c++11"
OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${PROTOBUF_LIBS} ${SNAPPY_LIBS}"
else
diff --git a/contrib/debian/rules b/contrib/debian/rules
index eb50fffb47..fd457a2b64 100755
--- a/contrib/debian/rules
+++ b/contrib/debian/rules
@@ -40,7 +40,7 @@ override_dh_auto_configure:
autoreconf -ivf
dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib \
--libexecdir=/usr/libexec --with-user=netdata --with-math --with-zlib --with-webdir=/var/lib/netdata/www \
- --with-bundled-lws=externaldeps/libwebsockets
+ --with-bundled-lws
override_dh_install:
cp -v $(BASE_CONFIG) debian/netdata.conf
diff --git a/netdata-installer.sh b/netdata-installer.sh
index c02be5203c..34278bf3f7 100755
--- a/netdata-installer.sh
+++ b/netdata-installer.sh
@@ -701,7 +701,7 @@ bundle_libwebsockets() {
copy_libwebsockets "${tmp}/libwebsockets-${LIBWEBSOCKETS_PACKAGE_VERSION}" &&
rm -rf "${tmp}"; then
run_ok "libwebsockets built and prepared."
- NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --with-bundled-lws=externaldeps/libwebsockets"
+ NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --with-bundled-lws"
else
run_failed "Failed to build libwebsockets."
if [ -n "${NETDATA_REQUIRE_CLOUD}" ]; then
@@ -789,7 +789,7 @@ bundle_judy() {
copy_judy "${tmp}/libjudy-${JUDY_PACKAGE_VERSION}" &&
rm -rf "${tmp}"; then
run_ok "libJudy built and prepared."
- NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --with-libJudy=externaldeps/libJudy"
+ NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --with-bundled-libJudy"
else
run_failed "Failed to build libJudy."
if [ -n "${NETDATA_BUILD_JUDY}" ]; then
diff --git a/netdata.spec.in b/netdata.spec.in
index 48e9289295..3b6bd21234 100644
--- a/netdata.spec.in
+++ b/netdata.spec.in
@@ -237,10 +237,10 @@ export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging
autoreconf -ivf
%configure \
%if 0%{!?fedora:1} && 0%{!?suse_version:1}
- --with-libJudy=externaldeps/libJudy \
+ --with-bundled-libJudy \
%endif
%if 0%{?centos_ver} < 8 || 0%{!?fedora:1}
- --with-bundled-lws=externaldeps/libwebsockets \
+ --with-bundled-lws \
%endif
--prefix="%{_prefix}" \
--sysconfdir="%{_sysconfdir}" \