--- projects/cms/source/conient/configure 2001/01/24 03:03:13 1.1 +++ projects/cms/source/conient/configure 2005/04/16 15:08:00 1.15 @@ -1,33 +1,81 @@ #!/bin/sh -HTTPSERVER="http://killigrew.ukc.ac.uk/" +# +# i-scream Distributed Centralised Monitoring System +# Conient configure script +# +# $Id: configure,v 1.15 2005/04/16 15:08:00 tdb Exp $ +# -echo "Generating Makefile includes" -echo "SOURCEROOT="`pwd` > Config.inc -echo "include \$(SOURCEROOT)/Config2.inc" >> Config.inc +## Config -echo "Checking for required libraries" -cd build/lib +# HTTP Server. This is the source of all downloads. +HTTPSERVER="http://www.i-scream.org/pub/i-scream/cms/lib/" -if test -r "jaxp.jar"; then \ - echo " jaxp.jar found"; \ -else \ - echo " jaxp.jar not found, fetching from ${HTTPSERVER}jaxp.jar"; \ - wget -nv ${HTTPSERVER}jaxp.jar; \ +# This script uses wget, set it's path and parameters here +WGETPARAM="-nv" +if test -x /usr/bin/wget; then + WGET="/usr/bin/wget ${WGETPARAM}" +else + if test -x /usr/local/bin/wget; then + WGET="/usr/local/bin/wget ${WGETPARAM}" + else + WGET="wget ${WGETPARAM}"; + fi fi -if test -r "parser.jar"; then \ - echo " parser.jar found"; \ +# This should always be the same +SRCROOT=`pwd` + +## Library check + +echo "> Checking for required libraries" +cd build/lib + +LIBRARIES="crimson.jar jaxp.jar iscream_util.jar" + +for LIB in ${LIBRARIES}; do + + if test -r "${LIB}"; then \ + echo " + ${LIB} found"; \ + else \ + echo " - ${LIB} not found, fetching from ${HTTPSERVER}${LIB}"; \ + ${WGET} -nv ${HTTPSERVER}${LIB}; \ + fi + +done + +## Cache javadoc API package-list files +echo "> Caching remote API's" + +JDKURL="http://java.sun.com/j2se/1.4.2/docs/api/" +mkdir -p ${SRCROOT}/.api-cache/jdk +cd ${SRCROOT}/.api-cache/jdk +if test -r "package-list"; then \ + echo " + jdk/package-list found"; \ else \ - echo " parser.jar not found, fetching from ${HTTPSERVER}parser.jar"; \ - wget -nv ${HTTPSERVER}parser.jar; \ + echo " - jdk/package-list not found, fetching from ${JDKURL}package-list"; \ + ${WGET} ${JDKURL}package-list; \ fi -if test -r "iscream-util.jar"; then \ - echo " iscream-util.jar found"; \ +UTILURL="http://www.i-scream.org/cms/javadoc/util/" +mkdir -p ${SRCROOT}/.api-cache/util +cd ${SRCROOT}/.api-cache/util +if test -r "package-list"; then \ + echo " + util/package-list found"; \ else \ - echo " iscream-util.jar not found, fetching from ${HTTPSERVER}iscream-util.jar"; \ - wget -nv ${HTTPSERVER}iscream-util.jar; \ + echo " - util/package-list not found, fetching from ${UTILURL}package-list"; \ + ${WGET} ${UTILURL}package-list; \ fi -echo "Configure Completed" +## Write out the include file for the Makefile's + +echo "> Generating Makefile includes" +echo " + writing root of source tree" +echo "SOURCEROOT=${SRCROOT}" > ${SRCROOT}/Config.inc +echo " + writing include" +echo "include \$(SOURCEROOT)/Config2.inc" >> ${SRCROOT}/Config.inc + +echo "> Configure Completed" + +## End