-
Notifications
You must be signed in to change notification settings - Fork 31
/
configure.ac
338 lines (298 loc) · 10.5 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
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
dnl configure.ac
dnl
dnl xfwm4 - window manager for the Xfce4 desktop environment
dnl
m4_define([glib_minimum_version], [2.72.0])
m4_define([gtk_minimum_version], [3.24.0])
m4_define([xfce_minimum_version], [4.8.0])
m4_define([libxfce4ui_minimum_version], [4.12.0])
m4_define([libxfce4kbd_private_minimum_version], [4.12.0])
m4_define([xfconf_minimum_version], [4.13.0])
m4_define([xfconf_legacy_version], [4.12.0])
m4_define([xcomposite_minimum_version], [0.2])
m4_define([wnck_minimum_version], [3.14])
m4_define([startup_notification_minimum_version], [0.5])
m4_define([libepoxy_minimum_version], [1.0])
m4_define([xpresent_minimum_version], [1.0])
m4_define([presentproto_minimum_version], [1.1])
dnl version info
XDT_VERSION_INIT([4.19.1], [git])
dnl init autoconf
AC_COPYRIGHT([Copyright (c) 2002-2024
The Xfce development team. All rights reserved.
Written for Xfce by Olivier Fourdan <[email protected]>.])
AC_INIT([xfwm4], [xdt_version], [https://gitlab.xfce.org/xfce/xfwm4])
AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar no-dist-gzip foreign])
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE()
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl set helper path prefix
AC_ARG_WITH([helper-path-prefix],
[AS_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
dnl check for basic programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
dnl check for libtool
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
dnl Check C Compiler Characteristics
AC_C_INLINE
dnl check for required headers
AC_CHECK_HEADERS([errno.h fcntl.h math.h memory.h signal.h stdarg.h \
stdio.h stdlib.h string.h sys/stat.h sys/time.h sys/types.h \
sys/wait.h time.h unistd.h])
dnl Math lib is required (if available)
MATH_LIBS=""
AC_CHECK_LIB(m, ceil, MATH_LIBS="-lm")
AC_SUBST([MATH_LIBS])
dnl Check for i18n support
GETTEXT_PACKAGE="$PACKAGE"
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Name of default gettext domain])
AC_SUBST([GETTEXT_PACKAGE])
AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
dnl Check for X11 window system
XDT_CHECK_LIBX11_REQUIRE
dnl Check for Xext library
AC_CHECK_LIB([Xext], [XShapeCombineShape],
[
if ! echo $LIBX11_LIBS | grep -q -- '-lXext'; then
LIBX11_LIBS="$LIBX11_LIBS -lXext"
fi
], [], [$LIBX11_CFLAGS $LIBX11_LDFLAGS $LIBX11_LIBS])
AC_ARG_ENABLE([xi2],
AS_HELP_STRING([--enable-xi2], [enable support for the X Input 2 extension])
AS_HELP_STRING([--disable-xi2], [don't enable the X Input 2 extension (default)]),
[enable_xi2=yes], [])
have_xi2="no"
if test x"$enable_xi2" = x"yes"; then
dnl Check for Xi2 library
AC_CHECK_LIB([Xi], [XISelectEvents],
[
if ! echo $LIBX11_LIBS | grep -q -- '-lXi'; then
have_xi2="yes"
LIBX11_LIBS="$LIBX11_LIBS -lXi"
AC_DEFINE([HAVE_XI2], [1], [Define to enable XI2])
fi
],
[
AC_MSG_ERROR([X Input 2 extension support requested but not available])
],
[$LIBX11_CFLAGS $LIBX11_LDFLAGS $LIBX11_LIBS])
fi
dnl Check for XRes library
AC_CHECK_LIB([XRes], [XResQueryClientIds],
[
if ! echo $LIBX11_LIBS | grep -q -- '-lXRes'; then
LIBX11_LIBS="$LIBX11_LIBS -lXRes"
AC_DEFINE([HAVE_XRES], [1], [Define to enable XRes])
fi
], [], [$LIBX11_CFLAGS $LIBX11_LDFLAGS $LIBX11_LIBS])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [glib_minimum_version])
XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [gtk_minimum_version])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [xfce_minimum_version])
XDT_CHECK_PACKAGE([LIBXFCE4UI], libxfce4ui-2, [libxfce4ui_minimum_version])
XDT_CHECK_PACKAGE([LIBXFCE4KBD_PRIVATE], libxfce4kbd-private-3, [libxfce4kbd_private_minimum_version])
XDT_CHECK_PACKAGE([LIBXFCONF], libxfconf-0, [xfconf_minimum_version],,
[
AC_DEFINE([XFCONF_LEGACY], [], [Use dbus-glib provided by xfconf 4.12 to obtain array type])
XDT_CHECK_PACKAGE([LIBXFCONF], [libxfconf-0], [xfconf_legacy_version])
])
XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-3.0], [wnck_minimum_version])
XDT_CHECK_PACKAGE([XINERAMA], [xinerama], [0])
AS_IF([test "x$USE_MAINTAINER_MODE" = "xyes"],
[
AC_PATH_PROG([XDT_CSOURCE], [xdt-csource])
AS_IF([test -z "$XDT_CSOURCE"],
[
echo '*** The program "xdt-csource" is required to build when --enable-maintainer-mode'
echo '*** is specified.'
exit 1
])
AC_PATH_PROG([GLIB_COMPILE_RESOURCES], [glib-compile-resources])
AS_IF([test -z "$GLIB_COMPILE_RESOURCES"],
[
echo '*** The program "glib-compile-resources" is required to build when --enable-maintainer-mode'
echo '*** is specified.'
exit 1
])
])
dnl
dnl Sync to vblank support
dnl
EPOXY_FOUND="no"
XDT_CHECK_OPTIONAL_PACKAGE([EPOXY],
[epoxy], [libepoxy_minimum_version],
[epoxy],
[library for handling OpenGL function pointer management], [yes])
dnl
dnl Startup notification support
dnl
LIBSTARTUP_NOTIFICATION_FOUND="no"
XDT_CHECK_OPTIONAL_PACKAGE([LIBSTARTUP_NOTIFICATION],
[libstartup-notification-1.0], [startup_notification_minimum_version],
[startup-notification],
[startup notification library], [yes])
dnl
dnl XSync support
dnl
XSYNC_LIBS=
AC_ARG_ENABLE([xsync],
AS_HELP_STRING([--enable-xsync], [try to use the xsync extension])
AS_HELP_STRING([--disable-xsync], [don't try to use the xsync extension]),
[], [enable_xsync=yes])
have_xsync="no"
if test x"$enable_xsync" = x"yes"; then
AC_CHECK_LIB([Xext], [XSyncCreateFence],
[ have_xsync="yes"
XSYNC_LIBS=" -lXext"
AC_DEFINE([HAVE_XSYNC], [1], [Define to enable xsync])
],[])
fi
AC_SUBST([XSYNC_LIBS])
dnl
dnl Render support
dnl
AC_ARG_ENABLE([render],
AS_HELP_STRING([--enable-render], [try to use the render extension])
AS_HELP_STRING([--disable-render], [don't try to use the render extension]),
[], [enable_render=yes])
have_render="no"
RENDER_LIBS=
if test x"$enable_render" = x"yes"; then
if $PKG_CONFIG --print-errors --exists xrender 2>&1; then
PKG_CHECK_MODULES(RENDER, xrender)
have_render="yes"
AC_DEFINE([HAVE_RENDER], [1], [Define to enable render])
else
dnl fallback to check for libXrender
AC_CHECK_LIB([Xrender], [XRenderCreatePicture],
[ have_render="yes"
RENDER_LIBS=" -lXrender"
AC_DEFINE([HAVE_RENDER], [1], [Define to enable render])
],[])
fi
fi
AC_SUBST([RENDER_LIBS])
dnl
dnl RANDR extension
dnl (please note that Xrandr requires Xrender - and no, it's not a typo ;)
dnl
AC_ARG_ENABLE([randr],
AS_HELP_STRING([--enable-randr], [try to use the randr extension (requires render)])
AS_HELP_STRING([--disable-randr], [don't try to use the randr extension]),
[], [enable_randr=yes])
RANDR_LIBS=
have_xrandr="no"
if test x"$enable_randr" = x"yes"; then
if test x"$have_render" = x"yes"; then
have_xrandr="no"
ac_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $LIBX11_CFLAGS"
AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
[AC_CHECK_HEADER(X11/extensions/Xrandr.h,
RANDR_LIBS="-lXrandr -lXrender"
AC_DEFINE([HAVE_RANDR], [1], [Define to enable xrandr])
have_xrandr="yes",,
[#include <X11/Xlib.h>])],,
$LIBS $LIBX11_LDFLAGS $LIBX11_LIBS -lXrender -lXext)
CFLAGS="$ac_CFLAGS"
fi
fi
AC_SUBST([RANDR_LIBS])
dnl
dnl XPresent support
dnl
AC_ARG_ENABLE([xpresent],
AS_HELP_STRING([--enable-xpresent], [try to use the xpresent extension])
AS_HELP_STRING([--disable-xpresent], [don't try to use the xpresent extension]),
[], [enable_xpresent=yes])
have_xpresent="no"
XPRESENT_LIBS=
if test x"$enable_xpresent" = x"yes"; then
if $PKG_CONFIG --print-errors --exists xpresent 2>&1; then
PKG_CHECK_MODULES(PRESENT_EXTENSION, presentproto >= [presentproto_minimum_version] xpresent)
have_xpresent="yes"
AC_DEFINE([HAVE_PRESENT_EXTENSION], [1], [Define to enable xpresent])
fi
fi
AC_SUBST([PRESENT_EXTENSION_LIBS])
dnl
dnl Xcomposite and related extensions
dnl
compositor="no"
ENABLE_COMPOSITOR=""
AC_ARG_ENABLE([compositor],
AS_HELP_STRING([--enable-compositor], [enable compositor in xfwm4 (default)])
AS_HELP_STRING([--disable-compositor], [disable compositor in xfwm4]),
[], [enable_compositor=yes])
if test x"$enable_compositor" = x"yes"; then
if test x"$have_render" = x"yes"; then
if $PKG_CONFIG --print-errors --exists xcomposite xfixes xdamage xrender 2>&1; then
PKG_CHECK_MODULES(COMPOSITOR, xcomposite >= [xcomposite_minimum_version] xfixes xdamage)
AC_DEFINE([HAVE_COMPOSITOR], [1], [Define to enable compositor])
ENABLE_COMPOSITOR="--enable-compositor"
AC_DEFINE([HAVE_COMPOSITOR], [1], [Define to enable compositor])
compositor="yes"
fi
fi
fi
AC_SUBST(ENABLE_COMPOSITOR)
dnl
dnl position window
dnl
AC_ARG_ENABLE([poswin],
AS_HELP_STRING([--enable-poswin], [enable position window on move/resize]),
[], [enable_poswin=no])
if test x"$enable_poswin" = x"yes"; then
AC_DEFINE([SHOW_POSITION], [1], [Define to enable position window on move/resize])
fi
dnl Check for debugging support
XDT_FEATURE_DEBUG([xdt_debug_default])
m4_define([xfwm4_revision], [ifelse(xdt_version_build, [], [unknown], [xdt_version_build])])
REVISION=xfwm4_revision
AC_DEFINE_UNQUOTED([REVISION], "$REVISION", [git id])
AC_SUBST([REVISION])
AC_CONFIG_FILES([
Makefile
defaults/Makefile
helper-dialog/Makefile
icons/Makefile
icons/16x16/Makefile
icons/22x22/Makefile
icons/48x48/Makefile
icons/128x128/Makefile
icons/scalable/Makefile
po/Makefile.in
common/Makefile
settings-dialogs/Makefile
src/Makefile
themes/Makefile
themes/daloa/Makefile
themes/default/Makefile
themes/default-hdpi/Makefile
themes/default-xhdpi/Makefile
themes/kokodi/Makefile
themes/moheli/Makefile
])
AC_OUTPUT
echo
echo "Build Configuration for $PACKAGE version $VERSION revision $REVISION:"
echo " Startup notification support: $LIBSTARTUP_NOTIFICATION_FOUND"
echo " XSync support: $have_xsync"
echo " Render support: $have_render"
echo " Xrandr support: $have_xrandr"
echo " Xpresent support: $have_xpresent"
echo " Xi2 support: $have_xi2"
echo " Embedded compositor: $compositor"
echo " Epoxy support: $EPOXY_FOUND"
echo " Position window: $enable_poswin"
echo