diff --git a/configure.in b/configure.in
index d02d7f85beafe3c993eea023a5473fae09c69a08..69ffc9d73b4ac58cc3179a045f952240e93c58d0 100644 (file)
--- a/configure.in
+++ b/configure.in
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT(nagios-plugins,1.4.14)
+AC_INIT(nagios-plugins,1.4.15)
AC_CONFIG_SRCDIR(NPTest.pm)
AC_CONFIG_FILES(gl/Makefile)
AC_CONFIG_AUX_DIR(build-aux)
LIBS="$_SAVEDLIBS"
CPPFLAGS="$_SAVEDCPPFLAGS"
+dnl Check for DBI libraries
+_SAVEDLIBS="$LIBS"
+AC_CHECK_LIB(dbi,dbi_initialize)
+if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then
+ EXTRAS="$EXTRAS check_dbi"
+ DBILIBS="-ldbi"
+ AC_SUBST(DBILIBS)
+else
+ AC_MSG_WARN([Skipping dbi plugin])
+ AC_MSG_WARN([install DBI libs to compile this plugin (see REQUIREMENTS).])
+fi
+LIBS="$_SAVEDLIBS"
+
dnl Check for radius libraries
_SAVEDLIBS="$LIBS"
AC_CHECK_LIB(radiusclient,rc_read_config)
ac_cv_ps_cols=9
AC_MSG_RESULT([using nagios-plugins internal ps command (pst3) for solaris])
if test `isainfo -b` = 64 ; then
- PST3CFLAGS="-m64"
- AC_SUBST(PST3CFLAGS)
- AC_MSG_NOTICE([using 64bit pst3])
+ pst3_use_64bit=1
+ AC_MSG_NOTICE([using 64bit pst3])
else
AC_MSG_NOTICE([using 32bit pst3])
fi
EXTRAS_ROOT="$EXTRAS_ROOT pst3"
+ if test "$pst3_use_64bit" = 1; then
+ dnl Test if we can actually compile code in 64bit
+ old_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ pst3_64bit_working=0
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([], [
+return sizeof(void*) == 8 ? 0 : 1;
+ ])
+ ],[
+ PST3CFLAGS="-m64"
+ AC_SUBST(PST3CFLAGS)
+ pst3_64bit_working=1
+ AC_MSG_NOTICE([using -m64 for 64bit code])
+ ],[
+ pst3_64bit_working=0
+ AC_MSG_NOTICE([compiler do not like -m64])
+ ])
+ CFLAGS=$old_cflags
+ if test "$pst3_64bit_working" = 0; then
+ old_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -xarch=v9"
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([], [
+return sizeof(void*) == 8 ? 0 : 1;
+ ])
+ ],[
+ PST3CFLAGS="-xarch=v9"
+ AC_SUBST(PST3CFLAGS)
+ pst3_64bit_working=1
+ AC_MSG_NOTICE([using -xarch=v9 for 64bit code])
+ ],[
+ pst3_64bit_working=0
+ AC_MSG_NOTICE([compiler do not like -xarch=v9])
+ ])
+ CFLAGS=$old_cflags
+ fi
+ if test "$pst3_64bit_working" = 0; then
+ old_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -xarch=amd64"
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([], [
+return sizeof(void*) == 8 ? 0 : 1;
+ ])
+ ],[
+ PST3CFLAGS="-xarch=amd64"
+ AC_SUBST(PST3CFLAGS)
+ pst3_64bit_working=1
+ AC_MSG_NOTICE([using -xarch=amd64 for 64bit code])
+ ],[
+ pst3_64bit_working=0
+ AC_MSG_NOTICE([compiler do not like -xarch=amd64])
+ ])
+ CFLAGS=$old_cflags
+ fi
+ if test "$pst3_64bit_working" = 0; then
+ AC_MSG_ERROR([I don't know how to build a 64-bit object!])
+ fi
+ fi
+
dnl Removing this for the moment - Ton
dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation
dnl Limitation that command name is not available