configure.in 59 KB

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