From 3d0e6d54029713b158a9c53ed7956a49074db9bf Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 13 Feb 2020 05:26:06 +0100 Subject: Replace our custom signalfd() fallback with glib one (available as of 2.54) Back in 2011 SIGWINCH couldn't be used with g_unix_signal_add. This has changed in 2.54 (released Sep. 2017). That means we can drop our wrapper now. --- configure.ac | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 37ec840..3aaced9 100644 --- a/configure.ac +++ b/configure.ac @@ -28,11 +28,26 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET +AC_CHECK_HEADERS([sys/ioctl.h sys/signalfd.h unistd.h signal.h]) + +AC_CHECK_FUNCS([signalfd]) + +AM_CONDITIONAL([HAVE_SIGNALFD], + [test "x$ac_cv_func_signalfd" = "xyes" -a "x$ac_cv_header_sys_signalfd_h" = "xyes"]) + +glib_version=2.0 +if test "x$ac_cv_func_signalfd" = "xno" -o "x$ac_cv_header_sys_signalfd_h" = "xno"; then + # If signalfd() is not available, we want to use g_unix_signal_add() + # which is supported for SIGWINCH as of 2.54, see + # https://github.com/GNOME/glib/commit/47a02c85610f4036681c9728b7339d + glib_version=2.54 +fi + # Checks for libraries. PKG_CHECK_MODULES(CURSES, [ncursesw], [], [ncursesw=no]) PKG_CHECK_MODULES(PULSE, [libpulse], [], AC_MSG_ERROR([libpulse required])) PKG_CHECK_MODULES(PULSE_MAINLOOP, [libpulse-mainloop-glib], [], AC_MSG_ERROR([libpulse-mainloop-glib required])) -PKG_CHECK_MODULES(GLIB, [glib-2.0], [], AC_MSG_ERROR([glib required])) +PKG_CHECK_MODULES(GLIB, [glib-2.0 >= $glib_version], [], AC_MSG_ERROR([glib >= $glib_version required])) if test "x$ncursesw" = "xno"; then AC_CHECK_LIB([curses], [newwin], [CURSES_LIBS=-lcurses], AC_MSG_ERROR([ncursesw or curses required])) @@ -45,14 +60,6 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(GCC_CFLAGS) -AC_CHECK_HEADERS([sys/ioctl.h sys/signalfd.h unistd.h signal.h]) - -AC_CHECK_FUNC([sigaction], [], AC_MSG_ERROR([function sigaction() not found])) -AC_CHECK_FUNCS([signalfd]) - -AM_CONDITIONAL([HAVE_SIGNALFD], - [test "x$ac_cv_func_signalfd" = "xyes" -a "x$ac_cv_header_sys_signalfd_h" = "xyes"]) - AC_DEFINE([_POSIX_C_SOURCE], [1], [Enable POSIX.1-1990 definitions]) AC_C_INLINE -- cgit