forked from intel/thermal_daemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
139 lines (113 loc) · 4.23 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
AC_PREREQ(1.0)
m4_define([td_major_version], [2])
m4_define([td_minor_version], [5.6])
m4_define([td_version],
[td_major_version.td_minor_version])
AC_INIT([thermald], [td_version], [], [thermald])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.11 foreign no-define subdir-objects])
AM_MAINTAINER_MODE([enable])
GTK_DOC_CHECK([1.11],[--flavour no-tmpl])
AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
if test -n "$with_dbus_sys_dir" ; then
DBUS_SYS_DIR="$with_dbus_sys_dir"
else
DBUS_SYS_DIR="/usr/share/dbus-1/system.d"
fi
AC_SUBST(DBUS_SYS_DIR)
AC_ARG_WITH(dbus-power-group, AS_HELP_STRING([--with-dbus-power-group=GROUP], [group that is allowed to connect to D-BUS service]))
if test -n "$with_dbus_power_group" ; then
DBUS_POWER_GROUP="$with_dbus_power_group"
else
DBUS_POWER_GROUP="power"
fi
AC_SUBST(DBUS_POWER_GROUP)
# paths
AC_SUBST(tdbinary, "$sbindir/$PACKAGE", [Binary executable])
AC_SUBST(tdconfdir, "$sysconfdir/$PACKAGE", [Configuration directory])
AC_SUBST(tdrundir, "$localstatedir/run/$PACKAGE", [Runtime state directory])
PKG_PROG_PKG_CONFIG
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
if test "x$with_systemdsystemunitdir" != xno; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
# print configuration
echo
echo "System paths:"
echo " prefix: $prefix"
echo " exec_prefix: $exec_prefix"
echo " systemdunitdir: $with_systemdsystemunitdir"
echo " tdbinary: $tdbinary"
echo " tdconfdir: $tdconfdir"
echo " tdrundir: $tdrundir"
echo
GETTEXT_PACKAGE=thermald
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
dnl
dnl Checks for new dbus-glib property access function
dnl
AC_CHECK_LIB([dbus-glib-1], [dbus_glib_global_set_disable_legacy_property_access], ac_have_dg_prop="1", ac_have_dg_prop="0")
AC_DEFINE_UNQUOTED(HAVE_DBUS_GLIB_DISABLE_LEGACY_PROP_ACCESS, $ac_have_dg_prop, [Define if you have a dbus-glib with dbus_glib_global_set_disable_legacy_property_access()])
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.94)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
GLIB_VERSION_DEFINES="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26"
DBUS_CFLAGS="$DBUS_CFLAGS $GLIB_VERSION_DEFINES"
PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.22 gmodule-2.0)
GLIB_CFLAGS="$GLIB_CFLAGS $GLIB_VERSION_DEFINES"
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.4)
AC_PATH_PROG([GDBUS_CODEGEN],[gdbus-codegen])
PKG_CHECK_MODULES(LZMA, liblzma)
PKG_CHECK_MODULES(UPOWER, upower-glib)
PKG_CHECK_MODULES(EVDEV, libevdev)
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
m4_ifdef([AX_CHECK_COMPILE_FLAG], [
# Check for -Werror flag support.
for flag in \
-Wall \
-Wclobbered \
-Wempty-body \
-Wformat \
-Wignored-qualifiers \
-Wmissing-field-initializers \
-Wreorder \
-Wreturn-type \
-Wsign-compare \
-Wtype-limits \
-Wuninitialized \
-Wunused-but-set-variable \
; do
AX_CHECK_COMPILE_FLAG([-Werror ${flag}],
[CXXFLAGS="$CXXFLAGS ${flag}"])
done
# Check for c++0x support.
AX_CHECK_COMPILE_FLAG([-std=c++0x],
[CXXFLAGS="$CXXFLAGS -std=c++0x"])
], [AC_MSG_ERROR([AX_CHECK_COMPILE_FLAG not found, you'll need to install autoconf-archive])])
AC_ARG_ENABLE(werror, AS_HELP_STRING([--disable-werror], [Disable -Werror]))
AS_IF([test "x$enable_werror" != "xno"], [CXXFLAGS="$CXXFLAGS -Werror"])
AC_CONFIG_FILES([Makefile
docs/Makefile
docs/version.xml
data/Makefile])
AC_ARG_ENABLE(gdbus,
[AS_HELP_STRING([--disable-gdbus],
[Switch DBus backend to glib-dbus. (Default: GDBus)])],
[],
[AC_DEFINE([GDBUS], [1], [Enable GDBus support])])
AC_OUTPUT