configure.in 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl Disable caching
  3. define([AC_CACHE_LOAD],)
  4. define([AC_CACHE_SAVE],)
  5. AC_INIT(src/nrpe.c)
  6. AC_CONFIG_HEADER(common/config.h)
  7. AC_PREFIX_DEFAULT(/usr/local/nagios)
  8. PKG_NAME=nrpe
  9. PKG_VERSION="1.7"
  10. PKG_HOME_URL="http://www.nagios.org/"
  11. PKG_REL_DATE="01-08-2003"
  12. dnl Figure out how to invoke "install" and what install options to use.
  13. AC_PROG_INSTALL
  14. AC_SUBST(INSTALL)
  15. dnl Checks for programs.
  16. AC_PROG_CC
  17. AC_PROG_MAKE_SET
  18. dnl Checks for header files.
  19. AC_HEADER_STDC
  20. AC_HEADER_TIME
  21. AC_HEADER_SYS_WAIT
  22. AC_CHECK_HEADERS(ctype.h errno.h fcntl.h grp.h netdb.h pwd.h signal.h strings.h string.h syslog.h unistd.h arpa/inet.h netinet/in.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h)
  23. dnl Checks for typedefs, structures, and compiler characteristics.
  24. AC_C_CONST
  25. AC_STRUCT_TM
  26. AC_TYPE_MODE_T
  27. AC_TYPE_PID_T
  28. AC_TYPE_SIZE_T
  29. AC_TYPE_SIGNAL
  30. AC_TYPE_GETGROUPS
  31. dnl Checks for library functions.
  32. AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
  33. AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
  34. AC_SUBST(SOCKETLIBS)
  35. AC_CHECK_FUNCS(strdup strstr strtoul initgroups)
  36. AC_MSG_CHECKING(for type of socket size)
  37. AC_TRY_COMPILE([#include <stdlib.h>
  38. #include <sys/types.h>
  39. #include <sys/socket.h>
  40. ],
  41. [int a = send(1, (const void *)0, (size_t *) 0, (int *) 0);],
  42. [AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)],
  43. [AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)])
  44. AC_ARG_WITH(nrpe_user,--with-nrpe-user=<user> sets user name to run NRPE,nrpe_user=$withval,nrpe_user=nagios)
  45. AC_ARG_WITH(nrpe_grp,--with-nrpe-grp=<grp> sets group name to run NRPE,nrpe_grp=$withval,nrpe_grp=nagios)
  46. AC_ARG_WITH(nrpe_port,--with-nrpe-port=<port> sets port number for NRPE to listen on,nrpe_port=$withval,nrpe_port=5666)
  47. AC_SUBST(nrpe_user)
  48. AC_SUBST(nrpe_grp)
  49. AC_SUBST(nrpe_port)
  50. AC_DEFINE_UNQUOTED(DEFAULT_SERVER_PORT,$nrpe_port)
  51. AC_PATH_PROG(PERL,perl)
  52. AC_OUTPUT(Makefile src/Makefile subst)
  53. perl subst nrpe.cfg
  54. perl subst init-script
  55. perl subst init-script.debian
  56. perl subst init-script.freebsd
  57. perl subst nrpe.xinetd
  58. dnl Review options
  59. echo ""
  60. echo ""
  61. AC_MSG_RESULT([*** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:])
  62. echo ""
  63. echo " General Options:"
  64. echo " -------------------------"
  65. AC_MSG_RESULT([ NRPE port: $nrpe_port])
  66. AC_MSG_RESULT([ NRPE user: $nrpe_user])
  67. AC_MSG_RESULT([ NRPE group: $nrpe_grp])
  68. echo ""
  69. echo ""
  70. echo "Review the options above for accuracy. If they look okay,"
  71. echo "type 'make all' to compile the NRPE daemon and client."
  72. echo ""