Skip to contentSkip to conversation

Check for ncurses

PATCH In review Pavel Roskin 2 participants 2 messages Feb 24, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Check for ncurses

Hello!

The CVS version of GRUB 2 doesn't compile without ncurses, but it doesn't check for ncurses in configure. The patch adds checks for headers and library.

ChangeLog:

* configure.ac: Add checks for ncurses.
* util/console.c: Include config.h and the ncurses header found by configure.

Signature · 2 lines
Regards,
Pavel Roskin
configure.ac +8 -0
@@ -97,6 +97,14 @@
   AC_DEFINE([NESTED_FUNC_ATTR], [],[Catch gcc bug])
 fi
 
+# Check for ncurses.
+AC_CHECK_LIB(ncurses, color_set, , [AC_MSG_ERROR([ncurses library not found])])
+ncurses_found=
+AC_CHECK_HEADERS(ncurses/curses.h ncurses.h curses.h, [ncurses_found=1; break;])
+if test -z "$ncurses_found"; then
+  AC_MSG_ERROR([ncurses header not found])
+fi
+
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 AC_CHECK_TOOL(OBJCOPY, objcopy)
console.c +10 -1
@@ -18,7 +18,16 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <curses.h>
+#include <config.h>
+
+#if defined(HAVE_NCURSES_CURSES_H)
+# include <ncurses/curses.h>
+#elif defined(HAVE_NCURSES_H)
+# include <ncurses.h>
+#elif defined(HAVE_CURSES_H)
+# include <curses.h>
+#endif
+
 #include <grub/machine/console.h>
 #include <grub/term.h>
 #include <grub/types.h>
#1 lore raw

Hi Pavel! I'm very happy to hear from you again.

Quoted 3 lines · Pavel Roskin

The CVS version of GRUB 2 doesn't compile without ncurses, but it doesn't check for ncurses in configure. The patch adds checks for headers and library.

Thank you. Can you commit it?

Okuji