disable HDF4 if netCDF-4 is not enabled
@@ -207,6 +207,9 @@ AC_MSG_CHECKING([whether reading of HDF4 SD files is to be enabled])
AC_ARG_ENABLE([hdf4], [AS_HELP_STRING([--enable-hdf4],
[build netcdf-4 with HDF4 read capability (HDF4, HDF5 and zlib required)])])
test "x$enable_hdf4" = xyes || enable_hdf4=no
+if test "x$enable_hdf4" = xyes -a "x$enable_netcdf_4" = xno; then
+ AC_MSG_ERROR([NetCDF-4 is required for HDF4 features])
+fi
AC_MSG_RESULT($enable_hdf4)
# Does the user want to turn on extra HDF4 file tests?
