summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/CONTRIBUTING.md3
-rw-r--r--.github/ISSUE_TEMPLATE.md29
-rw-r--r--.gitignore33
-rw-r--r--CHANGELOG6
-rw-r--r--I3LOCK_VERSION1
-rw-r--r--INSTALL.md24
-rw-r--r--LICENSE2
-rw-r--r--Makefile.am61
-rw-r--r--README.md35
-rw-r--r--configure.ac155
-rw-r--r--extras.c2
-rw-r--r--i3lock-extended.12
-rw-r--r--i3lock.c47
-rw-r--r--include/cursors.h (renamed from cursors.h)0
-rw-r--r--include/dpi.h (renamed from dpi.h)0
-rw-r--r--include/extras.h (renamed from extras.h)2
-rw-r--r--include/i3lock.h (renamed from i3lock.h)0
-rw-r--r--include/randr.h (renamed from randr.h)0
-rw-r--r--include/unlock_indicator.h (renamed from unlock_indicator.h)0
-rw-r--r--include/xcb.h (renamed from xcb.h)0
-rw-r--r--m4/ax_append_flag.m471
-rw-r--r--m4/ax_cflags_warn_all.m4122
-rw-r--r--m4/ax_check_compile_flag.m474
-rw-r--r--m4/ax_check_enable_debug.m4124
-rw-r--r--m4/ax_check_gnu_make.m484
-rw-r--r--m4/ax_check_link_flag.m474
-rw-r--r--m4/ax_code_coverage.m4273
-rw-r--r--m4/ax_configure_args.m470
-rw-r--r--m4/ax_enable_builddir.m4302
-rw-r--r--m4/ax_extend_srcdir.m486
-rw-r--r--m4/ax_require_defined.m437
-rw-r--r--m4/ax_sanitizers.m4130
-rw-r--r--meson.build130
-rwxr-xr-xmeson/meson-dist-script11
-rw-r--r--meson_options.txt1
-rw-r--r--travis/Dockerfile4
-rw-r--r--unlock_indicator.c53
37 files changed, 249 insertions, 1799 deletions
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
deleted file mode 100644
index ab0456b..0000000
--- a/.github/CONTRIBUTING.md
+++ /dev/null
@@ -1,3 +0,0 @@
1Please do not send/request features related to image manipulation. i3lock’s
2support for background images is intentionally kept minimal, you should do all
3pre-processing in external tools.
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
deleted file mode 100644
index 591fdfe..0000000
--- a/.github/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,29 +0,0 @@
1<!--
2PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.
3-->
4
5## I'm submitting a…
6<!-- Please check one of the following options with "x" -->
7<pre>
8[ ] Bug
9[ ] Feature Request
10[ ] Other (Please describe in detail)
11</pre>
12
13## Current Behavior
14<!-- Describe the current behavior -->
15
16## Expected Behavior
17<!-- Describe the desired behavior you expect after mitigation of the issue -->
18
19## Reproduction Instructions
20<!--
21For bug reports, please provide detailed instructions on how the bug can be reproduced.
22For feature requests, you can remove this section.
23-->
24
25## Environment
26Output of `i3lock --version`:
27<pre>
28i3lock version:
29</pre>
diff --git a/.gitignore b/.gitignore
index eb37b56..bc9fbfb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,31 +1,10 @@
1/i3lock 1/i3lock-extended
2*.o 2*.o
3tags 3tags
4*.swp 4*.swp
5 5
6################################################################################ 6# We recommend building in a subdirectory called build.
7# https://raw.githubusercontent.com/github/gitignore/master/Autotools.gitignore 7# If you chose a different directory name,
8################################################################################ 8# it is up to you to arrange for it to be ignored by git,
9 9# e.g. by listing your directory in .git/info/exclude.
10# http://www.gnu.org/software/automake 10/build
11
12Makefile.in
13/ar-lib
14/test-driver
15
16# http://www.gnu.org/software/autoconf
17
18/autom4te.cache
19/autoscan.log
20/autoscan-*.log
21/aclocal.m4
22/compile
23/config.h.in
24/config.guess
25/config.sub
26/configure
27/configure.scan
28/depcomp
29/install-sh
30/missing
31/stamp-h1
diff --git a/CHANGELOG b/CHANGELOG
index b9bd8ad..126cf58 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
12023-03-18 i3lock-extended 2.2.14
2
3 • Fetch and sync with i3lock 2.14.1
4 • Update README.md
5
6
12020-12-29 i3lock-extended 2.2.13a 72020-12-29 i3lock-extended 2.2.13a
2 8
3 • Fix and sort the help (-h) string 9 • Fix and sort the help (-h) string
diff --git a/I3LOCK_VERSION b/I3LOCK_VERSION
deleted file mode 100644
index 7ea8f83..0000000
--- a/I3LOCK_VERSION
+++ /dev/null
@@ -1 +0,0 @@
12.2.13a
diff --git a/INSTALL.md b/INSTALL.md
index cb2cde9..1c726b5 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,6 +1,6 @@
1i3lock - improved screen locker 1i3lock - improved screen locker
2=============================== 2===============================
3[i3lock](https://i3wm.org/i3lock/)> is a simple screen locker like slock. 3[i3lock](https://i3wm.org/i3lock/) is a simple screen locker like slock.
4After starting it, you will see a white screen (you can configure the 4After starting it, you will see a white screen (you can configure the
5color/an image). You can return to your screen by entering your password. 5color/an image). You can return to your screen by entering your password.
6 6
@@ -44,8 +44,16 @@ Requirements
44 44
45Running i3lock 45Running i3lock
46------------- 46-------------
47Simply invoke the 'i3lock' command. To get out of it, enter your password and 47
48press enter. 48To test i3lock, you can directly run the `i3lock` command. To get out of it,
49enter your password and press enter.
50
51For a more permanent setup, we strongly recommend using `xss-lock` so that the
52screen is locked *before* your laptop suspends:
53
54```
55xss-lock --transfer-sleep-lock -- i3lock --nofork
56```
49 57
50On OpenBSD the `i3lock` binary needs to be setgid `auth` to call the 58On OpenBSD the `i3lock` binary needs to be setgid `auth` to call the
51authentication helpers, e.g. `/usr/libexec/auth/login_passwd`. 59authentication helpers, e.g. `/usr/libexec/auth/login_passwd`.
@@ -58,17 +66,11 @@ i3lock unless you have a reason to do so.
58First install the dependencies listed in requirements section, then run these 66First install the dependencies listed in requirements section, then run these
59commands (might need to be adapted to your OS): 67commands (might need to be adapted to your OS):
60``` 68```
61autoreconf --force --install
62
63rm -rf build/ 69rm -rf build/
64mkdir -p build && cd build/ 70mkdir -p build && cd build/
65 71
66../configure \ 72meson .. -Dprefix=/usr
67 --prefix=/usr \ 73ninja
68 --sysconfdir=/etc \
69 --disable-sanitizers
70
71make
72``` 74```
73 75
74Upstream 76Upstream
diff --git a/LICENSE b/LICENSE
index 756d014..8b98561 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
1i3lock-extended 1i3lock-extended
2Copyright (C) 2020 Simeon Simeonov 2Copyright (C) 2020-2023 Simeon Simeonov
3 3
4This program is free software: you can redistribute it and/or modify 4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 5it under the terms of the GNU General Public License as published by
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index f9323b8..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,61 +0,0 @@
1@CODE_COVERAGE_RULES@
2
3echo-version:
4 @echo "@I3LOCK_VERSION@"
5
6bin_PROGRAMS = i3lock-extended
7
8dist_man1_MANS = i3lock-extended.1
9
10pamddir = $(sysconfdir)/pam.d
11pamd_files = pam/i3lock-extended
12pamd_DATA = $(pamd_files)
13
14AM_CPPFLAGS = \
15 @AX_EXTEND_SRCDIR_CPPFLAGS@
16
17i3lock_extended_CFLAGS = \
18 $(AM_CFLAGS) \
19 $(XCB_CFLAGS) \
20 $(XCB_IMAGE_CFLAGS) \
21 $(XCB_UTIL_CFLAGS) \
22 $(XCB_UTIL_XRM_CFLAGS) \
23 $(XKBCOMMON_CFLAGS) \
24 $(CAIRO_CFLAGS) \
25 -DEXTRAS \
26 $(CODE_COVERAGE_CFLAGS)
27
28i3lock_extended_CPPFLAGS = \
29 $(AM_CPPFLAGS) \
30 $(CODE_COVERAGE_CPPFLAGS)
31
32i3lock_extended_LDADD = \
33 $(XCB_LIBS) \
34 $(XCB_IMAGE_LIBS) \
35 $(XCB_UTIL_LIBS) \
36 $(XCB_UTIL_XRM_LIBS) \
37 $(XKBCOMMON_LIBS) \
38 $(CAIRO_LIBS) \
39 $(CODE_COVERAGE_LDFLAGS)
40
41i3lock_extended_SOURCES = \
42 cursors.h \
43 dpi.c \
44 dpi.h \
45 extras.c \
46 extras.h \
47 i3lock.c \
48 i3lock.h \
49 randr.c \
50 randr.h \
51 unlock_indicator.c \
52 unlock_indicator.h \
53 xcb.c \
54 xcb.h
55
56EXTRA_DIST = \
57 $(pamd_files) \
58 CHANGELOG \
59 LICENSE \
60 README.md \
61 I3LOCK_VERSION
diff --git a/README.md b/README.md
index 80b6ac1..9ea58fe 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
1# i3lock-extended 1# i3lock-extended
2 2
3i3lock-extended is a fork of i3lock (https://github.com/i3/i3lock). 3i3lock-extended is a fork of i3lock (https://github.com/i3/i3lock).
4It was started by Simeon Simeonov (sgs @ Freenode) as a small hack, 4It was started by Simeon Simeonov (sgs @ LiberaChat) as a small hack,
5implementing a LED-clock on top of an existing and robust screensaver. 5implementing a LED-clock on top of an existing and robust screensaver.
6 6
7i3lock-extended adds some additional functionality and is a free-software 7i3lock-extended adds some additional functionality and is a free-software
@@ -40,7 +40,9 @@ extended revision if used].
40### Gentoo 40### Gentoo
41 41
42 ```bash 42 ```bash
43 layman -a sgs 43 # add sgs' custom repository using app-eselect/eselect-repository
44 eselect repository add sgs
45
44 emerge x11-misc/i3lock-extended 46 emerge x11-misc/i3lock-extended
45 ``` 47 ```
46 48
@@ -58,25 +60,26 @@ Install the package:
58 ``` 60 ```
59 61
60 62
61### From source 63### From source (meson > 0.55.0)
62 64
63 ```bash 65 ```bash
64 wget https://simeon.simeonov.no/programs/i3lock_extended/downloads/i3lock-extended-<version>.tar.xz 66 wget https://github.com/blackm0re/i3lock_extended/releases/download/<version>/i3lock-extended-<version>.tar.xz
65 tar Jxvf i3lock-extended-<version>.tar.xz && cd i3lock-extended-<version> 67 tar Jxvf i3lock-extended-<version>.tar.xz
66 ./configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers 68 cd i3lock-extended-<version>
67 make 69 meson setup build --prefix=/usr
68 make install 70 meson compile -C build
71 sudo meson install -C build
69 ``` 72 ```
70 73
71 74
72### From git 75### From git (meson > 0.55.0)
73 76
74 ```bash 77 ```bash
75 git clone https://github.com/blackm0re/i3lock-extended.git && cd i3lock-extended 78 git clone https://github.com/blackm0re/i3lock-extended.git
76 autoreconf --force --install 79 cd i3lock-extended
77 ./configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers 80 meson setup build --prefix=/usr
78 make 81 meson compile -C build
79 make install 82 sudo meson install -C build
80 ``` 83 ```
81 84
82 85
@@ -112,12 +115,12 @@ i3lock-extended is hosted on GitHub: https://github.com/blackm0re/i3lock-extende
112 115
113## Author 116## Author
114 117
115Simeon Simeonov - sgs @ Freenode 118Simeon Simeonov - sgs @ LiberaChat
116 119
117 120
118## [License](https://github.com/blackm0re/i3lock-extended/blob/master/LICENSE) 121## [License](https://github.com/blackm0re/i3lock-extended/blob/master/LICENSE)
119 122
120Copyright 2020 Simeon Simeonov 123Copyright 2020-2023 Simeon Simeonov
121 124
122Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html 125Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html
123 126
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index d7c4f04..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,155 +0,0 @@
1# -*- Autoconf -*-
2# Run autoreconf -fi to generate a configure script from this file.
3
4AC_PREREQ([2.69])
5AC_INIT([i3lock-extended], [2.2.13a], [https://simeon.simeonov.no])
6# For AX_EXTEND_SRCDIR
7AX_ENABLE_BUILDDIR
8AM_INIT_AUTOMAKE([foreign subdir-objects -Wall no-dist-gzip dist-bzip2])
9# Default to silent rules, use V=1 to get verbose compilation output.
10AM_SILENT_RULES([yes])
11# Make it possible to disable maintainer mode to disable re-generation of build
12# system files.
13AM_MAINTAINER_MODE([enable])
14AC_CONFIG_SRCDIR([i3lock.c])
15AC_CONFIG_HEADERS([config.h])
16AC_CONFIG_MACRO_DIR([m4])
17
18dnl Verify macros defined in m4/ such as AX_SANITIZERS are not present in the
19dnl output, i.e. are replaced as expected. This line results in a better error
20dnl message when using aclocal < 1.13 (which does not understand
21dnl AC_CONFIG_MACRO_DIR) without passing the -I m4 parameter.
22m4_pattern_forbid([AX_SANITIZERS])
23
24# Verify we are using GNU make because we use '%'-style pattern rules in
25# Makefile.am, which are a GNU make extension. Pull requests to replace
26# '%'-style pattern rules with a more portable alternative are welcome.
27AX_CHECK_GNU_MAKE
28AS_VAR_IF([_cv_gnu_make_command], [""], [AC_MSG_ERROR([the i3lock Makefile.am requires GNU make])])
29
30AX_EXTEND_SRCDIR
31
32AS_IF([test -d ${srcdir}/.git],
33 [
34 VERSION="$(git -C ${srcdir} describe --tags --abbrev=0)"
35 I3LOCK_VERSION="$(git -C ${srcdir} describe --tags --always) ($(git -C ${srcdir} log --pretty=format:%cd --date=short -n1), branch \\\"$(git -C ${srcdir} describe --tags --always --all | sed s:heads/::)\\\")"
36 # Mirrors what libi3/is_debug_build.c does:
37 is_release=$(test $(echo "${I3LOCK_VERSION}" | cut -d '(' -f 1 | wc -m) -lt 10 && echo yes || echo no)
38 ],
39 [
40 VERSION="$(cut -d '-' -f 1 ${srcdir}/I3LOCK_VERSION | cut -d ' ' -f 1)"
41 I3LOCK_VERSION="$(sed -e 's/@<:@\"?\\@:>@/\\&/g' ${srcdir}/I3LOCK_VERSION)"
42 is_release="$(grep -q non-git ${srcdir}/I3LOCK_VERSION && echo no || echo yes)"
43 ])
44AC_SUBST([I3LOCK_VERSION], [$I3LOCK_VERSION])
45AC_DEFINE_UNQUOTED([I3LOCK_VERSION], ["${I3LOCK_VERSION}"], [i3lock version])
46
47AX_CODE_COVERAGE
48
49dnl is_release must be lowercase because AX_CHECK_ENABLE_DEBUG calls m4_tolower
50dnl on its fourth argument.
51AX_CHECK_ENABLE_DEBUG([yes], , [UNUSED_NDEBUG], [$is_release])
52
53AC_PROG_CC_C99
54
55# For strnlen() and vasprintf().
56AC_USE_SYSTEM_EXTENSIONS
57
58# Checks for typedefs, structures, and compiler characteristics.
59AC_CHECK_HEADER_STDBOOL
60dnl The error message should include the specific type which could not be
61dnl found, but I do not see a way to achieve that.
62AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t], , [AC_MSG_FAILURE([cannot find required type])])
63
64# Checks for library functions.
65AC_FUNC_FORK
66AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
67AC_FUNC_STRNLEN
68AC_CHECK_FUNCS([atexit dup2 ftruncate getcwd gettimeofday localtime_r memchr memset mkdir rmdir setlocale socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr strtol strtoul], , [AC_MSG_FAILURE([cannot find the $ac_func function, which i3lock requires])])
69AC_CHECK_FUNCS([explicit_bzero])
70
71# Checks for libraries.
72
73AC_SEARCH_LIBS([floor], [m], , [AC_MSG_FAILURE([cannot find the required floor() function despite trying to link with -lm])])
74
75# libev does not ship with a pkg-config file :(.
76AC_SEARCH_LIBS([ev_run], [ev], , [AC_MSG_FAILURE([cannot find the required ev_run() function despite trying to link with -lev])])
77
78AC_SEARCH_LIBS([shm_open], [rt])
79
80# Only disable PAM on OpenBSD where i3lock uses BSD Auth instead
81case "$host" in
82 *-openbsd*)
83 # Nothing yet.
84 ;;
85 *)
86 AC_SEARCH_LIBS([pam_authenticate], [pam])
87 ;;
88esac
89
90AC_SEARCH_LIBS([iconv_open], [iconv], , [AC_MSG_FAILURE([cannot find the required iconv_open() function despite trying to link with -liconv])])
91
92dnl Each prefix corresponds to a source tarball which users might have
93dnl downloaded in a newer version and would like to overwrite.
94PKG_CHECK_MODULES([XCB], [xcb xcb-xkb xcb-xinerama xcb-randr])
95PKG_CHECK_MODULES([XCB_IMAGE], [xcb-image])
96PKG_CHECK_MODULES([XCB_UTIL], [xcb-event xcb-util xcb-atom])
97PKG_CHECK_MODULES([XCB_UTIL_XRM], [xcb-xrm])
98PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon xkbcommon-x11])
99PKG_CHECK_MODULES([CAIRO], [cairo])
100
101# Checks for programs.
102AC_PROG_AWK
103AC_PROG_CPP
104AC_PROG_INSTALL
105AC_PROG_MAKE_SET
106AC_PROG_RANLIB
107AC_PROG_LN_S
108
109AM_PROG_AR
110
111AX_FLAGS_WARN_ALL
112AX_CHECK_COMPILE_FLAG([-Wunused-value], [AX_APPEND_FLAG([-Wunused-value], [AM_CFLAGS])])
113AC_SUBST(AM_CFLAGS)
114
115# Checks for header files.
116AC_CHECK_HEADERS([fcntl.h float.h inttypes.h limits.h locale.h netinet/in.h paths.h stddef.h stdint.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h], , [AC_MSG_FAILURE([cannot find the $ac_header header, which i3lock requires])])
117
118AC_CONFIG_FILES([Makefile])
119
120# Enable address sanitizer for non-release builds. The performance hit is a
121# 50% increase of wallclock time for the testsuite on my machine.
122if test x$is_release = xyes; then
123 default_sanitizers=
124else
125 default_sanitizers=address
126fi
127AX_SANITIZERS(, [$default_sanitizers], [AC_DEFINE([I3LOCK_ASAN_ENABLED], [], [Enable ASAN])])
128
129AC_OUTPUT
130
131in_git_worktree=`git rev-parse --is-inside-work-tree 2>/dev/null`
132if [[ "$in_git_worktree" = "true" ]]; then
133 git_dir=`git rev-parse --git-dir 2>/dev/null`
134 srcdir=`dirname "$git_dir"`
135 exclude_dir=`pwd | sed "s,^$srcdir,,g"`
136 if ! grep -q "^$exclude_dir" "$git_dir/info/exclude"; then
137 echo "$exclude_dir" >> "$git_dir/info/exclude"
138 fi
139fi
140
141echo \
142"--------------------------------------------------------------------------------
143build configured:
144
145AS_HELP_STRING([i3lock-extended version:], [`echo ${I3LOCK_VERSION} | sed 's,\\\\,,g'`])
146AS_HELP_STRING([is release version:], [${is_release}])
147
148AS_HELP_STRING([enable debug flags:], [${ax_enable_debug}])
149AS_HELP_STRING([code coverage:], [${CODE_COVERAGE_ENABLED}])
150AS_HELP_STRING([enabled sanitizers:], [${ax_enabled_sanitizers}])
151
152To compile, run:
153
154 cd `pwd` && make -j8
155--------------------------------------------------------------------------------"
diff --git a/extras.c b/extras.c
index fa78c86..4e321ff 100644
--- a/extras.c
+++ b/extras.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * This file is part of i3lock-extended 2 * This file is part of i3lock-extended
3 * Copyright (C) 2020 Simeon Simeonov 3 * Copyright (C) 2020-2023 Simeon Simeonov
4 4
5 * i3lock-extended is free software: you can redistribute it and/or modify 5 * i3lock-extended is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
diff --git a/i3lock-extended.1 b/i3lock-extended.1
index ee97c45..dbac52a 100644
--- a/i3lock-extended.1
+++ b/i3lock-extended.1
@@ -8,7 +8,7 @@
8.fi 8.fi
9.. 9..
10 10
11.TH i3lock\-extended 1 "DECEMBER 2020" Linux "User Manuals" 11.TH i3lock\-extended 1 "MARCH 2023" Linux "User Manuals"
12 12
13.SH NAME 13.SH NAME
14i3lock\-extended \- improved screen locker 14i3lock\-extended \- improved screen locker
diff --git a/i3lock.c b/i3lock.c
index 48edddb..aee9b2a 100644
--- a/i3lock.c
+++ b/i3lock.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * This file is part of i3lock-extended 2 * This file is part of i3lock-extended
3 * Copyright (C) 2020 Simeon Simeonov 3 * Copyright (C) 2020-2023 Simeon Simeonov
4 4
5 * i3lock-extended is free software: you can redistribute it and/or modify 5 * i3lock-extended is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -106,7 +106,7 @@ i3lock_led_clock_t i3lock_led_clock = {"ffff00",
106char *display_text = NULL; 106char *display_text = NULL;
107#endif 107#endif
108 108
109char color[7] = "ffffff"; 109char color[7] = "a3a3a3";
110uint32_t last_resolution[2]; 110uint32_t last_resolution[2];
111xcb_window_t win; 111xcb_window_t win;
112static xcb_cursor_t cursor; 112static xcb_cursor_t cursor;
@@ -132,9 +132,9 @@ int failed_attempts = 0;
132bool show_failed_attempts = false; 132bool show_failed_attempts = false;
133bool retry_verification = false; 133bool retry_verification = false;
134 134
135static struct xkb_state *xkb_state; 135struct xkb_state *xkb_state;
136static struct xkb_context *xkb_context; 136static struct xkb_context *xkb_context;
137static struct xkb_keymap *xkb_keymap; 137struct xkb_keymap *xkb_keymap;
138static struct xkb_compose_table *xkb_compose_table; 138static struct xkb_compose_table *xkb_compose_table;
139static struct xkb_compose_state *xkb_compose_state; 139static struct xkb_compose_state *xkb_compose_state;
140static uint8_t xkb_base_event; 140static uint8_t xkb_base_event;
@@ -360,41 +360,6 @@ static void input_done(void) {
360 if (debug_mode) 360 if (debug_mode)
361 fprintf(stderr, "Authentication failure\n"); 361 fprintf(stderr, "Authentication failure\n");
362 362
363 /* Get state of Caps and Num lock modifiers, to be displayed in
364 * STATE_AUTH_WRONG state */
365 xkb_mod_index_t idx, num_mods;
366 const char *mod_name;
367
368 num_mods = xkb_keymap_num_mods(xkb_keymap);
369
370 for (idx = 0; idx < num_mods; idx++) {
371 if (!xkb_state_mod_index_is_active(xkb_state, idx, XKB_STATE_MODS_EFFECTIVE))
372 continue;
373
374 mod_name = xkb_keymap_mod_get_name(xkb_keymap, idx);
375 if (mod_name == NULL)
376 continue;
377
378 /* Replace certain xkb names with nicer, human-readable ones. */
379 if (strcmp(mod_name, XKB_MOD_NAME_CAPS) == 0)
380 mod_name = "Caps Lock";
381 else if (strcmp(mod_name, XKB_MOD_NAME_ALT) == 0)
382 mod_name = "Alt";
383 else if (strcmp(mod_name, XKB_MOD_NAME_NUM) == 0)
384 mod_name = "Num Lock";
385 else if (strcmp(mod_name, XKB_MOD_NAME_LOGO) == 0)
386 mod_name = "Super";
387
388 char *tmp;
389 if (modifier_string == NULL) {
390 if (asprintf(&tmp, "%s", mod_name) != -1)
391 modifier_string = tmp;
392 } else if (asprintf(&tmp, "%s, %s", modifier_string, mod_name) != -1) {
393 free(modifier_string);
394 modifier_string = tmp;
395 }
396 }
397
398 auth_state = STATE_AUTH_WRONG; 363 auth_state = STATE_AUTH_WRONG;
399 failed_attempts += 1; 364 failed_attempts += 1;
400 clear_input(); 365 clear_input();
@@ -459,7 +424,7 @@ static void handle_key_press(xcb_key_press_event_t *event) {
459 return; 424 return;
460 case XKB_COMPOSE_COMPOSED: 425 case XKB_COMPOSE_COMPOSED:
461 /* xkb_compose_state_get_utf8 doesn't include the terminating byte in the return value 426 /* xkb_compose_state_get_utf8 doesn't include the terminating byte in the return value
462 * as xkb_keysym_to_utf8 does. Adding one makes the variable n consistent. */ 427 * as xkb_keysym_to_utf8 does. Adding one makes the variable n consistent. */
463 n = xkb_compose_state_get_utf8(xkb_compose_state, buffer, sizeof(buffer)) + 1; 428 n = xkb_compose_state_get_utf8(xkb_compose_state, buffer, sizeof(buffer)) + 1;
464 ksym = xkb_compose_state_get_one_sym(xkb_compose_state); 429 ksym = xkb_compose_state_get_one_sym(xkb_compose_state);
465 composed = true; 430 composed = true;
@@ -1131,7 +1096,7 @@ int main(int argc, char *argv[]) {
1131 while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) { 1096 while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) {
1132 switch (o) { 1097 switch (o) {
1133 case 'v': 1098 case 'v':
1134 errx(EXIT_SUCCESS, "version " I3LOCK_VERSION " © 2010 Michael Stapelberg, 2017-2020 Simeon Simeonov"); 1099 errx(EXIT_SUCCESS, "version " I3LOCK_VERSION " © 2010 Michael Stapelberg, 2020-2023 Simeon Simeonov");
1135 case 'n': 1100 case 'n':
1136 dont_fork = true; 1101 dont_fork = true;
1137 break; 1102 break;
diff --git a/cursors.h b/include/cursors.h
index bfce895..bfce895 100644
--- a/cursors.h
+++ b/include/cursors.h
diff --git a/dpi.h b/include/dpi.h
index 35840d2..35840d2 100644
--- a/dpi.h
+++ b/include/dpi.h
diff --git a/extras.h b/include/extras.h
index c78ffff..4f791d8 100644
--- a/extras.h
+++ b/include/extras.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * This file is part of i3lock-extended 2 * This file is part of i3lock-extended
3 * Copyright (C) 2020 Simeon Simeonov 3 * Copyright (C) 2020-2023 Simeon Simeonov
4 4
5 * i3lock-extended is free software: you can redistribute it and/or modify 5 * i3lock-extended is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
diff --git a/i3lock.h b/include/i3lock.h
index 6cf7694..6cf7694 100644
--- a/i3lock.h
+++ b/include/i3lock.h
diff --git a/randr.h b/include/randr.h
index 510a7cb..510a7cb 100644
--- a/randr.h
+++ b/include/randr.h
diff --git a/unlock_indicator.h b/include/unlock_indicator.h
index 581d028..581d028 100644
--- a/unlock_indicator.h
+++ b/include/unlock_indicator.h
diff --git a/xcb.h b/include/xcb.h
index 3555c58..3555c58 100644
--- a/xcb.h
+++ b/include/xcb.h
diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4
deleted file mode 100644
index 08f2e07..0000000
--- a/m4/ax_append_flag.m4
+++ /dev/null
@@ -1,71 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
8#
9# DESCRIPTION
10#
11# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
12# added in between.
13#
14# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
15# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
16# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
17# FLAG.
18#
19# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
20#
21# LICENSE
22#
23# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
24# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
25#
26# This program is free software: you can redistribute it and/or modify it
27# under the terms of the GNU General Public License as published by the
28# Free Software Foundation, either version 3 of the License, or (at your
29# option) any later version.
30#
31# This program is distributed in the hope that it will be useful, but
32# WITHOUT ANY WARRANTY; without even the implied warranty of
33# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
34# Public License for more details.
35#
36# You should have received a copy of the GNU General Public License along
37# with this program. If not, see <http://www.gnu.org/licenses/>.
38#
39# As a special exception, the respective Autoconf Macro's copyright owner
40# gives unlimited permission to copy, distribute and modify the configure
41# scripts that are the output of Autoconf when processing the Macro. You
42# need not follow the terms of the GNU General Public License when using
43# or distributing such scripts, even though portions of the text of the
44# Macro appear in them. The GNU General Public License (GPL) does govern
45# all other use of the material that constitutes the Autoconf Macro.
46#
47# This special exception to the GPL applies to versions of the Autoconf
48# Macro released by the Autoconf Archive. When you make and distribute a
49# modified version of the Autoconf Macro, you may extend this special
50# exception to the GPL to apply to your modified version as well.
51
52#serial 6
53
54AC_DEFUN([AX_APPEND_FLAG],
55[dnl
56AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
57AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
58AS_VAR_SET_IF(FLAGS,[
59 AS_CASE([" AS_VAR_GET(FLAGS) "],
60 [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
61 [
62 AS_VAR_APPEND(FLAGS,[" $1"])
63 AC_RUN_LOG([: FLAGS="$FLAGS"])
64 ])
65 ],
66 [
67 AS_VAR_SET(FLAGS,[$1])
68 AC_RUN_LOG([: FLAGS="$FLAGS"])
69 ])
70AS_VAR_POPDEF([FLAGS])dnl
71])dnl AX_APPEND_FLAG
diff --git a/m4/ax_cflags_warn_all.m4 b/m4/ax_cflags_warn_all.m4
deleted file mode 100644
index 1f07799..0000000
--- a/m4/ax_cflags_warn_all.m4
+++ /dev/null
@@ -1,122 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
8# AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
9# AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
10#
11# DESCRIPTION
12#
13# Try to find a compiler option that enables most reasonable warnings.
14#
15# For the GNU compiler it will be -Wall (and -ansi -pedantic) The result
16# is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default.
17#
18# Currently this macro knows about the GCC, Solaris, Digital Unix, AIX,
19# HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and
20# Intel compilers. For a given compiler, the Fortran flags are much more
21# experimental than their C equivalents.
22#
23# - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS
24# - $2 add-value-if-not-found : nothing
25# - $3 action-if-found : add value to shellvariable
26# - $4 action-if-not-found : nothing
27#
28# NOTE: These macros depend on AX_APPEND_FLAG.
29#
30# LICENSE
31#
32# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
33# Copyright (c) 2010 Rhys Ulerich <rhys.ulerich@gmail.com>
34#
35# This program is free software; you can redistribute it and/or modify it
36# under the terms of the GNU General Public License as published by the
37# Free Software Foundation; either version 3 of the License, or (at your
38# option) any later version.
39#
40# This program is distributed in the hope that it will be useful, but
41# WITHOUT ANY WARRANTY; without even the implied warranty of
42# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
43# Public License for more details.
44#
45# You should have received a copy of the GNU General Public License along
46# with this program. If not, see <http://www.gnu.org/licenses/>.
47#
48# As a special exception, the respective Autoconf Macro's copyright owner
49# gives unlimited permission to copy, distribute and modify the configure
50# scripts that are the output of Autoconf when processing the Macro. You
51# need not follow the terms of the GNU General Public License when using
52# or distributing such scripts, even though portions of the text of the
53# Macro appear in them. The GNU General Public License (GPL) does govern
54# all other use of the material that constitutes the Autoconf Macro.
55#
56# This special exception to the GPL applies to versions of the Autoconf
57# Macro released by the Autoconf Archive. When you make and distribute a
58# modified version of the Autoconf Macro, you may extend this special
59# exception to the GPL to apply to your modified version as well.
60
61#serial 15
62
63AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl
64AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
65AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl
66AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
67VAR,[VAR="no, unknown"
68ac_save_[]FLAGS="$[]FLAGS"
69for ac_arg dnl
70in "-warn all % -warn all" dnl Intel
71 "-pedantic % -Wall" dnl GCC
72 "-xstrconst % -v" dnl Solaris C
73 "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
74 "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
75 "-ansi -ansiE % -fullwarn" dnl IRIX
76 "+ESlit % +w1" dnl HP-UX C
77 "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
78 "-h conform % -h msglevel 2" dnl Cray C (Unicos)
79 #
80do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
81 AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
82 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
83done
84FLAGS="$ac_save_[]FLAGS"
85])
86AS_VAR_POPDEF([FLAGS])dnl
87AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
88case ".$VAR" in
89 .ok|.ok,*) m4_ifvaln($3,$3) ;;
90 .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;;
91 *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;;
92esac
93AS_VAR_POPDEF([VAR])dnl
94])dnl AX_FLAGS_WARN_ALL
95dnl implementation tactics:
96dnl the for-argument contains a list of options. The first part of
97dnl these does only exist to detect the compiler - usually it is
98dnl a global option to enable -ansi or -extrawarnings. All other
99dnl compilers will fail about it. That was needed since a lot of
100dnl compilers will give false positives for some option-syntax
101dnl like -Woption or -Xoption as they think of it is a pass-through
102dnl to later compile stages or something. The "%" is used as a
103dnl delimiter. A non-option comment can be given after "%%" marks
104dnl which will be shown but not added to the respective C/CXXFLAGS.
105
106AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
107AC_LANG_PUSH([C])
108AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
109AC_LANG_POP([C])
110])
111
112AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
113AC_LANG_PUSH([C++])
114AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
115AC_LANG_POP([C++])
116])
117
118AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
119AC_LANG_PUSH([Fortran])
120AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
121AC_LANG_POP([Fortran])
122])
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
deleted file mode 100644
index ca36397..0000000
--- a/m4/ax_check_compile_flag.m4
+++ /dev/null
@@ -1,74 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
8#
9# DESCRIPTION
10#
11# Check whether the given FLAG works with the current language's compiler
12# or gives an error. (Warnings, however, are ignored)
13#
14# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
15# success/failure.
16#
17# If EXTRA-FLAGS is defined, it is added to the current language's default
18# flags (e.g. CFLAGS) when the check is done. The check is thus made with
19# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
20# force the compiler to issue an error when a bad flag is given.
21#
22# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
23#
24# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
25# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
26#
27# LICENSE
28#
29# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
30# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
31#
32# This program is free software: you can redistribute it and/or modify it
33# under the terms of the GNU General Public License as published by the
34# Free Software Foundation, either version 3 of the License, or (at your
35# option) any later version.
36#
37# This program is distributed in the hope that it will be useful, but
38# WITHOUT ANY WARRANTY; without even the implied warranty of
39# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
40# Public License for more details.
41#
42# You should have received a copy of the GNU General Public License along
43# with this program. If not, see <http://www.gnu.org/licenses/>.
44#
45# As a special exception, the respective Autoconf Macro's copyright owner
46# gives unlimited permission to copy, distribute and modify the configure
47# scripts that are the output of Autoconf when processing the Macro. You
48# need not follow the terms of the GNU General Public License when using
49# or distributing such scripts, even though portions of the text of the
50# Macro appear in them. The GNU General Public License (GPL) does govern
51# all other use of the material that constitutes the Autoconf Macro.
52#
53# This special exception to the GPL applies to versions of the Autoconf
54# Macro released by the Autoconf Archive. When you make and distribute a
55# modified version of the Autoconf Macro, you may extend this special
56# exception to the GPL to apply to your modified version as well.
57
58#serial 4
59
60AC_DEFUN([AX_CHECK_COMPILE_FLAG],
61[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
62AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
63AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
64 ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
65 _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
66 AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
67 [AS_VAR_SET(CACHEVAR,[yes])],
68 [AS_VAR_SET(CACHEVAR,[no])])
69 _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
70AS_VAR_IF(CACHEVAR,yes,
71 [m4_default([$2], :)],
72 [m4_default([$3], :)])
73AS_VAR_POPDEF([CACHEVAR])dnl
74])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/m4/ax_check_enable_debug.m4 b/m4/ax_check_enable_debug.m4
deleted file mode 100644
index f99d75f..0000000
--- a/m4/ax_check_enable_debug.m4
+++ /dev/null
@@ -1,124 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CHECK_ENABLE_DEBUG([enable by default=yes/info/profile/no], [ENABLE DEBUG VARIABLES ...], [DISABLE DEBUG VARIABLES NDEBUG ...], [IS-RELEASE])
8#
9# DESCRIPTION
10#
11# Check for the presence of an --enable-debug option to configure, with
12# the specified default value used when the option is not present. Return
13# the value in the variable $ax_enable_debug.
14#
15# Specifying 'yes' adds '-g -O0' to the compilation flags for all
16# languages. Specifying 'info' adds '-g' to the compilation flags.
17# Specifying 'profile' adds '-g -pg' to the compilation flags and '-pg' to
18# the linking flags. Otherwise, nothing is added.
19#
20# Define the variables listed in the second argument if debug is enabled,
21# defaulting to no variables. Defines the variables listed in the third
22# argument if debug is disabled, defaulting to NDEBUG. All lists of
23# variables should be space-separated.
24#
25# If debug is not enabled, ensure AC_PROG_* will not add debugging flags.
26# Should be invoked prior to any AC_PROG_* compiler checks.
27#
28# IS-RELEASE can be used to change the default to 'no' when making a
29# release. Set IS-RELEASE to 'yes' or 'no' as appropriate. By default, it
30# uses the value of $ax_is_release, so if you are using the AX_IS_RELEASE
31# macro, there is no need to pass this parameter.
32#
33# AX_IS_RELEASE([git-directory])
34# AX_CHECK_ENABLE_DEBUG()
35#
36# LICENSE
37#
38# Copyright (c) 2011 Rhys Ulerich <rhys.ulerich@gmail.com>
39# Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
40#
41# Copying and distribution of this file, with or without modification, are
42# permitted in any medium without royalty provided the copyright notice
43# and this notice are preserved.
44
45#serial 5
46
47AC_DEFUN([AX_CHECK_ENABLE_DEBUG],[
48 AC_BEFORE([$0],[AC_PROG_CC])dnl
49 AC_BEFORE([$0],[AC_PROG_CXX])dnl
50 AC_BEFORE([$0],[AC_PROG_F77])dnl
51 AC_BEFORE([$0],[AC_PROG_FC])dnl
52
53 AC_MSG_CHECKING(whether to enable debugging)
54
55 ax_enable_debug_default=m4_tolower(m4_normalize(ifelse([$1],,[no],[$1])))
56 ax_enable_debug_is_release=m4_tolower(m4_normalize(ifelse([$4],,
57 [$ax_is_release],
58 [$4])))
59
60 # If this is a release, override the default.
61 AS_IF([test "$ax_enable_debug_is_release" = "yes"],
62 [ax_enable_debug_default="no"])
63
64 m4_define(ax_enable_debug_vars,[m4_normalize(ifelse([$2],,,[$2]))])
65 m4_define(ax_disable_debug_vars,[m4_normalize(ifelse([$3],,[NDEBUG],[$3]))])
66
67 AC_ARG_ENABLE(debug,
68 [AS_HELP_STRING([--enable-debug=]@<:@yes/info/profile/no@:>@,[compile with debugging])],
69 [],enable_debug=$ax_enable_debug_default)
70
71 # empty mean debug yes
72 AS_IF([test "x$enable_debug" = "x"],
73 [enable_debug="yes"])
74
75 # case of debug
76 AS_CASE([$enable_debug],
77 [yes],[
78 AC_MSG_RESULT(yes)
79 CFLAGS="${CFLAGS} -g -O0"
80 CXXFLAGS="${CXXFLAGS} -g -O0"
81 FFLAGS="${FFLAGS} -g -O0"
82 FCFLAGS="${FCFLAGS} -g -O0"
83 OBJCFLAGS="${OBJCFLAGS} -g -O0"
84 ],
85 [info],[
86 AC_MSG_RESULT(info)
87 CFLAGS="${CFLAGS} -g"
88 CXXFLAGS="${CXXFLAGS} -g"
89 FFLAGS="${FFLAGS} -g"
90 FCFLAGS="${FCFLAGS} -g"
91 OBJCFLAGS="${OBJCFLAGS} -g"
92 ],
93 [profile],[
94 AC_MSG_RESULT(profile)
95 CFLAGS="${CFLAGS} -g -pg"
96 CXXFLAGS="${CXXFLAGS} -g -pg"
97 FFLAGS="${FFLAGS} -g -pg"
98 FCFLAGS="${FCFLAGS} -g -pg"
99 OBJCFLAGS="${OBJCFLAGS} -g -pg"
100 LDFLAGS="${LDFLAGS} -pg"
101 ],
102 [
103 AC_MSG_RESULT(no)
104 dnl Ensure AC_PROG_CC/CXX/F77/FC/OBJC will not enable debug flags
105 dnl by setting any unset environment flag variables
106 AS_IF([test "x${CFLAGS+set}" != "xset"],
107 [CFLAGS=""])
108 AS_IF([test "x${CXXFLAGS+set}" != "xset"],
109 [CXXFLAGS=""])
110 AS_IF([test "x${FFLAGS+set}" != "xset"],
111 [FFLAGS=""])
112 AS_IF([test "x${FCFLAGS+set}" != "xset"],
113 [FCFLAGS=""])
114 AS_IF([test "x${OBJCFLAGS+set}" != "xset"],
115 [OBJCFLAGS=""])
116 ])
117
118 dnl Define various variables if debugging is disabled.
119 dnl assert.h is a NOP if NDEBUG is defined, so define it by default.
120 AS_IF([test "x$enable_debug" = "xyes"],
121 [m4_map_args_w(ax_enable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is enabled])])],
122 [m4_map_args_w(ax_disable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is disabled])])])
123 ax_enable_debug=$enable_debug
124])
diff --git a/m4/ax_check_gnu_make.m4 b/m4/ax_check_gnu_make.m4
deleted file mode 100644
index 6762e9e..0000000
--- a/m4/ax_check_gnu_make.m4
+++ /dev/null
@@ -1,84 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CHECK_GNU_MAKE()
8#
9# DESCRIPTION
10#
11# This macro searches for a GNU version of make. If a match is found:
12#
13# * The makefile variable `ifGNUmake' is set to the empty string, otherwise
14# it is set to "#". This is useful for including a special features in a
15# Makefile, which cannot be handled by other versions of make.
16# * The variable `_cv_gnu_make_command` is set to the command to invoke
17# GNU make if it exists, the empty string otherwise.
18# * The variable `ax_cv_gnu_make_command` is set to the command to invoke
19# GNU make by copying `_cv_gnu_make_command`, otherwise it is unset.
20# * If GNU Make is found, its version is extracted from the output of
21# `make --version` as the last field of a record of space-separated
22# columns and saved into the variable `ax_check_gnu_make_version`.
23#
24# Here is an example of its use:
25#
26# Makefile.in might contain:
27#
28# # A failsafe way of putting a dependency rule into a makefile
29# $(DEPEND):
30# $(CC) -MM $(srcdir)/*.c > $(DEPEND)
31#
32# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
33# @ifGNUmake@ include $(DEPEND)
34# @ifGNUmake@ endif
35#
36# Then configure.in would normally contain:
37#
38# AX_CHECK_GNU_MAKE()
39# AC_OUTPUT(Makefile)
40#
41# Then perhaps to cause gnu make to override any other make, we could do
42# something like this (note that GNU make always looks for GNUmakefile
43# first):
44#
45# if ! test x$_cv_gnu_make_command = x ; then
46# mv Makefile GNUmakefile
47# echo .DEFAULT: > Makefile ;
48# echo \ $_cv_gnu_make_command \$@ >> Makefile;
49# fi
50#
51# Then, if any (well almost any) other make is called, and GNU make also
52# exists, then the other make wraps the GNU make.
53#
54# LICENSE
55#
56# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
57# Copyright (c) 2015 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>
58#
59# Copying and distribution of this file, with or without modification, are
60# permitted in any medium without royalty provided the copyright notice
61# and this notice are preserved. This file is offered as-is, without any
62# warranty.
63
64#serial 8
65
66AC_DEFUN([AX_CHECK_GNU_MAKE],dnl
67 [AC_PROG_AWK
68 AC_CACHE_CHECK([for GNU make],[_cv_gnu_make_command],[dnl
69 _cv_gnu_make_command="" ;
70dnl Search all the common names for GNU make
71 for a in "$MAKE" make gmake gnumake ; do
72 if test -z "$a" ; then continue ; fi ;
73 if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then
74 _cv_gnu_make_command=$a ;
75 AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make")
76 ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }')
77 break ;
78 fi
79 done ;])
80dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
81 AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])], [AS_VAR_SET([ifGNUmake], [""])])
82 AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])])
83 AC_SUBST([ifGNUmake])
84])
diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4
deleted file mode 100644
index eb01a6c..0000000
--- a/m4/ax_check_link_flag.m4
+++ /dev/null
@@ -1,74 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
8#
9# DESCRIPTION
10#
11# Check whether the given FLAG works with the linker or gives an error.
12# (Warnings, however, are ignored)
13#
14# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
15# success/failure.
16#
17# If EXTRA-FLAGS is defined, it is added to the linker's default flags
18# when the check is done. The check is thus made with the flags: "LDFLAGS
19# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
20# issue an error when a bad flag is given.
21#
22# INPUT gives an alternative input source to AC_LINK_IFELSE.
23#
24# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
25# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
26#
27# LICENSE
28#
29# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
30# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
31#
32# This program is free software: you can redistribute it and/or modify it
33# under the terms of the GNU General Public License as published by the
34# Free Software Foundation, either version 3 of the License, or (at your
35# option) any later version.
36#
37# This program is distributed in the hope that it will be useful, but
38# WITHOUT ANY WARRANTY; without even the implied warranty of
39# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
40# Public License for more details.
41#
42# You should have received a copy of the GNU General Public License along
43# with this program. If not, see <http://www.gnu.org/licenses/>.
44#
45# As a special exception, the respective Autoconf Macro's copyright owner
46# gives unlimited permission to copy, distribute and modify the configure
47# scripts that are the output of Autoconf when processing the Macro. You
48# need not follow the terms of the GNU General Public License when using
49# or distributing such scripts, even though portions of the text of the
50# Macro appear in them. The GNU General Public License (GPL) does govern
51# all other use of the material that constitutes the Autoconf Macro.
52#
53# This special exception to the GPL applies to versions of the Autoconf
54# Macro released by the Autoconf Archive. When you make and distribute a
55# modified version of the Autoconf Macro, you may extend this special
56# exception to the GPL to apply to your modified version as well.
57
58#serial 4
59
60AC_DEFUN([AX_CHECK_LINK_FLAG],
61[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
62AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
63AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
64 ax_check_save_flags=$LDFLAGS
65 LDFLAGS="$LDFLAGS $4 $1"
66 AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
67 [AS_VAR_SET(CACHEVAR,[yes])],
68 [AS_VAR_SET(CACHEVAR,[no])])
69 LDFLAGS=$ax_check_save_flags])
70AS_VAR_IF(CACHEVAR,yes,
71 [m4_default([$2], :)],
72 [m4_default([$3], :)])
73AS_VAR_POPDEF([CACHEVAR])dnl
74])dnl AX_CHECK_LINK_FLAGS
diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4
deleted file mode 100644
index 6c985eb..0000000
--- a/m4/ax_code_coverage.m4
+++ /dev/null
@@ -1,273 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CODE_COVERAGE()
8#
9# DESCRIPTION
10#
11# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS,
12# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LDFLAGS which should be
13# included in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LDFLAGS variables of
14# every build target (program or library) which should be built with code
15# coverage support. Also defines CODE_COVERAGE_RULES which should be
16# substituted in your Makefile; and $enable_code_coverage which can be
17# used in subsequent configure output. CODE_COVERAGE_ENABLED is defined
18# and substituted, and corresponds to the value of the
19# --enable-code-coverage option, which defaults to being disabled.
20#
21# Test also for gcov program and create GCOV variable that could be
22# substituted.
23#
24# Note that all optimisation flags in CFLAGS must be disabled when code
25# coverage is enabled.
26#
27# Usage example:
28#
29# configure.ac:
30#
31# AX_CODE_COVERAGE
32#
33# Makefile.am:
34#
35# @CODE_COVERAGE_RULES@
36# my_program_LIBS = ... $(CODE_COVERAGE_LDFLAGS) ...
37# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ...
38# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ...
39# my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ...
40#
41# This results in a "check-code-coverage" rule being added to any
42# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module
43# has been configured with --enable-code-coverage). Running `make
44# check-code-coverage` in that directory will run the module's test suite
45# (`make check`) and build a code coverage report detailing the code which
46# was touched, then print the URI for the report.
47#
48# This code was derived from Makefile.decl in GLib, originally licenced
49# under LGPLv2.1+.
50#
51# LICENSE
52#
53# Copyright (c) 2012, 2016 Philip Withnall
54# Copyright (c) 2012 Xan Lopez
55# Copyright (c) 2012 Christian Persch
56# Copyright (c) 2012 Paolo Borelli
57# Copyright (c) 2012 Dan Winship
58# Copyright (c) 2015 Bastien ROUCARIES
59#
60# This library is free software; you can redistribute it and/or modify it
61# under the terms of the GNU Lesser General Public License as published by
62# the Free Software Foundation; either version 2.1 of the License, or (at
63# your option) any later version.
64#
65# This library is distributed in the hope that it will be useful, but
66# WITHOUT ANY WARRANTY; without even the implied warranty of
67# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
68# General Public License for more details.
69#
70# You should have received a copy of the GNU Lesser General Public License
71# along with this program. If not, see <http://www.gnu.org/licenses/>.
72
73#serial 15
74
75AC_DEFUN([AX_CODE_COVERAGE],[
76 dnl Check for --enable-code-coverage
77 AC_REQUIRE([AC_PROG_SED])
78
79 # allow to override gcov location
80 AC_ARG_WITH([gcov],
81 [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])],
82 [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov],
83 [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov])
84
85 AC_MSG_CHECKING([whether to build with code coverage support])
86 AC_ARG_ENABLE([code-coverage],
87 AS_HELP_STRING([--enable-code-coverage],
88 [Whether to enable code coverage support]),,
89 enable_code_coverage=no)
90
91 AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
92 AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
93 AC_MSG_RESULT($enable_code_coverage)
94
95 AS_IF([ test "$enable_code_coverage" = "yes" ], [
96 # check for gcov
97 AC_CHECK_TOOL([GCOV],
98 [$_AX_CODE_COVERAGE_GCOV_PROG_WITH],
99 [:])
100 AS_IF([test "X$GCOV" = "X:"],
101 [AC_MSG_ERROR([gcov is needed to do coverage])])
102 AC_SUBST([GCOV])
103
104 dnl Check if gcc is being used
105 AS_IF([ test "$GCC" = "no" ], [
106 AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
107 ])
108
109 # List of supported lcov versions.
110 lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12"
111
112 AC_CHECK_PROG([LCOV], [lcov], [lcov])
113 AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
114
115 AS_IF([ test "$LCOV" ], [
116 AC_CACHE_CHECK([for lcov version], ax_cv_lcov_version, [
117 ax_cv_lcov_version=invalid
118 lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
119 for lcov_check_version in $lcov_version_list; do
120 if test "$lcov_version" = "$lcov_check_version"; then
121 ax_cv_lcov_version="$lcov_check_version (ok)"
122 fi
123 done
124 ])
125 ], [
126 lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
127 AC_MSG_ERROR([$lcov_msg])
128 ])
129
130 case $ax_cv_lcov_version in
131 ""|invalid[)]
132 lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
133 AC_MSG_ERROR([$lcov_msg])
134 LCOV="exit 0;"
135 ;;
136 esac
137
138 AS_IF([ test -z "$GENHTML" ], [
139 AC_MSG_ERROR([Could not find genhtml from the lcov package])
140 ])
141
142 dnl Build the code coverage flags
143 CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
144 CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
145 CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
146 CODE_COVERAGE_LDFLAGS="-lgcov"
147
148 AC_SUBST([CODE_COVERAGE_CPPFLAGS])
149 AC_SUBST([CODE_COVERAGE_CFLAGS])
150 AC_SUBST([CODE_COVERAGE_CXXFLAGS])
151 AC_SUBST([CODE_COVERAGE_LDFLAGS])
152 ])
153
154[CODE_COVERAGE_RULES='
155# Code coverage
156#
157# Optional:
158# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
159# Multiple directories may be specified, separated by whitespace.
160# (Default: $(top_builddir))
161# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
162# by lcov for code coverage. (Default:
163# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
164# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
165# reports to be created. (Default:
166# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
167# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage,
168# set to 0 to disable it and leave empty to stay with the default.
169# (Default: empty)
170# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov
171# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
172# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov
173# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
174# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov
175# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the
176# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
177# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov
178# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
179# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering
180# lcov instance. (Default: empty)
181# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov
182# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
183# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the
184# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE)
185# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
186# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
187# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
188#
189# The generated report will be titled using the $(PACKAGE_NAME) and
190# $(PACKAGE_VERSION). In order to add the current git hash to the title,
191# use the git-version-gen script, available online.
192
193# Optional variables
194CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
195CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
196CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
197CODE_COVERAGE_BRANCH_COVERAGE ?=
198CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
199--rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
200CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT)
201CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)"
202CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH)
203CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT)
204CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?=
205CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT)
206CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\
207$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\
208--rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE))
209CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS)
210CODE_COVERAGE_IGNORE_PATTERN ?=
211
212code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V))
213code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY))
214code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\
215 $(CODE_COVERAGE_OUTPUT_FILE);
216code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V))
217code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY))
218code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\
219 $(CODE_COVERAGE_IGNORE_PATTERN);
220code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V))
221code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY))
222code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY);
223code_coverage_quiet = $(code_coverage_quiet_$(V))
224code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
225code_coverage_quiet_0 = --quiet
226
227# sanitizes the test-name: replaces with underscores: dashes and dots
228code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1)))
229
230# Use recursive makes in order to ignore errors during check
231check-code-coverage:
232ifeq ($(CODE_COVERAGE_ENABLED),yes)
233 -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check
234 $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
235else
236 @echo "Need to reconfigure with --enable-code-coverage"
237endif
238
239# Capture code coverage data
240code-coverage-capture: code-coverage-capture-hook
241ifeq ($(CODE_COVERAGE_ENABLED),yes)
242 $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
243 $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
244 -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
245 $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
246 @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
247else
248 @echo "Need to reconfigure with --enable-code-coverage"
249endif
250
251# Hook rule executed before code-coverage-capture, overridable by the user
252code-coverage-capture-hook:
253
254ifeq ($(CODE_COVERAGE_ENABLED),yes)
255clean: code-coverage-clean
256code-coverage-clean:
257 -$(LCOV) --directory $(top_builddir) -z
258 -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
259 -find . -name "*.gcda" -o -name "*.gcov" -delete
260endif
261
262GITIGNOREFILES ?=
263GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
264
265A''M_DISTCHECK_CONFIGURE_FLAGS ?=
266A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
267
268.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
269']
270
271 AC_SUBST([CODE_COVERAGE_RULES])
272 m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
273])
diff --git a/m4/ax_configure_args.m4 b/m4/ax_configure_args.m4
deleted file mode 100644
index 0726b1b..0000000
--- a/m4/ax_configure_args.m4
+++ /dev/null
@@ -1,70 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_configure_args.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CONFIGURE_ARGS
8#
9# DESCRIPTION
10#
11# Helper macro for AX_ENABLE_BUILDDIR.
12#
13# The traditional way of starting a subdir-configure is running the script
14# with ${1+"$@"} but since autoconf 2.60 this is broken. Instead we have
15# to rely on eval'ing $ac_configure_args however some old autoconf
16# versions do not provide that. To ensure maximum portability of autoconf
17# extension macros this helper can be AC_REQUIRE'd so that
18# $ac_configure_args will alsways be present.
19#
20# Sadly, the traditional "exec $SHELL" of the enable_builddir macros is
21# spoiled now and must be replaced by "eval + exit $?".
22#
23# Example:
24#
25# AC_DEFUN([AX_ENABLE_SUBDIR],[dnl
26# AC_REQUIRE([AX_CONFIGURE_ARGS])dnl
27# eval $SHELL $ac_configure_args || exit $?
28# ...])
29#
30# LICENSE
31#
32# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
33#
34# This program is free software; you can redistribute it and/or modify it
35# under the terms of the GNU General Public License as published by the
36# Free Software Foundation; either version 3 of the License, or (at your
37# option) any later version.
38#
39# This program is distributed in the hope that it will be useful, but
40# WITHOUT ANY WARRANTY; without even the implied warranty of
41# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
42# Public License for more details.
43#
44# You should have received a copy of the GNU General Public License along
45# with this program. If not, see <http://www.gnu.org/licenses/>.
46#
47# As a special exception, the respective Autoconf Macro's copyright owner
48# gives unlimited permission to copy, distribute and modify the configure
49# scripts that are the output of Autoconf when processing the Macro. You
50# need not follow the terms of the GNU General Public License when using
51# or distributing such scripts, even though portions of the text of the
52# Macro appear in them. The GNU General Public License (GPL) does govern
53# all other use of the material that constitutes the Autoconf Macro.
54#
55# This special exception to the GPL applies to versions of the Autoconf
56# Macro released by the Autoconf Archive. When you make and distribute a
57# modified version of the Autoconf Macro, you may extend this special
58# exception to the GPL to apply to your modified version as well.
59
60#serial 9
61
62AC_DEFUN([AX_CONFIGURE_ARGS],[
63 # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args
64 if test "${ac_configure_args+set}" != "set" ; then
65 ac_configure_args=
66 for ac_arg in ${1+"[$]@"}; do
67 ac_configure_args="$ac_configure_args '$ac_arg'"
68 done
69 fi
70])
diff --git a/m4/ax_enable_builddir.m4 b/m4/ax_enable_builddir.m4
deleted file mode 100644
index 5f4ba32..0000000
--- a/m4/ax_enable_builddir.m4
+++ /dev/null
@@ -1,302 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_enable_builddir.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_ENABLE_BUILDDIR [(dirstring-or-command [,Makefile.mk [,-all]])]
8#
9# DESCRIPTION
10#
11# If the current configure was run within the srcdir then we move all
12# configure-files into a subdir and let the configure steps continue
13# there. We provide an option --disable-builddir to suppress the move into
14# a separate builddir.
15#
16# Defaults:
17#
18# $1 = $host (overridden with $HOST)
19# $2 = Makefile.mk
20# $3 = -all
21#
22# This macro must be called before AM_INIT_AUTOMAKE. It creates a default
23# toplevel srcdir Makefile from the information found in the created
24# toplevel builddir Makefile. It just copies the variables and
25# rule-targets, each extended with a default rule-execution that recurses
26# into the build directory of the current "HOST". You can override the
27# auto-dection through `config.guess` and build-time of course, as in
28#
29# make HOST=i386-mingw-cross
30#
31# which can of course set at configure time as well using
32#
33# configure --host=i386-mingw-cross
34#
35# After the default has been created, additional rules can be appended
36# that will not just recurse into the subdirectories and only ever exist
37# in the srcdir toplevel makefile - these parts are read from the $2 =
38# Makefile.mk file
39#
40# The automatic rules are usually scanning the toplevel Makefile for lines
41# like '#### $host |$builddir' to recognize the place where to recurse
42# into. Usually, the last one is the only one used. However, almost all
43# targets have an additional "*-all" rule which makes the script to
44# recurse into _all_ variants of the current HOST (!!) setting. The "-all"
45# suffix can be overriden for the macro as well.
46#
47# a special rule is only given for things like "dist" that will copy the
48# tarball from the builddir to the sourcedir (or $(PUB)) for reason of
49# convenience.
50#
51# LICENSE
52#
53# Copyright (c) 2009 Guido U. Draheim <guidod@gmx.de>
54# Copyright (c) 2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>
55#
56# This program is free software; you can redistribute it and/or modify it
57# under the terms of the GNU General Public License as published by the
58# Free Software Foundation; either version 3 of the License, or (at your
59# option) any later version.
60#
61# This program is distributed in the hope that it will be useful, but
62# WITHOUT ANY WARRANTY; without even the implied warranty of
63# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
64# Public License for more details.
65#
66# You should have received a copy of the GNU General Public License along
67# with this program. If not, see <http://www.gnu.org/licenses/>.
68#
69# As a special exception, the respective Autoconf Macro's copyright owner
70# gives unlimited permission to copy, distribute and modify the configure
71# scripts that are the output of Autoconf when processing the Macro. You
72# need not follow the terms of the GNU General Public License when using
73# or distributing such scripts, even though portions of the text of the
74# Macro appear in them. The GNU General Public License (GPL) does govern
75# all other use of the material that constitutes the Autoconf Macro.
76#
77# This special exception to the GPL applies to versions of the Autoconf
78# Macro released by the Autoconf Archive. When you make and distribute a
79# modified version of the Autoconf Macro, you may extend this special
80# exception to the GPL to apply to your modified version as well.
81
82#serial 25
83
84AC_DEFUN([AX_ENABLE_BUILDDIR],[
85AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
86AC_REQUIRE([AC_CANONICAL_TARGET])[]dnl
87AC_REQUIRE([AX_CONFIGURE_ARGS])[]dnl
88AC_REQUIRE([AM_AUX_DIR_EXPAND])[]dnl
89AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
90AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
91AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
92AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
93SUB="."
94AC_ARG_ENABLE([builddir], AS_HELP_STRING(
95 [--disable-builddir],[disable automatic build in subdir of sources])
96 ,[SUB="$enableval"], [SUB="auto"])
97if test ".$ac_srcdir_defaulted" != ".no" ; then
98if test ".$srcdir" = ".." ; then
99 if test -f config.status ; then
100 AC_MSG_NOTICE(toplevel srcdir already configured... skipping subdir build)
101 else
102 test ".$SUB" = "." && SUB="."
103 test ".$SUB" = ".no" && SUB="."
104 test ".$TARGET" = "." && TARGET="$target"
105 test ".$SUB" = ".auto" && SUB="m4_ifval([$1], [$1],[$TARGET])"
106 if test ".$SUB" != ".." ; then # we know where to go and
107 AS_MKDIR_P([$SUB])
108 echo __.$SUB.__ > $SUB/conftest.tmp
109 cd $SUB
110 if grep __.$SUB.__ conftest.tmp >/dev/null 2>/dev/null ; then
111 rm conftest.tmp
112 AC_MSG_RESULT([continue configure in default builddir "./$SUB"])
113 else
114 AC_MSG_ERROR([could not change to default builddir "./$SUB"])
115 fi
116 srcdir=`echo "$SUB" |
117 sed -e 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,[[/]]$,,;'`
118 # going to restart from subdirectory location
119 test -f $srcdir/config.log && mv $srcdir/config.log .
120 test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h .
121 test -f $srcdir/conftest.log && mv $srcdir/conftest.log .
122 test -f $srcdir/$cache_file && mv $srcdir/$cache_file .
123 AC_MSG_RESULT(....exec $SHELL $srcdir/[$]0 "--srcdir=$srcdir" "--enable-builddir=$SUB" ${1+"[$]@"})
124 case "[$]0" in # restart
125 [[\\/]]* | ?:[[\\/]]*) # Asbolute name
126 eval $SHELL "'[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
127 *) eval $SHELL "'$srcdir/[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
128 esac ; exit $?
129 fi
130 fi
131fi fi
132test ".$SUB" = ".auto" && SUB="."
133dnl ac_path_prog uses "set dummy" to override $@ which would defeat the "exec"
134AC_PATH_PROG(SED,gsed sed, sed)
135AUX="$am_aux_dir"
136AS_VAR_POPDEF([SED])dnl
137AS_VAR_POPDEF([AUX])dnl
138AS_VAR_POPDEF([SUB])dnl
139AC_CONFIG_COMMANDS([buildir],[dnl .............. config.status ..............
140AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
141AS_VAR_PUSHDEF([TOP],[top_srcdir])dnl
142AS_VAR_PUSHDEF([SRC],[ac_top_srcdir])dnl
143AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
144AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
145pushdef([END],[Makefile.mk])dnl
146pushdef([_ALL],[ifelse([$3],,[-all],[$3])])dnl
147 SRC="$ax_enable_builddir_srcdir"
148 if test ".$SUB" = ".." ; then
149 if test -f "$TOP/Makefile" ; then
150 AC_MSG_NOTICE([skipping TOP/Makefile - left untouched])
151 else
152 AC_MSG_NOTICE([skipping TOP/Makefile - not created])
153 fi
154 else
155 if test -f "$SRC/Makefile" ; then
156 a=`grep "^VERSION " "$SRC/Makefile"` ; b=`grep "^VERSION " Makefile`
157 test "$a" != "$b" && rm "$SRC/Makefile"
158 fi
159 if test -f "$SRC/Makefile" ; then
160 echo "$SRC/Makefile : $SRC/Makefile.in" > $tmp/conftemp.mk
161 echo " []@ echo 'REMOVED,,,' >\$[]@" >> $tmp/conftemp.mk
162 eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null"
163 if grep '^REMOVED,,,' "$SRC/Makefile" >/dev/null
164 then rm $SRC/Makefile ; fi
165 cp $tmp/conftemp.mk $SRC/makefiles.mk~ ## DEBUGGING
166 fi
167 if test ! -f "$SRC/Makefile" ; then
168 AC_MSG_NOTICE([create TOP/Makefile guessed from local Makefile])
169 x='`' ; cat >$tmp/conftemp.sed <<_EOF
170/^\$/n
171x
172/^\$/bS
173x
174/\\\\\$/{H;d;}
175{H;s/.*//;x;}
176bM
177:S
178x
179/\\\\\$/{h;d;}
180{h;s/.*//;x;}
181:M
182s/\\(\\n\\) /\\1 /g
183/^ /d
184/^[[ ]]*[[\\#]]/d
185/^VPATH *=/d
186s/^srcdir *=.*/srcdir = ./
187s/^top_srcdir *=.*/top_srcdir = ./
188/[[:=]]/!d
189/^\\./d
190dnl Now handle rules (i.e. lines containing ":" but not " = ").
191/ = /b
192/ .= /b
193/:/!b
194s/:.*/:/
195s/ / /g
196s/ \\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/ \\1 \\1[]_ALL\\2/g
197s/^\\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/\\1 \\1[]_ALL\\2/
198s/ / /g
199/^all all[]_ALL[[ :]]/i\\
200all-configured : all[]_ALL
201dnl dist-all exists... and would make for dist-all-all
202s/ [[a-zA-Z0-9-]]*[]_ALL [[a-zA-Z0-9-]]*[]_ALL[]_ALL//g
203/[]_ALL[]_ALL/d
204a\\
205 @ HOST="\$(HOST)\" \\\\\\
206 ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
207 ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
208 ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
209 ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : \\\\\\
210 ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\
211 ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
212 ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\
213 ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
214 ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done
215dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree)
216/dist[]_ALL *:/a\\
217 @ HOST="\$(HOST)\" \\\\\\
218 ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
219 ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
220 ; found=$x echo \$\$BUILD | wc -w $x \\\\\\
221 ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\
222 ; if test "\$\$found" -eq "0" ; then : \\\\\\
223 ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
224 ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
225 ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\
226 ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
227dnl special rule add-on: "dist-foo" copies all the archives to $(PUB). (source tree)
228/dist-[[a-zA-Z0-9]]*[]_ALL *:/a\\
229 @ HOST="\$(HOST)\" \\\\\\
230 ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\
231 ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
232 ; found=$x echo \$\$BUILD | wc -w $x \\\\\\
233 ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\
234 ; if test "\$\$found" -eq "0" ; then : \\\\\\
235 ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
236 ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
237 ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\
238 ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
239dnl special rule add-on: "distclean" removes all local builddirs completely
240/distclean[]_ALL *:/a\\
241 @ HOST="\$(HOST)\" \\\\\\
242 ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
243 ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\
244 ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
245 ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\
246 ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
247 ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
248 ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\
249 ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
250 ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\
251 ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\
252 ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile
253_EOF
254 cp "$tmp/conftemp.sed" "$SRC/makefile.sed~" ## DEBUGGING
255 $SED -f $tmp/conftemp.sed Makefile >$SRC/Makefile
256 if test -f "$SRC/m4_ifval([$2],[$2],[END])" ; then
257 AC_MSG_NOTICE([extend TOP/Makefile with TOP/m4_ifval([$2],[$2],[END])])
258 cat $SRC/END >>$SRC/Makefile
259 fi ; xxxx="####"
260 echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$SRC/Makefile
261 # sanity check
262 if grep '^; echo "MAKE ' $SRC/Makefile >/dev/null ; then
263 AC_MSG_NOTICE([buggy sed found - it deletes tab in "a" text parts])
264 $SED -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \
265 >$SRC/Makefile~
266 (test -s $SRC/Makefile~ && mv $SRC/Makefile~ $SRC/Makefile) 2>/dev/null
267 fi
268 else
269 xxxx="\\#\\#\\#\\#"
270 # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed
271 echo "s!^$xxxx [[^|]]* | *$SUB *\$!$xxxx ...... $SUB!" >$tmp/conftemp.sed
272 $SED -f "$tmp/conftemp.sed" "$SRC/Makefile" >$tmp/mkfile.tmp
273 cp "$tmp/conftemp.sed" "$SRC/makefiles.sed~" ## DEBUGGING
274 cp "$tmp/mkfile.tmp" "$SRC/makefiles.out~" ## DEBUGGING
275 if cmp -s "$SRC/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then
276 AC_MSG_NOTICE([keeping TOP/Makefile from earlier configure])
277 rm "$tmp/mkfile.tmp"
278 else
279 AC_MSG_NOTICE([reusing TOP/Makefile from earlier configure])
280 mv "$tmp/mkfile.tmp" "$SRC/Makefile"
281 fi
282 fi
283 AC_MSG_NOTICE([build in $SUB (HOST=$ax_enable_builddir_host)])
284 xxxx="####"
285 echo "$xxxx" "$ax_enable_builddir_host" "|$SUB" >>$SRC/Makefile
286 fi
287popdef([END])dnl
288AS_VAR_POPDEF([SED])dnl
289AS_VAR_POPDEF([AUX])dnl
290AS_VAR_POPDEF([SRC])dnl
291AS_VAR_POPDEF([TOP])dnl
292AS_VAR_POPDEF([SUB])dnl
293],[dnl
294ax_enable_builddir_srcdir="$srcdir" # $srcdir
295ax_enable_builddir_host="$HOST" # $HOST / $host
296ax_enable_builddir_version="$VERSION" # $VERSION
297ax_enable_builddir_package="$PACKAGE" # $PACKAGE
298ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX
299ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED
300ax_enable_builddir="$ax_enable_builddir" # $SUB
301])dnl
302])
diff --git a/m4/ax_extend_srcdir.m4 b/m4/ax_extend_srcdir.m4
deleted file mode 100644
index 40f3787..0000000
--- a/m4/ax_extend_srcdir.m4
+++ /dev/null
@@ -1,86 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_extend_srcdir.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_EXTEND_SRCDIR
8#
9# DESCRIPTION
10#
11# The AX_EXTEND_SRCDIR macro extends $srcdir by one path component.
12#
13# As an example, when working in /home/michael/i3-4.12/build and calling
14# ../configure, your $srcdir is "..". After calling AX_EXTEND_SRCDIR,
15# $srcdir will be set to "../../i3-4.12".
16#
17# The result of extending $srcdir is that filenames (e.g. in the output of
18# the "backtrace" gdb command) will include one more path component of the
19# absolute source path. The additional path component makes it easy for
20# users to recognize which files belong to the PACKAGE, and -- provided a
21# dist tarball was unpacked -- which version of PACKAGE was used.
22#
23# As an example, in "backtrace", you will see:
24#
25# #0 main (argc=1, argv=0x7fffffff1fc8) at ../../i3-4.12/src/main.c:187
26#
27# instead of:
28#
29# #0 main (argc=1, argv=0x7fffffff1fc8) at ../src/main.c:187
30#
31# In case your code uses the __FILE__ preprocessor directive to refer to
32# the filename of the current source file (e.g. in debug messages), using
33# the extended path might be undesirable. For this purpose,
34# AX_EXTEND_SRCDIR defines the output variable AX_EXTEND_SRCDIR_CPPFLAGS,
35# which can be added to AM_CPPFLAGS in Makefile.am in order to define the
36# preprocessor directive STRIPPED__FILE__. As an example, when compiling
37# the file "../../i3-4.12/src/main.c", STRIPPED__FILE__ evaluates to
38# "main.c".
39#
40# There are some caveats: When $srcdir is "." (i.e. when ./configure was
41# called instead of ../configure in a separate build directory),
42# AX_EXTEND_SRCDIR will still extend $srcdir, but the intended effect will
43# not be achieved because of the way automake specifies file paths:
44# automake defines COMPILE to use "`test -f '$source' || echo
45# '\$(srcdir)/'`$source" in order to prefer files in the current directory
46# over specifying $srcdir explicitly.
47#
48# The AX_EXTEND_SRCDIR author is not aware of any way to influence this
49# automake behavior. Patches very welcome.
50#
51# To work around this issue, you can use AX_ENABLE_BUILDDIR i.e. by adding
52# the following code to configure.ac:
53#
54# AX_ENABLE_BUILDDIR
55# dnl ...
56# AX_EXTEND_SRCDIR
57#
58# Then also add this bit to Makefile.am (if you wish to use
59# STRIPPED__FILE__ in your code):
60#
61# AM_CPPFLAGS = @AX_EXTEND_SRCDIR_CPPFLAGS@
62#
63# LICENSE
64#
65# Copyright (c) 2016 Michael Stapelberg <michael@i3wm.org>
66#
67# Copying and distribution of this file, with or without modification, are
68# permitted in any medium without royalty provided the copyright notice
69# and this notice are preserved. This file is offered as-is, without any
70# warranty.
71
72#serial 3
73
74AC_DEFUN([AX_EXTEND_SRCDIR],
75[dnl
76AS_CASE([$srcdir],
77 [.|.*|/*],
78 [
79 # pwd -P is specified in IEEE 1003.1 from 2004
80 as_dir=`cd "$srcdir" && pwd -P`
81 as_base=`AS_BASENAME([$as_dir])`
82 srcdir=${srcdir}/../${as_base}
83
84 AC_SUBST([AX_EXTEND_SRCDIR_CPPFLAGS], ["-DSTRIPPED__FILE__=AS_ESCAPE([\"$$(basename $<)\"])"])
85 ])
86])dnl AX_EXTEND_SRCDIR
diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4
deleted file mode 100644
index cae1111..0000000
--- a/m4/ax_require_defined.m4
+++ /dev/null
@@ -1,37 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_REQUIRE_DEFINED(MACRO)
8#
9# DESCRIPTION
10#
11# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
12# been defined and thus are available for use. This avoids random issues
13# where a macro isn't expanded. Instead the configure script emits a
14# non-fatal:
15#
16# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
17#
18# It's like AC_REQUIRE except it doesn't expand the required macro.
19#
20# Here's an example:
21#
22# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
23#
24# LICENSE
25#
26# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
27#
28# Copying and distribution of this file, with or without modification, are
29# permitted in any medium without royalty provided the copyright notice
30# and this notice are preserved. This file is offered as-is, without any
31# warranty.
32
33#serial 1
34
35AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
36 m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
37])dnl AX_REQUIRE_DEFINED
diff --git a/m4/ax_sanitizers.m4 b/m4/ax_sanitizers.m4
deleted file mode 100644
index 836d4af..0000000
--- a/m4/ax_sanitizers.m4
+++ /dev/null
@@ -1,130 +0,0 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_sanitizers.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_SANITIZERS([SANITIZERS], [ENABLED-BY-DEFAULT], [ACTION-SUCCESS])
8#
9# DESCRIPTION
10#
11# Offers users to enable one or more sanitizers (see
12# https://github.com/google/sanitizers) with the corresponding
13# --enable-<sanitizer>-sanitizer option.
14#
15# SANITIZERS is a whitespace-separated list of sanitizers to offer via
16# --enable-<sanitizer>-sanitizer options, e.g. "address memory" for the
17# address sanitizer and the memory sanitizer. If SANITIZERS is not specified,
18# all known sanitizers to AX_SANITIZERS will be offered, which at the time of
19# writing are "address memory undefined".
20# NOTE that SANITIZERS is expanded at autoconf time, not at configure time,
21# i.e. you cannot use shell variables in SANITIZERS.
22#
23# ENABLED-BY-DEFAULT is a whitespace-separated list of sanitizers which
24# should be enabled by default, e.g. "memory undefined". Note that not all
25# sanitizers can be combined, e.g. memory sanitizer cannot be enabled when
26# address sanitizer is already enabled.
27# Set ENABLED-BY-DEFAULT to a single whitespace in order to disable all
28# sanitizers by default.
29# ENABLED-BY-DEFAULT is expanded at configure time, so you can use shell
30# variables.
31#
32# ACTION-SUCCESS allows to specify shell commands to execute on success, i.e.
33# when one of the sanitizers was successfully enabled. This is a good place
34# to call AC_DEFINE for any precompiler constants you might need to make your
35# code play nice with sanitizers.
36#
37# The variable ax_enabled_sanitizers contains a whitespace-separated list of
38# all enabled sanitizers, so that you can print them at the end of configure,
39# if you wish.
40#
41# The additional --enable-sanitizers option allows users to enable/disable
42# all sanitizers, effectively overriding ENABLED-BY-DEFAULT.
43#
44# EXAMPLES
45#
46# AX_SANITIZERS([address])
47# dnl offer users to enable address sanitizer via --enable-address-sanitizer
48#
49# is_debug_build=…
50# if test "x$is_debug_build" = "xyes"; then
51# default_sanitizers="address memory"
52# else
53# default_sanitizers=
54# fi
55# AX_SANITIZERS([address memory], [$default_sanitizers])
56# dnl enable address sanitizer and memory sanitizer by default for debug
57# dnl builds, e.g. when building from git instead of a dist tarball.
58#
59# AX_SANITIZERS(, , [
60# AC_DEFINE([SANITIZERS_ENABLED],
61# [],
62# [At least one sanitizer was enabled])])
63# dnl enable all sanitizers known to AX_SANITIZERS by default and set the
64# dnl SANITIZERS_ENABLED precompiler constant.
65#
66# AX_SANITIZERS(, [ ])
67# dnl provide all sanitizers, but enable none by default.
68#
69# LICENSE
70#
71# Copyright (c) 2016 Michael Stapelberg <michael@i3wm.org>
72#
73# Copying and distribution of this file, with or without modification,
74# are permitted in any medium without royalty provided the copyright
75# notice and this notice are preserved. This file is offered as-is,
76# without any warranty.
77
78AC_DEFUN([AX_SANITIZERS],
79[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
80AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
81AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
82AC_ARG_ENABLE(sanitizers,
83 AS_HELP_STRING(
84 [--enable-sanitizers],
85 [enable all known sanitizers]),
86 [ax_sanitizers_default=$enableval],
87 [ax_sanitizers_default=])
88ax_enabled_sanitizers=
89m4_foreach_w([mysan], m4_default($1, [address memory undefined]), [
90 dnl If ax_sanitizers_default is unset, i.e. the user neither explicitly
91 dnl enabled nor explicitly disabled all sanitizers, we get the default value
92 dnl for this sanitizer based on whether it is listed in ENABLED-BY-DEFAULT.
93 AS_IF([test "x$ax_sanitizers_default" = "x"], [dnl
94 ax_sanitizer_default=
95 for mycheck in m4_default([$2], [address memory undefined]); do
96 AS_IF([test "x$mycheck" = "x[]mysan"], [ax_sanitizer_default=yes])
97 done
98 AS_IF([test "x$ax_sanitizer_default" = "x"], [ax_sanitizer_default=no])
99 ],
100 [ax_sanitizer_default=$ax_sanitizers_default])
101 AC_ARG_ENABLE(mysan[]-sanitizer,
102 AS_HELP_STRING(
103 [--enable-[]mysan[]-sanitizer],
104 [enable -fsanitize=mysan]),
105 [ax_sanitizer_enabled=$enableval],
106 [ax_sanitizer_enabled=$ax_sanitizer_default])
107
108AS_IF([test "x$ax_sanitizer_enabled" = "xyes"], [
109dnl Not using AX_APPEND_COMPILE_FLAGS and AX_APPEND_LINK_FLAGS because they
110dnl lack the ability to specify ACTION-SUCCESS.
111 AX_CHECK_COMPILE_FLAG([-fsanitize=[]mysan], [
112 AX_CHECK_LINK_FLAG([-fsanitize=[]mysan], [
113 AX_APPEND_FLAG([-fsanitize=[]mysan], [])
114dnl If and only if libtool is being used, LDFLAGS needs to contain -Wc,-fsanitize=….
115dnl See e.g. https://sources.debian.net/src/systemd/231-7/configure.ac/?hl=128#L135
116dnl TODO: how can recognize that situation and add -Wc,?
117 AX_APPEND_FLAG([-fsanitize=[]mysan], [LDFLAGS])
118dnl TODO: add -fPIE -pie for memory
119 # -fno-omit-frame-pointer results in nicer stack traces in error
120 # messages, see http://clang.llvm.org/docs/AddressSanitizer.html#usage
121 AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer], [
122 AX_APPEND_FLAG([-fno-omit-frame-pointer], [])])
123dnl TODO: at least for clang, we should specify exactly -O1, not -O2 or -O0, so that performance is reasonable but stacktraces are not tampered with (due to inlining), see http://clang.llvm.org/docs/AddressSanitizer.html#usage
124 m4_default([$3], :)
125 ax_enabled_sanitizers="[]mysan $ax_enabled_sanitizers"
126 ])
127 ])
128])
129])dnl
130])dnl AX_SANITIZERS
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..c3b4dc8
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,130 @@
1# -*- mode: meson -*-
2
3# Style objective: be consistent with what mesonbuild.com documents/uses, and/or
4# the meson book: https://meson-manual.com/
5
6project(
7 'i3lock-extended',
8 'c',
9 version: '2.2.14',
10 default_options: [
11 'c_std=c11',
12 'warning_level=1', # enable all warnings (-Wall)
13 ],
14 # Ubuntu 18.04 (supported until 2023) has meson 0.45.
15 # We can revisit our minimum supported meson version
16 # if it turns out to be too hard to maintain.
17 meson_version: '>=0.45.0',
18)
19
20cc = meson.get_compiler('c')
21add_project_arguments(cc.get_supported_arguments(['-Wunused-value']), language: 'c')
22
23if meson.version().version_compare('>=0.48.0')
24 # https://github.com/mesonbuild/meson/issues/2166#issuecomment-629696911
25 meson.add_dist_script('meson/meson-dist-script')
26else
27 message('meson <0.48.0 detected, dist tarballs will not be filtered')
28endif
29
30################################################################################
31# Version handling
32################################################################################
33
34cdata = configuration_data()
35
36version_array = meson.project_version().split('.')
37cdata.set_quoted('I3LOCK_VERSION', meson.project_version())
38cdata.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir')))
39
40if get_option('b_sanitize').split(',').contains('address')
41 cdata.set('I3LOCK_ASAN_ENABLED', 1)
42endif
43
44cdata.set('HAVE_STRNDUP', cc.has_function('strndup'))
45cdata.set('HAVE_MKDIRP', cc.has_function('mkdirp'))
46
47config_h = configure_file(
48 output: 'config.h',
49 configuration: cdata,
50)
51
52config_h = declare_dependency(sources: config_h)
53
54################################################################################
55# manpages
56################################################################################
57
58install_man('i3lock-extended.1')
59
60# Required for e.g. struct ucred to be defined as per unix(7).
61add_project_arguments('-D_GNU_SOURCE', language: 'c')
62add_project_arguments('-DEXTRAS', language: 'c')
63
64# https://mesonbuild.com/howtox.html#add-math-library-lm-portably
65m_dep = cc.find_library('m', required: false)
66rt_dep = cc.find_library('rt', required: false)
67
68xcb_dep = dependency('xcb', method: 'pkg-config')
69xcb_xkb_dep = dependency('xcb-xkb', method: 'pkg-config')
70xcb_xinerama_dep = dependency('xcb-xinerama', method: 'pkg-config')
71xcb_randr_dep = dependency('xcb-randr', method: 'pkg-config')
72xcb_image_dep = dependency('xcb-image', method: 'pkg-config')
73xcb_util_dep = dependency('xcb-util', method: 'pkg-config')
74xcb_util_xrm_dep = dependency('xcb-xrm', method: 'pkg-config')
75xkbcommon_dep = dependency('xkbcommon', method: 'pkg-config')
76xkbcommon_x11_dep = dependency('xkbcommon-x11', method: 'pkg-config')
77cairo_dep = dependency('cairo', version: '>=1.14.4', method: 'pkg-config')
78
79i3lock_srcs = [
80 'dpi.c',
81 'extras.c',
82 'i3lock.c',
83 'randr.c',
84 'unlock_indicator.c',
85 'xcb.c',
86]
87
88ev_dep = cc.find_library('ev')
89
90thread_dep = dependency('threads')
91
92i3lock_deps = [
93 thread_dep,
94 m_dep,
95 rt_dep,
96 ev_dep,
97 config_h,
98 cairo_dep,
99 xcb_dep,
100 xcb_xkb_dep,
101 xcb_xinerama_dep,
102 xcb_randr_dep,
103 xcb_image_dep,
104 xcb_util_dep,
105 xcb_util_xrm_dep,
106 xkbcommon_dep,
107 xkbcommon_x11_dep,
108]
109
110host_os = host_machine.system()
111if host_os != 'openbsd'
112 pam_dep = cc.find_library('pam', required: true)
113 i3lock_deps += [pam_dep]
114endif
115
116inc = include_directories('include')
117
118executable(
119 'i3lock-extended',
120 i3lock_srcs,
121 install: true,
122 include_directories: inc,
123 dependencies: i3lock_deps,
124)
125
126install_subdir(
127 'pam',
128 strip_directory: true,
129 install_dir: join_paths(get_option('sysconfdir'), 'pam.d'),
130)
diff --git a/meson/meson-dist-script b/meson/meson-dist-script
new file mode 100755
index 0000000..b112d2f
--- /dev/null
+++ b/meson/meson-dist-script
@@ -0,0 +1,11 @@
1#!/bin/sh
2
3set -eu
4
5cd "${MESON_DIST_ROOT}"
6
7# Delete everything we do not want to have in the release tarballs:
8rm -rf \
9 .clang-format \
10 .editorconfig \
11 travis
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..5f1d584
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1 @@
# -*- mode: meson -*-
diff --git a/travis/Dockerfile b/travis/Dockerfile
index cc2dd7d..9dc8137 100644
--- a/travis/Dockerfile
+++ b/travis/Dockerfile
@@ -16,10 +16,10 @@ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry
16# test suite dependencies (for running tests) 16# test suite dependencies (for running tests)
17RUN apt-get update && \ 17RUN apt-get update && \
18 DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ 18 DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
19 build-essential clang git autoconf automake libxcb-randr0-dev pkg-config libpam0g-dev \ 19 build-essential clang git meson libxcb-randr0-dev pkg-config libpam0g-dev \
20 libcairo2-dev libxcb1-dev libxcb-dpms0-dev libxcb-image0-dev libxcb-util0-dev \ 20 libcairo2-dev libxcb1-dev libxcb-dpms0-dev libxcb-image0-dev libxcb-util0-dev \
21 libxcb-xrm-dev libev-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev \ 21 libxcb-xrm-dev libev-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev \
22 libxkbcommon-x11-dev clang-format-9 && \ 22 libxkbcommon-x11-dev && \
23 rm -rf /var/lib/apt/lists/* 23 rm -rf /var/lib/apt/lists/*
24 24
25WORKDIR /usr/src 25WORKDIR /usr/src
diff --git a/unlock_indicator.c b/unlock_indicator.c
index 8f69972..6f6fbf7 100644
--- a/unlock_indicator.c
+++ b/unlock_indicator.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * This file is part of i3lock-extended 2 * This file is part of i3lock-extended
3 * Copyright (C) 2020 Simeon Simeonov 3 * Copyright (C) 2020-2023 Simeon Simeonov
4 4
5 * i3lock-extended is free software: you can redistribute it and/or modify 5 * i3lock-extended is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -31,6 +31,7 @@
31#include <string.h> 31#include <string.h>
32#include <math.h> 32#include <math.h>
33#include <xcb/xcb.h> 33#include <xcb/xcb.h>
34#include <xkbcommon/xkbcommon.h>
34#include <ev.h> 35#include <ev.h>
35#include <cairo.h> 36#include <cairo.h>
36#include <cairo/cairo-xcb.h> 37#include <cairo/cairo-xcb.h>
@@ -103,6 +104,9 @@ extern bool show_failed_attempts;
103/* Number of failed unlock attempts. */ 104/* Number of failed unlock attempts. */
104extern int failed_attempts; 105extern int failed_attempts;
105 106
107extern struct xkb_keymap *xkb_keymap;
108extern struct xkb_state *xkb_state;
109
106/******************************************************************************* 110/*******************************************************************************
107 * Variables defined in xcb.c. 111 * Variables defined in xcb.c.
108 ******************************************************************************/ 112 ******************************************************************************/
@@ -122,6 +126,44 @@ static xcb_visualtype_t *vistype;
122unlock_state_t unlock_state; 126unlock_state_t unlock_state;
123auth_state_t auth_state; 127auth_state_t auth_state;
124 128
129/* check_modifier_keys describes the currently active modifiers (Caps Lock, Alt,
130 Num Lock or Super) in the modifier_string variable. */
131static void check_modifier_keys(void) {
132 xkb_mod_index_t idx, num_mods;
133 const char *mod_name;
134
135 num_mods = xkb_keymap_num_mods(xkb_keymap);
136
137 for (idx = 0; idx < num_mods; idx++) {
138 if (!xkb_state_mod_index_is_active(xkb_state, idx, XKB_STATE_MODS_EFFECTIVE))
139 continue;
140
141 mod_name = xkb_keymap_mod_get_name(xkb_keymap, idx);
142 if (mod_name == NULL)
143 continue;
144
145 /* Replace certain xkb names with nicer, human-readable ones. */
146 if (strcmp(mod_name, XKB_MOD_NAME_CAPS) == 0) {
147 mod_name = "Caps Lock";
148 } else if (strcmp(mod_name, XKB_MOD_NAME_NUM) == 0) {
149 mod_name = "Num Lock";
150 } else {
151 /* Show only Caps Lock and Num Lock, other modifiers (e.g. Shift)
152 * leak state about the password. */
153 continue;
154 }
155
156 char *tmp;
157 if (modifier_string == NULL) {
158 if (asprintf(&tmp, "%s", mod_name) != -1)
159 modifier_string = tmp;
160 } else if (asprintf(&tmp, "%s, %s", modifier_string, mod_name) != -1) {
161 free(modifier_string);
162 modifier_string = tmp;
163 }
164 }
165}
166
125/* 167/*
126 * Draws global image with fill color onto a pixmap with the given 168 * Draws global image with fill color onto a pixmap with the given
127 * resolution and returns it. 169 * resolution and returns it.
@@ -291,7 +333,7 @@ void draw_image(xcb_pixmap_t bg_pixmap, uint32_t *resolution) {
291 cairo_close_path(ctx); 333 cairo_close_path(ctx);
292 } 334 }
293 335
294 if (auth_state == STATE_AUTH_WRONG && (modifier_string != NULL)) { 336 if (modifier_string != NULL) {
295 cairo_text_extents_t extents; 337 cairo_text_extents_t extents;
296 double x, y; 338 double x, y;
297 339
@@ -432,6 +474,13 @@ void free_bg_pixmap(void) {
432 */ 474 */
433void redraw_screen(void) { 475void redraw_screen(void) {
434 DEBUG("redraw_screen(unlock_state = %d, auth_state = %d)\n", unlock_state, auth_state); 476 DEBUG("redraw_screen(unlock_state = %d, auth_state = %d)\n", unlock_state, auth_state);
477
478 if (modifier_string) {
479 free(modifier_string);
480 modifier_string = NULL;
481 }
482 check_modifier_keys();
483
435 if (bg_pixmap == XCB_NONE) { 484 if (bg_pixmap == XCB_NONE) {
436 DEBUG("allocating pixmap for %d x %d px\n", last_resolution[0], last_resolution[1]); 485 DEBUG("allocating pixmap for %d x %d px\n", last_resolution[0], last_resolution[1]);
437 bg_pixmap = create_bg_pixmap(conn, screen, last_resolution, color); 486 bg_pixmap = create_bg_pixmap(conn, screen, last_resolution, color);