--- projects/libstatgrab/configure.in 2004/11/01 18:33:19 1.78 +++ projects/libstatgrab/configure.in 2010/02/20 17:55:03 1.99 @@ -2,15 +2,15 @@ # Process this file with autoconf to produce a configure script. # # configure.in for libstatgrab -# $Id: configure.in,v 1.78 2004/11/01 18:33:19 tdb Exp $ +# $Id: configure.in,v 1.99 2010/02/20 17:55:03 tdb Exp $ # # Change these to change the package name and version -AC_INIT(libstatgrab, 0.11, bugs@i-scream.org) -AM_INIT_AUTOMAKE(libstatgrab, 0.11) +AC_INIT(libstatgrab, 0.17, bugs@i-scream.org) +AM_INIT_AUTOMAKE(libstatgrab, 0.17) # Revision number (automatically updated) -AC_REVISION($Revision: 1.78 $) +AC_REVISION($Revision: 1.99 $) # Might work with older autoconfs... but tested on 2.57 AC_PREREQ(2.57) @@ -31,7 +31,6 @@ AC_C_CONST # Checks for library functions AC_FUNC_MALLOC -AC_FUNC_REALLOC AC_CHECK_FUNCS(atoll seteuid setegid setresuid setresgid) # Disk IO read and write statistics are only present on recent NetBSD. @@ -52,6 +51,12 @@ AC_CHECK_MEMBER(struct statvfs.f_fstypename, [], [#include ]) +# FreeBSD 9 (and others) uses utmpx rather than utmp +AC_CHECK_MEMBER(struct utmpx.ut_type, + [AC_DEFINE(HAVE_UTMPX, , [utmpx])], + [], + [#include ]) + # Check for sys/loadavg.h AC_CHECK_HEADERS([sys/loadavg.h]) @@ -62,6 +67,9 @@ AC_CHECK_HEADERS([libdevinfo.h]) AM_CONDITIONAL(SETGIDBINS, false) AM_CONDITIONAL(SETUIDBINS, false) +# Default MINGW setting +AM_CONDITIONAL(MINGW, 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 @@ -75,11 +83,13 @@ solaris2.[[6-7]]) BIN_PERM="4755" LINKFLAGS="-lkstat -lsocket -lnsl" AC_CHECK_LIB(devinfo, di_init, [LINKFLAGS="$LINKFLAGS -ldevinfo"]) + AC_CHECK_LIB(m, fabs, [SAIDARLIBS="$SAIDARLIBS -lm"]) ;; solaris2.*) AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) LINKFLAGS="-lkstat -ldevinfo -lsocket -lnsl" + AC_CHECK_LIB(m, fabs, [SAIDARLIBS="$SAIDARLIBS -lm"]) ;; hpux11.11*) AC_DEFINE(HPUX, , [Building on HP-UX 11.11]) @@ -92,17 +102,17 @@ freebsd4.*) BIN_PERM="2755" LINKFLAGS="-lkvm -ldevstat" ;; -freebsd[[5-6]].*) +freebsd[[5-8]].*) AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) AC_DEFINE(FREEBSD, , [Building on FreeBSD]) - AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x or 6.x]) + AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x - 8.x]) LINKFLAGS="-ldevstat" ;; netbsdelf1*) AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) AC_DEFINE(NETBSD, , [Building on NetBSD]) ;; -netbsdelf2*) +netbsdelf[[2-3]]*) AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) AC_DEFINE(NETBSD, , [Building on NetBSD]) AC_DEFINE(NETBSD2, , [Building on NetBSD 2.x]) @@ -119,7 +129,7 @@ dragonfly*) BIN_PERM="2755" LINKFLAGS="-lkvm -ldevstat" ;; -linux-gnu) +linux-gnu*) AC_DEFINE(LINUX, , [Building on GNU/Linux]) AM_CONDITIONAL(SETUIDBINS, true) BIN_OWNER="root" @@ -128,6 +138,12 @@ linux-gnu) cygwin) AC_DEFINE(CYGWIN, , [Building on Cygwin]) ;; +mingw32) + AC_DEFINE(MINGW, , [Building on MinGW]) + AC_DEFINE(WINVER, 0x0500, [Building for Windows 2000]) + AM_CONDITIONAL(MINGW, true) + LINKFLAGS="-lpdh -lIphlpapi -lpsapi -lnetapi32" + ;; *) AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) ;; @@ -141,7 +157,7 @@ AC_ARG_WITH([curses-prefix], SAIDARLIBS="-L${withval}/lib ${SAIDARLIBS}" fi if test -d "$withval/include"; then - SAIDARCPPFLAGS="-I${withval}/include -I${withval}/include/ncurses ${SAIRDARCPPFLAGS}" + SAIDARCPPFLAGS="-I${withval}/include ${SAIRDARCPPFLAGS}" fi ] ) @@ -240,6 +256,6 @@ 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]) +AC_CONFIG_FILES([Makefile src/Makefile src/libstatgrab/Makefile src/statgrab/Makefile docs/Makefile docs/libstatgrab/Makefile docs/statgrab/Makefile docs/saidar/Makefile examples/Makefile libstatgrab.pc src/statgrab/statgrab-make-mrtg-config src/statgrab/statgrab-make-mrtg-index src/saidar/Makefile]) AC_OUTPUT