aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2014-12-16 06:41:22 +0100
committerJon Lund Steffensen <jonlst@gmail.com>2014-12-16 06:41:22 +0100
commit003025f5a3f4f9678279cd5bd985d0d32d1a4a48 (patch)
tree3a3e69b2711bfbde5c557192bf10ea544a4617a7 /configure.ac
parentMerge pull request #145 from jonls/appdata-xml (diff)
parentAdd CoreLocation (OSX) location provider (diff)
downloadredshift-ng-003025f5a3f4f9678279cd5bd985d0d32d1a4a48.tar.gz
redshift-ng-003025f5a3f4f9678279cd5bd985d0d32d1a4a48.tar.bz2
redshift-ng-003025f5a3f4f9678279cd5bd985d0d32d1a4a48.tar.xz
Merge pull request #140 from jonls/osx-support
OSX support. Adds gamma adjustment method `quartz` and location provider `corelocation`.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac101
1 files changed, 100 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 1bb5424..3f46334 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,14 +5,31 @@ AC_PREREQ([2.69])
AC_INIT([redshift], [1.9.1], [https://github.com/jonls/redshift/issues])
AC_CONFIG_SRCDIR([src/redshift.c])
AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Checks for programs.
AC_PROG_CC_C99
+AC_PROG_LIBTOOL
+AC_PROG_OBJC # For OSX support modules
+AC_LANG([C])
+
AC_PROG_INTLTOOL([0.50])
+# Test whether Objective C compiler works
+AC_MSG_CHECKING([whether Objective C compiler works])
+AC_LANG_PUSH([Objective C])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [
+ AC_MSG_RESULT([yes])
+ have_objc_compiler=yes
+], [
+ AC_MSG_RESULT([no])
+ have_objc_compiler=no
+])
+AC_LANG_POP([Objective C])
+
# Checks for libraries.
AM_GNU_GETTEXT_VERSION([0.17])
AM_GNU_GETTEXT([external])
@@ -34,6 +51,30 @@ PKG_CHECK_MODULES([GLIB], [glib-2.0 gobject-2.0], [have_glib=yes], [have_glib=no
PKG_CHECK_MODULES([GEOCLUE], [geoclue], [have_geoclue=yes], [have_geoclue=no])
PKG_CHECK_MODULES([GEOCLUE2], [glib-2.0 gio-2.0 >= 2.26], [have_geoclue2=yes], [have_geoclue2=no])
+# OSX headers
+AC_CHECK_HEADER([ApplicationServices/ApplicationServices.h], [have_appserv_h=yes], [have_appserv_h=no])
+
+# CoreLocation.h is an Objective C header. Only test if
+# Objective C compiler works. AC_CHECK_HEADER does not
+# appear to work if the Ojective C compiler is not
+# available so we need a custom test.
+AC_MSG_CHECKING([whether CoreLocation/CoreLocation.h is usable])
+AS_IF([test "x$have_objc_compiler" = xyes], [
+ AC_LANG_PUSH([Objective C])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#import <CoreLocation/CoreLocation.h>]],[[]])], [
+ AC_MSG_RESULT([yes])
+ have_corelocation_h=yes
+ ], [
+ AC_MSG_RESULT([no])
+ have_corelocation_h=no
+ ])
+ AC_LANG_POP([Objective C])
+], [
+ AC_MSG_RESULT([no Objective C compiler available])
+ have_corelocation_h=no
+])
+
+# Windows header
AC_CHECK_HEADER([windows.h], [have_windows_h=yes], [have_windows_h=no])
# Check for Python
@@ -111,6 +152,34 @@ AS_IF([test "x$enable_vidmode" != xno], [
])
AM_CONDITIONAL([ENABLE_VIDMODE], [test "x$enable_vidmode" = xyes])
+# Check Quartz (OSX) method
+AC_MSG_CHECKING([whether to enable Quartz method])
+AC_ARG_ENABLE([quartz], [AC_HELP_STRING([--enable-quartz],
+ [enable Quartz (OSX) method])],
+ [enable_quartz=$enableval],[enable_quartz=maybe])
+AS_IF([test "x$enable_quartz" != xno], [
+ AS_IF([test $have_appserv_h = yes], [
+ QUARTZ_CFLAGS=""
+ QUARTZ_LIBS="-framework ApplicationServices"
+ AC_DEFINE([ENABLE_QUARTZ], 1,
+ [Define to 1 to enable Quartz method])
+ AC_MSG_RESULT([yes])
+ enable_quartz=yes
+ ], [
+ AC_MSG_RESULT([missing dependencies])
+ AS_IF([test "x$enable_quartz" = xyes], [
+ AC_MSG_ERROR([missing Quartz headers])
+ ])
+ enable_quartz=no
+ ])
+], [
+ AC_MSG_RESULT([no])
+ enable_quartz=no
+])
+AM_CONDITIONAL([ENABLE_QUARTZ], [test "x$enable_quartz" = xyes])
+AC_SUBST([QUARTZ_CFLAGS])
+AC_SUBST([QUARTZ_LIBS])
+
# Check Windows GDI method
AC_MSG_CHECKING([whether to enable WinGDI method])
AC_ARG_ENABLE([wingdi], [AC_HELP_STRING([--enable-wingdi],
@@ -184,6 +253,34 @@ AS_IF([test "x$enable_geoclue2" != xno], [
])
AM_CONDITIONAL([ENABLE_GEOCLUE2], [test "x$enable_geoclue2" = xyes])
+# Check CoreLocation (OSX) provider
+AC_MSG_CHECKING([whether to enable CoreLocation method])
+AC_ARG_ENABLE([corelocation], [AC_HELP_STRING([--enable-corelocation],
+ [enable CoreLocation (OSX) provider])],
+ [enable_corelocation=$enableval],[enable_corelocation=maybe])
+AS_IF([test "x$enable_corelocation" != xno], [
+ AS_IF([test "x$have_corelocation_h" = xyes], [
+ CORELOCATION_CFLAGS=""
+ CORELOCATION_LIBS="-framework Foundation -framework CoreLocation"
+ AC_DEFINE([ENABLE_CORELOCATION], 1,
+ [Define to 1 to enable CoreLocation provider])
+ AC_MSG_RESULT([yes])
+ enable_corelocation=yes
+ ], [
+ AC_MSG_RESULT([missing dependencies])
+ AS_IF([test "x$enable_corelocation" = xyes], [
+ AC_MSG_ERROR([missing CoreLocation headers])
+ ])
+ enable_corelocation=no
+ ])
+], [
+ AC_MSG_RESULT([no])
+ enable_corelocation=no
+])
+AM_CONDITIONAL([ENABLE_CORELOCATION], [test "x$enable_corelocation" = xyes])
+AC_SUBST([CORELOCATION_CFLAGS])
+AC_SUBST([CORELOCATION_LIBS])
+
# Check for GUI status icon
AC_MSG_CHECKING([whether to enable GUI status icon])
@@ -270,11 +367,13 @@ echo "
DRM: ${enable_drm}
RANDR: ${enable_randr}
VidMode: ${enable_vidmode}
- WinGDI: ${enable_wingdi}
+ Quartz (OSX): ${enable_quartz}
+ WinGDI (Windows): ${enable_wingdi}
Location providers:
Geoclue: ${enable_geoclue}
Geoclue2: ${enable_geoclue2}
+ CoreLocation (OSX) ${enable_corelocation}
GUI: ${enable_gui}
Ubuntu icons: ${enable_ubuntu}