summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 8 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 3ca5384..37ec840 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,20 +29,23 @@ AC_PROG_INSTALL
AC_PROG_MAKE_SET
# Checks for libraries.
-AC_CHECK_LIB([ncursesw], [newwin], [CURSES_LIBS=-lncursesw], AC_MSG_ERROR([curses required]))
-
+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]))
+if test "x$ncursesw" = "xno"; then
+ AC_CHECK_LIB([curses], [newwin], [CURSES_LIBS=-lcurses], AC_MSG_ERROR([ncursesw or curses required]))
+ AC_CHECK_HEADERS([curses.h])
+ AC_SUBST(CURSES_LIBS)
+fi
+
if test "x$GCC" = "xyes"; then
GCC_CFLAGS="-Wall -pedantic -std=c99 -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option -fvisibility=hidden"
fi
AC_SUBST(GCC_CFLAGS)
-AC_SUBST(CURSES_LIBS)
-
-AC_CHECK_HEADERS([ncurses.h sys/ioctl.h sys/signalfd.h unistd.h signal.h])
+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])