Index: configure
--- configure.orig
+++ configure
@@ -2274,7 +2274,7 @@ if test x$HAS_NC_CONFIG = xno; then
 	echo "where you should replace /home/joe/bin etc. with the location where you have"
 	echo "installed the nc-config script that came with the netcdf 4 distribution."
 	echo "-----------------------------------------------------------------------------------"
-	exit -1
+	exit 1
 fi
 NETCDF_CC=`$NC_CONFIG_FULLQUAL --cc`
 NETCDF_LDFLAGS=`$NC_CONFIG_FULLQUAL --libs`
@@ -2308,7 +2308,7 @@ if test $NETCDF_V4 = "no"; then
 	echo "the full version of netcdf-4 with HDF-5 support, then please install"
 	echo "ncview version 1.93g instead."
 	echo "-------------------------------------------------------------------"
-	exit -1
+	exit 1
 fi
 
 #------------------------------------------------------------------------
@@ -4269,7 +4269,7 @@ if test "x$no_x" == "xyes"; then
 	echo "                              ^^^^^^^^^^              ^^^^^^^^^^^^^^^^ these are what"
 	echo "you want to set to reflect the location of files such as libX11.so and X.h on your"
 	echo "particular system."
-	exit -1
+	exit 1
 fi
 if test "$no_x" = yes; then
   # Not all programs may use this symbol, but it does not hurt to define it.
@@ -5074,7 +5074,7 @@ fi
 		echo "You must specify a directory that has ALL the udunits-2 include files"
 		echo "(converter.h as well as udunits2.h)."
 		echo "--------------------------------------------------------------------------------"
-		exit -1
+		exit 1
 	fi
         as_ac_Header=`$as_echo "ac_cv_header_$UDUNITS2_INCDIR/udunits2.h" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$UDUNITS2_INCDIR/udunits2.h" "$as_ac_Header" "$ac_includes_default"
@@ -5088,7 +5088,7 @@ fi
 fi
 if test $err -eq 1; then
         echo "Error: user specified udunits2 include directory does not have udunits2.h!"
-        exit -1
+        exit 1
 fi
 if test x$UDUNITS2_INCDIR = x; then
         ac_fn_c_check_header_mongrel "$LINENO" "udunits2.h" "ac_cv_header_udunits2_h" "$ac_includes_default"
@@ -5190,7 +5190,7 @@ fi
 fi
 if test $err -eq 1; then
         echo "Error: user specified udunits2 library directory does not have $UDUNITS2_LIBNAME !"
-        exit -1
+        exit 1
 fi
 if test x$NETCDF_LIBDIR = x; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_read_xml in -ludunits2" >&5
@@ -5419,7 +5419,7 @@ fi
 
 	if test x"$haveExpat"x != "xyesx"; then
 	  as_fn_error $? "Could not find the expat library despite the fact that the udunits2 library is installed.  This probably means some sort of configuration file error. Please consult with the package maintainer." "$LINENO" 5
-	  exit -1
+	  exit 1
 	fi
 	EXPAT_LIBS=$LIBS
 	echo "Expat libraries (needed by udunits2): $EXPAT_LIBS"
@@ -5494,12 +5494,12 @@ fi
 		echo "but that directory does NOT have required png include file png.h."
 		echo "You must specify a directory that has the png include files"
 		echo "--------------------------------------------------------------------------------"
-		exit -1
+		exit 1
 	fi
 fi
 if test $err -eq 1; then
         echo "Error: user specified png include directory does not have png.h!"
-        exit -1
+        exit 1
 fi
 if test x$PNG_INCDIR = x; then
         ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default"
@@ -5585,7 +5586,7 @@ fi
 fi
 if test $err -eq 1; then
         echo "Error: user specified png library directory does not have $PNG_LIBNAME !"
-        exit -1
+        exit 1
 fi
 if test x$PNG_LIBDIR = x; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_write_png in -lpng" >&5
@@ -5849,7 +5850,7 @@ if test x$CC_TEST_SAME != x$NETCDF_CC_TEST_SAME; then
 	echo "To do this, set environmental variable CC to $NETCDF_CC"
 	echo "and run ./configure again"
 	echo "==================================================================="
-	exit -1
+	exit 1
 fi
 
 #----------------------------------------------------------------------------------
@@ -5870,8 +5871,7 @@ if test x$ac_compiler_gnu = xyes; then
 	RPATH_FLAGS=""
 	for word in $UDUNITS2_LDFLAGS $NETCDF_LDFLAGS; do
 		if test `expr $word : -L/` -eq 3; then
-			#RPDIR=`expr substr $word 3 999`;
-			RPDIR=${word:2}
+			RPDIR=`expr substr $word 3 999`;
 			RPATH_FLAGS="$RPATH_FLAGS -Wl,-rpath,$RPDIR"
 		fi
 	done
