configure.in 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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="2.0a1"
  10. PKG_HOME_URL="http://www.nagios.org/"
  11. PKG_REL_DATE="01-28-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 getopt.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 Define u_int32_t if we don't have it already (Solaris)
  32. AC_CHECK_SIZEOF(int)
  33. AC_CHECK_SIZEOF(short)
  34. AC_CHECK_SIZEOF(long)
  35. if test "$ac_cv_sizeof_int" = 4 ; then
  36. AC_CHECK_TYPE(int32_t, int)
  37. AC_CHECK_TYPE(u_int32_t, unsigned int)
  38. elif test "$ac_cv_sizeof_short" = 4 ; then
  39. AC_CHECK_TYPE(int32_t, short)
  40. AC_CHECK_TYPE(u_int32_t, unsigned short)
  41. elif test "$ac_cv_sizeof_long" = 4 ; then
  42. AC_CHECK_TYPE(int32_t, long)
  43. AC_CHECK_TYPE(u_int32_t, unsigned long)
  44. else
  45. AC_MSG_ERROR([Cannot find a type with size of 32 bits])
  46. fi
  47. dnl Checks for library functions.
  48. AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
  49. AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
  50. AC_SUBST(SOCKETLIBS)
  51. AC_CHECK_FUNCS(strdup strstr strtoul initgroups)
  52. AC_MSG_CHECKING(for type of socket size)
  53. AC_TRY_COMPILE([#include <stdlib.h>
  54. #include <sys/types.h>
  55. #include <sys/socket.h>
  56. ],
  57. [int a = send(1, (const void *)0, (size_t *) 0, (int *) 0);],
  58. [AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)],
  59. [AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)])
  60. AC_ARG_WITH(nrpe_user,--with-nrpe-user=<user> sets user name to run NRPE,nrpe_user=$withval,nrpe_user=nagios)
  61. AC_ARG_WITH(nrpe_group,--with-nrpe-group=<group> sets group name to run NRPE,nrpe_grp=$withval,nrpe_grp=nagios)
  62. AC_ARG_WITH(nrpe_port,--with-nrpe-port=<port> sets port number for NRPE to listen on,nrpe_port=$withval,nrpe_port=5666)
  63. AC_SUBST(nrpe_user)
  64. AC_SUBST(nrpe_grp)
  65. AC_SUBST(nrpe_port)
  66. AC_DEFINE_UNQUOTED(DEFAULT_SERVER_PORT,$nrpe_port)
  67. AC_ARG_ENABLE(command-args,--enable-command-args allows clients to specify command arguments. *** THIS IS A SECURITY RISK! *** Read the SECURITY file before using this option!,AC_DEFINE_UNQUOTED(ENABLE_COMMAND_ARGUMENTS))
  68. AC_PATH_PROG(PERL,perl)
  69. AC_OUTPUT(Makefile src/Makefile subst)
  70. perl subst nrpe.cfg
  71. perl subst init-script
  72. perl subst init-script.debian
  73. perl subst init-script.freebsd
  74. perl subst nrpe.xinetd
  75. dnl Review options
  76. echo ""
  77. echo ""
  78. AC_MSG_RESULT([*** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:])
  79. echo ""
  80. echo " General Options:"
  81. echo " -------------------------"
  82. AC_MSG_RESULT([ NRPE port: $nrpe_port])
  83. AC_MSG_RESULT([ NRPE user: $nrpe_user])
  84. AC_MSG_RESULT([ NRPE group: $nrpe_grp])
  85. echo ""
  86. echo ""
  87. echo "Review the options above for accuracy. If they look okay,"
  88. echo "type 'make all' to compile the NRPE daemon and client."
  89. echo ""