configure.in 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_REVISION ($Revision$)
  3. AC_PREREQ(2.58)
  4. AC_INIT(nagios-plugins,1.4.2)
  5. AC_CONFIG_SRCDIR(NPTest.pm)
  6. AM_INIT_AUTOMAKE
  7. AM_CONFIG_HEADER(config.h)
  8. AC_CANONICAL_HOST
  9. RELEASE=1
  10. AC_SUBST(RELEASE)
  11. AC_PREFIX_DEFAULT(/usr/local/nagios)
  12. dnl Figure out how to invoke "install" and what install options to use.
  13. AC_PROG_INSTALL
  14. AC_SUBST(INSTALL)
  15. dnl Must come very early on due to coreutils requirement
  16. dnl Takes care of AC_GNU_SOURCE, AC_AIX and AC_MINIX
  17. gl_USE_SYSTEM_EXTENSIONS
  18. AC_PROG_CC
  19. AC_PROG_CPP
  20. AC_PROG_GCC_TRADITIONAL
  21. AC_PROG_RANLIB
  22. AC_PROG_MAKE_SET
  23. AC_PROG_AWK
  24. AC_FUNC_MALLOC
  25. AC_FUNC_REALLOC
  26. AC_FUNC_ERROR_AT_LINE
  27. AC_CONFIG_LIBOBJ_DIR(lib)
  28. AC_FUNC_GETLOADAVG([lib])
  29. ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
  30. dnl AM_WITH_REGEX
  31. PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
  32. AC_SUBST(PLUGIN_TEST)dnl
  33. SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
  34. AC_SUBST(SCRIPT_TEST)dnl
  35. WARRANTY="The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n"
  36. AC_SUBST(WARRANTY)
  37. SUPPORT="Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n"
  38. AC_SUBST(SUPPORT)
  39. dnl CGIURL has changed for Nagios with 1.0 beta
  40. AC_ARG_WITH(cgiurl,
  41. ACX_HELP_STRING([--with-cgiurl=DIR],
  42. [sets URL for cgi programs]),
  43. with_cgiurl=$withval,
  44. with_cgiurl=/nagios/cgi-bin)
  45. CGIURL="$with_cgiurl"
  46. AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
  47. AC_ARG_WITH(nagios_user,
  48. ACX_HELP_STRING([--with-nagios-user=USER],
  49. [set user name to run nagios]),
  50. with_nagios_user=$withval,
  51. with_nagios_user=nagios)
  52. AC_ARG_WITH(nagios_group,
  53. ACX_HELP_STRING([--with-nagios-group=GROUP],
  54. [set group name to run nagios]),
  55. with_nagios_group=$withval,
  56. with_nagios_group=nagios)
  57. AC_SUBST(with_nagios_user)
  58. AC_SUBST(with_nagios_group)
  59. INSTALL_OPTS="-o $with_nagios_user -g $with_nagios_group"
  60. AC_SUBST(INSTALL_OPTS)
  61. AC_ARG_WITH(libtap-srcdir,
  62. ACX_HELP_STRING([--with-libtap-srcdir=path],
  63. [full path to a compiled libtap srcdir]),
  64. EXTRA_TEST=test_utils
  65. EXTRA_TAPOBJ=$withval/tap.o
  66. AC_SUBST(EXTRA_TEST)
  67. AC_SUBST(EXTRA_TAPOBJ)
  68. LDFLAGS="$LDFLAGS -L$withval"
  69. CPPFLAGS="$CPPFLAGS -I$withval"
  70. )
  71. AC_ARG_WITH(trusted_path,
  72. ACX_HELP_STRING([--with-trusted-path=PATH],
  73. [sets trusted path for executables called by scripts (default=/bin:/sbin:/usr/bin:/usr/sbin)]),
  74. with_trusted_path=$withval,
  75. with_trusted_path=/bin:/sbin:/usr/bin:/usr/sbin)
  76. AC_SUBST(with_trusted_path)
  77. EXTRAS=
  78. dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
  79. LDFLAGS="$LDFLAGS -L."
  80. ac_cv_uname_m=`uname -m`
  81. ac_cv_uname_s=`uname -s`
  82. ac_cv_uname_r=`uname -r`
  83. ac_cv_uname_v=`uname -v`
  84. PKG_ARCH=`uname -p`
  85. REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
  86. REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
  87. AC_SUBST(PKG_ARCH)
  88. AC_SUBST(REV_DATESTAMP)
  89. AC_SUBST(REV_TIMESTAMP)
  90. dnl Checks for programs.
  91. AC_PATH_PROG(PYTHON,python)
  92. AC_PATH_PROG(SH,sh)
  93. AC_PATH_PROG(PERL,perl)
  94. AC_PATH_PROG(LIBGNUTLS_CONFIG,libgnutls-config)
  95. AC_PATH_PROG(HOSTNAME,hostname)
  96. AC_PATH_PROG(BASENAME,basename)
  97. dnl allow them to override the path of perl
  98. AC_ARG_WITH(perl,
  99. ACX_HELP_STRING([--with-perl=PATH],
  100. [sets path to perl executable]),
  101. with_perl=$withval,with_perl=$PERL)
  102. AC_SUBST(PERL, $with_perl)
  103. dnl openssl/gnutls
  104. AC_ARG_WITH(openssl,
  105. AC_HELP_STRING([--with-openssl=DIR],
  106. [path to openssl installation]),)
  107. AC_ARG_WITH(gnutls,
  108. ACX_HELP_STRING([--with-gnutls=PATH],
  109. [path to gnutls installation root]),)
  110. dnl you can only have one or the other
  111. if test ! "$with_openssl" = "" && test ! "$with_openssl" = "no"; then
  112. with_gnutls="no"
  113. fi
  114. if test ! "$with_gnutls" = "" && test ! "$with_gnutls" = "no"; then
  115. with_openssl="no"
  116. fi
  117. dnl list of possible dirs to try to autodetect openssl
  118. dnl if $dir/include exists, we consider it found
  119. dnl the order should allow locally installed versions to override distros' ones
  120. OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl \
  121. /opt /opt/openssl"
  122. dnl
  123. dnl Check for miscellaneous stuff
  124. dnl
  125. case $host_vender-$host_os in
  126. sun*)
  127. AC_DEFINE(__EXTENSIONS__,1,[Sun's netdb.h needs this for getaddrinfo])
  128. ;;
  129. osf*)
  130. AC_DEFINE(_OSF_SOURCE,1,[OSF needs this for getaddrinfo])
  131. ;;
  132. esac
  133. dnl
  134. dnl Checks for libraries.
  135. dnl
  136. AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
  137. AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
  138. AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
  139. AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
  140. AC_SUBST(SOCKETLIBS)
  141. dnl
  142. dnl check for math-related functions needing -lm
  143. AC_CHECK_HEADERS(math.h)
  144. AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
  145. AC_SUBST(MATHLIBS)
  146. dnl Check for PostgreSQL libraries
  147. _SAVEDLIBS="$LIBS"
  148. _SAVEDCPPFLAGS="$CPPFLAGS"
  149. AC_ARG_WITH(pgsql,
  150. ACX_HELP_STRING([--with-pgsql=DIR],
  151. [sets path to pgsql installation]),
  152. PGSQL=$withval,)
  153. AC_CHECK_LIB(crypt,main)
  154. if test "$ac_cv_lib_crypt_main" = "yes"; then
  155. if test -n "$PGSQL"; then
  156. LDFLAGS="$LDFLAGS -L$PGSQL/lib"
  157. CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
  158. fi
  159. AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
  160. if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
  161. AC_CHECK_HEADERS(pgsql/libpq-fe.h)
  162. AC_CHECK_HEADERS(postgresql/libpq-fe.h)
  163. AC_CHECK_HEADERS(libpq-fe.h)
  164. if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
  165. PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
  166. PGINCLUDE="-I$PGSQL/include"
  167. elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
  168. PGLIBS="-lpq -lcrypt"
  169. PGINCLUDE="-I/usr/include/pgsql"
  170. elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
  171. PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
  172. PGINCLUDE="-I/usr/include/postgresql"
  173. elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
  174. PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
  175. PGINCLUDE="-I$PGSQL/include"
  176. fi
  177. if test -z "$PGINCLUDE"; then
  178. AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
  179. AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
  180. else
  181. AC_SUBST(PGLIBS)
  182. AC_SUBST(PGINCLUDE)
  183. EXTRAS="$EXTRAS check_pgsql"
  184. fi
  185. else
  186. AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
  187. AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
  188. AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
  189. fi
  190. else
  191. AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
  192. AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
  193. fi
  194. LIBS="$_SAVEDLIBS"
  195. CPPFLAGS="$_SAVEDCPPFLAGS"
  196. dnl Check for radius libraries
  197. _SAVEDLIBS="$LIBS"
  198. AC_CHECK_LIB(radiusclient,rc_read_config)
  199. if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
  200. EXTRAS="$EXTRAS check_radius"
  201. RADIUSLIBS="-lradiusclient"
  202. AC_SUBST(RADIUSLIBS)
  203. else
  204. AC_MSG_WARN([Skipping radius plugin])
  205. AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
  206. fi
  207. LIBS="$_SAVEDLIBS"
  208. dnl Check for LDAP libraries
  209. _SAVEDLIBS="$LIBS"
  210. AC_CHECK_LIB(ldap,main,,,-llber)
  211. if test "$ac_cv_lib_ldap_main" = "yes"; then
  212. LDAPLIBS="-lldap -llber"\
  213. LDAPINCLUDE="-I/usr/include/ldap"
  214. AC_SUBST(LDAPLIBS)
  215. AC_SUBST(LDAPINCLUDE)
  216. AC_CHECK_FUNCS(ldap_set_option)
  217. EXTRAS="$EXTRAS check_ldap"
  218. AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
  219. else
  220. AC_MSG_WARN([Skipping LDAP plugin])
  221. AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
  222. fi
  223. LIBS="$_SAVEDLIBS"
  224. dnl Check for mysql libraries
  225. _SAVEDLIBS="$LIBS"
  226. _SAVEDCPPFLAGS="$CPPFLAGS"
  227. AC_ARG_WITH(mysql,
  228. ACX_HELP_STRING([--with-mysql=DIR],
  229. [sets path to mysql installation (assumes lib/mysql and include subdirs]),
  230. MYSQL=$withval,)
  231. if test -n "$MYSQL"; then
  232. MYSQLLIBDIR=$MYSQL/lib/mysql
  233. CPPFLAGS="-I$MYSQL/include"
  234. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR ",,-L$MYSQLLIBDIR -lz)
  235. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
  236. elif test -f /usr/lib/libmysqlclient.so; then
  237. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
  238. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
  239. elif test -f /usr/lib/libmysqlclient.a; then
  240. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
  241. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
  242. elif test -f /usr/lib/mysql/libmysqlclient.so; then
  243. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
  244. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
  245. elif test -f /usr/lib/mysql/libmysqlclient.a; then
  246. AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
  247. AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
  248. fi
  249. if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then
  250. AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h, MYSQLINCLUDE="-I$MYSQL/include" )
  251. if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then
  252. EXTRAS="$EXTRAS check_mysql check_mysql_query"
  253. AC_SUBST(MYSQLINCLUDE)
  254. AC_SUBST(MYSQLLIBS)
  255. AC_SUBST(check_mysql_LDFLAGS)
  256. else
  257. AC_MSG_WARN([Skipping mysql plugin])
  258. AC_MSG_WARN([install mysql client headers to compile this plugin (see REQUIREMENTS).])
  259. fi
  260. else
  261. AC_MSG_WARN([Skipping mysql plugin])
  262. AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
  263. fi
  264. CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE"
  265. LIBS="$_SAVEDLIBS"
  266. AC_CHECK_HEADERS(unistd.h)
  267. dnl Check for AF_INET6 support - unistd.h required for Darwin
  268. AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
  269. AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H
  270. #include <unistd.h>
  271. #endif
  272. #include <netinet/in.h>
  273. #include <sys/socket.h>],
  274. [struct sockaddr_in6 sin6;
  275. void *p;
  276. sin6.sin6_family = AF_INET6;
  277. sin6.sin6_port = 587;
  278. p = &sin6.sin6_addr;],
  279. [with_ipv6=yes],
  280. [with_ipv6=no])
  281. ])
  282. if test x"$with_ipv6" != xno ; then
  283. AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
  284. fi
  285. dnl #########################################################################
  286. dnl Check if Posix getaddrinfo() is available. It is also possible to use
  287. dnl the version from the lwres library distributed with BIND.
  288. dnl #########################################################################
  289. AC_ARG_ENABLE([emulate-getaddrinfo],
  290. ACX_HELP_STRING([--enable-emulate-getaddrinfo],
  291. [enable getaddrinfo emulation (default=no)]),
  292. ,
  293. enable_emulate_getaddrinfo=no)
  294. AC_ARG_WITH(lwres,
  295. ACX_HELP_STRING([--with-lwres=DIR],
  296. [use lwres library for getaddrinfo (default=no)]),
  297. ,
  298. with_lwres=no)
  299. dnl ## enable force to test getaddrinfo.c
  300. if test x$enable_emulate_getaddrinfo = xforce ; then
  301. enable_emulate_getaddrinfo=yes
  302. have_getaddrinfo=no
  303. else
  304. have_getaddrinfo=no
  305. if test x$with_lwres != xno ; then
  306. if test "$with_lwres" != yes ; then
  307. CPPFLAGS="-I${with_lwres}/include $CPPFLAGS"
  308. LDFLAGS="-L${with_lwres}/lib $LDFLAGS"
  309. fi
  310. AC_CHECK_HEADERS(lwres/netdb.h, ,
  311. [AC_MSG_ERROR([cannot find <lwres/netdb.h>])])
  312. AC_CHECK_LIB(lwres, lwres_getaddrinfo, ,
  313. [AC_MSG_ERROR([cannot find the lwres library])],
  314. -lnsl -lpthread)
  315. have_getaddrinfo=yes
  316. fi
  317. if test x$have_getaddrinfo != xyes ; then
  318. AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes)
  319. fi
  320. dnl # Special nonsense for systems that actually have getaddrinfo but
  321. dnl # redefine the name to something else, e.g. OSF
  322. if test x$have_getaddrinfo != xyes ; then
  323. AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h)
  324. AC_TRY_LINK([
  325. # include <netdb.h>
  326. ], [
  327. struct addrinfo hints, *res;
  328. int err;
  329. err = getaddrinfo ("host", "service", &hints, &res);
  330. ], [
  331. have_getaddrinfo=yes
  332. AC_MSG_RESULT(yes)
  333. ], [AC_MSG_RESULT(no)])
  334. fi
  335. fi
  336. if test x$have_getaddrinfo != xno ; then
  337. if test x$enable_emulate_getaddrinfo != xno ; then
  338. AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled])
  339. fi
  340. AC_DEFINE(HAVE_GETADDRINFO, 1,
  341. [Does system provide RFC 2553/Posix getaddrinfo?])
  342. else
  343. if test x$enable_emulate_getaddrinfo != xyes ; then
  344. dnl AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo])
  345. enable_emulate_getaddrinfo=yes
  346. AC_MSG_WARN([enabling getaddrinfo emulation])
  347. fi
  348. EXTRA_NETOBJS="$EXTRA_NETOBJS getaddrinfo.o"
  349. fi
  350. if test x"$enable_emulate_getaddrinfo" != xno ; then
  351. have_resolver=no
  352. dnl Try for getipnodebyname
  353. AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes)
  354. if test x"$have_resolver" != xno ; then
  355. AC_DEFINE(HAVE_GETIPNODEBYNAME, 1,
  356. [Set when getipnodebyname is available])
  357. fi
  358. dnl Try for gethostbyname_r
  359. if test x"$have_resolver" = xno ; then
  360. AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr,
  361. [have_resolver=yes
  362. ACX_WHICH_GETHOSTBYNAME_R])
  363. fi
  364. dnl Try for gethostbyname
  365. if test x"$have_resolver" = xno ; then
  366. if test x"$enable_pthreads" != xno ; then
  367. AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname])
  368. fi
  369. AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, ,
  370. [AC_MSG_ERROR([cannot find gethostbyname])])
  371. fi
  372. EXTRA_NETOBJS="$EXTRA_NETOBJS gethostbyname.o"
  373. fi
  374. dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
  375. AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
  376. if test "$FOUNDINCLUDE" = "no"; then
  377. _SAVEDCPPFLAGS="$CPPFLAGS"
  378. CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
  379. unset ac_cv_header_krb5_h
  380. AC_CHECK_HEADERS(krb5.h,
  381. KRB5INCLUDE="-I/usr/kerberos/include"
  382. FOUNDINCLUDE=yes,
  383. FOUNDINCLUDE=no)
  384. fi
  385. AC_SUBST(KRBINCLUDE)
  386. if test "$FOUNDINCLUDE" = "no"; then
  387. CPPFLAGS="$_SAVEDCPPFLAGS"
  388. fi
  389. dnl openssl detection/configuration
  390. if ! test "$with_openssl" = "no"; then
  391. dnl Check for OpenSSL location if it wasn't already specified
  392. if ! test -d "$with_openssl"; then
  393. for d in $OPENSSL_DIRS; do
  394. if test -x ${d}/bin/openssl || test -x ${d}/sbin/openssl ; then
  395. with_openssl=$d
  396. fi
  397. done
  398. fi
  399. _SAVEDCPPFLAGS="$CPPFLAGS"
  400. _SAVEDLDFLAGS="$LDFLAGS"
  401. dnl Check for OpenSSL header files
  402. unset FOUNDINCLUDE
  403. CPPFLAGS="$CPPFLAGS -I$OPENSSL/include"
  404. LDFLAGS="$LDFLAGS -R$OPENSSL/lib"
  405. dnl check for openssl in $dir/include/openssl
  406. AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
  407. SSLINCLUDE="-I$OPENSSL/include"
  408. FOUNDINCLUDE=yes,
  409. FOUNDINCLUDE=no)
  410. dnl else check to see if $dir/include has it
  411. if test "$FOUNDINCLUDE" = "no"; then
  412. AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
  413. SSLINCLUDE="-I$OPENSSL/include"
  414. FOUNDINCLUDE=yes,
  415. FOUNDINCLUDE=no)
  416. fi
  417. AC_SUBST(SSLINCLUDE)
  418. dnl if we didn't find it, reset CPPFLAGS
  419. if test "$FOUNDINCLUDE" = "no"; then
  420. CPPFLAGS="$_SAVEDCPPFLAGS"
  421. LDFLAGS="$_SAVEDLDFLAGS"
  422. fi
  423. dnl Check for crypto lib
  424. _SAVEDLIBS="$LIBS"
  425. LIBS="-L${with_openssl}/lib"
  426. AC_CHECK_LIB(crypto,CRYPTO_lock)
  427. if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
  428. dnl Check for SSL lib
  429. AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto)
  430. fi
  431. LIBS="$_SAVEDLIBS"
  432. dnl test headers and libs to decide whether check_http should use SSL
  433. if test "$ac_cv_lib_crypto_CRYPTO_lock" = "yes"; then
  434. if test "$ac_cv_lib_ssl_main" = "yes"; then
  435. if test "$FOUNDINCLUDE" = "yes"; then
  436. FOUNDOPENSSL="yes"
  437. fi
  438. fi
  439. fi
  440. fi
  441. dnl check for gnutls if openssl isn't found (or is disabled)
  442. if test ! "$FOUNDOPENSSL" = "yes" && test ! "$with_gnutls" = "no"; then
  443. if test ! "$with_gnutls" = ""; then
  444. CPPFLAGS="$CPPFLAGS -I${with_gnutls}/include"
  445. elif test ! "$LIBGNUTLS_CONFIG" = ""; then
  446. CPPFLAGS="$CPPFLAGS -I`$LIBGNUTLS_CONFIG --prefix`"
  447. fi
  448. AC_CHECK_HEADERS([gnutls/openssl.h],FOUNDGNUTLS="yes",)
  449. if test "$FOUNDGNUTLS" = "yes"; then
  450. AC_CHECK_LIB(gnutls-openssl,main,SSLLIBS="-lgnutls-openssl")
  451. fi
  452. fi
  453. dnl end check for gnutls
  454. if test "$FOUNDOPENSSL" = "yes" || test "$FOUNDGNUTLS" = "yes"; then
  455. check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
  456. AC_SUBST(check_tcp_ssl)
  457. AC_SUBST(SSLLIBS)
  458. AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
  459. if test "$FOUNDOPENSSL" = "yes"; then
  460. AC_DEFINE(USE_OPENSSL,1,[Define if using OpenSSL libraries])
  461. with_openssl="yes"
  462. with_gnutls="no"
  463. else
  464. AC_DEFINE(USE_GNUTLS,1,[Define if using gnutls libraries])
  465. with_gnutls="yes"
  466. with_openssl="no"
  467. fi
  468. else
  469. dnl else deliberately disabled or no ssl support available
  470. AC_MSG_WARN([OpenSSL or GnuTLS libs could not be found or were disabled])
  471. with_openssl="no"
  472. with_gnutls="no"
  473. fi
  474. dnl
  475. dnl Checks for header files.
  476. dnl
  477. AC_HEADER_STDC
  478. AC_HEADER_TIME
  479. AC_HEADER_SYS_WAIT
  480. AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h uio.h errno.h regex.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h sys/un.h)
  481. AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h stdlib.h)
  482. dnl Checks for typedefs, structures, and compiler characteristics.
  483. AC_C_CONST
  484. AC_STRUCT_TM
  485. AC_TYPE_PID_T
  486. AC_TYPE_SIZE_T
  487. AC_TYPE_SIGNAL
  488. AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
  489. AC_TRY_LINK([#include <stdarg.h>
  490. va_list ap1,ap2;], [va_copy(ap1,ap2);],
  491. ac_cv_HAVE_VA_COPY=yes,
  492. ac_cv_HAVE_VA_COPY=no)])
  493. if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
  494. AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
  495. else
  496. AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
  497. AC_TRY_LINK([#include <stdarg.h>
  498. va_list ap1,ap2;], [__va_copy(ap1,ap2);],
  499. ac_cv_HAVE___VA_COPY=yes,
  500. ac_cv_HAVE___VA_COPY=no)])
  501. if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
  502. AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
  503. fi
  504. fi
  505. AC_CHECK_FUNCS(vsnprintf snprintf asprintf vasprintf)
  506. AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[
  507. AC_TRY_RUN([
  508. #include <sys/types.h>
  509. #include <stdarg.h>
  510. void foo(const char *format, ...) {
  511. va_list ap;
  512. int len;
  513. char buf[5];
  514. va_start(ap, format);
  515. len = vsnprintf(buf, 0, format, ap);
  516. va_end(ap);
  517. if (len != 5) exit(1);
  518. va_start(ap, format);
  519. len = vsnprintf(0, 0, format, ap);
  520. va_end(ap);
  521. if (len != 5) exit(1);
  522. if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
  523. exit(0);
  524. }
  525. main() { foo("hello"); }
  526. ],
  527. ac_cv_HAVE_C99_VSNPRINTF=yes,ac_cv_HAVE_C99_VSNPRINTF=no,ac_cv_HAVE_C99_VSNPRINTF=cross)])
  528. if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
  529. AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Define if system has C99 compatible vsnprintf])
  530. fi
  531. AC_TRY_COMPILE([#include <sys/time.h>],
  532. [struct timeval *tv;
  533. struct timezone *tz;],
  534. AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
  535. AC_TRY_COMPILE([#include <sys/time.h>],
  536. [struct timeval *tv;
  537. struct timezone *tz;
  538. gettimeofday(tv, tz);],
  539. AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
  540. AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
  541. dnl Checks for library functions.
  542. AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul floor)
  543. AC_MSG_CHECKING(return type of socket size)
  544. AC_TRY_COMPILE([#include <stdlib.h>
  545. #include <sys/types.h>
  546. #include <sys/socket.h>],
  547. [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
  548. ac_cv_socket_size_type=["size_t"]
  549. AC_MSG_RESULT(size_t),
  550. ac_cv_socket_size_type=["int"]
  551. AC_MSG_RESULT(int))
  552. AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
  553. [Define type of socket size])
  554. AC_ARG_WITH(proc-loadavg,
  555. ACX_HELP_STRING([--with-proc-loadavg=PATH],
  556. [path to /proc/loadavg or equivalent]),
  557. ac_cv_proc_loadavg=$withval)
  558. AC_MSG_CHECKING([for /proc/loadavg])
  559. if test -n "$ac_cv_proc_loadavg"; then
  560. AC_MSG_RESULT([(command line) $ac_cv_proc_loadavg])
  561. elif test -f "/proc/loadavg"; then
  562. AC_MSG_RESULT([found /proc/loadavg])
  563. ac_cv_proc_loadavg="/proc/loadavg"
  564. else
  565. AC_MSG_RESULT([no])
  566. fi
  567. if test -n "$ac_cv_proc_loadavg"; then
  568. AC_DEFINE(HAVE_PROC_LOADAVG,1,[Define if /proc/loadavg or similar exists])
  569. AC_DEFINE_UNQUOTED(PROC_LOADAVG,"/proc/loadavg",[Location of /proc/loadavg])
  570. fi
  571. dnl #### Process table test
  572. AC_PATH_PROG(PATH_TO_PS,ps)
  573. AC_MSG_CHECKING(for ps syntax)
  574. AC_ARG_WITH(ps_command,
  575. ACX_HELP_STRING([--with-ps-command=PATH],
  576. [Verbatim command to execute for ps]),
  577. PS_COMMAND=$withval)
  578. AC_ARG_WITH(ps_format,
  579. ACX_HELP_STRING([--with-ps-format=FORMAT],
  580. [Format string for scanning ps output]),
  581. PS_FORMAT=$withval)
  582. AC_ARG_WITH(ps_cols,
  583. ACX_HELP_STRING([--with-ps-cols=NUM],
  584. [Number of columns in ps command]),
  585. PS_COLS=$withval)
  586. AC_ARG_WITH(ps_varlist,
  587. ACX_HELP_STRING([--with-ps-varlist=LIST],
  588. [Variable list for sscanf of 'ps' output]),
  589. PS_VARLIST=$withval)
  590. AM_CONDITIONAL(WANT_PST3, false)
  591. if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
  592. ac_cv_ps_command="$PS_COMMAND"
  593. ac_cv_ps_format="$PS_FORMAT"
  594. ac_cv_ps_varlist="$PS_VARLIST"
  595. ac_cv_ps_cols="$PS_COLS"
  596. AC_MSG_RESULT([(command-line) $ac_cv_ps_command])
  597. dnl Now using the pst3/kmem hack for solaris systems to avoid truncation
  598. elif test "$ac_cv_uname_s" = "SunOS"; then
  599. #
  600. # this is a very, very ugly hack, to hardcode the location for plugins
  601. #
  602. if test "$libexecdir" = '${exec_prefix}/libexec'; then
  603. if test "$exec_prefix" = "NONE"; then
  604. if test "$prefix" = "NONE"; then
  605. pst3="$ac_default_prefix/libexec/pst3"
  606. else
  607. pst3="$prefix/libexec/pst3"
  608. fi
  609. else
  610. pst3="$exec_prefix/libexec/pst3"
  611. fi
  612. else
  613. pst3="$libexecdir/pst3"
  614. fi
  615. ac_cv_ps_command="$pst3"
  616. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  617. ac_cv_ps_varlist="[procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  618. ac_cv_ps_cols=8
  619. AC_MSG_RESULT([using nagios-plugins internal ps for solaris])
  620. AM_CONDITIONAL(WANT_PST3, true)
  621. dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo.
  622. dnl so test for this first...
  623. elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
  624. egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
  625. then
  626. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  627. ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu comm args'"
  628. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  629. ac_cv_ps_cols=9
  630. AC_MSG_RESULT([$ac_cv_ps_command])
  631. dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
  632. dnl Should also work for FreeBSD 5.2.1 and 5.3
  633. dnl STAT UCOMM VSZ RSS USER PPID COMMAND
  634. elif ps -axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
  635. egrep -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
  636. then
  637. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  638. ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu comm args'"
  639. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  640. ac_cv_ps_cols=9
  641. AC_MSG_RESULT([$ac_cv_ps_command])
  642. dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4.
  643. dnl Limitation: Only first 16 chars returned for ucomm field
  644. dnl Must come before ps -weo
  645. elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
  646. egrep -i ["^ *STAT +UID +PID +PPID +VSZ +RSS +%CPU +UCOMM +COMMAND"] > /dev/null
  647. then
  648. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  649. ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu ucomm command'"
  650. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  651. ac_cv_ps_cols=9
  652. AC_MSG_RESULT([$ac_cv_ps_command])
  653. dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
  654. elif ps -weo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
  655. egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[ELAPSD]+ +[RGSCOMDNA]+"] >/dev/null
  656. then
  657. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]"
  658. ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid pid ppid vsz rss pcpu etime comm args'"
  659. ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
  660. ac_cv_ps_cols=10
  661. AC_MSG_RESULT([$ac_cv_ps_command])
  662. dnl FreeBSD
  663. elif ps waxco 'state command vsz rss uid user pid ppid' 2>/dev/null | \
  664. egrep -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PID +PPID"] >/dev/null
  665. then
  666. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  667. ac_cv_ps_command="$PATH_TO_PS waxco 'state uid pid ppid vsz rss pcpu command command'"
  668. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  669. ac_cv_ps_cols=9
  670. AC_MSG_RESULT([$ac_cv_ps_command])
  671. dnl BSD-like mode in RH 6.1
  672. elif ps waxno 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
  673. egrep -i ["^S +COMMAND +VSZ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  674. then
  675. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  676. ac_cv_ps_command="$PATH_TO_PS waxno 'state uid pid ppid vsz rss pcpu comm args'"
  677. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  678. ac_cv_ps_cols=9
  679. AC_MSG_RESULT([$ac_cv_ps_command])
  680. dnl SunOS 4.1.3:
  681. dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
  682. dnl Need the head -1 otherwise test will work because arguments are found
  683. elif ps -laxnwww 2>/dev/null | head -1 | \
  684. egrep -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
  685. then
  686. ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
  687. ac_cv_ps_command="$PATH_TO_PS -laxnwww"
  688. ac_cv_ps_format="%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
  689. ac_cv_ps_cols=9
  690. AC_MSG_RESULT([$ac_cv_ps_command])
  691. dnl Debian Linux / procps v1.2.9:
  692. dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
  693. dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2]
  694. dnl
  695. elif ps laxnwww 2>/dev/null | \
  696. egrep -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
  697. then
  698. ac_cv_ps_varlist="[&procuid,&procpid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
  699. ac_cv_ps_command="$PATH_TO_PS laxnwww"
  700. ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
  701. ac_cv_ps_cols=9
  702. AC_MSG_RESULT([$ac_cv_ps_command])
  703. dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
  704. elif ps -axo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
  705. egrep -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
  706. then
  707. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  708. ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid pid ppid vsz rss pcpu comm args'"
  709. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  710. ac_cv_ps_cols=9
  711. AC_MSG_RESULT([$ac_cv_ps_command])
  712. dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
  713. dnl Has /usr/bin/ps and /sbin/ps - force sbin version
  714. dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
  715. dnl of 1500). Will need big changes to check_procs to support
  716. elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
  717. egrep -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
  718. then
  719. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos]"
  720. ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
  721. ac_cv_ps_format=["%s%*[ +<>] %d %d %d %f %s %s %n"]
  722. ac_cv_ps_cols=8
  723. AC_MSG_RESULT([$ac_cv_ps_command])
  724. elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
  725. egrep -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
  726. then
  727. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  728. ac_cv_ps_command="$PATH_TO_PS -eo 's uid pid ppid vsz rss pcpu comm args'"
  729. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  730. ac_cv_ps_cols=9
  731. AC_MSG_RESULT([$ac_cv_ps_command])
  732. dnl AIX 4.3.3 and 5.1 do not have an rss field
  733. elif ps -eo 'stat uid pid ppid vsz pcpu comm args' 2>/dev/null | \
  734. egrep -i ["^ *S[TAUES]* +UID +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
  735. then
  736. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
  737. ac_cv_ps_command="$PATH_TO_PS -eo 'stat uid pid ppid vsz pcpu comm args'"
  738. ac_cv_ps_format="%s %d %d %d %d %f %s %n"
  739. ac_cv_ps_cols=8
  740. AC_MSG_RESULT([$ac_cv_ps_command - with no RSS])
  741. dnl Solaris 2.6
  742. elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
  743. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  744. then
  745. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  746. ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
  747. # There must be no space between the %s and %n due to a wierd problem in sscanf where
  748. # it will return %n as longer than the line length
  749. ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
  750. ac_cv_ps_cols=9
  751. AC_MSG_RESULT([$ac_cv_ps_command])
  752. elif ps -Ao 'status comm vsz rss uid user pid ppid args' 2>/dev/null | \
  753. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  754. then
  755. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  756. ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid pid ppid vsz rss pcpu comm args'"
  757. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  758. ac_cv_ps_cols=9
  759. AC_MSG_RESULT([$ac_cv_ps_command])
  760. elif ps -Ao 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
  761. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  762. then
  763. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  764. ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid pid ppid vsz rss pcpu comm args'"
  765. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  766. ac_cv_ps_cols=9
  767. AC_MSG_RESULT([$ac_cv_ps_command])
  768. dnl wonder who takes state instead of stat
  769. elif ps -ao 'state command vsz rss user pid ppid args' 2>/dev/null | \
  770. egrep -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
  771. then
  772. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
  773. ac_cv_ps_command="$PATH_TO_PS -ao 'state uid pid ppid vsz rss pcpu command args'"
  774. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  775. ac_cv_ps_cols=8
  776. AC_MSG_RESULT([$ac_cv_ps_command])
  777. dnl IRIX 53
  778. elif ps -el 2>/dev/null | \
  779. egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
  780. then
  781. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&pos,procprog]"
  782. ac_cv_ps_command="$PATH_TO_PS -el (IRIX 53)"
  783. ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
  784. ac_cv_ps_cols=8
  785. AC_MSG_RESULT([$ac_cv_ps_command])
  786. dnl IRIX 63
  787. elif ps -el 2>/dev/null | \
  788. egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
  789. then
  790. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
  791. ac_cv_ps_command="$PATH_TO_PS -el (IRIX 63)"
  792. ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
  793. ac_cv_ps_cols=6
  794. AC_MSG_RESULT([$ac_cv_ps_command])
  795. dnl AIX 4.1:
  796. dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
  797. dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper
  798. elif ps -el 2>/dev/null | \
  799. egrep -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
  800. then
  801. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
  802. ac_cv_ps_command="$PATH_TO_PS -el (AIX 4.1 and HP-UX)"
  803. ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
  804. ac_cv_ps_cols=6
  805. AC_MSG_RESULT([$ac_cv_ps_command])
  806. dnl AIX?
  807. elif ps glaxen 2>/dev/null | \
  808. egrep -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
  809. then
  810. ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
  811. ac_cv_ps_command="$PATH_TO_PS glaxen"
  812. ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
  813. ac_cv_ps_cols=8
  814. AC_MSG_RESULT([$ac_cv_ps_command])
  815. dnl MacOSX / Darwin
  816. dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
  817. dnl Some truncation will happen in UCOMM column
  818. dnl STAT VSZ RSS UID PPID %CPU UCOMM COMMAND
  819. dnl Ss 52756 22496 501 1 6.9 Window Manager /System/Library/CoreServices/WindowServer -daemon
  820. elif ps wwaxo 'state vsz rss uid pid ppid pcpu ucomm command' 2>/dev/null | \
  821. egrep -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
  822. then
  823. ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid pid ppid pcpu ucomm command'"
  824. ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procpid,&procppid,&procpcpu,procprog,&pos]"
  825. ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
  826. ac_cv_ps_cols=8
  827. AC_MSG_RESULT([$ac_cv_ps_command])
  828. dnl UnixWare
  829. elif ps -Al 2>/dev/null | \
  830. egrep -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
  831. then
  832. ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
  833. ac_cv_ps_command="$PATH_TO_PS -Al"
  834. ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
  835. ac_cv_ps_cols=8
  836. AC_MSG_RESULT([$ac_cv_ps_command])
  837. else
  838. AC_MSG_WARN([unable to find usable ps syntax - check_procs and check_nagios will not be compiled])
  839. fi
  840. if test -n "$ac_cv_ps_varlist" ; then
  841. AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
  842. [Variable list for sscanf of 'ps' output])
  843. AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
  844. [Verbatim command to execute for ps in check_procs])
  845. AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
  846. [Format string for scanning ps output in check_procs])
  847. AC_DEFINE_UNQUOTED(PS_COLS,$ac_cv_ps_cols,
  848. [Number of columns in ps command])
  849. EXTRAS="$EXTRAS check_procs check_nagios"
  850. if echo "$ac_cv_ps_varlist" | grep -q "procetime"; then
  851. AC_DEFINE(PS_USES_PROCETIME,"yes",
  852. [Whether the ps utility uses the "procetime" field])
  853. fi
  854. fi
  855. AC_PATH_PROG(PATH_TO_PING,ping)
  856. AC_PATH_PROG(PATH_TO_PING6,ping6)
  857. AC_ARG_WITH(ping_command,
  858. ACX_HELP_STRING([--with-ping-command=SYNTAX],
  859. [sets syntax for ICMP ping]),
  860. with_ping_command=$withval,)
  861. AC_MSG_CHECKING(for ICMP ping syntax)
  862. ac_cv_ping_packets_first=no
  863. ac_cv_ping_has_timeout=no
  864. if test -n "$with_ping_command"
  865. then
  866. AC_MSG_RESULT([(command-line) $with_ping_command])
  867. if test -n "$ac_cv_ping_packets_first"
  868. then
  869. ac_cv_ping_packets_first=yes
  870. ac_cv_ping_has_timeout=yes
  871. fi
  872. elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
  873. $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
  874. egrep -i "^round-trip|^rtt" >/dev/null
  875. then
  876. with_ping_command="$PATH_TO_PING -n -U -c %d %s"
  877. ac_cv_ping_packets_first=yes
  878. AC_MSG_RESULT([$with_ping_command])
  879. elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
  880. egrep -i "^round-trip|^rtt" >/dev/null
  881. then
  882. with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
  883. ac_cv_ping_packets_first=yes
  884. ac_cv_ping_has_timeout=yes
  885. AC_MSG_RESULT([$with_ping_command])
  886. elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
  887. egrep -i "^round-trip|^rtt" >/dev/null
  888. then
  889. with_ping_command="$PATH_TO_PING -n -U -c %d %s"
  890. ac_cv_ping_packets_first=yes
  891. AC_MSG_RESULT([$with_ping_command])
  892. elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
  893. egrep -i "^round-trip|^rtt" >/dev/null
  894. then
  895. with_ping_command="$PATH_TO_PING -n -c %d %s"
  896. ac_cv_ping_packets_first=yes
  897. AC_MSG_RESULT([$with_ping_command])
  898. elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
  899. egrep -i "^round-trip|^rtt" >/dev/null
  900. then
  901. with_ping_command="$PATH_TO_PING -n %s -c %d"
  902. AC_MSG_RESULT([$with_ping_command])
  903. elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
  904. egrep -i "^round-trip|^rtt" >/dev/null
  905. then
  906. with_ping_command="$PATH_TO_PING %s -n %d"
  907. AC_MSG_RESULT([$with_ping_command])
  908. elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
  909. egrep -i "^round-trip|^rtt" >/dev/null
  910. then
  911. with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
  912. AC_MSG_RESULT([$with_ping_command])
  913. elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
  914. egrep -i "^round-trip|^rtt" >/dev/null
  915. then
  916. with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
  917. AC_MSG_RESULT([$with_ping_command])
  918. elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
  919. egrep -i "^round-trip|^rtt" >/dev/null
  920. then
  921. with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
  922. ac_cv_ping_packets_first=yes
  923. AC_MSG_RESULT([$with_ping_command])
  924. elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
  925. egrep -i "^round-trip|^rtt" >/dev/null
  926. then
  927. with_ping_command="$PATH_TO_PING -n -c %d %s"
  928. ac_cv_ping_packets_first=yes
  929. AC_MSG_RESULT([$with_ping_command])
  930. else
  931. AC_MSG_WARN([unable to find usable ping syntax])
  932. fi
  933. AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
  934. [path and args for ICMP ping command])
  935. if test "x$ac_cv_ping_packets_first" != "xno"
  936. then
  937. AC_DEFINE(PING_PACKETS_FIRST,1,
  938. [Define if packet count must precede host])
  939. fi
  940. if test "x$ac_cv_ping_has_timeout" != "xno"
  941. then
  942. AC_DEFINE(PING_HAS_TIMEOUT,1,
  943. [Define if ping has its own timeout option that should be set])
  944. fi
  945. AC_ARG_WITH(ping6_command,
  946. ACX_HELP_STRING([--with-ping6-command=SYNTAX],
  947. [sets syntax for ICMPv6 ping]),
  948. with_ping6_command=$withval,)
  949. if test x"$with_ipv6" != xno ; then
  950. AC_MSG_CHECKING(for ICMPv6 ping syntax)
  951. ac_cv_ping6_packets_first=no
  952. if test -n "$with_ping6_command"
  953. then
  954. AC_MSG_RESULT([(command-line) $with_ping6_command])
  955. if test -n "$ac_cv_ping6_packets_first"
  956. then
  957. ac_cv_ping6_packets_first=yes
  958. fi
  959. elif test "x$PATH_TO_PING6" != "x"; then
  960. if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
  961. $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
  962. egrep -i "^round-trip|^rtt" >/dev/null
  963. then
  964. with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
  965. ac_cv_ping6_packets_first=yes
  966. AC_MSG_RESULT([$with_ping6_command])
  967. elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
  968. egrep -i "^round-trip|^rtt" >/dev/null
  969. then
  970. with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
  971. ac_cv_ping6_packets_first=yes
  972. ac_cv_ping_has_timeout=yes
  973. AC_MSG_RESULT([$with_ping6_command])
  974. elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
  975. egrep -i "^round-trip|^rtt" >/dev/null
  976. then
  977. with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
  978. ac_cv_ping6_packets_first=yes
  979. AC_MSG_RESULT([$with_ping6_command])
  980. elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
  981. egrep -i "^round-trip|^rtt" >/dev/null
  982. then
  983. with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
  984. ac_cv_ping6_packets_first=yes
  985. AC_MSG_RESULT([$with_ping6_command])
  986. elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
  987. egrep -i "^round-trip|^rtt" >/dev/null
  988. then
  989. with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
  990. AC_MSG_RESULT([$with_ping6_command])
  991. elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
  992. egrep -i "^round-trip|^rtt" >/dev/null
  993. then
  994. with_ping6_command="$PATH_TO_PING6 %s -n %d"
  995. AC_MSG_RESULT([$with_ping6_command])
  996. elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
  997. egrep -i "^round-trip|^rtt" >/dev/null
  998. then
  999. with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
  1000. AC_MSG_RESULT([$with_ping6_command])
  1001. elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
  1002. egrep -i "^round-trip|^rtt" >/dev/null
  1003. then
  1004. with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
  1005. AC_MSG_RESULT([$with_ping6_command])
  1006. elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
  1007. egrep -i "^round-trip|^rtt" >/dev/null
  1008. then
  1009. with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
  1010. ac_cv_ping6_packets_first=yes
  1011. AC_MSG_RESULT([$with_ping_command])
  1012. elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
  1013. egrep -i "^round-trip|^rtt" >/dev/null
  1014. then
  1015. with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
  1016. ac_cv_ping6_packets_first=yes
  1017. AC_MSG_RESULT([$with_ping6_command])
  1018. fi
  1019. elif test "x$PATH_TO_PING" != "x"; then
  1020. if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
  1021. $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
  1022. egrep -i "^round-trip|^rtt" >/dev/null
  1023. then
  1024. with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
  1025. ac_cv_ping6_packets_first=yes
  1026. AC_MSG_RESULT([$with_ping6_command])
  1027. elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
  1028. egrep -i "^round-trip|^rtt" >/dev/null
  1029. then
  1030. with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
  1031. ac_cv_ping6_packets_first=yes
  1032. AC_MSG_RESULT([$with_ping6_command])
  1033. elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
  1034. egrep -i "^round-trip|^rtt" >/dev/null
  1035. then
  1036. with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
  1037. ac_cv_ping6_packets_first=yes
  1038. AC_MSG_RESULT([$with_ping6_command])
  1039. elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
  1040. egrep -i "^round-trip|^rtt" >/dev/null
  1041. then
  1042. with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
  1043. AC_MSG_RESULT([$with_ping6_command])
  1044. elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
  1045. egrep -i "^round-trip|^rtt" >/dev/null
  1046. then
  1047. with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
  1048. AC_MSG_RESULT([$with_ping6_command])
  1049. elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
  1050. egrep -i "^round-trip|^rtt" >/dev/null
  1051. then
  1052. with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
  1053. AC_MSG_RESULT([$with_ping6_command])
  1054. elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
  1055. egrep -i "^round-trip|^rtt" >/dev/null
  1056. then
  1057. with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
  1058. AC_MSG_RESULT([$with_ping6_command])
  1059. elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
  1060. egrep -i "^round-trip|^rtt" >/dev/null
  1061. then
  1062. with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
  1063. ac_cv_ping6_packets_first=yes
  1064. AC_MSG_RESULT([$with_ping_command])
  1065. elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
  1066. egrep -i "^round-trip|^rtt" >/dev/null
  1067. then
  1068. with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
  1069. ac_cv_ping6_packets_first=yes
  1070. AC_MSG_RESULT([$with_ping6_command])
  1071. fi
  1072. fi
  1073. if test "x$with_ping6_command" != "x"; then
  1074. AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
  1075. [path and args for ICMPv6 ping command])
  1076. else
  1077. AC_MSG_RESULT([none])
  1078. fi
  1079. if test "x$ac_cv_ping6_packets_first" != "xno"; then
  1080. AC_DEFINE(PING6_PACKETS_FIRST,1,
  1081. [Define if packet count must precede host])
  1082. fi
  1083. fi
  1084. AC_MSG_CHECKING(for nslookup syntax)
  1085. AC_ARG_WITH(nslookup_command,
  1086. ACX_HELP_STRING([--with-nslookup-command=PATH],
  1087. [sets path to nslookup executable]),
  1088. ac_cv_nslookup_command=$withval)
  1089. if test -n "$ac_cv_nslookup_command"; then
  1090. AC_MSG_RESULT([(command line) $ac_cv_nslookup_command])
  1091. else
  1092. AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
  1093. if test -n "$PATH_TO_NSLOOKUP"
  1094. then
  1095. if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
  1096. then
  1097. ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
  1098. AC_MSG_RESULT([$ac_cv_nslookup_command])
  1099. else
  1100. ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
  1101. AC_MSG_RESULT([$ac_cv_nslookup_command])
  1102. fi
  1103. else
  1104. AC_MSG_WARN([nslookup command not found])
  1105. fi
  1106. fi
  1107. if test -n "$ac_cv_nslookup_command"; then
  1108. EXTRAS="$EXTRAS check_dns"
  1109. AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
  1110. fi
  1111. AC_PATH_PROG(PATH_TO_HOST,host)
  1112. if test -n "$ac_cv_path_PATH_TO_HOST"
  1113. then
  1114. EXTRAS="$EXTRAS check_dns"
  1115. fi
  1116. AC_PATH_PROG(PATH_TO_UPTIME,uptime)
  1117. AC_ARG_WITH(uptime_command,
  1118. ACX_HELP_STRING([--with-uptime-command=PATH],
  1119. [sets path to uptime]), PATH_TO_UPTIME=$withval)
  1120. AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
  1121. AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
  1122. AC_ARG_WITH(rpcinfo_command,
  1123. ACX_HELP_STRING([--with-rpcinfo-command=PATH],
  1124. [sets path to rpcinfo]), PATH_TO_RPCINFO=$withval)
  1125. AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
  1126. AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate)
  1127. AC_ARG_WITH(ntpdate_command,
  1128. ACX_HELP_STRING([--with-ntpdate-command=PATH],
  1129. [sets path to ntpdate]), PATH_TO_NTPDATE=$withval)
  1130. AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc)
  1131. AC_PATH_PROGS(PATH_TO_NTPQ,ntpq)
  1132. if (test -n "$PATH_TO_NTPDATE" || test -n "$PATH_TO_NTPQ")
  1133. then
  1134. AC_DEFINE_UNQUOTED(PATH_TO_NTPQ,"$PATH_TO_NTPQ",[path to ntpq binary])
  1135. AC_DEFINE_UNQUOTED(PATH_TO_NTPDATE,"$PATH_TO_NTPDATE",[path to ntpdate binary])
  1136. else
  1137. AC_MSG_WARN([Install NTP programs (http://www.ntp.org) if you want to monitor time synchronization])
  1138. fi
  1139. AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
  1140. if test -x "$PATH_TO_LMSTAT"
  1141. then
  1142. AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
  1143. else
  1144. AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
  1145. fi
  1146. AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
  1147. AC_ARG_WITH(smbclient_command,
  1148. ACX_HELP_STRING([--with-smbclient-command=PATH],
  1149. [sets path to smbclient]),
  1150. PATH_TO_SMBCLIENT=$withval)
  1151. if test -n "$PATH_TO_SMBCLIENT"
  1152. then
  1153. AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
  1154. else
  1155. AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
  1156. fi
  1157. AC_PATH_PROG(PATH_TO_WHO,who)
  1158. if [$PATH_TO_WHO -q 2>/dev/null | egrep -i "^# users=[0-9]+$" >/dev/null]
  1159. then
  1160. ac_cv_path_to_who="$PATH_TO_WHO -q"
  1161. else
  1162. ac_cv_path_to_who="$PATH_TO_WHO"
  1163. fi
  1164. AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
  1165. [path and arguments for invoking 'who'])
  1166. AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
  1167. AC_ARG_WITH(snmpget_command,
  1168. ACX_HELP_STRING([--with-snmpget-command=PATH],
  1169. [Path to snmpget command]),
  1170. PATH_TO_SNMPGET=$withval)
  1171. if test -n "$PATH_TO_SNMPGET"
  1172. then
  1173. AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
  1174. EXTRAS="$EXTRAS check_hpjd check_snmp"
  1175. else
  1176. AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
  1177. fi
  1178. AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
  1179. AC_ARG_WITH(snmpgetnext_command,
  1180. ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
  1181. [Path to snmpgetnext command]),
  1182. PATH_TO_SNMPGETNEXT=$withval)
  1183. if test -n "$PATH_TO_SNMPGETNEXT"
  1184. then
  1185. AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
  1186. fi
  1187. if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
  1188. then
  1189. AC_MSG_CHECKING(for Net::SNMP perl module)
  1190. AC_MSG_RESULT([found])
  1191. else
  1192. AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
  1193. fi
  1194. AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
  1195. AC_PATH_PROG(PATH_TO_QSTAT,qstat)
  1196. AC_ARG_WITH(qstat_command,
  1197. ACX_HELP_STRING([--with-qstat-command=PATH],
  1198. [Path to qstat command]), PATH_TO_QSTAT=$withval)
  1199. if test -x "$PATH_TO_QUAKESTAT"
  1200. then
  1201. ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
  1202. EXTRAS="$EXTRAS check_game"
  1203. elif test -n "$PATH_TO_QSTAT"
  1204. then
  1205. ac_cv_path_to_qstat="$PATH_TO_QSTAT"
  1206. EXTRAS="$EXTRAS check_game"
  1207. else
  1208. AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
  1209. fi
  1210. if test $ac_cv_path_to_qstat
  1211. then
  1212. AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
  1213. [path to qstat/quakestat])
  1214. fi
  1215. AC_PATH_PROG(PATH_TO_FPING,fping)
  1216. AC_ARG_WITH(fping_command,
  1217. ACX_HELP_STRING([--with-fping-command=PATH],
  1218. [Path to fping command]), PATH_TO_FPING=$withval)
  1219. if test -n "$PATH_TO_FPING"
  1220. then
  1221. AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
  1222. EXTRAS="$EXTRAS check_fping"
  1223. else
  1224. AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
  1225. fi
  1226. AC_PATH_PROG(PATH_TO_SSH,ssh)
  1227. AC_ARG_WITH(ssh_command,
  1228. ACX_HELP_STRING([--with-ssh-command=PATH],
  1229. [sets path for ssh]), PATH_TO_SSH=$withval)
  1230. if test -n "$PATH_TO_SSH"
  1231. then
  1232. AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
  1233. EXTRAS="$EXTRAS check_by_ssh"
  1234. else
  1235. AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
  1236. fi
  1237. AC_PATH_PROG(PATH_TO_MAILQ,mailq)
  1238. AC_ARG_WITH(mailq_command,
  1239. ACX_HELP_STRING([--with-mailq-command=PATH],
  1240. [sets path to mailq]), PATH_TO_MAILQ=$withval)
  1241. if test -n "$PATH_TO_MAILQ"
  1242. then
  1243. AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
  1244. else
  1245. AC_MSG_WARN([Could not find mailq or eqivalent])
  1246. fi
  1247. AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
  1248. if test -x "$PATH_TO_QMAIL_QSTAT"
  1249. then
  1250. AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
  1251. else
  1252. AC_MSG_WARN([Could not find qmail-qstat or eqivalent])
  1253. fi
  1254. dnl SWAP info required is amount allocated/available and amount free
  1255. dnl The plugin works through all the swap devices and adds up the total swap
  1256. dnl available.
  1257. AC_PATH_PROG(PATH_TO_SWAP,swap)
  1258. if (test -n "$PATH_TO_SWAP")
  1259. then
  1260. AC_MSG_CHECKING([for $PATH_TO_SWAP format])
  1261. if [$PATH_TO_SWAP -l 2>&1 >/dev/null]
  1262. then
  1263. ac_cv_have_swap=yes
  1264. ac_cv_swap_command="$PATH_TO_SWAP -l"
  1265. if [$PATH_TO_SWAP -l 2>/dev/null | \
  1266. egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
  1267. >/dev/null]
  1268. then
  1269. ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"]
  1270. ac_cv_swap_conv=2048
  1271. AC_MSG_RESULT([using IRIX format swap])
  1272. elif [$PATH_TO_SWAP -l 2>/dev/null | egrep -i "^path +dev +swaplo +blocks +free" >/dev/null]
  1273. then
  1274. ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"]
  1275. ac_cv_swap_conv=2048
  1276. AC_MSG_RESULT([using Unixware format swap])
  1277. else
  1278. dnl if we don't know what format swap's output is
  1279. dnl we might as well pretend we didn't see it
  1280. ac_cv_have_swap=""
  1281. ac_cv_swap_command=""
  1282. fi
  1283. fi
  1284. dnl end if for PATH_TO_SWAP
  1285. fi
  1286. AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
  1287. if (test -n "$PATH_TO_SWAPINFO")
  1288. then
  1289. AC_MSG_CHECKING([for $PATH_TO_SWAPINFO format])
  1290. if [$PATH_TO_SWAPINFO -k 2>&1 | egrep -i "^Device" >/dev/null]
  1291. then
  1292. ac_cv_have_swap=yes
  1293. ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
  1294. if [$PATH_TO_SWAPINFO -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null]
  1295. then
  1296. ac_cv_swap_format=["%*s %f %*d %f"]
  1297. ac_cv_swap_conv=1024
  1298. AC_MSG_RESULT([using FreeBSD format swapinfo])
  1299. fi
  1300. elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
  1301. then
  1302. ac_cv_have_swap=yes
  1303. ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM",
  1304. ac_cv_swap_format=["%*s %f %*d %f"]
  1305. ac_cv_swap_conv=1024
  1306. AC_MSG_RESULT([using HP-UX format swapinfo])
  1307. fi
  1308. dnl end if for PATH_TO_SWAPINFO
  1309. fi
  1310. AC_PATH_PROG(PATH_TO_LSPS,lsps)
  1311. if (test -n "$PATH_TO_LSPS")
  1312. then
  1313. AC_MSG_CHECKING([for $PATH_TO_LSPS format])
  1314. if [$PATH_TO_LSPS -a 2>/dev/null | egrep -i "^Page Space" > /dev/null]
  1315. then
  1316. ac_cv_have_swap=yes
  1317. ac_cv_swap_command="$PATH_TO_LSPS -a"
  1318. ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"]
  1319. ac_cv_swap_conv=1
  1320. AC_MSG_RESULT([using AIX lsps])
  1321. fi
  1322. dnl end if for PATH_TO_SWAPINFO
  1323. fi
  1324. dnl
  1325. dnl test for swapctl system call, both the 2-arg and 3-arg variants
  1326. dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared
  1327. dnl in the various BSD's
  1328. dnl
  1329. AC_CHECK_HEADERS([sys/stat.h sys/param.h])
  1330. AC_CHECK_HEADERS([sys/swap.h], [], [], [
  1331. #ifdef HAVE_SYS_PARAM_H
  1332. #include <sys/param.h>
  1333. #endif
  1334. ])
  1335. AC_CHECK_DECLS([swapctl],,,[
  1336. #include <unistd.h>
  1337. #include <sys/types.h>
  1338. #include <sys/param.h>
  1339. #include <sys/stat.h>
  1340. #include <sys/swap.h>
  1341. ])
  1342. AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[
  1343. #include <sys/types.h>
  1344. #include <sys/param.h>
  1345. #include <sys/stat.h>
  1346. #include <sys/swap.h>
  1347. ])
  1348. AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
  1349. #include <unistd.h>
  1350. #include <sys/types.h>
  1351. #include <sys/param.h>
  1352. #include <sys/stat.h>
  1353. #include <sys/swap.h>
  1354. ])
  1355. if test "$ac_cv_have_decl_swapctl" = "yes";
  1356. then
  1357. EXTRAS="$EXTRAS check_swap"
  1358. AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
  1359. if test "$ac_cv_type_swaptbl_t" = "yes" -a \
  1360. "$ac_cv_type_swapent_t" = "yes";
  1361. then
  1362. AC_MSG_RESULT([yes])
  1363. ac_cv_check_swap_swapctl_svr4="1";
  1364. AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1,
  1365. [Define if 2-argument SVR4 swapctl exists])
  1366. else
  1367. AC_MSG_RESULT([no])
  1368. AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
  1369. if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
  1370. then
  1371. AC_MSG_RESULT([yes])
  1372. AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
  1373. [Define if 3-argument BSD swapctl exists])
  1374. else
  1375. AC_MSG_RESULT([no])
  1376. fi
  1377. fi
  1378. AC_MSG_CHECKING([for whether swapctl uses blocks or pages])
  1379. if test "$ac_cv_check_swap_swapctl_svr4" = "1";
  1380. then
  1381. dnl
  1382. dnl the SVR4 spec returns values in pages
  1383. dnl
  1384. AC_MSG_RESULT([page])
  1385. AC_CHECK_DECLS([sysconf])
  1386. AC_MSG_CHECKING([for system page size])
  1387. if test "$ac_cv_have_decl_sysconf" = "yes";
  1388. then
  1389. AC_MSG_RESULT([determined by sysconf(3)])
  1390. ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
  1391. else
  1392. AC_MSG_WARN([don't know. guessing 4096k])
  1393. ac_cv_swap_conv=256
  1394. fi
  1395. else
  1396. dnl
  1397. dnl the BSD spec returns values in blocks
  1398. dnl
  1399. AC_MSG_RESULT([blocks (assuming 512b)])
  1400. ac_cv_swap_conv=2048
  1401. fi
  1402. AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
  1403. [Conversion factor to MB])
  1404. fi
  1405. dnl
  1406. dnl end tests for the swapctl system calls
  1407. dnl
  1408. if test "x$ac_cv_have_swap" != "x"
  1409. then
  1410. AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
  1411. EXTRAS="$EXTRAS check_swap"
  1412. fi
  1413. if test "x$ac_cv_swap_command" != "x"
  1414. then
  1415. AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
  1416. [Path to swap/swapinfo binary, with any args])
  1417. AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
  1418. [Format string for parsing swap output])
  1419. AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
  1420. [Conversion factor to MB])
  1421. fi
  1422. AC_ARG_WITH(proc-meminfo,
  1423. ACX_HELP_STRING([--with-proc-meminfo=PATH],
  1424. [path to /proc/meminfo or equivalent]),
  1425. ac_cv_proc_meminfo=$withval)
  1426. dnl dunno why this does not work below - use hack (kbd)
  1427. dnl fine on linux, broken on solaris
  1428. dnl if /bin/test -e "/proc/meminfo"
  1429. AC_MSG_CHECKING([for /proc/meminfo])
  1430. if test -n "$ac_cv_proc_meminfo"; then
  1431. AC_MSG_RESULT([(command line) $ac_cv_proc_meminfo])
  1432. elif [cat /proc/meminfo > /dev/null 2>&1]; then
  1433. AC_MSG_RESULT([found /proc/meminfo])
  1434. ac_cv_proc_meminfo="/proc/meminfo"
  1435. else
  1436. AC_MSG_RESULT([no])
  1437. fi
  1438. if test -n "$ac_cv_proc_meminfo"; then
  1439. AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
  1440. AC_DEFINE_UNQUOTED(PROC_MEMINFO,"$ac_cv_proc_meminfo",[path to /proc/meminfo if name changes])
  1441. EXTRAS="$EXTRAS check_swap"
  1442. fi
  1443. AC_PATH_PROG(PATH_TO_DIG,dig)
  1444. AC_ARG_WITH(dig_command,
  1445. ACX_HELP_STRING([--with-dig-command=PATH],
  1446. [Path to dig command]), PATH_TO_DIG=$withval)
  1447. if test -n "$PATH_TO_DIG"; then
  1448. EXTRAS="$EXTRAS check_dig"
  1449. AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
  1450. fi
  1451. if test -f plugins/check_nt.c ; then
  1452. EXTRAS="$EXTRAS check_nt"
  1453. elif test -f ../plugins/check_nt.c ; then
  1454. EXTRAS="$EXTRAS check_nt"
  1455. fi
  1456. AC_MSG_CHECKING(for va_list)
  1457. AC_TRY_COMPILE([#ifdef __STDC__
  1458. #include <stdio.h>
  1459. #include <stdlib.h>
  1460. #include <stdarg.h>
  1461. #else
  1462. #include <sys/types.h>
  1463. #include <stdio.h>
  1464. #include <varargs.h>
  1465. #endif],
  1466. [va_list args;],
  1467. [AC_MSG_RESULT(yes)],
  1468. [NEED_VA_LIST=-DNEED_VA_LIST AC_SUBST(NEED_VA_LIST) AC_MSG_RESULT(no)])
  1469. case $host in
  1470. *bsd*)
  1471. AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
  1472. ;;
  1473. *linux*)
  1474. AC_DEFINE(__linux__,1,[sun specific code in check_dhcp.c])
  1475. ;;
  1476. *sun* | solaris*)
  1477. AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
  1478. ;;
  1479. *hpux*)
  1480. AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c])
  1481. ;;
  1482. esac
  1483. AC_SUBST(EXTRAS)
  1484. AC_SUBST(EXTRA_NETOBJS)
  1485. AC_SUBST(DEPLIBS)
  1486. AM_GNU_GETTEXT([no-libtool], [need-ngettext])
  1487. AM_GNU_GETTEXT_VERSION(0.11.5)
  1488. dnl Check for Redhat spopen problem
  1489. dnl Wierd problem where ECHILD is returned from a wait call in error
  1490. dnl Only appears to affect nslookup and dig calls. Only affects redhat around
  1491. dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
  1492. dnl We patch plugins/popen.c
  1493. dnl Need to add smp because uname different on those
  1494. dnl Can force patch to be applied with --enable-redhat-pthread-workaround
  1495. AC_ARG_ENABLE(redhat-pthread-workaround,
  1496. AC_HELP_STRING([--enable-redhat-pthread-workaround],
  1497. [force Redhat patch to be applied (default: test system)]),
  1498. [ac_cv_enable_redhat_pthread_workaround=$enableval],
  1499. [ac_cv_enable_redhat_pthread_workaround=test])
  1500. if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
  1501. if echo $ac_cv_uname_r | egrep "\.EL(smp)?$" >/dev/null 2>&1 ; then
  1502. AC_MSG_CHECKING(for redhat spopen problem)
  1503. ( cd config_test && make && make test ) > /dev/null 2>&1
  1504. if test $? -eq 0 ; then
  1505. AC_MSG_RESULT(okay)
  1506. else
  1507. AC_MSG_RESULT(error)
  1508. AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Workaround on redhat in spopen])
  1509. fi
  1510. fi
  1511. elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
  1512. AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen])
  1513. fi
  1514. dnl External libraries - see ACKNOWLEDGEMENTS
  1515. np_COREUTILS
  1516. np_CURL
  1517. AC_OUTPUT(
  1518. Makefile
  1519. lib/Makefile
  1520. m4/Makefile
  1521. plugins/Makefile
  1522. plugins/tests/Makefile
  1523. plugins-root/Makefile
  1524. plugins-scripts/Makefile
  1525. plugins-scripts/subst
  1526. plugins-scripts/utils.pm
  1527. plugins-scripts/utils.sh
  1528. command.cfg
  1529. test.pl
  1530. pkg/solaris/pkginfo
  1531. intl/Makefile
  1532. po/Makefile.in
  1533. )
  1534. dnl the ones below that are commented out need to be cleaned up
  1535. dnl in the configure code above to use with_foo instead of ac_cv_foo
  1536. dnl if we want them to show up here. it'd also make the code cleaner.
  1537. dnl i'll get to that on another rainy day :) -sf
  1538. dnl ACX_FEATURE([with],[dig-command])
  1539. dnl ACX_FEATURE([with],[fping-command])
  1540. dnl ACX_FEATURE([with],[mailq-command])
  1541. dnl ACX_FEATURE([with],[nslookup-command])
  1542. dnl ACX_FEATURE([with],[ntpdate-command])
  1543. ACX_FEATURE([with],[ping6-command])
  1544. ACX_FEATURE([with],[ping-command])
  1545. dnl ACX_FEATURE([with],[qstat-command])
  1546. dnl ACX_FEATURE([with],[rpcinfo-command])
  1547. dnl ACX_FEATURE([with],[smbclient-command])
  1548. dnl ACX_FEATURE([with],[snmpget-command])
  1549. dnl ACX_FEATURE([with],[snmpgetnext-command])
  1550. dnl ACX_FEATURE([with],[ssh-command])
  1551. dnl ACX_FEATURE([with],[uptime-command])
  1552. dnl ACX_FEATURE([with],[proc-loadavg])
  1553. dnl ACX_FEATURE([with],[proc-meminfo])
  1554. dnl ACX_FEATURE([with],[ps-command])
  1555. dnl ACX_FEATURE([with],[ps-format])
  1556. dnl ACX_FEATURE([with],[ps-cols])
  1557. dnl ACX_FEATURE([with],[ps-varlist])
  1558. ACX_FEATURE([with],[lwres])
  1559. ACX_FEATURE([with],[ipv6])
  1560. ACX_FEATURE([with],[openssl])
  1561. ACX_FEATURE([with],[gnutls])
  1562. ACX_FEATURE([enable],[emulate-getaddrinfo])
  1563. ACX_FEATURE([with],[perl])
  1564. ACX_FEATURE([with],[cgiurl])
  1565. ACX_FEATURE([with],[nagios-user])
  1566. ACX_FEATURE([with],[nagios-group])
  1567. ACX_FEATURE([with],[trusted-path])