]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do not only check for presence of the libz.so file, but also for zlib.h.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 9 Feb 2011 17:25:38 +0000 (17:25 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 9 Feb 2011 17:25:38 +0000 (17:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@23320 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure
deal.II/doc/news/changes.h

index 6de3a6029bf84dbf01928f3b3a461224c7520d01..fdf51b778409a4607167d7e1dd4fcca36ff8dafc 100644 (file)
@@ -7141,16 +7141,23 @@ dnl Include the libz library
 dnl --------------------------------------------------
 AC_DEFUN(DEAL_II_WITH_ZLIB, dnl
 [
-  dnl -- We should check for zlib.h, but I could not make AC_CHECK_HEADERS run (GK)
   if test "x$1" != "xyes" ; then
-    AC_CHECK_LIB($1, crc32,
-    [ DEAL_II_ADD_EXTERNAL_LIBS_AT_FRONT(-l$1)
-      AC_DEFINE(HAVE_LIBZ)
-    ])
-dnl    fi
+    zlib=$1
   else
-    AC_CHECK_LIB(z, crc32)
+    zlib=z
   fi
+
+  dnl See if we can find the function crc32 in libz.so
+  AC_CHECK_LIB($zlib, crc32,
+    [
+      dnl Yes, we can. Now also check whether we can do
+      dnl #include <zlib.h>
+      AC_CHECK_HEADER(zlib.h,
+        [
+          DEAL_II_ADD_EXTERNAL_LIBS_AT_FRONT(-l$zlib)
+          AC_DEFINE(HAVE_LIBZ)
+        ])
+    ])
 ])
 
 
index f08bb558f685e71f0a59ff9808ad1c6979da0478..c55f440cc02e77def481ea173f97c232ff6b5c74 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 23238 .
+# From configure.in Revision: 23258 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.65 for deal.II 7.1.pre.
 #
 # Check whether --with-zlib was given.
 if test "${with_zlib+set}" = set; then :
   withval=$with_zlib;
-    if test "x$withval" != "xyes" ; then
-    as_ac_Lib=`$as_echo "ac_cv_lib_$withval''_crc32" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for crc32 in -l$withval" >&5
-$as_echo_n "checking for crc32 in -l$withval... " >&6; }
+  if test "x$withval" != "xyes" ; then
+    zlib=$withval
+  else
+    zlib=z
+  fi
+
+    as_ac_Lib=`$as_echo "ac_cv_lib_$zlib''_crc32" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for crc32 in -l$zlib" >&5
+$as_echo_n "checking for crc32 in -l$zlib... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-l$withval  $LIBS"
+LIBS="-l$zlib  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -11394,60 +11399,21 @@ $as_echo "$ac_res" >&6; }
 eval as_val=\$$as_ac_Lib
    if test "x$as_val" = x""yes; then :
 
-  LIBS="-l$withval $LIBS"
+                  ac_fn_cxx_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = x""yes; then :
 
-      $as_echo "#define HAVE_LIBZ 1" >>confdefs.h
 
+  LIBS="-l$zlib $LIBS"
 
-fi
+          $as_echo "#define HAVE_LIBZ 1" >>confdefs.h
 
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crc32 in -lz" >&5
-$as_echo_n "checking for crc32 in -lz... " >&6; }
-if test "${ac_cv_lib_z_crc32+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char crc32 ();
-int
-main ()
-{
-return crc32 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_z_crc32=yes
-else
-  ac_cv_lib_z_crc32=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_crc32" >&5
-$as_echo "$ac_cv_lib_z_crc32" >&6; }
-if test "x$ac_cv_lib_z_crc32" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
 
-  LIBS="-lz $LIBS"
+
 
 fi
 
-  fi
 
 fi
 
index f52355a0ee3fc7b9d73d4db27b5ca3ceb3dbce3e..1095f11c0ce4428fcca4783004eb260c47733a07 100644 (file)
@@ -78,6 +78,14 @@ should be fixed now.
 <h3>Specific improvements</h3>
 
 <ol>
+<li> Fixed: There are systems where the <code>libz</code> library is installed
+but the <code>zlib.h</code> header file is not available. Since the latter
+condition was not tested, this would result in compiler errors. This is now
+fixed.
+<br>
+(Wolfgang Bangerth, 2011/02/09)
+</li>
+
 <li> Fixed: Prolongation and restriction matrices were not computed at all
 for elements of type FE_DGQ if <code>dim@<spacedim</code>. Consequently,
 consumers of this information, such as the SolutionTransfer class or

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.