--- projects/libstatgrab/configure.in 2004/04/06 16:37:33 1.67 +++ projects/libstatgrab/configure.in 2004/11/01 18:33:19 1.78 @@ -2,15 +2,15 @@ # Process this file with autoconf to produce a configure script. # # configure.in for libstatgrab -# $Id: configure.in,v 1.67 2004/04/06 16:37:33 tdb Exp $ +# $Id: configure.in,v 1.78 2004/11/01 18:33:19 tdb Exp $ # # Change these to change the package name and version -AC_INIT(libstatgrab, 0.10, bugs@i-scream.org) -AM_INIT_AUTOMAKE(libstatgrab, 0.10) +AC_INIT(libstatgrab, 0.11, bugs@i-scream.org) +AM_INIT_AUTOMAKE(libstatgrab, 0.11) # Revision number (automatically updated) -AC_REVISION($Revision: 1.67 $) +AC_REVISION($Revision: 1.78 $) # Might work with older autoconfs... but tested on 2.57 AC_PREREQ(2.57) @@ -32,14 +32,26 @@ AC_C_CONST # Checks for library functions AC_FUNC_MALLOC AC_FUNC_REALLOC -AC_CHECK_FUNCS(atoll) +AC_CHECK_FUNCS(atoll seteuid setegid setresuid setresgid) # 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])], + [AC_DEFINE(HAVE_DK_RBYTES, , [New-style NetBSD disk stats])], [], [#include ]) +# Disk IO read and write statistics are only present on recent OpenBSD. +AC_CHECK_MEMBER(struct diskstats.ds_rbytes, + [AC_DEFINE(HAVE_DS_RBYTES, , [New-style OpenBSD disk stats])], + [], + [#include ]) + +# NetBSD 2.0 uses statvfs rather than statfs +AC_CHECK_MEMBER(struct statvfs.f_fstypename, + [AC_DEFINE(HAVE_STATVFS, , [NetBSD 2.0 statvfs])], + [], + [#include ]) + # Check for sys/loadavg.h AC_CHECK_HEADERS([sys/loadavg.h]) @@ -59,6 +71,8 @@ solaris2.[[6-7]]) AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) AC_DEFINE(SOL7, , [Building on Solaris 2.6 or 2.7]) AM_CONDITIONAL(SETUIDBINS, true) + BIN_OWNER="root" + BIN_PERM="4755" LINKFLAGS="-lkstat -lsocket -lnsl" AC_CHECK_LIB(devinfo, di_init, [LINKFLAGS="$LINKFLAGS -ldevinfo"]) ;; @@ -67,16 +81,21 @@ solaris2.*) AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) LINKFLAGS="-lkstat -ldevinfo -lsocket -lnsl" ;; +hpux11.11*) + AC_DEFINE(HPUX, , [Building on HP-UX 11.11]) + ;; freebsd4.*) AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) AC_DEFINE(FREEBSD, , [Building on FreeBSD]) AM_CONDITIONAL(SETGIDBINS, true) + BIN_GROUP="kmem" + BIN_PERM="2755" LINKFLAGS="-lkvm -ldevstat" ;; -freebsd5.*) +freebsd[[5-6]].*) AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) AC_DEFINE(FREEBSD, , [Building on FreeBSD]) - AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x]) + AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x or 6.x]) LINKFLAGS="-ldevstat" ;; netbsdelf1*) @@ -96,11 +115,15 @@ dragonfly*) AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) AC_DEFINE(DFBSD, , [Building on DragonFlyBSD]) AM_CONDITIONAL(SETGIDBINS, true) + BIN_GROUP="kmem" + BIN_PERM="2755" LINKFLAGS="-lkvm -ldevstat" ;; linux-gnu) AC_DEFINE(LINUX, , [Building on GNU/Linux]) AM_CONDITIONAL(SETUIDBINS, true) + BIN_OWNER="root" + BIN_PERM="4755" ;; cygwin) AC_DEFINE(CYGWIN, , [Building on Cygwin]) @@ -210,6 +233,11 @@ AC_SUBST(SAIDARCPPFLAGS) # The flags needed to link to libstatgrab # (ie. our dependencies) AC_SUBST(LINKFLAGS) + +# Ownership and permissions possibly needed for binaries +AC_SUBST(BIN_OWNER) +AC_SUBST(BIN_GROUP) +AC_SUBST(BIN_PERM) # And finish by changing these files AC_CONFIG_FILES([Makefile src/Makefile src/libstatgrab/Makefile src/statgrab/Makefile docs/Makefile examples/Makefile libstatgrab.pc src/statgrab/statgrab-make-mrtg-config src/statgrab/statgrab-make-mrtg-index src/saidar/Makefile])