diff --git a/gdal/configure b/gdal/configure index 6bb09ade908c..0edea880fe3e 100755 --- a/gdal/configure +++ b/gdal/configure @@ -27373,7 +27373,8 @@ if test "$NETCDF_SETTING" != "no" ; then for ac_header in $NETCDF_INCLUDEDIR/netcdf_mem.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <$NETCDF_INCLUDEDIR/netcdf.h> +" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 diff --git a/gdal/configure.ac b/gdal/configure.ac index 383a6b7f9a11..b6e035d8017c 100644 --- a/gdal/configure.ac +++ b/gdal/configure.ac @@ -2673,7 +2673,7 @@ AC_SUBST([NETCDF_SETTING], [$NETCDF_SETTING]) if test "$NETCDF_SETTING" != "no" ; then - AC_CHECK_HEADERS([$NETCDF_INCLUDEDIR/netcdf_mem.h], [NETCDF_MEM=yes], [NETCDF_MEM=no],) + AC_CHECK_HEADERS([$NETCDF_INCLUDEDIR/netcdf_mem.h], [NETCDF_MEM=yes], [NETCDF_MEM=no], [#include <$NETCDF_INCLUDEDIR/netcdf.h>]) AC_SUBST([NETCDF_MEM], [$NETCDF_MEM]) AC_SUBST([NETCDF_ROOT], [$NETCDF_ROOT])