Configure script doesn't error-out when (n)curses isn't found
genpfault opened this issue · 4 comments
genpfault commented
The configure
script generated by autogen.sh
doesn't hard-fail when it fails to find a (n)curses library:
...
checking for a BSD-compatible install... /usr/bin/install -c
checking for initscr in -lcurses... ./configure: line 3115: ac_fn_c_try_link: command not found
no
checking for initscr in -lncurses... no
checking for keypad in -ltinfo... yes
...
checking whether memrmem is declared... no
configure: creating ./config.status
config.status: creating Makefile
config.status: WARNING: 'Makefile.in' seems to ignore the --datarootdir setting
config.status: creating Makefile-build
config.status: WARNING: 'Makefile-build.in' seems to ignore the --datarootdir setting
config.status: creating hexedit.1
config.status: creating config.h
make
ing after this apparently successful configure
doesn't work:
gcc -DHAVE_CONFIG_H -g -O2 -c hexedit.c
In file included from hexedit.c:17:0:
hexedit.h:16:20: fatal error: curses.h: No such file or directory
#include <curses.h>
^
compilation terminated.
Makefile:30: recipe for target 'hexedit.o' failed
make: *** [hexedit.o] Error 1
Debian Stretch amd64, with the latest master (e417f243a8637c5e80e528ecbedc7adaaeca10e
).
Installing libncurses5-dev
and re-configure
ing fixes the build.
rsaxvc commented
configure.ac tries to
rsaxvc commented
checking for a BSD-compatible install... /usr/bin/install -c
checking for initscr in -lcurses... ./configure: line 3115: ac_fn_c_try_link: command not found
no
checking for initscr in -lncurses... no
checking for keypad in -ltinfo... yes
checking for use_default_colors... no
genpfault commented
This patch fixes it on my end:
diff --git a/configure.ac b/configure.ac
index 7c654e8..76765bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,7 +36,8 @@ AC_PROG_INSTALL
dnl Checks for libraries.
AC_CHECK_LIB(curses, initscr, LIBS="$LIBS -lcurses",
- [AC_CHECK_LIB(ncurses, initscr, LIBS="$LIBS -lncurses")]
+ [AC_CHECK_LIB(ncurses, initscr, LIBS="$LIBS -lncurses",
+ AC_MSG_ERROR([libcurses/libncurses not found.]))]
)
AC_CHECK_LIB(tinfo, keypad, LIBS="$LIBS -ltinfo")
AC_CHECK_FUNC(use_default_colors,
prigaux commented
Thanks, committed!