configure.in 59 KB

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