diff mbox series

[2/2] libstb/(create|print)-container: Enable custom ssl dir

Message ID 20250509175311.148294-2-arbab@linux.ibm.com
State Accepted
Headers show
Series [1/2] libstb: Add print-container to `make clean` | expand

Commit Message

Reza Arbab May 9, 2025, 5:53 p.m. UTC
Respect SSL_DIR if it is set, to use ssl headers and libs that are in a
nonstandard location.

When skiboot is built by op-build, the system ssl installation is being
used instead of the buildroot one. This change will let us fix that.

Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
---
 libstb/Makefile.inc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Reza Arbab May 27, 2025, 2:13 p.m. UTC | #1
On Fri, May 09, 2025 at 12:53:11PM -0500, Reza Arbab wrote:
>Respect SSL_DIR if it is set, to use ssl headers and libs that are in a
>nonstandard location.

Series applied to master.
diff mbox series

Patch

diff --git a/libstb/Makefile.inc b/libstb/Makefile.inc
index d3a9ee2cdf84..8c4536f81400 100644
--- a/libstb/Makefile.inc
+++ b/libstb/Makefile.inc
@@ -19,15 +19,20 @@  CPPFLAGS += -I$(SRC)/$(LIBSTB_DIR)/crypto/mbedtls/include
 CPPFLAGS += -I$(SRC)/$(LIBSTB_DIR)/ibmtpm20tss/utils
 CFLAGS += -DTPM_SKIBOOT
 
+ifneq ($(SSL_DIR),)
+HOSTCFLAGS += -I$(SSL_DIR)/include
+HOSTLDFLAGS += -L$(SSL_DIR)/lib -Wl,-rpath,$(SSL_DIR)/lib
+endif
+
 $(LIBSTB): $(LIBSTB_OBJS:%=$(LIBSTB_DIR)/%) $(DRIVERS) $(SECVAR) $(CRYPTO) $(TSS2)
 
 libstb/create-container: libstb/create-container.c libstb/container-utils.c
-	$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) \
+	$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) \
 	-Wpadded -O0 -g -I$(SRC) -I$(SRC)/include -o $@ $^ -lssl -lcrypto,$<)
 
 libstb/print-container: HOSTCFLAGS += -Wno-error=deprecated-declarations
 libstb/print-container: libstb/print-container.c libstb/container-utils.c
-	$(call Q, HOSTCC , $(HOSTCC) $(HOSTCFLAGS) \
+	$(call Q, HOSTCC , $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) \
 	-O0 -g -I$(SRC) -I$(SRC)/include -o $@ $^ -lssl -lcrypto, $<)
 
 clean: container-utils-clean