Optional autogen.sh flag --enable-kdbus-transport added allowing to compile with...
authorLukasz Stempien <l.stempien@samsung.com>
Thu, 24 Oct 2013 09:37:54 +0000 (11:37 +0200)
committerLukasz Stempien <l.stempien@samsung.com>
Thu, 24 Oct 2013 13:38:14 +0000 (15:38 +0200)
- Required #ifdef ENABLE_KDBUS_TRANSPORT added to code
- Makefile.am and configure.ac modified

Change-Id: Ief9c7036c68e1d4ee9ff090d8a67be979a4b6262
Signed-off-by: Lukasz Stempien <l.stempien@samsung.com>
25 files changed:
bus/Makefile.am
bus/activation.c
bus/bus.c
bus/bus.h
bus/connection.c
bus/connection.h
bus/dispatch.c
bus/driver.c
bus/services.c
bus/services.h
configure.ac
dbus/Makefile.am
dbus/dbus-auth.c
dbus/dbus-auth.h
dbus/dbus-bus.c
dbus/dbus-bus.h
dbus/dbus-connection-internal.h
dbus/dbus-connection.c
dbus/dbus-connection.h
dbus/dbus-message.c
dbus/dbus-message.h
dbus/dbus-server.c
dbus/dbus-server.h
dbus/dbus-transport.c
dbus/dbus-transport.h

index 9a646af..55c73b5 100644 (file)
@@ -76,8 +76,6 @@ BUS_SOURCES=                                  \
        driver.h                                \
        expirelist.c                            \
        expirelist.h                            \
-       kdbus-d.c                                       \
-       kdbus-d.h                                       \       
        policy.c                                \
        policy.h                                \
        selinux.h                               \
@@ -94,6 +92,13 @@ BUS_SOURCES=                                 \
        utils.h                                 \
        $(XML_SOURCES)
 
+if ENABLE_KDBUS_TRANSPORT
+BUS_SOURCES+=                          \
+       kdbus-d.c                               \
+       kdbus-d.h
+endif
+
+
 dbus_daemon_SOURCES=                           \
        $(BUS_SOURCES)                          \
        main.c
