Index: jhdf-2.9/native/hdf5lib/Makefile.in
===================================================================
--- jhdf-2.9.orig/native/hdf5lib/Makefile.in
+++ jhdf-2.9/native/hdf5lib/Makefile.in
@@ -35,7 +35,8 @@ COPT=@COPT@
 
 CFLAGS = -D_FILE_OFFSET_BITS=64 $(DEFS) -I. -I$(HDF5INC) -I$(JAVAINC1) -I$(JAVAINC2)
 
-LIBS =  $(HDF5LIB)/libhdf5.$(LLEXT) $(ZLIB) $(SZLIB) -lm
+#LIBS =  $(HDF5LIB)/libhdf5.$(LLEXT) $(ZLIB) $(SZLIB) -lm
+LIBS =  $(HDF5LIB) $(ZLIB) $(SZLIB) -lm
 
 # Macro def: object filename used
 OBJECTS =  exceptionImp.o h5Constants.o h5Imp.o h5aImp.o h5dImp.o h5eImp.o h5fImp.o h5gImp.o h5iImp.o h5lImp.o h5oImp.o h5pImp.o h5rImp.o h5sImp.o h5tImp.o nativeData.o h5util.o h5zImp.o
Index: jhdf-2.9/native/hdflib/Makefile.in
===================================================================
--- jhdf-2.9.orig/native/hdflib/Makefile.in
+++ jhdf-2.9/native/hdflib/Makefile.in
@@ -41,7 +41,8 @@ COPT=@COPT@
 CFLAGS = $(DEFS) -I. -I$(JAVAINC1) -I$(JAVAINC2) -I$(HDFINC)
 
 # Be sure to add -lbsd if compiling in a SYSV environment
-LIBS =  $(HDFLIB)/libmfhdf.$(LLEXT) $(HDFLIB)/libdf.$(LLEXT) $(SZLIB) $(ZLIB) $(JPEGLIB) -lm
+#LIBS =  $(HDFLIB)/libmfhdf.$(LLEXT) $(HDFLIB)/libdf.$(LLEXT) $(SZLIB) $(ZLIB) $(JPEGLIB) -lm
+LIBS =  -lmfhdf -ldf $(SZLIB) $(ZLIB) $(JPEGLIB) -lm
 
 # Macro def: object filename used
 OBJECTS =  hdfstructsutil.o \
Index: jhdf-2.9/configure.in
===================================================================
--- jhdf-2.9.orig/configure.in
+++ jhdf-2.9/configure.in
@@ -165,26 +165,7 @@ withval="";
 AC_SUBST(ZLIB) ZLIB=""
 AC_ARG_WITH(libz,[  --with-libz=LIB     Path to the gzip library (required if not in default path)],,)
 
-case "$withval" in
-  yes)
-      ZLIB=""
-  HAVE_ZLIB="no"
-    ;;
-  no)
-      ZLIB=""
-  HAVE_ZLIB="suppressed"
-    ;;
-  *)
-    if test -n "$withval" ; then
-        z_lib="`echo $withval |cut -f2 -d, -s`"
-  ZLIB=$z_lib"/libz."$LLEXT
-  HAVE_ZLIB="yes"
-    else
-      ZLIB=""
-  HAVE_ZLIB="no"
-    fi
-;;
-esac
+ZLIB=" -lz " 
 if test -n "$ZLIB"; then
   LIBS="$LIBS $ZLIB"
   HAVE_ZLIB="yes"
@@ -200,25 +181,7 @@ withval="";
 AC_SUBST(JPEGLIB) JPEGLIB=""
 AC_ARG_WITH(libjpeg,[  --with-libjpeg=LIB     Path to the jpeg library (required if not in default path)],,)
 
-case "$withval" in
-  yes)
-  HAVE_JPEG="no"
-    ;;
-  no)
-      JPEGLIB=""
-  HAVE_JPEG="suppressed"
-    ;;
-  *)
-    if test -n "$withval" ; then
-        jpeg_lib="`echo $withval |cut -f2 -d, -s`"
-  JPEGLIB=$jpeg_lib"/libjpeg."$LLEXT
-      dnl AC_MSG_RESULT([jpeg found: $JPEGLIB]);
-  HAVE_JPEG="yes"
-    else
-  HAVE_JPEG="no"
-    fi
-;;
-esac
+JPEGLIB=" -ljpeg"
 if test -n "$JPEGLIB"; then
   LIBS="$LIBS $JPEGLIB"
   HAVE_JPEG="yes"
@@ -274,33 +237,10 @@ withval="";
 AC_SUBST(HDF4LIB) HDF4LIB=""
 AC_ARG_WITH(hdf4,[  --with-hdf4=LIB     Path to the hdf library (required if not in default path)],,)
 
-case "$withval" in
-  yes)
-    dnl AC_MSG_ERROR(HDF4 library needed for compilation.)
-      HDF4LIB=""
-  HAVE_HDF4="no"
-    ;;
-  no)
-      HDF4LIB=""
-  HAVE_HDF4="suppressed"
-    ;;
-  *)
-  if test -n "$withval" ; then
-      hdf4_inc="`echo $withval |cut -f1 -d,`"
-      if test -n "$hdf4_inc"; then
-        HDF4INC="$hdf4_inc"
-      fi
-      hdf4_lib="`echo $withval |cut -f2 -d, -s`"
-      if test -n "$hdf4_lib"; then
-    HDF4LIB=$hdf4_lib
-      fi
-      HAVE_HDF4="yes"
-  else
-        HDF4LIB=""
-      HAVE_HDF4="no"
-  fi
-  ;;
-esac
+HDF4LIB=" -lmfhdf -ldf "
+LIBS=" -lmfhdf -ldf $LIBS"
+HDF4INC="/usr/include/hdf/"
+HAVE_HDF4="yes"
 if test -n "$HDF4LIB"; then
   LIBS="$HDF4LIB/libdf.$LLEXT $HDF4LIB/libmfhdf.$LLEXT $LIBS"
   HAVE_HDF4="yes"
@@ -370,7 +310,7 @@ case "$withval" in
       fi
       hdf5_lib="`echo $withval |cut -f2 -d, -s`"
       if test -n "$hdf5_lib"; then
-    HDF5LIB=$hdf5_lib
+    HDF5LIB="-L$hdf5_lib -lhdf5"
       fi
       HAVE_HDF5="yes"
   else
@@ -379,10 +319,6 @@ case "$withval" in
   fi
   ;;
 esac
-if test -n "$HDF5LIB"; then
-  LIBS="$HDF5LIB/libhdf5.$LLEXT $LIBS"
-  HAVE_HDF5="yes"
-fi
 AC_MSG_RESULT([$HAVE_HDF5])
 if test $HAVE_HDF5 = "yes"; then
       AC_MSG_RESULT([HDF5 found: $HDF5LIB]);
@@ -395,8 +331,8 @@ dnl  Must stop here if something is miss
 dnl
 if test -n "$HDF5LIB"; then
   AC_MSG_CHECKING([dependencies for HDF5 library])
-  DFL=`grep 'filters (external)' $HDF5LIB"/libhdf5.settings" | grep deflate`
-  SZP=`grep 'filters (external)' $HDF5LIB"/libhdf5.settings" | grep szip`
+  DFL=`grep 'filters (external)' $hdf5_lib"/libhdf5.settings" | grep deflate`
+  SZP=`grep 'filters (external)' $hdf5_lib"/libhdf5.settings" | grep szip`
   if test -n "$DFL";
   then
     if test "$HAVE_ZLIB" != "yes"; then
