1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
AC_INIT([redshift], [0.4], [jonlst@gmail.com])
AC_CONFIG_SRCDIR([src/redshift.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([dist-bzip2])
# Checks for programs.
AC_PROG_CC_C99
# Checks for libraries.
PKG_CHECK_MODULES([X11], [x11], [have_x11=yes], [have_x11=no])
PKG_CHECK_MODULES([XF86VM], [xxf86vm], [have_xf86vm=yes], [have_xf86vm=no])
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])
# Check RANDR method
AC_MSG_CHECKING([whether to enable RANDR method])
AC_ARG_ENABLE([randr], [AC_HELP_STRING([--enable-randr],
[enable RANDR method])],
[enable_randr=$enableval],[enable_randr=yes])
AS_IF([test "x$enable_randr" != xno], [
AS_IF([test $have_xcb = yes -a $have_xcb_randr = yes], [
AC_DEFINE([ENABLE_RANDR], 1,
[Define to 1 to enable RANDR method])
AC_MSG_RESULT([yes])
], [
enable_randr=no
AC_MSG_RESULT([missing dependencies])
])
], [
AC_MSG_RESULT([no])
])
AM_CONDITIONAL([ENABLE_RANDR], [test "x$enable_randr" != xno])
# Check VidMode method
AC_MSG_CHECKING([whether to enable VidMode method])
AC_ARG_ENABLE([vidmode], [AC_HELP_STRING([--enable-vidmode],
[enable VidMode method])],
[enable_vidmode=$enableval],[enable_vidmode=yes])
AS_IF([test "x$enable_vidmode" != xno], [
AS_IF([test $have_x11 = yes -a $have_xf86vm = yes], [
AC_DEFINE([ENABLE_VIDMODE], 1,
[Define to 1 to enable VidMode method])
AC_MSG_RESULT([yes])
], [
enable_vidmode=no
AC_MSG_RESULT([missing dependencies])
])
], [
AC_MSG_RESULT([no])
])
AM_CONDITIONAL([ENABLE_VIDMODE], [test "x$enable_vidmode" != xno])
# 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])
])
# Checks for header files.
AC_CHECK_HEADERS([locale.h stdint.h stdlib.h string.h unistd.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])
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT
echo "
$PACKAGE_NAME $VERSION
prefix: ${prefix}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
"
|