aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac131
1 files changed, 113 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index 18e2855..22dd3e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,11 +2,13 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
-AC_INIT([redshift], [1.1], [https://bugs.launchpad.net/redshift])
+AC_INIT([redshift], [1.3], [https://bugs.launchpad.net/redshift])
AC_CONFIG_SRCDIR([src/redshift.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([dist-bzip2])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
# Checks for programs.
AC_PROG_CC_C99
@@ -20,8 +22,13 @@ PKG_CHECK_MODULES([XCB], [xcb], [have_xcb=yes], [have_xcb=no])
PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr],
[have_xcb_randr=yes], [have_xcb_randr=no])
+PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])
+PKG_CHECK_MODULES([GCONF], [gconf-2.0], [have_gconf=yes], [have_gconf=no])
+
+AC_CHECK_HEADER([windows.h], [have_windows_h=yes], [have_windows_h=no])
+
# Check for Python
-AM_PATH_PYTHON([2.4], [have_python=yes], [have_python=no])
+AM_PATH_PYTHON([2.6], [have_python=yes], [have_python=no])
# Check RANDR method
AC_MSG_CHECKING([whether to enable RANDR method])
@@ -33,6 +40,7 @@ AS_IF([test "x$enable_randr" != xno], [
AC_DEFINE([ENABLE_RANDR], 1,
[Define to 1 to enable RANDR method])
AC_MSG_RESULT([yes])
+ enable_randr=yes
], [
AC_MSG_RESULT([missing dependencies])
AS_IF([test "x$enable_randr" = xyes], [
@@ -42,8 +50,9 @@ AS_IF([test "x$enable_randr" != xno], [
])
], [
AC_MSG_RESULT([no])
+ enable_randr=no
])
-AM_CONDITIONAL([ENABLE_RANDR], [test "x$enable_randr" != xno])
+AM_CONDITIONAL([ENABLE_RANDR], [test "x$enable_randr" = xyes])
# Check VidMode method
AC_MSG_CHECKING([whether to enable VidMode method])
@@ -55,6 +64,7 @@ AS_IF([test "x$enable_vidmode" != xno], [
AC_DEFINE([ENABLE_VIDMODE], 1,
[Define to 1 to enable VidMode method])
AC_MSG_RESULT([yes])
+ enable_vidmode=yes
], [
AC_MSG_RESULT([missing dependencies])
AS_IF([test "x$enable_vidmode" = xyes], [
@@ -64,37 +74,110 @@ AS_IF([test "x$enable_vidmode" != xno], [
])
], [
AC_MSG_RESULT([no])
+ enable_vidmode=no
+])
+AM_CONDITIONAL([ENABLE_VIDMODE], [test "x$enable_vidmode" = xyes])
+
+# Check Windows GDI method
+AC_MSG_CHECKING([whether to enable WinGDI method])
+AC_ARG_ENABLE([wingdi], [AC_HELP_STRING([--enable-wingdi],
+ [enable WinGDI method])],
+ [enable_wingdi=$enableval],[enable_wingdi=maybe])
+AS_IF([test "x$enable_wingdi" != xno], [
+ AS_IF([test $have_windows_h = yes], [
+ AC_DEFINE([ENABLE_WINGDI], 1,
+ [Define to 1 to enable WinGDI method])
+ AC_MSG_RESULT([yes])
+ enable_wingdi=yes
+ ], [
+ AC_MSG_RESULT([missing dependencies])
+ AS_IF([test "x$enable_wingdi" = xyes], [
+ AC_MSG_ERROR([missing Windows API headers for WinGDI method])
+ ])
+ enable_wingdi=no
+ ])
+], [
+ AC_MSG_RESULT([no])
+ enable_wingdi=no
])
-AM_CONDITIONAL([ENABLE_VIDMODE], [test "x$enable_vidmode" != xno])
+AM_CONDITIONAL([ENABLE_WINGDI], [test "x$enable_wingdi" = xyes])
# Check that at least one method is enabled
-AS_IF([test "x$enable_randr" = xno -a "x$enable_vidmode" = xno], [
- AC_MSG_ERROR([either RANDR or VidMode must be enabled])
+AS_IF([test "x$enable_randr" = xno -a "x$enable_vidmode" = xno -a "x$enable_wingdi" = xno], [
+ AC_MSG_ERROR([either RANDR, VidMode or WinGDI must be enabled])
])
-# Check for GTK+ status icon
-AC_MSG_CHECKING([whether to enable GTK status icon])
-AC_ARG_ENABLE([gtk], [AC_HELP_STRING([--enable-gtk],
- [enable GTK status icon])],
- [enable_gtk=$enableval],[enable_gtk=maybe])
-AS_IF([test "x$enable_gtk" != xno], [
- AS_IF([test $have_python != yes], [
- AC_MSG_WARN([status icon script requires Python and PyGTK])
+# Check GNOME Clock location provider
+AC_MSG_CHECKING([whether to enable GNOME Clock location provider])
+AC_ARG_ENABLE([gnome-clock], [AC_HELP_STRING([--enable-gnome-clock],
+ [enable GNOME Clock location provider])],
+ [enable_gnome_clock=$enableval],[enable_gnome_clock=maybe])
+AS_IF([test "x$enable_gnome_clock" != xno], [
+ AS_IF([test $have_glib = yes -a $have_gconf = yes], [
+ AC_DEFINE([ENABLE_GNOME_CLOCK], 1,
+ [Define to 1 to enable GNOME Clock location provider])
+ AC_MSG_RESULT([yes])
+ enable_gnome_clock=yes
+ ], [
+ AC_MSG_RESULT([missing dependencies])
+ AS_IF([test "x$enable_gnome_clock" = xyes], [
+ AC_MSG_ERROR([missing dependencies for GNOME Clock location provider])
+ ])
+ enable_gnome_clock=no
])
- AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
+ enable_gnome_clock=no
+])
+AM_CONDITIONAL([ENABLE_GNOME_CLOCK], [test "x$enable_gnome_clock" = xyes])
+
+
+# Check for GUI
+# There doesn't seem to be an easy way of detecting the presence
+# of a python module. For that reason, statusicon is the default GUI.
+AC_MSG_CHECKING([which GUI to enable])
+AC_ARG_ENABLE([gui], [AC_HELP_STRING([--enable-gui],
+ [enable GUI (appindicator, statusicon or none)])],
+ [enable_gui=$enableval],[enable_gui=maybe])
+
+# Statusicon GUI
+AS_IF([test "x$enable_gui" = xstatusicon -o "x$enable_gui" = maybe], [
+ AS_IF([test $have_python != yes], [
+ AS_IF([test "x$enable_gui" = xstatusicon], [
+ AC_MSG_ERROR([status icon script requires Python 2.6])
+ ])
+ enable_gui=maybe
+ ])
+])
+
+# Appindicator GUI
+AS_IF([test "x$enable_gui" = xappindicator -o "x$enable_gui" = maybe], [
+ AS_IF([test $have_python != yes], [
+ AS_IF([test "x$enable_gui" = xappindicator], [
+ AC_MSG_ERROR([application indicator script requires Python 2.6])
+ ])
+ enable_gui=maybe
+ ])
+])
+
+# Fall back to no GUI
+AS_IF([test "x$enable_gui" != xappindicator -a "x$enable_gui" != xstatusicon], [
+ enable_gui=none
])
-AM_CONDITIONAL([ENABLE_GTK], [test "x$enable_gtk" != xno])
+
+AC_MSG_RESULT([$enable_gui])
+
+AM_CONDITIONAL([ENABLE_STATUSICON], [test "x$enable_gui" = xstatusicon])
+AM_CONDITIONAL([ENABLE_APPINDICATOR], [test "x$enable_gui" = xappindicator])
+
# Checks for header files.
-AC_CHECK_HEADERS([locale.h stdint.h stdlib.h string.h unistd.h])
+AC_CHECK_HEADERS([locale.h stdint.h stdlib.h string.h unistd.h sys/signal.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT16_T
# Checks for library functions.
-AC_FUNC_MALLOC
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([floor], [m])
AC_CHECK_FUNCS([setlocale strchr floor pow clock_gettime])
@@ -102,6 +185,8 @@ AC_CHECK_FUNCS([setlocale strchr floor pow clock_gettime])
AC_CONFIG_FILES([
Makefile
po/Makefile.in
+ src/Makefile
+ src/gtk-redshift/Makefile
])
AC_OUTPUT
@@ -113,4 +198,14 @@ echo "
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
+
+ Adjustment methods:
+ RANDR: ${enable_randr}
+ VidMode: ${enable_vidmode}
+ WinGDI: ${enable_wingdi}
+
+ Location providers:
+ GNOME Clock: ${enable_gnome_clock}
+
+ GUI: ${enable_gui}
"