--- projects/cms/source/ihost/configure.in 2003/03/29 18:05:07 1.18 +++ projects/cms/source/ihost/configure.in 2005/09/24 13:30:40 1.34 @@ -2,15 +2,15 @@ # Process this file with autoconf to produce a configure script. # # configure.in for i-scream ihost -# $Id: configure.in,v 1.18 2003/03/29 18:05:07 tdb Exp $ +# $Id: configure.in,v 1.34 2005/09/24 13:30:40 tdb Exp $ # # Change these to change the package name and version -AC_INIT(ihost, 1.5.4, dev@i-scream.org.uk) -AM_INIT_AUTOMAKE(ihost, 1.5.4) +AC_INIT(ihost, 1.5.9, bugs@i-scream.org) +AM_INIT_AUTOMAKE(ihost, 1.5.9) # 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) @@ -21,7 +21,6 @@ AM_CONFIG_HEADER(config.h) # Checks for programs AC_PROG_CC AC_PROG_INSTALL -AC_PROG_RANLIB # User specified libstatgrab prefix AC_ARG_WITH([libstatgrab-prefix], @@ -74,27 +73,46 @@ AM_CONDITIONAL(SETGIDKMEM, false) # We also need to add the right LDFLAGS case $host_os in solaris2.*) + AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])],[-lnsl -lsocket]) AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) - LIBS="$LIBS -lnsl -lsocket -lkstat -Wl,-Bstatic -lstatgrab -lukcprog -Wl,-Bdynamic" + LIBS="$LIBS -lnsl -lsocket -lkstat -ldevinfo -lstatgrab -lukcprog" ;; -freebsd4.*) - AC_DEFINE(FREEBSD, , [Building on FreeBSD 4.x]) - LIBS="$LIBS -lkvm -lstatgrab -lukcprog -static" +freebsd*) + AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])]) + AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) + AC_DEFINE(FREEBSD, , [Building on FreeBSD]) + LIBS="$LIBS -lstatgrab -lkvm -ldevstat -lukcprog" # FreeBSD needs ihost to be setgid kmem AM_CONDITIONAL(SETGIDKMEM, true) ;; +netbsdelf*) + AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])]) + AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) + AC_DEFINE(NETBSD, , [Building on NetBSD]) + LIBS="$LIBS -lstatgrab -lkvm -lukcprog" + AM_CONDITIONAL(SETGIDKMEM, true) + ;; linux-gnu) + AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])]) AC_DEFINE(LINUX, , [Building on GNU/Linux]) - LIBS="$LIBS -lstatgrab -lukcprog -static" + LIBS="$LIBS -lstatgrab -lukcprog" ;; +cygwin) + AC_MSG_ERROR([libstatgrab doesn't fully support cygwin, yet]) + ;; +mingw32) + AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])]) + AC_DEFINE(MINGW, , [Building on MinGW]) + AC_DEFINE(WINVER, 0x0500, [Building for Windows 2000]) + LIBS="$LIBS -lstatgrab -lukcprog -lws2_32 -lpdh -lIphlpapi -lpsapi -lnetapi32" + ;; *) AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) ;; esac -# Library checks that need to be done after the OS specific stuff -AC_CHECK_LIB(statgrab, get_general_stats,[:],[AC_MSG_ERROR([need libstatgrab])]) -AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])],[$LIBUKCPROGLIBS]) +# Check for libstatgrab +AC_CHECK_LIB(statgrab, sg_get_host_info,[:],[AC_MSG_ERROR([need libstatgrab])]) # 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]]) @@ -107,6 +125,14 @@ AC_DEFINE_UNQUOTED([MAX_UDP_PACKET_SIZE], [$max_udp_si # 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]) + +# Check for the --with-server-name option +AC_ARG_WITH([server-name], [ --with-server-name=NAME default server name (default: i-scream)], [servername=$withval], [servername=[i-scream]]) +AC_DEFINE_UNQUOTED([DEF_SERVER_NAME], ["$servername"], [Default Server Name]) + +# Check for the --with-server-port option +AC_ARG_WITH([server-port], [ --with-server-port=PORT default server port (default: 4567)], [serverport=$withval], [serverport=[4567]]) +AC_DEFINE_UNQUOTED([DEF_SERVER_PORT], [$serverport], [Default Server Port]) # And finish by changing these files AC_CONFIG_FILES([Makefile])