From cdbba6ac4bf40d64641b7afea2c79d39dee22ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 1 Jul 2020 09:58:25 +0200 Subject: [PATCH] agent: Make LIBC configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the default LIBC used to build the agent is "musl". However, "musl" is not preset in a big portion of the distros *and* "gnu" libc just works as expected. Knowing that, let's add the option to the one building the project to simply do `make LIBC=gnu` instead of expected the person to go through the Makefile and replace musl by gnu there. Fixes: #369 Signed-off-by: Fabiano FidĂȘncio --- src/agent/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/agent/Makefile b/src/agent/Makefile index 79fd92707b..7a43d77b51 100644 --- a/src/agent/Makefile +++ b/src/agent/Makefile @@ -31,7 +31,15 @@ ifdef proto endif ARCH = $(shell uname -m) -LIBC = musl +LIBC ?= musl +ifneq ($(LIBC),musl) + ifeq ($(LIBC),gnu) + override LIBC = gnu + else + $(error "ERROR: A non supported LIBC value was passed. Supported values are musl and gnu") + endif +endif + TRIPLE = $(ARCH)-unknown-linux-$(LIBC) TARGET_PATH = target/$(TRIPLE)/$(BUILD_TYPE)/$(TARGET)