From 790b7984a2b634714fcb9d9c079dc00df2b6fdaf Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 9 Feb 2011 17:25:38 +0000 Subject: [PATCH] Do not only check for presence of the libz.so file, but also for zlib.h. git-svn-id: https://svn.dealii.org/trunk@23320 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 21 ++++++++---- deal.II/configure | 66 +++++++++----------------------------- deal.II/doc/news/changes.h | 8 +++++ 3 files changed, 38 insertions(+), 57 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 6de3a6029b..fdf51b7784 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -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 + AC_CHECK_HEADER(zlib.h, + [ + DEAL_II_ADD_EXTERNAL_LIBS_AT_FRONT(-l$zlib) + AC_DEFINE(HAVE_LIBZ) + ]) + ]) ]) diff --git a/deal.II/configure b/deal.II/configure index f08bb558f6..c55f440cc0 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -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. # @@ -11352,15 +11352,20 @@ fi # 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 diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index f52355a0ee..1095f11c0c 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -78,6 +78,14 @@ should be fixed now.

Specific improvements

    +
  1. Fixed: There are systems where the libz library is installed +but the zlib.h header file is not available. Since the latter +condition was not tested, this would result in compiler errors. This is now +fixed. +
    +(Wolfgang Bangerth, 2011/02/09) +
  2. +
  3. Fixed: Prolongation and restriction matrices were not computed at all for elements of type FE_DGQ if dim@. Consequently, consumers of this information, such as the SolutionTransfer class or -- 2.39.5