PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/config/ac_qshell.m4

https://code.google.com/
m4 | 71 lines | 47 code | 7 blank | 17 comment | 0 complexity | 88e79d5f18b1a217aac810cda1602a08 MD5 | raw file
 1##*****************************************************************************
 2## $Id$
 3##*****************************************************************************
 4#  AUTHOR:
 5#    Jim Garlick <garlick@llnl.gov>
 6#
 7#  SYNOPSIS:
 8#    AC_QSHELL
 9#
10#  DESCRIPTION:
11#    Adds support for the "--with-qshell" configure script option.
12#    Checks for rmscall and elan3 libraries if Elan support is desired,
13#    Elan-specific libraries are exported via ELAN_LIBS variable.
14#
15#  WARNINGS:
16#    This macro must be placed after AC_PROG_CC or equivalent.
17##*****************************************************************************
18
19AC_DEFUN([AC_QSHELL],
20[
21  AC_MSG_CHECKING([for whether to build qshell module and qshd daemon])
22  AC_ARG_WITH([qshell],
23    AC_HELP_STRING([--with-qshell], [Build qsh module and qshd daemon]),
24    [ case "$withval" in
25        yes) ac_with_qshell=yes ;;
26        no)  ac_with_qshell=no ;;
27        *)   AC_MSG_RESULT([doh!])
28             AC_MSG_ERROR([bad value "$withval" for --with-qshell]) ;;
29      esac
30    ]
31  )
32  AC_MSG_RESULT([${ac_with_qshell=no}])
33
34  if test "$ac_with_qshell" = yes; then
35
36     AC_ELAN
37
38     if test "$ac_have_elan" != "yes" ; then
39        AC_MSG_NOTICE([Cannot support qshell without libelan3 or libelanctrl!])
40     fi
41
42     if test "$ac_with_pam" = "yes" ; then
43        AC_CHECK_LIB([pam], [pam_start], [ac_have_pam=yes])
44        if test "$ac_have_pam" != "yes" ; then
45           AC_MSG_NOTICE([Cannot support qshell without libpam])
46           AC_MSG_NOTICE([Consider turning off pam support with --without-pam])
47		   AC_MSG_ERROR([Error configuring qshell])
48        fi
49     else
50        ac_have_pam=yes         
51     fi
52
53     if test "$ac_have_elan" = "yes" &&
54        test "$ac_have_pam" = "yes" ; then
55        ac_have_qshell=yes
56        ac_have_qsw=yes
57        QSHELL_LIBS="$ELAN_LIBS"
58        AC_ADD_STATIC_MODULE("qcmd")
59        AC_DEFINE_UNQUOTED(HAVE_QSHELL, [1], [Define for Qshell support.])
60        PROG_QSHD=in.qshd
61        if test "$ac_with_pam" = "yes" ; then
62           QSHELL_LIBS="$QSHELL_LIBS -lpam -lpam_misc"
63           AC_DEFINE_UNQUOTED(USE_PAM, [1], [Define for Qshell PAM support.])
64        fi
65     fi
66  fi
67
68  AC_SUBST(HAVE_QSHELL)
69  AC_SUBST(PROG_QSHD)
70  AC_SUBST(QSHELL_LIBS)
71])