PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/config/ac_nodeupdown.m4

https://code.google.com/
m4 | 77 lines | 52 code | 6 blank | 19 comment | 0 complexity | 4edf7236f517642b29174a3358470892 MD5 | raw file
 1##*****************************************************************************
 2## $Id$
 3##*****************************************************************************
 4#  AUTHOR:
 5#    Jim Garlick <garlick@llnl.gov>
 6#
 7#  SYNOPSIS:
 8#    AC_NODEUPDOWN
 9#
10#  DESCRIPTION:
11#    Checks for nodeupdown support. 
12#
13#  WARNINGS:
14#    This macro must be placed after AC_PROG_CC or equivalent.
15##*****************************************************************************
16
17AC_DEFUN([AC_NODEUPDOWN],
18[
19  #
20  # Check for whether to include libnodeupdown module
21  #
22  AC_MSG_CHECKING([for whether to build nodeupdown module])
23  AC_ARG_WITH([nodeupdown],
24    AC_HELP_STRING([--with-nodeupdown], [Build nodeupdown module]),
25    [ case "$withval" in
26        no)  ac_with_libnodeupdown=no ;;
27        yes) ac_with_libnodeupdown=yes ;;
28        *)   AC_MSG_RESULT([doh!])
29             AC_MSG_ERROR([bad value "$withval" for --with-nodeupdown]) ;;
30      esac
31    ]
32  )
33  AC_MSG_RESULT([${ac_with_libnodeupdown=no}])
34   
35  if test "$ac_with_libnodeupdown" = "yes"; then
36    AC_CHECK_LIB([nodeupdown], [nodeupdown_handle_create], 
37                 [ac_found_libnodeupdown=yes], [])
38
39   if test "$ac_found_libnodeupdown" != "yes" ; then
40      AC_MSG_NOTICE([Cannot support nodeupdown without libnodeupdown])
41   else
42      # Which nodeupdown API version do we have?
43      AC_TRY_COMPILE(
44           [#include <nodeupdown.h>],
45           [nodeupdown_load_data(NULL, NULL, NULL, NULL, 0,0);],
46           ac_nodeupdown_load_data_6=yes,
47           ac_nodeupdown_load_data_6=no)
48      AC_TRY_COMPILE(
49           [#include <nodeupdown.h>],
50           [nodeupdown_load_data(NULL, NULL, 0, 0, NULL);],
51           ac_nodeupdown_load_data_5=yes,
52           ac_nodeupdown_load_data_5=no)
53      
54      if test "$ac_nodeupdown_load_data_6" = "yes"; then
55           AC_DEFINE(HAVE_NODEUPDOWN_LOAD_DATA_6, 1, 
56                     [6 param nodeupdown_load_data])
57           ac_have_libnodeupdown=yes
58      elif test "$ac_nodeupdown_load_data_5" = "yes"; then
59           AC_DEFINE(HAVE_NODEUPDOWN_LOAD_DATA_5, 1, 
60                     [5 param nodeupdown_load_data])
61           ac_have_libnodeupdown=yes
62      else
63           AC_MSG_NOTICE([Unnkown libnodeupdown library])
64      fi
65      
66      if test "$ac_have_libnodeupdown" = "yes"; then
67           AC_ADD_STATIC_MODULE("nodeupdown")
68           AC_DEFINE([HAVE_LIBNODEUPDOWN], [1], 
69                     [Define if you have libnodeupdown.])
70           NODEUPDOWN_LIBS="-lnodeupdown"
71      fi
72   fi 
73  fi
74
75  AC_SUBST(HAVE_LIBNODEUPDOWN)
76  AC_SUBST(NODEUPDOWN_LIBS)
77])