diff options
author | Benjamin Franzke <benjaminfranzke@gmail.com> | 2020-02-12 21:39:42 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@gmail.com> | 2020-02-12 21:39:45 +0100 |
commit | cfe267835813b684b9c8ef81b096c2c25263f544 (patch) | |
tree | e828f59bea85c7724096d47592df4b0e5925b6f7 /configure.ac | |
parent | 244ea507ccbf2d85996e85e15b66bdc857900dd1 (diff) | |
download | pa-sink-ctl-cfe267835813b684b9c8ef81b096c2c25263f544.tar.gz pa-sink-ctl-cfe267835813b684b9c8ef81b096c2c25263f544.tar.bz2 pa-sink-ctl-cfe267835813b684b9c8ef81b096c2c25263f544.zip |
Use pkg-config for ncursesw, fallback to classic curses
The fallback is intended for non-ncurses systems only.
TODO: add proper check that the fallback lib is wide
character capable. (Can't add right now, as we don't
know about an incompatiblity)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
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]) |