From 30aaad03b66ff22d8cc50de2116b2d93a9d445f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rainer=20M=C3=BCller?= Date: Sun, 10 Nov 2013 03:51:40 +0100 Subject: [PATCH] Link to IOKit using -framework The libIOKit.dylib symlink no longer exists in OS X 10.9 Mavericks, we now have to link using -framework. This should also work in all previous versions of OS X. Signed-off-by: Florian Forster --- configure.in | 9 ++++----- src/Makefile.am | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 87a19076..ff791d6c 100644 --- a/configure.in +++ b/configure.in @@ -1427,13 +1427,12 @@ AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes") AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes") with_libiokit="no" -AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices, -[ +if test "x$ac_system" = "xDarwin" +then with_libiokit="yes" -], -[ +else with_libiokit="no" -]) +fi AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes") with_libkvm="no" diff --git a/src/Makefile.am b/src/Makefile.am index 2bebec55..71abeca9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -191,7 +191,7 @@ if BUILD_PLUGIN_APPLE_SENSORS pkglib_LTLIBRARIES += apple_sensors.la apple_sensors_la_SOURCES = apple_sensors.c apple_sensors_la_LDFLAGS = -module -avoid-version -apple_sensors_la_LIBADD = -lIOKit +apple_sensors_la_LDFLAGS += -framework IOKit collectd_LDADD += "-dlopen" apple_sensors.la collectd_DEPENDENCIES += apple_sensors.la endif @@ -213,7 +213,7 @@ battery_la_SOURCES = battery.c battery_la_LDFLAGS = -module -avoid-version battery_la_LIBADD = if BUILD_WITH_LIBIOKIT -battery_la_LIBADD += -lIOKit +battery_la_LDFLAGS += -framework IOKit endif collectd_LDADD += "-dlopen" battery.la collectd_DEPENDENCIES += battery.la @@ -361,7 +361,7 @@ if BUILD_WITH_LIBDEVINFO disk_la_LIBADD += -ldevinfo endif if BUILD_WITH_LIBIOKIT -disk_la_LIBADD += -lIOKit +disk_la_LDFLAGS += -framework IOKit endif if BUILD_WITH_LIBSTATGRAB disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS) -- 2.11.0