Diff for /embedaddon/bmon/configure.ac between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2012/02/21 22:19:56 version 1.1.1.2, 2014/07/30 07:55:27
Line 1 Line 1
 #  #
 # configure.in      Configure Script  # configure.in      Configure Script
 #  #
# Copyright (c) 2001-2005 Thomas Graf <tgraf@suug.ch># Copyright (c) 2001-2013 Thomas Graf <tgraf@suug.ch>
 #  #
 # Permission is hereby granted, free of charge, to any person obtaining a  # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),  # copy of this software and associated documentation files (the "Software"),
Line 21 Line 21
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.  # DEALINGS IN THE SOFTWARE.
   
AC_INIT(bmon, 2.1.0, tgraf@suug.ch)AC_INIT(bmon, 3.3, [], [], [http://www.infradead.org/~tgr/bmon/])
AC_CONFIG_HEADER(include/bmon/defs.h)AC_CONFIG_HEADERS(include/bmon/defs.h)
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
   
   AC_CANONICAL_TARGET
 AC_CANONICAL_SYSTEM  AC_CANONICAL_SYSTEM
   
save_CFLAGS="${CFLAGS}"AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
save_LDFLAGS="${LDFLAGS}"m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)], [])
save_CPPFLAGS="${CPPFLAGS}" 
   
 AC_ISC_POSIX  AC_ISC_POSIX
 AC_PROG_CC  AC_PROG_CC
Line 51  AC_FUNC_FORK Line 53  AC_FUNC_FORK
   
 AC_CHECK_HEADERS(getopt.h ncurses/ncurses.h ncurses.h curses.h)  AC_CHECK_HEADERS(getopt.h ncurses/ncurses.h ncurses.h curses.h)
 AC_CHECK_HEADERS(dirent.h sys/utsname.h sys/sockio.h netinet6/in6.h)  AC_CHECK_HEADERS(dirent.h sys/utsname.h sys/sockio.h netinet6/in6.h)
AC_CHECK_HEADERS(rrd.h fcntl.h netdb.h netinet/in.h sysctl/ioctl.h)AC_CHECK_HEADERS(fcntl.h netdb.h netinet/in.h sysctl/ioctl.h)
 AC_CHECK_HEADERS(sys/param.h sys/socket.h)  AC_CHECK_HEADERS(sys/param.h sys/socket.h)
   
 AC_CHECK_TYPES(suseconds_t)  AC_CHECK_TYPES(suseconds_t)
   
 AC_CHECK_FUNCS(atexit gettimeofday memset pow socket strcasecmp)  AC_CHECK_FUNCS(atexit gettimeofday memset pow socket strcasecmp)
 AC_CHECK_FUNCS(strchr strdup strerror strncasecmp strstr strtol)  AC_CHECK_FUNCS(strchr strdup strerror strncasecmp strstr strtol)
AC_CHECK_FUNCS(uname)AC_CHECK_FUNCS(uname getdate)
   
#AX_WITH_CURSES
# Check if -lsocket is neededif test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then
#        AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])
AC_CHECK_FUNC(connect,,[fi
        AC_CHECK_LIB(socket,connect,LIB_INET="${LIB_INET} -lsocket") 
]) 
   
#PKG_CHECK_MODULES([CONFUSE], [libconfuse], [], AC_MSG_ERROR([requires libconfuse]))
# Check if -lnsl is needed 
# 
AC_CHECK_FUNC(gethostbyname,,[ 
        AC_CHECK_LIB(nsl,gethostbyname,LIB_INET="${LIB_INET} -lnsl") 
]) 
   
#case ${target_os} in
# Check if -lresolv is needed    linux*)
#        PKG_CHECK_MODULES([LIBNL], [libnl-3.0], [], AC_MSG_ERROR([requires libnl3-dev]))
AC_CHECK_FUNC(inet_aton,,[        PKG_CHECK_MODULES([LIBNL_ROUTE], [libnl-route-3.0], [], AC_MSG_ERROR([requires libnl3-route]))
        AC_CHECK_LIB(resolv, inet_aton,LIB_INET="${LIB_INET} -lresolv")    ;;
])esac
   
AC_CHECK_FUNC(fcloseall,[AC_CHECK_LIB(m, pow, [], AC_MSG_ERROR([requires libm]))
        AC_DEFINE_UNQUOTED(HAVE_FCLOSEALL, "1", [have fcloseall]) 
]) 
   
   BMON_LIB=""
   
 #####################################################################  #####################################################################
 ##  ##
