--- projects/libstatgrab/configure.in 2003/04/09 21:13:34 1.18 +++ projects/libstatgrab/configure.in 2003/10/08 17:49:21 1.34 @@ -2,15 +2,15 @@ # Process this file with autoconf to produce a configure script. # # configure.in for libstatgrab -# $Id: configure.in,v 1.18 2003/04/09 21:13:34 tdb Exp $ +# $Id: configure.in,v 1.34 2003/10/08 17:49:21 tdb Exp $ # # Change these to change the package name and version -AC_INIT(libstatgrab, 0.4.1, dev@i-scream.org.uk) -AM_INIT_AUTOMAKE(libstatgrab, 0.4.1) +AC_INIT(libstatgrab, 0.6, bugs@i-scream.org) +AM_INIT_AUTOMAKE(libstatgrab, 0.6) # Revision number (automatically updated) -AC_REVISION($Revision: 1.18 $) +AC_REVISION($Revision: 1.34 $) # Might work with older autoconfs... but tested on 2.57 AC_PREREQ(2.57) @@ -42,17 +42,22 @@ 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]) - LDFLAGS="$LDFLAGS -lkstat" + LINKFLAGS="-lkstat" ;; solaris2.*) AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) - LDFLAGS="$LDFLAGS -lkstat" + LINKFLAGS="-lkstat" ;; freebsd4.*) - AC_DEFINE(FREEBSD, , [Building on FreeBSD 4.x]) - LDFLAGS="$LDFLAGS -lkvm -ldevstat" + AC_DEFINE(FREEBSD, , [Building on FreeBSD]) + LINKFLAGS="-lkvm -ldevstat" ;; +freebsd5.*) + AC_DEFINE(FREEBSD, , [Building on FreeBSD]) + AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x]) + LINKFLAGS="-lkvm -ldevstat" + ;; linux-gnu) AC_DEFINE(LINUX, , [Building on GNU/Linux]) ;; @@ -61,7 +66,85 @@ linux-gnu) ;; esac +# User specified curses/ncurses prefix +AC_ARG_WITH([curses-prefix], + [ --with-curses-prefix=PATH curses (or ncurses) is in PATH], + [ + if test -d "$withval/lib"; then + SAIDARLIBS="-L${withval}/lib ${SAIDARLIBS}" + fi + if test -d "$withval/include"; then + SAIDARCPPFLAGS="-I${withval}/include -I${withval}/include/ncurses ${SAIRDARCPPFLAGS}" + fi + ] +) + +# Check if user wants to disable statgrab +AM_CONDITIONAL(STATGRAB, true) +AC_ARG_ENABLE(statgrab, + [ --disable-statgrab disable building of statgrab], + [ + if test "x$enableval" = "xno" ; then + AM_CONDITIONAL(STATGRAB, false) + fi + ] +) + +# Check if user wants to disable saidar +AM_CONDITIONAL(SAIDAR, true) +AC_ARG_ENABLE(saidar, + [ --disable-saidar disable building of saidar], + [ + if test "x$enableval" = "xno" ; then + AM_CONDITIONAL(SAIDAR, false) + fi + ], + [ + # saidar needs curses + # (if we don't find curses we disable saidar) + MP_WITH_CURSES + ] +) + +# Check if the user would prefer not to build examples +AM_CONDITIONAL(EXAMPLES, true) +AC_ARG_ENABLE(examples, + [ --disable-examples disable building of examples], + [ + if test "x$enableval" = "xno" ; then + AM_CONDITIONAL(EXAMPLES, false) + fi + ] +) + +# Check if user wants to install manpages +AM_CONDITIONAL(MANPAGES, true) +AC_ARG_ENABLE(manpages, + [ --disable-manpages disable installation of manpages], + [ + if test "x$enableval" = "xno" ; then + AM_CONDITIONAL(MANPAGES, false) + fi + ] +) + +# 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" ] +) +AC_SUBST(PKGCONFIG_DIR) + +# The LIBS and CPPFLAGS that saidar needs +AC_SUBST(SAIDARLIBS) +AC_SUBST(SAIDARCPPFLAGS) + +# The flags needed to link to libstatgrab +# (ie. our dependencies) +AC_SUBST(LINKFLAGS) + # And finish by changing these files -AC_CONFIG_FILES([Makefile src/Makefile]) +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_OUTPUT