1 dnl Copyright (C) 2014 Simon Ruderich
3 dnl This program is free software: you can redistribute it and/or modify
4 dnl it under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation, either version 3 of the License, or
6 dnl (at your option) any later version.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 dnl GNU General Public License for more details.
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
18 AC_INIT([wall-notify],[0.1],[simon@ruderich.org])
20 AC_CONFIG_AUX_DIR([build-aux])
21 AC_CONFIG_MACRO_DIR([m4])
22 AC_CONFIG_HEADERS([config.h])
23 AC_CONFIG_SRCDIR([src/wall-notify.c])
25 dnl Get functions which are only provided by e.g. _XOPEN_SOURCE.
26 AC_USE_SYSTEM_EXTENSIONS
29 AM_INIT_AUTOMAKE([foreign -Wall -Werror])
33 if test "x$GCC" = xyes; then
34 CFLAGS="-Wall -Wextra -Wconversion $CFLAGS"
38 AC_CHECK_HEADERS([utempter.h utmpx.h])
40 if test "x$ac_cv_header_utempter_h" = xyes; then
41 AC_MSG_NOTICE([using utempter])
42 AC_CHECK_LIB([utempter], [utempter_add_record],
43 [], [AC_MSG_ERROR([utempter_add_record() required])])
44 AC_CHECK_LIB([utempter], [utempter_remove_record],
45 [], [AC_MSG_ERROR([utempter_remove_record() required])])
46 AC_DEFINE([USE_UTEMPTER], 1, [Define to 1 to use utempter.])
47 elif test "x$ac_cv_header_utmpx_h" = xyes; then
48 AC_MSG_NOTICE([using utmp])
49 AC_DEFINE([USE_UTMPX], 1, [Define to 1 to use utmp.])
51 AC_MSG_ERROR([neither utmpx.h nor utempter.h found, aborting])
58 AC_CONFIG_FILES([Makefile src/Makefile])
61 if test "x$ac_cv_header_utempter_h" != xyes; then
62 AC_MSG_NOTICE([utempter not found, you must make wall-notify setgid utmp])