#!/bin/sh ## ## Copyright by the Board of Trustees of the University of Illinois. ## All rights reserved. ## ## This file is part of HDF5. The full HDF5 copyright notice, including ## terms governing use, modification, and redistribution, is contained in ## the files COPYING and Copyright.html. COPYING can be found at the root ## of the source code distribution tree; Copyright.html can be found at the ## root level of an installed copy of the electronic HDF5 document set and ## is linked from the top-level documents page. It can also be found at ## http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have ## access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. ## # Build HDF5 library by doing configure, make, and tests. # Usage: See USAGE() # Programmer: Albert Cheng # Creation date: Jul 9, 2003 # Some handy definitions USAGE() { cat <> "$resultfile" 2>&1 if [ $? -ne 0 ]; then echo "error in '$banner'. buildhdf5 aborted." exit 1 fi } # Try locate the SZLIB. # This is a hack because there is no consistent szlib pathname. LOCATE_SZLIB() { OS=`uname -s` echo OS=$OS case "$OS" in HP-UX) szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/HPUX-11.00" ;; IRIX) szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/IRIX64-6.5-32bit" ;; IRIX64) case "$CC" in *-n32) szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/IRIX64-6.5-32bit" ;; *) szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/IRIX64-6.5" ;; esac ;; Linux) case `uname -m` in i686) szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/Linux2.4" ;; *) # Don't know. Give a shot at standard places. szlibpaths="/usr/ncsa /usr/sdt" ;; esac ;; SunOS) szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/SunOS_5.8" ;; *) # Don't know. Give a shot at standard places. szlibpaths="/usr/ncsa /usr/sdt" ;; esac echo szlibpaths=$szlibpaths for x in $szlibpaths dummy; do if [ $x != dummy -a -f $x/include/szlib.h -a -f $x/lib/libsz.a ]; then WITH_SZLIB="--with-szlib=$x" break fi done echo WITH_SZLIB="$WITH_SZLIB" } # Configure. Default to do --srcdir. CONFIG() { CMD="$SRCDIR/configure $*" echo $CMD if [ "$NOEXEC" != 'noexec' ]; then $CMD else true # set exit code as 0 fi } # Main body TIMESTAMP trap QUIT 0 # # setup # MAKE=${MAKE:-'gmake'} export MAKE CONFIGURE="CONFIG" CONFIG_OP= # configure options CONFIG_ONLY=no # default is configure and build NOEXEC= # default to execute commands SRCDIRLIST=". ../hdf5" # places to look for configure nerror=0 # parse some options while [ $# -gt 0 ]; do case "$1" in -config) # do configure only CONFIG_ONLY=yes ;; -help) USAGE exit 0 ;; -n) NOEXEC='noexec' ;; -srcdir) shift SRCDIRLIST="$1" ;; -szlib) LOCATE_SZLIB ;; *) # Quit parsing break ;; esac shift done # Figure out if srcdir is wished. # Make sure we are at the library root level # by checking couple typical files. Not bullet-proof. for SRCDIR in $SRCDIRLIST dummy; do if [ x-$SRCDIR = x-dummy ]; then break fi if [ -d $SRCDIR/src -a -d $SRCDIR/config -a -f $SRCDIR/configure ] then break fi done if [ x-$SRCDIR = x-dummy ]; then echo "Could not find the source dir or configure script. Abort." exit 1 fi # Setup Configure options CONFIG_OP="$WITH_SZLIB" # Configure # no configure if already done. if [ ! -f config.status ]; then CONFIGURE="$CONFIGURE $CONFIG_OP $*" STEP "Configure HDF5..." "$CONFIGURE" "#config" else STEP "Confiugre Skipped" "echo Confiugre Skipped" "#config" fi if [ x-$CONFIG_ONLY = x-yes ]; then exit 0 fi # Compile STEP "Make HDF5..." "$MAKE" "#make" # Serial tests STEP "Testing HDF5 serial parts..." "$MAKE check-s" "#test-s" # Parallel tests STEP "Testing HDF5 parallel parts..." "$MAKE check-p" "#test-p" # all done echo "No Errors encountered" TIMESTAMP