modules/battery: fix compiling on OS X
authorJean Guyomarc'h <jean.guyomarch@gmail.com>
Thu, 9 Apr 2015 21:41:22 +0000 (17:41 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 9 Apr 2015 21:41:22 +0000 (17:41 -0400)
Summary:
Battery module relies on Apple's CoreFoundation (CF), but CF's CFLAGS
were not provided to this module.

Test Plan: Enlightenment now compiles on OS X.

Reviewers: zmike, raster

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2328

configure.ac
src/modules/Makefile_battery.mk

index c90986f..c29d9ba 100644 (file)
@@ -644,7 +644,8 @@ have_freebsd="no"
 BATTERY_LDFLAGS=
 case "$host_os" in
   darwin*)
-    BATTERY_LDFLAGS="-framework Foundation -framework IOKit"
+    BATTERY_LDFLAGS="${cf_libs}"
+    BATTERY_CFLAGS="${BATTERY_CFLAGS} ${cf_cflags}"
   ;;
   openbsd*)
     have_openbsd="yes"
index 180f948..b11cb73 100644 (file)
@@ -35,7 +35,7 @@ endif
 src_modules_battery_batgetdir = $(batterypkgdir)
 src_modules_battery_batget_PROGRAMS = src/modules/battery/batget
 
-src_modules_battery_batget_CPPFLAGS = $(MOD_CPPFLAGS)
+src_modules_battery_batget_CPPFLAGS = $(MOD_CPPFLAGS) @BATTERY_CFLAGS@
 src_modules_battery_batget_SOURCES = src/modules/battery/batget.c
 src_modules_battery_batget_LDADD   = @BATTERY_LIBS@
 src_modules_battery_batget_LDFLAGS = @BATTERY_LDFLAGS@