summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@avionic-design.de>2010-11-23 21:12:11 +0100
committerLennart Poettering <lennart@poettering.net>2010-11-23 22:38:55 +0100
commit9a60da2834074d970ca063c210fe9d2f05c70532 (patch)
treeb86ce16ec73449b2df9bdfcc8459e5bc1b54b80f /src
parent3686ced6d76d72a7364db4616c14a164f9c1f01e (diff)
build-sys: allow cross-compilation
When cross-compiling systemd, the introspection XML files fail to be generated because the systemd host binary is not executable. This patch works around this by putting the introspection XML data into separate ELF sections and extracting them from the binary when generating the XML files. The extracted XML data is passed through the strings utility in order to strip the trailing NUL character. A small AWK script is used to prepend the doctype and add the opening and closing node tags respectively. Finally, the C preprocessor is used to substitute the correct doctype information from the D-Bus header files.
Diffstat (limited to 'src')
-rw-r--r--src/dbus-automount.c2
-rw-r--r--src/dbus-device.c2
-rw-r--r--src/dbus-job.c2
-rw-r--r--src/dbus-manager.c2
-rw-r--r--src/dbus-mount.c2
-rw-r--r--src/dbus-path.c2
-rw-r--r--src/dbus-service.c2
-rw-r--r--src/dbus-snapshot.c2
-rw-r--r--src/dbus-socket.c2
-rw-r--r--src/dbus-swap.c2
-rw-r--r--src/dbus-target.c2
-rw-r--r--src/dbus-timer.c2
-rw-r--r--src/dbus-unit.c2
-rw-r--r--src/macro.h1
14 files changed, 14 insertions, 13 deletions
diff --git a/src/dbus-automount.c b/src/dbus-automount.c
index 3bccb4e5f7..af277af39c 100644
--- a/src/dbus-automount.c
+++ b/src/dbus-automount.c
@@ -38,7 +38,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_automount_interface[] = BUS_AUTOMOUNT_INTERFACE;
+const char bus_automount_interface[] _introspect_("Automount") = BUS_AUTOMOUNT_INTERFACE;
DBusHandlerResult bus_automount_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
const BusProperty properties[] = {
diff --git a/src/dbus-device.c b/src/dbus-device.c
index fcb05a441e..aafe5d61fa 100644
--- a/src/dbus-device.c
+++ b/src/dbus-device.c
@@ -37,7 +37,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_device_interface[] = BUS_DEVICE_INTERFACE;
+const char bus_device_interface[] _introspect_("Device") = BUS_DEVICE_INTERFACE;
const char bus_device_invalidating_properties[] =
"SysFSPath\0"
diff --git a/src/dbus-job.c b/src/dbus-job.c
index 667eb04a69..18da72d67a 100644
--- a/src/dbus-job.c
+++ b/src/dbus-job.c
@@ -43,7 +43,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_job_interface[] = BUS_JOB_INTERFACE;
+const char bus_job_interface[] _introspect_("Job") = BUS_JOB_INTERFACE;
#define INVALIDATING_PROPERTIES \
"State\0" \
diff --git a/src/dbus-manager.c b/src/dbus-manager.c
index 28986e5426..d160e7bba3 100644
--- a/src/dbus-manager.c
+++ b/src/dbus-manager.c
@@ -202,7 +202,7 @@
#define INTROSPECTION_END \
"</node>\n"
-const char bus_manager_interface[] = BUS_MANAGER_INTERFACE;
+const char bus_manager_interface[] _introspect_("Manager") = BUS_MANAGER_INTERFACE;
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_manager_append_running_as, manager_running_as, ManagerRunningAs);
diff --git a/src/dbus-mount.c b/src/dbus-mount.c
index 4de00f7fac..fa319febd5 100644
--- a/src/dbus-mount.c
+++ b/src/dbus-mount.c
@@ -50,7 +50,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_mount_interface[] = BUS_MOUNT_INTERFACE;
+const char bus_mount_interface[] _introspect_("Mount") = BUS_MOUNT_INTERFACE;
const char bus_mount_invalidating_properties[] =
"What\0"
diff --git a/src/dbus-path.c b/src/dbus-path.c
index c8c302ab37..9692d6a247 100644
--- a/src/dbus-path.c
+++ b/src/dbus-path.c
@@ -41,7 +41,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_path_interface[] = BUS_PATH_INTERFACE;
+const char bus_path_interface[] _introspect_("Path") = BUS_PATH_INTERFACE;
static int bus_path_append_paths(Manager *m, DBusMessageIter *i, const char *property, void *data) {
Path *p = data;
diff --git a/src/dbus-service.c b/src/dbus-service.c
index a79f769e94..f929627666 100644
--- a/src/dbus-service.c
+++ b/src/dbus-service.c
@@ -90,7 +90,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_service_interface[] = BUS_SERVICE_INTERFACE;
+const char bus_service_interface[] _introspect_("Service") = BUS_SERVICE_INTERFACE;
const char bus_service_invalidating_properties[] =
"ExecStartPre\0"
diff --git a/src/dbus-snapshot.c b/src/dbus-snapshot.c
index efaec7df3d..a9903ec484 100644
--- a/src/dbus-snapshot.c
+++ b/src/dbus-snapshot.c
@@ -38,7 +38,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_snapshot_interface[] = BUS_SNAPSHOT_INTERFACE;
+const char bus_snapshot_interface[] _introspect_("Snapshot") = BUS_SNAPSHOT_INTERFACE;
DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
const BusProperty properties[] = {
diff --git a/src/dbus-socket.c b/src/dbus-socket.c
index 5931f006c2..a9cb1c38f8 100644
--- a/src/dbus-socket.c
+++ b/src/dbus-socket.c
@@ -64,7 +64,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_socket_interface[] = BUS_SOCKET_INTERFACE;
+const char bus_socket_interface[] _introspect_("Socket") = BUS_SOCKET_INTERFACE;
const char bus_socket_invalidating_properties[] =
"ExecStartPre\0"
diff --git a/src/dbus-swap.c b/src/dbus-swap.c
index 70cccdcab8..06acb22dcc 100644
--- a/src/dbus-swap.c
+++ b/src/dbus-swap.c
@@ -47,7 +47,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_swap_interface[] = BUS_SWAP_INTERFACE;
+const char bus_swap_interface[] _introspect_("Swap") = BUS_SWAP_INTERFACE;
const char bus_swap_invalidating_properties[] =
"What\0"
diff --git a/src/dbus-target.c b/src/dbus-target.c
index 69e8212076..1eb3c249f8 100644
--- a/src/dbus-target.c
+++ b/src/dbus-target.c
@@ -38,7 +38,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_target_interface[] = BUS_TARGET_INTERFACE;
+const char bus_target_interface[] _introspect_("Target") = BUS_TARGET_INTERFACE;
DBusHandlerResult bus_target_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
const BusProperty properties[] = {
diff --git a/src/dbus-timer.c b/src/dbus-timer.c
index e57e97303a..56044661e7 100644
--- a/src/dbus-timer.c
+++ b/src/dbus-timer.c
@@ -42,7 +42,7 @@
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
-const char bus_timer_interface[] = BUS_TIMER_INTERFACE;
+const char bus_timer_interface[] _introspect_("Timer") = BUS_TIMER_INTERFACE;
const char bus_timer_invalidating_properties[] =
"Timers\0"
diff --git a/src/dbus-unit.c b/src/dbus-unit.c
index 47aa8d338c..835eeda329 100644
--- a/src/dbus-unit.c
+++ b/src/dbus-unit.c
@@ -26,7 +26,7 @@
#include "dbus-unit.h"
#include "bus-errors.h"
-const char bus_unit_interface[] = BUS_UNIT_INTERFACE;
+const char bus_unit_interface[] _introspect_("Unit") = BUS_UNIT_INTERFACE;
#define INVALIDATING_PROPERTIES \
"LoadState\0" \
diff --git a/src/macro.h b/src/macro.h
index b3da60f13e..85a7fbccfd 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -45,6 +45,7 @@
#define _public_ __attribute__ ((visibility("default")))
#define _hidden_ __attribute__ ((visibility("hidden")))
#define _weakref_(x) __attribute__((weakref(#x)))
+#define _introspect_(x) __attribute__((section("introspect." x)))
/* Rounds up */
static inline size_t ALIGN(size_t l) {