configure.in 61 KB

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