--- projects/libstatgrab/configure.in 2003/10/07 22:07:37 1.33 +++ projects/libstatgrab/configure.in 2003/11/20 12:13:11 1.45 @@ -2,15 +2,15 @@ # Process this file with autoconf to produce a configure script. # # configure.in for libstatgrab -# $Id: configure.in,v 1.33 2003/10/07 22:07:37 tdb Exp $ +# $Id: configure.in,v 1.45 2003/11/20 12:13:11 tdb Exp $ # # Change these to change the package name and version -AC_INIT(libstatgrab, 0.6, bugs@i-scream.org) -AM_INIT_AUTOMAKE(libstatgrab, 0.6) +AC_INIT(libstatgrab, 0.7.1, bugs@i-scream.org) +AM_INIT_AUTOMAKE(libstatgrab, 0.7.1) # Revision number (automatically updated) -AC_REVISION($Revision: 1.33 $) +AC_REVISION($Revision: 1.45 $) # Might work with older autoconfs... but tested on 2.57 AC_PREREQ(2.57) @@ -34,6 +34,15 @@ AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS(atoll) +# Disk IO read and write statistics are only present on recent NetBSD. +AC_CHECK_MEMBER(struct disk_sysctl.dk_rbytes, + [AC_DEFINE(HAVE_DK_RBYTES, , [New-style NetBSD stats])], + [], + [#include ]) + +# Default needing setgid to false +AM_CONDITIONAL(SETGIDBINS, false) + # Set things up for different OS's # We define the name of the OS so the code can act accordingly # We also need to add the right LDFLAGS @@ -42,20 +51,38 @@ solaris2.[[6-7]]) AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) AC_DEFINE(SOL7, , [Building on Solaris 2.7]) - LINKFLAGS="-lkstat" + LINKFLAGS="-lkstat -ldevinfo" ;; solaris2.*) AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) - LINKFLAGS="-lkstat" + LINKFLAGS="-lkstat -ldevinfo" ;; freebsd4.*) - AC_DEFINE(FREEBSD, , [Building on FreeBSD 4.x]) + AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) + AC_DEFINE(FREEBSD, , [Building on FreeBSD]) + AM_CONDITIONAL(SETGIDBINS, true) LINKFLAGS="-lkvm -ldevstat" ;; +freebsd5.*) + AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) + AC_DEFINE(FREEBSD, , [Building on FreeBSD]) + AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x]) + AM_CONDITIONAL(SETGIDBINS, true) + LINKFLAGS="-lkvm -ldevstat" + ;; +netbsdelf*) + AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) + AC_DEFINE(NETBSD, , [Building on NetBSD]) + AM_CONDITIONAL(SETGIDBINS, true) + LINKFLAGS="-lkvm" + ;; linux-gnu) AC_DEFINE(LINUX, , [Building on GNU/Linux]) ;; +cygwin) + AC_DEFINE(CYGWIN, , [Building on Cygwin]) + ;; *) AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) ;; @@ -123,13 +150,16 @@ AC_ARG_ENABLE(manpages, ] ) -# User specified pkgconfig dir -AC_ARG_WITH([pkgconfig-dir], - [ --with-pkgconfig-dir=PATH pkgconfig lib directory (PREFIX/lib/pkgconfig)], - [ PKGCONFIG_DIR=$withval ], - [ PKGCONFIG_DIR="\$(libdir)/pkgconfig" ] +# Check if the user wants to turn off setgid binaries +# (only really relevant on FreeBSD) +AC_ARG_ENABLE(setgid-binaries, + [ --disable-setgid-binaries disable binaries being setgid], + [ + if test "x$enableval" = "xno" ; then + AM_CONDITIONAL(SETGIDBINS, false) + fi + ] ) -AC_SUBST(PKGCONFIG_DIR) # The LIBS and CPPFLAGS that saidar needs AC_SUBST(SAIDARLIBS)