index adf71ab..3dc8701 100644 (file)
@@ -1188,6 +1188,7 @@ bus_activation_send_pending_auto_activation_messages (BusActivation  *activation
         {
           DBusConnection *addressed_recipient;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
           /* kdbus change - we can not send anything using phantom connections
            * (DBusConnection structures for services other than daemon)
            * so we have to use daemon connection
@@ -1195,6 +1196,7 @@ bus_activation_send_pending_auto_activation_messages (BusActivation  *activation
           if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
               addressed_recipient = entry->connection;
           else
+#endif
               addressed_recipient = bus_service_get_primary_owners_connection (service);
 
           /* Resume dispatching where we left off in bus_dispatch() */
index 2fa54b6..e1d9c8c 100644 (file)
--- a/bus/bus.c
+++ b/bus/bus.c
 #include <dbus/dbus-hash.h>
 #include <dbus/dbus-credentials.h>
 #include <dbus/dbus-internals.h>
+
+#ifdef ENABLE_KDBUS_TRANSPORT
 #include "kdbus-d.h"
 #include <stdlib.h>
+#endif
 
 #ifdef DBUS_CYGWIN
 #include <signal.h>
@@ -71,7 +74,9 @@ struct BusContext
   unsigned int keep_umask : 1;
   unsigned int allow_anonymous : 1;
   unsigned int systemd_activation : 1;
+#ifdef ENABLE_KDBUS_TRANSPORT
   DBusConnection *myKdbusConnection;  //todo maybe can be rafctored and removed
+#endif
 };
 
 static dbus_int32_t server_data_slot = -1;
@@ -427,7 +432,8 @@ process_config_first_time_only (BusContext       *context,
 
   if (address)
     {
-      if(!strcmp(_dbus_string_get_const_data(address), "kdbus:"))
+#ifdef ENABLE_KDBUS_TRANSPORT
+      if(!strcmp(_dbus_string_get_const_data(address), "kdbus"))
       {
          DBusBusType type;
          DBusServer* server;
@@ -462,7 +468,8 @@ process_config_first_time_only (BusContext       *context,
                  goto failed;
       }
       else
-      {
+#endif
+        {
                  DBusServer *server;
 
                  server = dbus_server_listen (_dbus_string_get_const_data(address), error);
@@ -771,7 +778,10 @@ bus_context_new (const DBusString *config_file,
       goto failed;
     }
   context->refcount = 1;
+
+#ifdef ENABLE_KDBUS_TRANSPORT
   context->myKdbusConnection = NULL;
+#endif
 
   _dbus_generate_uuid (&context->uuid);
 
@@ -970,6 +980,7 @@ bus_context_new (const DBusString *config_file,
 
   dbus_server_free_data_slot (&server_data_slot);
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(context->myKdbusConnection)
   {
          DBusString unique_name;
@@ -1000,6 +1011,7 @@ bus_context_new (const DBusString *config_file,
           goto failed;
          }
   }
+#endif
 
   return context;
 
@@ -1053,6 +1065,7 @@ bus_context_reload_config (BusContext *context,
       goto failed;
     }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(context->myKdbusConnection)
   {
       if(!update_kdbus_starters(context->myKdbusConnection))
@@ -1062,6 +1075,8 @@ bus_context_reload_config (BusContext *context,
           goto failed;
       }
   }
+#endif
+
   ret = TRUE;
 
   bus_context_log (context, DBUS_SYSTEM_LOG_INFO, "Reloaded configuration");
@@ -1258,10 +1273,12 @@ bus_context_get_loop (BusContext *context)
   return context->loop;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBusConnection* bus_context_get_myConnection(BusContext *context)
 {
   return context->myKdbusConnection;
 }
+#endif
 
 dbus_bool_t
 bus_context_allow_unix_user (BusContext   *context,
@@ -1360,10 +1377,12 @@ bus_context_get_reply_timeout (BusContext *context)
   return context->limits.reply_timeout;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 dbus_bool_t bus_context_is_kdbus(BusContext* context)
 {
        return context->myKdbusConnection != NULL;
 }
+#endif
 
 void
 bus_context_log (BusContext *context, DBusSystemLogSeverity severity, const char *msg, ...) _DBUS_GNUC_PRINTF (3, 4);
index f913586..1b5da42 100644 (file)
--- a/bus/bus.h
+++ b/bus/bus.h
@@ -95,7 +95,9 @@ BusConnections*   bus_context_get_connections                    (BusContext
 BusActivation*    bus_context_get_activation                     (BusContext       *context);
 BusMatchmaker*    bus_context_get_matchmaker                     (BusContext       *context);
 DBusLoop*         bus_context_get_loop                           (BusContext       *context);
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBusConnection*   bus_context_get_myConnection                                  (BusContext       *context);
+#endif
 dbus_bool_t       bus_context_allow_unix_user                    (BusContext       *context,
                                                                   unsigned long     uid);
 dbus_bool_t       bus_context_allow_windows_user                 (BusContext       *context,
@@ -115,7 +117,11 @@ int               bus_context_get_max_services_per_connection    (BusContext
 int               bus_context_get_max_match_rules_per_connection (BusContext       *context);
 int               bus_context_get_max_replies_per_connection     (BusContext       *context);
 int               bus_context_get_reply_timeout                  (BusContext       *context);
+
+#ifdef ENABLE_KDBUS_TRANSPORT
 dbus_bool_t      bus_context_is_kdbus                                                   (BusContext       *context);
+#endif
+
 void              bus_context_log                                (BusContext       *context,
                                                                   DBusSystemLogSeverity severity,
                                                                   const char       *msg,
index eeab273..f97935d 100644 (file)
@@ -191,7 +191,9 @@ bus_connection_disconnected (DBusConnection *connection)
   BusConnectionData *d;
   BusService *service;
   BusMatchmaker *matchmaker;
+#ifdef ENABLE_KDBUS_TRANSPORT
   dbus_bool_t is_phantom = FALSE;
+#endif
   
   d = BUS_CONNECTION_DATA (connection);
   _dbus_assert (d != NULL);
@@ -199,8 +201,10 @@ bus_connection_disconnected (DBusConnection *connection)
   _dbus_verbose ("%s disconnected, dropping all service ownership and releasing\n",
                  d->name ? d->name : "(inactive)");
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(d->connections->context) && (strcmp(bus_connection_get_name(connection), ":1.1")))
       is_phantom = TRUE;
+#endif
 
   /* Delete our match rules */
   if (d->n_match_rules > 0)
@@ -310,9 +314,12 @@ bus_connection_disconnected (DBusConnection *connection)
   dbus_connection_set_data (connection,
                             connection_data_slot,
                             NULL, NULL);
+
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(is_phantom)
       dbus_connection_unref_phantom(connection);
   else
+#endif
       dbus_connection_unref (connection);
 }
 
@@ -1002,6 +1009,7 @@ bus_connections_foreach (BusConnections               *connections,
   foreach_inactive (connections, function, data);
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBusConnection*
 bus_connections_find_conn_by_name(BusConnections *connections, const char* name)
 {
@@ -1021,6 +1029,7 @@ bus_connections_find_conn_by_name(BusConnections *connections, const char* name)
 
     return NULL;
 }
+#endif
 
 BusContext*
 bus_connections_get_context (BusConnections *connections)
@@ -1378,6 +1387,7 @@ bus_connection_get_n_services_owned (DBusConnection *connection)
   return d->n_services_owned;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBusList**
 bus_connection_get_services_owned (DBusConnection *connection)
 {
@@ -1387,6 +1397,7 @@ bus_connection_get_services_owned (DBusConnection *connection)
 
     return &d->services_owned;
 }
+#endif
 
 dbus_bool_t
 bus_connection_complete (DBusConnection   *connection,
@@ -2053,7 +2064,9 @@ bus_transaction_send_from_driver (BusTransaction *transaction,
   if (!dbus_message_set_sender (message, DBUS_SERVICE_DBUS))
     return FALSE;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(!bus_context_is_kdbus(bus_transaction_get_context (transaction))) /* we can't set destination on the basis of connection when on kdbus*/
+#endif
     if (bus_connection_is_active (connection))
     {
       if (!dbus_message_set_destination (message,
@@ -2269,12 +2282,14 @@ bus_transaction_execute_and_free (BusTransaction *transaction)
   dbus_free (transaction);
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 void
 bus_transaction_free (BusTransaction *transaction)
 {
          free_cancel_hooks (transaction);
          dbus_free (transaction);
 }
+#endif
 
 static void
 bus_connection_remove_transactions (DBusConnection *connection)
index 3684ba0..6b3afaf 100644 (file)
@@ -43,8 +43,10 @@ void            bus_connections_foreach           (BusConnections
 void            bus_connections_foreach_active    (BusConnections               *connections,
                                                    BusConnectionForeachFunction  function,
                                                    void                         *data);
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBusConnection* bus_connections_find_conn_by_name (BusConnections *connections,
                                                    const char* name);
+#endif
 BusContext*     bus_connections_get_context       (BusConnections               *connections);
 void            bus_connections_increment_stamp   (BusConnections               *connections);
 BusContext*     bus_connection_get_context        (DBusConnection               *connection);
@@ -81,7 +83,9 @@ dbus_bool_t bus_connection_preallocate_oom_error (DBusConnection *connection);
 void        bus_connection_send_oom_error        (DBusConnection *connection,
                                                   DBusMessage    *in_reply_to);
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBusList** bus_connection_get_services_owned (DBusConnection *connection);
+#endif
 
 /* called by signals.c */
 dbus_bool_t bus_connection_add_match_rule      (DBusConnection *connection,
@@ -137,7 +141,9 @@ dbus_bool_t     bus_transaction_send_error_reply (BusTransaction               *
                                                   DBusMessage                  *in_reply_to);
 void            bus_transaction_cancel_and_free  (BusTransaction               *transaction);
 void            bus_transaction_execute_and_free (BusTransaction               *transaction);
+#ifdef ENABLE_KDBUS_TRANSPORT
 void                   bus_transaction_free                     (BusTransaction *transaction);
+#endif
 dbus_bool_t     bus_transaction_add_cancel_hook  (BusTransaction               *transaction,
                                                   BusTransactionCancelFunction  cancel_function,
                                                   void                         *data,
index fdeb6c1..a7d4c37 100644 (file)
@@ -37,7 +37,9 @@
 #include <dbus/dbus-internals.h>
 #include <dbus/dbus-misc.h>
 #include <string.h>
+#ifdef ENABLE_KDBUS_TRANSPORT
 #include "kdbus-d.h"
+#endif
 
 #ifdef HAVE_UNIX_FD_PASSING
 #include <dbus/dbus-sysdeps-unix.h>
@@ -251,6 +253,7 @@ bus_dispatch (DBusConnection *connection,
           goto out;
         }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
       if(bus_context_is_kdbus(context))
       {
           if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged"))
@@ -259,10 +262,14 @@ bus_dispatch (DBusConnection *connection,
               goto out;
           }
       }
+#endif
     }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   /* Assign a sender to the message */
   if(bus_context_is_kdbus(context) == FALSE)  //if using kdbus, sender must be set on library side
+#endif
+  {
     if (bus_connection_is_active (connection))
     {
       sender = bus_connection_get_name (connection);
@@ -281,6 +288,7 @@ bus_dispatch (DBusConnection *connection,
        */
       service_name = dbus_message_get_destination (message);
     }
+  }
 
   if (service_name &&
       strcmp (service_name, DBUS_SERVICE_DBUS) == 0) /* to bus driver */
@@ -315,7 +323,11 @@ bus_dispatch (DBusConnection *connection,
       _dbus_string_init_const (&service_string, service_name);
       service = bus_registry_lookup (registry, &service_string);
 
+#ifdef ENABLE_KDBUS_TRANSPORT
       if (dbus_message_get_auto_start (message) && (service == NULL || bus_service_get_is_kdbus_starter(service)))
+#else
+      if (service == NULL && dbus_message_get_auto_start (message))
+#endif
         {
           BusActivation *activation;
           /* We can't do the security policy check here, since the addressed
index 1ca6267..af85eb0 100644 (file)
 #include <dbus/dbus-marshal-recursive.h>
 #include <string.h>
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 #include "kdbus-d.h"
 #include <stdio.h>
 #include <errno.h>
 #include <limits.h>
+#endif
 
 static DBusConnection *
 bus_driver_get_conn_helper (DBusConnection  *connection,
@@ -104,8 +106,10 @@ bus_driver_send_service_owner_changed (const char     *service_name,
   dbus_bool_t retval;
   const char *null_service;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
          return TRUE;
+#endif
 
   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
@@ -156,8 +160,10 @@ bus_driver_send_service_lost (DBusConnection *connection,
 {
   DBusMessage *message;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
          return TRUE;
+#endif
 
   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
@@ -202,8 +208,10 @@ bus_driver_send_service_acquired (DBusConnection *connection,
 {
   DBusMessage *message;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
          return TRUE;
+#endif
 
   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
@@ -452,7 +460,7 @@ bus_driver_handle_list_services (DBusConnection *connection,
       return FALSE;
     }
 
-
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
          if(!kdbus_list_services (connection, &services, &len))
@@ -463,12 +471,16 @@ bus_driver_handle_list_services (DBusConnection *connection,
            }
   }
   else
-  if (!bus_registry_list_services (registry, &services, &len))
-    {
-      dbus_message_unref (reply);
-      BUS_SET_OOM (error);
-      return FALSE;
-    }
+#endif
+  {
+
+      if (!bus_registry_list_services (registry, &services, &len))
+        {
+          dbus_message_unref (reply);
+          BUS_SET_OOM (error);
+          return FALSE;
+        }
+  }
 
   dbus_message_iter_init_append (reply, &iter);
 
@@ -482,8 +494,11 @@ bus_driver_handle_list_services (DBusConnection *connection,
       return FALSE;
     }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(!bus_context_is_kdbus(bus_transaction_get_context (transaction))) //not needed for kdbus, we got it from kdbus_list_services
+#endif
   {
+
     /* Include the bus driver in the list */
     const char *v_STRING = DBUS_SERVICE_DBUS;
     if (!dbus_message_iter_append_basic (&sub, DBUS_TYPE_STRING,
@@ -654,6 +669,7 @@ bus_driver_handle_acquire_service (DBusConnection *connection,
   retval = FALSE;
   reply = NULL;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
          if (!bus_registry_acquire_kdbus_service (registry, connection,
@@ -663,7 +679,9 @@ bus_driver_handle_acquire_service (DBusConnection *connection,
            goto out;
   }
   else
+#endif
   {
+
          _dbus_string_init_const (&service_name, name);
 
          if (!bus_registry_acquire_service (registry, connection,
@@ -671,7 +689,6 @@ bus_driver_handle_acquire_service (DBusConnection *connection,
                                             &service_reply, transaction,
                                             error))
            goto out;
-
   }
 
   reply = dbus_message_new_method_return (message);
@@ -729,6 +746,7 @@ bus_driver_handle_release_service (DBusConnection *connection,
   _dbus_string_init_const (&service_name, name);
   registry = bus_connection_get_registry (connection);
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
          if (!bus_registry_release_service_kdbus (dbus_message_get_sender(message), connection,
@@ -736,7 +754,9 @@ bus_driver_handle_release_service (DBusConnection *connection,
                                             transaction, error))
              goto out;
   }
-  else if (!bus_registry_release_service (registry, connection,
+  else
+#endif
+  if (!bus_registry_release_service (registry, connection,
                                      &service_name, &service_reply,
                                      transaction, error))
     goto out;
@@ -799,6 +819,7 @@ bus_driver_handle_service_exists (DBusConnection *connection,
     }
   else
     {
+#ifdef ENABLE_KDBUS_TRANSPORT
          if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
          {
                  int inter_ret;
@@ -815,6 +836,7 @@ bus_driver_handle_service_exists (DBusConnection *connection,
                        }
          }
          else
+#endif
          {
              _dbus_string_init_const (&service_name, name);
              service = bus_registry_lookup (registry, &service_name);
@@ -1089,6 +1111,7 @@ bus_driver_handle_add_match (DBusConnection *connection,
   if (rule == NULL)
     goto failed;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
 
@@ -1100,7 +1123,9 @@ bus_driver_handle_add_match (DBusConnection *connection,
              goto failed;
   }
   else
+#endif
   {
+
          matchmaker = bus_connection_get_matchmaker (connection);
 
          if (!bus_matchmaker_add_rule (matchmaker, rule))
@@ -1158,11 +1183,13 @@ bus_driver_handle_remove_match (DBusConnection *connection,
   if (rule == NULL)
     goto failed;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
          if(!kdbus_remove_match(connection, message, error))
                  goto failed;
   }
+#endif
 
   /* Send the ack before we remove the rule, since the ack is undone
    * on transaction cancel, but rule removal isn't.
@@ -1171,7 +1198,9 @@ bus_driver_handle_remove_match (DBusConnection *connection,
                        message, error))
     goto failed;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(!bus_context_is_kdbus(bus_transaction_get_context (transaction)))
+#endif
   {
          matchmaker = bus_connection_get_matchmaker (connection);
 
@@ -1202,7 +1231,6 @@ bus_driver_handle_get_service_owner (DBusConnection *connection,
   BusRegistry *registry;
   BusService *service;
   DBusMessage *reply;
-  char unique_name[(unsigned int)(snprintf((char*)base_name, 0, "%llu", ULLONG_MAX) + sizeof(":1."))];
 
   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
 
@@ -1216,10 +1244,12 @@ bus_driver_handle_get_service_owner (DBusConnection *connection,
                               DBUS_TYPE_INVALID))
       goto failed;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
          int ret;
          struct nameInfo info;
+         char unique_name[(unsigned int)(snprintf((char*)base_name, 0, "%llu", ULLONG_MAX) + sizeof(":1."))];
 
          ret = kdbus_NameQuery(text, dbus_connection_get_transport(connection), &info);
                if(ret == 0) //unique id of the name
@@ -1243,7 +1273,8 @@ bus_driver_handle_get_service_owner (DBusConnection *connection,
                }
   }
   else
-  {
+#endif
+    {
          _dbus_string_init_const (&str, text);
          service = bus_registry_lookup (registry, &str);
          if (service == NULL &&
@@ -1426,12 +1457,14 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection,
   if (reply == NULL)
     goto oom;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
          if(!kdbus_get_connection_unix_user(connection, message, &uid, error))
                  goto failed;
   }
   else
+#endif
   {
          conn = bus_driver_get_conn_helper (connection, message, "UID", &service,
                                      error);
@@ -1489,12 +1522,14 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection,
   if (reply == NULL)
     goto oom;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
          if(!kdbus_get_connection_unix_process_id(connection, message, &pid, error))
                  goto failed;
   }
   else
+#endif
   {
          conn = bus_driver_get_conn_helper (connection, message, "PID", &service,
                                                                                 error);
@@ -1609,12 +1644,14 @@ bus_driver_handle_get_connection_selinux_security_context (DBusConnection *conne
   if (reply == NULL)
     goto oom;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
          if(!kdbus_get_connection_unix_selinux_security_context(connection, message, reply, error))
                  goto failed;
   }
   else
+#endif
   {
          conn = bus_driver_get_conn_helper (connection, message, "security context",
                                                                                 &service, error);
@@ -1671,8 +1708,10 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection,
   if (reply == NULL)
     goto oom;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(!bus_context_is_kdbus(bus_transaction_get_context (transaction)))
   {
+#endif
          conn = bus_driver_get_conn_helper (connection, message, "credentials",
                                                                                 &service, error);
 
@@ -1696,6 +1735,7 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection,
                  if (!_dbus_asv_add_uint32 (&array_iter, "UnixUserID", ulong_val))
                        goto oom;
                }
+#ifdef ENABLE_KDBUS_TRANSPORT
   }
   else
   {
@@ -1715,6 +1755,7 @@ bus_driver_handle_get_connection_credentials (DBusConnection *connection,
          else
                  goto failed;
   }
+#endif
 
   if (!_dbus_asv_close (&reply_iter, &array_iter))
     goto oom;
index 98e24b3..8a18627 100644 (file)
 #include <dbus/dbus-list.h>
 #include <dbus/dbus-mempool.h>
 #include <dbus/dbus-marshal-validate.h>
+#ifdef ENABLE_KDBUS_TRANSPORT
 #include <linux/types.h>
 #include <errno.h>
 #include <stdlib.h>
-
+#endif
 
 #include "driver.h"
 #include "services.h"
 #include "policy.h"
 #include "bus.h"
 #include "selinux.h"
+#ifdef ENABLE_KDBUS_TRANSPORT
 #include "kdbus-d.h"
 #include "dbus/kdbus.h"
+#endif
 
 struct BusService
 {
@@ -62,7 +65,9 @@ struct BusOwner
 
   unsigned int allow_replacement : 1;
   unsigned int do_not_queue : 1;
+#ifdef ENABLE_KDBUS_TRANSPORT
   unsigned int is_kdbus_starter : 1;
+#endif
 };
 
 struct BusRegistry
@@ -180,6 +185,7 @@ _bus_service_find_owner_link (BusService *service,
   return link;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 static DBusConnection *
 _bus_service_find_owner_connection (BusService *service,
                                    const char* unique_name)
@@ -201,6 +207,7 @@ _bus_service_find_owner_connection (BusService *service,
 
   return NULL;
 }
+#endif
 
 static void
 bus_owner_set_flags (BusOwner *owner,
@@ -212,8 +219,10 @@ bus_owner_set_flags (BusOwner *owner,
    owner->do_not_queue =
         (flags & DBUS_NAME_FLAG_DO_NOT_QUEUE) != FALSE;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
    owner->is_kdbus_starter =
         (flags & KDBUS_NAME_STARTER) != FALSE;
+#endif
 }
 
 static BusOwner *
@@ -628,6 +637,7 @@ bus_registry_acquire_service (BusRegistry      *registry,
   return retval;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 dbus_bool_t
 bus_registry_acquire_kdbus_service (BusRegistry      *registry,
                               DBusConnection   *connection,
@@ -639,6 +649,7 @@ bus_registry_acquire_kdbus_service (BusRegistry      *registry,
   dbus_bool_t retval;
   BusService *service;
   BusActivation  *activation;
+
   DBusString service_name_real;
   const DBusString *service_name = &service_name_real;
   char* name;
@@ -759,7 +770,7 @@ bus_registry_acquire_kdbus_service (BusRegistry      *registry,
                                               transaction, error))
                    goto failed2;
            }*/
-       /*   if((link = _bus_service_find_owner_link (service, connection)))  //if daemon is a starter
+           /*if((link = _bus_service_find_owner_link (service, connection)))  //if daemon is a starter
            {
                _dbus_list_unlink (&service->owners, link);
                _dbus_list_append_link (&service->owners, link);  //it must be moved at the end of the queue
@@ -782,6 +793,7 @@ failed:
 
   return FALSE;
 }
+#endif
 
 dbus_bool_t
 bus_registry_release_service (BusRegistry      *registry,
@@ -860,6 +872,7 @@ bus_registry_release_service (BusRegistry      *registry,
   return retval;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 dbus_bool_t
 bus_registry_release_service_kdbus (const char* sender_name,
                               DBusConnection   *connection,
@@ -946,6 +959,7 @@ bus_registry_release_service_kdbus (const char* sender_name,
  out:
   return retval;
 }
+#endif
 
 dbus_bool_t
 bus_registry_set_service_context_table (BusRegistry   *registry,
@@ -1530,6 +1544,7 @@ bus_service_get_allow_replacement (BusService *service)
   return owner->allow_replacement;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 dbus_bool_t
 bus_service_get_is_kdbus_starter (BusService *service)
 {
@@ -1543,6 +1558,7 @@ bus_service_get_is_kdbus_starter (BusService *service)
 
   return owner->is_kdbus_starter;
 }
+#endif
 
 dbus_bool_t
 bus_service_has_owner (BusService     *service,
@@ -1578,7 +1594,9 @@ bus_service_list_queued_owners (BusService *service,
       owner = (BusOwner *) link->data;
       uname = bus_connection_get_name (owner->conn);
 
+#ifdef ENABLE_KDBUS_TRANSPORT
       if(!owner->is_kdbus_starter)
+#endif
           if (!_dbus_list_append (return_list, (char *)uname))
               goto oom;
 
index 5df2888..b459b0d 100644 (file)
@@ -57,24 +57,28 @@ dbus_bool_t  bus_registry_acquire_service (BusRegistry                 *registry
                                            dbus_uint32_t               *result,
                                            BusTransaction              *transaction,
                                            DBusError                   *error);
-dbus_bool_t bus_registry_acquire_kdbus_service (BusRegistry      *registry,
-                                                 DBusConnection   *connection,
-                                                 DBusMessage *message,
-                                                 dbus_uint32_t    *result,
-                                                 BusTransaction   *transaction,
-                                                 DBusError        *error);
 dbus_bool_t  bus_registry_release_service (BusRegistry                 *registry,
                                            DBusConnection              *connection,
                                            const DBusString            *service_name,
                                            dbus_uint32_t               *result,
                                            BusTransaction              *transaction,
                                            DBusError                   *error);
+#ifdef ENABLE_KDBUS_TRANSPORT
+dbus_bool_t bus_registry_acquire_kdbus_service (BusRegistry      *registry,
+                                                 DBusConnection   *connection,
+                                                 DBusMessage *message,
+                                                 dbus_uint32_t    *result,
+                                                 BusTransaction   *transaction,
+                                                 DBusError        *error);
+
+
 dbus_bool_t bus_registry_release_service_kdbus (const char* sender_name,
                                           DBusConnection   *connection,
                                           const DBusString *service_name,
                                           dbus_uint32_t    *result,
                                           BusTransaction   *transaction,
                                           DBusError        *error);
+#endif
 dbus_bool_t  bus_registry_set_service_context_table (BusRegistry           *registry,
                                                     DBusHashTable         *table);
 
@@ -97,7 +101,9 @@ dbus_bool_t     bus_service_has_owner                 (BusService     *service,
                                                        DBusConnection *connection);
 BusOwner*       bus_service_get_primary_owner         (BusService     *service);
 dbus_bool_t     bus_service_get_allow_replacement     (BusService     *service);
+#ifdef ENABLE_KDBUS_TRANSPORT
 dbus_bool_t     bus_service_get_is_kdbus_starter      (BusService     *service);
+#endif
 const char*     bus_service_get_name                  (BusService     *service);
 dbus_bool_t     bus_service_list_queued_owners        (BusService *service,
                                                        DBusList  **return_list,
index 2559bcc..39ae389 100644 (file)
@@ -156,6 +156,7 @@ AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[
 AC_ARG_ENABLE(userdb-cache, AS_HELP_STRING([--enable-userdb-cache],[build with userdb-cache support]),enable_userdb_cache=$enableval,enable_userdb_cache=yes)
 AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
 AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)
+AC_ARG_ENABLE(kdbus-transport, AS_HELP_STRING([--enable-kdbus-transport],[build with kdbus transport support]),enable_kdbus_transport=$enableval,enable_kdbus_transport=no)
 
 AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
 AC_ARG_WITH(session-socket-dir, AS_HELP_STRING([--with-session-socket-dir=[dirname]],[Where to put sockets for the per-login-session message bus]))
@@ -1271,11 +1272,17 @@ AC_DEFINE_UNQUOTED([DBUS_DEFAULT_MESSAGE_UNIX_FDS],
   [Default for dbus_connection_get_max_message_unix_fds()])
 AC_SUBST([DEFAULT_MESSAGE_UNIX_FDS])
 
-### kdbus related libs
+### kdbus support
+if test x$enable_kdbus_transport = xyes; then
+    KDBUS_LIBS=
+    #"-lcrypto"
+    #AC_SUBST([KDBUS_LIBS])
+    AC_DEFINE(ENABLE_KDBUS_TRANSPORT,1,[Enable kdbus transport support])
+else
+    KDBUS_LIBS=
+fi
 
-KDBUS_LIBS=
-#"-lcrypto"
-#AC_SUBST([KDBUS_LIBS])             
+AM_CONDITIONAL([ENABLE_KDBUS_TRANSPORT], [test x$enable_kdbus_transport = xyes])
 
 #### Set up final flags
 LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $KDBUS_LIBS"
index 4ee22bd..81abc30 100644 (file)
@@ -106,15 +106,19 @@ DBUS_SHARED_arch_sources =                        \
        dbus-sysdeps-pthread.c                  \
        dbus-transport-unix.c                   \
        dbus-transport-unix.h                   \
-       dbus-transport-kdbus.c                  \
-       dbus-transport-kdbus.h                  \
-       kdbus-common.c                  \
-       kdbus-common.h                  \
        dbus-userdb.c                           \
        dbus-userdb.h                           \
        sd-daemon.c                             \
        sd-daemon.h
 
+if ENABLE_KDBUS_TRANSPORT
+DBUS_SHARED_arch_sources += \
+    dbus-transport-kdbus.c  \
+    dbus-transport-kdbus.h  \
+    kdbus-common.c          \
+    kdbus-common.h
+endif
+
 DBUS_UTIL_arch_sources =                       \
        dbus-sysdeps-util-unix.c                \
        dbus-userdb-util.c                      \
index 129cf19..86e3223 100644 (file)
@@ -2322,6 +2322,7 @@ _dbus_auth_client_new (void)
   return auth;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 /**
  * Creates a new auth conversation object for the client side of kdbus.
  * In fact it only initialize structures and sets authenticated state
@@ -2362,6 +2363,7 @@ _dbus_auth_client_new_kdbus (void)
 
   return auth;
 }
+#endif
 
 /**
  * Increments the refcount of an auth object.
index 30de4bd..8a47298 100644 (file)
@@ -44,7 +44,9 @@ typedef enum
 
 DBusAuth*     _dbus_auth_server_new          (const DBusString       *guid);
 DBusAuth*     _dbus_auth_client_new          (void);
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBusAuth*        _dbus_auth_client_new_kdbus    (void);
+#endif
 DBusAuth*     _dbus_auth_ref                 (DBusAuth               *auth);
 void          _dbus_auth_unref               (DBusAuth               *auth);
 dbus_bool_t   _dbus_auth_set_mechanisms      (DBusAuth               *auth,
index dad7bc6..3824b3f 100644 (file)
 #include "dbus-threads-internal.h"
 #include "dbus-connection-internal.h"
 #include "dbus-string.h"
+#ifdef ENABLE_KDBUS_TRANSPORT
 #include "dbus-transport-kdbus.h"
 #include <stdlib.h>
 #include <limits.h>
 #include <stdio.h>
+#endif
 
 /**
  * @defgroup DBusBus Message bus APIs
@@ -140,12 +142,14 @@ get_from_env (char           **connection_p,
     }
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 void dbus_bus_set_bus_connection_address(DBusBusType address_type, char* address)
 {
        if(bus_connection_addresses[address_type] != NULL)
                free(bus_connection_addresses[address_type]);
        bus_connection_addresses[address_type] = address;
 }
+#endif
 
 static dbus_bool_t
 init_session_address (void)
@@ -726,7 +730,7 @@ dbus_bus_register (DBusConnection *connection,
       _DBUS_SET_OOM (error);
       goto out;
     }
-  //_dbus_verbose("-- Our uniqe name is: %s\n", bd->unique_name);
+
   retval = TRUE;
   
  out:
@@ -734,8 +738,6 @@ dbus_bus_register (DBusConnection *connection,
 
   if (message)
     dbus_message_unref (message);
-  else if (name)
-         free(name);
 
   if (reply)
     dbus_message_unref (reply);
index 35ab21d..e8549e7 100644 (file)
@@ -28,7 +28,9 @@
 #define DBUS_BUS_H
 
 #include <dbus/dbus-connection.h>
+#ifdef ENABLE_KDBUS_TRANSPORT
 #include "dbus-address.h"
+#endif
 
 DBUS_BEGIN_DECLS
 
@@ -37,8 +39,10 @@ DBUS_BEGIN_DECLS
  * @{
  */
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBUS_EXPORT
 void                   dbus_bus_set_bus_connection_address(DBusBusType address_type, char* address);
+#endif
 
 DBUS_EXPORT
 DBusConnection *dbus_bus_get              (DBusBusType     type,
index 56ce771..6e1bc30 100644 (file)
@@ -72,7 +72,9 @@ void              _dbus_connection_toggle_timeout_unlocked     (DBusConnection
                                                                 DBusTimeout        *timeout,
                                                                 dbus_bool_t         enabled);
 DBusConnection*   _dbus_connection_new_for_transport           (DBusTransport      *transport);
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBusConnection*   _dbus_connection_new_for_used_transport       (DBusTransport *transport);
+#endif
 void              _dbus_connection_do_iteration_unlocked       (DBusConnection     *connection,
                                                                 DBusPendingCall    *pending,
                                                                 unsigned int        flags,
index b8d89d0..9167619 100644 (file)
 #include "dbus-threads-internal.h"
 #include "dbus-bus.h"
 #include "dbus-marshal-basic.h"
+#ifdef ENABLE_KDBUS_TRANSPORT
 #include "dbus-transport-kdbus.h"
 #include <stdlib.h>
+#endif
 
 #ifdef DBUS_DISABLE_CHECKS
 #define TOOK_LOCK_CHECK(connection)
@@ -1248,8 +1250,13 @@ _dbus_connection_do_iteration_unlocked (DBusConnection *connection,
  * @param transport the transport.
  * @returns the new connection, or #NULL on failure.
 */
+#ifdef ENABLE_KDBUS_TRANSPORT
 static DBusConnection*
 _dbus_connection_new_for_transport_internal (DBusTransport *transport, dbus_bool_t exists)
+#else
+DBusConnection*
+_dbus_connection_new_for_transport (DBusTransport *transport)
+#endif
 {
   DBusConnection *connection;
   DBusWatchList *watch_list;
@@ -1360,7 +1367,9 @@ _dbus_connection_new_for_transport_internal (DBusTransport *transport, dbus_bool
 
   connection->disconnect_message_link = disconnect_link;
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(!exists)
+#endif
   {
       CONNECTION_LOCK (connection);
 
@@ -1414,6 +1423,7 @@ _dbus_connection_new_for_transport_internal (DBusTransport *transport, dbus_bool
   return NULL;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 /**
  * Creates a new connection for the given transport.  A transport
  * represents a message stream that uses some concrete mechanism, such
@@ -1434,6 +1444,7 @@ _dbus_connection_new_for_used_transport (DBusTransport *transport)
 {
     return _dbus_connection_new_for_transport_internal(transport, TRUE);
 }
+#endif
 
 /**
  * Increments the reference count of a DBusConnection.
@@ -2703,8 +2714,13 @@ free_outgoing_message (void *element,
   dbus_message_unref (message);
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 static void
 _dbus_connection_last_unref_internal (DBusConnection *connection, dbus_bool_t unref_transport)
+#else
+static void
+_dbus_connection_last_unref (DBusConnection *connection)
+#endif
 {
   DBusList *link;
 
@@ -2715,7 +2731,9 @@ _dbus_connection_last_unref_internal (DBusConnection *connection, dbus_bool_t un
   /* You have to disconnect the connection before unref:ing it. Otherwise
    * you won't get the disconnected message.
    */
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(unref_transport)
+#endif
       _dbus_assert (!_dbus_transport_get_is_connected (connection->transport));
   _dbus_assert (connection->server_guid == NULL);
   
@@ -2770,7 +2788,9 @@ _dbus_connection_last_unref_internal (DBusConnection *connection, dbus_bool_t un
 
   _dbus_counter_unref (connection->outgoing_counter);
 
+#ifdef ENABLE_KDBUS_TRANSPORT
   if(unref_transport)
+#endif
       _dbus_transport_unref (connection->transport);
 
   if (connection->disconnect_message_link)
@@ -2793,6 +2813,7 @@ _dbus_connection_last_unref_internal (DBusConnection *connection, dbus_bool_t un
   dbus_free (connection);
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 /* This is run without the mutex held, but after the last reference
  * to the connection has been dropped we should have no thread-related
  * problems
@@ -2802,6 +2823,7 @@ _dbus_connection_last_unref (DBusConnection *connection)
 {
     _dbus_connection_last_unref_internal(connection, TRUE);
 }
+#endif
 
 /**
  * Decrements the reference count of a DBusConnection, and finalizes
@@ -2851,6 +2873,7 @@ dbus_connection_unref (DBusConnection *connection)
     }
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 void
 dbus_connection_unref_phantom (DBusConnection *connection)
 {
@@ -2866,6 +2889,7 @@ dbus_connection_unref_phantom (DBusConnection *connection)
   if (old_refcount == 1)
       _dbus_connection_last_unref_internal(connection, FALSE);
 }
+#endif
 
 /*
  * Note that the transport can disconnect itself (other end drops us)
@@ -3030,6 +3054,7 @@ dbus_connection_get_is_authenticated (DBusConnection *connection)
   return res;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 /**
  * Sets authenticated status for connection. Needed for kdbus, where authentication is
  * made in different manner.
@@ -3047,6 +3072,7 @@ dbus_connection_set_is_authenticated (DBusConnection *connection)
 
   return TRUE;
 }
+#endif
 
 /**
  * Gets whether the connection is not authenticated as a specific
@@ -6360,6 +6386,7 @@ _dbus_connection_get_address (DBusConnection *connection)
   return _dbus_transport_get_address (connection->transport);
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBusTransport*
 dbus_connection_get_transport(DBusConnection *connection)
 {
@@ -6367,5 +6394,6 @@ dbus_connection_get_transport(DBusConnection *connection)
 
        return connection->transport;
 }
+#endif
 
 /** @} */
index a3afb93..faabc88 100644 (file)
@@ -184,16 +184,20 @@ DBUS_EXPORT
 DBusConnection*    dbus_connection_ref                          (DBusConnection             *connection);
 DBUS_EXPORT
 void               dbus_connection_unref                        (DBusConnection             *connection);
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBUS_EXPORT
 void               dbus_connection_unref_phantom               (DBusConnection             *connection);
+#endif
 DBUS_EXPORT
 void               dbus_connection_close                        (DBusConnection             *connection);
 DBUS_EXPORT
 dbus_bool_t        dbus_connection_get_is_connected             (DBusConnection             *connection);
 DBUS_EXPORT
 dbus_bool_t        dbus_connection_get_is_authenticated         (DBusConnection             *connection);
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBUS_EXPORT
 dbus_bool_t        dbus_connection_set_is_authenticated         (DBusConnection             *connection);
+#endif
 DBUS_EXPORT
 dbus_bool_t        dbus_connection_get_is_anonymous             (DBusConnection             *connection);
 DBUS_EXPORT
index 7288e81..f37a7ed 100644 (file)
@@ -396,11 +396,13 @@ dbus_message_lock (DBusMessage  *message)
     }
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 void
 dbus_message_unlock (DBusMessage  *message)
 {
        message->locked = FALSE;
 }
+#endif
 
 static dbus_bool_t
 set_or_delete_string_field (DBusMessage *message,
index e30069a..41b0a5d 100644 (file)
@@ -266,8 +266,10 @@ void        dbus_message_iter_abandon_container  (DBusMessageIter *iter,
 DBUS_EXPORT
 void dbus_message_lock    (DBusMessage  *message);
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBUS_EXPORT
 void dbus_message_unlock  (DBusMessage  *message);
+#endif
 
 DBUS_EXPORT
 dbus_bool_t  dbus_set_error_from_message  (DBusError    *error,
index f969403..ba993d1 100644 (file)
@@ -183,6 +183,7 @@ _dbus_server_init_base (DBusServer             *server,
   return FALSE;
 }
 
+#ifdef ENABLE_KDBUS_TRANSPORT
 static void mini_vtable_dummy_func(DBusServer *server)
 {
     // Used to prevent assert errors. Pointer to function is passed to
@@ -228,6 +229,7 @@ failed:
        dbus_free(server);
        return NULL;
 }
+#endif
 
 
 /**
index 8c81495..4266ddc 100644 (file)
@@ -47,8 +47,11 @@ typedef struct DBusServer DBusServer;
 typedef void (* DBusNewConnectionFunction) (DBusServer     *server,
                                             DBusConnection *new_connection,
                                             void           *data);
+
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBUS_EXPORT
 DBusServer* dbus_server_init_mini               (char* address);
+#endif
 
 DBUS_EXPORT
 DBusServer* dbus_server_listen           (const char     *address,
index 78b880d..6b50372 100644 (file)
@@ -22,6 +22,7 @@
  *
  */
 
+
 #include <../config.h>
 #include "dbus-transport-protected.h"
 #include "dbus-transport-unix.h"
@@ -33,7 +34,9 @@
 #include "dbus-credentials.h"
 #include "dbus-mainloop.h"
 #include "dbus-message.h"
+#ifdef ENABLE_KDBUS_TRANSPORT
 #include "dbus-transport-kdbus.h"
+#endif
 #ifdef DBUS_ENABLE_EMBEDDED_TESTS
 #include "dbus-server-debug-pipe.h"
 #endif
@@ -126,9 +129,11 @@ _dbus_transport_init_base (DBusTransport             *transport,
           _dbus_message_loader_unref (loader);
           return FALSE;
         }
+#ifdef ENABLE_KDBUS_TRANSPORT
       if(address_copy == strstr(address_copy, "kdbus:path="))
          auth = _dbus_auth_client_new_kdbus();
          else
+#endif
                  auth = _dbus_auth_client_new ();
   }
 
@@ -348,7 +353,9 @@ static const struct {
                                     DBusTransport   **transport_p,
                                     DBusError        *error);
 } open_funcs[] = {
+#ifdef ENABLE_KDBUS_TRANSPORT
   { _dbus_transport_open_kdbus },
+#endif
   { _dbus_transport_open_socket },
   { _dbus_transport_open_platform_specific },
   { _dbus_transport_open_autolaunch }
index 2c8e70d..04f512f 100644 (file)
@@ -97,8 +97,11 @@ dbus_bool_t        _dbus_transport_set_auth_mechanisms    (DBusTransport
                                                            const char                **mechanisms);
 void               _dbus_transport_set_allow_anonymous    (DBusTransport              *transport,
                                                            dbus_bool_t                 value);
+
+#ifdef ENABLE_KDBUS_TRANSPORT
 DBUS_EXPORT
 DBusTransport*         dbus_connection_get_transport      (DBusConnection *connection);
+#endif
 
 /* if DBUS_ENABLE_STATS */
 void _dbus_transport_get_stats (DBusTransport  *transport,