dnl Check for header, if found check for C library,
dnl if successful, HAVE_LIBNETCDF will be set
+ dnl As we cannot ask "x$HAVE_LIBNETCDF"!="x" we must
+ dnl introduce second variable NETCDF_HEADER_AND_LIB_FOUND
dnl
dnl if the C++ library is missing, the test will fail
- AC_CHECK_HEADER(netcdfcpp.h, AC_CHECK_LIB(netcdf, nc_open))
-
+ AC_CHECK_HEADER(netcdfcpp.h, AC_CHECK_LIB(netcdf, nc_open,
+ NETCDF_HEADER_AND_LIB_FOUND=1))
+
dnl If the C library was found, but not the C++ library
dnl abort configure with an error message
- if test "x$DEAL_II_NETCDF_DIR" != "x" ; then
- LIBS="-lnetcdf_c++ $LIBS"
+ if test "x$NETCDF_HEADER_AND_LIB_FOUND" == "x1" ; then
+ LIBS="-lnetcdf_c++ -lnetcdf $LIBS"
AC_LINK_IFELSE(
[ AC_LANG_PROGRAM([[#include <netcdfcpp.h>
]],
[[NcFile test("test")]])
- ],,
+ ],
+ AC_DEFINE(HAVE_LIBNETCDF),
AC_MSG_FAILURE([Your NetCDF installation is incomplete: C++ library missing]))
fi
])
#! /bin/sh
-# From configure.in Revision: 1.229 .
+# From configure.in Revision: 1.230 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for deal.II 5.3.pre.
#
fi
fi
- if test "${ac_cv_header_netcdfcpp_h+set}" = set; then
+ if test "${ac_cv_header_netcdfcpp_h+set}" = set; then
echo "$as_me:$LINENO: checking for netcdfcpp.h" >&5
echo $ECHO_N "checking for netcdfcpp.h... $ECHO_C" >&6
if test "${ac_cv_header_netcdfcpp_h+set}" = set; then
fi
if test $ac_cv_header_netcdfcpp_h = yes; then
-
-echo "$as_me:$LINENO: checking for nc_open in -lnetcdf" >&5
+ echo "$as_me:$LINENO: checking for nc_open in -lnetcdf" >&5
echo $ECHO_N "checking for nc_open in -lnetcdf... $ECHO_C" >&6
if test "${ac_cv_lib_netcdf_nc_open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
echo "$as_me:$LINENO: result: $ac_cv_lib_netcdf_nc_open" >&5
echo "${ECHO_T}$ac_cv_lib_netcdf_nc_open" >&6
if test $ac_cv_lib_netcdf_nc_open = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNETCDF 1
-_ACEOF
-
- LIBS="-lnetcdf $LIBS"
-
+ NETCDF_HEADER_AND_LIB_FOUND=1
fi
fi
- if test "x$DEAL_II_NETCDF_DIR" != "x" ; then
- LIBS="-lnetcdf_c++ $LIBS"
+ if test "x$NETCDF_HEADER_AND_LIB_FOUND" == "x1" ; then
+ LIBS="-lnetcdf_c++ -lnetcdf $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- :
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBNETCDF 1
+_ACEOF
+
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5