Commit 0abe11bd authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

config: cleanup NetCDF

parent 59fe6d9b
......@@ -1517,7 +1517,7 @@ Optional Packages:
--with-hdf5=<yes|no|directory> (default=no)
location of HDF5 library
--with-netcdf=<yes|no|directory> (default=no)
location of netCDF library (lib and include subdirs)
location of NetCDF library (lib and include subdirs)
--with-cmor=<directory> Specify location of CMOR library.
--with-grib_api=<yes|no|directory> (default=no)
location of GRIB_API library (lib and include
......@@ -18825,8 +18825,8 @@ ENABLE_NC4HDF5=no
if test "${with_netcdf+set}" = set; then :
withval=$with_netcdf; case "$with_netcdf" in #(
no) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for netCDF library" >&5
$as_echo_n "checking for netCDF library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF library" >&5
$as_echo_n "checking for NetCDF library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; } ;; #(
yes) :
......@@ -18900,11 +18900,10 @@ $as_echo "#define HAVE_LIBNETCDF 1" >>confdefs.h
 
ENABLE_NETCDF=yes
else
as_fn_error $? "Could not link to netCDF library" "$LINENO" 5
as_fn_error $? "Could not link to NetCDF library" "$LINENO" 5
fi
 
NETCDF_LIBS=" -lnetcdf"
# Extract the first word of "nc-config", so it can be a program name with args.
set dummy nc-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
......@@ -19060,12 +19059,11 @@ $as_echo "#define HAVE_LIBNETCDF 1" >>confdefs.h
 
ENABLE_NETCDF=yes
else
as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
as_fn_error $? "Could not link to NetCDF library" "$LINENO" 5
fi
 
NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking nc-config script" >&5
$as_echo_n "checking nc-config script... " >&6; }
# Extract the first word of "nc-config", so it can be a program name with args.
......@@ -19162,15 +19160,15 @@ else
$as_echo "Could not find nc-config! go on with default configuration" >&6; }
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: $with_netcdf is not a directory! NETCDF suppressed" >&5
$as_echo "$as_me: $with_netcdf is not a directory! NETCDF suppressed" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: $with_netcdf is not a directory! NetCDF suppressed" >&5
$as_echo "$as_me: $with_netcdf is not a directory! NetCDF suppressed" >&6;}
fi ;; #(
*) :
;;
esac
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NETCDF library" >&5
$as_echo_n "checking for NETCDF library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF library" >&5
$as_echo_n "checking for NetCDF library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; }
fi
......
......@@ -119,33 +119,32 @@ ENABLE_NC2=no
ENABLE_NC4=no
ENABLE_NC4HDF5=no
AC_ARG_WITH([netcdf],
[AS_HELP_STRING([--with-netcdf=<yes|no|directory> (default=no)],[location of netCDF library (lib and include subdirs)])],
[AS_HELP_STRING([--with-netcdf=<yes|no|directory> (default=no)],[location of NetCDF library (lib and include subdirs)])],
[AS_CASE(["$with_netcdf"],
[no],[AC_MSG_CHECKING([for netCDF library])
[no],[AC_MSG_CHECKING([for NetCDF library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([netcdf.h])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for netCDF support])
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NetCDF support])
ENABLE_NETCDF=yes],
[AC_MSG_ERROR([Could not link to netCDF library])])
[AC_MSG_ERROR([Could not link to NetCDF library])])
NETCDF_LIBS=" -lnetcdf"
AC_CHECK_PROG(NC_CONFIG,nc-config,nc-config)
AS_IF([test "x$NC_CONFIG" != "x"],
[AC_MSG_CHECKING([netcdf's nc2 support])
AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for netCDF2 support])
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NetCDF2 support])
ENABLE_NC2=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4 support])
AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NETCDF4 support])
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NetCDF4 support])
ENABLE_NC4=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4/hdf5 support])
AS_IF([test "x$($NC_CONFIG --has-hdf5)" = "xyes"],
[AC_DEFINE([HAVE_NC4HDF5],[1],[Define to 1 for NETCDF4/HDF5 support])
[AC_DEFINE([HAVE_NC4HDF5],[1],[Define to 1 for NetCDF4/HDF5 support])
ENABLE_NC4HDF5=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])]) ],
[AS_ECHO([Could not find nc-config! go on with default configuration])])],
......@@ -156,42 +155,41 @@ AC_ARG_WITH([netcdf],
AC_CHECK_HEADERS([netcdf.h])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NetCDF support])
ENABLE_NETCDF=yes],
[AC_MSG_ERROR([Could not link to netcdf library])])
[AC_MSG_ERROR([Could not link to NetCDF library])])
NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
AC_MSG_CHECKING([nc-config script])
AC_CHECK_PROG(NC_CONFIG,nc-config,[$NETCDF_ROOT/bin/nc-config],,["$NETCDF_ROOT/bin"])
AS_IF([test "x$NC_CONFIG" != "x"],
[AC_MSG_CHECKING([netcdf's OpenDAP support])
AS_IF([test "x$($NC_CONFIG --has-dap)" = "xyes"],
[AC_DEFINE([HAVE_LIBNC_DAP],[1],[Define to 1 for NETCDF OpenDAP])
[AC_DEFINE([HAVE_LIBNC_DAP],[1],[Define to 1 for NetCDF OpenDAP])
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])]
[AC_MSG_CHECKING([netcdf's nc2 support])
AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NETCDF2 support])
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NetCDF2 support])
ENABLE_NC2=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4 support])
AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NETCDF4 support])
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NetCDF4 support])
ENABLE_NC4=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4/hdf5 support])
AS_IF([test "x$($NC_CONFIG --has-hdf5)" = "xyes"],
[AC_DEFINE([HAVE_NC4HDF5],[1],[Define to 1 for NETCDF4/HDF5 support])
[AC_DEFINE([HAVE_NC4HDF5],[1],[Define to 1 for NetCDF4/HDF5 support])
ENABLE_NC4HDF5=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])]) ],
[AC_MSG_RESULT([Could not find nc-config! go on with default configuration])])],
[AC_MSG_NOTICE([$with_netcdf is not a directory! NETCDF suppressed])])])],
[AC_MSG_CHECKING([for NETCDF library])
[AC_MSG_NOTICE([$with_netcdf is not a directory! NetCDF suppressed])])])],
[AC_MSG_CHECKING([for NetCDF library])
AC_MSG_RESULT([suppressed])])
AS_IF([test "x$ENABLE_NC4HDF5" = "xyes"],
[AC_SEARCH_LIBS([H5TS_mutex_lock], [netcdf],
[AC_DEFINE([HAVE_NC4HDF5_THREADSAFE],[1],[Define to 1 for NETCDF4/HDF5 threadsafe support])],,
[AC_DEFINE([HAVE_NC4HDF5_THREADSAFE],[1],[Define to 1 for NetCDF4/HDF5 threadsafe support])],,
[-lhdf5_hl -lhdf5])])
AC_SUBST([ENABLE_NETCDF])
......
......@@ -103,10 +103,10 @@
/* Define to 1 if you have the `malloc' library (-lmalloc). */
#undef HAVE_LIBMALLOC
/* Define to 1 for NETCDF OpenDAP */
/* Define to 1 for NetCDF OpenDAP */
#undef HAVE_LIBNC_DAP
/* Define to 1 for NETCDF support */
/* Define to 1 for NetCDF support */
#undef HAVE_LIBNETCDF
/* Define to 1 for PROJ support */
......@@ -148,16 +148,16 @@
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 for NETCDF4/HDF5 support */
/* Define to 1 for NetCDF4/HDF5 support */
#undef HAVE_NC4HDF5
/* Define to 1 for NETCDF4/HDF5 threadsafe support */
/* Define to 1 for NetCDF4/HDF5 threadsafe support */
#undef HAVE_NC4HDF5_THREADSAFE
/* Define to 1 for NETCDF2 support */
/* Define to 1 for NetCDF2 support */
#undef HAVE_NETCDF2
/* Define to 1 for NETCDF4 support */
/* Define to 1 for NetCDF4 support */
#undef HAVE_NETCDF4
/* Define to 1 if you have the <netcdf.h> header file. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment