--- projects/cms/source/ihost/configure.in 2002/05/29 23:03:53 1.2 +++ projects/cms/source/ihost/configure.in 2003/02/03 16:33:29 1.8 @@ -1,29 +1,33 @@ -AC_INIT(ihost.c) +dnl configure.in for i-scream ihost +dnl $Id: configure.in,v 1.8 2003/02/03 16:33:29 tdb Exp $ + +dnl Change these to change the package name and version +AC_INIT(ihost, 1.0rc1, dev@i-scream.org.uk) AM_INIT_AUTOMAKE(ihost, 1.0rc1) -dnl AC_CONFIG_SRCDIR([ihost.c]) -AM_CONFIG_HEADER([config.h]) +dnl The file we use to pass #define's to the source +AM_CONFIG_HEADER(config.h) + +dnl We need a CC, install, and ranlib AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB -dnl AC_HEADER_DIRENT +dnl And we probably need the standard C bits AC_HEADER_STDC -dnl AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h memory.h mntent.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/mount.h sys/param.h sys/socket.h sys/statvfs.h sys/time.h sys/vfs.h syslog.h unistd.h utmp.h]) -dnl AC_C_CONST -dnl AC_TYPE_UID_T -dnl AC_TYPE_PID_T -dnl AC_TYPE_SIZE_T -dnl AC_HEADER_TIME +dnl The program needs to know whether it can use getloadavg +AC_CHECK_FUNCS(getloadavg) -dnl AC_FUNC_FORK -AC_FUNC_GETLOADAVG -dnl AC_FUNC_MALLOC -dnl AC_CHECK_FUNCS([gethostbyname getmntent getmntinfo getpagesize inet_ntoa memmove memset socket strchr strdup strncasecmp strrchr strtol uname]) - +dnl Figure out details about the host - we need the OS AC_CANONICAL_HOST +dnl 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 case $host_os in solaris2.*) AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) @@ -32,21 +36,27 @@ 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) ;; 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 -AC_ARG_WITH([pid-file], AC_HELP_STRING([--with-pid-file=FILE],[location of PID file (default: /var/tmp/.ihost.pid)]), [pid_file=$withval], [pid_file=[/var/tmp/.ihost.pid]]) -AC_DEFINE_UNQUOTED([PID_FILE], ["$pid_file"], [Location of PID file]) +dnl Check for the --with-pid-file option +dnl define accordingly for the code, and subst for the scripts +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]) -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]]) +dnl Check for the --with-max-udp-size option +dnl define accordingly for the code +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([UDP_MAX_PACKET_SIZE], [$max_udp_size], [Maximum size of UDP packets in kilobytes]) -AC_CONFIG_FILES([Makefile libstatgrab/Makefile libukcprog/Makefile]) - -AC_OUTPUT +dnl And finish by changing these files +AC_OUTPUT([Makefile libstatgrab/Makefile libukcprog/Makefile ihostchk.sh], [chmod ugo+x ihostchk.sh])