ax_nagios_get_files 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # ===========================================================================
  2. # SYNOPSIS
  3. #
  4. # AX_NAGIOS_GET_FILES
  5. #
  6. # DESCRIPTION
  7. #
  8. # This macro figures out which init and/or inetd files to use based
  9. # on the results of the AX_NAGIOS_GET_OS, AX_NAGIOS_GET_DISTRIB_TYPE,
  10. # AX_NAGIOS_GET_INIT and AX_NAGIOS_GET_INETD macros. It will select
  11. # the appropriate files(s) from the 'startup' directory and copy it.
  12. #
  13. # LICENSE
  14. #
  15. # Copyright (c) 2016 Nagios Core Development Team
  16. #
  17. # This program is free software; you can redistribute it and/or modify it
  18. # under the terms of the GNU General Public License as published by the
  19. # Free Software Foundation; either version 2 of the License, or (at your
  20. # option) any later version.
  21. #
  22. # This program is distributed in the hope that it will be useful, but
  23. # WITHOUT ANY WARRANTY; without even the implied warranty of
  24. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  25. # Public License for more details.
  26. #
  27. # You should have received a copy of the GNU General Public License along
  28. # with this program. If not, see <http://www.gnu.org/licenses/>.
  29. #
  30. # As a special exception, the respective Autoconf Macro's copyright owner
  31. # gives unlimited permission to copy, distribute and modify the configure
  32. # scripts that are the output of Autoconf when processing the Macro. You
  33. # need not follow the terms of the GNU General Public License when using
  34. # or distributing such scripts, even though portions of the text of the
  35. # Macro appear in them. The GNU General Public License (GPL) does govern
  36. # all other use of the material that constitutes the Autoconf Macro.
  37. #
  38. # This special exception to the GPL applies to versions of the Autoconf
  39. # Macro released by the Autoconf Archive. When you make and distribute a
  40. # modified version of the Autoconf Macro, you may extend this special
  41. # exception to the GPL to apply to your modified version as well.
  42. # ===========================================================================
  43. AU_ALIAS([AC_NAGIOS_GET_FILES], [AX_NAGIOS_GET_FILES])
  44. AC_DEFUN([AX_NAGIOS_GET_FILES],
  45. [
  46. AC_SUBST(src_init)
  47. AC_SUBST(src_inetd)
  48. AC_SUBST(src_tmpfile)
  49. AC_SUBST(bsd_enable)
  50. src_inetd=""
  51. src_init=""
  52. bsd_enable=""
  53. AC_MSG_CHECKING(for which init file to use )
  54. AS_CASE([$init_type],
  55. [sysv],
  56. src_init=default-init,
  57. [systemd],
  58. src_tmpfile=tmpfile.conf
  59. src_init=default-service,
  60. [bsd],
  61. src_init=bsd-init,
  62. [newbsd],
  63. if test $dist_type = freebsd ; then
  64. bsd_enable="_enable"
  65. src_init=newbsd-init
  66. elif test $dist_type = openbsd ; then
  67. bsd_enable="_flags"
  68. src_init=openbsd-init
  69. elif test $dist_type = netbsd ; then
  70. bsd_enable=""
  71. src_init=newbsd-init
  72. fi,
  73. # [gentoo],
  74. [openrc],
  75. src_init=openrc-init,
  76. [smf*],
  77. src_init="solaris-init.xml"
  78. src_inetd="solaris-inetd.xml",
  79. [upstart],
  80. if test $dist_type = rh ; then
  81. src_init=rh-upstart-init
  82. else
  83. src_init=upstart-init
  84. fi,
  85. [launchd],
  86. src_init="mac-init.plist",
  87. [*],
  88. src_init="unknown"
  89. )
  90. AC_MSG_RESULT($src_init)
  91. AC_MSG_CHECKING(for which inetd files to use )
  92. if test x$src_inetd = x; then
  93. AS_CASE([$inetd_type],
  94. [inetd*],
  95. src_inetd=default-inetd,
  96. [xinetd],
  97. src_inetd=default-xinetd,
  98. [systemd],
  99. src_inetd=default-socket,
  100. [launchd],
  101. src_inetd="mac-inetd.plist",
  102. [*],
  103. src_inetd="unknown"
  104. )
  105. fi
  106. AC_MSG_RESULT($src_inetd)
  107. ])