summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b9f877b)
raw | patch | inline | side by side (parent: b9f877b)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Mon, 5 Dec 2016 19:55:49 +0000 (20:55 +0100) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Mon, 5 Dec 2016 19:57:28 +0000 (20:57 +0100) |
HAL has been deprecated for a long time.
README | patch | blob | history | |
configure.ac | patch | blob | history | |
src/Makefile.am | patch | blob | history | |
src/uuid.c | patch | blob | history |
index 7754d87ce69d5af88af8f5484662c16811e12c2a..2fa89542b3c8ac0ccfebc9dff3f3a97e46e13e25 100644 (file)
--- a/README
+++ b/README
Used by the `gps' plugin.
<http://developer.berlios.de/projects/gpsd/>
- * libhal (optional)
- If present, the `uuid' plugin will check for UUID from HAL.
- <http://hal.freedesktop.org/>
-
* libi2c-dev (optional)
Used for the plugin `barometer', provides just the i2c-dev.h header file
for user space i2c development.
diff --git a/configure.ac b/configure.ac
index 1c8d4db9f8f24275754143e46982e33e5f7e79ee..dcec7715c2e7fbff7ad70b16324802edbd0efbab 100644 (file)
--- a/configure.ac
+++ b/configure.ac
# Checks for libraries begin here
#
-# Check for HAL (hardware abstraction library)
-PKG_CHECK_MODULES([HAL], [hal],
- [
- SAVE_LIBS="$LIBS"
- LIBS="$HAL_LIBS $LIBS"
- AC_CHECK_LIB([hal], [libhal_device_property_exists],
- [
- SAVE_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$HAL_CFLAGS $CPPFLAGS"
- AC_CHECK_HEADERS([libhal.h],
- [
- with_libhal="yes"
- BUILD_WITH_LIBHAL_CFLAGS="$HAL_CFLAGS"
- BUILD_WITH_LIBHAL_LIBS="$HAL_LIBS"
- ])
- CPPFLAGS="$SAVE_CPPFLAGS"
- ],
- [with_libhal="no"]
- )
- LIBS="$SAVE_LIBS"
- ],
- [with_libhal="no"]
-)
-AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
-AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
-
-
# Check for libpthread
SAVE_LIBS="$LIBS"
AC_CHECK_LIB([pthread],
AC_MSG_RESULT([ libgcrypt . . . . . . $with_libgcrypt])
AC_MSG_RESULT([ libgps . . . . . . . $with_libgps])
AC_MSG_RESULT([ libgrpc++ . . . . . . $with_libgrpcpp])
-AC_MSG_RESULT([ libhal . . . . . . . $with_libhal])
AC_MSG_RESULT([ libhiredis . . . . . $with_libhiredis])
AC_MSG_RESULT([ libi2c-dev . . . . . $with_libi2c])
AC_MSG_RESULT([ libiokit . . . . . . $with_libiokit])
diff --git a/src/Makefile.am b/src/Makefile.am
index a693affc18440e63619e8bbdc9fee1421378ea95..b48ea27912ffe63e6cfd1ff97fc189c66687c6a2 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
if BUILD_PLUGIN_UUID
pkglib_LTLIBRARIES += uuid.la
uuid_la_SOURCES = uuid.c
-uuid_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHAL_CFLAGS)
-uuid_la_LIBADD = $(BUILD_WITH_LIBHAL_LIBS)
uuid_la_LDFLAGS = $(PLUGIN_LDFLAGS)
endif
diff --git a/src/uuid.c b/src/uuid.c
index ad8d4d2e9830bc09305a7618d59749cb91a65ce9..546d481d81d8daa5ec116fc857ffc9caa146e919 100644 (file)
--- a/src/uuid.c
+++ b/src/uuid.c
#include <sys/sysctl.h>
#endif
-#if HAVE_LIBHAL_H
-#include <libhal.h>
-#endif
-
#define UUID_RAW_LENGTH 16
#define UUID_PRINTABLE_COMPACT_LENGTH (UUID_RAW_LENGTH * 2)
#define UUID_PRINTABLE_NORMAL_LENGTH (UUID_PRINTABLE_COMPACT_LENGTH + 4)
}
#endif
-#if HAVE_LIBHAL_H
-
-#define UUID_PATH "/org/freedesktop/Hal/devices/computer"
-#define UUID_PROPERTY "smbios.system.uuid"
-
-static char *uuid_get_from_hal(void) {
- LibHalContext *ctx;
-
- DBusError error;
- DBusConnection *con;
-
- dbus_error_init(&error);
-
- if (!(con = dbus_bus_get(DBUS_BUS_SYSTEM, &error)))
- goto bailout_nobus;
-
- ctx = libhal_ctx_new();
- libhal_ctx_set_dbus_connection(ctx, con);
-
- if (!libhal_ctx_init(ctx, &error))
- goto bailout;
-
- if (!libhal_device_property_exists(ctx, UUID_PATH, UUID_PROPERTY, &error))
- goto bailout;
-
- char *uuid =
- libhal_device_get_property_string(ctx, UUID_PATH, UUID_PROPERTY, &error);
- if (looks_like_a_uuid(uuid))
- return (uuid);
-
-bailout : {
- DBusError ctxerror;
- dbus_error_init(&ctxerror);
- if (!(libhal_ctx_shutdown(ctx, &ctxerror)))
- dbus_error_free(&ctxerror);
-}
-
- libhal_ctx_free(ctx);
-
-bailout_nobus:
- if (dbus_error_is_set(&error))
- dbus_error_free(&error);
- return (NULL);
-}
-#endif
-
static char *uuid_get_from_file(const char *path) {
FILE *file;
char uuid[UUID_PRINTABLE_NORMAL_LENGTH + 1] = "";
return (uuid);
#endif
-#if HAVE_LIBHAL_H
- if ((uuid = uuid_get_from_hal()) != NULL)
- return (uuid);
-#endif
-
if ((uuid = uuid_get_from_dmidecode()) != NULL)
return (uuid);