Line 120  AC_CHECK_LIB($LCURSES, use_default_colors, [ Line 114  AC_CHECK_LIB($LCURSES, use_default_colors, [
   
 #####################################################################  #####################################################################
 ##  ##
 ## librrd check  
 ##  
 #####################################################################  
 RRD="No "  
 AC_CHECK_LIB(rrd, rrd_create, [  
         AC_DEFINE_UNQUOTED(HAVE_RRD, "1", [have rrd])  
         LIBRRD="-lrrd"  
         RRD="Yes"  
 ],[  
         echo  
         echo "*** Warning: Building bmon w/o rrd support ***"  
         echo  
 ])  
   
 #####################################################################  
 ##  
 ## libdbi check  
 ##  
 #####################################################################  
 DBI="No "  
 AC_CHECK_LIB(dbi, dbi_initialize, [  
         AC_DEFINE_UNQUOTED(HAVE_DBI, "1", [have dbi])  
         LIBDBI="-ldbi"  
         DBI="Yes"  
 ],[  
         echo  
         echo "*** Warning: Building bmon w/o DBI support ***"  
         echo  
 ])  
   
 #####################################################################  
 ##  
 ## libasound check  
 ##  
 #####################################################################  
 ASOUND="No "  
 AC_CHECK_LIB(asound, snd_seq_open, [  
         AC_DEFINE_UNQUOTED(HAVE_ASOUND, "1", [have asound])  
         LIBASOUND="-lasound"  
         ASOUND="Yes"  
 ],[  
         echo  
         echo "*** Warning: Building bmon w/o libasound support ***"  
         echo  
 ])  
   
 #####################################################################  
 ##  
 ## libkstat check  
 ##  
 #####################################################################  
 KSTAT="No "  
 AC_CHECK_LIB(kstat, kstat_open, [  
         AC_DEFINE_UNQUOTED(HAVE_KSTAT, "1", [have kstat])  
         LIBKSTAT="-lkstat"  
         KSTAT="Yes"  
 ],[  
         case ${target_os} in  
             *solaris*)  
                 echo  
                 echo "*** Warning: Building bmon on SunOS w/o libkstat ***"  
                 echo  
             ;;  
         esac  
 ])  
   
 #####################################################################  
 ##  
 ## libnl check  
 ##  
 #####################################################################  
 NL="No "  
 AC_CHECK_LIB(nl, nl_connect, [  
         AC_DEFINE_UNQUOTED(HAVE_NL, "1", [have libnl])  
         LIBNL="-lnl"  
         NL="Yes"  
 ],[  
         case ${target_os} in  
             *linux*)  
                 echo  
                 echo "*** Warning: Building bmon on Linuxx w/o libnl ***"  
                 echo  
             ;;  
         esac  
 ])  
   
 #####################################################################  
 ##  
 ## libm check  
 ##  
 #####################################################################  
 M="No "  
 AC_CHECK_LIB(m, pow, [  
         LIBM="-lm"  
         M="Yes"  
 ],[  
         echo  
         echo "*** Error: libm required ***"  
         echo  
         exit  
 ])  
   
 #####################################################################  
 ##  
 ## interface counter overflow workaround  ## interface counter overflow workaround
 ##  ##
 #####################################################################  #####################################################################
Line 236  AC_ARG_ENABLE(cnt-workaround, Line 126  AC_ARG_ENABLE(cnt-workaround,
   
 #####################################################################  #####################################################################
 ##  ##
 ## librrd  
 ##  
 #####################################################################  
 AC_ARG_ENABLE(rrd,  
 [  --disable-rrd           Disables rrd output],[  
         if test x$enableval = xno; then  
                 RRD="No "  
         fi  
 ])  
   
 #####################################################################  
 ##  
 ## libasound  
 ##  
 #####################################################################  
 AC_ARG_ENABLE(asound,  
 [  --disable-asound        Disables asound output],[  
         if test x$enableval = xno; then  
                 ASOUND="No "  
         fi  
 ])  
   
 #####################################################################  
 ##  
 ## libdbi  
 ##  
 #####################################################################  
 AC_ARG_ENABLE(dbi,  
 [  --disable-dbi           Disables DBI output],[  
         if test x$enableval = xno; then  
                 DBI="No "  
         fi  
 ])  
   
 #####################################################################  
 ##  
 ## curses  ## curses
 ##  ##
 #####################################################################  #####################################################################
Line 291  DEBUG=0 Line 145  DEBUG=0
 AC_ARG_ENABLE(debug,  AC_ARG_ENABLE(debug,
 [  --enable-debug          Enable debug mode (default disabled)],[  [  --enable-debug          Enable debug mode (default disabled)],[
         if test x$enableval = xyes; then          if test x$enableval = xyes; then
                   AC_DEFINE_UNQUOTED(DEBUG, "1", [enable debugging])
                 DEBUG=1;                  DEBUG=1;
         fi          fi
 ])  ])
   
 #####################################################################  #####################################################################
 ##  ##
 ## static check  
 ##  
 #####################################################################  
 STATIC=0  
 AC_ARG_ENABLE(static,  
 [  --enable-static         Enable static linking (default disabled)],[  
         if test x$enableval = xyes; then  
                 STATIC=1;  
         fi  
 ])  
   
 #####################################################################  
 ##  
 ## target os eval  ## target os eval
 ##  ##
 #####################################################################  #####################################################################
Line 337  esac Line 179  esac
   
 #####################################################################  #####################################################################
 ##  ##
 ## compile decisions  
 ##  
 #####################################################################  
 COMPILE_BMON="Yes "  
 BMON_LIB="$LIB_INET $LIBM"  
 if test x$CURSES = xYes; then  
         BMON_LIB="$BMON_LIB $LIBCURSES"  
 fi;  
   
 if test x$NL = xYes; then  
         BMON_LIB="$BMON_LIB $LIBNL"  
 fi;  
   
 if test x$KSTAT = xYes; then  
         BMON_LIB="$BMON_LIB $LIBKSTAT"  
 fi;  
   
 if test x$RRD = xYes; then  
         BMON_LIB="$BMON_LIB $LIBRRD"  
 fi;  
   
 if test x$ASOUND = xYes; then  
         BMON_LIB="$BMON_LIB $LIBASOUND"  
 fi;  
   
 if test x$DBI = xYes; then  
         BMON_LIB="$BMON_LIB $LIBDBI"  
 fi;  
           
   
 #####################################################################  
 ##  
 ## export variables  ## export variables
 ##  ##
 #####################################################################  #####################################################################
 AC_SUBST(COMPILE_BMON)  
 AC_SUBST(BMON_LIB)  
   
 AC_SUBST(DEBUG)  AC_SUBST(DEBUG)
 AC_SUBST(STATIC)  AC_SUBST(STATIC)
 AC_SUBST(SYS)  AC_SUBST(SYS)
 AC_SUBST(ARCH)  AC_SUBST(ARCH)
   
 AC_SUBST(CURSES)  AC_SUBST(CURSES)
 AC_SUBST(RRD)  
 AC_SUBST(ASOUND)  
 AC_SUBST(DBI)  
   
AC_OUTPUT([Makefile.opts])AC_CONFIG_FILES([
 Makefile
 include/Makefile
 src/Makefile
 man/Makefile
 examples/Makefile
 ])
   
#####################################################################AC_OUTPUT
## 
## status report 
## 
##################################################################### 
echo " 
---------------------------------------------------------------------- 
SUMMARY: 
 
OS: $target_os 
 
Included in Compilation: 
  bmon:   $COMPILE_BMON $BMON_LIB 
 
Dependencies: 
bmon: 
  libm             $M       (required) 
  lib(n)curses     $CURSES       (suggested) 
  librrd           $RRD       (suggested) 
  libdbi           $DBI       (suggested) 
  libasound        $ASOUND       (toy)" 
case ${target_os} in 
  *linux*) 
   echo "  libnl            $NL       (suggested)" 
   ;; 
esac 
if test x$target_os = xsolaris; then 
   echo "  libkstat         $KSTAT     (required on SunOS)" 
fi 
echo " 
---------------------------------------------------------------------- 
 
WARNING: 
   Please do not install the bmon executable as SUID root. This 
   software package was written with portability and configurability 
   in mind and will never fulfill the requirements to be installed 
   as SUID root executable. 
 
   If you do please be aware that every user will be able to run 
   arbitary commands as root via the key bind interface or by 
   providing a malicious netstat binary. 
 
   In fact there is no reason to do so, all supported input modules 
   will work fine without superuser privileges. There is probably a 
   good reason if your operating system requires special privileges 
   which is that a normal user is not supposed to read the statistics 
   which should not be worked around using the SUID bit. 
 
   Thanks. 
" 

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>