-
Notifications
You must be signed in to change notification settings - Fork 22
/
configure.ac.in
660 lines (543 loc) · 20.2 KB
/
configure.ac.in
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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
dnl -*- mode: m4 -*-
AC_PREREQ(2.60)
LT_PREREQ([2.4])
AC_INIT([light-locker],
[1.9.0])
AC_CONFIG_SRCDIR(src/light-locker.c)
AM_INIT_AUTOMAKE([1.10 no-dist-gzip dist-bzip2 tar-ustar])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS(config.h)
AM_MAINTAINER_MODE([enable])
IT_PROG_INTLTOOL([0.35.0])
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_C_O
AC_STDC_HEADERS
AC_CANONICAL_HOST
AC_HEADER_STDC
AC_SUBST(VERSION)
# Save flags to aclocal
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
dnl ******************************
dnl *** Check for i18n support ***
dnl ******************************
dnl the next line will be removed if xdt is missing
XDT_I18N([@LINGUAS@])
GETTEXT_PACKAGE=light-locker
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain])
AM_GLIB_GNU_GETTEXT
GLIB_GSETTINGS
# Dependencies
DBUS_REQUIRED_VERSION=0.30
GLIB_REQUIRED_VERSION=2.44
GTK_REQUIRED_VERSION=3.0
X11_REQUIRED_VERSION=1.0
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(crypt.h sys/select.h)
AC_CHECK_FUNCS(select fcntl uname nice setpriority getcwd getwd putenv sbrk)
AC_CHECK_FUNCS(sigaction syslog realpath setrlimit)
AC_CHECK_FUNCS(getresuid)
AC_TYPE_UID_T
AC_CHECK_FUNCS([setresuid setenv unsetenv clearenv])
PKG_CHECK_MODULES(LIGHT_LOCKER,
x11 >= $X11_REQUIRED_VERSION
gtk+-3.0 >= $GTK_REQUIRED_VERSION
dbus-glib-1 >= $DBUS_REQUIRED_VERSION)
AC_SUBST(LIGHT_LOCKER_CFLAGS)
AC_SUBST(LIGHT_LOCKER_LIBS)
PKG_CHECK_MODULES(LIGHT_LOCKER_COMMAND,
gio-2.0 >= $GLIB_REQUIRED_VERSION
gobject-2.0 >= $GLIB_REQUIRED_VERSION)
AC_SUBST(LIGHT_LOCKER_COMMAND_CFLAGS)
AC_SUBST(LIGHT_LOCKER_COMMAND_LIBS)
AC_PATH_XTRA
ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS"
SAVER_LIBS="$ALL_X_LIBS"
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
# Optional dependencies for the theme engines
SAVER_MODULES="gthread-2.0 gtk+-3.0 >= $GTK_REQUIRED_VERSION"
PKG_CHECK_MODULES(LIGHT_LOCKER_SAVER, $SAVER_MODULES)
AC_SUBST(LIGHT_LOCKER_SAVER_CFLAGS)
AC_SUBST(LIGHT_LOCKER_SAVER_LIBS)
# Find out the version of DBUS we're using
dbus_version=`${PKG_CONFIG:-pkg-config} --modversion dbus-1`
DBUS_VERSION_MAJOR=`echo $dbus_version | awk -F. '{print $1}'`
DBUS_VERSION_MINOR=`echo $dbus_version | awk -F. '{print $2}'`
DBUS_VERSION_MICRO=`echo $dbus_version | awk -F. '{print $3}'`
if test "z$DBUS_VERSION_MAJOR" = "z"; then
DBUS_VERSION_MAJOR="0"
fi
if test "z$DBUS_VERSION_MINOR" = "z"; then
DBUS_VERSION_MINOR="0"
fi
if test "z$DBUS_VERSION_MICRO" = "z"; then
DBUS_VERSION_MICRO="0"
fi
if test "z$DBUS_VERSION_MAJOR" = "z0" -a "z$DBUS_VERSION_MINOR" = "z0" -a "z$DBUS_VERSION_MICRO" = "z0"; then echo "Error: Couldn't determine the version of your DBUS package."
echo " This is probably an error in this script, please report it"
echo " along with the following information:"
echo " Base DBUS version ='$dbus_version'"
echo " DBUS_VERSION_MAJOR='$DBUS_VERSION_MAJOR'"
echo " DBUS_VERSION_MINOR='$DBUS_VERSION_MINOR'"
echo " DBUS_VERSION_MICRO='$DBUS_VERSION_MICRO'"
exit 1
else
echo "Your dbus version is $DBUS_VERSION_MAJOR,$DBUS_VERSION_MINOR,$DBUS_VERSION_MICRO."
DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
AC_SUBST(DBUS_CFLAGS)
fi
dnl ---------------------------------------------------------------------------
dnl - Some utility functions to make checking for X things easier.
dnl ---------------------------------------------------------------------------
# Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
#
AC_DEFUN([AC_CHECK_X_HEADER], [
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
CPPFLAGS="$CPPFLAGS -I$includedir"
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_CHECK_HEADER([$1],[$2],[$3],[$4])
CPPFLAGS="$ac_save_CPPFLAGS"])
# Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
#
AC_DEFUN([AC_TRY_X_COMPILE], [
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
CPPFLAGS="$CPPFLAGS -I$includedir"
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_TRY_COMPILE([$1], [$2], [$3], [$4])
CPPFLAGS="$ac_save_CPPFLAGS"])
# Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
# Use this sparingly; it probably doesn't work very well on X programs.
#
AC_DEFUN([AC_CHECK_X_LIB], [
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
# ac_save_LIBS="$LIBS"
if test \! -z "$includedir" ; then
CPPFLAGS="$CPPFLAGS -I$includedir"
fi
# note: $X_CFLAGS includes $x_includes
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
if test \! -z "$libdir" ; then
LDFLAGS="$LDFLAGS -L$libdir"
fi
# note: $X_LIBS includes $x_libraries
LDFLAGS="$LDFLAGS $ALL_X_LIBS"
AC_CHECK_LIB([$1], [$2], [$3], [$4], [$5])
CPPFLAGS="$ac_save_CPPFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
# LIBS="$ac_save_LIBS"
])
# Usage: HANDLE_X_PATH_ARG([variable_name],
# [--command-line-option],
# [descriptive string])
#
# All of the --with options take three forms:
#
# --with-foo (or --with-foo=yes)
# --without-foo (or --with-foo=no)
# --with-foo=/DIR
#
# This function, HANDLE_X_PATH_ARG, deals with the /DIR case. When it sees
# a directory (string beginning with a slash) it checks to see whether
# /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
# as appropriate.
#
AC_DEFUN([HANDLE_X_PATH_ARG], [
case "$[$1]" in
yes) ;;
no) ;;
/*)
AC_MSG_CHECKING([for [$3] headers])
d=$[$1]/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
AC_MSG_RESULT($d)
else
AC_MSG_RESULT(not found ($d: no such directory))
fi
AC_MSG_CHECKING([for [$3] libs])
d=$[$1]/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
AC_MSG_RESULT($d)
else
AC_MSG_RESULT(not found ($d: no such directory))
fi
# replace the directory string with "yes".
[$1]_req="yes"
[$1]=$[$1]_req
;;
*)
echo ""
echo "error: argument to [$2] must be \"yes\", \"no\", or a directory."
echo " If it is a directory, then \`DIR/include' will be added to"
echo " the -I list, and \`DIR/lib' will be added to the -L list."
exit 1
;;
esac
])
dnl ---------------------------------------------------------------------------
dnl - Check for the MIT-SCREEN-SAVER server extension.
dnl ---------------------------------------------------------------------------
have_mit=no
with_mit_req=unspecified
AC_ARG_WITH(mit-ext,
[ --with-mit-ext Include support for the MIT-SCREEN-SAVER extension.],
[with_mit="$withval"; with_mit_req="$withval"],[with_mit=yes])
HANDLE_X_PATH_ARG(with_mit, --with-mit-ext, MIT-SCREEN-SAVER)
if test "$with_mit" = yes; then
AC_CHECK_X_HEADER(X11/extensions/scrnsaver.h, [have_mit=yes],,
[#include <X11/Xlib.h>])
# Now check to see if it's really in the library; XF86Free-3.3 ships
# scrnsaver.h, but doesn't include the code in libXext.a
if test "$have_mit" = yes; then
AC_CHECK_X_LIB(Xext, XScreenSaverRegister, [true], [have_mit=no], -lm)
if test "$have_mit" = no; then
# Looks like XF86Free-3.3 actually puts it in XExExt instead
# of in Xext.
AC_CHECK_X_LIB(XExExt, XScreenSaverRegister,
[have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
[true], -lX11 -lXext -lm)
fi
if test "$have_mit" = no; then
# Looks like some versions of XFree86 (whichever version
# it is that comes with RedHat Linux 2.0 -- I can't find a version
# number) put this in Xss instead of Xext.
AC_CHECK_X_LIB(Xss, XScreenSaverRegister,
[have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"],
[true], -lX11 -lXext -lm)
fi
if test "$have_mit" = yes; then
AC_DEFINE(HAVE_MIT_SAVER_EXTENSION, 1, [Define if the MIT screensaver extension is available])
fi
fi
elif test "$with_mit" != no; then
echo "error: must be yes or no: --with-mit-ext=$with_mit"
exit 1
fi
dnl ---------------------------------------------------------------------------
dnl - Check for the DPMS server extension.
dnl ---------------------------------------------------------------------------
have_dpms=no
with_dpms_req=unspecified
AC_ARG_WITH(dpms-ext,
[ --with-dpms-ext Include support for the DPMS extension.],
[with_dpms="$withval"; with_dmps_req="$withval"],[with_dpms=yes])
HANDLE_X_PATH_ARG(with_dpms, --with-dpms-ext, MIT-SCREEN-SAVER)
if test "$with_dpms" = yes; then
AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes],,
[#include <X11/Xlib.h>])
if test "$have_dpms" = yes; then
AC_CHECK_X_LIB(Xext, DPMSForceLevel, [true], [have_dpms=no], -lm)
if test "$have_dpms" = no; then
AC_CHECK_X_LIB(XExExt, DPMSForceLevel,
[have_dmps=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"],
[true], -lX11 -lXext -lm)
fi
if test "$have_dpms" = yes; then
AC_DEFINE(HAVE_DPMS_EXTENSION, 1, [Define if the DPMS extension is available])
fi
fi
elif test "$with_dpms" != no; then
echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
exit 1
fi
dnl ---------------------------------------------------------------------------
dnl - Check for the XF86VMODE server extension (for gamma fading.)
dnl ---------------------------------------------------------------------------
have_xf86vmode=no
have_xf86gamma=no
have_xf86gamma_ramp=no
with_xf86gamma_req=unspecified
AC_ARG_WITH(xf86gamma-ext,
[ --with-xf86gamma-ext Include support for XFree86 gamma fading.],
[with_xf86gamma="$withval"; with_xf86gamma_req="$withval"],
[with_xf86gamma=yes])
HANDLE_X_PATH_ARG(with_xf86gamma, --with-xf86gamma-ext, xf86gamma)
if test "$with_xf86gamma" = yes; then
# first check for xf86vmode.h, if we haven't already
if test "$have_xf86vmode" = yes; then
have_xf86gamma=yes
else
AC_CHECK_X_HEADER(X11/extensions/xf86vmode.h, [have_xf86gamma=yes],,
[#include <X11/Xlib.h>])
fi
# if that succeeded, then check for the -lXxf86vm
if test "$have_xf86gamma" = yes; then
have_xf86gamma=no
AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGamma,
[have_xf86gamma=yes],
[true], -lXext -lX11)
fi
# check for the Ramp versions of the functions too.
if test "$have_xf86gamma" = yes; then
have_xf86gamma_ramp=no
AC_CHECK_X_LIB(Xxf86vm, XF86VidModeSetGammaRamp,
[have_xf86gamma_ramp=yes],
[true], -lXext -lX11)
fi
# if those tests succeeded, then we've really got the functions.
if test "$have_xf86gamma" = yes; then
AC_DEFINE(HAVE_XF86VMODE_GAMMA, 1, [Define if XF86VMODE Gamma is available])
fi
if test "$have_xf86gamma_ramp" = yes; then
AC_DEFINE(HAVE_XF86VMODE_GAMMA_RAMP, 1, [Define if XF86VMODE Gamma Ramp is available])
fi
# pull in the lib, if we haven't already
if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
fi
elif test "$with_xf86gamma" != no; then
echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
exit 1
fi
dnl ---------------------------------------------------------------------------
dnl - Check for XF86MiscSetGrabKeysState (but only bother if we are already
dnl - using other XF86 stuff.)
dnl ---------------------------------------------------------------------------
have_xf86miscsetgrabkeysstate=no
if test "$have_xf86gamma" = yes -o "$have_xf86vmode" = yes; then
AC_CHECK_X_LIB(Xxf86misc, XF86MiscSetGrabKeysState,
[have_xf86miscsetgrabkeysstate=yes],
[true], -lXext -lX11)
if test "$have_xf86miscsetgrabkeysstate" = yes ; then
SAVER_LIBS="$SAVER_LIBS -lXxf86misc"
AC_DEFINE(HAVE_XF86MISCSETGRABKEYSSTATE, , [Define this if you have the XF86MiscSetGrabKeysState function])
fi
fi
dnl ---------------------------------------------------------------------------
dnl systemd
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(systemd,
AS_HELP_STRING([--with-systemd],
[Add systemd support]),
[with_systemd=$withval], [with_systemd=auto])
PKG_CHECK_MODULES(SYSTEMD,
[libsystemd],
[have_systemd=yes], [have_systemd=no])
if test "x$with_systemd" = "xauto" ; then
if test x$have_systemd = xno ; then
use_systemd=no
else
use_systemd=yes
fi
else
use_systemd=$with_systemd
fi
if test "x$use_systemd" = "xyes"; then
if test "x$have_systemd" = "xno"; then
AC_MSG_ERROR([Systemd support explicitly required, but systemd not found])
fi
AC_DEFINE(WITH_SYSTEMD, 1, [systemd support])
fi
AC_SUBST(SYSTEMD_CFLAGS)
AC_SUBST(SYSTEMD_LIBS)
dnl ---------------------------------------------------------------------------
dnl UPower
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(upower,
AS_HELP_STRING([--with-upower],
[Add UPower support]),,
with_upower=auto)
use_upower=no
if test "x$with_upower" != "xno" ; then
use_upower=yes
AC_DEFINE(WITH_UPOWER, 1, [UPower support])
fi
AM_CONDITIONAL(WITH_UPOWER, test x$use_upower = xyes)
AC_SUBST(WITH_UPOWER)
dnl ---------------------------------------------------------------------------
dnl Finish
dnl ---------------------------------------------------------------------------
AC_SUBST(SAVER_LIBS)
REAL_PREFIX=
if test "x$prefix" = "xNONE"; then
REAL_PREFIX=$ac_default_prefix
else
REAL_PREFIX=$prefix
fi
## temporarily change prefix and exec_prefix
old_prefix=$prefix
prefix=$REAL_PREFIX
if test "x$exec_prefix" = xNONE ; then
REAL_EXEC_PREFIX=$REAL_PREFIX
else
REAL_EXEC_PREFIX=$exec_prefix
fi
old_exec_prefix=$exec_prefix
exec_prefix=$REAL_EXEC_PREFIX
## eval everything
LOCALSTATEDIR_TMP="$localstatedir"
EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
AC_SUBST(EXPANDED_LOCALSTATEDIR)
SYSCONFDIR_TMP="$sysconfdir"
EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
AC_SUBST(EXPANDED_SYSCONFDIR)
BINDIR_TMP="$bindir"
EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
AC_SUBST(EXPANDED_BINDIR)
LIBDIR_TMP="$libdir"
EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
AC_SUBST(EXPANDED_LIBDIR)
DATADIR_TMP="$datadir"
EXPANDED_DATADIR=`eval echo $DATADIR_TMP`
AC_SUBST(EXPANDED_DATADIR)
## put prefix and exec_prefix back
prefix=$old_prefix
exec_prefix=$old_exec_prefix
dnl ---------------------------------------------------------------------------
dnl Features
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(late-locking, [AC_HELP_STRING([--enable-late-locking=[no/yes/on/off]], [Enable the --late-locking command option, on means this options is used by default])],, enable_late_locking=yes)
LATE_LOCKING_DEFAULT=false
with_late_locking_val=no
if test "x$have_mit" != "xyes"; then
enable_late_locking=no
else
case $enable_late_locking in
on) with_late_locking_val=TRUE ; LATE_LOCKING_DEFAULT=true ;;
off|yes) with_late_locking_val=FALSE ;;
esac
fi
if test "x$with_late_locking_val" != "xno"; then
AC_DEFINE_UNQUOTED(WITH_LATE_LOCKING, [$with_late_locking_val], [Late locking support, TRUE default on FALSE default off])
fi
AC_SUBST(LATE_LOCKING_DEFAULT)
AC_ARG_ENABLE(lock-on-suspend, [AC_HELP_STRING([--enable-lock-on-suspend=[no/yes/on/off]], [Enable the --lock-on-suspend command option, off means this options is not used by default])],, enable_lock_on_suspend=yes)
LOCK_ON_SUSPEND_DEFAULT=false
with_lock_on_suspend_val=no
case $enable_lock_on_suspend in
on|yes) with_lock_on_suspend_val=TRUE ; LOCK_ON_SUSPEND_DEFAULT=true ;;
off) with_lock_on_suspend_val=FALSE ;;
esac
if test "x$with_lock_on_suspend_val" != "xno"; then
AC_DEFINE_UNQUOTED(WITH_LOCK_ON_SUSPEND, [$with_lock_on_suspend_val], [Lock on suspend, TRUE default on FALSE default off])
fi
AC_SUBST(LOCK_ON_SUSPEND_DEFAULT)
AC_ARG_ENABLE(lock-on-lid, [AC_HELP_STRING([--enable-lock-on-lid=[no/yes/on/off]], [Enable the --lock-on-lid command option, on means this options is used by default])],, enable_lock_on_lid=yes)
LOCK_ON_LID_DEFAULT=false
with_lock_on_lid_val=no
if test "x$use_upower" != "xyes"; then
enable_lock_on_lid=no
else
case $enable_lock_on_lid in
on) with_lock_on_lid_val=TRUE ; LOCK_ON_LID_DEFAULT=true ;;
off|yes) with_lock_on_lid_val=FALSE ;;
esac
fi
if test "x$with_lock_on_lid_val" != "xno"; then
AC_DEFINE_UNQUOTED(WITH_LOCK_ON_LID, [$with_lock_on_lid_val], [Lock on lid, TRUE default on FALSE default off])
fi
AC_SUBST(LOCK_ON_LID_DEFAULT)
AC_ARG_ENABLE(settings-backend, [AC_HELP_STRING([--enable-settings-backend=[no/yes/gsettings]], [Make te command options persistend by storing the settings])],, enable_settings_backend=yes)
with_settings_backend=no
case $enable_settings_backend in
gsettings|yes) with_settings_backend=GSETTINGS ;;
esac
if test "x$with_settings_backend" != "xno"; then
AC_DEFINE_UNQUOTED(WITH_SETTINGS_BACKEND, [$with_settings_backend], [Persistent settings backend to store command options])
fi
# Turn on the additional warnings last, so -Werror doesn't affect other tests.
AC_ARG_ENABLE(more-warnings,
AC_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]),
set_more_warnings="$enableval",[
if test -d $srcdir/.git; then
is_cvs_version=true
set_more_warnings=yes
else
set_more_warnings=no
fi
])
AC_MSG_CHECKING(for more warnings)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
CFLAGS="\
-Wall \
-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
-Wnested-externs -Wpointer-arith \
-Wcast-align -Wsign-compare \
$CFLAGS"
for option in -Wno-strict-aliasing -Wno-sign-compare; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no,)
if test $has_option = no; then
CFLAGS="$SAVE_CFLAGS"
fi
AC_MSG_RESULT($has_option)
unset has_option
unset SAVE_CFLAGS
done
unset option
else
AC_MSG_RESULT(no)
fi
#
# Enable Debug
#
AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug=[no/yes]], [turn on debugging])],, enable_debug=yes)
if test "$enable_debug" = "yes"; then
DEBUG_CFLAGS="-DG_ENABLE_DEBUG"
else
if test "x$enable_debug" = "xno"; then
DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
else
DEBUG_CFLAGS=""
fi
fi
AC_SUBST(DEBUG_CFLAGS)
# Flags
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
# Files
AC_OUTPUT([
Makefile
po/Makefile.in
src/Makefile
data/Makefile
data/apps.light-locker.gschema.xml.in
])
echo "
light-locker $VERSION
==================
prefix: ${prefix}
exec_prefix: ${exec_prefix}
libdir: ${EXPANDED_LIBDIR}
bindir: ${EXPANDED_BINDIR}
sysconfdir: ${EXPANDED_SYSCONFDIR}
localstatedir: ${EXPANDED_LOCALSTATEDIR}
datadir: ${EXPANDED_DATADIR}
source code location: ${srcdir}
compiler: ${CC}
cflags: ${CFLAGS}
Base libs: ${LIGHT_LOCKER_LIBS}
Extension libs: ${SAVER_LIBS}
Maintainer mode: ${USE_MAINTAINER_MODE}
Platform:
---------
systemd: ${use_systemd}
UPower: ${use_upower}
Features:
---------
lock-after-screensaver: ${have_mit}
late-locking: ${enable_late_locking}
lock-on-suspend: ${enable_lock_on_suspend}
lock-on-lid: ${enable_lock_on_lid}
settings backend: ${with_settings_backend}
"
if test "x$have_pam" = "xyes" ; then
echo "\
PAM prefix: ${PAM_PREFIX}
"
fi