configure.in 59 KB

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