diff mbox series

[v4,18/19] tools/config: add XEN_RUN_STORED to config.h

Message ID 20230814074707.27696-19-jgross@suse.com (mailing list archive)
State New, archived
Headers show
Series tools/xenstore: drop TDB | expand

Commit Message

Jürgen Groß Aug. 14, 2023, 7:47 a.m. UTC
Instead of adding the definition of XEN_RUN_STORED to CFLAGS in
multiple Makefiles, let configure add it to tools/config.h instead.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V4:
- new patch
---
 configure                      | 5 +++++
 m4/paths.m4                    | 1 +
 tools/config.h.in              | 3 +++
 tools/configure                | 5 +++++
 tools/libs/store/Makefile      | 1 -
 tools/xenstore/Makefile.common | 1 -
 6 files changed, 14 insertions(+), 2 deletions(-)

Comments

Anthony PERARD Aug. 14, 2023, 10:34 a.m. UTC | #1
On Mon, Aug 14, 2023 at 09:47:06AM +0200, Juergen Gross wrote:
> Instead of adding the definition of XEN_RUN_STORED to CFLAGS in
> multiple Makefiles, let configure add it to tools/config.h instead.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

I think with this change, you could probably remove XEN_RUN_STORED from
"config/Paths.mk.in".

In any case, patch looks fine:
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,
Jürgen Groß Aug. 14, 2023, 11:07 a.m. UTC | #2
On 14.08.23 12:34, Anthony PERARD wrote:
> On Mon, Aug 14, 2023 at 09:47:06AM +0200, Juergen Gross wrote:
>> Instead of adding the definition of XEN_RUN_STORED to CFLAGS in
>> multiple Makefiles, let configure add it to tools/config.h instead.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> I think with this change, you could probably remove XEN_RUN_STORED from
> "config/Paths.mk.in".

Ah, indeed. I'll send an updated patch (V4.1).

> 
> In any case, patch looks fine:
> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,


Juergen
diff mbox series

Patch

diff --git a/configure b/configure
index 99f8434cbf..dd05f314f6 100755
--- a/configure
+++ b/configure
@@ -2079,6 +2079,11 @@  _ACEOF
 XEN_RUN_STORED=$rundir_path/xenstored
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_RUN_STORED "$XEN_RUN_STORED"
+_ACEOF
+
+
 XEN_LIB_DIR=$localstatedir/lib/xen
 
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index e4104bcce0..3f94c62efb 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -138,6 +138,7 @@  AC_DEFINE_UNQUOTED([XEN_LOG_DIR], ["$XEN_LOG_DIR"], [Xen's log dir])
 
 XEN_RUN_STORED=$rundir_path/xenstored
 AC_SUBST(XEN_RUN_STORED)
+AC_DEFINE_UNQUOTED([XEN_RUN_STORED], ["$XEN_RUN_STORED"], [Xenstore's runstate path])
 
 XEN_LIB_DIR=$localstatedir/lib/xen
 AC_SUBST(XEN_LIB_DIR)
diff --git a/tools/config.h.in b/tools/config.h.in
index 3071cb3998..41014a65ed 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -153,6 +153,9 @@ 
 /* Xen's script dir */
 #undef XEN_SCRIPT_DIR
 
+/* Xenstore's runstate path */
+#undef XEN_RUN_STORED
+
 /* Enable large inode numbers on Mac OS X 10.5.  */
 #ifndef _DARWIN_USE_64_BIT_INODE
 # define _DARWIN_USE_64_BIT_INODE 1
diff --git a/tools/configure b/tools/configure
index 52b4717d01..5c05fa5ea1 100755
--- a/tools/configure
+++ b/tools/configure
@@ -4060,6 +4060,11 @@  _ACEOF
 XEN_RUN_STORED=$rundir_path/xenstored
 
 
+cat >>confdefs.h <<_ACEOF
+#define XEN_RUN_STORED "$XEN_RUN_STORED"
+_ACEOF
+
+
 XEN_LIB_DIR=$localstatedir/lib/xen
 
 
diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
index c1a1508713..0649cf8307 100644
--- a/tools/libs/store/Makefile
+++ b/tools/libs/store/Makefile
@@ -18,7 +18,6 @@  include ../libs.mk
 # Include configure output (config.h)
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
 CFLAGS += $(CFLAGS_libxentoolcore)
-CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
 
 xs.opic: CFLAGS += -DUSE_PTHREAD
 ifeq ($(CONFIG_Linux),y)
diff --git a/tools/xenstore/Makefile.common b/tools/xenstore/Makefile.common
index 3259ab51e6..41973a8a5e 100644
--- a/tools/xenstore/Makefile.common
+++ b/tools/xenstore/Makefile.common
@@ -16,7 +16,6 @@  CFLAGS += $(CFLAGS_libxenevtchn)
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_libxenguest)
 CFLAGS += $(CFLAGS_libxentoolcore)
-CFLAGS += -DXEN_RUN_STORED="\"$(XEN_RUN_STORED)\""
 
 ifdef CONFIG_STUBDOM
 CFLAGS += -DNO_SOCKETS=1