| 1 | < | AC_INIT(ihost.c) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2 | < | AM_INIT_AUTOMAKE(ihost, 1.0rc1) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 3 | < | dnl AC_CONFIG_SRCDIR([ihost.c]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 4 | < | AM_CONFIG_HEADER([config.h]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1 | > | #                                               -*- Autoconf -*- | 
 
 
 
 
 | 2 | > | # Process this file with autoconf to produce a configure script. | 
 
 
 
 
 | 3 | > | # | 
 
 
 
 
 | 4 | > | # configure.in for i-scream ihost | 
 
 
 
 
 | 5 | > | # $Id$ | 
 
 
 
 
 | 6 | > | # | 
 
 
 
 
 
 
 
 
 
 
 | 7 |  |  | 
 
 
 
 
 
 
 
 | 8 | + | # Change these to change the package name and version | 
 
 
 
 
 
 
 
 | 9 | + | AC_INIT(ihost, 1.6, dev@i-scream.org.uk) | 
 
 
 
 
 
 
 
 | 10 | + | AM_INIT_AUTOMAKE(ihost, 1.6) | 
 
 
 
 
 
 
 
 | 11 | + |  | 
 
 
 
 
 
 
 
 | 12 | + | # Revision number (automatically updated) | 
 
 
 
 
 
 
 
 | 13 | + | AC_REVISION($Revision$) | 
 
 
 
 
 
 
 
 | 14 | + |  | 
 
 
 
 
 
 
 
 | 15 | + | # Might work with older autoconfs... but tested on 2.57 | 
 
 
 
 
 
 
 
 | 16 | + | AC_PREREQ(2.57) | 
 
 
 
 
 
 
 
 | 17 | + |  | 
 
 
 
 
 
 
 
 | 18 | + | # The file we use to pass #define's to the source | 
 
 
 
 
 
 
 
 | 19 | + | AM_CONFIG_HEADER(config.h) | 
 
 
 
 
 
 
 
 | 20 | + |  | 
 
 
 
 
 
 
 
 | 21 | + | # Checks for programs | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 22 |  | AC_PROG_CC | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 23 |  | AC_PROG_INSTALL | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 24 |  | AC_PROG_RANLIB | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 25 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 26 | < | dnl AC_HEADER_DIRENT | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 26 | > | # User specified libstatgrab prefix | 
 
 
 
 
 | 27 | > | AC_ARG_WITH([libstatgrab-prefix], | 
 
 
 
 
 | 28 | > | [  --with-libstatgrab-prefix=PATH        libstatgrab is in PATH], | 
 
 
 
 
 | 29 | > | [ | 
 
 
 
 
 | 30 | > | if test -d "$withval/lib"; then | 
 
 
 
 
 | 31 | > | LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" | 
 
 
 
 
 | 32 | > | fi | 
 
 
 
 
 | 33 | > | if test -d "$withval/include"; then | 
 
 
 
 
 | 34 | > | CPPFLAGS="-I${withval}/include ${CPPFLAGS}" | 
 
 
 
 
 | 35 | > | fi | 
 
 
 
 
 | 36 | > | ] | 
 
 
 
 
 | 37 | > | ) | 
 
 
 
 
 | 38 | > |  | 
 
 
 
 
 | 39 | > | # Checks for header files | 
 
 
 
 
 
 
 
 
 
 
 | 40 |  | AC_HEADER_STDC | 
 
 
 
 
 
 
 
 
 
 
 | 41 | < | 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]) | 
 
 
 
 
 
 
 
 
 | 41 | > | AC_CHECK_HEADERS(statgrab.h,,[AC_MSG_ERROR([need statgrab.h])]) | 
 
 
 
 
 
 
 
 
 
 
 | 42 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 43 | < | dnl AC_C_CONST | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 44 | < | dnl AC_TYPE_UID_T | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 16 | < | dnl AC_TYPE_PID_T | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 17 | < | dnl AC_TYPE_SIZE_T | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 18 | < | dnl AC_HEADER_TIME | 
 
 
 
 
 
 
 
 
 | 43 | > | # Checks for typedefs, structures, and compiler characteristics | 
 
 
 
 
 | 44 | > | AC_C_CONST | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 45 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 46 | < | dnl AC_FUNC_FORK | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 47 | < | AC_FUNC_GETLOADAVG | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 48 | < | dnl AC_FUNC_MALLOC | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 49 | < | dnl AC_CHECK_FUNCS([gethostbyname getmntent getmntinfo getpagesize inet_ntoa memmove memset socket strchr strdup strncasecmp strrchr strtol uname]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 46 | > | # Checks for library functions | 
 
 
 
 
 | 47 | > | AC_FUNC_MALLOC | 
 
 
 
 
 | 48 | > | AC_FUNC_REALLOC | 
 
 
 
 
 | 49 | > | AC_FUNC_FORK | 
 
 
 
 
 | 50 | > | AC_CHECK_LIB(statgrab, get_general_stats,[LIBS="-Wl,-Bstatic -lstatgrab -Wl,-Bdynamic $LIBS"],[AC_MSG_ERROR([need libstatgrab])]) | 
 
 
 
 
 
 
 
 
 
 
 | 51 |  |  | 
 
 
 
 
 
 
 
 | 52 | + | # Figure out details about the host - we need the OS | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 53 |  | AC_CANONICAL_HOST | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 54 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 55 | < | AM_CONDITIONAL([SETGIDKMEM], [false]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 55 | > | # Default needing setgid kmem to false | 
 
 
 
 
 | 56 | > | AM_CONDITIONAL(SETGIDKMEM, false) | 
 
 
 
 
 
 
 
 
 
 
 | 57 |  |  | 
 
 
 
 
 
 
 
 | 58 | + | # Set things up for different OS's | 
 
 
 
 
 
 
 
 | 59 | + | # We define the name of the OS so the code can act accordingly | 
 
 
 
 
 
 
 
 | 60 | + | # We also need to add the right LDFLAGS | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 61 |  | case $host_os in | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 62 |  | solaris2.*) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 63 |  | AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) | 
 
 
 
 
 
 
 
 
 
 
 | 64 | < | LDFLAGS="$LDFLAGS -lnsl -lsocket -lkstat" | 
 
 
 
 
 
 
 
 
 | 64 | > | LIBS="$LIBS -lnsl -lsocket -lkstat" | 
 
 
 
 
 
 
 
 
 
 
 | 65 |  | ;; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 66 |  | freebsd4.*) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 67 |  | AC_DEFINE(FREEBSD, , [Building on FreeBSD 4.x]) | 
 
 
 
 
 
 
 
 
 
 
 | 68 | < | LDFLAGS="$LDFLAGS -lkvm" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 69 | < | AM_CONDITIONAL([SETGIDKMEM], [true]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 68 | > | LIBS="$LIBS -lkvm" | 
 
 
 
 
 | 69 | > | # FreeBSD needs ihost to be setgid kmem | 
 
 
 
 
 | 70 | > | AM_CONDITIONAL(SETGIDKMEM, true) | 
 
 
 
 
 
 
 
 
 
 
 | 71 |  | ;; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 72 |  | linux-gnu) | 
 
 
 
 
 
 
 
 
 
 
 | 73 | < | AC_DEFINE(LINUX, , [Building on GNU/Lunix]) | 
 
 
 
 
 
 
 
 
 | 73 | > | AC_DEFINE(LINUX, , [Building on GNU/Linux]) | 
 
 
 
 
 
 
 
 
 
 
 | 74 |  | ;; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 75 |  | *) | 
 
 
 
 
 
 
 
 
 
 
 | 76 | < | AC_MSG_ERROR([Cannot build on unknown OS: $build_os]) | 
 
 
 
 
 
 
 
 
 | 76 | > | AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) | 
 
 
 
 
 
 
 
 
 
 
 | 77 |  | ;; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 78 |  | esac | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 79 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 80 | < | 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]]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 80 | > | # Check for the --with-pid-file option | 
 
 
 
 
 | 81 | > | 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]]) | 
 
 
 
 
 
 
 
 
 
 
 | 82 |  | AC_DEFINE_UNQUOTED([PID_FILE], ["$pidfile"], [Location of PID file]) | 
 
 
 
 
 
 
 
 
 | 49 | – | AC_SUBST([pidfile], [$pidfile]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 83 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 84 | < | 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]]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 85 | < | AC_DEFINE_UNQUOTED([UDP_MAX_PACKET_SIZE], [$max_udp_size], [Maximum size of UDP packets in kilobytes]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 84 | > | # Check for the --with-max-udp-size option | 
 
 
 
 
 | 85 | > | 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]]) | 
 
 
 
 
 | 86 | > | AC_DEFINE_UNQUOTED([MAX_UDP_PACKET_SIZE], [$max_udp_size], [Maximum size of UDP packets in kilobytes]) | 
 
 
 
 
 
 
 
 
 
 
 | 87 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 88 | < | AC_CONFIG_FILES([Makefile libstatgrab/Makefile libukcprog/Makefile]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 89 | < | AC_CONFIG_FILES([ihostchk.sh], [chmod ugo+x ihostchk.sh]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 88 | > | # Check for the --with-log-file option | 
 
 
 
 
 | 89 | > | 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]]) | 
 
 
 
 
 | 90 | > | AC_DEFINE_UNQUOTED([LOG_FILE], ["$logfile"], [Location of log file]) | 
 
 
 
 
 | 91 | > |  | 
 
 
 
 
 | 92 | > | # And finish by changing these files | 
 
 
 
 
 | 93 | > | AC_CONFIG_FILES([Makefile libukcprog/Makefile]) | 
 
 
 
 
 
 
 
 
 
 
 | 94 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 95 |  | AC_OUTPUT |