From 3e701d6274924adaed568e22af2362aa5af1f055 Mon Sep 17 00:00:00 2001
From: Peter Seebach <peter.seebach@windriver.com>
Date: Sun, 8 Jan 2023 23:01:28 +0800
Subject: [PATCH] Fix quoting for BUILD_WITH

The escaped quotes are to make the -D values produce strings which
can be used to display these values. However, if the values are more
than one word, with spaces, they also need shell quoting to make them
into single words.

Upstream-Status: Pending

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 src/main/libfreeradius-server.mk    | 2 +-
 src/main/unittest.mk                | 2 +-
 src/modules/rlm_eap/radeapclient.mk | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/libfreeradius-server.mk b/src/main/libfreeradius-server.mk
index 4495f72481..07c28f1968 100644
--- a/src/main/libfreeradius-server.mk
+++ b/src/main/libfreeradius-server.mk
@@ -18,5 +18,5 @@ SOURCES	:=	conffile.c \
 TGT_LDLIBS      := $(OPENSSL_LIBS)
 
 ifneq ($(MAKECMDGOALS),scan)
-SRC_CFLAGS	+= -DBUILT_WITH_CPPFLAGS=\"$(CPPFLAGS)\" -DBUILT_WITH_CFLAGS=\"$(CFLAGS)\" -DBUILT_WITH_LDFLAGS=\"$(LDFLAGS)\" -DBUILT_WITH_LIBS=\"$(LIBS)\"
+SRC_CFLAGS	+= -DBUILT_WITH_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILT_WITH_CFLAGS="\"$(CFLAGS)\"" -DBUILT_WITH_LDFLAGS="\"$(LDFLAGS)\"" -DBUILT_WITH_LIBS="\"$(LIBS)\""
 endif
diff --git a/src/main/unittest.mk b/src/main/unittest.mk
index edd4f133a7..b5b44d5e11 100644
--- a/src/main/unittest.mk
+++ b/src/main/unittest.mk
@@ -21,5 +21,5 @@ TGT_PREREQS	+= libfreeradius-eap.a
 endif
 
 ifneq ($(MAKECMDGOALS),scan)
-SRC_CFLAGS	+= -DBUILT_WITH_CPPFLAGS=\"$(CPPFLAGS)\" -DBUILT_WITH_CFLAGS=\"$(CFLAGS)\" -DBUILT_WITH_LDFLAGS=\"$(LDFLAGS)\" -DBUILT_WITH_LIBS=\"$(LIBS)\"
+SRC_CFLAGS	+= -DBUILT_WITH_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILT_WITH_CFLAGS="\"$(CFLAGS)\"" -DBUILT_WITH_LDFLAGS="\"$(LDFLAGS)\"" -DBUILT_WITH_LIBS="\"$(LIBS)\""
 endif
diff --git a/src/modules/rlm_eap/radeapclient.mk b/src/modules/rlm_eap/radeapclient.mk
index 6068f54813..7d3c55625b 100644
--- a/src/modules/rlm_eap/radeapclient.mk
+++ b/src/modules/rlm_eap/radeapclient.mk
@@ -23,7 +23,7 @@ SRC_CFLAGS += -DWITH_EAPCLIENT
 SRC_INCDIRS  := ${top_srcdir}/src/modules/rlm_eap/libeap
 
 ifneq ($(MAKECMDGOALS),scan)
-SRC_CFLAGS	+= -DBUILT_WITH_CPPFLAGS=\"$(CPPFLAGS)\" -DBUILT_WITH_CFLAGS=\"$(CFLAGS)\" -DBUILT_WITH_LDFLAGS=\"$(LDFLAGS)\" -DBUILT_WITH_LIBS=\"$(LIBS)\"
+SRC_CFLAGS	+= -DBUILT_WITH_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILT_WITH_CFLAGS="\"$(CFLAGS)\"" -DBUILT_WITH_LDFLAGS="\"$(LDFLAGS)\"" -DBUILT_WITH_LIBS="\"$(LIBS)\""
 endif
 
 endif
-- 
2.25.1

