]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add -lnetcdf to make it link. Introduce new variable NETCDF_HEADER_AND_LIB_FOUND
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Thu, 30 Mar 2006 09:51:51 +0000 (09:51 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Thu, 30 Mar 2006 09:51:51 +0000 (09:51 +0000)
git-svn-id: https://svn.dealii.org/trunk@12766 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure

index 1fb802ee032f5451feb3667e76b606f383b2083d..cb7b48390e261ad61c2d196128d1772a487f73aa 100644 (file)
@@ -4769,19 +4769,23 @@ AC_DEFUN(DEAL_II_CONFIGURE_NETCDF, dnl
   
   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
 ])
index 8256144f01a8bc178062a261303f07d10ecd8645..5b7ee540b6d9773f0edf7ed45184bdd8310c593c 100755 (executable)
@@ -1,5 +1,5 @@
 #! /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.
 #
@@ -11052,7 +11052,7 @@ fi;
     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
@@ -11190,8 +11190,7 @@ echo "${ECHO_T}$ac_cv_header_netcdfcpp_h" >&6
 
 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
@@ -11309,7 +11303,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.