--- projects/cms/source/ihost/configure.in 2002/05/31 09:42:42 1.5 +++ projects/cms/source/ihost/configure.in 2003/03/03 12:32:35 1.9 @@ -1,33 +1,63 @@ -dnl configure.in for i-scream ihost -dnl $Id: configure.in,v 1.5 2002/05/31 09:42:42 tdb Exp $ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +# +# configure.in for i-scream ihost +# $Id: configure.in,v 1.9 2003/03/03 12:32:35 tdb Exp $ +# -dnl Change these to change the package name and version -AC_INIT(ihost.c) -AM_INIT_AUTOMAKE(ihost, 1.0rc1) +# Change these to change the package name and version +AC_INIT(ihost, 1.5, dev@i-scream.org.uk) +AM_INIT_AUTOMAKE(ihost, 1.5) -dnl The file we use to pass #define's to the source -AM_CONFIG_HEADER([config.h]) +# Revision number (automatically updated) +AC_REVISION($Revision: 1.9 $) -dnl We need a CC, install, and ranlib +# Might work with older autoconfs... but tested on 2.57 +AC_PREREQ(2.57) + +# The file we use to pass #define's to the source +AM_CONFIG_HEADER(config.h) + +# Checks for programs AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB -dnl And we probably need the standard C bits +# User specified libstatgrab prefix +AC_ARG_WITH([libstatgrab-prefix], + [ --with-libstatgrab-prefix=PATH libstatgrab is in PATH], + [ + if test -d "$withval/lib"; then + LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" + fi + if test -d "$withval/include"; then + CPPFLAGS="-I${withval}/include ${CPPFLAGS}" + fi + ] +) + +# Checks for header files AC_HEADER_STDC +AC_CHECK_HEADERS(statgrab.h,,[AC_MSG_ERROR([need statgrab.h])]) -dnl The program needs to know whether it can use getloadavg -AC_FUNC_GETLOADAVG +# Checks for typedefs, structures, and compiler characteristics +AC_C_CONST -dnl Figure out details about the host - we need the OS +# Checks for library functions +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_FUNC_FORK +AC_CHECK_LIB(statgrab, get_general_stats,,[AC_MSG_ERROR([need libstatgrab])]) + +# Figure out details about the host - we need the OS AC_CANONICAL_HOST -dnl Default needing setgid kmem to false -AM_CONDITIONAL([SETGIDKMEM], [false]) +# Default needing setgid kmem to false +AM_CONDITIONAL(SETGIDKMEM, false) -dnl Set things up for different OS's -dnl We define the name of the OS so the code can act accordingly -dnl We also need to add the right LDFLAGS +# 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 case $host_os in solaris2.*) AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) @@ -36,31 +66,30 @@ solaris2.*) freebsd4.*) AC_DEFINE(FREEBSD, , [Building on FreeBSD 4.x]) LDFLAGS="$LDFLAGS -lkvm" - dnl FreeBSD needs ihost to be setgid kmem - AM_CONDITIONAL([SETGIDKMEM], [true]) + # FreeBSD needs ihost to be setgid kmem + AM_CONDITIONAL(SETGIDKMEM, true) ;; linux-gnu) - AC_DEFINE(LINUX, , [Building on GNU/Lunix]) + AC_DEFINE(LINUX, , [Building on GNU/Linux]) ;; *) - AC_MSG_ERROR([Cannot build on unknown OS: $build_os]) + AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) ;; esac -dnl Check for the --with-pid-file option -dnl define accordingly for the code, and subst for the scripts -AC_ARG_WITH([pid-file], AC_HELP_STRING([--with-pid-file=FILE],[location of PID file (default: /var/tmp/.ihost.pid)]), [pidfile=$withval], [pidfile=[/var/tmp/.ihost.pid]]) +# Check for the --with-pid-file option +AC_ARG_WITH([pid-file], [ --with-pid-file=FILE location of PID file (default: /var/tmp/.ihost.pid)], [pidfile=$withval], [pidfile=[/var/tmp/.ihost.pid]]) AC_DEFINE_UNQUOTED([PID_FILE], ["$pidfile"], [Location of PID file]) -AC_SUBST([pidfile], [$pidfile]) -dnl Check for the --with-max-udp-size option -dnl define accordingly for the code -AC_ARG_WITH([max-udp-size], AC_HELP_STRING([--with-max-udp-size=SIZE],[maximum size of UDP packets in kilobytes (default: 8192kb)]), [max_udp_size=$withval], [max_udp_size=[8192]]) -AC_DEFINE_UNQUOTED([UDP_MAX_PACKET_SIZE], [$max_udp_size], [Maximum size of UDP packets in kilobytes]) +# Check for the --with-max-udp-size option +AC_ARG_WITH([max-udp-size], [ --with-max-udp-size=KB maximum size of UDP packets in kilobytes (default: 8192kb)], [max_udp_size=$withval], [max_udp_size=[8192]]) +AC_DEFINE_UNQUOTED([MAX_UDP_PACKET_SIZE], [$max_udp_size], [Maximum size of UDP packets in kilobytes]) -dnl Finally the files we'll want to change -AC_CONFIG_FILES([Makefile libstatgrab/Makefile libukcprog/Makefile]) -AC_CONFIG_FILES([ihostchk.sh], [chmod ugo+x ihostchk.sh]) +# Check for the --with-log-file option +AC_ARG_WITH([log-file], [ --with-log-file=FILE location of log file (default: /var/log/ihost.log)], [logfile=$withval], [logfile=[/var/log/ihost.log]]) +AC_DEFINE_UNQUOTED([LOG_FILE], ["$logfile"], [Location of log file]) -dnl And finish :) +# And finish by changing these files +AC_CONFIG_FILES([Makefile libukcprog/Makefile]) + AC_OUTPUT