From e7d9ddaed12fc87356c720b26677b4ebd46434eb Mon Sep 17 00:00:00 2001
From: rayg <rayg@145b5396-d1c6-4523-8c67-3646d8218c8b>
Date: Tue, 9 Jun 2015 18:35:37 +0000
Subject: [PATCH] make SZIP and HDF4 optional and autodetect

git-svn-id: https://svn.ssec.wisc.edu/repos/shellb3/trunk@842 145b5396-d1c6-4523-8c67-3646d8218c8b
---
 ShellB3/shallbethree.sh | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/ShellB3/shallbethree.sh b/ShellB3/shallbethree.sh
index 819cd960..76a79aa0 100755
--- a/ShellB3/shallbethree.sh
+++ b/ShellB3/shallbethree.sh
@@ -495,13 +495,14 @@ mk_szip() {
 
 mk_hdf5() {
   _find_cots HDF5 include/hdf5.h $BASE $COTS_HOME && return 0
-  _find_cots SZLIB include/szlib.h $BASE $COTS_HOME /usr || oops "HDF5 requires szip"
+  _find_cots SZLIB include/szlib.h $BASE $COTS_HOME /usr || echo "WARING: HDF5 is building without szip"
   _find_cots ZLIB include/zlib.h $BASE $COTS_HOME /usr || oops "HDF5 requires zlib"
   echo unpacking hdf5...
   tar jxf src/hdf5-${HDF5VER}.tar.bz2 -C build || oops "could not unpack hdf5 from src/"
   echo building hdf5 for $BASE
+  test -n "$SZLIB" && SZOPTS="--with-szlib=$SZLIB" || SZOPTS=""
   (cd build/hdf5-${HDF5VER} \
-   && ./configure --prefix=$BASE --enable-shared --with-pic --with-zlib=$ZLIB --with-pthread --with-szlib=$SZLIB\
+   && ./configure --prefix=$BASE --enable-shared --with-pic --with-zlib=$ZLIB --with-pthread $SZOPTS \
    && make \
    && make install ) \
    || oops "hdf5 build failed"
@@ -693,7 +694,7 @@ SOSAYWEALL
 mk_netcdf4() {
   _find_cots ZLIB include/zlib.h $BASE $COTS_HOME /usr || oops "netcdf4 needs ZLIB"
   _find_cots JPEG include/jpeglib.h $BASE $COTS_HOME /usr || oops "netcdf4 needs JPEG"
-  _find_cots SZLIB include/szlib.h $BASE $COTS_HOME /usr || oops "netcdf4 needs SZIP"
+  _find_cots SZLIB include/szlib.h $BASE $COTS_HOME /usr || echo "WARNING: netcdf4 building without SZIP"
   _find_cots HDF5 include/hdf5.h $BASE $COTS_HOME || oops "netcdf4 requires hdf5-18"
   _find_cots HDF4 include/hdf.h $BASE $COTS_HOME || echo "WARNING: netcdf4 will not include hdf4 support"
   _find_cots ZLIB include/zlib.h $BASE $COTS_HOME /usr || oops "netcdf4 requires zlib"
@@ -714,9 +715,9 @@ mk_netcdf4() {
 mk_netcdf4cxx() {
   _find_cots ZLIB include/zlib.h $BASE $COTS_HOME /usr || oops "netcdf4cxx needs ZLIB"
   _find_cots JPEG include/jpeglib.h $BASE $COTS_HOME /usr || oops "netcdf4cxx needs JPEG"
-  _find_cots SZLIB include/szlib.h $BASE $COTS_HOME /usr || oops "netcdf4cxx needs SZIP"
+  _find_cots SZLIB include/szlib.h $BASE $COTS_HOME /usr || echo "WARNING: netcdf4cxx building without SZIP"
   _find_cots HDF5 include/hdf5.h $BASE $COTS_HOME || oops "netcdf4cxx requires hdf5-18"
-  _find_cots HDF4 include/hdf.h $BASE $COTS_HOME || oops "netcdf4cxx requires hdf4"
+  _find_cots HDF4 include/hdf.h $BASE $COTS_HOME || echo "WARNING: netcdf4cxx will build without HDF4"
   _find_cots NETCDF4 include/netcdf.h $BASE $COTS_HOME || oops "netcdf4cxx requires netcdf4"
   _find_cots ZLIB include/zlib.h $BASE $COTS_HOME /usr || oops "netcdf4cxx requires zlib"
   echo "unpacking netcdf4cxx..."
@@ -735,9 +736,9 @@ mk_netcdf4cxx() {
 mk_netcdf4fortran() {
   _find_cots ZLIB include/zlib.h $BASE $COTS_HOME /usr || oops "netcdf4fortran needs ZLIB"
   _find_cots JPEG include/jpeglib.h $BASE $COTS_HOME /usr || oops "netcdf4fortran needs JPEG"
-  _find_cots SZLIB include/szlib.h $BASE $COTS_HOME /usr || oops "netcdf4fortran needs SZIP"
+  _find_cots SZLIB include/szlib.h $BASE $COTS_HOME /usr || echo "WARNING: netcdf4fortran building without SZIP"
   _find_cots HDF5 include/hdf5.h $BASE $COTS_HOME || oops "netcdf4fortran requires hdf5-18"
-  _find_cots HDF4 include/hdf.h $BASE $COTS_HOME || oops "netcdf4fortran requires hdf4"
+  _find_cots HDF4 include/hdf.h $BASE $COTS_HOME || echo "WARNING: netcdf4fortran building without HDF4"
   _find_cots NETCDF4 include/netcdf.h $BASE $COTS_HOME || oops "netcdf4fortran requires netcdf4"
   _find_cots ZLIB include/zlib.h $BASE $COTS_HOME /usr || oops "netcdf4fortran requires zlib"
   echo "unpacking netcdf4fortran..."
-- 
GitLab