[Pacemaker] [PATCH] feature test for sighandler_t added and for ncurses improved

Grüninger, Andreas (LGL Extern) Andreas.Grueninger at lgl.bwl.de
Mon Sep 24 18:32:36 CEST 2012


When pacemaker 1.1.8 is compiled with gcc 4.5.2 and ncurses 5.7 2 problems occur:
- ncurses is errounesly detected as version 5.4
- sighandler_t is not defined in libglib-2.0

The feature test for ncurses uses another order for checking as the tests in lib/pengine/unpack.h.
The test für ncurses should precede the test for curses as in lib/pengine/unpack.h.

The patch adds a feature test for sighandler_t and changes the feature test for ncurses according to the the test in lib/pengine/unpack.h.

Andreas

commit 81497be39234cde6572b5a4105e48b5a3b126bd0
Author: andreas.grueninger <andreas.grueninger at server>
Date:   Mon Sep 24 18:09:37 2012 +0200

    feature test for sighandler_t added and for ncurses improved

diff --git a/configure.ac b/configure.ac
index 684863d..3918a81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -839,6 +839,17 @@ if test x$ac_cv_header_bzlib_h != xyes; then
    AC_MSG_ERROR(BZ2 Development headers not found)
 fi

+dnl ========================================================================
+dnl sighandler_t is missing from Illumos, Solaris11 systems
+dnl ========================================================================
+
+AC_MSG_CHECKING([for sighandler_t])
+AC_TRY_COMPILE([#include <signal.h>],[sighandler_t *f;],
+has_sighandler_t=yes,has_sighandler_t=no)
+AC_MSG_RESULT($has_sighandler_t)
+if test "$has_sighandler_t" = "yes" ; then
+    AC_DEFINE( HAVE_SIGHANDLER_T, 1, [Define if sighandler_t available] )
+fi

 dnl ========================================================================
 dnl   ncurses
@@ -900,10 +911,12 @@ if test X"$CURSESLIBS" != X"" && cc_supports_flag -Wcast-qual && cc_supports_fla
     AC_LINK_IFELSE(
            [AC_LANG_PROGRAM(
              [
-#if defined(HAVE_CURSES_H)
-#  include <curses.h>
-#elif defined(HAVE_NCURSES_H)
+#if defined(HAVE_NCURSES_H)
 #  include <ncurses.h>
+#elif defined(HAVE_NCURSES_NCURSES_H)
+#  include <ncurses/ncurses.h>
+#elif defined(HAVE_CURSES_H)
+#  include <curses.h>
 #endif
              ],
              [printw((const char *)"Test");]
diff --git a/tools/crm_mon.c b/tools/crm_mon.c
index 7bcc187..542b0ba 100644
--- a/tools/crm_mon.c
+++ b/tools/crm_mon.c
@@ -206,6 +206,9 @@ mon_shutdown(int nsig)
 #endif

 #if CURSES_ENABLED
+#ifndef HAVE_SIGHANDLER_T
+typedef void (*sighandler_t)(int);
+#endif
 static sighandler_t ncurses_winch_handler;
 static void
 mon_winresize(int nsig)



More information about the Pacemaker mailing list