/
configure.ac
84 lines (73 loc) · 2.44 KB
/
configure.ac
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
# Copyright (c) 2013-2015 Fabian Hirschmann <fabian@hirschmann.email>
#
# This file is part of sleeptimer.
#
# Sleeptimer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Sleeptimer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Sleeptimer. If not, see <http://www.gnu.org/licenses/>.
# Prelude.
AC_INIT(sleeptimer, 0.4.2, [fabian@hirschmann.email], [sleeptimer],
http://github.com/fhirschmann/sleeptimer.git)
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AM_GNU_GETTEXT_VERSION([0.19.6])
AM_GNU_GETTEXT([external])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AM_MISSING_PROG([HELP2MAN], [help2man])
AC_PATH_PROG([xosdconfigpath], [xosd-config], [no])
if test "$xosdconfigpath" = "no"; then
AC_MSG_ERROR([xosd-config binary is required])
fi
XOSD_CFLAGS=`$xosdconfigpath --cflags`
if test -z "$XOSD_CFLAGS"; then
AC_MSG_RESULT([not found.])
exit
fi
XOSD_LDFLAGS=`$xosdconfigpath --libs`
if test -z "$XOSD_LDFLAGS"; then
AC_MSG_RESULT([not found.])
exit
fi
AC_SUBST(XOSD_CFLAGS)
AC_SUBST(XOSD_LDFLAGS)
# Checks for libraries.
AC_MSG_CHECKING(if LIRC support is enabled)
lirc=yes
AC_ARG_ENABLE([lirc],
AC_HELP_STRING([--disable-lirc], [disable lirc support]),
[
if test "x${enableval}" = "xyes" -a "x$GCC" = "xyes"; then
AC_MSG_RESULT(yes)
lirc=yes
else
AC_MSG_RESULT(no)
lirc=no
fi], AC_MSG_RESULT(no))
AC_ARG_WITH(lirc-prefix,
[ --with-lirc-prefix=PATH Prefix where LIRC is installed],
[
for dir in `echo "$withval" | tr : ' '`; do
if test -d $dir/lib; then CXXFLAGS="$CXXFLAGS -L$dir/lib"; fi
if test -d $dir/include; then CXXFLAGS="$CXXFLAGS -I$dir/include"; fi
done
])
HAVE_LIRC=no
if test "x${lirc}" != "xno" ; then
AC_CHECK_HEADER(lirc/lirc_client.h,
[AC_CHECK_LIB(lirc_client,lirc_init,[HAVE_LIRC=yes;LIBS=-llirc_client $LIBS;AC_DEFINE([HAVE_LIRC],[],[Define to 1 if LIRC must be used])],,)],)
fi
AM_CONDITIONAL(HAVE_LIRC, [test "x$HAVE_LIRC" = xyes])
# Output files.
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile po/Makefile.in])
AC_OUTPUT