Re: [PATCH v2 3/4] tools/{c,o}xenstored: Don't link against libsystemd

2024-05-23 Thread Jürgen Groß

On 16.05.24 20:58, Andrew Cooper wrote:

Use the local freestanding wrapper instead.

Signed-off-by: Andrew Cooper 


Reviewed-by: Juergen Gross  # tools/xenstored


Juergen


---
CC: Anthony PERARD 
CC: Juergen Gross 
CC: George Dunlap 
CC: Jan Beulich 
CC: Stefano Stabellini 
CC: Julien Grall 
CC: Christian Lindig 
CC: Edwin Török 

v2:
  * Redo almost from scratch, using the freestanding wrapper instead.
---
  tools/ocaml/xenstored/Makefile| 2 --
  tools/ocaml/xenstored/systemd_stubs.c | 2 +-
  tools/xenstored/Makefile  | 5 -
  tools/xenstored/posix.c   | 4 ++--
  4 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index e8aaecf2e630..a8b8bb64698e 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -4,8 +4,6 @@ include $(OCAML_TOPLEVEL)/common.make
  
  # Include configure output (config.h)

  CFLAGS += -include $(XEN_ROOT)/tools/config.h
-CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
-LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
  
  CFLAGS  += $(CFLAGS-y)

  CFLAGS  += $(APPEND_CFLAGS)
diff --git a/tools/ocaml/xenstored/systemd_stubs.c 
b/tools/ocaml/xenstored/systemd_stubs.c
index f4c875075abe..7dbbdd35bf30 100644
--- a/tools/ocaml/xenstored/systemd_stubs.c
+++ b/tools/ocaml/xenstored/systemd_stubs.c
@@ -25,7 +25,7 @@
  
  #if defined(HAVE_SYSTEMD)
  
-#include 

+#include 
  
  CAMLprim value ocaml_sd_notify_ready(value ignore)

  {
diff --git a/tools/xenstored/Makefile b/tools/xenstored/Makefile
index e0897ed1ba30..09adfe1d5064 100644
--- a/tools/xenstored/Makefile
+++ b/tools/xenstored/Makefile
@@ -9,11 +9,6 @@ xenstored: LDLIBS += $(LDLIBS_libxenctrl)
  xenstored: LDLIBS += -lrt
  xenstored: LDLIBS += $(SOCKET_LIBS)
  
-ifeq ($(CONFIG_SYSTEMD),y)

-$(XENSTORED_OBJS-y): CFLAGS += $(SYSTEMD_CFLAGS)
-xenstored: LDLIBS += $(SYSTEMD_LIBS)
-endif
-
  TARGETS := xenstored
  
  .PHONY: all

diff --git a/tools/xenstored/posix.c b/tools/xenstored/posix.c
index d88c82d972d7..6037d739d013 100644
--- a/tools/xenstored/posix.c
+++ b/tools/xenstored/posix.c
@@ -27,7 +27,7 @@
  #include 
  #include 
  #if defined(HAVE_SYSTEMD)
-#include 
+#include 
  #endif
  #include 
  
@@ -393,7 +393,7 @@ void late_init(bool live_update)

  #if defined(HAVE_SYSTEMD)
if (!live_update) {
sd_notify(1, "READY=1");
-   fprintf(stderr, SD_NOTICE "xenstored is ready\n");
+   fprintf(stderr, "xenstored is ready\n");
}
  #endif
  }





[PATCH v2 3/4] tools/{c,o}xenstored: Don't link against libsystemd

2024-05-16 Thread Andrew Cooper
Use the local freestanding wrapper instead.

Signed-off-by: Andrew Cooper 
---
CC: Anthony PERARD 
CC: Juergen Gross 
CC: George Dunlap 
CC: Jan Beulich 
CC: Stefano Stabellini 
CC: Julien Grall 
CC: Christian Lindig 
CC: Edwin Török 

v2:
 * Redo almost from scratch, using the freestanding wrapper instead.
---
 tools/ocaml/xenstored/Makefile| 2 --
 tools/ocaml/xenstored/systemd_stubs.c | 2 +-
 tools/xenstored/Makefile  | 5 -
 tools/xenstored/posix.c   | 4 ++--
 4 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index e8aaecf2e630..a8b8bb64698e 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -4,8 +4,6 @@ include $(OCAML_TOPLEVEL)/common.make
 
 # Include configure output (config.h)
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
-CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
-LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
 
 CFLAGS  += $(CFLAGS-y)
 CFLAGS  += $(APPEND_CFLAGS)
diff --git a/tools/ocaml/xenstored/systemd_stubs.c 
b/tools/ocaml/xenstored/systemd_stubs.c
index f4c875075abe..7dbbdd35bf30 100644
--- a/tools/ocaml/xenstored/systemd_stubs.c
+++ b/tools/ocaml/xenstored/systemd_stubs.c
@@ -25,7 +25,7 @@
 
 #if defined(HAVE_SYSTEMD)
 
-#include 
+#include 
 
 CAMLprim value ocaml_sd_notify_ready(value ignore)
 {
diff --git a/tools/xenstored/Makefile b/tools/xenstored/Makefile
index e0897ed1ba30..09adfe1d5064 100644
--- a/tools/xenstored/Makefile
+++ b/tools/xenstored/Makefile
@@ -9,11 +9,6 @@ xenstored: LDLIBS += $(LDLIBS_libxenctrl)
 xenstored: LDLIBS += -lrt
 xenstored: LDLIBS += $(SOCKET_LIBS)
 
-ifeq ($(CONFIG_SYSTEMD),y)
-$(XENSTORED_OBJS-y): CFLAGS += $(SYSTEMD_CFLAGS)
-xenstored: LDLIBS += $(SYSTEMD_LIBS)
-endif
-
 TARGETS := xenstored
 
 .PHONY: all
diff --git a/tools/xenstored/posix.c b/tools/xenstored/posix.c
index d88c82d972d7..6037d739d013 100644
--- a/tools/xenstored/posix.c
+++ b/tools/xenstored/posix.c
@@ -27,7 +27,7 @@
 #include 
 #include 
 #if defined(HAVE_SYSTEMD)
-#include 
+#include 
 #endif
 #include 
 
@@ -393,7 +393,7 @@ void late_init(bool live_update)
 #if defined(HAVE_SYSTEMD)
if (!live_update) {
sd_notify(1, "READY=1");
-   fprintf(stderr, SD_NOTICE "xenstored is ready\n");
+   fprintf(stderr, "xenstored is ready\n");
}
 #endif
 }
-- 
2.30.2