/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. AC_DEFUN([AC_QSHELL],
  19. [
  20. AC_MSG_CHECKING([for whether to build qshell module and qshd daemon])
  21. AC_ARG_WITH([qshell],
  22. AC_HELP_STRING([--with-qshell], [Build qsh module and qshd daemon]),
  23. [ case "$withval" in
  24. yes) ac_with_qshell=yes ;;
  25. no) ac_with_qshell=no ;;
  26. *) AC_MSG_RESULT([doh!])
  27. AC_MSG_ERROR([bad value "$withval" for --with-qshell]) ;;
  28. esac
  29. ]
  30. )
  31. AC_MSG_RESULT([${ac_with_qshell=no}])
  32. if test "$ac_with_qshell" = yes; then
  33. AC_ELAN
  34. if test "$ac_have_elan" != "yes" ; then
  35. AC_MSG_NOTICE([Cannot support qshell without libelan3 or libelanctrl!])
  36. fi
  37. if test "$ac_with_pam" = "yes" ; then
  38. AC_CHECK_LIB([pam], [pam_start], [ac_have_pam=yes])
  39. if test "$ac_have_pam" != "yes" ; then
  40. AC_MSG_NOTICE([Cannot support qshell without libpam])
  41. AC_MSG_NOTICE([Consider turning off pam support with --without-pam])
  42. AC_MSG_ERROR([Error configuring qshell])
  43. fi
  44. else
  45. ac_have_pam=yes
  46. fi
  47. if test "$ac_have_elan" = "yes" &&
  48. test "$ac_have_pam" = "yes" ; then
  49. ac_have_qshell=yes
  50. ac_have_qsw=yes
  51. QSHELL_LIBS="$ELAN_LIBS"
  52. AC_ADD_STATIC_MODULE("qcmd")
  53. AC_DEFINE_UNQUOTED(HAVE_QSHELL, [1], [Define for Qshell support.])
  54. PROG_QSHD=in.qshd
  55. if test "$ac_with_pam" = "yes" ; then
  56. QSHELL_LIBS="$QSHELL_LIBS -lpam -lpam_misc"
  57. AC_DEFINE_UNQUOTED(USE_PAM, [1], [Define for Qshell PAM support.])
  58. fi
  59. fi
  60. fi
  61. AC_SUBST(HAVE_QSHELL)
  62. AC_SUBST(PROG_QSHD)
  63. AC_SUBST(QSHELL_LIBS)
  64. ])