summaryrefslogtreecommitdiff
path: root/configure.ac.in
blob: b1a0d3597479814ede551ff027f2c02a3cae0cd4 (plain)
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
dnl
dnl Copyright (c) 2003-2019
dnl         The Xfce development team. All rights reserved.
dnl
dnl Written for Xfce by Benedikt Meurer <benny@xfce.org>.
dnl

dnl Version information
m4_define([xfsm_version_major], [4])
m4_define([xfsm_version_minor], [16])
m4_define([xfsm_version_micro], [0])
m4_define([xfsm_version_nano], []) dnl leave this empty to have no nano version
m4_define([xfsm_version_build], [@REVISION@])
m4_define([xfsm_version_tag], [git])
m4_define([xfsm_version], [xfsm_version_major().xfsm_version_minor().xfsm_version_micro()ifelse(xfsm_version_nano(), [], [], [.xfsm_version_nano()])ifelse(xfsm_version_tag(), [git], [xfsm_version_tag()-xfsm_version_build()], [xfsm_version_tag()])])

m4_define([xfsm_debug_default], [ifelse(xfsm_version_tag(), [git], [yes], [minimum])])
m4_define([intltool_minimum_version], [0.35])

dnl Initialize autoconf
AC_COPYRIGHT([Copyright (c) 2003-2019
        The Xfce development team. All rights reserved.

Written for Xfce by Benedikt Meurer <benny@xfce.org>.])
AC_INIT([xfce4-session], [xfsm_version], [https://bugzilla.xfce.org/])
AC_PREREQ([2.60])
AC_REVISION([$Id$])
AC_PROG_MAKE_SET()

dnl Initialize automake
AM_INIT_AUTOMAKE([1.11 dist-bzip2 tar-ustar no-dist-gzip foreign])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
AM_MAINTAINER_MODE()
AM_SILENT_RULES([yes])

dnl Set helper path prefix
AC_ARG_WITH([helper-path-prefix],
            [AC_HELP_STRING([--with-helper-path-prefix=PATH],
                            [Path prefix under which helper executables will be installed (default: $libdir)])],
            [HELPER_PATH_PREFIX="$withval"],
            [HELPER_PATH_PREFIX="$libdir"])
AC_SUBST([HELPER_PATH_PREFIX])

dnl check for UNIX variants
AC_USE_SYSTEM_EXTENSIONS
AM_CONDITIONAL([HAVE_OS_CYGWIN], [test x"`uname | grep \"CYGWIN\"`" != x""])
if test x"`uname | grep \"CYGWIN\"`" != x""; then
	AC_DEFINE([HAVE_OS_CYGWIN], [1], [Compiling under cygwin])
fi

dnl check for basic programs
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
IT_PROG_INTLTOOL([intltool_minimum_version], [no-xml])
m4_ifdef([AC_PROG_SED], [AC_PROG_SED], [AC_CHECK_PROG(SED, sed, sed)])

dnl check for libtool
LT_PREREQ([2.2.6])
LT_INIT([disable-static])

dnl check for standard header files
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h fcntl.h \
                  netdb.h signal.h stdarg.h sys/resource.h \
                  sys/socket.h sys/time.h sys/wait.h sys/utsname.h time.h \
                  unistd.h math.h sys/types.h])
AC_CHECK_FUNCS([getaddrinfo gethostbyname gethostname setsid strdup])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T

# Checks for library functions.
AC_FUNC_MALLOC

dnl Check for required libraries
AC_CHECK_LIBM
AC_SUBST(LIBM)

dnl Check for X11 installed
XDT_CHECK_LIBX11_REQUIRE()

dnl Check for session management support
XDT_CHECK_LIBSM()

dnl Check for _IceTransNoListen
ac_LIBS="$LIBS"
LIBS="$LIBS $LIBSM_LDFLAGS $LIBSM_LIBS"
AC_CHECK_FUNCS([_IceTransNoListen])
LIBS="$ac_LIBS"

dnl Check for i18n support
XDT_I18N([@LINGUAS@])

dnl Check for required packages
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.15.2])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.15.1])
XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.22.0])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.50.0])
XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [2.50.0])
XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-3.0], [3.10])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.12.0])

dnl Check for Polkit/PolicyKit
XDT_CHECK_OPTIONAL_PACKAGE([POLKIT], [polkit-gobject-1], [0.102],
                           [polkit], [Polkit support])

AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_50, [Ignore post 2.50 deprecations])
AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_50, [Prevent post 2.50 APIs])

AC_DEFINE(GDK_VERSION_MIN_REQUIRED, GDK_VERSION_3_20, [Ignore post 3.20 deprecations])
AC_DEFINE(GDK_VERSION_MAX_ALLOWED, GDK_VERSION_3_20, [Prevent post 3.20 APIs])

dnl Check for debugging support
XDT_FEATURE_DEBUG([xfsm_debug_default])

dnl Check for linker optimizations
XDT_FEATURE_LINKER_OPTS()

dnl Check for iceauth
AC_PATH_PROG([ICEAUTH], [iceauth])
if test x"$ICEAUTH" != x""; then
  AC_DEFINE_UNQUOTED([ICEAUTH_CMD], ["$ICEAUTH"], [path to iceauth])
else
  AC_MSG_ERROR([iceauth missing, please check your X11 installation])
fi

dnl Find a location for the session desktop file
AC_MSG_CHECKING([what xsession-prefix to use])
AC_ARG_WITH([xsession-prefix],
            AC_HELP_STRING([--with-xsession-prefix=XSESSION_PREFIX], [What should be the prefix for the xsession .desktop file?]),
  [], [with_xsession_prefix="/usr"])
XSESSION_PREFIX=$with_xsession_prefix
AC_SUBST([XSESSION_PREFIX])
AC_MSG_RESULT([$with_xsession_prefix])

dnl Check for legacy session management
AC_ARG_ENABLE([legacy-sm],
AC_HELP_STRING([--enable-legacy-sm], [Enable X11R5 session management])
AC_HELP_STRING([--disable-legacy-sm], [Disable X11R5 session management]),
  [], [enable_legacy_sm=yes])
AC_MSG_CHECKING([whether to enable X11R5 session management])
if test x"$enable_legacy_sm" != x"yes"; then
  AC_MSG_RESULT([no])
else
  AC_DEFINE([LEGACY_SESSION_MANAGEMENT], [1], [Define for X11R5 sm compat])
  AC_MSG_RESULT([yes])
fi

dnl Compile time default choice of backend
AC_ARG_WITH([backend],
	    AS_HELP_STRING([--with-backend=<option>],
			   [Default backend to use linux, freebsd, openbsd]))
# default to a sane option
AC_CANONICAL_HOST
if test x$with_backend = x; then
	AS_CASE([$host],
		[*-linux*],   [with_backend=linux],
		[*-*freebsd*], [with_backend=freebsd],
		[*-*dragonfly*], [with_backend=freebsd],
		[*-openbsd*], [with_backend=openbsd])
fi
AC_DEFINE_UNQUOTED(BACKEND, "$with_backend", [backend])
AC_SUBST(BACKEND, "$with_backend")

if test x$with_backend = xlinux; then
    AC_DEFINE(BACKEND_TYPE_LINUX, 1, [Linux suspend/hibernate/hybrid-sleep backend])
fi
if test x$with_backend = xfreebsd; then
    AC_DEFINE(BACKEND_TYPE_FREEBSD, 1, [FreeBSD suspend/hibernate backend])
fi
if test x$with_backend = xopenbsd; then
    AC_DEFINE(BACKEND_TYPE_OPENBSD, 1, [OpenBSD suspend/hibernate backend])
fi

AC_CONFIG_FILES([
Makefile
doc/Makefile
icons/Makefile
icons/16x16/Makefile
icons/24x24/Makefile
icons/24x24-actions/Makefile
icons/32x32/Makefile
icons/48x48-actions/Makefile
icons/48x48/Makefile
icons/128x128/Makefile
icons/scalable/Makefile
libxfsm/Makefile
po/Makefile.in
settings/Makefile
scripts/Makefile
scripts/xinitrc.in
xfce4-session/Makefile
xfce4-session-logout/Makefile
xfsm-shutdown-helper/Makefile
])
AC_OUTPUT

dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "Build Configuration:"
echo
echo " * Debugging support:              $enable_debug"
if test x"$POLKIT_FOUND" = x"yes"; then
echo " * Polkit/PolicyKit support:       yes"
else
echo " * Polkit/PolicyKit support:       no"
fi
if test x"$enable_legacy_sm" = x"yes"; then
echo " * Legacy session management:      yes"
else
echo " * Legacy session management:      no"
fi
echo " * Backend:                        ${with_backend}"

echo